From bonefish at mail.berlios.de Thu Mar 1 02:16:16 2007 From: bonefish at mail.berlios.de (bonefish at BerliOS) Date: Thu, 1 Mar 2007 02:16:16 +0100 Subject: [Haiku-commits] r20258 - in haiku/trunk: headers/private/userlandfs/private src/add-ons/kernel/file_systems/userlandfs/kernel_add_on src/add-ons/kernel/file_systems/userlandfs/private src/add-ons/kernel/file_systems/userlandfs/server Message-ID: <200703010116.l211GGix024455@sheep.berlios.de> Author: bonefish Date: 2007-03-01 02:16:13 +0100 (Thu, 01 Mar 2007) New Revision: 20258 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20258&view=rev Modified: haiku/trunk/headers/private/userlandfs/private/Requests.h haiku/trunk/headers/private/userlandfs/private/userlandfs_ioctl.h haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/Volume.cpp haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/Volume.h haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/kernel_interface.cpp haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/private/Requests.cpp haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/BeOSKernelVolume.cpp haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/BeOSKernelVolume.h haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/UserlandRequestHandler.cpp haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/UserlandRequestHandler.h haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/Volume.cpp haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/Volume.h Log: Implemented the new attribute open/close/... FS hooks. The mapping to the old interface is completely done in userland ATM. It becomes more and more obvious that we probably need to provide the kernel add-on with a bit more information about what the client FS interface supports in the first place, so we can save unnecessary trips to the userland. Opening/closing attributes for a FS using the old style interface could be handled completely in the kernel add-on, for instance (even if we lose a bit of accuracy wrt to open modes etc.). Modified: haiku/trunk/headers/private/userlandfs/private/Requests.h =================================================================== --- haiku/trunk/headers/private/userlandfs/private/Requests.h 2007-02-28 22:26:44 UTC (rev 20257) +++ haiku/trunk/headers/private/userlandfs/private/Requests.h 2007-03-01 01:16:13 UTC (rev 20258) @@ -122,6 +122,14 @@ REWIND_ATTR_DIR_REPLY, // attributes + CREATE_ATTR_REQUEST, + CREATE_ATTR_REPLY, + OPEN_ATTR_REQUEST, + OPEN_ATTR_REPLY, + CLOSE_ATTR_REQUEST, + CLOSE_ATTR_REPLY, + FREE_ATTR_COOKIE_REQUEST, + FREE_ATTR_COOKIE_REPLY, READ_ATTR_REQUEST, READ_ATTR_REPLY, WRITE_ATTR_REQUEST, @@ -960,6 +968,67 @@ // #pragma mark - attributes +// CreateAttrRequest +class CreateAttrRequest : public NodeRequest { +public: + CreateAttrRequest() : NodeRequest(CREATE_ATTR_REQUEST) {} + status_t GetAddressInfos(AddressInfo* infos, int32* count); + + Address name; + uint32 type; + int openMode; +}; + +// CreateAttrReply +class CreateAttrReply : public ReplyRequest { +public: + CreateAttrReply() : ReplyRequest(CREATE_ATTR_REPLY) {} + + fs_cookie attrCookie; +}; + +// OpenAttrRequest +class OpenAttrRequest : public NodeRequest { +public: + OpenAttrRequest() : NodeRequest(OPEN_ATTR_REQUEST) {} + status_t GetAddressInfos(AddressInfo* infos, int32* count); + + Address name; + int openMode; +}; + +// OpenAttrReply +class OpenAttrReply : public ReplyRequest { +public: + OpenAttrReply() : ReplyRequest(OPEN_ATTR_REPLY) {} + + fs_cookie attrCookie; +}; + +// CloseAttrRequest +class CloseAttrRequest : public AttributeRequest { +public: + CloseAttrRequest() : AttributeRequest(CLOSE_ATTR_REQUEST) {} +}; + +// CloseAttrReply +class CloseAttrReply : public ReplyRequest { +public: + CloseAttrReply() : ReplyRequest(CLOSE_ATTR_REPLY) {} +}; + +// FreeAttrCookieRequest +class FreeAttrCookieRequest : public AttributeRequest { +public: + FreeAttrCookieRequest() : AttributeRequest(FREE_ATTR_COOKIE_REQUEST) {} +}; + +// FreeAttrCookieReply +class FreeAttrCookieReply : public ReplyRequest { +public: + FreeAttrCookieReply() : ReplyRequest(FREE_ATTR_COOKIE_REPLY) {} +}; + // ReadAttrRequest class ReadAttrRequest : public AttributeRequest { public: @@ -1605,6 +1674,22 @@ case REWIND_ATTR_DIR_REPLY: return task((RewindAttrDirReply*)request); // attributes + case CREATE_ATTR_REQUEST: + return task((CreateAttrRequest*)request); + case CREATE_ATTR_REPLY: + return task((CreateAttrReply*)request); + case OPEN_ATTR_REQUEST: + return task((OpenAttrRequest*)request); + case OPEN_ATTR_REPLY: + return task((OpenAttrReply*)request); + case CLOSE_ATTR_REQUEST: + return task((CloseAttrRequest*)request); + case CLOSE_ATTR_REPLY: + return task((CloseAttrReply*)request); + case FREE_ATTR_COOKIE_REQUEST: + return task((FreeAttrCookieRequest*)request); + case FREE_ATTR_COOKIE_REPLY: + return task((FreeAttrCookieReply*)request); case READ_ATTR_REQUEST: return task((ReadAttrRequest*)request); case READ_ATTR_REPLY: @@ -1834,6 +1919,14 @@ using UserlandFSUtil::RewindAttrDirRequest; using UserlandFSUtil::RewindAttrDirReply; // attributes +using UserlandFSUtil::CreateAttrRequest; +using UserlandFSUtil::CreateAttrReply; +using UserlandFSUtil::OpenAttrRequest; +using UserlandFSUtil::OpenAttrReply; +using UserlandFSUtil::CloseAttrRequest; +using UserlandFSUtil::CloseAttrReply; +using UserlandFSUtil::FreeAttrCookieRequest; +using UserlandFSUtil::FreeAttrCookieReply; using UserlandFSUtil::ReadAttrRequest; using UserlandFSUtil::ReadAttrReply; using UserlandFSUtil::WriteAttrRequest; Modified: haiku/trunk/headers/private/userlandfs/private/userlandfs_ioctl.h =================================================================== --- haiku/trunk/headers/private/userlandfs/private/userlandfs_ioctl.h 2007-02-28 22:26:44 UTC (rev 20257) +++ haiku/trunk/headers/private/userlandfs/private/userlandfs_ioctl.h 2007-03-01 01:16:13 UTC (rev 20258) @@ -32,6 +32,7 @@ USERLAND_IOCTL_OPEN_FILES, USERLAND_IOCTL_OPEN_DIRECTORIES, USERLAND_IOCTL_OPEN_ATTRIBUTE_DIRECTORIES, + USERLAND_IOCTL_OPEN_ATTRIBUTES, USERLAND_IOCTL_OPEN_INDEX_DIRECTORIES, USERLAND_IOCTL_OPEN_QUERIES, }; Modified: haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/Volume.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/Volume.cpp 2007-02-28 22:26:44 UTC (rev 20257) +++ haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/Volume.cpp 2007-03-01 01:16:13 UTC (rev 20258) @@ -74,6 +74,7 @@ fOpenFiles(0), fOpenDirectories(0), fOpenAttributeDirectories(0), + fOpenAttributes(0), fOpenIndexDirectories(0), fOpenQueries(0), fVNodeCountMap(NULL), @@ -1097,6 +1098,7 @@ if (!port) return B_ERROR; PortReleaser _(fFileSystem->GetPortPool(), port); + AutoIncrementer incrementer(&fOpenFiles); // prepare the request RequestAllocator allocator(port->GetPort()); @@ -1124,6 +1126,7 @@ // process the reply if (reply->error != B_OK) return reply->error; + incrementer.Keep(); *vnid = reply->vnid; *cookie = reply->fileCookie; // The VFS will balance the new_vnode() call for the FS. @@ -1197,6 +1200,7 @@ error = B_OK; disconnected = true; } + int32 openFiles = atomic_add(&fOpenFiles, -1); if (openFiles <= 1 && disconnected) _PutAllPendingVNodes(); @@ -1710,7 +1714,127 @@ // #pragma mark - attributes +// CreateAttr +status_t +Volume::CreateAttr(fs_vnode node, const char* name, uint32 type, int openMode, + fs_cookie* cookie) +{ + // get a free port + RequestPort* port = fFileSystem->GetPortPool()->AcquirePort(); + if (!port) + return B_ERROR; + PortReleaser _(fFileSystem->GetPortPool(), port); + AutoIncrementer incrementer(&fOpenAttributes); + // prepare the request + RequestAllocator allocator(port->GetPort()); + CreateAttrRequest* request; + status_t error = AllocateRequest(allocator, &request); + if (error != B_OK) + return error; + + request->volume = fUserlandVolume; + request->node = node; + error = allocator.AllocateString(request->name, name); + request->type = type; + request->openMode = openMode; + if (error != B_OK) + return error; + + // send the request + KernelRequestHandler handler(this, CREATE_ATTR_REPLY); + CreateAttrReply* reply; + error = _SendRequest(port, &allocator, &handler, (Request**)&reply); + if (error != B_OK) + return error; + RequestReleaser requestReleaser(port, reply); + + // process the reply + if (reply->error != B_OK) + return reply->error; + incrementer.Keep(); + *cookie = reply->attrCookie; + return error; +} + +// OpenAttr +status_t +Volume::OpenAttr(fs_vnode node, const char* name, int openMode, + fs_cookie* cookie) +{ + // get a free port + RequestPort* port = fFileSystem->GetPortPool()->AcquirePort(); + if (!port) + return B_ERROR; + PortReleaser _(fFileSystem->GetPortPool(), port); + AutoIncrementer incrementer(&fOpenAttributes); + + // prepare the request + RequestAllocator allocator(port->GetPort()); + OpenAttrRequest* request; + status_t error = AllocateRequest(allocator, &request); + if (error != B_OK) + return error; + + request->volume = fUserlandVolume; + request->node = node; + error = allocator.AllocateString(request->name, name); + request->openMode = openMode; + if (error != B_OK) + return error; + + // send the request + KernelRequestHandler handler(this, OPEN_ATTR_REPLY); + OpenAttrReply* reply; + error = _SendRequest(port, &allocator, &handler, (Request**)&reply); + if (error != B_OK) + return error; + RequestReleaser requestReleaser(port, reply); + + // process the reply + if (reply->error != B_OK) + return reply->error; + incrementer.Keep(); + *cookie = reply->attrCookie; + return error; +} + +// CloseAttr +status_t +Volume::CloseAttr(fs_vnode node, fs_cookie cookie) +{ + status_t error = _CloseAttr(node, cookie); + if (error != B_OK && fFileSystem->GetPortPool()->IsDisconnected()) { + // This isn't really necessary, as the return value is irrelevant to + // the VFS. OBOS ignores it completely. The fsshell returns it to the + // userland, but considers the node closed anyway. + WARN(("Volume::CloseAttr(): connection lost, forcing close attr\n")); + return B_OK; + } + return error; +} + +// FreeAttrCookie +status_t +Volume::FreeAttrCookie(fs_vnode node, fs_cookie cookie) +{ + status_t error = _FreeAttrCookie(node, cookie); + bool disconnected = false; + if (error != B_OK && fFileSystem->GetPortPool()->IsDisconnected()) { + // This isn't really necessary, as the return value is irrelevant to + // the VFS. It's completely ignored by OBOS as well as by the fsshell. + WARN(("Volume::FreeAttrCookie(): connection lost, forcing free attr " + "cookie\n")); + error = B_OK; + disconnected = true; + } + + int32 openAttributes = atomic_add(&fOpenAttributes, -1); + if (openAttributes <= 1 && disconnected) + _PutAllPendingVNodes(); + return error; +} + // ReadAttr status_t Volume::ReadAttr(fs_vnode node, fs_cookie cookie, off_t pos, @@ -2708,6 +2832,76 @@ return error; } +// _CloseAttr +status_t +Volume::_CloseAttr(fs_vnode node, fs_cookie cookie) +{ + // get a free port + RequestPort* port = fFileSystem->GetPortPool()->AcquirePort(); + if (!port) + return B_ERROR; + PortReleaser _(fFileSystem->GetPortPool(), port); + + // prepare the request + RequestAllocator allocator(port->GetPort()); + CloseAttrRequest* request; + status_t error = AllocateRequest(allocator, &request); + if (error != B_OK) + return error; + + request->volume = fUserlandVolume; + request->node = node; + request->attrCookie = cookie; + + // send the request + KernelRequestHandler handler(this, CLOSE_ATTR_REPLY); + CloseAttrReply* reply; + error = _SendRequest(port, &allocator, &handler, (Request**)&reply); + if (error != B_OK) + return error; + RequestReleaser requestReleaser(port, reply); + + // process the reply + if (reply->error != B_OK) + return reply->error; + return error; +} + +// _FreeAttrCookie +status_t +Volume::_FreeAttrCookie(fs_vnode node, fs_cookie cookie) +{ + // get a free port + RequestPort* port = fFileSystem->GetPortPool()->AcquirePort(); + if (!port) + return B_ERROR; + PortReleaser _(fFileSystem->GetPortPool(), port); + + // prepare the request + RequestAllocator allocator(port->GetPort()); + FreeAttrCookieRequest* request; + status_t error = AllocateRequest(allocator, &request); + if (error != B_OK) + return error; + + request->volume = fUserlandVolume; + request->node = node; + request->attrCookie = cookie; + + // send the request + KernelRequestHandler handler(this, FREE_ATTR_COOKIE_REPLY); + FreeAttrCookieReply* reply; + error = _SendRequest(port, &allocator, &handler, (Request**)&reply); + if (error != B_OK) + return error; + RequestReleaser requestReleaser(port, reply); + + // process the reply + if (reply->error != B_OK) + return reply->error; + return error; +} + // _CloseIndexDir status_t Volume::_CloseIndexDir(fs_cookie cookie) @@ -2982,6 +3176,10 @@ PRINT(("Volume::_PutAllPendingVNodes() failed: open attr dirs\n")); return USERLAND_IOCTL_OPEN_ATTRIBUTE_DIRECTORIES; } + if (fOpenAttributes > 0) { + PRINT(("Volume::_PutAllPendingVNodes() failed: open attributes\n")); + return USERLAND_IOCTL_OPEN_ATTRIBUTES; + } if (fOpenIndexDirectories > 0) { PRINT(("Volume::_PutAllPendingVNodes() failed: open index dirs\n")); return USERLAND_IOCTL_OPEN_INDEX_DIRECTORIES; Modified: haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/Volume.h =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/Volume.h 2007-02-28 22:26:44 UTC (rev 20257) +++ haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/Volume.h 2007-03-01 01:16:13 UTC (rev 20258) @@ -125,6 +125,13 @@ status_t RewindAttrDir(fs_vnode node, fs_cookie cookie); // attributes + status_t CreateAttr(fs_vnode node, const char* name, + uint32 type, int openMode, + fs_cookie* cookie); + status_t OpenAttr(fs_vnode node, const char* name, + int openMode, fs_cookie* cookie); + status_t CloseAttr(fs_vnode node, fs_cookie cookie); + status_t FreeAttrCookie(fs_vnode node, fs_cookie cookie); status_t ReadAttr(fs_vnode node, fs_cookie cookie, off_t pos, void* buffer, size_t bufferSize, size_t* bytesRead); @@ -176,6 +183,9 @@ status_t _CloseAttrDir(fs_vnode node, fs_cookie cookie); status_t _FreeAttrDirCookie(fs_vnode node, fs_cookie cookie); + status_t _CloseAttr(fs_vnode node, fs_cookie cookie); + status_t _FreeAttrCookie(fs_vnode node, + fs_cookie cookie); status_t _CloseIndexDir(fs_cookie cookie); status_t _FreeIndexDirCookie(fs_cookie cookie); status_t _CloseQuery(fs_cookie cookie); @@ -208,6 +218,7 @@ vint32 fOpenFiles; vint32 fOpenDirectories; vint32 fOpenAttributeDirectories; + vint32 fOpenAttributes; vint32 fOpenIndexDirectories; vint32 fOpenQueries; VNodeCountMap* fVNodeCountMap; Modified: haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/kernel_interface.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/kernel_interface.cpp 2007-02-28 22:26:44 UTC (rev 20257) +++ haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/kernel_interface.cpp 2007-03-01 01:16:13 UTC (rev 20258) @@ -629,11 +629,54 @@ // #pragma mark - attributes -// TODO: create_attr() -// TODO: open_attr() -// TODO: close_attr() -// TODO: free_attr_cookie() +// userlandfs_create_attr +status_t +userlandfs_create_attr(fs_volume fs, fs_vnode node, const char *name, + uint32 type, int openMode, fs_cookie *cookie) +{ + Volume* volume = (Volume*)fs; + PRINT(("userlandfs_create_attr(%p, %p, \"%s\", 0x%lx, %d, %p)\n", fs, node, + name, type, openMode, cookie)); + status_t error = volume->CreateAttr(node, name, type, openMode, cookie); + PRINT(("userlandfs_create_attr() done: (%lx, %p)\n", error, *cookie)); + return error; +} +// userlandfs_open_attr +status_t +userlandfs_open_attr(fs_volume fs, fs_vnode node, const char *name, + int openMode, fs_cookie *cookie) +{ + Volume* volume = (Volume*)fs; + PRINT(("userlandfs_open_attr(%p, %p, \"%s\", %d, %p)\n", fs, node, name, + openMode, cookie)); + status_t error = volume->OpenAttr(node, name, openMode, cookie); + PRINT(("userlandfs_open_attr() done: (%lx, %p)\n", error, *cookie)); + return error; +} + +// userlandfs_close_attr +status_t +userlandfs_close_attr(fs_volume fs, fs_vnode node, fs_cookie cookie) +{ + Volume* volume = (Volume*)fs; + PRINT(("userlandfs_close_attr(%p, %p, %p)\n", fs, node, cookie)); + status_t error = volume->CloseAttr(node, cookie); + PRINT(("userlandfs_close_attr() done: %lx\n", error)); + return error; +} + +// userlandfs_free_attr_cookie +status_t +userlandfs_free_attr_cookie(fs_volume fs, fs_vnode node, fs_cookie cookie) +{ + Volume* volume = (Volume*)fs; + PRINT(("userlandfs_close_attr(%p, %p, %p)\n", fs, node, cookie)); + status_t error = volume->FreeAttrCookie(node, cookie); + PRINT(("userlandfs_close_attr() done: %lx\n", error)); + return error; +} + // userlandfs_read_attr static status_t userlandfs_read_attr(fs_volume fs, fs_vnode node, fs_cookie cookie, @@ -1016,10 +1059,10 @@ &userlandfs_rewind_attr_dir, /* attribute operations */ - NULL, // &userlandfs_create_attr, - NULL, // &userlandfs_open_attr, - NULL, // &userlandfs_close_attr, - NULL, // &userlandfs_free_attr_cookie, + &userlandfs_create_attr, + &userlandfs_open_attr, + &userlandfs_close_attr, + &userlandfs_free_attr_cookie, &userlandfs_read_attr, &userlandfs_write_attr, Modified: haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/private/Requests.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/private/Requests.cpp 2007-02-28 22:26:44 UTC (rev 20257) +++ haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/private/Requests.cpp 2007-03-01 01:16:13 UTC (rev 20258) @@ -175,6 +175,22 @@ return B_OK; } +// CreateAttrRequest +status_t +CreateAttrRequest::GetAddressInfos(AddressInfo* infos, int32* count) +{ + ADD_NON_NULL_STRING(name); + return B_OK; +} + +// OpenAttrRequest +status_t +OpenAttrRequest::GetAddressInfos(AddressInfo* infos, int32* count) +{ + ADD_NON_NULL_STRING(name); + return B_OK; +} + // ReadAttrReply status_t ReadAttrReply::GetAddressInfos(AddressInfo* infos, int32* count) @@ -563,12 +579,21 @@ case REWIND_ATTR_DIR_REPLY: return false; // attributes + case CREATE_ATTR_REQUEST: + case OPEN_ATTR_REQUEST: + case CLOSE_ATTR_REQUEST: + case FREE_ATTR_COOKIE_REQUEST: case READ_ATTR_REQUEST: case WRITE_ATTR_REQUEST: case READ_ATTR_STAT_REQUEST: case RENAME_ATTR_REQUEST: case REMOVE_ATTR_REQUEST: return true; + case CREATE_ATTR_REPLY: + case OPEN_ATTR_REPLY: + case CLOSE_ATTR_REPLY: + case FREE_ATTR_COOKIE_REPLY: + case READ_ATTR_REPLY: case WRITE_ATTR_REPLY: case READ_ATTR_STAT_REPLY: @@ -753,12 +778,20 @@ case REWIND_ATTR_DIR_REPLY: return true; // attributes + case CREATE_ATTR_REQUEST: + case OPEN_ATTR_REQUEST: + case CLOSE_ATTR_REQUEST: + case FREE_ATTR_COOKIE_REQUEST: case READ_ATTR_REQUEST: case WRITE_ATTR_REQUEST: case RENAME_ATTR_REQUEST: case READ_ATTR_STAT_REQUEST: case REMOVE_ATTR_REQUEST: return false; + case CREATE_ATTR_REPLY: + case OPEN_ATTR_REPLY: + case CLOSE_ATTR_REPLY: + case FREE_ATTR_COOKIE_REPLY: case READ_ATTR_REPLY: case WRITE_ATTR_REPLY: case READ_ATTR_STAT_REPLY: Modified: haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/BeOSKernelVolume.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/BeOSKernelVolume.cpp 2007-02-28 22:26:44 UTC (rev 20257) +++ haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/BeOSKernelVolume.cpp 2007-03-01 01:16:13 UTC (rev 20258) @@ -2,9 +2,41 @@ #include "BeOSKernelVolume.h" +#include + +#include +#include + #include "beos_fs_interface.h" #include "kernel_emu.h" + +using std::nothrow; + +static int open_mode_to_access(int openMode); + + +// AttributeCookie +class BeOSKernelVolume::AttributeCookie { +public: + AttributeCookie(const char* name, uint32 type, int openMode, bool exists, + bool create) + : fType(type), + fOpenMode(openMode), + fExists(exists), + fCreate(create) + { + strcpy(fName, name); + } + + char fName[B_ATTR_NAME_LENGTH]; + uint32 fType; + int fOpenMode; + bool fExists; + bool fCreate; +}; + + // constructor BeOSKernelVolume::BeOSKernelVolume(FileSystem* fileSystem, mount_id id, beos_vnode_ops* fsOps) @@ -503,43 +535,106 @@ // #pragma mark - attributes +// CreateAttr +status_t +BeOSKernelVolume::CreateAttr(fs_vnode node, const char* name, uint32 type, + int openMode, fs_cookie* cookie) +{ + return _OpenAttr(node, name, type, openMode, true, cookie); +} + +// OpenAttr +status_t +BeOSKernelVolume::OpenAttr(fs_vnode node, const char* name, int openMode, + fs_cookie* cookie) +{ + return _OpenAttr(node, name, 0, openMode, false, cookie); +} + +// CloseAttr +status_t +BeOSKernelVolume::CloseAttr(fs_vnode node, fs_cookie cookie) +{ + return B_OK; +} + +// FreeAttrCookie +status_t +BeOSKernelVolume::FreeAttrCookie(fs_vnode node, fs_cookie _cookie) +{ + AttributeCookie* cookie = (AttributeCookie*)_cookie; + + // If the attribute doesn't exist yet and it was opened with + // CreateAttr(), we could create it now. We have a race condition here + // though, since someone else could have created it in the meantime. + + delete cookie; + + return B_OK; +} + // ReadAttr status_t -BeOSKernelVolume::ReadAttr(fs_vnode node, fs_cookie cookie, off_t pos, +BeOSKernelVolume::ReadAttr(fs_vnode node, fs_cookie _cookie, off_t pos, void* buffer, size_t bufferSize, size_t* bytesRead) { -// TODO: Implement! -return B_BAD_VALUE; -// if (!fFSOps->read_attr) -// return B_BAD_VALUE; -// *bytesRead = bufferSize; -// return fFSOps->read_attr(fVolumeCookie, node, name, type, buffer, bytesRead, -// pos); + AttributeCookie* cookie = (AttributeCookie*)_cookie; + + // check, if open mode allows reading + if ((open_mode_to_access(cookie->fOpenMode) | R_OK) == 0) + return B_FILE_ERROR; + + // read + if (!fFSOps->read_attr) + return B_BAD_VALUE; + + *bytesRead = bufferSize; + return fFSOps->read_attr(fVolumeCookie, node, cookie->fName, cookie->fType, + buffer, bytesRead, pos); } // WriteAttr status_t -BeOSKernelVolume::WriteAttr(fs_vnode node, fs_cookie cookie, off_t pos, +BeOSKernelVolume::WriteAttr(fs_vnode node, fs_cookie _cookie, off_t pos, const void* buffer, size_t bufferSize, size_t* bytesWritten) { -// TODO: Implement! -return B_BAD_VALUE; -// if (!fFSOps->write_attr) -// return B_BAD_VALUE; -// *bytesWritten = bufferSize; -// return fFSOps->write_attr(fVolumeCookie, node, name, type, buffer, -// bytesWritten, pos); + AttributeCookie* cookie = (AttributeCookie*)_cookie; + + // check, if open mode allows writing + if ((open_mode_to_access(cookie->fOpenMode) | W_OK) == 0) + return B_FILE_ERROR; + + // write + if (!fFSOps->write_attr) + return B_BAD_VALUE; + + *bytesWritten = bufferSize; + return fFSOps->write_attr(fVolumeCookie, node, cookie->fName, cookie->fType, + buffer, bytesWritten, pos); } // ReadAttrStat status_t -BeOSKernelVolume::ReadAttrStat(fs_vnode node, fs_cookie cookie, struct stat *st) +BeOSKernelVolume::ReadAttrStat(fs_vnode node, fs_cookie _cookie, + struct stat *st) { -// TODO: Implement! -return B_BAD_VALUE; -// if (!fFSOps->stat_attr) -// return B_BAD_VALUE; -// return fFSOps->stat_attr(fVolumeCookie, node, name, attrInfo); + AttributeCookie* cookie = (AttributeCookie*)_cookie; + + // get the stats + beos_attr_info attrInfo; + if (!fFSOps->stat_attr) + return B_BAD_VALUE; + + status_t error = fFSOps->stat_attr(fVolumeCookie, node, cookie->fName, + &attrInfo); + if (error != B_OK) + return error; + + // translate to struct stat + st->st_size = attrInfo.size; + st->st_type = attrInfo.type; + + return B_OK; } // RenameAttr @@ -708,3 +803,65 @@ (struct beos_dirent*)buffer, bufferSize); } + +// #pragma mark - Private + + +// _OpenAttr +status_t +BeOSKernelVolume::_OpenAttr(fs_vnode node, const char* name, uint32 type, + int openMode, bool create, fs_cookie* _cookie) +{ + // check permissions first + int accessMode = open_mode_to_access(openMode) | (create ? W_OK : 0); + status_t error = Access(node, accessMode); + if (error != B_OK) + return error; + + // check whether the attribute already exists + beos_attr_info attrInfo; + if (!fFSOps->stat_attr) + return B_BAD_VALUE; + bool exists + = (fFSOps->stat_attr(fVolumeCookie, node, name, &attrInfo) == B_OK); + + if (create) { + // create: fail, if attribute exists and non-existence was required + if (exists && (openMode & O_EXCL)) + return B_FILE_EXISTS; + } else { + // open: fail, if attribute doesn't exist + if (!exists) + return B_ENTRY_NOT_FOUND; + + // keep the attribute type + type = attrInfo.type; + } + + // create an attribute cookie + AttributeCookie* cookie = new(nothrow) AttributeCookie(name, type, + openMode, exists, create); + if (!cookie) + return B_NO_MEMORY; + + // TODO: If we want to support O_TRUNC, we should do that here. + + *_cookie = cookie; + return B_OK; +} + +// open_mode_to_access +static int +open_mode_to_access(int openMode) +{ + switch (openMode & O_RWMASK) { + case O_RDONLY: + return R_OK; + case O_WRONLY: + return W_OK; + case O_RDWR: + default: + return W_OK | R_OK; + } +} + Modified: haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/BeOSKernelVolume.h =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/BeOSKernelVolume.h 2007-02-28 22:26:44 UTC (rev 20257) +++ haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/BeOSKernelVolume.h 2007-03-01 01:16:13 UTC (rev 20258) @@ -98,6 +98,13 @@ virtual status_t RewindAttrDir(fs_vnode node, fs_cookie cookie); // attributes + virtual status_t CreateAttr(fs_vnode node, const char *name, + uint32 type, int openMode, + fs_cookie *cookie); + virtual status_t OpenAttr(fs_vnode node, const char *name, + int openMode, fs_cookie *cookie); + virtual status_t CloseAttr(fs_vnode node, fs_cookie cookie); + virtual status_t FreeAttrCookie(fs_vnode node, fs_cookie cookie); virtual status_t ReadAttr(fs_vnode node, fs_cookie cookie, off_t pos, void* buffer, size_t bufferSize, size_t* bytesRead); @@ -136,6 +143,14 @@ uint32* countRead); private: + class AttributeCookie; + +private: + status_t _OpenAttr(fs_vnode node, const char* name, + uint32 type, int openMode, bool create, + fs_cookie* cookie); + +private: beos_vnode_ops* fFSOps; void* fVolumeCookie; }; Modified: haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/UserlandRequestHandler.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/UserlandRequestHandler.cpp 2007-02-28 22:26:44 UTC (rev 20257) +++ haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/UserlandRequestHandler.cpp 2007-03-01 01:16:13 UTC (rev 20258) @@ -138,6 +138,14 @@ return _HandleRequest((RewindAttrDirRequest*)request); // attributes + case CREATE_ATTR_REQUEST: + return _HandleRequest((CreateAttrRequest*)request); + case OPEN_ATTR_REQUEST: + return _HandleRequest((OpenAttrRequest*)request); + case CLOSE_ATTR_REQUEST: + return _HandleRequest((CloseAttrRequest*)request); + case FREE_ATTR_COOKIE_REQUEST: + return _HandleRequest((FreeAttrCookieRequest*)request); case READ_ATTR_REQUEST: return _HandleRequest((ReadAttrRequest*)request); case WRITE_ATTR_REQUEST: @@ -1495,6 +1503,126 @@ // _HandleRequest status_t +UserlandRequestHandler::_HandleRequest(CreateAttrRequest* request) +{ + // check and execute the request + status_t result = B_OK; + Volume* volume = (Volume*)request->volume; + if (!volume) + result = B_BAD_VALUE; + + fs_cookie attrCookie; + if (result == B_OK) { + RequestThreadContext context(volume); + result = volume->CreateAttr(request->node, + (const char*)request->name.GetData(), request->type, + request->openMode, &attrCookie); + } + + // prepare the reply + RequestAllocator allocator(fPort->GetPort()); + CreateAttrReply* reply; + status_t error = AllocateRequest(allocator, &reply); + if (error != B_OK) + RETURN_ERROR(error); + + reply->error = result; + reply->attrCookie = attrCookie; + + // send the reply + return _SendReply(allocator, false); +} + +// _HandleRequest +status_t +UserlandRequestHandler::_HandleRequest(OpenAttrRequest* request) +{ + // check and execute the request + status_t result = B_OK; + Volume* volume = (Volume*)request->volume; + if (!volume) + result = B_BAD_VALUE; + + fs_cookie attrCookie; + if (result == B_OK) { + RequestThreadContext context(volume); + result = volume->OpenAttr(request->node, + (const char*)request->name.GetData(), request->openMode, + &attrCookie); + } + + // prepare the reply + RequestAllocator allocator(fPort->GetPort()); + OpenAttrReply* reply; + status_t error = AllocateRequest(allocator, &reply); + if (error != B_OK) + RETURN_ERROR(error); + + reply->error = result; + reply->attrCookie = attrCookie; + + // send the reply + return _SendReply(allocator, false); +} + +// _HandleRequest +status_t +UserlandRequestHandler::_HandleRequest(CloseAttrRequest* request) +{ + // check and execute the request + status_t result = B_OK; + Volume* volume = (Volume*)request->volume; + if (!volume) + result = B_BAD_VALUE; + + if (result == B_OK) { + RequestThreadContext context(volume); + result = volume->CloseAttr(request->node, request->attrCookie); + } + + // prepare the reply + RequestAllocator allocator(fPort->GetPort()); + CloseAttrReply* reply; + status_t error = AllocateRequest(allocator, &reply); + if (error != B_OK) + RETURN_ERROR(error); + + reply->error = result; + + // send the reply + return _SendReply(allocator, false); +} + +// _HandleRequest +status_t +UserlandRequestHandler::_HandleRequest(FreeAttrCookieRequest* request) +{ + // check and execute the request + status_t result = B_OK; + Volume* volume = (Volume*)request->volume; + if (!volume) + result = B_BAD_VALUE; + + if (result == B_OK) { + RequestThreadContext context(volume); + result = volume->FreeAttrCookie(request->node, request->attrCookie); + } + + // prepare the reply + RequestAllocator allocator(fPort->GetPort()); + FreeAttrCookieReply* reply; + status_t error = AllocateRequest(allocator, &reply); + if (error != B_OK) + RETURN_ERROR(error); + + reply->error = result; + + // send the reply + return _SendReply(allocator, false); +} + +// _HandleRequest +status_t UserlandRequestHandler::_HandleRequest(ReadAttrRequest* request) { [... truncated: 90 lines follow ...] From bonefish at mail.berlios.de Thu Mar 1 02:42:16 2007 From: bonefish at mail.berlios.de (bonefish at BerliOS) Date: Thu, 1 Mar 2007 02:42:16 +0100 Subject: [Haiku-commits] r20259 - haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on Message-ID: <200703010142.l211gG7h026410@sheep.berlios.de> Author: bonefish Date: 2007-03-01 02:42:14 +0100 (Thu, 01 Mar 2007) New Revision: 20259 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20259&view=rev Modified: haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/kernel_interface.cpp Log: Fixed debug build. Modified: haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/kernel_interface.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/kernel_interface.cpp 2007-03-01 01:16:13 UTC (rev 20258) +++ haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/kernel_interface.cpp 2007-03-01 01:42:14 UTC (rev 20259) @@ -1,5 +1,7 @@ // kernel_interface.cpp +#include + #include #include @@ -440,7 +442,7 @@ void *buffer, size_t *length) { Volume* volume = (Volume*)fs; - PRINT(("userlandfs_read(%p, %p, %p, %Ld, %p, %lu)\n", nf, node, cookie, pos, + PRINT(("userlandfs_read(%p, %p, %p, %Ld, %p, %lu)\n", fs, node, cookie, pos, buffer, *length)); status_t error = volume->Read(node, cookie, pos, buffer, *length, length); @@ -535,7 +537,7 @@ PRINT(("userlandfs_read_dir() done: (%lx, %lu)\n", error, *count)); #if DEBUG dirent* entry = buffer; - for (int32 i = 0; i < *count; i++) { + for (uint32 i = 0; i < *count; i++) { // R5's kernel vsprintf() doesn't seem to know `%.s', so // we need to work around. char name[B_FILE_NAME_LENGTH]; @@ -835,7 +837,7 @@ userlandfs_read_index_stat(fs_volume fs, const char *name, struct stat *st) { Volume* volume = (Volume*)fs; - PRINT(("userlandfs_read_index_stat(%p, `%s', %p)\n", s, name, st)); + PRINT(("userlandfs_read_index_stat(%p, `%s', %p)\n", fs, name, st)); status_t error = volume->ReadIndexStat(name, st); PRINT(("userlandfs_read_index_stat() done: (%lx)\n", error)); return error; From bonefish at mail.berlios.de Thu Mar 1 02:43:05 2007 From: bonefish at mail.berlios.de (bonefish at BerliOS) Date: Thu, 1 Mar 2007 02:43:05 +0100 Subject: [Haiku-commits] r20260 - haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server Message-ID: <200703010143.l211h5cS026453@sheep.berlios.de> Author: bonefish Date: 2007-03-01 02:43:05 +0100 (Thu, 01 Mar 2007) New Revision: 20260 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20260&view=rev Modified: haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/main.cpp Log: Committed accidentally and forgot to fix it. Modified: haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/main.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/main.cpp 2007-03-01 01:42:14 UTC (rev 20259) +++ haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/main.cpp 2007-03-01 01:43:05 UTC (rev 20260) @@ -6,7 +6,7 @@ #include "Debug.h" #include "ServerDefs.h" #include "UserlandFSDispatcher.h" -//#include "UserlandFSServer.h" +#include "UserlandFSServer.h" // server signature static const char* kServerSignature @@ -98,14 +98,14 @@ error = dispatcher->Init(); app = dispatcher; } else { -// UserlandFSServer* server -// = new(nothrow) UserlandFSServer(kServerSignature); -// if (!server) { -// fprintf(stderr, "Failed to create server.\n"); -// return 1; -// } -// error = server->Init(fileSystem); -// app = server; + UserlandFSServer* server + = new(nothrow) UserlandFSServer(kServerSignature); + if (!server) { + fprintf(stderr, "Failed to create server.\n"); + return 1; + } + error = server->Init(fileSystem); + app = server; } // run it, if everything went fine From bonefish at mail.berlios.de Thu Mar 1 03:06:32 2007 From: bonefish at mail.berlios.de (bonefish at BerliOS) Date: Thu, 1 Mar 2007 03:06:32 +0100 Subject: [Haiku-commits] r20261 - haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server Message-ID: <200703010206.l2126Wsm027433@sheep.berlios.de> Author: bonefish Date: 2007-03-01 03:06:31 +0100 (Thu, 01 Mar 2007) New Revision: 20261 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20261&view=rev Modified: haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/UserlandFSServer.cpp Log: Variable are data not text. I wonder why that ever worked under BeOS. Modified: haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/UserlandFSServer.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/UserlandFSServer.cpp 2007-03-01 01:43:05 UTC (rev 20260) +++ haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/UserlandFSServer.cpp 2007-03-01 02:06:31 UTC (rev 20261) @@ -82,7 +82,7 @@ // get the symbols "fs_entry" and "api_version" beos_vnode_ops* fsOps; - error = get_image_symbol(fAddOnImage, "fs_entry", B_SYMBOL_TYPE_TEXT, + error = get_image_symbol(fAddOnImage, "fs_entry", B_SYMBOL_TYPE_DATA, (void**)&fsOps); if (error != B_OK) RETURN_ERROR(error); From bonefish at mail.berlios.de Thu Mar 1 03:55:43 2007 From: bonefish at mail.berlios.de (bonefish at BerliOS) Date: Thu, 1 Mar 2007 03:55:43 +0100 Subject: [Haiku-commits] r20262 - haiku/trunk/src/system/kernel/fs Message-ID: <200703010255.l212thwN030962@sheep.berlios.de> Author: bonefish Date: 2007-03-01 03:55:41 +0100 (Thu, 01 Mar 2007) New Revision: 20262 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20262&view=rev Modified: haiku/trunk/src/system/kernel/fs/vfs.cpp Log: Be nicer to FSs and fill in the known part of the fs_info *after* the FS had its go. BeOS does the same. Modified: haiku/trunk/src/system/kernel/fs/vfs.cpp =================================================================== --- haiku/trunk/src/system/kernel/fs/vfs.cpp 2007-03-01 02:06:31 UTC (rev 20261) +++ haiku/trunk/src/system/kernel/fs/vfs.cpp 2007-03-01 02:55:41 UTC (rev 20262) @@ -5716,17 +5716,22 @@ if (status < B_OK) return status; - // fill in info the file system doesn't (have to) know about memset(info, 0, sizeof(struct fs_info)); - info->dev = mount->id; - info->root = mount->root_vnode->id; - strlcpy(info->fsh_name, mount->fs_name, sizeof(info->fsh_name)); - if (mount->device_name != NULL) - strlcpy(info->device_name, mount->device_name, sizeof(info->device_name)); if (FS_MOUNT_CALL(mount, read_fs_info)) status = FS_MOUNT_CALL(mount, read_fs_info)(mount->cookie, info); + // fill in info the file system doesn't (have to) know about + if (status == B_OK) { + info->dev = mount->id; + info->root = mount->root_vnode->id; + strlcpy(info->fsh_name, mount->fs_name, sizeof(info->fsh_name)); + if (mount->device_name != NULL) { + strlcpy(info->device_name, mount->device_name, + sizeof(info->device_name)); + } + } + // if the call is not supported by the file system, there are still // the parts that we filled out ourselves From bonefish at mail.berlios.de Thu Mar 1 05:46:17 2007 From: bonefish at mail.berlios.de (bonefish at BerliOS) Date: Thu, 1 Mar 2007 05:46:17 +0100 Subject: [Haiku-commits] r20263 - haiku/trunk/src/tests/add-ons/kernel/file_systems/userlandfs/r5/src/test/ramfs Message-ID: <200703010446.l214kHjN006068@sheep.berlios.de> Author: bonefish Date: 2007-03-01 05:46:16 +0100 (Thu, 01 Mar 2007) New Revision: 20263 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20263&view=rev Modified: haiku/trunk/src/tests/add-ons/kernel/file_systems/userlandfs/r5/src/test/ramfs/Node.cpp haiku/trunk/src/tests/add-ons/kernel/file_systems/userlandfs/r5/src/test/ramfs/Node.h haiku/trunk/src/tests/add-ons/kernel/file_systems/userlandfs/r5/src/test/ramfs/Volume.cpp Log: Set reasonable permissions for the root directory. Haiku seems to be a bit pickier than BeOS. Modified: haiku/trunk/src/tests/add-ons/kernel/file_systems/userlandfs/r5/src/test/ramfs/Node.cpp =================================================================== --- haiku/trunk/src/tests/add-ons/kernel/file_systems/userlandfs/r5/src/test/ramfs/Node.cpp 2007-03-01 02:55:41 UTC (rev 20262) +++ haiku/trunk/src/tests/add-ons/kernel/file_systems/userlandfs/r5/src/test/ramfs/Node.cpp 2007-03-01 04:46:16 UTC (rev 20263) @@ -159,7 +159,7 @@ // root has always read/write permission, but at least one of the // X bits must be set for execute permission permissions = userPermissions | groupPermissions | otherPermissions - | S_IROTH | S_IWOTH; + | ACCESS_R | ACCESS_W; // user is node owner } else if (uid == fUID) permissions = userPermissions; Modified: haiku/trunk/src/tests/add-ons/kernel/file_systems/userlandfs/r5/src/test/ramfs/Node.h =================================================================== --- haiku/trunk/src/tests/add-ons/kernel/file_systems/userlandfs/r5/src/test/ramfs/Node.h 2007-03-01 02:55:41 UTC (rev 20262) +++ haiku/trunk/src/tests/add-ons/kernel/file_systems/userlandfs/r5/src/test/ramfs/Node.h 2007-03-01 04:46:16 UTC (rev 20263) @@ -57,8 +57,8 @@ // stat data -// void SetMode(mode_t mode) { fMode = mode; } - inline void SetMode(mode_t mode) { fMode = fMode & S_IFMT | mode & ~S_IFMT; } + inline void SetMode(mode_t mode) + { fMode = fMode & ~S_IUMSK | mode & S_IUMSK; } inline mode_t GetMode() const { return fMode; } inline void SetUID(uid_t uid) { fUID = uid; } Modified: haiku/trunk/src/tests/add-ons/kernel/file_systems/userlandfs/r5/src/test/ramfs/Volume.cpp =================================================================== --- haiku/trunk/src/tests/add-ons/kernel/file_systems/userlandfs/r5/src/test/ramfs/Volume.cpp 2007-03-01 02:55:41 UTC (rev 20262) +++ haiku/trunk/src/tests/add-ons/kernel/file_systems/userlandfs/r5/src/test/ramfs/Volume.cpp 2007-03-01 04:46:16 UTC (rev 20263) @@ -230,9 +230,12 @@ // create the root dir if (error == B_OK) { fRootDirectory = new(nothrow) Directory(this); - if (fRootDirectory) + if (fRootDirectory) { + // set permissions: -rwxr-xr-x + fRootDirectory->SetMode( + S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH); error = fRootDirectory->Link(NULL); - else + } else SET_ERROR(error, B_NO_MEMORY); } // set mounted flag / cleanup on error From bonefish at mail.berlios.de Thu Mar 1 05:56:10 2007 From: bonefish at mail.berlios.de (bonefish at BerliOS) Date: Thu, 1 Mar 2007 05:56:10 +0100 Subject: [Haiku-commits] r20264 - in haiku/trunk: headers/private/userlandfs/private src/add-ons/kernel/file_systems/userlandfs src/add-ons/kernel/file_systems/userlandfs/kernel_add_on src/add-ons/kernel/file_systems/userlandfs/private src/add-ons/kernel/file_systems/userlandfs/server Message-ID: <200703010456.l214uA5T006454@sheep.berlios.de> Author: bonefish Date: 2007-03-01 05:56:08 +0100 (Thu, 01 Mar 2007) New Revision: 20264 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20264&view=rev Added: haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/userlandfs Modified: haiku/trunk/headers/private/userlandfs/private/Requests.h haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/KernelRequestHandler.cpp haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/KernelRequestHandler.h haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/Volume.cpp haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/Volume.h haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/kernel_interface.cpp haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/private/Requests.cpp haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/beos_kernel_emu.cpp haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/kernel_emu.cpp Log: * More debug output in the kernel module. * Made publish_vnode() available in userland. For old style FS add-ons publish_vnode() is used when they request a new_vnode(). The semantics of new_vnode() changed considerably in Haiku, but publish_vnode() seems to do pretty much what the old new_vnode() did. * The UserlandFS hosted RamFS begins to work under Haiku. It runs pretty soon out of memory though (under vmware with 256 MB) and node monitoring is broken ATM. Modified: haiku/trunk/headers/private/userlandfs/private/Requests.h =================================================================== --- haiku/trunk/headers/private/userlandfs/private/Requests.h 2007-03-01 04:46:16 UTC (rev 20263) +++ haiku/trunk/headers/private/userlandfs/private/Requests.h 2007-03-01 04:56:08 UTC (rev 20264) @@ -185,6 +185,8 @@ PUT_VNODE_REPLY, NEW_VNODE_REQUEST, NEW_VNODE_REPLY, + PUBLISH_VNODE_REQUEST, + PUBLISH_VNODE_REPLY, REMOVE_VNODE_REQUEST, REMOVE_VNODE_REPLY, UNREMOVE_VNODE_REQUEST, @@ -1425,6 +1427,22 @@ NewVNodeReply() : ReplyRequest(NEW_VNODE_REPLY) {} }; +// PublishVNodeRequest +class PublishVNodeRequest : public Request { +public: + PublishVNodeRequest() : Request(PUBLISH_VNODE_REQUEST) {} + + mount_id nsid; + vnode_id vnid; + fs_vnode node; +}; + +// PublishVNodeReply +class PublishVNodeReply : public ReplyRequest { +public: + PublishVNodeReply() : ReplyRequest(PUBLISH_VNODE_REPLY) {} +}; + // RemoveVNodeRequest class RemoveVNodeRequest : public Request { public: @@ -1788,6 +1806,10 @@ return task((NewVNodeRequest*)request); case NEW_VNODE_REPLY: return task((NewVNodeReply*)request); + case PUBLISH_VNODE_REQUEST: + return task((PublishVNodeRequest*)request); + case PUBLISH_VNODE_REPLY: + return task((PublishVNodeReply*)request); case REMOVE_VNODE_REQUEST: return task((RemoveVNodeRequest*)request); case REMOVE_VNODE_REPLY: @@ -1979,6 +2001,8 @@ using UserlandFSUtil::PutVNodeReply; using UserlandFSUtil::NewVNodeRequest; using UserlandFSUtil::NewVNodeReply; +using UserlandFSUtil::PublishVNodeRequest; +using UserlandFSUtil::PublishVNodeReply; using UserlandFSUtil::RemoveVNodeRequest; using UserlandFSUtil::RemoveVNodeReply; using UserlandFSUtil::UnremoveVNodeRequest; Modified: haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/KernelRequestHandler.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/KernelRequestHandler.cpp 2007-03-01 04:46:16 UTC (rev 20263) +++ haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/KernelRequestHandler.cpp 2007-03-01 04:56:08 UTC (rev 20264) @@ -71,6 +71,8 @@ return _HandleRequest((PutVNodeRequest*)request); case NEW_VNODE_REQUEST: return _HandleRequest((NewVNodeRequest*)request); + case PUBLISH_VNODE_REQUEST: + return _HandleRequest((PublishVNodeRequest*)request); case REMOVE_VNODE_REQUEST: return _HandleRequest((RemoveVNodeRequest*)request); case UNREMOVE_VNODE_REQUEST: @@ -276,6 +278,30 @@ // _HandleRequest status_t +KernelRequestHandler::_HandleRequest(PublishVNodeRequest* request) +{ + // check and executed the request + Volume* volume = NULL; + status_t result = _GetVolume(request->nsid, &volume); + VolumePutter _(volume); + if (result == B_OK) + result = volume->PublishVNode(request->vnid, request->node); + + // prepare the reply + RequestAllocator allocator(fPort->GetPort()); + PublishVNodeReply* reply; + status_t error = AllocateRequest(allocator, &reply); + if (error != B_OK) + return error; + + reply->error = result; + + // send the reply + return fPort->SendRequest(&allocator); +} + +// _HandleRequest +status_t KernelRequestHandler::_HandleRequest(RemoveVNodeRequest* request) { // check and executed the request Modified: haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/KernelRequestHandler.h =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/KernelRequestHandler.h 2007-03-01 04:46:16 UTC (rev 20263) +++ haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/KernelRequestHandler.h 2007-03-01 04:56:08 UTC (rev 20264) @@ -14,6 +14,7 @@ class NewVNodeRequest; class NotifyListenerRequest; class NotifySelectEventRequest; +class PublishVNodeRequest; class PutVNodeRequest; class RemoveVNodeRequest; class SendNotificationRequest; @@ -26,11 +27,11 @@ using UserlandFSUtil::NewVNodeRequest; using UserlandFSUtil::NotifyListenerRequest; using UserlandFSUtil::NotifySelectEventRequest; +using UserlandFSUtil::PublishVNodeRequest; using UserlandFSUtil::PutVNodeRequest; using UserlandFSUtil::RemoveVNodeRequest; using UserlandFSUtil::SendNotificationRequest; using UserlandFSUtil::UnremoveVNodeRequest; -using UserlandFSUtil::GetVNodeRequest; class Volume; @@ -55,6 +56,7 @@ status_t _HandleRequest(GetVNodeRequest* request); status_t _HandleRequest(PutVNodeRequest* request); status_t _HandleRequest(NewVNodeRequest* request); + status_t _HandleRequest(PublishVNodeRequest* request); status_t _HandleRequest(RemoveVNodeRequest* request); status_t _HandleRequest(UnremoveVNodeRequest* request); status_t _HandleRequest(IsVNodeRemovedRequest* request); Modified: haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/Volume.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/Volume.cpp 2007-03-01 04:46:16 UTC (rev 20263) +++ haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/Volume.cpp 2007-03-01 04:56:08 UTC (rev 20264) @@ -163,10 +163,33 @@ if (error != B_OK) { ERROR(("Volume::NewVNode(): Failed to add vnode to mount " "vnode map!\n")); + publish_vnode(fID, vnid, node); put_vnode(fID, vnid); return error; } } +// TODO: Check what need to do according to the new semantics. +// _IncrementVNodeCount(vnid); + } + return error; +} + +// PublishVNode +status_t +Volume::PublishVNode(vnode_id vnid, fs_vnode node) +{ +PRINT(("publish_vnode(%ld, %Ld)\n", fID, vnid)); + status_t error = publish_vnode(fID, vnid, node); + if (error == B_OK) { + if (IsMounting()) { + error = fMountVNodes->Put(vnid, node); + if (error != B_OK) { + ERROR(("Volume::PublishVNode(): Failed to add vnode to mount " + "vnode map!\n")); + put_vnode(fID, vnid); + return error; + } + } _IncrementVNodeCount(vnid); } return error; Modified: haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/Volume.h =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/Volume.h 2007-03-01 04:46:16 UTC (rev 20263) +++ haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/Volume.h 2007-03-01 04:56:08 UTC (rev 20264) @@ -35,9 +35,10 @@ bool IsMounting() const; // client methods - status_t GetVNode(vnode_id vnid, void** node); + status_t GetVNode(vnode_id vnid, fs_vnode* node); status_t PutVNode(vnode_id vnid); - status_t NewVNode(vnode_id vnid, void* node); + status_t NewVNode(vnode_id vnid, fs_vnode node); + status_t PublishVNode(vnode_id vnid, fs_vnode node); status_t RemoveVNode(vnode_id vnid); status_t UnremoveVNode(vnode_id vnid); status_t IsVNodeRemoved(vnode_id vnid); Modified: haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/kernel_interface.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/kernel_interface.cpp 2007-03-01 04:46:16 UTC (rev 20263) +++ haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/kernel_interface.cpp 2007-03-01 04:56:08 UTC (rev 20264) @@ -67,6 +67,9 @@ userlandfs_mount(mount_id id, const char *device, uint32 flags, const char *args, fs_volume *fsCookie, vnode_id *rootVnodeID) { + PRINT(("userlandfs_mount(%ld, %s, 0x%lx, %s, %p, %p)\n", id, device, flags, + args, fsCookie, rootVnodeID)); + status_t error = B_OK; // get the parameters @@ -75,44 +78,50 @@ const char* fsParameters; error = parse_parameters(args, fsName, &fsParameters); if (error != B_OK) - return error; + RETURN_ERROR(error); // get the UserlandFS object UserlandFS* userlandFS = UserlandFS::GetUserlandFS(); if (!userlandFS) - return B_ERROR; + RETURN_ERROR(B_ERROR); // get the file system FileSystem* fileSystem = NULL; error = userlandFS->RegisterFileSystem(fsName.GetString(), &fileSystem); if (error != B_OK) - return error; + RETURN_ERROR(error); // mount the volume Volume* volume = NULL; error = fileSystem->Mount(id, device, flags, fsParameters, &volume); if (error != B_OK) { userlandFS->UnregisterFileSystem(fileSystem); - return error; + RETURN_ERROR(error); } *fsCookie = volume; *rootVnodeID = volume->GetRootID(); + PRINT(("userlandfs_mount() done: %p, %lld\n", *fsCookie, *rootVnodeID)); + return error; } // userlandfs_unmount static status_t -userlandfs_unmount(fs_volume ns) +userlandfs_unmount(fs_volume fs) { - Volume* volume = (Volume*)ns; + Volume* volume = (Volume*)fs; + PRINT(("userlandfs_unmount(%p)\n", fs)); + FileSystem* fileSystem = volume->GetFileSystem(); status_t error = volume->Unmount(); // The error code the FS's unmount hook returns is completely irrelevant to // the VFS. It considers the volume unmounted in any case. volume->RemoveReference(); UserlandFS::GetUserlandFS()->UnregisterFileSystem(fileSystem); + + PRINT(("userlandfs_unmount() done: %lx\n", error)); return error; } @@ -960,6 +969,7 @@ case B_MODULE_INIT: { init_debugging(); + PRINT(("userlandfs_std_ops(): B_MODULE_INIT\n")); // make sure there is a UserlandFS we can work with UserlandFS* userlandFS = NULL; @@ -973,6 +983,7 @@ } case B_MODULE_UNINIT: + PRINT(("userlandfs_std_ops(): B_MODULE_UNINIT\n")); UserlandFS::UninitUserlandFS(); exit_debugging(); return B_OK; Modified: haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/private/Requests.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/private/Requests.cpp 2007-03-01 04:46:16 UTC (rev 20263) +++ haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/private/Requests.cpp 2007-03-01 04:56:08 UTC (rev 20264) @@ -645,6 +645,7 @@ case GET_VNODE_REQUEST: case PUT_VNODE_REQUEST: case NEW_VNODE_REQUEST: + case PUBLISH_VNODE_REQUEST: case REMOVE_VNODE_REQUEST: case UNREMOVE_VNODE_REQUEST: case IS_VNODE_REMOVED_REQUEST: @@ -652,6 +653,7 @@ case GET_VNODE_REPLY: case PUT_VNODE_REPLY: case NEW_VNODE_REPLY: + case PUBLISH_VNODE_REPLY: case REMOVE_VNODE_REPLY: case UNREMOVE_VNODE_REPLY: case IS_VNODE_REMOVED_REPLY: @@ -843,6 +845,7 @@ case GET_VNODE_REQUEST: case PUT_VNODE_REQUEST: case NEW_VNODE_REQUEST: + case PUBLISH_VNODE_REQUEST: case REMOVE_VNODE_REQUEST: case UNREMOVE_VNODE_REQUEST: case IS_VNODE_REMOVED_REQUEST: @@ -850,6 +853,7 @@ case GET_VNODE_REPLY: case PUT_VNODE_REPLY: case NEW_VNODE_REPLY: + case PUBLISH_VNODE_REPLY: case REMOVE_VNODE_REPLY: case UNREMOVE_VNODE_REPLY: case IS_VNODE_REMOVED_REPLY: Modified: haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/beos_kernel_emu.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/beos_kernel_emu.cpp 2007-03-01 04:46:16 UTC (rev 20263) +++ haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/beos_kernel_emu.cpp 2007-03-01 04:56:08 UTC (rev 20264) @@ -83,7 +83,9 @@ int new_vnode(nspace_id nsid, vnode_id vnid, void *data) { - return UserlandFS::KernelEmu::new_vnode(nsid, vnid, data); + // The semantics of new_vnode() has changed. The new publish_vnode() + // should work like the former new_vnode(). + return UserlandFS::KernelEmu::publish_vnode(nsid, vnid, data); } // remove_vnode Modified: haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/kernel_emu.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/kernel_emu.cpp 2007-03-01 04:46:16 UTC (rev 20263) +++ haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/kernel_emu.cpp 2007-03-01 04:56:08 UTC (rev 20264) @@ -360,8 +360,36 @@ UserlandFS::KernelEmu::publish_vnode(mount_id nsid, vnode_id vnid, fs_vnode data) { - // TODO: Implement! - return B_BAD_VALUE; + // get the request port and the file system + RequestPort* port; + FileSystem* fileSystem; + status_t error = get_port_and_fs(&port, &fileSystem); + if (error != B_OK) + return error; + + // prepare the request + RequestAllocator allocator(port->GetPort()); + PublishVNodeRequest* request; + error = AllocateRequest(allocator, &request); + if (error != B_OK) + return error; + + request->nsid = nsid; + request->vnid = vnid; + request->node = data; + + // send the request + UserlandRequestHandler handler(fileSystem, PUBLISH_VNODE_REPLY); + PublishVNodeReply* reply; + error = port->SendRequest(&allocator, &handler, (Request**)&reply); + if (error != B_OK) + return error; + RequestReleaser requestReleaser(port, reply); + + // process the reply + if (reply->error != B_OK) + return reply->error; + return error; } // remove_vnode Copied: haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/userlandfs (from rev 20258, haiku/trunk/src/tests/add-ons/kernel/file_systems/userlandfs/r5/userlandfs.sample) From geist at mail.berlios.de Thu Mar 1 07:30:16 2007 From: geist at mail.berlios.de (geist at BerliOS) Date: Thu, 1 Mar 2007 07:30:16 +0100 Subject: [Haiku-commits] r20265 - haiku/trunk/src/system/kernel/arch/x86 Message-ID: <200703010630.l216UGbJ022049@sheep.berlios.de> Author: geist Date: 2007-03-01 07:30:16 +0100 (Thu, 01 Mar 2007) New Revision: 20265 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20265&view=rev Modified: haiku/trunk/src/system/kernel/arch/x86/arch_smp.c Log: the recent vm change uncovered a long standing latent pseudo-bug where the local and ioapic memory window were mapped into kernel space via create_area(), not map_physical_memory() like it should be. create_area() used to work fine, but now it's a big more picky about mapping memory it can't get a vm_page to (like stuff outside the range of RAM). Modified: haiku/trunk/src/system/kernel/arch/x86/arch_smp.c =================================================================== --- haiku/trunk/src/system/kernel/arch/x86/arch_smp.c 2007-03-01 04:56:08 UTC (rev 20264) +++ haiku/trunk/src/system/kernel/arch/x86/arch_smp.c 2007-03-01 06:30:16 UTC (rev 20265) @@ -187,10 +187,10 @@ apic_timer_tics_per_sec = args->arch_args.apic_time_cv_factor; // setup regions that represent the apic & ioapic - create_area("local apic", &apic, B_EXACT_ADDRESS, B_PAGE_SIZE, - B_ALREADY_WIRED, B_KERNEL_READ_AREA | B_KERNEL_WRITE_AREA); - create_area("ioapic", &ioapic, B_EXACT_ADDRESS, B_PAGE_SIZE, - B_ALREADY_WIRED, B_KERNEL_READ_AREA | B_KERNEL_WRITE_AREA); + map_physical_memory("local apic", (void *)args->arch_args.apic, B_PAGE_SIZE, + B_EXACT_ADDRESS, B_KERNEL_READ_AREA | B_KERNEL_WRITE_AREA, &apic); + map_physical_memory("ioapic", (void *)args->arch_args.ioapic, B_PAGE_SIZE, + B_EXACT_ADDRESS, B_KERNEL_READ_AREA | B_KERNEL_WRITE_AREA, &ioapic); // set up the local apic on the boot cpu arch_smp_per_cpu_init(args, 0); From jackburton at mail.berlios.de Thu Mar 1 08:20:06 2007 From: jackburton at mail.berlios.de (jackburton at BerliOS) Date: Thu, 1 Mar 2007 08:20:06 +0100 Subject: [Haiku-commits] r20266 - haiku/trunk/src/apps/terminal Message-ID: <200703010720.l217K6KZ024805@sheep.berlios.de> Author: jackburton Date: 2007-03-01 08:20:06 +0100 (Thu, 01 Mar 2007) New Revision: 20266 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20266&view=rev Modified: haiku/trunk/src/apps/terminal/PrefDlg.cpp haiku/trunk/src/apps/terminal/PrefDlg.h Log: Patch by Vasilis Kaoutsis: * Style issues. * Renamed CenteredRect to _CenteredRect since is private and removed the static keyword. * Corrected copyright dates. Thank you! Modified: haiku/trunk/src/apps/terminal/PrefDlg.cpp =================================================================== --- haiku/trunk/src/apps/terminal/PrefDlg.cpp 2007-03-01 06:30:16 UTC (rev 20265) +++ haiku/trunk/src/apps/terminal/PrefDlg.cpp 2007-03-01 07:20:06 UTC (rev 20266) @@ -1,85 +1,78 @@ /* - * Copyright 2001-2007, Haiku, Inc. + * Copyright 2007, Haiku, Inc. * Copyright 2003-2004 Kian Duffy, myob at users.sourceforge.net * Parts Copyright 1998-1999 Kazuho Okui and Takashi Murai. * All rights reserved. Distributed under the terms of the MIT license. */ +#include "AppearPrefView.h" +#include "MenuUtil.h" +#include "PrefHandler.h" +#include "PrefDlg.h" +#include "PrefView.h" +#include "spawn.h" +#include "TermConst.h" + +#include #include #include #include +#include #include -#include -#include + #include -#include "PrefHandler.h" -#include "PrefDlg.h" -#include "TermConst.h" -#include "MenuUtil.h" -#include "AppearPrefView.h" -#include "PrefView.h" -#include "spawn.h" - - -// Global Preference Handler extern PrefHandler *gTermPref; + // Global Preference Handler PrefDlg::PrefDlg(BMessenger messenger) - : BWindow(CenteredRect(BRect(0, 0, 350, 215)), "Terminal Settings", + : BWindow(_CenteredRect(BRect(0, 0, 350, 215)), "Terminal Settings", B_TITLED_WINDOW_LOOK, B_NORMAL_WINDOW_FEEL, B_NOT_RESIZABLE|B_NOT_ZOOMABLE), + fPrefTemp(new PrefHandler(gTermPref)), + fSavePanel(NULL), + fDirty(false), fPrefDlgMessenger(messenger) { - fPrefTemp = new PrefHandler(gTermPref); - fDirty = false; - fSavePanel = NULL; + BRect rect; - BRect r; - BView *top = new BView(Bounds(), "topview", B_FOLLOW_NONE, B_WILL_DRAW); - top->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR)); + top->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR)); AddChild(top); - r=top->Bounds(); - r.bottom *= .75; - AppearancePrefView *prefView= new AppearancePrefView(r, "Appearance", + rect = top->Bounds(); + rect.bottom *= .75; + AppearancePrefView *prefView= new AppearancePrefView(rect, "Appearance", fPrefDlgMessenger); top->AddChild(prefView); - fSaveAsFileButton = new BButton(BRect(0,0,1,1), "savebutton", - "Save to File", - new BMessage(MSG_SAVEAS_PRESSED), - B_FOLLOW_TOP, B_WILL_DRAW); + fSaveAsFileButton = new BButton(BRect(0, 0, 1, 1), "savebutton", "Save to File", + new BMessage(MSG_SAVEAS_PRESSED), B_FOLLOW_TOP, B_WILL_DRAW); fSaveAsFileButton->ResizeToPreferred(); fSaveAsFileButton->MoveTo(5, top->Bounds().Height() - 5 - - fSaveAsFileButton->Bounds().Height()); + fSaveAsFileButton->Bounds().Height()); top->AddChild(fSaveAsFileButton); - - - fSaveButton = new BButton(BRect(0,0,1,1), "okbutton", "OK", - new BMessage(MSG_SAVE_PRESSED), B_FOLLOW_TOP, - B_WILL_DRAW); + + fSaveButton = new BButton(BRect(0, 0, 1, 1), "okbutton", "OK", + new BMessage(MSG_SAVE_PRESSED), B_FOLLOW_TOP, B_WILL_DRAW); fSaveButton->ResizeToPreferred(); fSaveButton->MoveTo(top->Bounds().Width() - 5 - fSaveButton->Bounds().Width(), - top->Bounds().Height() - 5 - fSaveButton->Bounds().Height()); + top->Bounds().Height() - 5 - fSaveButton->Bounds().Height()); fSaveButton->MakeDefault(true); top->AddChild(fSaveButton); - - fRevertButton = new BButton(BRect(0,0,1,1), "revertbutton", - "Cancel", new BMessage(MSG_REVERT_PRESSED), - B_FOLLOW_TOP, B_WILL_DRAW); + + fRevertButton = new BButton(BRect(0, 0, 1, 1), "revertbutton", + "Cancel", new BMessage(MSG_REVERT_PRESSED), B_FOLLOW_TOP, B_WILL_DRAW); fRevertButton->ResizeToPreferred(); - fRevertButton->MoveTo(fSaveButton->Frame().left - 10 - - fRevertButton->Bounds().Width(), - top->Bounds().Height() - 5 - - fRevertButton->Bounds().Height()); + fRevertButton->MoveTo(fSaveButton->Frame().left - 10 - + fRevertButton->Bounds().Width(), top->Bounds().Height() - 5 - + fRevertButton->Bounds().Height()); top->AddChild(fRevertButton); - AddShortcut ((ulong)'Q', (ulong)B_COMMAND_KEY, new BMessage(B_QUIT_REQUESTED)); - AddShortcut ((ulong)'W', (ulong)B_COMMAND_KEY, new BMessage(B_QUIT_REQUESTED)); + AddShortcut((ulong)'Q', (ulong)B_COMMAND_KEY, new BMessage(B_QUIT_REQUESTED)); + AddShortcut((ulong)'W', (ulong)B_COMMAND_KEY, new BMessage(B_QUIT_REQUESTED)); Show(); } @@ -213,16 +206,16 @@ BRect -PrefDlg::CenteredRect(BRect r) +PrefDlg::_CenteredRect(BRect rect) { BRect screenRect = BScreen().Frame(); screenRect.InsetBy(10,10); - float x = screenRect.left + (screenRect.Width() - r.Width()) / 2; - float y = screenRect.top + (screenRect.Height() - r.Height()) / 3; + float x = screenRect.left + (screenRect.Width() - rect.Width()) / 2; + float y = screenRect.top + (screenRect.Height() - rect.Height()) / 3; - r.OffsetTo(x, y); + rect.OffsetTo(x, y); - return r; + return rect; } Modified: haiku/trunk/src/apps/terminal/PrefDlg.h =================================================================== --- haiku/trunk/src/apps/terminal/PrefDlg.h 2007-03-01 06:30:16 UTC (rev 20265) +++ haiku/trunk/src/apps/terminal/PrefDlg.h 2007-03-01 07:20:06 UTC (rev 20266) @@ -1,5 +1,5 @@ /* - * Copyright 2001-2007, Haiku, Inc. + * Copyright 2007, Haiku, Inc. * Copyright 2003-2004 Kian Duffy, myob at users.sourceforge.net * Parts Copyright 1998-1999 Kazuho Okui and Takashi Murai. * All rights reserved. Distributed under the terms of the MIT license. @@ -7,32 +7,33 @@ #ifndef PREFDLG_H_INCLUDED #define PREFDLG_H_INCLUDED + +#include "PrefHandler.h" + #include #include -#include "PrefHandler.h" -// local message, so these are in .cpp files.... +// local messages const ulong MSG_SAVE_PRESSED = 'okok'; const ulong MSG_SAVEAS_PRESSED = 'canl'; const ulong MSG_REVERT_PRESSED = 'revt'; const ulong MSG_PREF_CLOSED = 'mspc'; - -// Notify PrefDlg closed to TermWindow - +class BButton; +class BFilePanel; +class BMessage; class BRect; -class BMessage; class BTextControl; -class BButton; + class PrefHandler; -class BFilePanel; + class PrefDlg : public BWindow { public: PrefDlg(BMessenger messenger); virtual ~PrefDlg(); - + virtual void Quit(); virtual bool QuitRequested(); virtual void MessageReceived(BMessage *msg); @@ -42,9 +43,9 @@ void _SaveAs(); void _Revert(); void _SaveRequested(BMessage *msg); + BRect _CenteredRect(BRect rect); - static BRect CenteredRect(BRect r); - + private: PrefHandler *fPrefTemp; BFilePanel *fSavePanel; @@ -53,8 +54,7 @@ *fSaveButton; bool fDirty; - BMessenger fPrefDlgMessenger; }; -#endif //PREFDLG_H_INCLUDED +#endif // PREFDLG_H_INCLUDED From jackburton at mail.berlios.de Thu Mar 1 08:45:50 2007 From: jackburton at mail.berlios.de (jackburton at BerliOS) Date: Thu, 1 Mar 2007 08:45:50 +0100 Subject: [Haiku-commits] r20267 - haiku/trunk/src/tests/kits/interface/picture Message-ID: <200703010745.l217joHF026615@sheep.berlios.de> Author: jackburton Date: 2007-03-01 08:45:50 +0100 (Thu, 01 Mar 2007) New Revision: 20267 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20267&view=rev Modified: haiku/trunk/src/tests/kits/interface/picture/PictureTest.cpp Log: Flatten and Unflatten the BPicture before showing it. The picture doesn't show up, that means something is still broken in Flatten() or Unflatten() Modified: haiku/trunk/src/tests/kits/interface/picture/PictureTest.cpp =================================================================== --- haiku/trunk/src/tests/kits/interface/picture/PictureTest.cpp 2007-03-01 07:20:06 UTC (rev 20266) +++ haiku/trunk/src/tests/kits/interface/picture/PictureTest.cpp 2007-03-01 07:45:50 UTC (rev 20267) @@ -103,12 +103,26 @@ void PictureView::AllAttached() -{ +{ BeginPicture(new BPicture); DrawStuff(this); - fPicture = EndPicture(); + BPicture *picture = EndPicture(); + + BMallocIO stream; + + status_t status = picture->Flatten(&stream); + if (status != B_OK) + printf("Error flattening BPicture: %s\n", strerror(status)); + if (status == B_OK) { + fPicture = new BPicture(); + status = fPicture->Unflatten(&stream); + if (status != B_OK) + printf("Error unflattening BPicture: %s\n", strerror(status)); + } + + delete picture; } void From geist at mail.berlios.de Thu Mar 1 08:49:44 2007 From: geist at mail.berlios.de (geist at BerliOS) Date: Thu, 1 Mar 2007 08:49:44 +0100 Subject: [Haiku-commits] r20268 - haiku/trunk/src/system/kernel/arch/x86 Message-ID: <200703010749.l217nipA027142@sheep.berlios.de> Author: geist Date: 2007-03-01 08:49:43 +0100 (Thu, 01 Mar 2007) New Revision: 20268 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20268&view=rev Modified: haiku/trunk/src/system/kernel/arch/x86/arch_smp.c Log: the last smp change wasn't quite it. This time, make sure it maps the right physical page. Modified: haiku/trunk/src/system/kernel/arch/x86/arch_smp.c =================================================================== --- haiku/trunk/src/system/kernel/arch/x86/arch_smp.c 2007-03-01 07:45:50 UTC (rev 20267) +++ haiku/trunk/src/system/kernel/arch/x86/arch_smp.c 2007-03-01 07:49:43 UTC (rev 20268) @@ -110,6 +110,7 @@ uint32 config; TRACE(("setting up the APIC for CPU %ld...\n", cpu)); + TRACE((" apic id %d, version %d\n", apic_read(APIC_ID), apic_read(APIC_VERSION))); /* set spurious interrupt vector to 0xff */ config = apic_read(APIC_SPURIOUS_INTR_VECTOR) & 0xffffff00; @@ -187,9 +188,9 @@ apic_timer_tics_per_sec = args->arch_args.apic_time_cv_factor; // setup regions that represent the apic & ioapic - map_physical_memory("local apic", (void *)args->arch_args.apic, B_PAGE_SIZE, + map_physical_memory("local apic", (void *)args->arch_args.apic_phys, B_PAGE_SIZE, B_EXACT_ADDRESS, B_KERNEL_READ_AREA | B_KERNEL_WRITE_AREA, &apic); - map_physical_memory("ioapic", (void *)args->arch_args.ioapic, B_PAGE_SIZE, + map_physical_memory("ioapic", (void *)args->arch_args.ioapic_phys, B_PAGE_SIZE, B_EXACT_ADDRESS, B_KERNEL_READ_AREA | B_KERNEL_WRITE_AREA, &ioapic); // set up the local apic on the boot cpu From geist at mail.berlios.de Thu Mar 1 09:09:29 2007 From: geist at mail.berlios.de (geist at BerliOS) Date: Thu, 1 Mar 2007 09:09:29 +0100 Subject: [Haiku-commits] r20269 - in haiku/trunk: headers/private/kernel src/system/kernel Message-ID: <200703010809.l2189TwT027993@sheep.berlios.de> Author: geist Date: 2007-03-01 09:09:28 +0100 (Thu, 01 Mar 2007) New Revision: 20269 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20269&view=rev Modified: haiku/trunk/headers/private/kernel/smp.h haiku/trunk/src/system/kernel/main.c haiku/trunk/src/system/kernel/smp.c haiku/trunk/src/system/kernel/thread.c Log: this seems to solve the 'lock up on bootup on core 2' problem. Basically, there was a pretty subtle race between the cpus in main where if the main cpu released the AP cpus and then before the AP cpus had a chance to run the boot cpu started creating the main thread (which causes smp ici messages to be created) the system would livelock, where the boot cpu waited forever for the AP cpu to acknowledge the ICI (for a TLB flush when creating the kernel stack). Added smp_cpu_rendezvous(), used to synchronize all the cpus to a particular point, and used it a few times in main(). While i was at it i fixed another race that'll probably never happen, but what the hey. Make sure the kernel args are copied into kernel space by the main cpu before letting any other ones use it. Modified: haiku/trunk/headers/private/kernel/smp.h =================================================================== --- haiku/trunk/headers/private/kernel/smp.h 2007-03-01 07:49:43 UTC (rev 20268) +++ haiku/trunk/headers/private/kernel/smp.h 2007-03-01 08:09:28 UTC (rev 20269) @@ -42,7 +42,7 @@ status_t smp_per_cpu_init(struct kernel_args *args, int32 cpu); bool smp_trap_non_boot_cpus(int32 cpu); void smp_wake_up_non_boot_cpus(void); -void smp_wait_for_non_boot_cpus(void); +void smp_cpu_rendezvous(volatile uint32 *var, int current_cpu); void smp_send_ici(int32 targetCPU, int32 message, uint32 data, uint32 data2, uint32 data3, void *data_ptr, uint32 flags); void smp_send_broadcast_ici(int32 message, uint32 data, uint32 data2, uint32 data3, Modified: haiku/trunk/src/system/kernel/main.c =================================================================== --- haiku/trunk/src/system/kernel/main.c 2007-03-01 07:49:43 UTC (rev 20268) +++ haiku/trunk/src/system/kernel/main.c 2007-03-01 08:09:28 UTC (rev 20269) @@ -40,26 +40,25 @@ #include -//#define TRACE_BOOT +#define TRACE_BOOT #ifdef TRACE_BOOT # define TRACE(x...) dprintf("INIT : " x) #else # define TRACE(x...) ; #endif -bool kernel_startup; +bool kernel_startup = true; static kernel_args sKernelArgs; +static uint32 sCpuRendezvous; +static uint32 sCpuRendezvous2; static int32 main2(void *); int _start(kernel_args *bootKernelArgs, int cpu); /* keep compiler happy */ - int _start(kernel_args *bootKernelArgs, int currentCPU) { - kernel_startup = true; - if (bootKernelArgs->kernel_args_size != sizeof(kernel_args) || bootKernelArgs->version != CURRENT_KERNEL_ARGS_VERSION) { // This is something we cannot handle right now - release kernels @@ -69,11 +68,17 @@ return -1; } - memcpy(&sKernelArgs, bootKernelArgs, sizeof(kernel_args)); - // the passed in kernel args are in a non-allocated range of memory + smp_set_num_cpus(bootKernelArgs->num_cpus); - smp_set_num_cpus(sKernelArgs.num_cpus); + // wait for all the cpus to get here + smp_cpu_rendezvous(&sCpuRendezvous, currentCPU); + // the passed in kernel args are in a non-allocated range of memory + if (currentCPU == 0) + memcpy(&sKernelArgs, bootKernelArgs, sizeof(kernel_args)); + + smp_cpu_rendezvous(&sCpuRendezvous2, currentCPU); + // do any pre-booting cpu config cpu_preboot_init_percpu(&sKernelArgs, currentCPU); thread_preboot_init_percpu(&sKernelArgs, currentCPU); @@ -90,9 +95,6 @@ set_dprintf_enabled(true); dprintf("Welcome to kernel debugger output!\n"); - // we're the boot processor, so wait for all of the APs to enter the kernel - smp_wait_for_non_boot_cpus(); - // init modules TRACE("init CPU\n"); cpu_init(&sKernelArgs); @@ -154,24 +156,42 @@ TRACE("init VFS\n"); vfs_init(&sKernelArgs); - TRACE("enable interrupts, exit kernel startup\n"); + // bring up the AP cpus in a lock step fashion + TRACE("waking up AP cpus\n"); + sCpuRendezvous = sCpuRendezvous2 = 0; + smp_wake_up_non_boot_cpus(); + smp_cpu_rendezvous(&sCpuRendezvous, 0); // wait until they're booted + + // exit the kernel startup phase (mutexes, etc work from now on out) + TRACE("exiting kernel startup\n"); kernel_startup = false; - TRACE("waking up AP cpus\n"); - smp_wake_up_non_boot_cpus(); + smp_cpu_rendezvous(&sCpuRendezvous2, 0); // release the AP cpus to go enter the scheduler + TRACE("enabling interrupts and starting scheduler on cpu 0\n"); enable_interrupts(); scheduler_start(); // start a thread to finish initializing the rest of the system TRACE("starting main2 thread\n"); thread = spawn_kernel_thread(&main2, "main2", B_NORMAL_PRIORITY, NULL); + TRACE("resuming main2 thread...\n"); resume_thread(thread); } else { + // lets make sure we're in sync with the main cpu + // the boot processor has probably been sending us + // tlb sync messages all along the way, but we've + // been ignoring them + arch_cpu_global_TLB_invalidate(); + // this is run for each non boot processor after they've been set loose cpu_init_percpu(&sKernelArgs, currentCPU); smp_per_cpu_init(&sKernelArgs, currentCPU); + // wait for all other AP cpus to get to this point + smp_cpu_rendezvous(&sCpuRendezvous, currentCPU); + smp_cpu_rendezvous(&sCpuRendezvous2, currentCPU); + // welcome to the machine enable_interrupts(); scheduler_start(); Modified: haiku/trunk/src/system/kernel/smp.c =================================================================== --- haiku/trunk/src/system/kernel/smp.c 2007-03-01 07:49:43 UTC (rev 20268) +++ haiku/trunk/src/system/kernel/smp.c 2007-03-01 08:09:28 UTC (rev 20269) @@ -553,12 +553,6 @@ boot_cpu_spin[cpu] = 1; acquire_spinlock_nocheck(&boot_cpu_spin[cpu]); - // lets make sure we're in sync with the main cpu - // the boot processor has probably been sending us - // tlb sync messages all along the way, but we've - // been ignoring them - arch_cpu_global_TLB_invalidate(); - return false; } @@ -581,22 +575,16 @@ } } - +/* have all cpus spin until all have run */ void -smp_wait_for_non_boot_cpus(void) +smp_cpu_rendezvous(volatile uint32 *var, int current_cpu) { - bool retry; - int32 i; - do { - retry = false; - for (i = 1; i < sNumCPUs; i++) { - if (boot_cpu_spin[i] != 1) - retry = true; - } - } while (retry == true); + atomic_or(var, 1<id = threadID >= 0 ? threadID : allocate_thread_id(); thread->team = NULL; - // XXX terrible hack, this is to leave the early boot cpu pointers alone while being initialized -// thread->cpu = NULL; + thread->cpu = cpu; thread->sem.blocking = -1; thread->fault_handler = 0; thread->page_faults_allowed = 1; @@ -360,7 +359,7 @@ TRACE(("create_thread(%s, id = %ld, %s)\n", name, threadID, kernel ? "kernel" : "user")); - thread = create_thread_struct(NULL, name, threadID); + thread = create_thread_struct(NULL, name, threadID, NULL); if (thread == NULL) return B_NO_MEMORY; @@ -1470,7 +1469,7 @@ sprintf(name, "idle thread %lu", i + 1); thread = create_thread_struct(&sIdleThreads[i], name, - i == 0 ? team_get_kernel_team_id() : -1); + i == 0 ? team_get_kernel_team_id() : -1, &gCPU[i]); if (thread == NULL) { panic("error creating idle thread struct\n"); return B_NO_MEMORY; @@ -1491,7 +1490,6 @@ hash_insert(sThreadHash, thread); insert_thread_into_team(thread->team, thread); - thread->cpu = &gCPU[i]; } sUsedThreads = args->num_cpus; From axeld at pinc-software.de Thu Mar 1 09:16:07 2007 From: axeld at pinc-software.de (Axel =?iso-8859-15?q?D=F6rfler?=) Date: Thu, 01 Mar 2007 09:16:07 +0100 CET Subject: [Haiku-commits] r20268 - haiku/trunk/src/system/kernel/arch/x86 In-Reply-To: <200703010749.l217nipA027142@sheep.berlios.de> Message-ID: <2814187144-BeMail@zon> geist at BerliOS wrote: > Log: > the last smp change wasn't quite it. This time, make sure it maps the > right > physical page. Thanks, I completely missed that problem when doing the changes. BTW do you think it's a good idea to map something twice on other architectures than x86? At least I removed the test in vm_map_physical_memory() if the page is already mapped. Bye, Axel. From geist at foobox.com Thu Mar 1 09:23:52 2007 From: geist at foobox.com (Travis Geiselbrecht) Date: Thu, 1 Mar 2007 00:23:52 -0800 Subject: [Haiku-commits] r20268 - haiku/trunk/src/system/kernel/arch/x86 In-Reply-To: <2814187144-BeMail@zon> References: <2814187144-BeMail@zon> Message-ID: On Mar 1, 2007, at 12:16 AM, Axel D?rfler wrote: > geist at BerliOS wrote: >> Log: >> the last smp change wasn't quite it. This time, make sure it maps the >> right >> physical page. > > Thanks, I completely missed that problem when doing the changes. > BTW do you think it's a good idea to map something twice on other > architectures than x86? At least I removed the test in > vm_map_physical_memory() if the page is already mapped. Yeah, in general the situation of already having pages mapped like that is a weird case, and treating the page as already being mapped as an error is probably a good idea. I don't think the architecture really enters into it that much. It's generally a sign that your data structures have gotten out of date with reality. On reason you might want to do that is to remove the TLB flush on map(). If you can basically guarantee that nothing is already mapped there (or it's been explicitly unmapped before map) then you can leave out the TLB flush, which is a pretty big win. If things weren't so unstable at the moment I'd go ahead and remove the flush as is. In the case of map_physical_memory, there's no place to pass the flags to say B_ALREADY_MAPPED, so we're sort of stuck. I assume the api is that way to match beos. I guess for now you can sort of assume that if you're doing map_physical_memory, you probably know what you're doing. I thought of adding an unmap before the map in map_physical_memory, but not sure if we want to make it officially okay to overlap map like that. OTOH, once the vm is up and running, it should be basically impossible to double map the same virtual address, since the region slot search code would fail and not allow the new region to be created. Travis From axeld at pinc-software.de Thu Mar 1 09:33:11 2007 From: axeld at pinc-software.de (Axel =?iso-8859-15?q?D=F6rfler?=) Date: Thu, 01 Mar 2007 09:33:11 +0100 CET Subject: [Haiku-commits] =?iso-8859-15?q?r20264_-_in_haiku/trunk=3A_header?= =?iso-8859-15?q?s/private/userlandfs/private_src/add-ons/kernel/file=5Fsy?= =?iso-8859-15?q?stems/userlandfs_src/add-ons/kernel/file=5Fsystems/userla?= =?iso-8859-15?q?ndfs/kernel=5Fadd=5Fon_src/add-ons/kernel/file=5Fsystems/?= =?iso-8859-15?q?userlandfs/private_src/add-ons/kernel/file=5Fsystems/user?= =?iso-8859-15?q?landfs/server?= In-Reply-To: <200703010456.l214uA5T006454@sheep.berlios.de> Message-ID: <3838074219-BeMail@zon> bonefish at BerliOS wrote: > * Made publish_vnode() available in userland. For old style FS add- > ons > publish_vnode() is used when they request a new_vnode(). The > semantics > of new_vnode() changed considerably in Haiku, but publish_vnode() > seems to do pretty much what the old new_vnode() did. Yes, that's the basic idea :-) Since you can't atomically create an on-disk inode *and* call new_vnode() at the same time, Haiku breaks this down into two separate functions: new_vnode() only reserves the space, while publish_vnode() actually makes the vnode available. This saves quite a bit of locking in the FS implementations. > * The UserlandFS hosted RamFS begins to work under Haiku. It runs > pretty > soon out of memory though (under vmware with 256 MB) and node > monitoring is broken ATM. Neat, nice progess :-) Bye, Axel. From korli at users.berlios.de Thu Mar 1 09:34:03 2007 From: korli at users.berlios.de (=?ISO-8859-1?Q?J=E9r=F4me_Duval?=) Date: Thu, 1 Mar 2007 09:34:03 +0100 Subject: [Haiku-commits] r20252 - haiku/trunk/headers/private/kernel/util In-Reply-To: <51766222744-BeMail@zon> References: <200702281935.l1SJZw97012769@sheep.berlios.de> <51766222744-BeMail@zon> Message-ID: 2007/2/28, Axel D?rfler : > korli at BerliOS wrote: > > Log: > > fixed the build; I also changed MoveFrom(), untested > > Thanks, I guess you're using GCC4, right? As GCC2.95.3 shouldn't care > about unused templates. > Yes, I would have been surprised if you broke all builds together :) Bye, J?r?me From marcusoverhagen at arcor.de Thu Mar 1 09:36:29 2007 From: marcusoverhagen at arcor.de (Marcus Overhagen) Date: Thu, 1 Mar 2007 09:36:29 +0100 (CET) Subject: [Haiku-commits] r20256 - in haiku/trunk: headers/os/drivers src/system/kernel/fs In-Reply-To: <200702282224.l1SMOTLA032083@sheep.berlios.de> References: <200702282224.l1SMOTLA032083@sheep.berlios.de> Message-ID: <22300393.1172738189830.JavaMail.ngmail@webmail13> bonefish at BerliOS wrote: > +extern "C" status_t > +is_vnode_removed(mount_id mountID, vnode_id vnodeID) > + if (vnode) > + result = vnode->remove ? 1 : 0; > + else > + result = B_BAD_VALUE; That mix of bool and status_t is really crude, especially because false == B_OK. Wouldn't it be enough to return a bool only, with B_BAD_VALUE = true ? or make it status_t is_vnode_removed(mount_id mountID, vnode_id vnodeID, bool *_removed) regards Marcus Viel oder wenig? Schnell oder langsam? Unbegrenzt surfen + telefonieren ohne Zeit- und Volumenbegrenzung? DAS TOP ANGEBOT JETZT bei Arcor: g?nstig und schnell mit DSL - das All-Inclusive-Paket f?r clevere Doppel-Sparer, nur 39,85 ? inkl. DSL- und ISDN-Grundgeb?hr! http://www.arcor.de/rd/emf-dsl-2 From jackburton at mail.berlios.de Thu Mar 1 09:47:06 2007 From: jackburton at mail.berlios.de (jackburton at BerliOS) Date: Thu, 1 Mar 2007 09:47:06 +0100 Subject: [Haiku-commits] r20270 - haiku/trunk/src/tests/kits/interface/picture Message-ID: <200703010847.l218l6Qu030020@sheep.berlios.de> Author: jackburton Date: 2007-03-01 09:47:05 +0100 (Thu, 01 Mar 2007) New Revision: 20270 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20270&view=rev Modified: haiku/trunk/src/tests/kits/interface/picture/PictureTest.cpp Log: Unflattening the picture was obviously failing because we didn't rewind the stream after Flattening. Now Unflattening works, but the picture seems to be empty Modified: haiku/trunk/src/tests/kits/interface/picture/PictureTest.cpp =================================================================== --- haiku/trunk/src/tests/kits/interface/picture/PictureTest.cpp 2007-03-01 08:09:28 UTC (rev 20269) +++ haiku/trunk/src/tests/kits/interface/picture/PictureTest.cpp 2007-03-01 08:47:05 UTC (rev 20270) @@ -116,6 +116,7 @@ if (status != B_OK) printf("Error flattening BPicture: %s\n", strerror(status)); if (status == B_OK) { + stream.Seek(0, SEEK_SET); fPicture = new BPicture(); status = fPicture->Unflatten(&stream); if (status != B_OK) From axeld at mail.berlios.de Thu Mar 1 10:00:52 2007 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Thu, 1 Mar 2007 10:00:52 +0100 Subject: [Haiku-commits] r20271 - in haiku/trunk: headers/private/graphics/radeon src/add-ons/accelerants/radeon src/add-ons/kernel/drivers/graphics/radeon Message-ID: <200703010900.l2190qj6031149@sheep.berlios.de> Author: axeld Date: 2007-03-01 10:00:49 +0100 (Thu, 01 Mar 2007) New Revision: 20271 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20271&view=rev Modified: haiku/trunk/headers/private/graphics/radeon/2d_regs.h haiku/trunk/headers/private/graphics/radeon/buscntrl_regs.h haiku/trunk/headers/private/graphics/radeon/config_regs.h haiku/trunk/headers/private/graphics/radeon/fp_regs.h haiku/trunk/headers/private/graphics/radeon/memcntrl_regs.h haiku/trunk/headers/private/graphics/radeon/overlay_regs.h haiku/trunk/headers/private/graphics/radeon/pll_access.h haiku/trunk/headers/private/graphics/radeon/pll_regs.h haiku/trunk/headers/private/graphics/radeon/radeon_interface.h haiku/trunk/headers/private/graphics/radeon/version.h haiku/trunk/src/add-ons/accelerants/radeon/ProposeDisplayMode.c haiku/trunk/src/add-ons/accelerants/radeon/SetDisplayMode.c haiku/trunk/src/add-ons/accelerants/radeon/crtc.c haiku/trunk/src/add-ons/accelerants/radeon/dpms.c haiku/trunk/src/add-ons/accelerants/radeon/driver_wrapper.c haiku/trunk/src/add-ons/accelerants/radeon/flat_panel.c haiku/trunk/src/add-ons/accelerants/radeon/internal_tv_out.c haiku/trunk/src/add-ons/accelerants/radeon/monitor_detection.c haiku/trunk/src/add-ons/accelerants/radeon/monitor_routing.c haiku/trunk/src/add-ons/accelerants/radeon/overlay_management.c haiku/trunk/src/add-ons/accelerants/radeon/palette.c haiku/trunk/src/add-ons/accelerants/radeon/pll.c haiku/trunk/src/add-ons/accelerants/radeon/radeon_accelerant.h haiku/trunk/src/add-ons/accelerants/radeon/set_mode.h haiku/trunk/src/add-ons/kernel/drivers/graphics/radeon/CP_setup.c haiku/trunk/src/add-ons/kernel/drivers/graphics/radeon/bios.c haiku/trunk/src/add-ons/kernel/drivers/graphics/radeon/detect.c haiku/trunk/src/add-ons/kernel/drivers/graphics/radeon/driver.c haiku/trunk/src/add-ons/kernel/drivers/graphics/radeon/init.c haiku/trunk/src/add-ons/kernel/drivers/graphics/radeon/mem_controller.c haiku/trunk/src/add-ons/kernel/drivers/graphics/radeon/pll_access.c haiku/trunk/src/add-ons/kernel/drivers/graphics/radeon/radeon_driver.h Log: First of a set of patches by Euan Kirkhope: * Headers updated * PLL errata workarounds * Radeon asic type overhaul (consolidated) * Device IDs Updated. * support for X-series devices with legacy bios type * minor tidy ups / compiler warnings (casts) Modified: haiku/trunk/headers/private/graphics/radeon/2d_regs.h =================================================================== --- haiku/trunk/headers/private/graphics/radeon/2d_regs.h 2007-03-01 08:47:05 UTC (rev 20270) +++ haiku/trunk/headers/private/graphics/radeon/2d_regs.h 2007-03-01 09:00:49 UTC (rev 20271) @@ -183,7 +183,7 @@ #define RADEON_DST_LINE_START 0x1600 #define RADEON_DST_LINE_END 0x1604 #define RADEON_DST_LINE_PATCOUNT 0x1608 - +# define RADEON_BRES_CNTL_SHIFT 8 #define RADEON_DEFAULT_OFFSET 0x16e0 #define RADEON_DEFAULT_PITCH 0x16e4 Modified: haiku/trunk/headers/private/graphics/radeon/buscntrl_regs.h =================================================================== --- haiku/trunk/headers/private/graphics/radeon/buscntrl_regs.h 2007-03-01 08:47:05 UTC (rev 20270) +++ haiku/trunk/headers/private/graphics/radeon/buscntrl_regs.h 2007-03-01 09:00:49 UTC (rev 20271) @@ -56,6 +56,6 @@ #define RADEON_HOST_PATH_CNTL 0x0130 # define RADEON_HDP_SOFT_RESET (1 << 26) +# define RADEON_HDP_APER_CNTL (1 << 23) - #endif Modified: haiku/trunk/headers/private/graphics/radeon/config_regs.h =================================================================== --- haiku/trunk/headers/private/graphics/radeon/config_regs.h 2007-03-01 08:47:05 UTC (rev 20270) +++ haiku/trunk/headers/private/graphics/radeon/config_regs.h 2007-03-01 09:00:49 UTC (rev 20271) @@ -11,9 +11,16 @@ #define _CONFIG_REGS_H // mmio registers +#define RADEON_CONFIG_APER_0_BASE 0x0100 +#define RADEON_CONFIG_APER_1_BASE 0x0104 +#define RADEON_CONFIG_APER_SIZE 0x0108 + #define RADEON_CONFIG_CNTL 0x00e0 -#define RADEON_CFG_ATI_REV_ID_SHIFT 16 -#define RADEON_CFG_ATI_REV_ID_MASK (0xf << 16) +# define RADEON_CFG_ATI_REV_A11 (0 << 16) +# define RADEON_CFG_ATI_REV_A12 (1 << 16) +# define RADEON_CFG_ATI_REV_A13 (2 << 16) +# define RADEON_CFG_ATI_REV_ID_MASK (0xf << 16) +#define RADEON_CFG_ATI_REV_ID_SHIFT 16 #define RADEON_CONFIG_MEMSIZE 0x00f8 # define RADEON_CONFIG_MEMSIZE_MASK 0x1ff00000 Modified: haiku/trunk/headers/private/graphics/radeon/fp_regs.h =================================================================== --- haiku/trunk/headers/private/graphics/radeon/fp_regs.h 2007-03-01 08:47:05 UTC (rev 20270) +++ haiku/trunk/headers/private/graphics/radeon/fp_regs.h 2007-03-01 09:00:49 UTC (rev 20271) @@ -108,5 +108,13 @@ #define RADEON_FP_V2_SYNC_STRT_WID 0x03c8 +#define RADEON_BIOS_0_SCRATCH 0x0010 +#define RADEON_BIOS_1_SCRATCH 0x0014 +#define RADEON_BIOS_2_SCRATCH 0x0018 +#define RADEON_BIOS_3_SCRATCH 0x001c +#define RADEON_BIOS_4_SCRATCH 0x0020 +#define RADEON_BIOS_5_SCRATCH 0x0024 +#define RADEON_BIOS_6_SCRATCH 0x0028 +#define RADEON_BIOS_7_SCRATCH 0x002c #endif Modified: haiku/trunk/headers/private/graphics/radeon/memcntrl_regs.h =================================================================== --- haiku/trunk/headers/private/graphics/radeon/memcntrl_regs.h 2007-03-01 08:47:05 UTC (rev 20270) +++ haiku/trunk/headers/private/graphics/radeon/memcntrl_regs.h 2007-03-01 09:00:49 UTC (rev 20271) @@ -12,7 +12,11 @@ #define RADEON_AGP_BASE 0x0170 #define RADEON_MEM_CNTL 0x0140 - +# define RADEON_MEM_NUM_CHANNELS_MASK 0x01 +# define RADEON_MEM_USE_B_CH_ONLY (1<<1) +# define RV100_HALF_MODE (1<<3) +# define R300_MEM_NUM_CHANNELS_MASK 0x03 +# define R300_MEM_USE_CD_CH_ONLY (1<<2) #define RADEON_MC_AGP_LOCATION 0x014c #define RADEON_MC_FB_LOCATION 0x0148 #define RADEON_MEM_INIT_LAT_TIMER 0x0154 @@ -20,7 +24,7 @@ # define RADEON_MEM_CFG_TYPE_MASK (1 << 30) # define RADEON_MEM_CFG_SDR (0 << 30) # define RADEON_MEM_CFG_DDR (1 << 30) -#define RADEON_GC_NB_TOM 0x015c +#define RADEON_NB_TOM 0x015c #define RADEON_DISPLAY_BASE_ADDRESS 0x023c #define RADEON_CRTC2_DISPLAY_BASE_ADDRESS 0x033c #define RADEON_OV0_BASE_ADDRESS 0x043c Modified: haiku/trunk/headers/private/graphics/radeon/overlay_regs.h =================================================================== --- haiku/trunk/headers/private/graphics/radeon/overlay_regs.h 2007-03-01 08:47:05 UTC (rev 20270) +++ haiku/trunk/headers/private/graphics/radeon/overlay_regs.h 2007-03-01 09:00:49 UTC (rev 20271) @@ -40,14 +40,14 @@ # define RADEON_SCALER_ADAPTIVE_DEINT 0x00001000L # define R200_SCALER_TEMPORAL_DEINT 0x00002000L # define RADEON_SCALER_CRTC_SEL 0x00004000L -//# define RADEON_SCALER_SMART_SWITCH 0x00008000L +# define RADEON_SCALER_SMART_SWITCH 0x00008000L # define RADEON_SCALER_BURST_PER_PLANE 0x007F0000L # define RADEON_SCALER_DOUBLE_BUFFER 0x01000000L # define RADEON_SCALER_DIS_LIMIT 0x08000000L +# define RADEON_SCALER_LIN_TRANS_BYPASS 0x10000000L # define RADEON_SCALER_INT_EMU 0x20000000L # define RADEON_SCALER_ENABLE 0x40000000L # define RADEON_SCALER_SOFT_RESET 0x80000000L -# define RADEON_SCALER_ADAPTIVE_DEINT 0x00001000L #define RADEON_OV0_V_INC 0x0424 #define RADEON_OV0_P1_V_ACCUM_INIT 0x0428 # define RADEON_OV0_P1_MAX_LN_IN_PER_LN_OUT 0x00000003L Modified: haiku/trunk/headers/private/graphics/radeon/pll_access.h =================================================================== --- haiku/trunk/headers/private/graphics/radeon/pll_access.h 2007-03-01 08:47:05 UTC (rev 20270) +++ haiku/trunk/headers/private/graphics/radeon/pll_access.h 2007-03-01 09:00:49 UTC (rev 20271) @@ -13,11 +13,16 @@ #include "mmio.h" -// r300: to be called after each CLOCK_CNTL_INDEX access; +// to be called after each CLOCK_CNTL_INDEX access; // all functions declared in this header take care of that // (hardware bug fix suggested by XFree86) -void R300_PLLFix( vuint8 *regs, radeon_type asic ); +void RADEONPllErrataAfterIndex( vuint8 *regs, radeon_type asic ); +// to be called after each CLOCK_CNTL_DATA access; +// all functions declared in this header take care of that +// (hardware bug fix suggested by XFree86) +void RADEONPllErrataAfterData( vuint8 *regs, radeon_type asic ); + // in general: // - the PLL is connected via special port // - you need first to choose the PLL register and then write/read its value Modified: haiku/trunk/headers/private/graphics/radeon/pll_regs.h =================================================================== --- haiku/trunk/headers/private/graphics/radeon/pll_regs.h 2007-03-01 08:47:05 UTC (rev 20270) +++ haiku/trunk/headers/private/graphics/radeon/pll_regs.h 2007-03-01 09:00:49 UTC (rev 20271) @@ -19,7 +19,18 @@ # define RADEON_PLL_DIV_SEL_DIV1 (1 << 8) # define RADEON_PLL_DIV_SEL_DIV2 (2 << 8) # define RADEON_PLL_DIV_SEL_DIV3 (3 << 8) +#define RADEON_CLK_PIN_CNTL 0x0001 /* PLL */ +# define RADEON_SCLK_DYN_START_CNTL (1 << 15) +// PLL Power management registers +#define RADEON_CLK_PWRMGT_CNTL 0x0014 +# define RADEON_ENGIN_DYNCLK_MODE (1 << 12) +# define RADEON_ACTIVE_HILO_LAT_MASK (3 << 13) +# define RADEON_ACTIVE_HILO_LAT_SHIFT 13 +# define RADEON_DISP_DYN_STOP_LAT_MASK (1 << 12) +# define RADEON_DYN_STOP_MODE_MASK (7 << 21) +#define RADEON_PLL_PWRMGT_CNTL 0x0015 +# define RADEON_TCL_BYPASS_DISABLE (1 << 20) // indirect PLL registers #define RADEON_CLK_PIN_CNTL 0x0001 @@ -55,12 +66,46 @@ # define RADEON_ECP_DIV_VCLK_2 (1 << 8) # define RADEON_VCLK_ECP_CNTL_BYTE_CLK_POST_DIV_SHIFT 16 # define RADEON_VCLK_ECP_CNTL_BYTE_CLK_POST_DIV_MASK (3 << 16) +# define R300_DISP_DAC_PIXCLK_DAC_BLANK_OFF (1<<23) + #define RADEON_HTOTAL_CNTL 0x0009 -#define RADEON_SCLK_CNTL 0x000d +#define RADEON_SCLK_CNTL 0x000d /* PLL */ +# define RADEON_SCLK_SRC_SEL_MASK 0x0007 # define RADEON_DYN_STOP_LAT_MASK 0x00007ff8 # define RADEON_CP_MAX_DYN_STOP_LAT 0x0008 # define RADEON_SCLK_FORCEON_MASK 0xffff8000 -#define RADEON_SCLK_MORE_CNTL 0x0035 +# define RADEON_SCLK_FORCE_DISP2 (1<<15) +# define RADEON_SCLK_FORCE_CP (1<<16) +# define RADEON_SCLK_FORCE_HDP (1<<17) +# define RADEON_SCLK_FORCE_DISP1 (1<<18) +# define RADEON_SCLK_FORCE_TOP (1<<19) +# define RADEON_SCLK_FORCE_E2 (1<<20) +# define RADEON_SCLK_FORCE_SE (1<<21) +# define RADEON_SCLK_FORCE_IDCT (1<<22) +# define RADEON_SCLK_FORCE_VIP (1<<23) +# define RADEON_SCLK_FORCE_RE (1<<24) +# define RADEON_SCLK_FORCE_PB (1<<25) +# define RADEON_SCLK_FORCE_TAM (1<<26) +# define RADEON_SCLK_FORCE_TDM (1<<27) +# define RADEON_SCLK_FORCE_RB (1<<28) +# define RADEON_SCLK_FORCE_TV_SCLK (1<<29) +# define RADEON_SCLK_FORCE_SUBPIC (1<<30) +# define RADEON_SCLK_FORCE_OV0 (1<<31) +# define R300_SCLK_FORCE_VAP (1<<21) +# define R300_SCLK_FORCE_SR (1<<25) +# define R300_SCLK_FORCE_PX (1<<26) +# define R300_SCLK_FORCE_TX (1<<27) +# define R300_SCLK_FORCE_US (1<<28) +# define R300_SCLK_FORCE_SU (1<<30) +#define R300_SCLK_CNTL2 0x1e /* PLL */ +# define R300_SCLK_TCL_MAX_DYN_STOP_LAT (1<<10) +# define R300_SCLK_GA_MAX_DYN_STOP_LAT (1<<11) +# define R300_SCLK_CBA_MAX_DYN_STOP_LAT (1<<12) +# define R300_SCLK_FORCE_TCL (1<<13) +# define R300_SCLK_FORCE_CBA (1<<14) +# define R300_SCLK_FORCE_GA (1<<15) +#define RADEON_SCLK_MORE_CNTL 0x0035 /* PLL */ +# define RADEON_SCLK_MORE_MAX_DYN_STOP_LAT 0x0007 # define RADEON_SCLK_MORE_FORCEON 0x0700 #define RADEON_MCLK_CNTL 0x0012 # define RADEON_FORCEON_MCLKA (1 << 16) @@ -69,6 +114,13 @@ # define RADEON_FORCEON_YCLKB (1 << 19) # define RADEON_FORCEON_MC (1 << 20) # define RADEON_FORCEON_AIC (1 << 21) +# define R300_DISABLE_MC_MCLKA (1 << 21) +# define R300_DISABLE_MC_MCLKB (1 << 21) +#define RADEON_MCLK_MISC 0x001f /* PLL */ +# define RADEON_MC_MCLK_MAX_DYN_STOP_LAT (1<<12) +# define RADEON_IO_MCLK_MAX_DYN_STOP_LAT (1<<13) +# define RADEON_MC_MCLK_DYN_ENABLE (1 << 14) +# define RADEON_IO_MCLK_DYN_ENABLE (1 << 15) #define RADEON_P2PLL_CNTL 0x002a # define RADEON_P2PLL_RESET (1 << 0) # define RADEON_P2PLL_SLEEP (1 << 1) @@ -90,8 +142,23 @@ # define RADEON_PIXCLK_TV_SRC_SEL_MASK (1 << 8) # define RADEON_PIXCLK_TV_SRC_SEL_PIXCLK (0 << 8) # define RADEON_PIXCLK_TV_SRC_SEL_PIX2CLK (1 << 8) +# define RADEON_PIX2CLK_SRC_SEL_BYTECLK 0x02 +# define RADEON_PIX2CLK_ALWAYS_ONb (1<<6) +# define RADEON_PIX2CLK_DAC_ALWAYS_ONb (1<<7) +# define RADEON_PIXCLK_TV_SRC_SEL (1 << 8) +# define RADEON_DISP_TVOUT_PIXCLK_TV_ALWAYS_ONb (1 << 9) +# define R300_DVOCLK_ALWAYS_ONb (1 << 10) +# define RADEON_PIXCLK_BLEND_ALWAYS_ONb (1 << 11) +# define RADEON_PIXCLK_GV_ALWAYS_ONb (1 << 12) +# define RADEON_PIXCLK_DIG_TMDS_ALWAYS_ONb (1 << 13) +# define R300_PIXCLK_DVO_ALWAYS_ONb (1 << 13) # define RADEON_PIXCLK_LVDS_ALWAYS_ONb (1 << 14) # define RADEON_PIXCLK_TMDS_ALWAYS_ONb (1 << 15) +# define R300_PIXCLK_TRANS_ALWAYS_ONb (1 << 16) +# define R300_PIXCLK_TVO_ALWAYS_ONb (1 << 17) +# define R300_P2G2CLK_ALWAYS_ONb (1 << 18) +# define R300_P2G2CLK_DAC_ALWAYS_ONb (1 << 19) +# define R300_DISP_DAC_PIXCLK_DAC2_BLANK_OFF (1 << 23) #define RADEON_HTOTAL2_CNTL 0x002e Modified: haiku/trunk/headers/private/graphics/radeon/radeon_interface.h =================================================================== --- haiku/trunk/headers/private/graphics/radeon/radeon_interface.h 2007-03-01 08:47:05 UTC (rev 20270) +++ haiku/trunk/headers/private/graphics/radeon/radeon_interface.h 2007-03-01 09:00:49 UTC (rev 20271) @@ -17,8 +17,8 @@ #include #include "video_overlay.h" #include "benaphore.h" +#include "ddc.h" - // magic code for ioctls #define RADEON_PRIVATE_DATA_MAGIC 'TKRA' @@ -94,31 +94,46 @@ // type of ASIC typedef enum { rt_r100, // original Radeon - rt_ve, // original VE version - rt_m6, // original mobile Radeon + rt_rv100, // original VE version rt_rs100, // IGP 320M rt_rv200, // Radeon 7500 - rt_m7, // mobile Radeon 7500 rt_rs200, // IGP 330M/340M/350M rt_r200, // Radeon 8500/9100 rt_rv250, // Radeon 9000 - rt_m9, // mobile Radeon 9000 - rt_rv280, // Radeon 9200 - rt_m9plus, // mobile Radeon 9200 - - // from here on, r300 and up must be located as ATI modified the PLL - // with r300 and the code only tests for >= rt_r300 + rt_rs300, // IGP rs300 + rt_rv280, // Radeon 9200 + // from here on, r300 and up must be located as ATI modified the + // PLL design and the PLL code only tests for >= rt_r300 rt_r300, // Radeon 9700 - rt_r300_4p, // Radeon 9500 + rt_r350, // Radeon 9800 rt_rv350, // Radeon 9600 - rt_m10, // mobile Radeon 9600 - rt_rv360, // Radeon 9600 - rt_r350, // Radeon 9800 - rt_r360, // Radeon 9800 - rt_m11 // Radeon 9700 Mobility + rt_rv380, // X600 + rt_r420 // X800 } radeon_type; +#define IS_RV100_VARIANT ( \ + (ai->si->asic == rt_rv100) || \ + (ai->si->asic == rt_rv200) || \ + (ai->si->asic == rt_rs100) || \ + (ai->si->asic == rt_rs200) || \ + (ai->si->asic == rt_rv250) || \ + (ai->si->asic == rt_rv280) || \ + (ai->si->asic == rt_rs300)) +#define IS_DI_R300_VARIANT ( \ + (di->asic == rt_r300) || \ + (di->asic == rt_r350) || \ + (di->asic == rt_rv350) || \ + (di->asic == rt_rv380) || \ + (di->asic == rt_r420)) + +#define IS_R300_VARIANT ( \ + (ai->si->asic == rt_r300) || \ + (ai->si->asic == rt_r350) || \ + (ai->si->asic == rt_rv350) || \ + (ai->si->asic == rt_rv380) || \ + (ai->si->asic == rt_r420)) + // TV standard typedef enum { ts_off, @@ -390,22 +405,25 @@ benaphore lock; // engine lock } engine; - uint16 vendor_id; // PCI vendor id - uint16 device_id; // PCI device id - uint8 revision; // PCI device revision + uint16 vendor_id; // PCI vendor id + uint16 device_id; // PCI device id + uint8 revision; // PCI device revision - //bool has_crtc2; // has second CRTC - radeon_type asic; // ASIC version - bool is_mobility; // mobility version - tv_chip_type tv_chip; // type of TV-Out encoder - bool new_pll; // r300 style PLL - - uint8 theatre_channel; // VIP channel of Rage Theatre (if applicable) + //bool has_crtc2; // has second CRTC + radeon_type asic; // ASIC version + bool is_mobility; // mobility version + bool is_igp; // might need to know if it's an integrated chip + bool is_atombios; + tv_chip_type tv_chip; // type of TV-Out encoder + bool new_pll; // r300 style PLL + bool has_no_i2c; // I2C is broken + uint16 panel_pwr_delay;// delay for LCD backlight to stabilise + uint8 theatre_channel;// VIP channel of Rage Theatre (if applicable) general_pll_info pll; - area_id regs_area; // area of memory mapped registers - area_id ROM_area; // area of ROM + area_id regs_area; // area of memory mapped registers + area_id ROM_area; // area of ROM //area_id fb_area; // area of frame buffer void *framebuffer_pci; // physical address of frame buffer (aka local memory) // this is a hack needed by BeOS Modified: haiku/trunk/headers/private/graphics/radeon/version.h =================================================================== --- haiku/trunk/headers/private/graphics/radeon/version.h 2007-03-01 08:47:05 UTC (rev 20270) +++ haiku/trunk/headers/private/graphics/radeon/version.h 2007-03-01 09:00:49 UTC (rev 20271) @@ -8,4 +8,4 @@ */ // current version -#define RADEON_DRIVER_VERSION "Version: 5.1.0.1" +#define RADEON_DRIVER_VERSION "Version: 5.1.1.1" Modified: haiku/trunk/src/add-ons/accelerants/radeon/ProposeDisplayMode.c =================================================================== --- haiku/trunk/src/add-ons/accelerants/radeon/ProposeDisplayMode.c 2007-03-01 08:47:05 UTC (rev 20270) +++ haiku/trunk/src/add-ons/accelerants/radeon/ProposeDisplayMode.c 2007-03-01 09:00:49 UTC (rev 20271) @@ -62,6 +62,8 @@ { { 108000, 1280, 1376, 1488, 1800, 960, 961, 964, 1000, T_POSITIVE_SYNC}, B_CMAP8, 1152, 864, 0, 0, MODE_FLAGS}, /* Vesa_Monitor_ at 60Hz_(1280X960X8.Z1) - not in Be's list */ { { 148500, 1280, 1344, 1504, 1728, 960, 961, 964, 1011, T_POSITIVE_SYNC}, B_CMAP8, 1152, 864, 0, 0, MODE_FLAGS}, /* Vesa_Monitor_ at 85Hz_(1280X960X8.Z1) - not in Be's list */ +{ { 147100, 1680, 1784, 1968, 2256, 1050, 1051, 1054, 1087, T_POSITIVE_SYNC}, B_CMAP8, 1680, 1050, 0, 0, MODE_FLAGS}, /* Vesa_Monitor_ at 60Hz_(1680X1050) */ + { { 108000, 1280, 1328, 1440, 1688, 1024, 1025, 1028, 1066, T_POSITIVE_SYNC}, B_CMAP8, 1280, 1024, 0, 0, MODE_FLAGS}, /* Vesa_Monitor_ at 60Hz_(1280X1024X8.Z1) */ { { 135000, 1280, 1296, 1440, 1688, 1024, 1025, 1028, 1066, T_POSITIVE_SYNC}, B_CMAP8, 1280, 1024, 0, 0, MODE_FLAGS}, /* Vesa_Monitor_ at 75Hz_(1280X1024X8.Z1) */ { { 157500, 1280, 1344, 1504, 1728, 1024, 1025, 1028, 1072, T_POSITIVE_SYNC}, B_CMAP8, 1280, 1024, 0, 0, MODE_FLAGS}, /* Vesa_Monitor_ at 85Hz_(1280X1024X8.Z1) */ Modified: haiku/trunk/src/add-ons/accelerants/radeon/SetDisplayMode.c =================================================================== --- haiku/trunk/src/add-ons/accelerants/radeon/SetDisplayMode.c 2007-03-01 08:47:05 UTC (rev 20270) +++ haiku/trunk/src/add-ons/accelerants/radeon/SetDisplayMode.c 2007-03-01 09:00:49 UTC (rev 20271) @@ -20,11 +20,15 @@ #include "overlay_regs.h" #include "rbbm_regs.h" #include "dac_regs.h" +#include "fp_regs.h" +#include "gpiopad_regs.h" #include "set_mode.h" #include +void Radeon_SetMode( + accelerator_info *ai, crtc_info *crtc, display_mode *mode, impactv_params *tv_params ); // round virtual width up to next valid size uint32 Radeon_RoundVWidth( Modified: haiku/trunk/src/add-ons/accelerants/radeon/crtc.c =================================================================== --- haiku/trunk/src/add-ons/accelerants/radeon/crtc.c 2007-03-01 08:47:05 UTC (rev 20270) +++ haiku/trunk/src/add-ons/accelerants/radeon/crtc.c 2007-03-01 09:00:49 UTC (rev 20271) @@ -12,6 +12,7 @@ #include "crtc_regs.h" #include "GlobalData.h" #include "set_mode.h" +#include "generic.h" // hammer CRTC registers Modified: haiku/trunk/src/add-ons/accelerants/radeon/dpms.c =================================================================== --- haiku/trunk/src/add-ons/accelerants/radeon/dpms.c 2007-03-01 08:47:05 UTC (rev 20270) +++ haiku/trunk/src/add-ons/accelerants/radeon/dpms.c 2007-03-01 09:00:49 UTC (rev 20271) @@ -16,6 +16,7 @@ #include "tv_out_regs.h" #include "theatre_regs.h" #include "GlobalData.h" +#include "generic.h" // public function: set DPMS mode @@ -78,13 +79,13 @@ old_pixclks_cntl = Radeon_INPLL( ai->regs, ai->si->asic, RADEON_PIXCLKS_CNTL); // ASIC bug: when LVDS_ON is reset, LVDS_ALWAYS_ON must be zero - if( ai->si->is_mobility || ai->si->asic == rt_rs100 ) + if( ai->si->is_mobility || ai->si->is_igp ) Radeon_OUTPLLP( ai->regs, ai->si->asic, RADEON_PIXCLKS_CNTL, 0, ~RADEON_PIXCLK_LVDS_ALWAYS_ONb ); OUTREGP( regs, RADEON_LVDS_GEN_CNTL, RADEON_LVDS_DISPLAY_DIS, ~(RADEON_LVDS_DISPLAY_DIS | RADEON_LVDS_BLON | RADEON_LVDS_ON) ); - if( ai->si->is_mobility || ai->si->asic == rt_rs100 ) + if( ai->si->is_mobility || ai->si->is_igp ) Radeon_OUTPLL( ai->regs, ai->si->asic, RADEON_PIXCLKS_CNTL, old_pixclks_cntl ); break; } Modified: haiku/trunk/src/add-ons/accelerants/radeon/driver_wrapper.c =================================================================== --- haiku/trunk/src/add-ons/accelerants/radeon/driver_wrapper.c 2007-03-01 08:47:05 UTC (rev 20270) +++ haiku/trunk/src/add-ons/accelerants/radeon/driver_wrapper.c 2007-03-01 09:00:49 UTC (rev 20271) @@ -9,7 +9,10 @@ #include "radeon_accelerant.h" #include +#include "rbbm_regs.h" +#include "mmio.h" + status_t Radeon_WaitForIdle( accelerator_info *ai, bool keep_lock ) { radeon_wait_for_idle wfi; Modified: haiku/trunk/src/add-ons/accelerants/radeon/flat_panel.c =================================================================== --- haiku/trunk/src/add-ons/accelerants/radeon/flat_panel.c 2007-03-01 08:47:05 UTC (rev 20270) +++ haiku/trunk/src/add-ons/accelerants/radeon/flat_panel.c 2007-03-01 09:00:49 UTC (rev 20271) @@ -13,6 +13,8 @@ #include "memcntrl_regs.h" #include "utils.h" #include "set_mode.h" +#include "pll_regs.h" +#include "pll_access.h" void Radeon_ReadRMXRegisters( @@ -125,7 +127,7 @@ values->fp2_h_sync_strt_wid = INREG( regs, RADEON_FP_H2_SYNC_STRT_WID ); values->fp2_v_sync_strt_wid = INREG( regs, RADEON_FP_V2_SYNC_STRT_WID ); - SHOW_FLOW( 2, "before: fp_gen_cntl=%lx, horz=%lx, vert=%lx, lvds_gen_cntl=%lx", + SHOW_FLOW( 2, "before: fp_gen_cntl=%08lx, horz=%08lx, vert=%08lx, lvds_gen_cntl=%08lx", values->fp_gen_cntl, values->fp_horz_stretch, values->fp_vert_stretch, values->lvds_gen_cntl ); } @@ -185,7 +187,7 @@ values->fp2_gen_cntl |= RADEON_FP2_DV0_EN; } - SHOW_FLOW( 2, "after: fp_gen_cntl=%lx, horz=%lx, vert=%lx, lvds_gen_cntl=%lx", + SHOW_FLOW( 2, "after: fp_gen_cntl=%08lx, horz=%08lx, vert=%08lx, lvds_gen_cntl=%08lx", values->fp_gen_cntl, values->fp_horz_stretch, values->fp_vert_stretch, values->lvds_gen_cntl ); } Modified: haiku/trunk/src/add-ons/accelerants/radeon/internal_tv_out.c =================================================================== --- haiku/trunk/src/add-ons/accelerants/radeon/internal_tv_out.c 2007-03-01 08:47:05 UTC (rev 20270) +++ haiku/trunk/src/add-ons/accelerants/radeon/internal_tv_out.c 2007-03-01 09:00:49 UTC (rev 20271) @@ -122,6 +122,7 @@ // read timing FIFO +#if 0 static uint32 Radeon_InternalTVOutReadFIFO( accelerator_info *ai, uint16 addr ) { @@ -151,8 +152,8 @@ return res; } +#endif - // write to timing FIFO static void Radeon_InternalTVOutWriteFIFO( accelerator_info *ai, uint16 addr, uint32 value ) Modified: haiku/trunk/src/add-ons/accelerants/radeon/monitor_detection.c =================================================================== --- haiku/trunk/src/add-ons/accelerants/radeon/monitor_detection.c 2007-03-01 08:47:05 UTC (rev 20270) +++ haiku/trunk/src/add-ons/accelerants/radeon/monitor_detection.c 2007-03-01 09:00:49 UTC (rev 20271) @@ -16,11 +16,13 @@ #include "config_regs.h" #include "ddc_regs.h" #include "gpiopad_regs.h" +#include "fp_regs.h" #include "pll_access.h" #include "theatre_regs.h" #include "set_mode.h" #include "ddc.h" #include +#include "string.h" typedef struct { accelerator_info *ai; @@ -294,34 +296,31 @@ // check whether there is a CRT connected to TV-DAC static bool Radeon_DetectTVCRT( accelerator_info *ai ) { + if (ai->si->is_mobility) + return dd_none; + switch( ai->si->asic ) { case rt_r100: - case rt_m6: - case rt_m7: - case rt_m9: - case rt_m9plus: - case rt_m10: // original Radeons have pure DVI only and mobility chips // have no DVI connector // TBD: can they have a docking station for CRT on TV-DAC? return dd_none; - case rt_ve: + case rt_rv100: case rt_rv200: case rt_rv250: case rt_rv280: // IGP is guessed case rt_rs100: case rt_rs200: + case rt_rs300: return Radeon_DetectTVCRT_RV200( ai ); case rt_r300: - case rt_r300_4p: - case rt_rv350: - case rt_rv360: case rt_r350: - case rt_r360: - case rt_m11: + case rt_rv350: + case rt_rv380: + case rt_r420: return Radeon_DetectTVCRT_R300( ai ); case rt_r200: @@ -662,27 +661,21 @@ case rt_r200: return Radeon_DetectTV_Theatre( ai ); - case rt_ve: - case rt_m6: + case rt_rv100: case rt_rv200: - case rt_m7: case rt_rv250: - case rt_m9: case rt_rv280: - case rt_m9plus: // IGP method is guessed case rt_rs100: case rt_rs200: + case rt_rs300: return Radeon_DetectTV_RV200( ai, tv_crt_found ); case rt_r300: - case rt_r300_4p: - case rt_rv350: - case rt_rv360: - case rt_m10: - case rt_m11: case rt_r350: - case rt_r360: + case rt_rv350: + case rt_rv380: + case rt_r420: return Radeon_DetectTV_R300( ai ); } @@ -812,8 +805,8 @@ fp_info *fp = &ai->si->flatpanels[0]; uint32 max_hsize, max_vsize; - SHOW_FLOW0( 2, "EDID data read from DVI port via DDC2:" ); - edid_dump( edid ); + //SHOW_FLOW0( 2, "EDID data read from DVI port via DDC2:" ); + //edid_dump( edid ); // find detailed timing with maximum resolution max_hsize = max_vsize = 0; Modified: haiku/trunk/src/add-ons/accelerants/radeon/monitor_routing.c =================================================================== --- haiku/trunk/src/add-ons/accelerants/radeon/monitor_routing.c 2007-03-01 08:47:05 UTC (rev 20270) +++ haiku/trunk/src/add-ons/accelerants/radeon/monitor_routing.c 2007-03-01 09:00:49 UTC (rev 20271) @@ -37,16 +37,13 @@ values->vclk_ecp_cntl = Radeon_INPLL( ai->regs, ai->si->asic, RADEON_VCLK_ECP_CNTL ); switch( ai->si->asic ) { - case rt_ve: - case rt_m6: + case rt_rv100: case rt_rv200: - case rt_m7: case rt_rv250: - case rt_m9: case rt_rv280: - case rt_m9plus: case rt_rs100: case rt_rs200: + case rt_rs300: values->disp_hw_debug = INREG( regs, RADEON_DISP_HW_DEBUG ); break; @@ -55,13 +52,10 @@ break; case rt_r300: - case rt_r300_4p: case rt_rv350: - case rt_m10: - case rt_rv360: case rt_r350: - case rt_r360: - case rt_m11: + case rt_rv380: + case rt_r420: values->gpiopad_a = INREG( regs, RADEON_GPIOPAD_A ); break; @@ -137,29 +131,23 @@ values->crtc_ext_cntl |= RADEON_CRTC_CRT_ON; switch( ai->si->asic ) { - case rt_ve: - case rt_m6: - case rt_rv200: - case rt_m7: + case rt_rv100: + case rt_rv200: case rt_rv250: - case rt_m9: case rt_rv280: - case rt_m9plus: case rt_rs100: case rt_rs200: + case rt_rs300: values->dac_cntl2 &= ~RADEON_DAC_CLK_SEL_MASK; values->dac_cntl2 |= crtc_idx == 0 ? 0 : RADEON_DAC_CLK_SEL_CRTC2; break; case rt_r200: case rt_r300: - case rt_r300_4p: case rt_rv350: - case rt_m10: - case rt_m11: - case rt_rv360: case rt_r350: - case rt_r360: + case rt_rv380: + case rt_r420: values->disp_output_cntl &= ~RADEON_DISP_DAC_SOURCE_MASK; values->disp_output_cntl |= (crtc_idx == 0 ? 0 : RADEON_DISP_DAC_SOURCE_CRTC2); @@ -203,22 +191,9 @@ (2 << RADEON_TV_DAC_CNTL_DACADJ_SHIFT); // at least r300 needs magic bit set to switch between TV-CRT and TV-Out - switch( ai->si->asic ) { - case rt_r200: - case rt_r300: - case rt_r300_4p: - case rt_rv350: - case rt_m10: - case rt_m11: - case rt_rv360: - case rt_r350: - case rt_r360: + if (IS_R300_VARIANT) values->gpiopad_a |= 1; - break; - default: - ; - } - + } else if( (controlled_devices & dd_tv_crt) != 0 ) { values->crtc2_gen_cntl &= ~RADEON_CRTC2_CRT2_ON; } @@ -239,22 +214,10 @@ values->dac_cntl2 |= RADEON_DAC2_CLK_SEL_TV; // at least r300 needs magic bit set to switch between TV-CRT and TV-Out - switch( ai->si->asic ) { - case rt_r200: - case rt_r300: - case rt_r300_4p: - case rt_rv350: - case rt_rv360: - case rt_m10: - case rt_m11: - case rt_r350: - case rt_r360: + if(IS_R300_VARIANT) values->gpiopad_a &= ~1; - break; - default: - ; - } + // the TV-DAC itself is under control of the TV-Out code values->skip_tv_dac = true; @@ -330,17 +293,14 @@ int crtc_idx = (display_devices[1] & (dd_tv_crt | dd_ctv | dd_stv)) != 0; switch( ai->si->asic ) { - case rt_ve: - case rt_m6: + case rt_rv100: case rt_rv200: - case rt_m7: case rt_rv250: - case rt_m9: case rt_rv280: - case rt_m9plus: case rt_rs100: case rt_rs200: - values->disp_hw_debug &= ~RADEON_CRT2_DISP1_SEL; + case rt_rs300: + values->disp_hw_debug &= ~RADEON_CRT2_DISP1_SEL; // warning: meaning is wrong way around - 0 means crtc2, 1 means crtc1 values->disp_hw_debug |= crtc_idx == 0 ? RADEON_CRT2_DISP1_SEL : 0; break; @@ -354,13 +314,10 @@ break; case rt_r300: - case rt_r300_4p: case rt_rv350: - case rt_m10: - case rt_m11: - case rt_rv360: case rt_r350: - case rt_r360: + case rt_rv380: + case rt_r420: values->disp_output_cntl &= ~RADEON_DISP_TVDAC_SOURCE_MASK; values->disp_output_cntl |= crtc_idx == 0 ? 0 : RADEON_DISP_TVDAC_SOURCE_CRTC2; @@ -444,7 +401,8 @@ case rt_r300: case rt_r350: case rt_rv350: - case rt_m10: + case rt_rv380: + case rt_r420: values->fp2_gen_cntl &= ~RADEON_FP2_SOURCE_SEL_CRTC2; values->fp2_gen_cntl |= crtc_idx == 0 ? 0 : RADEON_FP2_SOURCE_SEL_CRTC2; @@ -470,16 +428,13 @@ OUTREG( regs, RADEON_DISP_OUTPUT_CNTL, values->disp_output_cntl ); switch( ai->si->asic ) { - case rt_ve: - case rt_m6: + case rt_rv100: case rt_rv200: - case rt_m7: case rt_rv250: - case rt_m9: case rt_rv280: - case rt_m9plus: case rt_rs100: case rt_rs200: + case rt_rs300: OUTREG( regs, RADEON_DISP_HW_DEBUG, values->disp_hw_debug ); break; @@ -488,13 +443,10 @@ break; case rt_r300: - case rt_r300_4p: case rt_rv350: - case rt_m10: - case rt_m11: - case rt_rv360: case rt_r350: - case rt_r360: + case rt_rv380: + case rt_r420: OUTREGP( regs, RADEON_GPIOPAD_A, values->gpiopad_a, ~1 ); break; @@ -589,7 +541,7 @@ // internal version of SetupDefaultMonitorRouting; // input and output are written to local variables -void assignDefaultMonitorRoute( +static void assignDefaultMonitorRoute( accelerator_info *ai, display_device_e display_devices, int whished_num_heads, bool use_laptop_panel, display_device_e *crtc1, display_device_e *crtc2 ) Modified: haiku/trunk/src/add-ons/accelerants/radeon/overlay_management.c =================================================================== --- haiku/trunk/src/add-ons/accelerants/radeon/overlay_management.c 2007-03-01 08:47:05 UTC (rev 20270) +++ haiku/trunk/src/add-ons/accelerants/radeon/overlay_management.c 2007-03-01 09:00:49 UTC (rev 20271) @@ -14,6 +14,7 @@ #include #include #include "overlay_regs.h" +#include "generic.h" // we could add support of planar modes and YUV modes // but I neither know how planar modes are defined nor @@ -148,7 +149,7 @@ node->mem_handle = am.handle; node->mem_offset = am.offset; buffer->buffer = si->local_mem + am.offset; - buffer->buffer_dma = si->framebuffer_pci + am.offset; + buffer->buffer_dma = (void *) ((unsigned long) si->framebuffer_pci + am.offset); // add to list of overlays node->next = vc->overlay_buffers; Modified: haiku/trunk/src/add-ons/accelerants/radeon/palette.c =================================================================== --- haiku/trunk/src/add-ons/accelerants/radeon/palette.c 2007-03-01 08:47:05 UTC (rev 20270) +++ haiku/trunk/src/add-ons/accelerants/radeon/palette.c 2007-03-01 09:00:49 UTC (rev 20271) @@ -14,8 +14,8 @@ #include "GlobalData.h" #include "dac_regs.h" #include "CP.h" +#include "generic.h" - // Radeon's DACs share same public registers, this function // selects the DAC you'll talk to #define selectPalette( crtc_idx ) \ Modified: haiku/trunk/src/add-ons/accelerants/radeon/pll.c =================================================================== --- haiku/trunk/src/add-ons/accelerants/radeon/pll.c 2007-03-01 08:47:05 UTC (rev 20270) +++ haiku/trunk/src/add-ons/accelerants/radeon/pll.c 2007-03-01 09:00:49 UTC (rev 20271) @@ -477,6 +477,8 @@ OUTREGP( regs, RADEON_CLOCK_CNTL_INDEX, RADEON_PLL_DIV_SEL_DIV3, ~RADEON_PLL_DIV_SEL_MASK ); + + RADEONPllErrataAfterIndex(regs, asic); if( ai->si->new_pll && crtc_idx == 0 ) { // starting with r300, the reference divider of the first PLL was Modified: haiku/trunk/src/add-ons/accelerants/radeon/radeon_accelerant.h =================================================================== --- haiku/trunk/src/add-ons/accelerants/radeon/radeon_accelerant.h 2007-03-01 08:47:05 UTC (rev 20270) +++ haiku/trunk/src/add-ons/accelerants/radeon/radeon_accelerant.h 2007-03-01 09:00:49 UTC (rev 20271) @@ -78,8 +78,8 @@ // SetDisplayMode.c uint32 Radeon_RoundVWidth( int virtual_width, int bpp ); status_t Radeon_MoveDisplay( accelerator_info *ai, uint16 h_display_start, uint16 v_display_start ); +void Radeon_EnableIRQ( accelerator_info *ai, bool enable ); - // multimon.c void Radeon_HideMultiMode( virtual_card *vc, display_mode *mode ); void Radeon_DetectMultiMode( virtual_card *vc, display_mode *mode ); @@ -130,14 +130,15 @@ // overlay.c void Radeon_HideOverlay( accelerator_info *ai ); status_t Radeon_UpdateOverlay( accelerator_info *ai ); +void Radeon_InitOverlay( accelerator_info *ai, int crtc_idx ); - // EngineManagement.c void Radeon_Spin( uint32 delay ); // monitor_detection.c void Radeon_DetectDisplays( accelerator_info *ai ); +bool Radeon_ReadEDID( accelerator_info *ai, uint32 ddc_port, edid1_info *edid ); // palette.c Modified: haiku/trunk/src/add-ons/accelerants/radeon/set_mode.h =================================================================== --- haiku/trunk/src/add-ons/accelerants/radeon/set_mode.h 2007-03-01 08:47:05 UTC (rev 20270) +++ haiku/trunk/src/add-ons/accelerants/radeon/set_mode.h 2007-03-01 09:00:49 UTC (rev 20271) @@ -25,19 +25,19 @@ // TV-timing typedef struct { uint32 freq; // TV sub carrier frequency x12 - uint16 h_total; - uint16 h_sync_len; - uint16 h_genclk_delay; - uint16 h_setup_delay; - uint16 h_active_delay; - uint16 h_active_len; - uint16 v_total; - uint16 v_active_lines; - uint16 v_field_total; - uint16 v_fields; - uint16 f_total; - uint16 frame_size_adjust; - uint32 scale; + uint16 h_total; + uint16 h_sync_len; + uint16 h_genclk_delay; + uint16 h_setup_delay; + uint16 h_active_delay; + uint16 h_active_len; + uint16 v_total; + uint16 v_active_lines; + uint16 v_field_total; + uint16 v_fields; + uint16 f_total; + uint16 frame_size_adjust; + uint32 scale; } tv_timing; @@ -64,7 +64,7 @@ pll_dividers tv_dividers; pll_dividers crt_dividers; - tv_timing timing; + tv_timing timing; } impactv_params; @@ -88,9 +88,9 @@ // pure information uint32 dot_clock_freq; // in 10 kHz - uint32 pll_output_freq;// in 10 kHz - int feedback_div; - int post_div; + uint32 pll_output_freq;// in 10 kHz + int feedback_div; + int post_div; } pll_regs; Modified: haiku/trunk/src/add-ons/kernel/drivers/graphics/radeon/CP_setup.c =================================================================== --- haiku/trunk/src/add-ons/kernel/drivers/graphics/radeon/CP_setup.c 2007-03-01 08:47:05 UTC (rev 20270) +++ haiku/trunk/src/add-ons/kernel/drivers/graphics/radeon/CP_setup.c 2007-03-01 09:00:49 UTC (rev 20271) @@ -27,6 +27,8 @@ #include "pll_regs.h" #include "rbbm_regs.h" [... truncated: 969 lines follow ...] From axeld at mail.berlios.de Thu Mar 1 10:05:12 2007 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Thu, 1 Mar 2007 10:05:12 +0100 Subject: [Haiku-commits] r20272 - in haiku/trunk: headers/private/graphics/radeon src/add-ons/kernel/drivers/graphics/radeon Message-ID: <200703010905.l2195Cnm031708@sheep.berlios.de> Author: axeld Date: 2007-03-01 10:05:12 +0100 (Thu, 01 Mar 2007) New Revision: 20272 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20272&view=rev Modified: haiku/trunk/headers/private/graphics/radeon/version.h haiku/trunk/src/add-ons/kernel/drivers/graphics/radeon/bios.c Log: Patch by Euan Kirkhope: * New "ATOM" BIOS Support for radeons X-series * This also removes scanning for the BIOS signature for other cards Modified: haiku/trunk/headers/private/graphics/radeon/version.h =================================================================== --- haiku/trunk/headers/private/graphics/radeon/version.h 2007-03-01 09:00:49 UTC (rev 20271) +++ haiku/trunk/headers/private/graphics/radeon/version.h 2007-03-01 09:05:12 UTC (rev 20272) @@ -8,4 +8,4 @@ */ // current version -#define RADEON_DRIVER_VERSION "Version: 5.1.1.1" +#define RADEON_DRIVER_VERSION "Version: 5.1.2.1" Modified: haiku/trunk/src/add-ons/kernel/drivers/graphics/radeon/bios.c =================================================================== --- haiku/trunk/src/add-ons/kernel/drivers/graphics/radeon/bios.c 2007-03-01 09:00:49 UTC (rev 20271) +++ haiku/trunk/src/add-ons/kernel/drivers/graphics/radeon/bios.c 2007-03-01 09:05:12 UTC (rev 20272) @@ -27,33 +27,18 @@ #include #include +#define get_pci(o, s) (*pci_bus->read_pci_config)(pcii->bus, pcii->device, pcii->function, (o), (s)) + +#define RADEON_BIOS8(v) (di->rom.rom_ptr[v]) +#define RADEON_BIOS16(v) ((di->rom.rom_ptr[v]) | \ + (di->rom.rom_ptr[(v) + 1] << 8)) +#define RADEON_BIOS32(v) ((di->rom.rom_ptr[v]) | \ + (di->rom.rom_ptr[(v) + 1] << 8) \ + (di->rom.rom_ptr[(v) + 2] << 16) \ + (di->rom.rom_ptr[(v) + 3] << 24)) + static const char ati_rom_sig[] = "761295520"; -static const char *radeon_sig[] = { - "RADEON", // r100 - "RV100", // rv100 - "U1", // rs100 (IGP320M) - "M6", // mobile version of r100 - // probably an M6P; - // anyway - this is the card I wrote this driver for! - // (perhaps ATI tries to make the card incompatible to standard drivers) - "P6", - "RV200", // rv200 - "M7", // m7 - "RG6", // r200 (according to spec) - "RS200", // rs200 - "R200", // r200 (8500 LE) - "R200AGP", // Fire GL E1 - "M9" // guess: m9 - "RV250", // rv250 R9100 - "V280", // RV280 R9200 - "R300", // R300 R9500 / R9700 - "R350", // R350 R9800 - "R360", // R360 R9800 XT - "V350", // RV350 R9600 - "V360", // RV350 R9600 XT :guess -}; - // find address of ROM; // this code is really nasty as maintaining the radeon signatures // is almost impossible (the signatures provided by ATI are always out-dated); @@ -70,7 +55,7 @@ uint32 segstart; uint8 *rom_base; char *rom; - int i,j; + int i; for( segstart = 0x000c0000; segstart < 0x000f0000; segstart += 0x00001000 ) { bool found = false; @@ -98,24 +83,8 @@ if( !found ) continue; - // find signature of card - found = false; - - for( i = 0; i < 512; i++ ) { - for( j = 0; j < sizeof( radeon_sig ) / sizeof( radeon_sig[0] ); j++ ) { - if( radeon_sig[j][0] == rom_base[i] ) { - if( strncmp( radeon_sig[j], rom_base + i, strlen( radeon_sig[j] )) == 0 ) { - SHOW_INFO( 2, "Signature: %s", radeon_sig[j] ); - found = true; - break; - } - } - } - } - - if( !found ) - continue; - + // EK don't bother looking for signiture now, due to lack of consistancy. + SHOW_INFO( 2, "found ROM @0x%lx", segstart ); return rom_base; } @@ -130,22 +99,70 @@ static void Radeon_GetPLLInfo( device_info *di ) { uint8 *bios_header; + uint8 *tmp; PLL_BLOCK pll, *pll_info; bios_header = di->rom.rom_ptr + *(uint16 *)(di->rom.rom_ptr + 0x48); pll_info = (PLL_BLOCK *)(di->rom.rom_ptr + *(uint16 *)(bios_header + 0x30)); - memcpy( &pll, pll_info, sizeof( pll )); + // determine type of ROM + + tmp = bios_header + 4; + + if (( *tmp == 'A' + && *(tmp+1) == 'T' + && *(tmp+2) == 'O' + && *(tmp+3) == 'M' + ) + || + ( *tmp == 'M' + && *(tmp+1) == 'O' + && *(tmp+2) == 'T' + && *(tmp+3) == 'A' + )) + { + int bios_header, master_data_start, pll_start; + di->is_atombios = true; - di->pll.xclk = (uint32)pll.XCLK; - di->pll.ref_freq = (uint32)pll.PCLK_ref_freq; - di->pll.ref_div = (uint32)pll.PCLK_ref_divider; - di->pll.min_pll_freq = pll.PCLK_min_freq; - di->pll.max_pll_freq = pll.PCLK_max_freq; + bios_header = RADEON_BIOS16(0x48); + master_data_start = RADEON_BIOS16(bios_header + 32); + pll_start = RADEON_BIOS16(master_data_start + 12); + + di->pll.ref_div = 0; + di->pll.max_pll_freq = RADEON_BIOS16(pll_start + 32); + di->pll.xclk = RADEON_BIOS16(pll_start + 72); + di->pll.min_pll_freq = RADEON_BIOS16(pll_start + 78); + di->pll.ref_freq = RADEON_BIOS16(pll_start + 82); + + SHOW_INFO( 2, "TESTING ref_clk=%ld, ref_div=%ld, xclk=%ld, min_freq=%ld, max_freq=%ld from ATOM Bios", + di->pll.ref_freq, di->pll.ref_div, di->pll.xclk, + di->pll.min_pll_freq, di->pll.max_pll_freq ); + + // Unused by beos driver so it appears... + // info->sclk = RADEON_BIOS32(pll_info_block + 8) / 100.0; + // info->mclk = RADEON_BIOS32(pll_info_block + 12) / 100.0; + // if (info->sclk == 0) info->sclk = 200; + // if (info->mclk == 0) info->mclk = 200; + + } + else + { + di->is_atombios = false; + + memcpy( &pll, pll_info, sizeof( pll )); - SHOW_INFO( 2, "ref_clk=%ld, ref_div=%ld, xclk=%ld, min_freq=%ld, max_freq=%ld from BIOS", + di->pll.xclk = (uint32)pll.XCLK; + di->pll.ref_freq = (uint32)pll.PCLK_ref_freq; + di->pll.ref_div = (uint32)pll.PCLK_ref_divider; + di->pll.min_pll_freq = pll.PCLK_min_freq; + di->pll.max_pll_freq = pll.PCLK_max_freq; + + SHOW_INFO( 2, "ref_clk=%ld, ref_div=%ld, xclk=%ld, min_freq=%ld, max_freq=%ld from Legacy BIOS", di->pll.ref_freq, di->pll.ref_div, di->pll.xclk, di->pll.min_pll_freq, di->pll.max_pll_freq ); + + } + } /* @@ -247,75 +264,119 @@ // who knows which strange kind of combination is out there?) static bool Radeon_GetBIOSDFPInfo( device_info *di ) { - uint8 *bios_header; + uint16 bios_header; uint16 fpi_offset; FPI_BLOCK fpi; char panel_name[30]; int i; - bios_header = di->rom.rom_ptr + *(uint16 *)(di->rom.rom_ptr + 0x48); + uint16 tmp; - fpi_offset = *(uint16 *)(bios_header + 0x40); + bios_header = RADEON_BIOS16( 0x48 ); + + if (di->is_atombios) + { + int master_data_start; + master_data_start = RADEON_BIOS16( bios_header + 32 ); + + tmp = RADEON_BIOS16( master_data_start + 16 ); + if( tmp ) + { - if( !fpi_offset ) { - di->fp_info.panel_pwr_delay = 200; - SHOW_ERROR0( 2, "No Panel Info Table found in BIOS" ); - return false; - } - - memcpy( &fpi, di->rom.rom_ptr + fpi_offset, sizeof( fpi )); + di->fp_info.panel_xres = RADEON_BIOS16( tmp + 6 ); + di->fp_info.panel_yres = RADEON_BIOS16( tmp + 10 ); + di->fp_info.dot_clock = RADEON_BIOS16( tmp + 4 ) * 10; + di->fp_info.h_blank = RADEON_BIOS16( tmp + 8 ); + di->fp_info.h_over_plus = RADEON_BIOS16( tmp + 14 ); + di->fp_info.h_sync_width = RADEON_BIOS16( tmp + 16 ); + di->fp_info.v_blank = RADEON_BIOS16( tmp + 12 ); + di->fp_info.v_over_plus = RADEON_BIOS16( tmp + 18 ); + di->fp_info.h_sync_width = RADEON_BIOS16( tmp + 20 ); + di->fp_info.panel_pwr_delay = RADEON_BIOS16( tmp + 40 ); - memcpy( panel_name, &fpi.name, sizeof( fpi.name ) ); - panel_name[sizeof( fpi.name )] = 0; + SHOW_INFO( 2, "Panel Info from ATOMBIOS:\n" + "XRes: %d, YRes: %d, DotClock: %d\n" + "HBlank: %d, HOverPlus: %d, HSyncWidth: %d\n" + "VBlank: %d, VOverPlus: %d, VSyncWidth: %d\n" + "PanelPowerDelay: %d\n", + di->fp_info.panel_xres, di->fp_info.panel_yres, di->fp_info.dot_clock, + di->fp_info.h_blank, di->fp_info.h_over_plus, di->fp_info.h_sync_width, + di->fp_info.v_blank, di->fp_info.v_over_plus, di->fp_info.h_sync_width, + di->fp_info.panel_pwr_delay ); + + } + else + { + di->fp_info.panel_pwr_delay = 200; + SHOW_ERROR0( 2, "No Panel Info Table found in BIOS" ); + return false; + } + } // is_atombios + else + { - SHOW_INFO( 2, "Panel ID string: %s", panel_name ); + fpi_offset = RADEON_BIOS16(bios_header + 0x40); + + if( !fpi_offset ) { + di->fp_info.panel_pwr_delay = 200; + SHOW_ERROR0( 2, "No Panel Info Table found in BIOS" ); + return false; + } - di->fp_info.panel_xres = fpi.panel_xres; - di->fp_info.panel_yres = fpi.panel_yres; - - SHOW_INFO( 2, "Panel Size from BIOS: %dx%d", - di->fp_info.panel_xres, di->fp_info.panel_yres); + memcpy( &fpi, di->rom.rom_ptr + fpi_offset, sizeof( fpi )); - di->fp_info.panel_pwr_delay = fpi.panel_pwr_delay; - if( di->fp_info.panel_pwr_delay > 2000 || di->fp_info.panel_pwr_delay < 0 ) - di->fp_info.panel_pwr_delay = 2000; - - di->fp_info.ref_div = fpi.ref_div; - di->fp_info.post_div = fpi.post_div; - di->fp_info.feedback_div = fpi.feedback_div; - - di->fp_info.fixed_dividers = - di->fp_info.ref_div != 0 && di->fp_info.feedback_div > 3; - - - // there might be multiple supported resolutions stored; - // we are looking for native resolution - for( i = 0; i < 20; ++i ) { - uint16 fpi_timing_ofs; - FPI_TIMING_BLOCK fpi_timing; + memcpy( panel_name, &fpi.name, sizeof( fpi.name ) ); + panel_name[sizeof( fpi.name )] = 0; - fpi_timing_ofs = fpi.fpi_timing_ofs[i]; + SHOW_INFO( 2, "Panel ID string: %s", panel_name ); + + di->fp_info.panel_xres = fpi.panel_xres; + di->fp_info.panel_yres = fpi.panel_yres; - if( fpi_timing_ofs == 0 ) - break; + SHOW_INFO( 2, "Panel Size from BIOS: %dx%d", + di->fp_info.panel_xres, di->fp_info.panel_yres); - memcpy( &fpi_timing, di->rom.rom_ptr + fpi_timing_ofs, sizeof( fpi_timing )); - - if( fpi_timing.panel_xres != di->fp_info.panel_xres || - fpi_timing.panel_yres != di->fp_info.panel_yres ) - continue; + di->fp_info.panel_pwr_delay = fpi.panel_pwr_delay; + if( di->fp_info.panel_pwr_delay > 2000 || di->fp_info.panel_pwr_delay < 0 ) + di->fp_info.panel_pwr_delay = 2000; + + di->fp_info.ref_div = fpi.ref_div; + di->fp_info.post_div = fpi.post_div; + di->fp_info.feedback_div = fpi.feedback_div; + + di->fp_info.fixed_dividers = + di->fp_info.ref_div != 0 && di->fp_info.feedback_div > 3; - di->fp_info.h_blank = (fpi_timing.h_total - fpi_timing.h_display) * 8; - // TBD: seems like upper four bits of hsync_start contain garbage - di->fp_info.h_over_plus = ((fpi_timing.h_sync_start & 0xfff) - fpi_timing.h_display - 1) * 8; - di->fp_info.h_sync_width = fpi_timing.h_sync_width * 8; - di->fp_info.v_blank = fpi_timing.v_total - fpi_timing.v_display; - di->fp_info.v_over_plus = (fpi_timing.v_sync & 0x7ff) - fpi_timing.v_display; - di->fp_info.v_sync_width = (fpi_timing.v_sync & 0xf800) >> 11; - di->fp_info.dot_clock = fpi_timing.dot_clock * 10; - return true; - } + // there might be multiple supported resolutions stored; + // we are looking for native resolution + for( i = 0; i < 20; ++i ) { + uint16 fpi_timing_ofs; + FPI_TIMING_BLOCK fpi_timing; + + fpi_timing_ofs = fpi.fpi_timing_ofs[i]; + + if( fpi_timing_ofs == 0 ) + break; + + memcpy( &fpi_timing, di->rom.rom_ptr + fpi_timing_ofs, sizeof( fpi_timing )); + + if( fpi_timing.panel_xres != di->fp_info.panel_xres || + fpi_timing.panel_yres != di->fp_info.panel_yres ) + continue; + + di->fp_info.h_blank = (fpi_timing.h_total - fpi_timing.h_display) * 8; + // TBD: seems like upper four bits of hsync_start contain garbage + di->fp_info.h_over_plus = ((fpi_timing.h_sync_start & 0xfff) - fpi_timing.h_display - 1) * 8; + di->fp_info.h_sync_width = fpi_timing.h_sync_width * 8; + di->fp_info.v_blank = fpi_timing.v_total - fpi_timing.v_display; + di->fp_info.v_over_plus = (fpi_timing.v_sync & 0x7ff) - fpi_timing.v_display; + di->fp_info.v_sync_width = (fpi_timing.v_sync & 0xf800) >> 11; + di->fp_info.dot_clock = fpi_timing.dot_clock * 10; + return true; + } + } // not is_atombios + SHOW_ERROR0( 2, "Radeon: couldn't get Panel Timing from BIOS" ); return false; } From axeld at pinc-software.de Thu Mar 1 10:21:57 2007 From: axeld at pinc-software.de (Axel =?iso-8859-15?q?D=F6rfler?=) Date: Thu, 01 Mar 2007 10:21:57 +0100 CET Subject: [Haiku-commits] r20268 - haiku/trunk/src/system/kernel/arch/x86 In-Reply-To: Message-ID: <6764780477-BeMail@zon> Travis Geiselbrecht wrote: > On Mar 1, 2007, at 12:16 AM, Axel D?rfler wrote: > > geist at BerliOS wrote: > >> Log: > >> the last smp change wasn't quite it. This time, make sure it maps > > > the > >> right physical page. > > Thanks, I completely missed that problem when doing the changes. > > BTW do you think it's a good idea to map something twice on other > > architectures than x86? At least I removed the test in > > vm_map_physical_memory() if the page is already mapped. > Yeah, in general the situation of already having pages mapped like > that is a weird case, and treating the page as already being mapped > as an error is probably a good idea. I don't think the architecture > really enters into it that much. It's generally a sign that your data > structures have gotten out of date with reality. On reason you might > want to do that is to remove the TLB flush on map(). If you can > basically guarantee that nothing is already mapped there (or it's > been explicitly unmapped before map) then you can leave out the TLB > flush, which is a pretty big win. If things weren't so unstable at > the moment I'd go ahead and remove the flush as is. Sounds like a good idea to do it... later :-) > In the case of map_physical_memory, there's no place to pass the > flags to say B_ALREADY_MAPPED, so we're sort of stuck. I assume the > api is that way to match beos. I guess for now you can sort of assume > that if you're doing map_physical_memory, you probably know what > you're doing. I thought of adding an unmap before the map in > map_physical_memory, but not sure if we want to make it officially > okay to overlap map like that. We could add a parameter to vm_map_physical_memory() and use that instead for cases like these. Bye, Axel. From axeld at pinc-software.de Thu Mar 1 10:23:48 2007 From: axeld at pinc-software.de (Axel =?iso-8859-15?q?D=F6rfler?=) Date: Thu, 01 Mar 2007 10:23:48 +0100 CET Subject: [Haiku-commits] r20252 - haiku/trunk/headers/private/kernel/util In-Reply-To: Message-ID: <6875697018-BeMail@zon> "J?r?me Duval" wrote: > 2007/2/28, Axel D?rfler : > > korli at BerliOS wrote: > > > Log: > > > fixed the build; I also changed MoveFrom(), untested > > Thanks, I guess you're using GCC4, right? As GCC2.95.3 shouldn't > > care > > about unused templates. > Yes, I would have been surprised if you broke all builds together :) Oh my god, I think you have problems with your long term memory ;-) Not that I ever broke the build... Bye, Axel. From axeld at pinc-software.de Thu Mar 1 10:25:10 2007 From: axeld at pinc-software.de (Axel =?iso-8859-15?q?D=F6rfler?=) Date: Thu, 01 Mar 2007 10:25:10 +0100 CET Subject: [Haiku-commits] =?iso-8859-15?q?r20256_-_in_haiku/trunk=3A_header?= =?iso-8859-15?q?s/os/drivers_src/system/kernel/fs?= In-Reply-To: <22300393.1172738189830.JavaMail.ngmail@webmail13> Message-ID: <6957990195-BeMail@zon> Marcus Overhagen wrote: > bonefish at BerliOS wrote: > > +extern "C" status_t > > +is_vnode_removed(mount_id mountID, vnode_id vnodeID) > > > + if (vnode) > > + result = vnode->remove ? 1 : 0; > > + else > > + result = B_BAD_VALUE; > That mix of bool and status_t is really crude, especially because > false == B_OK. > Wouldn't it be enough to return a bool only, with B_BAD_VALUE = true > ? > > or make it > > status_t is_vnode_removed(mount_id mountID, vnode_id vnodeID, bool * > _removed) Indeed, there is little reason to keep that thing BeOS compatible. Bye, Axel. From axeld at mail.berlios.de Thu Mar 1 10:28:27 2007 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Thu, 1 Mar 2007 10:28:27 +0100 Subject: [Haiku-commits] r20273 - in haiku/trunk: headers/private/graphics/radeon src/add-ons/accelerants/radeon src/add-ons/kernel/drivers/graphics/radeon Message-ID: <200703010928.l219SRt7001999@sheep.berlios.de> Author: axeld Date: 2007-03-01 10:28:25 +0100 (Thu, 01 Mar 2007) New Revision: 20273 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20273&view=rev Modified: haiku/trunk/headers/private/graphics/radeon/radeon_interface.h haiku/trunk/headers/private/graphics/radeon/version.h haiku/trunk/src/add-ons/accelerants/radeon/Acceleration.c haiku/trunk/src/add-ons/accelerants/radeon/EngineManagment.c haiku/trunk/src/add-ons/accelerants/radeon/InitAccelerant.c haiku/trunk/src/add-ons/accelerants/radeon/driver_wrapper.c haiku/trunk/src/add-ons/accelerants/radeon/generic.h haiku/trunk/src/add-ons/accelerants/radeon/overlay.c haiku/trunk/src/add-ons/accelerants/radeon/palette.c haiku/trunk/src/add-ons/accelerants/radeon/radeon_accelerant.h haiku/trunk/src/add-ons/kernel/drivers/graphics/radeon/CP_setup.c haiku/trunk/src/add-ons/kernel/drivers/graphics/radeon/bios.c haiku/trunk/src/add-ons/kernel/drivers/graphics/radeon/detect.c haiku/trunk/src/add-ons/kernel/drivers/graphics/radeon/driver.c haiku/trunk/src/add-ons/kernel/drivers/graphics/radeon/init.c haiku/trunk/src/add-ons/kernel/drivers/graphics/radeon/mem_controller.c haiku/trunk/src/add-ons/kernel/drivers/graphics/radeon/radeon_driver.h Log: Patch by Euan Kirkhope: * option for PIO engine instead of DMA (for dodgy X700s) * misc RAM config changes inline with x.org codebase Modified: haiku/trunk/headers/private/graphics/radeon/radeon_interface.h =================================================================== --- haiku/trunk/headers/private/graphics/radeon/radeon_interface.h 2007-03-01 09:05:12 UTC (rev 20272) +++ haiku/trunk/headers/private/graphics/radeon/radeon_interface.h 2007-03-01 09:28:25 UTC (rev 20273) @@ -20,7 +20,8 @@ #include "ddc.h" // magic code for ioctls -#define RADEON_PRIVATE_DATA_MAGIC 'TKRA' +// changed from TKRA to TKR1 for RADEON_WAITFORFIFO ioctl +#define RADEON_PRIVATE_DATA_MAGIC 'TKR1' #define MAX_RADEON_DEVICE_NAME_LENGTH MAXPATHLEN @@ -35,6 +36,7 @@ RADEON_FREE_MEM, RADEON_WAITFORIDLE, + RADEON_WAITFORFIFO, RADEON_RESETENGINE, RADEON_VIPREAD, RADEON_VIPWRITE, @@ -396,6 +398,7 @@ typedef struct { // filled out by kernel CP_info cp; // info concerning command processor + bool acc_dma; // prevent use of dma engine // set by accelerant struct { @@ -499,6 +502,12 @@ bool keep_lock; // keep lock after engine is idle } radeon_wait_for_idle; +// wait for idle +typedef struct { + uint32 magic; + int entries; // keep lock after engine is idle +} radeon_wait_for_fifo; + // read VIP register typedef struct { uint32 magic; Modified: haiku/trunk/headers/private/graphics/radeon/version.h =================================================================== --- haiku/trunk/headers/private/graphics/radeon/version.h 2007-03-01 09:05:12 UTC (rev 20272) +++ haiku/trunk/headers/private/graphics/radeon/version.h 2007-03-01 09:28:25 UTC (rev 20273) @@ -8,4 +8,4 @@ */ // current version -#define RADEON_DRIVER_VERSION "Version: 5.1.2.1" +#define RADEON_DRIVER_VERSION "Version: 5.1.3.1" Modified: haiku/trunk/src/add-ons/accelerants/radeon/Acceleration.c =================================================================== --- haiku/trunk/src/add-ons/accelerants/radeon/Acceleration.c 2007-03-01 09:05:12 UTC (rev 20272) +++ haiku/trunk/src/add-ons/accelerants/radeon/Acceleration.c 2007-03-01 09:28:25 UTC (rev 20273) @@ -13,6 +13,7 @@ #include "generic.h" #include "3d_regs.h" #include "2d_regs.h" +#include "radeon_regs.h" #include "mmio.h" #include "CP.h" @@ -21,7 +22,7 @@ // et - ignored // list - list of rectangles // count - number of rectangles -void SCREEN_TO_SCREEN_BLIT(engine_token *et, blit_params *list, uint32 count) +void SCREEN_TO_SCREEN_BLIT_DMA(engine_token *et, blit_params *list, uint32 count) { virtual_card *vc = ai->vc; @@ -55,13 +56,63 @@ ++ai->si->engine.count; } +#define SRC_DSTCOLOR 0x00030000 +#define DP_SRC_RECT 0x00000200 +void SCREEN_TO_SCREEN_BLIT_PIO(engine_token *et, blit_params *list, uint32 count) +{ + int xdir; + int ydir; + virtual_card *vc = ai->vc; + + SHOW_FLOW0( 4, "" ); + + Radeon_WaitForFifo ( ai , 1 ); + + // Setup for Screen to screen blit + OUTREG(ai->regs, RADEON_DP_GUI_MASTER_CNTL, (vc->datatype << RADEON_GMC_DST_DATATYPE_SHIFT + | RADEON_GMC_BRUSH_NONE + | RADEON_GMC_SRC_DATATYPE_COLOR + | RADEON_ROP3_S + | RADEON_DP_SRC_SOURCE_MEMORY + | RADEON_GMC_SRC_PITCH_OFFSET_CNTL)); + + + for( ; count > 0; --count, ++list ) { + + // make sure there is space in the FIFO for 4 register writes + Radeon_WaitForFifo ( ai , 4 ); + + xdir = ((list->src_left < list->dest_left) && (list->src_top == list->dest_top)) ? -1 : 1; + ydir = (list->src_top < list->dest_top) ? -1 : 1; + + if (xdir < 0) list->src_left += list->width , list->dest_left += list->width ; + if (ydir < 0) list->src_top += list->height , list->dest_top += list->height ; + + OUTREG(ai->regs, RADEON_DP_CNTL, ((xdir >= 0 ? RADEON_DST_X_LEFT_TO_RIGHT : 0) + | (ydir >= 0 ? RADEON_DST_Y_TOP_TO_BOTTOM : 0))); + + // Tell the engine where the source data resides. + OUTREG( ai->regs, RADEON_SRC_Y_X, (list->src_top << 16 ) | list->src_left); + OUTREG( ai->regs, RADEON_DST_Y_X, (list->dest_top << 16 ) | list->dest_left); + + // this is the blt initiator. + OUTREG( ai->regs, RADEON_DST_HEIGHT_WIDTH, ((list->height + 1) << 16 ) | (list->width + 1)); + + } + + ++ai->si->engine.count; + et = et; + +} + + // fill rectangles on screen // et - ignored // colorIndex - fill colour // list - list of rectangles // count - number of rectangles -void FILL_RECTANGLE(engine_token *et, uint32 colorIndex, +void FILL_RECTANGLE_DMA(engine_token *et, uint32 colorIndex, fill_rect_params *list, uint32 count) { virtual_card *vc = ai->vc; @@ -98,11 +149,47 @@ } +// fill rectangles on screen +// et - ignored +// colorIndex - fill colour +// list - list of rectangles +// count - number of rectangles +#define BRUSH_SOLIDCOLOR 0x00000d00 + +void FILL_RECTANGLE_PIO(engine_token *et, uint32 colorIndex, fill_rect_params *list, uint32 count) +{ + virtual_card *vc = ai->vc; + + SHOW_FLOW( 4, "colorIndex", colorIndex); + + Radeon_WaitForFifo(ai, 3); + OUTREG(ai->regs, RADEON_DP_GUI_MASTER_CNTL, ((vc->datatype << RADEON_GMC_DST_DATATYPE_SHIFT) + | RADEON_GMC_BRUSH_SOLID_COLOR + | RADEON_GMC_SRC_DATATYPE_COLOR + | RADEON_ROP3_P)); + // Set brush colour + OUTREG(ai->regs, RADEON_DP_BRUSH_FRGD_CLR, colorIndex); + OUTREG(ai->regs, RADEON_DP_CNTL, (RADEON_DST_X_LEFT_TO_RIGHT | RADEON_DST_Y_TOP_TO_BOTTOM)); + + for( ; count > 0; --count, ++list ) + { + + Radeon_WaitForFifo(ai, 2); + OUTREG(ai->regs, RADEON_DST_Y_X, (list->top << 16) | list->left); + OUTREG(ai->regs, RADEON_DST_WIDTH_HEIGHT, ((list->right - list->left + 1) << 16) | (list->bottom - list->top + 1)); + + } + ++ai->si->engine.count; + et = et; +} + + + // invert rectangle on screen // et - ignored // list - list of rectangles // count - number of rectangles -void INVERT_RECTANGLE(engine_token *et, fill_rect_params *list, uint32 count) +void INVERT_RECTANGLE_DMA(engine_token *et, fill_rect_params *list, uint32 count) { virtual_card *vc = ai->vc; @@ -151,12 +238,41 @@ ++ai->si->engine.count; } + +void INVERT_RECTANGLE_PIO(engine_token *et, fill_rect_params *list, uint32 count) +{ + virtual_card *vc = ai->vc; + + SHOW_FLOW0( 4, "" ); + + Radeon_WaitForFifo(ai, 3); + OUTREG(ai->regs, RADEON_DP_GUI_MASTER_CNTL, ((vc->datatype << RADEON_GMC_DST_DATATYPE_SHIFT) + | RADEON_GMC_BRUSH_NONE + | RADEON_GMC_SRC_DATATYPE_COLOR + | RADEON_ROP3_Dn + | RADEON_DP_SRC_SOURCE_MEMORY)); + + OUTREG(ai->regs, RADEON_DP_CNTL, (RADEON_DST_X_LEFT_TO_RIGHT | RADEON_DST_Y_TOP_TO_BOTTOM)); + + for( ; count > 0; --count, ++list ) + { + + Radeon_WaitForFifo(ai, 2); + OUTREG(ai->regs, RADEON_DST_Y_X, (list->top << 16) | list->left); + OUTREG(ai->regs, RADEON_DST_WIDTH_HEIGHT, ((list->right - list->left + 1) << 16) | (list->bottom - list->top + 1)); + } + + ++ai->si->engine.count; + et = et; + +} + // fill horizontal spans on screen // et - ignored // colorIndex - fill colour // list - list of spans // count - number of spans -void FILL_SPAN(engine_token *et, uint32 colorIndex, uint16 *list, uint32 count) +void FILL_SPAN_DMA(engine_token *et, uint32 colorIndex, uint16 *list, uint32 count) { virtual_card *vc = ai->vc; @@ -196,72 +312,181 @@ } +// fill horizontal spans on screen +// et - ignored +// colorIndex - fill colour +// list - list of spans +// count - number of spans +void FILL_SPAN_PIO(engine_token *et, uint32 colorIndex, uint16 *list, uint32 count) +{ + + virtual_card *vc = ai->vc; + //int offset = 0; + uint16 y, x, width; + + SHOW_FLOW0( 4, "" ); + + Radeon_WaitForFifo( ai , 1); + OUTREG( ai->regs, RADEON_DP_GUI_MASTER_CNTL, 0 + | RADEON_GMC_BRUSH_SOLID_COLOR + | (vc->datatype << RADEON_GMC_DST_DATATYPE_SHIFT) + | RADEON_GMC_SRC_DATATYPE_COLOR + | RADEON_ROP3_P); + + if ( ai->si->asic >= rt_rv200 ) { + Radeon_WaitForFifo( ai , 1); + OUTREG( ai->regs, RADEON_DST_LINE_PATCOUNT, 0x55 << RADEON_BRES_CNTL_SHIFT); + } + + Radeon_WaitForFifo( ai , 1); + OUTREG( ai->regs, RADEON_DP_BRUSH_FRGD_CLR, colorIndex); + + for( ; count > 0; --count ) { + + Radeon_WaitForFifo( ai , 2); + + y = *list++; + x = *list++; + width = *list++ - x + 1; + + OUTREG( ai->regs, RADEON_DST_LINE_START, (y << 16) | x); + OUTREG( ai->regs, RADEON_DST_LINE_END, ((y) << 16) | (x + width)); + + } + + ++ai->si->engine.count; + et = et; +} + + +void SCREEN_TO_SCREEN_BLIT(engine_token *et, blit_params *list, uint32 count) +{ + if ( ai->si->acc_dma ) + SCREEN_TO_SCREEN_BLIT_DMA(et,list,count); + else + SCREEN_TO_SCREEN_BLIT_PIO(et,list,count); +} + +void FILL_RECTANGLE(engine_token *et, uint32 color, fill_rect_params *list, uint32 count) +{ + if ( ai->si->acc_dma ) + FILL_RECTANGLE_DMA(et, color, list, count); + else + FILL_RECTANGLE_PIO(et, color, list, count); +} + +void INVERT_RECTANGLE(engine_token *et, fill_rect_params *list, uint32 count) +{ + if ( ai->si->acc_dma ) + INVERT_RECTANGLE_DMA(et, list, count); + else + INVERT_RECTANGLE_PIO(et, list, count); +} + +void FILL_SPAN(engine_token *et, uint32 color, uint16 *list, uint32 count) +{ + if ( ai->si->acc_dma ) + FILL_SPAN_DMA(et, color, list, count); + else + FILL_SPAN_PIO(et, color, list, count); + +} + + // prepare 2D acceleration void Radeon_Init2D( accelerator_info *ai ) { SHOW_FLOW0( 3, "" ); - START_IB(); - // forget about 3D - WRITE_IB_REG( RADEON_RB3D_CNTL, 0 ); - - SUBMIT_IB(); + if ( ai->si->acc_dma ) { + START_IB(); + WRITE_IB_REG( RADEON_RB3D_CNTL, 0 ); + SUBMIT_IB(); + } + else { + OUTREG( ai->regs, RADEON_RB3D_CNTL, 0 ); + } } - // fill state buffer that sets 2D registers up for accelerated operations void Radeon_FillStateBuffer( accelerator_info *ai, uint32 datatype ) { virtual_card *vc = ai->vc; uint32 pitch_offset; - uint32 *buffer, *buffer_start; + uint32 *buffer = NULL, *buffer_start = NULL; SHOW_FLOW0( 4, "" ); - // make sure buffer is not used - Radeon_InvalidateStateBuffer( ai, vc->state_buffer_idx ); - - buffer = buffer_start = Radeon_GetIndirectBufferPtr( ai, vc->state_buffer_idx ); - // set offset of frame buffer and pitch pitch_offset = ((ai->si->memory[mt_local].virtual_addr_start + vc->fb_offset) >> 10) | ((vc->pitch >> 6) << 22); - WRITE_IB_REG( RADEON_DEFAULT_OFFSET, pitch_offset ); - WRITE_IB_REG( RADEON_DST_PITCH_OFFSET, pitch_offset ); - WRITE_IB_REG( RADEON_SRC_PITCH_OFFSET, pitch_offset ); + + if ( ai->si->acc_dma ) { + // make sure buffer is not used + Radeon_InvalidateStateBuffer( ai, vc->state_buffer_idx ); + buffer = buffer_start = Radeon_GetIndirectBufferPtr( ai, vc->state_buffer_idx ); - // no siccors - WRITE_IB_REG( RADEON_DEFAULT_SC_BOTTOM_RIGHT, - (RADEON_DEFAULT_SC_RIGHT_MAX | RADEON_DEFAULT_SC_BOTTOM_MAX)); + WRITE_IB_REG( RADEON_DEFAULT_OFFSET, pitch_offset ); + WRITE_IB_REG( RADEON_DST_PITCH_OFFSET, pitch_offset ); + WRITE_IB_REG( RADEON_SRC_PITCH_OFFSET, pitch_offset ); + // no sissors + WRITE_IB_REG( RADEON_DEFAULT_SC_BOTTOM_RIGHT, + (RADEON_DEFAULT_SC_RIGHT_MAX | RADEON_DEFAULT_SC_BOTTOM_MAX)); - // setup general flags - perhaps this is not needed as all - // 2D commands contain this register - WRITE_IB_REG( RADEON_DP_GUI_MASTER_CNTL, - (datatype << RADEON_GMC_DST_DATATYPE_SHIFT) - | RADEON_GMC_CLR_CMP_CNTL_DIS + // general fluff + WRITE_IB_REG( RADEON_DP_GUI_MASTER_CNTL, + (datatype << RADEON_GMC_DST_DATATYPE_SHIFT) + | RADEON_GMC_CLR_CMP_CNTL_DIS + + | RADEON_GMC_BRUSH_SOLID_COLOR + | RADEON_GMC_SRC_DATATYPE_COLOR + + | RADEON_ROP3_P + | RADEON_DP_SRC_SOURCE_MEMORY + | RADEON_GMC_WR_MSK_DIS ); - | RADEON_GMC_BRUSH_SOLID_COLOR - | RADEON_GMC_SRC_DATATYPE_COLOR - - | RADEON_ROP3_P - | RADEON_DP_SRC_SOURCE_MEMORY - | RADEON_GMC_WR_MSK_DIS ); - + // most of this init is probably not necessary + // as we neither draw lines nor use brushes + WRITE_IB_REG( RADEON_DP_BRUSH_FRGD_CLR, 0xffffffff); + WRITE_IB_REG( RADEON_DP_BRUSH_BKGD_CLR, 0x00000000); + WRITE_IB_REG( RADEON_DP_SRC_FRGD_CLR, 0xffffffff); + WRITE_IB_REG( RADEON_DP_SRC_BKGD_CLR, 0x00000000); + WRITE_IB_REG( RADEON_DP_WRITE_MASK, 0xffffffff); - // most of this init is probably not nessacary - // as we neither draw lines nor use brushes - WRITE_IB_REG( RADEON_DST_LINE_START, 0); - WRITE_IB_REG( RADEON_DST_LINE_END, 0); - WRITE_IB_REG( RADEON_DP_BRUSH_FRGD_CLR, 0xffffffff); - WRITE_IB_REG( RADEON_DP_BRUSH_BKGD_CLR, 0x00000000); - WRITE_IB_REG( RADEON_DP_SRC_FRGD_CLR, 0xffffffff); - WRITE_IB_REG( RADEON_DP_SRC_BKGD_CLR, 0x00000000); - WRITE_IB_REG( RADEON_DP_WRITE_MASK, 0xffffffff); + // this is required + vc->state_buffer_size = buffer - buffer_start; + } else { + Radeon_WaitForFifo( ai, 10 ); + OUTREG( ai->regs, RADEON_DEFAULT_OFFSET, pitch_offset ); + OUTREG( ai->regs, RADEON_DST_PITCH_OFFSET, pitch_offset ); + OUTREG( ai->regs, RADEON_SRC_PITCH_OFFSET, pitch_offset ); + // no sissors + OUTREG( ai->regs, RADEON_DEFAULT_SC_BOTTOM_RIGHT, (RADEON_DEFAULT_SC_RIGHT_MAX + | RADEON_DEFAULT_SC_BOTTOM_MAX)); + // general fluff + OUTREG( ai->regs, RADEON_DP_GUI_MASTER_CNTL, + (datatype << RADEON_GMC_DST_DATATYPE_SHIFT) + | RADEON_GMC_CLR_CMP_CNTL_DIS + + | RADEON_GMC_BRUSH_SOLID_COLOR + | RADEON_GMC_SRC_DATATYPE_COLOR + + | RADEON_ROP3_P + | RADEON_DP_SRC_SOURCE_MEMORY + | RADEON_GMC_WR_MSK_DIS ); + + // most of this init is probably not necessary + // as we neither draw lines nor use brushes + OUTREG( ai->regs, RADEON_DP_BRUSH_FRGD_CLR, 0xffffffff); + OUTREG( ai->regs, RADEON_DP_BRUSH_BKGD_CLR, 0x00000000); + OUTREG( ai->regs, RADEON_DP_SRC_FRGD_CLR, 0xffffffff); + OUTREG( ai->regs, RADEON_DP_SRC_BKGD_CLR, 0x00000000); + OUTREG( ai->regs, RADEON_DP_WRITE_MASK, 0xffffffff); - vc->state_buffer_size = buffer - buffer_start; + } ai->si->active_vc = vc->id; } Modified: haiku/trunk/src/add-ons/accelerants/radeon/EngineManagment.c =================================================================== --- haiku/trunk/src/add-ons/accelerants/radeon/EngineManagment.c 2007-03-01 09:05:12 UTC (rev 20272) +++ haiku/trunk/src/add-ons/accelerants/radeon/EngineManagment.c 2007-03-01 09:28:25 UTC (rev 20273) @@ -65,21 +65,30 @@ if( ai->si->engine.count == ai->si->engine.written ) return; - START_IB(); - - // flush pending data - WRITE_IB_REG( RADEON_RB2D_DSTCACHE_CTLSTAT, RADEON_RB2D_DC_FLUSH_ALL ); + if( ai->si->acc_dma ) { + START_IB(); - // make sure commands are finished - WRITE_IB_REG( RADEON_WAIT_UNTIL, RADEON_WAIT_2D_IDLECLEAN | - RADEON_WAIT_3D_IDLECLEAN | RADEON_WAIT_HOST_IDLECLEAN ); + // flush pending data + WRITE_IB_REG( RADEON_RB2D_DSTCACHE_CTLSTAT, RADEON_RB2D_DC_FLUSH_ALL ); - // write scratch register - WRITE_IB_REG( RADEON_SCRATCH_REG0, ai->si->engine.count ); - - ai->si->engine.written = ai->si->engine.count; - - SUBMIT_IB(); + // make sure commands are finished + WRITE_IB_REG( RADEON_WAIT_UNTIL, RADEON_WAIT_2D_IDLECLEAN | + RADEON_WAIT_3D_IDLECLEAN | RADEON_WAIT_HOST_IDLECLEAN ); + + // write scratch register + WRITE_IB_REG( RADEON_SCRATCH_REG0, ai->si->engine.count ); + + ai->si->engine.written = ai->si->engine.count; + + SUBMIT_IB(); + } else { + Radeon_WaitForFifo( ai, 2 ); + OUTREG( ai->regs, RADEON_RB2D_DSTCACHE_CTLSTAT, RADEON_RB2D_DC_FLUSH_ALL); + OUTREG( ai->regs, RADEON_WAIT_UNTIL, RADEON_WAIT_2D_IDLECLEAN | + RADEON_WAIT_3D_IDLECLEAN | + RADEON_WAIT_HOST_IDLECLEAN); + ai->si->engine.written = ai->si->engine.count; + } } // public function: acquire engine for future use @@ -178,6 +187,13 @@ SHOW_FLOW0( 4, "" ); + if ( !ai->si->acc_dma ) + { + Radeon_WaitForFifo( ai, 64 ); + Radeon_WaitForIdle( ai, false ); + return B_OK; + } + start_time = system_time(); while( 1 ) { Modified: haiku/trunk/src/add-ons/accelerants/radeon/InitAccelerant.c =================================================================== --- haiku/trunk/src/add-ons/accelerants/radeon/InitAccelerant.c 2007-03-01 09:05:12 UTC (rev 20272) +++ haiku/trunk/src/add-ons/accelerants/radeon/InitAccelerant.c 2007-03-01 09:28:25 UTC (rev 20273) @@ -111,7 +111,8 @@ static void uninit_common( void ) { if( !ai->accelerant_is_clone ) { - Radeon_FreeVirtualCardStateBuffer( ai ); + if ( ai->si->acc_dma ) + Radeon_FreeVirtualCardStateBuffer( ai ); // the last accelerant should must wait for the card to become quite, // else some nasty command could lunger in some FIFO @@ -200,7 +201,8 @@ // mark engine as having no state //si->cp.active_state_buffer = -1; - Radeon_AllocateVirtualCardStateBuffer( ai ); + if ( ai->si->acc_dma ) + Radeon_AllocateVirtualCardStateBuffer( ai ); // everything else is initialized upon set_display_mode return B_OK; Modified: haiku/trunk/src/add-ons/accelerants/radeon/driver_wrapper.c =================================================================== --- haiku/trunk/src/add-ons/accelerants/radeon/driver_wrapper.c 2007-03-01 09:05:12 UTC (rev 20272) +++ haiku/trunk/src/add-ons/accelerants/radeon/driver_wrapper.c 2007-03-01 09:28:25 UTC (rev 20273) @@ -23,7 +23,28 @@ return ioctl( ai->fd, RADEON_WAITFORIDLE, &wfi, sizeof( wfi )); } +// wait until "entries" FIFO entries are empty +// lock must be hold +status_t Radeon_WaitForFifo( accelerator_info *ai, int entries ) +{ + while( 1 ) { + bigtime_t start_time = system_time(); + + do { + int slots = INREG( ai->regs, RADEON_RBBM_STATUS ) & RADEON_RBBM_FIFOCNT_MASK; + + if ( slots >= entries ) + return B_OK; + snooze( 1 ); + } while( system_time() - start_time < 1000000 ); + + Radeon_ResetEngine( ai ); + } + + return B_ERROR; +} + void Radeon_ResetEngine( accelerator_info *ai ) { radeon_no_arg na; Modified: haiku/trunk/src/add-ons/accelerants/radeon/generic.h =================================================================== --- haiku/trunk/src/add-ons/accelerants/radeon/generic.h 2007-03-01 09:05:12 UTC (rev 20272) +++ haiku/trunk/src/add-ons/accelerants/radeon/generic.h 2007-03-01 09:28:25 UTC (rev 20273) @@ -49,6 +49,18 @@ void FILL_SPAN(engine_token *et, uint32 color, uint16 *list, uint32 count); +void SCREEN_TO_SCREEN_BLIT_DMA(engine_token *et, blit_params *list, uint32 count); +void FILL_RECTANGLE_DMA(engine_token *et, uint32 color, fill_rect_params *list, uint32 count); +void INVERT_RECTANGLE_DMA(engine_token *et, fill_rect_params *list, uint32 count); + +void FILL_SPAN_DMA(engine_token *et, uint32 color, uint16 *list, uint32 count); + +void SCREEN_TO_SCREEN_BLIT_PIO(engine_token *et, blit_params *list, uint32 count); +void FILL_RECTANGLE_PIO(engine_token *et, uint32 color, fill_rect_params *list, uint32 count); +void INVERT_RECTANGLE_PIO(engine_token *et, fill_rect_params *list, uint32 count); + +void FILL_SPAN_PIO(engine_token *et, uint32 color, uint16 *list, uint32 count); + uint32 OVERLAY_COUNT(const display_mode *dm); const uint32 *OVERLAY_SUPPORTED_SPACES(const display_mode *dm); uint32 OVERLAY_SUPPORTED_FEATURES(uint32 a_color_space); Modified: haiku/trunk/src/add-ons/accelerants/radeon/overlay.c =================================================================== --- haiku/trunk/src/add-ons/accelerants/radeon/overlay.c 2007-03-01 09:05:12 UTC (rev 20272) +++ haiku/trunk/src/add-ons/accelerants/radeon/overlay.c 2007-03-01 09:28:25 UTC (rev 20273) @@ -973,17 +973,27 @@ shared_info *si = ai->si; uint32 offset; - START_IB(); - - offset = si->pending_overlay.on->mem_offset + si->active_overlay.rel_offset; + if ( ai->si->acc_dma ) + { + START_IB(); - WRITE_IB_REG( RADEON_OV0_VID_BUF0_BASE_ADRS, offset); - - si->overlay_mgr.auto_flip_reg ^= RADEON_OV0_SOFT_EOF_TOGGLE; - WRITE_IB_REG( RADEON_OV0_AUTO_FLIP_CNTRL, si->overlay_mgr.auto_flip_reg ); - - SUBMIT_IB(); - + offset = si->pending_overlay.on->mem_offset + si->active_overlay.rel_offset; + + WRITE_IB_REG( RADEON_OV0_VID_BUF0_BASE_ADRS, offset); + + si->overlay_mgr.auto_flip_reg ^= RADEON_OV0_SOFT_EOF_TOGGLE; + WRITE_IB_REG( RADEON_OV0_AUTO_FLIP_CNTRL, si->overlay_mgr.auto_flip_reg ); + + SUBMIT_IB(); + } else { + Radeon_WaitForFifo( ai, 2 ); + offset = si->pending_overlay.on->mem_offset + si->active_overlay.rel_offset; + + OUTREG( ai->regs, RADEON_OV0_VID_BUF0_BASE_ADRS, offset); + + si->overlay_mgr.auto_flip_reg ^= RADEON_OV0_SOFT_EOF_TOGGLE; + OUTREG( ai->regs, RADEON_OV0_AUTO_FLIP_CNTRL, si->overlay_mgr.auto_flip_reg ); + } ai->si->active_overlay.on = ai->si->pending_overlay.on; #endif } Modified: haiku/trunk/src/add-ons/accelerants/radeon/palette.c =================================================================== --- haiku/trunk/src/add-ons/accelerants/radeon/palette.c 2007-03-01 09:05:12 UTC (rev 20272) +++ haiku/trunk/src/add-ons/accelerants/radeon/palette.c 2007-03-01 09:28:25 UTC (rev 20273) @@ -13,33 +13,41 @@ #include "GlobalData.h" #include "dac_regs.h" +#include "mmio.h" #include "CP.h" #include "generic.h" -// Radeon's DACs share same public registers, this function -// selects the DAC you'll talk to -#define selectPalette( crtc_idx ) \ - WRITE_IB_REG( RADEON_DAC_CNTL2, \ - (crtc_idx == 0 ? 0 : RADEON_DAC2_PALETTE_ACC_CTL) | \ - (ai->si->dac_cntl2 & ~RADEON_DAC2_PALETTE_ACC_CTL) ); - - // set standard colour palette (needed for non-palette modes) void Radeon_InitPalette( accelerator_info *ai, int crtc_idx ) { int i; - START_IB(); - - selectPalette( crtc_idx ); - - WRITE_IB_REG( RADEON_PALETTE_INDEX, 0 ); - - for( i = 0; i < 256; ++i ) - WRITE_IB_REG( RADEON_PALETTE_DATA, (i << 16) | (i << 8) | i ); + if ( ai->si->acc_dma ) { + START_IB(); - SUBMIT_IB(); + WRITE_IB_REG( RADEON_DAC_CNTL2, + (crtc_idx == 0 ? 0 : RADEON_DAC2_PALETTE_ACC_CTL) | + (ai->si->dac_cntl2 & ~RADEON_DAC2_PALETTE_ACC_CTL) ); + + WRITE_IB_REG( RADEON_PALETTE_INDEX, 0 ); + + for( i = 0; i < 256; ++i ) + WRITE_IB_REG( RADEON_PALETTE_DATA, (i << 16) | (i << 8) | i ); + + SUBMIT_IB(); + } else { + Radeon_WaitForFifo ( ai , 1 ); + OUTREG( ai->regs, RADEON_DAC_CNTL2, + (crtc_idx == 0 ? 0 : RADEON_DAC2_PALETTE_ACC_CTL) | + (ai->si->dac_cntl2 & ~RADEON_DAC2_PALETTE_ACC_CTL) ); + + OUTREG( ai->regs, RADEON_PALETTE_INDEX, 0 ); + for( i = 0; i < 256; ++i ) { + Radeon_WaitForFifo ( ai , 1 ); // TODO FIXME good god this is gonna be slow... + OUTREG( ai->regs, RADEON_PALETTE_DATA, (i << 16) | (i << 8) | i ); + } + } } static void setPalette( @@ -75,17 +83,35 @@ { uint i; - START_IB(); - - selectPalette( crtc_idx ); - - WRITE_IB_REG( RADEON_PALETTE_INDEX, first ); - - for( i = 0; i < count; ++i, color_data += 3 ) - WRITE_IB_REG( RADEON_PALETTE_DATA, - ((uint32)color_data[0] << 16) | - ((uint32)color_data[1] << 8) | - color_data[2] ); - - SUBMIT_IB(); + if ( ai->si->acc_dma ) { + START_IB(); + + WRITE_IB_REG( RADEON_DAC_CNTL2, + (crtc_idx == 0 ? 0 : RADEON_DAC2_PALETTE_ACC_CTL) | + (ai->si->dac_cntl2 & ~RADEON_DAC2_PALETTE_ACC_CTL) ); + + WRITE_IB_REG( RADEON_PALETTE_INDEX, first ); + + for( i = 0; i < count; ++i, color_data += 3 ) + WRITE_IB_REG( RADEON_PALETTE_DATA, + ((uint32)color_data[0] << 16) | + ((uint32)color_data[1] << 8) | + color_data[2] ); + + SUBMIT_IB(); + } else { + Radeon_WaitForFifo ( ai , 1 ); + OUTREG( ai->regs, RADEON_DAC_CNTL2, + (crtc_idx == 0 ? 0 : RADEON_DAC2_PALETTE_ACC_CTL) | + (ai->si->dac_cntl2 & ~RADEON_DAC2_PALETTE_ACC_CTL) ); + + OUTREG( ai->regs, RADEON_PALETTE_INDEX, first ); + for( i = 0; i < count; ++i, color_data += 3 ) { + Radeon_WaitForFifo ( ai , 1 ); // TODO FIXME good god this is gonna be slow... + OUTREG( ai->regs, RADEON_PALETTE_DATA, + ((uint32)color_data[0] << 16) | + ((uint32)color_data[1] << 8) | + color_data[2] ); + } + } } Modified: haiku/trunk/src/add-ons/accelerants/radeon/radeon_accelerant.h =================================================================== --- haiku/trunk/src/add-ons/accelerants/radeon/radeon_accelerant.h 2007-03-01 09:05:12 UTC (rev 20272) +++ haiku/trunk/src/add-ons/accelerants/radeon/radeon_accelerant.h 2007-03-01 09:28:25 UTC (rev 20273) @@ -115,6 +115,7 @@ // driver_wrapper.c status_t Radeon_WaitForIdle( accelerator_info *ai, bool keep_lock ); +status_t Radeon_WaitForFifo( accelerator_info *ai, int entries ); void Radeon_ResetEngine( accelerator_info *ai ); status_t Radeon_VIPRead( accelerator_info *ai, uint channel, uint address, uint32 *data ); Modified: haiku/trunk/src/add-ons/kernel/drivers/graphics/radeon/CP_setup.c =================================================================== --- haiku/trunk/src/add-ons/kernel/drivers/graphics/radeon/CP_setup.c 2007-03-01 09:05:12 UTC (rev 20272) +++ haiku/trunk/src/add-ons/kernel/drivers/graphics/radeon/CP_setup.c 2007-03-01 09:28:25 UTC (rev 20273) @@ -227,71 +227,54 @@ host_path_cntl = INREG( regs, RADEON_HOST_PATH_CNTL ); rbbm_soft_reset = INREG( regs, RADEON_RBBM_SOFT_RESET ); - switch( di->asic ) { - case rt_r300: - OUTREG( regs, RADEON_RBBM_SOFT_RESET, (rbbm_soft_reset | + OUTREG( regs, RADEON_RBBM_SOFT_RESET, (rbbm_soft_reset | RADEON_SOFT_RESET_CP | RADEON_SOFT_RESET_HI | - RADEON_SOFT_RESET_E2 | - RADEON_SOFT_RESET_AIC )); - INREG( regs, RADEON_RBBM_SOFT_RESET); - OUTREG( regs, RADEON_RBBM_SOFT_RESET, 0); - // this bit has no description - OUTREGP( regs, RADEON_RB2D_DSTCACHE_MODE, (1 << 17), ~0 ); - - break; - default: - OUTREG( regs, RADEON_RBBM_SOFT_RESET, rbbm_soft_reset | - RADEON_SOFT_RESET_CP | - RADEON_SOFT_RESET_HI | RADEON_SOFT_RESET_SE | RADEON_SOFT_RESET_RE | RADEON_SOFT_RESET_PP | RADEON_SOFT_RESET_E2 | - RADEON_SOFT_RESET_RB | - RADEON_SOFT_RESET_AIC ); - INREG( regs, RADEON_RBBM_SOFT_RESET ); - OUTREG( regs, RADEON_RBBM_SOFT_RESET, rbbm_soft_reset & - ~( RADEON_SOFT_RESET_CP | - RADEON_SOFT_RESET_HI | - RADEON_SOFT_RESET_SE | - RADEON_SOFT_RESET_RE | - RADEON_SOFT_RESET_PP | - RADEON_SOFT_RESET_E2 | - RADEON_SOFT_RESET_RB | - RADEON_SOFT_RESET_AIC ) ); - INREG( regs, RADEON_RBBM_SOFT_RESET ); - } - + RADEON_SOFT_RESET_RB ) ); + INREG( regs, RADEON_RBBM_SOFT_RESET); + OUTREG( regs, RADEON_RBBM_SOFT_RESET, rbbm_soft_reset & + ~( RADEON_SOFT_RESET_CP | + RADEON_SOFT_RESET_HI | + RADEON_SOFT_RESET_SE | + RADEON_SOFT_RESET_RE | + RADEON_SOFT_RESET_PP | + RADEON_SOFT_RESET_E2 | + RADEON_SOFT_RESET_RB ) ); + INREG( regs, RADEON_RBBM_SOFT_RESET); + OUTREG( regs, RADEON_HOST_PATH_CNTL, host_path_cntl | RADEON_HDP_SOFT_RESET ); INREG( regs, RADEON_HOST_PATH_CNTL ); OUTREG( regs, RADEON_HOST_PATH_CNTL, host_path_cntl ); - // restore regs - OUTREG( regs, RADEON_RBBM_SOFT_RESET, rbbm_soft_reset); - - OUTREG( regs, RADEON_CLOCK_CNTL_INDEX, clock_cntl_index ); - //R300_PLLFix( regs, di->asic ); Radeon_OUTPLL( regs, di->asic, RADEON_MCLK_CNTL, mclk_cntl ); + OUTREG( regs, RADEON_CLOCK_CNTL_INDEX, clock_cntl_index ); + //RADEONPllErrataAfterIndex( regs, di->asic ); // drm doesn't do this here! + OUTREG( regs, RADEON_RBBM_SOFT_RESET, rbbm_soft_reset); + + if ( di->acc_dma ) + { + // reset ring buffer + cur_read_ptr = INREG( regs, RADEON_CP_RB_RPTR ); + OUTREG( regs, RADEON_CP_RB_WPTR, cur_read_ptr ); + + //if( si->cp.ring.head ) { + // during init, there are no feedback data + if( si->cp.feedback.mem_handle != 0 ) { + *(uint32 *)MEM2CPU( si->cp.feedback.mem_type, si->cp.feedback.head_mem_offset) = + cur_read_ptr; + // *si->cp.ring.head = cur_read_ptr; + si->cp.ring.tail = cur_read_ptr; + } - // reset ring buffer - cur_read_ptr = INREG( regs, RADEON_CP_RB_RPTR ); - OUTREG( regs, RADEON_CP_RB_WPTR, cur_read_ptr ); - - //if( si->cp.ring.head ) { - // during init, there are no feedback data - if( si->cp.feedback.mem_handle != 0 ) { - *(uint32 *)MEM2CPU( si->cp.feedback.mem_type, si->cp.feedback.head_mem_offset) = - cur_read_ptr; - // *si->cp.ring.head = cur_read_ptr; - si->cp.ring.tail = cur_read_ptr; + // mark all buffers as being finished + Radeon_DiscardAllIndirectBuffers( di ); } ++si->engine.count; - - // mark all buffers as being finished - Radeon_DiscardAllIndirectBuffers( di ); - return; } @@ -522,7 +505,7 @@ set_sem_owner( di->si->cp.lock.sem, thinfo.team ); // init raw CP - loadMicroEngineRAMData( di ); + if ( di->acc_dma ) loadMicroEngineRAMData( di ); // do soft-reset Radeon_ResetEngine( di ); @@ -536,27 +519,31 @@ // reset CP to make disabling active Radeon_ResetEngine( di ); - res = initRingBuffer( di, CP_RING_SIZE ); - if( res < 0 ) - goto err4; - - res = initCPFeedback( di ); - if( res < 0 ) - goto err3; + if ( di->acc_dma ) + { + res = initRingBuffer( di, CP_RING_SIZE ); + if( res < 0 ) + goto err4; - res = initIndirectBuffers( di ); - if( res < 0 ) - goto err2; + res = initCPFeedback( di ); + if( res < 0 ) + goto err3; + + res = initIndirectBuffers( di ); + if( res < 0 ) + goto err2; + + // tell CP to use BM + Radeon_WaitForIdle( di, false, false ); - // tell CP to use BM - Radeon_WaitForIdle( di, false, false ); - - // enable direct and indirect CP bus mastering - OUTREG( di->regs, RADEON_CP_CSQ_CNTL, RADEON_CSQ_PRIBM_INDBM ); - - // allow bus mastering in general - OUTREGP( di->regs, RADEON_BUS_CNTL, 0, ~RADEON_BUS_MASTER_DIS ); + // enable direct and indirect CP bus mastering + OUTREG( di->regs, RADEON_CP_CSQ_CNTL, RADEON_CSQ_PRIBM_INDBM ); + + // allow bus mastering in general + OUTREGP( di->regs, RADEON_BUS_CNTL, 0, ~RADEON_BUS_MASTER_DIS ); + } + // don't allow mixing of 2D/3D/scratch/wait_until commands // (in fact, this doesn't seem to make any difference as we do a // manual sync in all these cases anyway) @@ -596,11 +583,14 @@ OUTREG( regs, RADEON_CP_CSQ_CNTL, RADEON_CSQ_PRIDIS_INDDIS ); // read-back for flushing INREG( regs, RADEON_CP_CSQ_CNTL ); - - uninitRingBuffer( di ); - uninitCPFeedback( di ); - uninitIndirectBuffers( di ); + if ( di->acc_dma ) + { + uninitRingBuffer( di ); + uninitCPFeedback( di ); + uninitIndirectBuffers( di ); + } + DELETE_BEN( di->si->cp.lock ); } Modified: haiku/trunk/src/add-ons/kernel/drivers/graphics/radeon/bios.c =================================================================== --- haiku/trunk/src/add-ons/kernel/drivers/graphics/radeon/bios.c 2007-03-01 09:05:12 UTC (rev 20272) +++ haiku/trunk/src/add-ons/kernel/drivers/graphics/radeon/bios.c 2007-03-01 09:28:25 UTC (rev 20273) @@ -536,58 +536,142 @@ SHOW_INFO( 2, "pixel_clock=%d", di->fp_info.dot_clock ); } + +// Depending on card genertation, chipset bugs, etc... the amount of vram +// accessible to the CPU can vary. This function is our best shot at figuring +// it out. Returns a value in KB. +static uint32 RADEON_GetAccessibleVRAM( device_info *di ) +{ + vuint8 *regs = di->regs; + pci_info *pcii = &(di->pcii); + + uint32 aper_size = INREG( regs, RADEON_CONFIG_APER_SIZE ); + + // Set HDP_APER_CNTL only on cards that are known not to be broken, + // that is has the 2nd generation multifunction PCI interface + if (di->asic == rt_rv280 || + di->asic == rt_rv350 || + di->asic == rt_rv380 || + di->asic == rt_r420 ) { + OUTREGP( regs, RADEON_HOST_PATH_CNTL, RADEON_HDP_APER_CNTL, + ~RADEON_HDP_APER_CNTL); + SHOW_INFO0( 0, "Generation 2 PCI interface, using max accessible memory"); + return aper_size * 2; + } + + // Older cards have all sorts of funny issues to deal with. First + // check if it's a multifunction card by reading the PCI config + // header type... Limit those to one aperture size + if (get_pci(PCI_header_type, 1) & 0x80) { + SHOW_INFO0( 0, "Generation 1 PCI interface in multifunction mode" + ", accessible memory limited to one aperture\n"); + return aper_size; + } + + // Single function older card. We read HDP_APER_CNTL to see how the BIOS [... truncated: 384 lines follow ...] From axeld at mail.berlios.de Thu Mar 1 10:33:08 2007 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Thu, 1 Mar 2007 10:33:08 +0100 Subject: [Haiku-commits] r20274 - in haiku/trunk: headers/private/graphics/radeon src/add-ons/accelerants/radeon src/add-ons/kernel/drivers/graphics/radeon Message-ID: <200703010933.l219X8J6003376@sheep.berlios.de> Author: axeld Date: 2007-03-01 10:33:08 +0100 (Thu, 01 Mar 2007) New Revision: 20274 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20274&view=rev Modified: haiku/trunk/headers/private/graphics/radeon/radeon_interface.h haiku/trunk/headers/private/graphics/radeon/version.h haiku/trunk/src/add-ons/accelerants/radeon/monitor_routing.c haiku/trunk/src/add-ons/kernel/drivers/graphics/radeon/driver.c haiku/trunk/src/add-ons/kernel/drivers/graphics/radeon/init.c haiku/trunk/src/add-ons/kernel/drivers/graphics/radeon/radeon_driver.h Log: Patch by Euan Kirkhope: * Kernel settings configuration added Modified: haiku/trunk/headers/private/graphics/radeon/radeon_interface.h =================================================================== --- haiku/trunk/headers/private/graphics/radeon/radeon_interface.h 2007-03-01 09:28:25 UTC (rev 20273) +++ haiku/trunk/headers/private/graphics/radeon/radeon_interface.h 2007-03-01 09:33:08 UTC (rev 20274) @@ -55,6 +55,19 @@ // buffers in one chunk, the size per buffer in bytes must be a multiple of 4k #define INDIRECT_BUFFER_SIZE (4096/4) +typedef struct { + uint32 loginfo; + uint32 logflow; + uint32 logerror; + bool switchhead; + bool force_lcd; + bool dynamic_clocks; // power saving / management for mobility chips + bool force_pci; + bool unhide_fastwrites; + bool force_acc_dma; // one or the other + bool force_acc_mmio; // one or the other + bool acc_writeback; +} radeon_settings; // type of memory typedef enum { @@ -460,6 +473,8 @@ int blank_period; // vertical blank period of a frame in ms int enable_virtual_irq; // true, to enable virtual interrupts + radeon_settings settings; // settings from radeon.settings file + struct log_info_t *log; // fast logger data } shared_info; Modified: haiku/trunk/headers/private/graphics/radeon/version.h =================================================================== --- haiku/trunk/headers/private/graphics/radeon/version.h 2007-03-01 09:28:25 UTC (rev 20273) +++ haiku/trunk/headers/private/graphics/radeon/version.h 2007-03-01 09:33:08 UTC (rev 20274) @@ -8,4 +8,4 @@ */ // current version -#define RADEON_DRIVER_VERSION "Version: 5.1.3.1" +#define RADEON_DRIVER_VERSION "Version: 5.1.3.5" Modified: haiku/trunk/src/add-ons/accelerants/radeon/monitor_routing.c =================================================================== --- haiku/trunk/src/add-ons/accelerants/radeon/monitor_routing.c 2007-03-01 09:28:25 UTC (rev 20273) +++ haiku/trunk/src/add-ons/accelerants/radeon/monitor_routing.c 2007-03-01 09:33:08 UTC (rev 20274) @@ -650,6 +650,11 @@ virtual_card *vc = ai->vc; shared_info *si = ai->si; display_device_e display_devices = vc->connected_displays; + + if (ai->si->settings.force_lcd) { + use_laptop_panel = true; + SHOW_FLOW0( 2, "LCD Forced Used by Kernel Settings"); + } SHOW_FLOW( 2, "display_devices=%x, whished_num_heads=%d, use_laptop_panel=%d", display_devices, whished_num_heads, use_laptop_panel ); Modified: haiku/trunk/src/add-ons/kernel/drivers/graphics/radeon/driver.c =================================================================== --- haiku/trunk/src/add-ons/kernel/drivers/graphics/radeon/driver.c 2007-03-01 09:28:25 UTC (rev 20273) +++ haiku/trunk/src/add-ons/kernel/drivers/graphics/radeon/driver.c 2007-03-01 09:33:08 UTC (rev 20274) @@ -45,7 +45,90 @@ NULL }; +radeon_settings def_settings = { // see comments in radeon.settings + 2, // loginfo + 2, // logflow + 2, // logerror + false, // switchhead + false, // force_lcd + true, // dynamic_clocks + true, // force_pci + false, // unhide_fw + false, // acc_dma + false, // acc_mmio + true, // acc_wb +}; +radeon_settings current_settings; + +static void GetDriverSettings(void) +{ + + void *settings_handle = NULL; + + SHOW_FLOW0( 1, "" ); + + // init settings to defaults; + current_settings = def_settings; + + // get driver/accelerant settings, apsed + settings_handle = load_driver_settings ("radeon.settings"); + if (settings_handle != NULL) { + const char *item; + char *end; + uint32 value; + + item = get_driver_parameter (settings_handle, "loginfo", "2", "2"); + value = strtoul (item, &end, 0); + if (*end == '\0' && value <= 4) { + current_settings.loginfo = value; + SHOW_INFO( 1, "Log Info Level now %ld/4", value ); + } + + item = get_driver_parameter (settings_handle, "logflow", "2", "2"); + value = strtoul (item, &end, 0); + if (*end == '\0' && value <= 4) { + current_settings.logflow = value; + SHOW_INFO( 1, "Log Flow Level now %ld/4", value ); + } + + item = get_driver_parameter (settings_handle, "logerror", "2", "2"); + value = strtoul (item, &end, 0); + if (*end == '\0' && value <= 4) { + current_settings.logerror = value; + SHOW_INFO( 1, "Log Error Level now %ld/4", value ); + } + + current_settings.switchhead = get_driver_boolean_parameter (settings_handle, "switchhead", false, false); + current_settings.force_lcd = get_driver_boolean_parameter (settings_handle, "force_lcd", false, false); + current_settings.dynamic_clocks = get_driver_boolean_parameter (settings_handle, "dynamic_clocks", true, true); + current_settings.force_pci = get_driver_boolean_parameter (settings_handle, "force_pci", true, true); + current_settings.unhide_fastwrites = get_driver_boolean_parameter (settings_handle, "unhide_fw", false, false); + current_settings.force_acc_dma = get_driver_boolean_parameter (settings_handle, "force_acc_dma", false, false); + current_settings.force_acc_mmio = get_driver_boolean_parameter (settings_handle, "force_acc_mmio", false, false); + current_settings.acc_writeback = get_driver_boolean_parameter (settings_handle, "acc_writeback", false, false); + + if ( current_settings.switchhead != def_settings.switchhead ) + SHOW_INFO0( 1, "Switch Head = True" ); + if ( current_settings.force_lcd != def_settings.force_lcd ) + SHOW_INFO0( 1, "Force LCD ON" ); + if ( current_settings.dynamic_clocks != def_settings.dynamic_clocks ) + SHOW_INFO0( 1, "Mobility Power Saving Disabled (Dynamic Clocks)" ); + if ( current_settings.force_pci != def_settings.force_pci ) + SHOW_INFO0( 1, "Force PCI = True" ); + if ( current_settings.unhide_fastwrites != def_settings.unhide_fastwrites ) + SHOW_INFO0( 1, "use Fastwrites ON" ); + if ( current_settings.force_acc_dma != def_settings.force_acc_dma ) + SHOW_INFO0( 1, "DMA ACC Enabled" ); + if ( current_settings.force_acc_mmio != def_settings.force_acc_mmio ) + SHOW_INFO0( 1, "DMA ACC Disabled" ); + if ( current_settings.acc_writeback != def_settings.acc_writeback ) + SHOW_INFO0( 1, "DMA WriteBack Disabled" ); + + unload_driver_settings (settings_handle); + } +} + // public function: check whether there is *any* supported hardware status_t init_hardware( void ) { @@ -74,6 +157,7 @@ (void)INIT_BEN( devices->kernel, "Radeon Kernel" ); + GetDriverSettings(); Radeon_ProbeDevices(); return B_OK; } Modified: haiku/trunk/src/add-ons/kernel/drivers/graphics/radeon/init.c =================================================================== --- haiku/trunk/src/add-ons/kernel/drivers/graphics/radeon/init.c 2007-03-01 09:28:25 UTC (rev 20273) +++ haiku/trunk/src/add-ons/kernel/drivers/graphics/radeon/init.c 2007-03-01 09:33:08 UTC (rev 20274) @@ -28,6 +28,7 @@ #define get_pci(o, s) (*pci_bus->read_pci_config)(pcii->bus, pcii->device, pcii->function, (o), (s)) #define set_pci(o, s, v) (*pci_bus->write_pci_config)(pcii->bus, pcii->device, pcii->function, (o), (s), (v)) +extern radeon_settings current_settings; // map frame buffer and registers // mmio_only - true = map registers only (used during detection) @@ -229,7 +230,14 @@ memset( di->si, 0, sizeof( *di->si )); si = di->si; + + si->settings = di->settings = current_settings; + if (di->settings.force_acc_dma) + di->acc_dma = true; + if (di->settings.force_acc_mmio) // force mmio will override dma... a tristate fuzzylogic, grey bool would be nice... + di->acc_dma = false; + #ifdef ENABLE_LOGGING #ifdef LOG_INCLUDE_STARTUP si->log = log_init( 1000000 ); Modified: haiku/trunk/src/add-ons/kernel/drivers/graphics/radeon/radeon_driver.h =================================================================== --- haiku/trunk/src/add-ons/kernel/drivers/graphics/radeon/radeon_driver.h 2007-03-01 09:28:25 UTC (rev 20273) +++ haiku/trunk/src/add-ons/kernel/drivers/graphics/radeon/radeon_driver.h 2007-03-01 09:33:08 UTC (rev 20274) @@ -154,6 +154,8 @@ uint32 dac2_cntl; // original dac2_cntl register content + radeon_settings settings; // overrides read from radeon.settings + pci_info pcii; char name[MAX_RADEON_DEVICE_NAME_LENGTH]; char video_name[MAX_RADEON_DEVICE_NAME_LENGTH]; From axeld at mail.berlios.de Thu Mar 1 10:35:25 2007 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Thu, 1 Mar 2007 10:35:25 +0100 Subject: [Haiku-commits] r20275 - in haiku/trunk: headers/private/graphics/radeon src/add-ons/accelerants/radeon src/add-ons/kernel/drivers/graphics/radeon Message-ID: <200703010935.l219ZP3R003771@sheep.berlios.de> Author: axeld Date: 2007-03-01 10:35:22 +0100 (Thu, 01 Mar 2007) New Revision: 20275 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20275&view=rev Modified: haiku/trunk/headers/private/graphics/radeon/radeon_interface.h haiku/trunk/headers/private/graphics/radeon/version.h haiku/trunk/src/add-ons/accelerants/radeon/monitor_detection.c haiku/trunk/src/add-ons/kernel/drivers/graphics/radeon/bios.c haiku/trunk/src/add-ons/kernel/drivers/graphics/radeon/init.c haiku/trunk/src/add-ons/kernel/drivers/graphics/radeon/radeon_driver.h Log: Patch by Euan Kirkhope: Monitor Routing rework * mostly to fix my issues with dual monitors VGA + DVI which didn't work! ;) Modified: haiku/trunk/headers/private/graphics/radeon/radeon_interface.h =================================================================== --- haiku/trunk/headers/private/graphics/radeon/radeon_interface.h 2007-03-01 09:33:08 UTC (rev 20274) +++ haiku/trunk/headers/private/graphics/radeon/radeon_interface.h 2007-03-01 09:35:22 UTC (rev 20275) @@ -105,7 +105,98 @@ dd_dvi_ext = 64 // external DVI (only provided by few models) } display_device_e; +typedef enum +{ + ddc_none_detected, + ddc_monid, + ddc_dvi, + ddc_vga, + ddc_crt2 +} radeon_ddc_type; +typedef enum +{ + mt_unknown = -1, + mt_none = 0, + mt_crt = 1, + mt_lcd = 2, + mt_dfp = 3, + mt_ctv = 4, + mt_stv = 5 +} radeon_monitor_type; + +typedef enum +{ + connector_none, + connector_proprietary, + connector_crt, + connector_dvi_i, + connector_dvi_d, + connector_ctv, + connector_stv, + connector_unsupported +} radeon_connector_type; + +typedef enum +{ + connector_none_atom, + connector_vga_atom, + connector_dvi_i_atom, + connector_dvi_d_atom, + connector_dvi_a_atom, + connector_stv_atom, + connector_ctv_atom, + connector_lvds_atom, + connector_digital_atom, + connector_unsupported_atom +} radeon_connector_type_atom; + +typedef enum +{ + dac_unknown = -1, + dac_primary = 0, + dac_tvdac = 1 +} radeon_dac_type; + +typedef enum +{ + tmds_unknown = -1, + tmds_int = 0, + tmds_ext = 1 +} radeon_tmds_type; + +typedef struct +{ + radeon_ddc_type ddc_type; + radeon_dac_type dac_type; + radeon_tmds_type tmds_type; + radeon_connector_type connector_type; + radeon_monitor_type mon_type; + edid1_info edid; + bool edid_valid; +} radeon_connector; + +typedef struct +{ + bool has_secondary; + + /* + * The next two are used to make sure CRTC2 is restored before CRTC_EXT, + * otherwise it could lead to blank screens. + */ + bool is_secondary_restored; + bool restore_primary; + + int mon_type1; + int mon_type2; + + bool reversed_DAC; /* TVDAC used as primary dac */ + bool reversed_TMDS; /* DDC_DVI is used for external TMDS */ + + radeon_connector port_info[2]; +} disp_entity, *ptr_disp_entity; + + // type of ASIC typedef enum { rt_r100, // original Radeon @@ -448,6 +539,7 @@ uint8 num_crtc; // number of physical heads fp_info flatpanels[2]; // info about connected flat panels (if any) + disp_entity routing; // info if display connector routings eg DVI-I <- EXT TMDS <- DAC2 <- CRTC2 memory_type_info memory[mt_last]; // info about memory types memory_type_e nonlocal_type; // default type of non-local memory Modified: haiku/trunk/headers/private/graphics/radeon/version.h =================================================================== --- haiku/trunk/headers/private/graphics/radeon/version.h 2007-03-01 09:33:08 UTC (rev 20274) +++ haiku/trunk/headers/private/graphics/radeon/version.h 2007-03-01 09:35:22 UTC (rev 20275) @@ -8,4 +8,4 @@ */ // current version -#define RADEON_DRIVER_VERSION "Version: 5.1.3.5" +#define RADEON_DRIVER_VERSION "Version: 5.1.4.0" Modified: haiku/trunk/src/add-ons/accelerants/radeon/monitor_detection.c =================================================================== --- haiku/trunk/src/add-ons/accelerants/radeon/monitor_detection.c 2007-03-01 09:33:08 UTC (rev 20274) +++ haiku/trunk/src/add-ons/accelerants/radeon/monitor_detection.c 2007-03-01 09:35:22 UTC (rev 20275) @@ -834,59 +834,246 @@ return B_OK; } +static void Radeon_ConnectorInfo( accelerator_info *ai, int port, disp_entity* ptr_entity ) +{ + const char* mon; + const char* ddc = ptr_entity->port_info[port].ddc_type == ddc_none_detected ? "None" : + ptr_entity->port_info[port].ddc_type == ddc_monid ? "Mon ID" : + ptr_entity->port_info[port].ddc_type == ddc_dvi ? "DVI DDC" : + ptr_entity->port_info[port].ddc_type == ddc_vga ? "VGA DDC" : + ptr_entity->port_info[port].ddc_type == ddc_crt2 ? "CRT2 DDC" : "Error"; + + const char* tmds = ptr_entity->port_info[port].tmds_type == tmds_unknown ? "None" : + ptr_entity->port_info[port].tmds_type == tmds_int ? "Internal" : + ptr_entity->port_info[port].tmds_type == tmds_ext ? "External" : "??? "; + const char* dac = ptr_entity->port_info[port].dac_type == dac_unknown ? "Unknown" : + ptr_entity->port_info[port].dac_type == dac_primary ? "Primary" : + ptr_entity->port_info[port].dac_type == dac_tvdac ? "TV / External" : "Error"; + + const char* con; + if (ai->si->is_atombios) { + con = ptr_entity->port_info[port].connector_type == connector_none_atom ? "None" : + ptr_entity->port_info[port].connector_type == connector_vga_atom ? "VGA" : + ptr_entity->port_info[port].connector_type == connector_dvi_i_atom ? "DVI-I" : + ptr_entity->port_info[port].connector_type == connector_dvi_d_atom ? "DVI-D" : + ptr_entity->port_info[port].connector_type == connector_dvi_a_atom ? "DVI-A" : + ptr_entity->port_info[port].connector_type == connector_stv_atom ? "S-Video TV" : + ptr_entity->port_info[port].connector_type == connector_ctv_atom ? "Composite TV" : + ptr_entity->port_info[port].connector_type == connector_lvds_atom ? "LVDS" : + ptr_entity->port_info[port].connector_type == connector_digital_atom ? "Digital" : + ptr_entity->port_info[port].connector_type == connector_unsupported_atom ? "N/A " : "Err "; + } else { + con = ptr_entity->port_info[port].connector_type == connector_none ? "None" : + ptr_entity->port_info[port].connector_type == connector_crt ? "VGA" : + ptr_entity->port_info[port].connector_type == connector_dvi_i ? "DVI-I" : + ptr_entity->port_info[port].connector_type == connector_dvi_d ? "DVI-D" : + ptr_entity->port_info[port].connector_type == connector_proprietary ? "Proprietary" : + ptr_entity->port_info[port].connector_type == connector_stv ? "S-Video TV" : + ptr_entity->port_info[port].connector_type == connector_ctv ? "Composite TV" : + ptr_entity->port_info[port].connector_type == connector_unsupported ? "N/A" : "Err"; + } + + mon = ptr_entity->port_info[port].mon_type == mt_unknown ? "???" : + ptr_entity->port_info[port].mon_type == mt_none ? "None" : + ptr_entity->port_info[port].mon_type == mt_crt ? "CRT " : + ptr_entity->port_info[port].mon_type == mt_lcd ? "LCD " : + ptr_entity->port_info[port].mon_type == mt_dfp ? "DVI " : + ptr_entity->port_info[port].mon_type == mt_ctv ? "Composite TV" : + ptr_entity->port_info[port].mon_type == mt_stv ? "S-Video TV" : "Err ?"; + + SHOW_INFO( 2 , "Port %d:- \nMonitor: %s\nConn Type: %s\nDDC Port: %s\nTMDS Type: %s\nDAC Type: %s", + port, mon, con, ddc, tmds, dac); +} + + // detect connected displays devices // whished_num_heads - how many heads the requested display mode needs void Radeon_DetectDisplays( accelerator_info *ai ) { shared_info *si = ai->si; + + disp_entity* routes = &si->routing; display_device_e displays = 0; display_device_e controlled_displays = ai->vc->controlled_displays; - edid1_info edid; + int i; + + uint32 edid_regs[] = { + 0, + RADEON_GPIO_MONID, + RADEON_GPIO_DVI_DDC, + RADEON_GPIO_VGA_DDC, + RADEON_GPIO_CRT2_DDC + }; // lock hardware so noone bothers us Radeon_WaitForIdle( ai, true ); + + // alwats make TMDS_INT port first + if (routes->port_info[1].tmds_type == tmds_int) { + + radeon_connector swap_entity; + swap_entity = routes->port_info[0]; + routes->port_info[0] = routes->port_info[1]; + routes->port_info[1] = swap_entity; + SHOW_FLOW0( 2, "Swapping TMDS_INT to first port"); + } + else if ( routes->port_info[0].tmds_type != tmds_int && + routes->port_info[1].tmds_type != tmds_int ) { + + // no TMDS_INT port, make primary DAC port first + // On my Inspiron 8600 both internal and external ports are + // marked DAC_PRIMARY in BIOS. So be extra careful - only + // swap when the first port is not DAC_PRIMARY + if ( routes->port_info[1].dac_type == dac_primary && + routes->port_info[0].dac_type != dac_primary ) { + + radeon_connector swap_entity; + swap_entity = routes->port_info[0]; + routes->port_info[0] = routes->port_info[1]; + routes->port_info[1] = swap_entity; + SHOW_FLOW0( 2, "Swapping Primary Dac to front"); + } + } + + if ( si->asic == rt_rs300 ) // RS300 only has single Dac of TV type + { + // For RS300/RS350/RS400 chips, there is no primary DAC. Force VGA port to use TVDAC + if ( routes->port_info[0].connector_type == connector_crt ) { + routes->port_info[0].dac_type = dac_tvdac; + routes->port_info[1].dac_type = dac_primary; + } else { + routes->port_info[1].dac_type = dac_primary; + routes->port_info[0].dac_type = dac_tvdac; + } + } else if ( si->num_crtc == 1 ) { - // mobile chips are for use in laptops - there must be a laptop panel - if( si->is_mobility ) - displays |= dd_lvds; + routes->port_info[0].dac_type = dac_primary; + } // use DDC to detect monitors - if we can read DDC, there must be a monitor - - // all non-mobility versions have a DVI port - if( (displays & dd_lvds) == 0 && - Radeon_ReadEDID( ai, RADEON_GPIO_DVI_DDC, &edid )) + for ( i = 0; i < 2; i++ ) { - SHOW_FLOW0( 2, "Found monitor on DVI DDC port" ); - // there may be an analog monitor connected to DVI-I; - // we must check EDID to see whether it's really a digital monitor - if( edid.display.input_type == 1 ) { - SHOW_FLOW0( 2, "Must be a DVI monitor" ); - - // store info about DVI-connected flat-panel - if( Radeon_StoreFPEDID( ai, &edid ) == B_OK ) { - displays |= dd_dvi; + if (routes->port_info[i].mon_type != mt_unknown ) { + SHOW_FLOW0( 2, "known type, skpping detection" ); + continue; + } + + memset( &routes->port_info[i].edid , 0, sizeof(edid1_info) ); + switch ( routes->port_info[i].ddc_type ) { + case ddc_monid: + case ddc_dvi: + case ddc_vga: + case ddc_crt2: + if ( Radeon_ReadEDID( ai, edid_regs[routes->port_info[i].ddc_type], &routes->port_info[i].edid )) + { + routes->port_info[i].edid_valid = true; + SHOW_FLOW( 2, "Edid Data for CRTC %d on line %d", i, routes->port_info[i].ddc_type ); + edid_dump ( &routes->port_info[i].edid ); + } else { + routes->port_info[i].mon_type = mt_none; + } + + break; + default: + SHOW_FLOW( 2, "No Edid Pin Assigned to CRTC %d ", i ); + routes->port_info[i].mon_type = mt_none; + } + + if ( routes->port_info[i].edid_valid ) { + + if( routes->port_info[i].edid.display.input_type == 1 ) { + SHOW_FLOW0( 2, "Must be a DVI monitor" ); + + // Note some laptops have a DVI output that uses internal TMDS, + // when its DVI is enabled by hotkey, LVDS panel is not used. + // In this case, the laptop is configured as DVI+VGA as a normal + // desktop card. + // Also for laptop, when X starts with lid closed (no DVI connection) + // both LDVS and TMDS are disable, we still need to treat it as a LVDS panel. + if ( routes->port_info[i].tmds_type == tmds_ext ){ + // store info about DVI-connected flat-panel + if( Radeon_StoreFPEDID( ai, &routes->port_info[i].edid ) == B_OK ) { + SHOW_INFO0( 2, "Found Ext Laptop DVI" ); + routes->port_info[i].mon_type = mt_dfp; + displays |= dd_dvi_ext; + } else { + SHOW_ERROR0( 2, "Disabled Ext DVI - invalid EDID" ); + } + } else { + if( INREG( ai->regs, RADEON_FP_GEN_CNTL) & (1 << 7) || ( !si->is_mobility ) ) { + // store info about DVI-connected flat-panel + if( Radeon_StoreFPEDID( ai, &routes->port_info[i].edid ) == B_OK ) { + SHOW_INFO0( 2, "Found DVI" ); + routes->port_info[i].mon_type = mt_dfp; + displays |= dd_dvi; + } else { + SHOW_ERROR0( 2, "Disabled DVI - invalid EDID" ); + } + } else { + SHOW_INFO0( 2, "Laptop Panel Found" ); + routes->port_info[i].mon_type = mt_lcd; + displays |= dd_lvds; + } + } } else { - SHOW_ERROR0( 2, "Disabled DVI - invalid EDID" ); + // must be the analog portion of DVI + // I'm not sure about Radeons with one CRTC - do they have DVI-I or DVI-D? + // anyway - if there are two CRTC, analog portion must be connected + // to TV-DAC; if there is one CRTC, it must be the normal VGA-DAC + if( si->num_crtc > 1 ) { + SHOW_FLOW0( 2, "Must be an analog monitor on DVI port" ); + routes->port_info[i].mon_type = mt_crt; + displays |= dd_tv_crt; + } else { + SHOW_FLOW0( 2, "Seems to be a CRT on VGA port!?" ); + routes->port_info[i].mon_type = mt_crt; + displays |= dd_crt; + } } + } + } + + + if ( !routes->port_info[0].edid_valid ) { + SHOW_INFO0( 2, "Searching port 0" ); + if ( si->is_mobility && (INREG( ai->regs, RADEON_BIOS_4_SCRATCH) & 4)) { + SHOW_INFO0( 2, "Found Laptop Panel" ); + routes->port_info[0].mon_type = mt_lcd; + displays |= dd_lvds; + } + } + + if ( !routes->port_info[1].edid_valid ) { + + if ( si->is_mobility && (INREG( ai->regs, RADEON_FP2_GEN_CNTL) & RADEON_FP2_FPON)) { + SHOW_INFO0( 2, "Found Ext Laptop DVI" ); + routes->port_info[1].mon_type = mt_dfp; + displays |= dd_dvi; + } + } + + if ( routes->port_info[0].mon_type == mt_none ) + { + if ( routes->port_info[1].mon_type == mt_none ) { + routes->port_info[0].mon_type = mt_crt; } else { - // must be the analog portion of DVI - // I'm not sure about Radeons with one CRTC - do they have DVI-I or DVI-D? - // anyway - if there are two CRTC, analog portion must be connected - // to TV-DAC; if there is one CRTC, it must be the normal VGA-DAC - if( si->num_crtc > 1 ) { - SHOW_FLOW0( 2, "Must be an analog monitor on DVI port" ); - displays |= dd_tv_crt; - } else { - SHOW_FLOW0( 2, "Seems to be a CRT on VGA port!?" ); - displays |= dd_crt; - } + radeon_connector swap_entity; + swap_entity = routes->port_info[0]; + routes->port_info[0] = routes->port_info[1]; + routes->port_info[1] = swap_entity; + SHOW_ERROR0( 2, "swapping active port 2 to free port 1" ); } + } - // all chips have a standard VGA port - if( Radeon_ReadEDID( ai, RADEON_GPIO_VGA_DDC, &edid )) - displays |= dd_crt; + routes->reversed_DAC = false; + if ( routes->port_info[1].dac_type == dac_tvdac ) { + SHOW_ERROR0( 2, "Reversed dac detected (not impl. yet)" ); + routes->reversed_DAC = true; + } + + // we may have overseen monitors if they don't support DDC or // have broken DDC data (like mine); @@ -898,14 +1085,14 @@ // all versions have a standard VGA port if( (displays & dd_crt) == 0 && - (controlled_displays && dd_crt) != 0 && + (controlled_displays & dd_crt) != 0 && Radeon_DetectCRT( ai )) displays |= dd_crt; // check VGA signal routed to DVI port // (the detection code checks whether there is hardware for that) if( (displays & dd_tv_crt) == 0 && - (controlled_displays && dd_tv_crt) != 0 && + (controlled_displays & dd_tv_crt) != 0 && Radeon_DetectTVCRT( ai )) displays |= dd_tv_crt; @@ -920,7 +1107,10 @@ // if no monitor found, we define to have a CRT connected to CRT-DAC if( displays == 0 ) displays = dd_crt; - + + Radeon_ConnectorInfo( ai, 0, routes); + Radeon_ConnectorInfo( ai, 1, routes); + ai->vc->connected_displays = displays; RELEASE_BEN( si->cp.lock ); Modified: haiku/trunk/src/add-ons/kernel/drivers/graphics/radeon/bios.c =================================================================== --- haiku/trunk/src/add-ons/kernel/drivers/graphics/radeon/bios.c 2007-03-01 09:33:08 UTC (rev 20274) +++ haiku/trunk/src/add-ons/kernel/drivers/graphics/radeon/bios.c 2007-03-01 09:35:22 UTC (rev 20275) @@ -259,6 +259,223 @@ } */ + +static bool Radeon_GetConnectorInfoFromBIOS ( device_info* di ) +{ + + ptr_disp_entity ptr_entity = &di->routing; + int i = 0, j, tmp, tmp0=0, tmp1=0; + + int bios_header, master_data_start; + + bios_header = RADEON_BIOS16(0x48); + + if (di->is_atombios) + { + master_data_start = RADEON_BIOS16( bios_header + 32 ); + tmp = RADEON_BIOS16( master_data_start + 22); + if (tmp) { + int crtc = 0, id[2]; + tmp1 = RADEON_BIOS16( tmp + 4 ); + for (i=0; i<8; i++) { + if(tmp1 & (1<> 8) & 0xf) == id[0] ) { + if (i == 3) + ptr_entity->port_info[0].tmds_type = tmds_int; + else if (i == 7) + ptr_entity->port_info[0].tmds_type = tmds_ext; + + if (ptr_entity->port_info[0].dac_type == dac_unknown) + ptr_entity->port_info[0].dac_type = (portinfo & 0xf) - 1; + continue; + } + } + + id[crtc] = (portinfo>>8) & 0xf; + ptr_entity->port_info[crtc].dac_type = (portinfo & 0xf) - 1; + ptr_entity->port_info[crtc].connector_type = (portinfo>>4) & 0xf; + if (i == 3) + ptr_entity->port_info[crtc].tmds_type = tmds_int; + else if (i == 7) + ptr_entity->port_info[crtc].tmds_type = tmds_ext; + + tmp0 = RADEON_BIOS16( master_data_start + 24); + if( tmp0 && id[crtc] ) { + switch (RADEON_BIOS16(tmp0 + 4 + 27 * id[crtc]) * 4) + { + case RADEON_GPIO_MONID: + ptr_entity->port_info[crtc].ddc_type = ddc_monid; + break; + case RADEON_GPIO_DVI_DDC: + ptr_entity->port_info[crtc].ddc_type = ddc_dvi; + break; + case RADEON_GPIO_VGA_DDC: + ptr_entity->port_info[crtc].ddc_type = ddc_vga; + break; + case RADEON_GPIO_CRT2_DDC: + ptr_entity->port_info[crtc].ddc_type = ddc_crt2; + break; + default: + ptr_entity->port_info[crtc].ddc_type = ddc_none_detected; + break; + } + + } else { + ptr_entity->port_info[crtc].ddc_type = ddc_none_detected; + } + crtc++; + } else { + /* we have already had two CRTCs assigned. the rest may share the same + * port with the existing connector, fill in them accordingly. + */ + for ( j = 0; j < 2; j++ ) { + if ((( portinfo >> 8 ) & 0xf ) == id[j] ) { + if ( i == 3 ) + ptr_entity->port_info[j].tmds_type = tmds_int; + else if (i == 7) + ptr_entity->port_info[j].tmds_type = tmds_ext; + + if ( ptr_entity->port_info[j].dac_type == dac_unknown ) + ptr_entity->port_info[j].dac_type = ( portinfo & 0xf ) - 1; + } + } + } + } + } + + for (i=0; i<2; i++) { + SHOW_INFO( 2, "Port%d: DDCType-%d, DACType-%d, TMDSType-%d, ConnectorType-%d", + i, ptr_entity->port_info[i].ddc_type, ptr_entity->port_info[i].dac_type, + ptr_entity->port_info[i].tmds_type, ptr_entity->port_info[i].connector_type); + } + } else { + SHOW_INFO0( 4 , "No Device Info Table found!"); + return FALSE; + } + } else { + /* Some laptops only have one connector (VGA) listed in the connector table, + * we need to add LVDS in as a non-DDC display. + * Note, we can't assume the listed VGA will be filled in PortInfo[0], + * when walking through connector table. connector_found has following meaning: + * 0 -- nothing found, + * 1 -- only PortInfo[0] filled, + * 2 -- only PortInfo[1] filled, + * 3 -- both are filled. + */ + int connector_found = 0; + + if ((tmp = RADEON_BIOS16( bios_header + 0x50 ))) { + for ( i = 1; i < 4; i++ ) { + + if (!(RADEON_BIOS16( tmp + i * 2 ))) + break; /* end of table */ + + tmp0 = RADEON_BIOS16( tmp + i * 2 ); + if ((( tmp0 >> 12 ) & 0x0f ) == 0 ) + continue; /* no connector */ + if (connector_found > 0) { + if (ptr_entity->port_info[tmp1].ddc_type == (( tmp0 >> 8 ) & 0x0f )) + continue; /* same connector */ + } + + /* internal ddc_dvi port will get assigned to portinfo[0], or if there is no ddc_dvi (like in some igps). */ + tmp1 = (((( tmp0 >> 8 ) & 0xf ) == ddc_dvi ) || ( tmp1 == 1 )) ? 0 : 1; /* determine port info index */ + + ptr_entity->port_info[tmp1].ddc_type = (tmp0 >> 8) & 0x0f; + if (ptr_entity->port_info[tmp1].ddc_type > ddc_crt2) + ptr_entity->port_info[tmp1].ddc_type = ddc_none_detected; + ptr_entity->port_info[tmp1].dac_type = (tmp0 & 0x01) ? dac_tvdac : dac_primary; + ptr_entity->port_info[tmp1].connector_type = (tmp0 >> 12) & 0x0f; + if (ptr_entity->port_info[tmp1].connector_type > connector_unsupported) + ptr_entity->port_info[tmp1].connector_type = connector_unsupported; + ptr_entity->port_info[tmp1].tmds_type = ((tmp0 >> 4) & 0x01) ? tmds_ext : tmds_int; + + /* some sanity checks */ + if (((ptr_entity->port_info[tmp1].connector_type != connector_dvi_d) && + (ptr_entity->port_info[tmp1].connector_type != connector_dvi_i)) && + ptr_entity->port_info[tmp1].tmds_type == tmds_int) + ptr_entity->port_info[tmp1].tmds_type = tmds_unknown; + + connector_found += (tmp1 + 1); + } + } else { + SHOW_INFO0(4, "No Connector Info Table found!"); + return FALSE; + } + + if (di->is_mobility) + { + /* For the cases where only one VGA connector is found, + we assume LVDS is not listed in the connector table, + add it in here as the first port. + */ + if ((connector_found < 3) && (ptr_entity->port_info[tmp1].connector_type == connector_crt)) { + if (connector_found == 1) { + memcpy (&ptr_entity->port_info[1], + &ptr_entity->port_info[0], + sizeof (ptr_entity->port_info[0])); + } + ptr_entity->port_info[0].dac_type = dac_tvdac; + ptr_entity->port_info[0].tmds_type = tmds_unknown; + ptr_entity->port_info[0].ddc_type = ddc_none_detected; + ptr_entity->port_info[0].connector_type = connector_proprietary; + + SHOW_INFO0( 4 , "lvds port is not in connector table, added in."); + if (connector_found == 0) + connector_found = 1; + else + connector_found = 3; + } + + if ((tmp = RADEON_BIOS16( bios_header + 0x42 ))) { + if ((tmp0 = RADEON_BIOS16( tmp + 0x15 ))) { + if ((tmp1 = RADEON_BIOS16( tmp0 + 2 ) & 0x07)) { + ptr_entity->port_info[0].ddc_type = tmp1; + if (ptr_entity->port_info[0].ddc_type > ddc_crt2) { + SHOW_INFO( 4, "unknown ddctype %d found", + ptr_entity->port_info[0].ddc_type); + ptr_entity->port_info[0].ddc_type = ddc_none_detected; + } + SHOW_INFO0( 4, "lcd ddc info table found!"); + } + } + } + } else if (connector_found == 2) { + memcpy (&ptr_entity->port_info[0], + &ptr_entity->port_info[1], + sizeof (ptr_entity->port_info[0])); + ptr_entity->port_info[1].dac_type = dac_unknown; + ptr_entity->port_info[1].tmds_type = tmds_unknown; + ptr_entity->port_info[1].ddc_type = ddc_none_detected; + ptr_entity->port_info[1].connector_type = connector_none; + connector_found = 1; + } + + if (connector_found == 0) { + SHOW_INFO0( 4, "no connector found in connector info table."); + } else { + SHOW_INFO( 2, "Port%d: DDCType-%d, DACType-%d, TMDSType-%d, ConnectorType-%d", + 0, ptr_entity->port_info[0].ddc_type, ptr_entity->port_info[0].dac_type, + ptr_entity->port_info[0].tmds_type, ptr_entity->port_info[0].connector_type); + + } + if (connector_found == 3) { + SHOW_INFO( 2, "Port%d: DDCType-%d, DACType-%d, TMDSType-%d, ConnectorType-%d", + 1, ptr_entity->port_info[1].ddc_type, ptr_entity->port_info[1].dac_type, + ptr_entity->port_info[1].tmds_type, ptr_entity->port_info[1].connector_type); + } + + } + return TRUE; +} + + // get flat panel info (does only make sense for Laptops // with integrated display, but looking for it doesn't hurt, // who knows which strange kind of combination is out there?) @@ -740,6 +957,29 @@ goto err1; Radeon_GetPLLInfo( di ); + + // setup defaults + di->routing.port_info[0].mon_type = mt_unknown; + di->routing.port_info[0].ddc_type = ddc_none_detected; + di->routing.port_info[0].dac_type = dac_unknown; + di->routing.port_info[0].tmds_type = tmds_unknown; + di->routing.port_info[0].connector_type = connector_none; + + if ( !Radeon_GetConnectorInfoFromBIOS( di ) ) + { + di->routing.port_info[0].mon_type = mt_unknown; + di->routing.port_info[0].ddc_type = ddc_none_detected; + di->routing.port_info[0].dac_type = dac_tvdac; + di->routing.port_info[0].tmds_type = tmds_unknown; + di->routing.port_info[0].connector_type = connector_proprietary; + + di->routing.port_info[1].mon_type = mt_unknown; + di->routing.port_info[1].ddc_type = ddc_none_detected; + di->routing.port_info[1].dac_type = dac_primary; + di->routing.port_info[1].tmds_type = tmds_ext; + di->routing.port_info[1].connector_type = connector_crt; + + } Radeon_GetFPData( di ); Radeon_DetectRAM( di ); Modified: haiku/trunk/src/add-ons/kernel/drivers/graphics/radeon/init.c =================================================================== --- haiku/trunk/src/add-ons/kernel/drivers/graphics/radeon/init.c 2007-03-01 09:33:08 UTC (rev 20274) +++ haiku/trunk/src/add-ons/kernel/drivers/graphics/radeon/init.c 2007-03-01 09:35:22 UTC (rev 20275) @@ -260,6 +260,7 @@ si->panel_pwr_delay = di->si->panel_pwr_delay; si->acc_dma = di->acc_dma; + memcpy(&si->routing, &di->routing, sizeof(disp_entity)); // detecting theatre channel in kernel would lead to code duplication, // so we let the first accelerant take care of it Modified: haiku/trunk/src/add-ons/kernel/drivers/graphics/radeon/radeon_driver.h =================================================================== --- haiku/trunk/src/add-ons/kernel/drivers/graphics/radeon/radeon_driver.h 2007-03-01 09:33:08 UTC (rev 20274) +++ haiku/trunk/src/add-ons/kernel/drivers/graphics/radeon/radeon_driver.h 2007-03-01 09:35:22 UTC (rev 20275) @@ -113,6 +113,7 @@ bool acc_dma; fp_info fp_info; + disp_entity routing; general_pll_info pll; ram_info ram; From axeld at mail.berlios.de Thu Mar 1 10:38:12 2007 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Thu, 1 Mar 2007 10:38:12 +0100 Subject: [Haiku-commits] r20276 - in haiku/trunk: headers/private/graphics/radeon src/add-ons/accelerants/radeon src/add-ons/kernel/drivers/graphics/radeon Message-ID: <200703010938.l219cCut004093@sheep.berlios.de> Author: axeld Date: 2007-03-01 10:38:11 +0100 (Thu, 01 Mar 2007) New Revision: 20276 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20276&view=rev Modified: haiku/trunk/headers/private/graphics/radeon/version.h haiku/trunk/src/add-ons/accelerants/radeon/dpms.c haiku/trunk/src/add-ons/accelerants/radeon/flat_panel.c haiku/trunk/src/add-ons/accelerants/radeon/set_mode.h haiku/trunk/src/add-ons/kernel/drivers/graphics/radeon/CP_setup.c haiku/trunk/src/add-ons/kernel/drivers/graphics/radeon/init.c haiku/trunk/src/add-ons/kernel/drivers/graphics/radeon/radeon_driver.h Log: Patch by Euan Kirkhope: * Laptop LCD Backlight rework + powermanagement Modified: haiku/trunk/headers/private/graphics/radeon/version.h =================================================================== --- haiku/trunk/headers/private/graphics/radeon/version.h 2007-03-01 09:35:22 UTC (rev 20275) +++ haiku/trunk/headers/private/graphics/radeon/version.h 2007-03-01 09:38:11 UTC (rev 20276) @@ -8,4 +8,4 @@ */ // current version -#define RADEON_DRIVER_VERSION "Version: 5.1.4.0" +#define RADEON_DRIVER_VERSION "Version: 5.1.4.5" Modified: haiku/trunk/src/add-ons/accelerants/radeon/dpms.c =================================================================== --- haiku/trunk/src/add-ons/accelerants/radeon/dpms.c 2007-03-01 09:35:22 UTC (rev 20275) +++ haiku/trunk/src/add-ons/accelerants/radeon/dpms.c 2007-03-01 09:38:11 UTC (rev 20276) @@ -66,9 +66,8 @@ // (you get a dark picture first that becomes brighter step by step, // after a couple of seconds you have full brightness again) OUTREGP( regs, RADEON_LVDS_GEN_CNTL, RADEON_LVDS_BLON, ~RADEON_LVDS_BLON ); - //snooze( ai->si->fp_port.panel_pwr_delay * 1000 ); - OUTREGP( regs, RADEON_LVDS_GEN_CNTL, RADEON_LVDS_BLON | RADEON_LVDS_ON, - ~(RADEON_LVDS_DISPLAY_DIS | RADEON_LVDS_BLON | RADEON_LVDS_ON) ); + snooze( ai->si->panel_pwr_delay * 1000 ); + OUTREGP( regs, RADEON_LVDS_GEN_CNTL, RADEON_LVDS_ON, ~RADEON_LVDS_ON ); break; case B_DPMS_STAND_BY: @@ -82,8 +81,7 @@ if( ai->si->is_mobility || ai->si->is_igp ) Radeon_OUTPLLP( ai->regs, ai->si->asic, RADEON_PIXCLKS_CNTL, 0, ~RADEON_PIXCLK_LVDS_ALWAYS_ONb ); - OUTREGP( regs, RADEON_LVDS_GEN_CNTL, RADEON_LVDS_DISPLAY_DIS, - ~(RADEON_LVDS_DISPLAY_DIS | RADEON_LVDS_BLON | RADEON_LVDS_ON) ); + OUTREGP( regs, RADEON_LVDS_GEN_CNTL, 0, ~(RADEON_LVDS_BLON | RADEON_LVDS_ON) ); if( ai->si->is_mobility || ai->si->is_igp ) Radeon_OUTPLL( ai->regs, ai->si->asic, RADEON_PIXCLKS_CNTL, old_pixclks_cntl ); @@ -125,15 +123,20 @@ // *should* be supported as well) switch( mode ) { case B_DPMS_ON: - OUTREGP( regs, RADEON_FP2_GEN_CNTL, - RADEON_FP_FPON | - (ai->si->asic >= rt_r200 ? RADEON_FP2_DV0_EN : 0), - ~(RADEON_FP2_BLANK_EN | RADEON_FP2_BLANK_EN) ); + OUTREGP( regs, RADEON_FP2_GEN_CNTL, 0, ~RADEON_FP2_BLANK_EN); + OUTREGP( regs, RADEON_FP2_GEN_CNTL, RADEON_FP2_FPON, ~RADEON_FP2_FPON); + if (ai->si->asic >= rt_r200) { + OUTREGP( regs, RADEON_FP2_GEN_CNTL, RADEON_FP2_DV0_EN, ~RADEON_FP2_DV0_EN); + } break; case B_DPMS_STAND_BY: case B_DPMS_SUSPEND: case B_DPMS_OFF: - OUTREGP( regs, RADEON_FP2_GEN_CNTL, 0, ~(RADEON_FP2_BLANK_EN | RADEON_FP2_BLANK_EN) ); + OUTREGP( regs, RADEON_FP2_GEN_CNTL, RADEON_FP2_BLANK_EN, ~RADEON_FP2_BLANK_EN ); + OUTREGP( regs, RADEON_FP2_GEN_CNTL, 0, ~RADEON_FP2_FPON); + if (ai->si->asic >= rt_r200) { + OUTREGP( regs, RADEON_FP2_GEN_CNTL, 0, ~RADEON_FP2_DV0_EN); + } break; } } @@ -170,14 +173,20 @@ switch( mode ) { case B_DPMS_ON: - OUTREGP( regs, RADEON_CRTC2_GEN_CNTL, 0, ~RADEON_CRTC2_DISP_DIS ); + OUTREGP( regs, RADEON_CRTC2_GEN_CNTL, 0, + ~(RADEON_CRTC2_DISP_DIS | RADEON_CRTC2_VSYNC_DIS | RADEON_CRTC2_HSYNC_DIS) ); break; - case B_DPMS_STAND_BY: + OUTREGP( regs, RADEON_CRTC2_GEN_CNTL, (RADEON_CRTC2_DISP_DIS | RADEON_CRTC2_HSYNC_DIS), + ~(RADEON_CRTC2_DISP_DIS | RADEON_CRTC2_VSYNC_DIS | RADEON_CRTC2_HSYNC_DIS) ); + break; case B_DPMS_SUSPEND: + OUTREGP( regs, RADEON_CRTC2_GEN_CNTL, (RADEON_CRTC2_DISP_DIS | RADEON_CRTC2_VSYNC_DIS), + ~(RADEON_CRTC2_DISP_DIS | RADEON_CRTC2_VSYNC_DIS | RADEON_CRTC2_HSYNC_DIS) ); + break; case B_DPMS_OFF: - OUTREGP( regs, RADEON_CRTC2_GEN_CNTL, - RADEON_CRTC2_DISP_DIS, ~RADEON_CRTC2_DISP_DIS ); + OUTREGP( regs, RADEON_CRTC2_GEN_CNTL, (RADEON_CRTC2_DISP_DIS | RADEON_CRTC2_VSYNC_DIS | RADEON_CRTC2_HSYNC_DIS), + ~(RADEON_CRTC2_DISP_DIS | RADEON_CRTC2_VSYNC_DIS | RADEON_CRTC2_HSYNC_DIS) ); break; } } @@ -188,26 +197,23 @@ { vuint8 *regs = ai->regs; - uint32 mask = RADEON_CRTC_HSYNC_DIS | RADEON_CRTC_VSYNC_DIS; + uint32 mask = ~(RADEON_CRTC_DISPLAY_DIS | RADEON_CRTC_VSYNC_DIS | RADEON_CRTC_HSYNC_DIS); switch( mode ) { case B_DPMS_ON: - /* Screen: On; HSync: On, VSync: On */ - OUTREGP( regs, RADEON_CRTC_EXT_CNTL, 0, ~mask ); + OUTREGP( regs, RADEON_CRTC_EXT_CNTL, 0, mask ); break; case B_DPMS_STAND_BY: - /* Screen: Off; HSync: Off, VSync: On */ - OUTREGP( regs, RADEON_CRTC_EXT_CNTL, - RADEON_CRTC_HSYNC_DIS, ~mask ); + OUTREGP( regs, RADEON_CRTC_EXT_CNTL, + (RADEON_CRTC_DISPLAY_DIS | RADEON_CRTC_HSYNC_DIS), mask ); break; case B_DPMS_SUSPEND: - /* Screen: Off; HSync: On, VSync: Off */ - OUTREGP( regs, RADEON_CRTC_EXT_CNTL, - RADEON_CRTC_VSYNC_DIS, ~mask ); + OUTREGP( regs, RADEON_CRTC_EXT_CNTL, + (RADEON_CRTC_DISPLAY_DIS | RADEON_CRTC_VSYNC_DIS), mask ); break; case B_DPMS_OFF: - /* Screen: Off; HSync: Off, VSync: Off */ - OUTREGP( regs, RADEON_CRTC_EXT_CNTL, mask, ~mask ); + OUTREGP( regs, RADEON_CRTC_EXT_CNTL, + (RADEON_CRTC_DISPLAY_DIS | RADEON_CRTC_VSYNC_DIS | RADEON_CRTC_HSYNC_DIS), mask ); break; } @@ -233,26 +239,21 @@ { vuint8 *regs = ai->regs; - int mask = RADEON_CRTC2_HSYNC_DIS | RADEON_CRTC2_VSYNC_DIS; + int mask = ~(RADEON_CRTC2_DISP_DIS | RADEON_CRTC2_VSYNC_DIS | RADEON_CRTC2_HSYNC_DIS); switch( mode ) { case B_DPMS_ON: - /* Screen: On; HSync: On, VSync: On */ - OUTREGP( regs, RADEON_CRTC2_GEN_CNTL, 0, ~mask ); + OUTREGP( regs, RADEON_CRTC2_GEN_CNTL, 0, mask ); break; case B_DPMS_STAND_BY: - /* Screen: Off; HSync: Off, VSync: On */ - OUTREGP( regs, RADEON_CRTC2_GEN_CNTL, - RADEON_CRTC2_HSYNC_DIS, ~mask ); + OUTREGP( regs, RADEON_CRTC2_GEN_CNTL, (RADEON_CRTC2_DISP_DIS | RADEON_CRTC2_HSYNC_DIS), mask ); break; case B_DPMS_SUSPEND: - /* Screen: Off; HSync: On, VSync: Off */ - OUTREGP( regs, RADEON_CRTC2_GEN_CNTL, - RADEON_CRTC2_VSYNC_DIS, ~mask ); + OUTREGP( regs, RADEON_CRTC2_GEN_CNTL, (RADEON_CRTC2_DISP_DIS | RADEON_CRTC2_VSYNC_DIS), mask); break; case B_DPMS_OFF: - /* Screen: Off; HSync: Off, VSync: Off */ - OUTREGP( regs, RADEON_CRTC2_GEN_CNTL, mask, ~mask ); + OUTREGP( regs, RADEON_CRTC2_GEN_CNTL, + (RADEON_CRTC2_DISP_DIS | RADEON_CRTC2_VSYNC_DIS | RADEON_CRTC2_HSYNC_DIS), mask); break; } Modified: haiku/trunk/src/add-ons/accelerants/radeon/flat_panel.c =================================================================== --- haiku/trunk/src/add-ons/accelerants/radeon/flat_panel.c 2007-03-01 09:35:22 UTC (rev 20275) +++ haiku/trunk/src/add-ons/accelerants/radeon/flat_panel.c 2007-03-01 09:38:11 UTC (rev 20276) @@ -126,6 +126,9 @@ values->fp_v_sync_strt_wid = INREG( regs, RADEON_FP_V_SYNC_STRT_WID ); values->fp2_h_sync_strt_wid = INREG( regs, RADEON_FP_H2_SYNC_STRT_WID ); values->fp2_v_sync_strt_wid = INREG( regs, RADEON_FP_V2_SYNC_STRT_WID ); + values->bios_4_scratch = INREG( regs, RADEON_BIOS_4_SCRATCH ); + values->bios_5_scratch = INREG( regs, RADEON_BIOS_5_SCRATCH ); + values->bios_6_scratch = INREG( regs, RADEON_BIOS_6_SCRATCH ); SHOW_FLOW( 2, "before: fp_gen_cntl=%08lx, horz=%08lx, vert=%08lx, lvds_gen_cntl=%08lx", values->fp_gen_cntl, values->fp_horz_stretch, values->fp_vert_stretch, @@ -222,8 +225,54 @@ INREG( regs, RADEON_GRPH_BUFFER_CNTL) & ~0x7f0000); } + if ( ai->si->is_mobility ) { + OUTREG( regs, RADEON_BIOS_4_SCRATCH, values->bios_4_scratch); + OUTREG( regs, RADEON_BIOS_5_SCRATCH, values->bios_5_scratch); + OUTREG( regs, RADEON_BIOS_6_SCRATCH, values->bios_6_scratch); + } + if( (crtc->chosen_displays & dd_lvds) != 0 ) { - OUTREGP( regs, RADEON_LVDS_GEN_CNTL, values->lvds_gen_cntl, - RADEON_LVDS_ON | RADEON_LVDS_BLON ); + + //OUTREGP( regs, RADEON_LVDS_GEN_CNTL, values->lvds_gen_cntl, + // RADEON_LVDS_ON | RADEON_LVDS_BLON ); + + uint32 old_pixclks_cntl; + uint32 tmp; + + old_pixclks_cntl = Radeon_INPLL( ai->regs, ai->si->asic, RADEON_PIXCLKS_CNTL); + + // ASIC bug: when LVDS_ON is reset, LVDS_ALWAYS_ON must be zero + if( ai->si->is_mobility || ai->si->is_igp ) + { + if (!(values->lvds_gen_cntl & RADEON_LVDS_ON)) { + Radeon_OUTPLLP( ai->regs, ai->si->asic, RADEON_PIXCLKS_CNTL, 0, ~RADEON_PIXCLK_LVDS_ALWAYS_ONb ); + } + } + + // get current state of LCD + tmp = INREG( regs, RADEON_LVDS_GEN_CNTL); + + // if LCD is on, and previous state was on, just write the state directly. + if (( tmp & ( RADEON_LVDS_ON | RADEON_LVDS_BLON )) == + ( values->lvds_gen_cntl & ( RADEON_LVDS_ON | RADEON_LVDS_BLON ))) { + OUTREG( regs, RADEON_LVDS_GEN_CNTL, values->lvds_gen_cntl ); + } else { + if ( values->lvds_gen_cntl & ( RADEON_LVDS_ON | RADEON_LVDS_BLON )) { + snooze( ai->si->panel_pwr_delay * 1000 ); + OUTREG( regs, RADEON_LVDS_GEN_CNTL, values->lvds_gen_cntl ); + } else { + + //turn on backlight, wait for stable before turning on data ??? + OUTREG( regs, RADEON_LVDS_GEN_CNTL, values->lvds_gen_cntl | RADEON_LVDS_BLON ); + snooze( ai->si->panel_pwr_delay * 1000 ); + OUTREG( regs, RADEON_LVDS_GEN_CNTL, values->lvds_gen_cntl ); + } + } + + if( ai->si->is_mobility || ai->si->is_igp ) { + if (!(values->lvds_gen_cntl & RADEON_LVDS_ON)) { + Radeon_OUTPLL( ai->regs, ai->si->asic, RADEON_PIXCLKS_CNTL, old_pixclks_cntl ); + } + } } } Modified: haiku/trunk/src/add-ons/accelerants/radeon/set_mode.h =================================================================== --- haiku/trunk/src/add-ons/accelerants/radeon/set_mode.h 2007-03-01 09:35:22 UTC (rev 20275) +++ haiku/trunk/src/add-ons/accelerants/radeon/set_mode.h 2007-03-01 09:38:11 UTC (rev 20276) @@ -109,6 +109,11 @@ // RMX registers uint32 fp_horz_stretch; uint32 fp_vert_stretch; + + // Bios values used by Mobility Asics + uint32 bios_4_scratch; + uint32 bios_5_scratch; + uint32 bios_6_scratch; } fp_regs; Modified: haiku/trunk/src/add-ons/kernel/drivers/graphics/radeon/CP_setup.c =================================================================== --- haiku/trunk/src/add-ons/kernel/drivers/graphics/radeon/CP_setup.c 2007-03-01 09:35:22 UTC (rev 20275) +++ haiku/trunk/src/add-ons/kernel/drivers/graphics/radeon/CP_setup.c 2007-03-01 09:38:11 UTC (rev 20276) @@ -627,3 +627,356 @@ cp->buffers.oldest = tmp_oldest_buffer; } } + +// lets hide this in here, as it's got lots of lovely register headers already... +// does it go here, or in the accelerant anyway? +// for now i'm assuming you turn on dynamic clocks, and they take care of themselves onwards... +// so doing it at driver init seems sensible after a valid detection of course... +void Radeon_SetDynamicClock( device_info *di, int mode) +{ + vuint8 *regs = di->regs; + radeon_type asic = di->asic; + uint32 tmp; + + switch(mode) { + case 0: /* Turn everything OFF (ForceON to everything)*/ + if ( di->num_crtc != 2 ) { + tmp = Radeon_INPLL(regs, asic, RADEON_SCLK_CNTL); + tmp |= (RADEON_SCLK_FORCE_CP | RADEON_SCLK_FORCE_HDP | + RADEON_SCLK_FORCE_DISP1 | RADEON_SCLK_FORCE_TOP | + RADEON_SCLK_FORCE_E2 | RADEON_SCLK_FORCE_SE | + RADEON_SCLK_FORCE_IDCT | RADEON_SCLK_FORCE_VIP | + RADEON_SCLK_FORCE_RE | RADEON_SCLK_FORCE_PB | + RADEON_SCLK_FORCE_TAM | RADEON_SCLK_FORCE_TDM | + RADEON_SCLK_FORCE_RB); + Radeon_OUTPLL(regs, asic, RADEON_SCLK_CNTL, tmp); + } else if (asic == rt_rv350) { + /* for RV350/M10, no delays are required. */ + tmp = Radeon_INPLL(regs, asic, R300_SCLK_CNTL2); + tmp |= (R300_SCLK_FORCE_TCL | + R300_SCLK_FORCE_GA | + R300_SCLK_FORCE_CBA); + Radeon_OUTPLL(regs, asic, R300_SCLK_CNTL2, tmp); + + tmp = Radeon_INPLL(regs, asic, RADEON_SCLK_CNTL); + tmp |= (RADEON_SCLK_FORCE_DISP2 | RADEON_SCLK_FORCE_CP | + RADEON_SCLK_FORCE_HDP | RADEON_SCLK_FORCE_DISP1 | + RADEON_SCLK_FORCE_TOP | RADEON_SCLK_FORCE_E2 | + R300_SCLK_FORCE_VAP | RADEON_SCLK_FORCE_IDCT | + RADEON_SCLK_FORCE_VIP | R300_SCLK_FORCE_SR | + R300_SCLK_FORCE_PX | R300_SCLK_FORCE_TX | + R300_SCLK_FORCE_US | RADEON_SCLK_FORCE_TV_SCLK | + R300_SCLK_FORCE_SU | RADEON_SCLK_FORCE_OV0); + Radeon_OUTPLL(regs, asic, RADEON_SCLK_CNTL, tmp); + + tmp = Radeon_INPLL(regs, asic, RADEON_SCLK_MORE_CNTL); + tmp |= RADEON_SCLK_MORE_FORCEON; + Radeon_OUTPLL(regs, asic, RADEON_SCLK_MORE_CNTL, tmp); + + tmp = Radeon_INPLL(regs, asic, RADEON_MCLK_CNTL); + tmp |= (RADEON_FORCEON_MCLKA | + RADEON_FORCEON_MCLKB | + RADEON_FORCEON_YCLKA | + RADEON_FORCEON_YCLKB | + RADEON_FORCEON_MC); + Radeon_OUTPLL(regs, asic, RADEON_MCLK_CNTL, tmp); + + tmp = Radeon_INPLL(regs, asic, RADEON_VCLK_ECP_CNTL); + tmp &= ~(RADEON_PIXCLK_ALWAYS_ONb | + RADEON_PIXCLK_DAC_ALWAYS_ONb | + R300_DISP_DAC_PIXCLK_DAC_BLANK_OFF); + Radeon_OUTPLL(regs, asic, RADEON_VCLK_ECP_CNTL, tmp); + + tmp = Radeon_INPLL(regs, asic, RADEON_PIXCLKS_CNTL); + tmp &= ~(RADEON_PIX2CLK_ALWAYS_ONb | + RADEON_PIX2CLK_DAC_ALWAYS_ONb | + RADEON_DISP_TVOUT_PIXCLK_TV_ALWAYS_ONb | + R300_DVOCLK_ALWAYS_ONb | + RADEON_PIXCLK_BLEND_ALWAYS_ONb | + RADEON_PIXCLK_GV_ALWAYS_ONb | + R300_PIXCLK_DVO_ALWAYS_ONb | + RADEON_PIXCLK_LVDS_ALWAYS_ONb | + RADEON_PIXCLK_TMDS_ALWAYS_ONb | + R300_PIXCLK_TRANS_ALWAYS_ONb | + R300_PIXCLK_TVO_ALWAYS_ONb | + R300_P2G2CLK_ALWAYS_ONb | + R300_P2G2CLK_ALWAYS_ONb | + R300_DISP_DAC_PIXCLK_DAC2_BLANK_OFF); + Radeon_OUTPLL(regs, asic, RADEON_PIXCLKS_CNTL, tmp); + } else { + tmp = Radeon_INPLL(regs, asic, RADEON_SCLK_CNTL); + tmp |= (RADEON_SCLK_FORCE_CP | RADEON_SCLK_FORCE_E2); + tmp |= RADEON_SCLK_FORCE_SE; + + if ( di->num_crtc != 2 ) { + tmp |= ( RADEON_SCLK_FORCE_RB | + RADEON_SCLK_FORCE_TDM | + RADEON_SCLK_FORCE_TAM | + RADEON_SCLK_FORCE_PB | + RADEON_SCLK_FORCE_RE | + RADEON_SCLK_FORCE_VIP | + RADEON_SCLK_FORCE_IDCT | + RADEON_SCLK_FORCE_TOP | + RADEON_SCLK_FORCE_DISP1 | + RADEON_SCLK_FORCE_DISP2 | + RADEON_SCLK_FORCE_HDP ); + } else if ((asic == rt_r300) || (asic == rt_r350)) { + tmp |= ( RADEON_SCLK_FORCE_HDP | + RADEON_SCLK_FORCE_DISP1 | + RADEON_SCLK_FORCE_DISP2 | + RADEON_SCLK_FORCE_TOP | + RADEON_SCLK_FORCE_IDCT | + RADEON_SCLK_FORCE_VIP); + } + Radeon_OUTPLL(regs, asic, RADEON_SCLK_CNTL, tmp); + + snooze(16000); + + if ((asic == rt_r300) || (asic == rt_r350)) { + tmp = Radeon_INPLL(regs, asic, R300_SCLK_CNTL2); + tmp |= ( R300_SCLK_FORCE_TCL | + R300_SCLK_FORCE_GA | + R300_SCLK_FORCE_CBA); + Radeon_OUTPLL(regs, asic, R300_SCLK_CNTL2, tmp); + snooze(16000); + } + + if (di->is_igp) { + tmp = Radeon_INPLL(regs, asic, RADEON_MCLK_CNTL); + tmp &= ~(RADEON_FORCEON_MCLKA | + RADEON_FORCEON_YCLKA); + Radeon_OUTPLL(regs, asic, RADEON_MCLK_CNTL, tmp); + snooze(16000); + } + + if ((asic == rt_rv200) || + (asic == rt_rv250) || + (asic == rt_rv280)) { + tmp = Radeon_INPLL(regs, asic, RADEON_SCLK_MORE_CNTL); + tmp |= RADEON_SCLK_MORE_FORCEON; + Radeon_OUTPLL(regs, asic, RADEON_SCLK_MORE_CNTL, tmp); + snooze(16000); + } + + tmp = Radeon_INPLL(regs, asic, RADEON_PIXCLKS_CNTL); + tmp &= ~(RADEON_PIX2CLK_ALWAYS_ONb | + RADEON_PIX2CLK_DAC_ALWAYS_ONb | + RADEON_PIXCLK_BLEND_ALWAYS_ONb | + RADEON_PIXCLK_GV_ALWAYS_ONb | + RADEON_PIXCLK_DIG_TMDS_ALWAYS_ONb | + RADEON_PIXCLK_LVDS_ALWAYS_ONb | + RADEON_PIXCLK_TMDS_ALWAYS_ONb); + + Radeon_OUTPLL(regs, asic, RADEON_PIXCLKS_CNTL, tmp); + snooze(16000); + + tmp = Radeon_INPLL(regs, asic, RADEON_VCLK_ECP_CNTL); + tmp &= ~(RADEON_PIXCLK_ALWAYS_ONb | + RADEON_PIXCLK_DAC_ALWAYS_ONb); + Radeon_OUTPLL(regs, asic, RADEON_VCLK_ECP_CNTL, tmp); + } + SHOW_FLOW0( 3, "Dynamic Clock Scaling Disabled" ); + break; + case 1: + if ( di->num_crtc != 2 ) { + tmp = Radeon_INPLL(regs, asic, RADEON_SCLK_CNTL); + if ((INREG( regs, RADEON_CONFIG_CNTL) & RADEON_CFG_ATI_REV_ID_MASK) > RADEON_CFG_ATI_REV_A13) { + tmp &= ~(RADEON_SCLK_FORCE_CP | RADEON_SCLK_FORCE_RB); + } + tmp &= ~(RADEON_SCLK_FORCE_HDP | RADEON_SCLK_FORCE_DISP1 | + RADEON_SCLK_FORCE_TOP | RADEON_SCLK_FORCE_SE | + RADEON_SCLK_FORCE_IDCT | RADEON_SCLK_FORCE_RE | + RADEON_SCLK_FORCE_PB | RADEON_SCLK_FORCE_TAM | + RADEON_SCLK_FORCE_TDM); + Radeon_OUTPLL(regs, asic, RADEON_SCLK_CNTL, tmp); + } else if ((asic == rt_r300) + || (asic == rt_r350) + || (asic == rt_rv350)) { + if (asic == rt_rv350) { + tmp = Radeon_INPLL(regs, asic, R300_SCLK_CNTL2); + tmp &= ~(R300_SCLK_FORCE_TCL | + R300_SCLK_FORCE_GA | + R300_SCLK_FORCE_CBA); + tmp |= (R300_SCLK_TCL_MAX_DYN_STOP_LAT | + R300_SCLK_GA_MAX_DYN_STOP_LAT | + R300_SCLK_CBA_MAX_DYN_STOP_LAT); + Radeon_OUTPLL(regs, asic, R300_SCLK_CNTL2, tmp); + + tmp = Radeon_INPLL(regs, asic, RADEON_SCLK_CNTL); + tmp &= ~(RADEON_SCLK_FORCE_DISP2 | RADEON_SCLK_FORCE_CP | + RADEON_SCLK_FORCE_HDP | RADEON_SCLK_FORCE_DISP1 | + RADEON_SCLK_FORCE_TOP | RADEON_SCLK_FORCE_E2 | + R300_SCLK_FORCE_VAP | RADEON_SCLK_FORCE_IDCT | + RADEON_SCLK_FORCE_VIP | R300_SCLK_FORCE_SR | + R300_SCLK_FORCE_PX | R300_SCLK_FORCE_TX | + R300_SCLK_FORCE_US | RADEON_SCLK_FORCE_TV_SCLK | + R300_SCLK_FORCE_SU | RADEON_SCLK_FORCE_OV0); + tmp |= RADEON_DYN_STOP_LAT_MASK; + Radeon_OUTPLL(regs, asic, RADEON_SCLK_CNTL, tmp); + + tmp = Radeon_INPLL(regs, asic, RADEON_SCLK_MORE_CNTL); + tmp &= ~RADEON_SCLK_MORE_FORCEON; + tmp |= RADEON_SCLK_MORE_MAX_DYN_STOP_LAT; + Radeon_OUTPLL(regs, asic, RADEON_SCLK_MORE_CNTL, tmp); + + tmp = Radeon_INPLL(regs, asic, RADEON_VCLK_ECP_CNTL); + tmp |= (RADEON_PIXCLK_ALWAYS_ONb | + RADEON_PIXCLK_DAC_ALWAYS_ONb); + Radeon_OUTPLL(regs, asic, RADEON_VCLK_ECP_CNTL, tmp); + + tmp = Radeon_INPLL(regs, asic, RADEON_PIXCLKS_CNTL); + tmp |= (RADEON_PIX2CLK_ALWAYS_ONb | + RADEON_PIX2CLK_DAC_ALWAYS_ONb | + RADEON_DISP_TVOUT_PIXCLK_TV_ALWAYS_ONb | + R300_DVOCLK_ALWAYS_ONb | + RADEON_PIXCLK_BLEND_ALWAYS_ONb | + RADEON_PIXCLK_GV_ALWAYS_ONb | + R300_PIXCLK_DVO_ALWAYS_ONb | + RADEON_PIXCLK_LVDS_ALWAYS_ONb | + RADEON_PIXCLK_TMDS_ALWAYS_ONb | + R300_PIXCLK_TRANS_ALWAYS_ONb | + R300_PIXCLK_TVO_ALWAYS_ONb | + R300_P2G2CLK_ALWAYS_ONb | + R300_P2G2CLK_ALWAYS_ONb); + Radeon_OUTPLL(regs, asic, RADEON_PIXCLKS_CNTL, tmp); + + tmp = Radeon_INPLL(regs, asic, RADEON_MCLK_MISC); + tmp |= (RADEON_MC_MCLK_DYN_ENABLE | + RADEON_IO_MCLK_DYN_ENABLE); + Radeon_OUTPLL(regs, asic, RADEON_MCLK_MISC, tmp); + + tmp = Radeon_INPLL(regs, asic, RADEON_MCLK_CNTL); + tmp |= (RADEON_FORCEON_MCLKA | + RADEON_FORCEON_MCLKB); + + tmp &= ~(RADEON_FORCEON_YCLKA | + RADEON_FORCEON_YCLKB | + RADEON_FORCEON_MC); + + /* Some releases of vbios have set DISABLE_MC_MCLKA + and DISABLE_MC_MCLKB bits in the vbios table. Setting these + bits will cause H/W hang when reading video memory with dynamic clocking + enabled. */ + if ((tmp & R300_DISABLE_MC_MCLKA) && + (tmp & R300_DISABLE_MC_MCLKB)) { + /* If both bits are set, then check the active channels */ + tmp = Radeon_INPLL(regs, asic, RADEON_MCLK_CNTL); + if (di->ram.width == 64) { + if (INREG( regs, RADEON_MEM_CNTL) & R300_MEM_USE_CD_CH_ONLY) + tmp &= ~R300_DISABLE_MC_MCLKB; + else + tmp &= ~R300_DISABLE_MC_MCLKA; + } else { + tmp &= ~(R300_DISABLE_MC_MCLKA | + R300_DISABLE_MC_MCLKB); + } + } + + Radeon_OUTPLL(regs, asic, RADEON_MCLK_CNTL, tmp); + } else { + tmp = Radeon_INPLL(regs, asic, RADEON_SCLK_CNTL); + tmp &= ~(R300_SCLK_FORCE_VAP); + tmp |= RADEON_SCLK_FORCE_CP; + Radeon_OUTPLL(regs, asic, RADEON_SCLK_CNTL, tmp); + snooze(15000); + + tmp = Radeon_INPLL(regs, asic, R300_SCLK_CNTL2); + tmp &= ~(R300_SCLK_FORCE_TCL | + R300_SCLK_FORCE_GA | + R300_SCLK_FORCE_CBA); + Radeon_OUTPLL(regs, asic, R300_SCLK_CNTL2, tmp); + } + } else { + tmp = Radeon_INPLL(regs, asic, RADEON_CLK_PWRMGT_CNTL); + + tmp &= ~(RADEON_ACTIVE_HILO_LAT_MASK | + RADEON_DISP_DYN_STOP_LAT_MASK | + RADEON_DYN_STOP_MODE_MASK); + + tmp |= (RADEON_ENGIN_DYNCLK_MODE | + (0x01 << RADEON_ACTIVE_HILO_LAT_SHIFT)); + Radeon_OUTPLL(regs, asic, RADEON_CLK_PWRMGT_CNTL, tmp); + snooze(15000); + + tmp = Radeon_INPLL(regs, asic, RADEON_CLK_PIN_CNTL); + tmp |= RADEON_SCLK_DYN_START_CNTL; + Radeon_OUTPLL(regs, asic, RADEON_CLK_PIN_CNTL, tmp); + snooze(15000); + + /* When DRI is enabled, setting DYN_STOP_LAT to zero can cause some R200 + to lockup randomly, leave them as set by BIOS. + */ + tmp = Radeon_INPLL(regs, asic, RADEON_SCLK_CNTL); + /*tmp &= RADEON_SCLK_SRC_SEL_MASK;*/ + tmp &= ~RADEON_SCLK_FORCEON_MASK; + + /*RAGE_6::A11 A12 A12N1 A13, RV250::A11 A12, R300*/ + if (((asic == rt_rv250) && + ((INREG( regs, RADEON_CONFIG_CNTL) & RADEON_CFG_ATI_REV_ID_MASK) < + RADEON_CFG_ATI_REV_A13)) || + ((asic == rt_rv100) && + ((INREG( regs, RADEON_CONFIG_CNTL) & RADEON_CFG_ATI_REV_ID_MASK) <= + RADEON_CFG_ATI_REV_A13))) + { + tmp |= RADEON_SCLK_FORCE_CP; + tmp |= RADEON_SCLK_FORCE_VIP; + } + + Radeon_OUTPLL(regs, asic, RADEON_SCLK_CNTL, tmp); + + if ((asic == rt_rv200) || + (asic == rt_rv250) || + (asic == rt_rv280)) { + tmp = Radeon_INPLL(regs, asic, RADEON_SCLK_MORE_CNTL); + tmp &= ~RADEON_SCLK_MORE_FORCEON; + + /* RV200::A11 A12 RV250::A11 A12 */ + if (((asic == rt_rv200) || + (asic == rt_rv250)) && + ((INREG( regs, RADEON_CONFIG_CNTL) & RADEON_CFG_ATI_REV_ID_MASK) < + RADEON_CFG_ATI_REV_A13)) + { + tmp |= RADEON_SCLK_MORE_FORCEON; + } + Radeon_OUTPLL(regs, asic, RADEON_SCLK_MORE_CNTL, tmp); + snooze(15000); + } + + /* RV200::A11 A12, RV250::A11 A12 */ + if (((asic == rt_rv200) || + (asic == rt_rv250)) && + ((INREG( regs, RADEON_CONFIG_CNTL) & RADEON_CFG_ATI_REV_ID_MASK) < + RADEON_CFG_ATI_REV_A13)) + { + tmp = Radeon_INPLL(regs, asic, RADEON_PLL_PWRMGT_CNTL); + tmp |= RADEON_TCL_BYPASS_DISABLE; + Radeon_OUTPLL(regs, asic, RADEON_PLL_PWRMGT_CNTL, tmp); + } + snooze(15000); + + /*enable dynamic mode for display clocks (PIXCLK and PIX2CLK)*/ + tmp = Radeon_INPLL(regs, asic, RADEON_PIXCLKS_CNTL); + tmp |= (RADEON_PIX2CLK_ALWAYS_ONb | + RADEON_PIX2CLK_DAC_ALWAYS_ONb | + RADEON_PIXCLK_BLEND_ALWAYS_ONb | + RADEON_PIXCLK_GV_ALWAYS_ONb | + RADEON_PIXCLK_DIG_TMDS_ALWAYS_ONb | + RADEON_PIXCLK_LVDS_ALWAYS_ONb | + RADEON_PIXCLK_TMDS_ALWAYS_ONb); + + Radeon_OUTPLL(regs, asic, RADEON_PIXCLKS_CNTL, tmp); + snooze(15000); + + tmp = Radeon_INPLL(regs, asic, RADEON_VCLK_ECP_CNTL); + tmp |= (RADEON_PIXCLK_ALWAYS_ONb | + RADEON_PIXCLK_DAC_ALWAYS_ONb); + + Radeon_OUTPLL(regs, asic, RADEON_VCLK_ECP_CNTL, tmp); + snooze(15000); + } + SHOW_FLOW0( 3, "Dynamic Clock Scaling Enabled" ); + break; + default: + break; + } +} Modified: haiku/trunk/src/add-ons/kernel/drivers/graphics/radeon/init.c =================================================================== --- haiku/trunk/src/add-ons/kernel/drivers/graphics/radeon/init.c 2007-03-01 09:35:22 UTC (rev 20275) +++ haiku/trunk/src/add-ons/kernel/drivers/graphics/radeon/init.c 2007-03-01 09:38:11 UTC (rev 20276) @@ -324,6 +324,14 @@ if( di->asic == rt_rv100 && di->is_mobility) di->dac2_cntl = INREG( di->regs, RADEON_DAC_CNTL2 ); + // print these out to capture bios status... + if ( di->is_mobility ) { + SHOW_INFO0( 4, "Copy of Laptop Display Regs for Reference:"); + SHOW_INFO( 4, "LVDS CNTL = %8lx", INREG( di->regs, RADEON_LVDS_GEN_CNTL )); + SHOW_INFO( 4, "FP1 CNTL = %8lx", INREG( di->regs, RADEON_FP_GEN_CNTL )); + SHOW_INFO( 4, "FP2 CNTL = %8lx", INREG( di->regs, RADEON_FP2_GEN_CNTL )); + } + result = Radeon_InitPCIGART( di ); if( result < 0 ) goto err5; @@ -391,6 +399,10 @@ si->nonlocal_mem = (uint32 *)((uint32)si->framebuffer + dma_offset); si->nonlocal_vm_start = (uint32)si->framebuffer_pci + dma_offset;*/ + // set dynamic clocks for Mobilty chips + if (di->is_mobility && di->settings.dynamic_clocks) + Radeon_SetDynamicClock( di, 1); + return B_OK; err0: Modified: haiku/trunk/src/add-ons/kernel/drivers/graphics/radeon/radeon_driver.h =================================================================== --- haiku/trunk/src/add-ons/kernel/drivers/graphics/radeon/radeon_driver.h 2007-03-01 09:35:22 UTC (rev 20275) +++ haiku/trunk/src/add-ons/kernel/drivers/graphics/radeon/radeon_driver.h 2007-03-01 09:38:11 UTC (rev 20276) @@ -219,6 +219,7 @@ void Radeon_ResetEngine( device_info *di ); status_t Radeon_InitCP( device_info *di ); void Radeon_UninitCP( device_info *di ); +void Radeon_SetDynamicClock( device_info *di, int mode ); // vip.c From axeld at mail.berlios.de Thu Mar 1 10:41:37 2007 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Thu, 1 Mar 2007 10:41:37 +0100 Subject: [Haiku-commits] r20277 - in haiku/trunk: headers/private/graphics/radeon src/add-ons/accelerants/radeon Message-ID: <200703010941.l219fb2V004504@sheep.berlios.de> Author: axeld Date: 2007-03-01 10:41:37 +0100 (Thu, 01 Mar 2007) New Revision: 20277 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20277&view=rev Modified: haiku/trunk/headers/private/graphics/radeon/version.h haiku/trunk/src/add-ons/accelerants/radeon/overlay.c Log: Patch by Euan Kirkhope: Sync overlay with x.org Modified: haiku/trunk/headers/private/graphics/radeon/version.h =================================================================== --- haiku/trunk/headers/private/graphics/radeon/version.h 2007-03-01 09:38:11 UTC (rev 20276) +++ haiku/trunk/headers/private/graphics/radeon/version.h 2007-03-01 09:41:37 UTC (rev 20277) @@ -8,4 +8,4 @@ */ // current version -#define RADEON_DRIVER_VERSION "Version: 5.1.4.5" +#define RADEON_DRIVER_VERSION "Version: 5.1.4.9" Modified: haiku/trunk/src/add-ons/accelerants/radeon/overlay.c =================================================================== --- haiku/trunk/src/add-ons/accelerants/radeon/overlay.c 2007-03-01 09:38:11 UTC (rev 20276) +++ haiku/trunk/src/add-ons/accelerants/radeon/overlay.c 2007-03-01 09:41:37 UTC (rev 20277) @@ -102,6 +102,14 @@ Radeon_OUTPLLP( regs, si->asic, RADEON_VCLK_ECP_CNTL, ecp_div << RADEON_ECP_DIV_SHIFT, ~RADEON_ECP_DIV_MASK ); + // Force the overlay clock on for integrated chips + if ((si->asic == rt_rs100) || + (si->asic == rt_rs200) || + (si->asic == rt_rs300)) { + Radeon_OUTPLL( regs, si->asic, RADEON_VCLK_ECP_CNTL, + (Radeon_INPLL( regs, si->asic, RADEON_VCLK_ECP_CNTL) | (1<<18))); + } + si->active_overlay.crtc_idx = si->pending_overlay.crtc_idx; // invalidate active colour space @@ -442,6 +450,7 @@ // get appropriate scaling/filter parameters static hscale_factor *getHScaleFactor( + accelerator_info *ai, space_params *params, uint32 src_left, uint32 src_right, uint32 *h_inc ) { @@ -450,64 +459,67 @@ uint i; uint num_factors; hscale_factor *factors; - + SHOW_FLOW0( 3, "" ); // check whether fifo is large enough to feed vertical 4-tap-filter - + words_per_p1_line = ceilShiftDiv( (src_right - 1) << params->bpp_shift, 4 ) - ((src_left << params->bpp_shift) >> 4) + 1; words_per_p23_line = ceilShiftDiv( (src_right - 1) << params->bpuv_shift, 4 ) - ((src_left << params->bpuv_shift) >> 4) + 1; - - // overlay buffer for one line; this value is probably - // higher on newer Radeons (or smaller on older Radeons?) - max_words_per_line = 96; - switch( params->num_planes ) { - case 3: - p1_4tap_allowed = words_per_p1_line < max_words_per_line / 2; - p23_4tap_allowed = words_per_p23_line < max_words_per_line / 4; - break; - case 2: - p1_4tap_allowed = words_per_p1_line < max_words_per_line / 2; - p23_4tap_allowed = words_per_p23_line < max_words_per_line / 2; - break; - case 1: - default: - p1_4tap_allowed = p23_4tap_allowed = words_per_p1_line < max_words_per_line; - break; + // overlay scaler line length differs for different revisions + // this needs to be maintained by hand + if (ai->si->asic == rt_r200 || ai->si->asic >= rt_r300) + max_words_per_line = 1920 / 16; + else + max_words_per_line = 1536 / 16; + + switch (params->num_planes) { + case 3: + p1_4tap_allowed = words_per_p1_line < max_words_per_line / 2; + p23_4tap_allowed = words_per_p23_line < max_words_per_line / 4; + break; + case 2: + p1_4tap_allowed = words_per_p1_line < max_words_per_line / 2; + p23_4tap_allowed = words_per_p23_line < max_words_per_line / 2; + break; + case 1: + default: + p1_4tap_allowed = p23_4tap_allowed = words_per_p1_line < max_words_per_line; + break; } - + SHOW_FLOW( 3, "p1_4tap_allowed=%d, p23_4t_allowed=%d", (int)p1_4tap_allowed, (int)p23_4tap_allowed ); // search for proper scaling/filter entry factors = params->factors; num_factors = params->num_factors; - - if( factors == NULL || num_factors == 0 ) + + if (factors == NULL || num_factors == 0) return NULL; - - for( i = 0; i < num_factors; ++i, ++factors ) { - if( *h_inc <= factors->max_scale && - (factors->p1_step_by > 0 || p1_4tap_allowed) && - (factors->p23_step_by > 0 || p23_4tap_allowed)) + + for (i = 0; i < num_factors; ++i, ++factors) { + if (*h_inc <= factors->max_scale + && (factors->p1_step_by > 0 || p1_4tap_allowed) + && (factors->p23_step_by > 0 || p23_4tap_allowed)) break; } - - if( i == num_factors ) { + + if (i == num_factors) { // overlay is asked to be scaled down more than allowed, // so use least scaling factor supported --factors; *h_inc = factors->max_scale; } - + SHOW_FLOW( 3, "group_size=%d, p1_step_by=%d, p23_step_by=%d", factors->group_size, factors->p1_step_by, factors->p23_step_by ); - + return factors; } @@ -542,6 +554,8 @@ uint32 p1_x_start, p1_x_end; uint32 p23_x_start, p23_x_end; + uint scale_ctrl; + /*uint32 buffer[20*2]; uint idx = 0;*/ @@ -646,7 +660,7 @@ // choose proper scaler { - factors = getHScaleFactor( params, src_left >> 16, src_right >> 16, &h_inc ); + factors = getHScaleFactor( ai, params, src_left >> 16, src_right >> 16, &h_inc ); if( factors == NULL ) return B_ERROR; @@ -871,12 +885,31 @@ OUTREG( regs, RADEON_OV0_P23_V_ACCUM_INIT, p23_v_accum_init ); OUTREG( regs, RADEON_OV0_TEST, node->test_reg ); - OUTREG( regs, RADEON_OV0_SCALE_CNTL, - RADEON_SCALER_ENABLE | + + scale_ctrl = RADEON_SCALER_ENABLE | RADEON_SCALER_DOUBLE_BUFFER | (node->ati_space << 8) | - /*RADEON_SCALER_ADAPTIVE_DEINT |*/ - (crtc->crtc_idx == 0 ? 0 : RADEON_SCALER_CRTC_SEL )); + RADEON_SCALER_ADAPTIVE_DEINT | + RADEON_SCALER_BURST_PER_PLANE | + (crtc->crtc_idx == 0 ? 0 : RADEON_SCALER_CRTC_SEL ); + + switch (node->ati_space << 8) { + case RADEON_SCALER_SOURCE_15BPP: // RGB15 + case RADEON_SCALER_SOURCE_16BPP: + case RADEON_SCALER_SOURCE_32BPP: + OUTREG( regs, RADEON_OV0_SCALE_CNTL, scale_ctrl | + RADEON_SCALER_LIN_TRANS_BYPASS); + break; + case RADEON_SCALER_SOURCE_VYUY422: // VYUY422 + case RADEON_SCALER_SOURCE_YVYU422: // YVYU422 + OUTREG( regs, RADEON_OV0_SCALE_CNTL, scale_ctrl); + break; + default: + SHOW_FLOW(4, "What overlay format is this??? %d", node->ati_space); + OUTREG( regs, RADEON_OV0_SCALE_CNTL, scale_ctrl | + (( ai->si->asic >= rt_r200) ? R200_SCALER_TEMPORAL_DEINT : 0)); + + } si->overlay_mgr.auto_flip_reg ^= RADEON_OV0_SOFT_EOF_TOGGLE; From axeld at mail.berlios.de Thu Mar 1 10:43:34 2007 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Thu, 1 Mar 2007 10:43:34 +0100 Subject: [Haiku-commits] r20278 - in haiku/trunk: headers/private/graphics/radeon src/add-ons/kernel/drivers/graphics/radeon Message-ID: <200703010943.l219hYpd004655@sheep.berlios.de> Author: axeld Date: 2007-03-01 10:43:33 +0100 (Thu, 01 Mar 2007) New Revision: 20278 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20278&view=rev Modified: haiku/trunk/headers/private/graphics/radeon/radeon_interface.h haiku/trunk/headers/private/graphics/radeon/version.h haiku/trunk/src/add-ons/kernel/drivers/graphics/radeon/driver.c haiku/trunk/src/add-ons/kernel/drivers/graphics/radeon/radeon_driver.h haiku/trunk/src/add-ons/kernel/drivers/graphics/radeon/vip.c Log: Patch by Euan Kirkhope: * VIP FIFO functions for Rage Theater200 support Modified: haiku/trunk/headers/private/graphics/radeon/radeon_interface.h =================================================================== --- haiku/trunk/headers/private/graphics/radeon/radeon_interface.h 2007-03-01 09:41:37 UTC (rev 20277) +++ haiku/trunk/headers/private/graphics/radeon/radeon_interface.h 2007-03-01 09:43:33 UTC (rev 20278) @@ -20,8 +20,8 @@ #include "ddc.h" // magic code for ioctls -// changed from TKRA to TKR1 for RADEON_WAITFORFIFO ioctl -#define RADEON_PRIVATE_DATA_MAGIC 'TKR1' +// changed from TKRA to TKR2 for VIP FIFO ioctls +#define RADEON_PRIVATE_DATA_MAGIC 'TKR2' #define MAX_RADEON_DEVICE_NAME_LENGTH MAXPATHLEN @@ -40,7 +40,10 @@ RADEON_RESETENGINE, RADEON_VIPREAD, RADEON_VIPWRITE, + RADEON_VIPFIFOREAD, + RADEON_VIPFIFOWRITE, RADEON_FINDVIPDEVICE, + RADEON_VIPRESET, RADEON_WAIT_FOR_CAP_IRQ, RADEON_DMACOPY, @@ -633,6 +636,26 @@ bool lock; // true, if CP lock must be acquired } radeon_vip_write; +// read VIP fifo +typedef struct { + uint32 magic; + uint channel; // channel, i.e. device + uint address; // address + uint32 count; // size of buffer + uint8 *data; // read data + bool lock; // true, if CP lock must be acquired +} radeon_vip_fifo_read; + +// write VIP fifo +typedef struct { + uint32 magic; + uint channel; // channel, i.e. device + uint address; // address + uint32 count; // size of buffer + uint8 *data; // data to write + bool lock; // true, if CP lock must be acquired +} radeon_vip_fifo_write; + // find channel of device with given ID typedef struct { uint32 magic; @@ -640,6 +663,13 @@ uint channel; // channel of device (-1 if not found) } radeon_find_vip_device; +// reset / init VIP +typedef struct { + uint32 magic; + bool lock; +} radeon_vip_reset; + + // wait for capture interrupt and get status about typedef struct { uint32 magic; Modified: haiku/trunk/headers/private/graphics/radeon/version.h =================================================================== --- haiku/trunk/headers/private/graphics/radeon/version.h 2007-03-01 09:41:37 UTC (rev 20277) +++ haiku/trunk/headers/private/graphics/radeon/version.h 2007-03-01 09:43:33 UTC (rev 20278) @@ -8,4 +8,4 @@ */ // current version -#define RADEON_DRIVER_VERSION "Version: 5.1.4.9" +#define RADEON_DRIVER_VERSION "Version: 5.1.5.0" Modified: haiku/trunk/src/add-ons/kernel/drivers/graphics/radeon/driver.c =================================================================== --- haiku/trunk/src/add-ons/kernel/drivers/graphics/radeon/driver.c 2007-03-01 09:41:37 UTC (rev 20277) +++ haiku/trunk/src/add-ons/kernel/drivers/graphics/radeon/driver.c 2007-03-01 09:43:33 UTC (rev 20278) @@ -400,6 +400,26 @@ vw->lock ) ? B_OK : B_ERROR; } break; + case RADEON_VIPFIFOREAD: { + radeon_vip_fifo_read *vr = (radeon_vip_fifo_read *)buf; + + if( vr->magic != RADEON_PRIVATE_DATA_MAGIC ) + break; + + result = Radeon_VIPFifoRead( di, vr->channel, vr->address, vr->count, vr->data, + vr->lock ) ? B_OK : B_ERROR; + } break; + + case RADEON_VIPFIFOWRITE: { + radeon_vip_fifo_write *vw = (radeon_vip_fifo_write *)buf; + + if( vw->magic != RADEON_PRIVATE_DATA_MAGIC ) + break; + + result = Radeon_VIPFifoWrite( di, vw->channel, vw->address, vw->count, vw->data, + vw->lock ) ? B_OK : B_ERROR; + } break; + case RADEON_FINDVIPDEVICE: { radeon_find_vip_device *fvd = (radeon_find_vip_device *)buf; @@ -409,7 +429,18 @@ fvd->channel = Radeon_FindVIPDevice( di, fvd->device_id ); result = B_OK; } break; + + + case RADEON_VIPRESET: { + radeon_vip_reset *fvd = (radeon_vip_reset *)buf; + if( fvd->magic != RADEON_PRIVATE_DATA_MAGIC ) + break; + + Radeon_VIPReset( di, fvd->lock ); + result = B_OK; + } break; + case RADEON_WAIT_FOR_CAP_IRQ: { radeon_wait_for_cap_irq *wvc = (radeon_wait_for_cap_irq *)buf; Modified: haiku/trunk/src/add-ons/kernel/drivers/graphics/radeon/radeon_driver.h =================================================================== --- haiku/trunk/src/add-ons/kernel/drivers/graphics/radeon/radeon_driver.h 2007-03-01 09:41:37 UTC (rev 20277) +++ haiku/trunk/src/add-ons/kernel/drivers/graphics/radeon/radeon_driver.h 2007-03-01 09:43:33 UTC (rev 20278) @@ -225,7 +225,10 @@ // vip.c bool Radeon_VIPRead( device_info *di, uint channel, uint address, uint32 *data, bool lock ); bool Radeon_VIPWrite( device_info *di, uint8 channel, uint address, uint32 data, bool lock ); +bool Radeon_VIPFifoRead(device_info *di, uint8 channel, uint32 address, uint32 count, uint8 *buffer, bool lock); +bool Radeon_VIPFifoWrite(device_info *di, uint8 channel, uint32 address, uint32 count, uint8 *buffer, bool lock); int Radeon_FindVIPDevice( device_info *di, uint32 device_id ); +void Radeon_VIPReset( device_info *di, bool lock ); // dma.c Modified: haiku/trunk/src/add-ons/kernel/drivers/graphics/radeon/vip.c =================================================================== --- haiku/trunk/src/add-ons/kernel/drivers/graphics/radeon/vip.c 2007-03-01 09:41:37 UTC (rev 20277) +++ haiku/trunk/src/add-ons/kernel/drivers/graphics/radeon/vip.c 2007-03-01 09:43:33 UTC (rev 20278) @@ -21,6 +21,7 @@ // moved to bottom to avoid inlining static bool Radeon_VIPWaitForIdle( device_info *di ); +static status_t RADEON_VIPFifoIdle(device_info *di, uint8 channel); // read data from VIP @@ -84,8 +85,98 @@ ACQUIRE_BEN( di->si->cp.lock ); res = do_VIPRead( di, channel, address, data ); + + if( lock ) + RELEASE_BEN( di->si->cp.lock ); + +// SHOW_FLOW( 2, "address=%x, data=%lx, lock=%d", address, *data, lock ); + + return res; +} + +static bool do_VIPFifoRead(device_info *di, uint8 channel, uint32 address, uint32 count, uint8 *buffer) +{ + vuint8 *regs = di->regs; + uint32 status, tmp; + + if(count!=1) + { + SHOW_FLOW0( 2, "Attempt to access VIP bus with non-stadard transaction length\n"); + return false; + } + + SHOW_FLOW( 2, "address=%lx, count=%ld ", address, count ); + Radeon_WaitForFifo( di, 2); + SHOW_FLOW0( 2, "1"); + OUTREG( regs, RADEON_VIPH_REG_ADDR, (channel << 14) | address | 0x3000); + SHOW_FLOW0( 2, "3"); + while(B_BUSY == (status = RADEON_VIPFifoIdle( di , 0xff))); + if(B_OK != status) return false; + + // disable VIPH_REGR_DIS to enable VIP cycle. + // The LSB of VIPH_TIMEOUT_STAT are set to 0 + // because 1 would have acknowledged various VIP + // interrupts unexpectedly + + SHOW_FLOW0( 2, "4"); + Radeon_WaitForFifo( di, 2 ); // Radeon_WaitForIdle( di, false, false ); + SHOW_FLOW0( 2, "5"); + OUTREG( regs, RADEON_VIPH_TIMEOUT_STAT, + INREG( regs, RADEON_VIPH_TIMEOUT_STAT) & + (0xffffff00 & ~RADEON_VIPH_TIMEOUT_STAT_VIPH_REGR_DIS) ); + + // the value returned here is garbage. The read merely initiates + // a register cycle + SHOW_FLOW0( 2, "6"); + Radeon_WaitForFifo( di, 2 ); // Radeon_WaitForIdle( di, false, false ); + INREG( regs, RADEON_VIPH_REG_DATA); + SHOW_FLOW0( 2, "7"); + while(B_BUSY == (status = RADEON_VIPFifoIdle( di , 0xff))); + if(B_OK != status) return false; + + // set VIPH_REGR_DIS so that the read won't take too long. + SHOW_FLOW0( 2, "8"); + Radeon_WaitForFifo( di, 2 ); // Radeon_WaitForIdle( di, false, false ); + SHOW_FLOW0( 2, "9"); + tmp = INREG( regs, RADEON_VIPH_TIMEOUT_STAT); + OUTREG( regs, RADEON_VIPH_TIMEOUT_STAT, (tmp & 0xffffff00) | RADEON_VIPH_TIMEOUT_STAT_VIPH_REGR_DIS); + + SHOW_FLOW0( 2, "10"); + Radeon_WaitForFifo( di, 2 ); // Radeon_WaitForIdle( di, false, false ); + switch(count){ + case 1: + *buffer=(uint8)(INREG( regs, RADEON_VIPH_REG_DATA) & 0xff); + break; + case 2: + *(uint16 *)buffer=(uint16) (INREG( regs, RADEON_VIPH_REG_DATA) & 0xffff); + break; + case 4: + *(uint32 *)buffer=(uint32) ( INREG( regs, RADEON_VIPH_REG_DATA) & 0xffffffff); + break; + } + SHOW_FLOW0( 2, "11"); + while(B_BUSY == (status = RADEON_VIPFifoIdle( di , 0xff))); + if(B_OK != status) return false; + + // so that reading VIPH_REG_DATA would not trigger unnecessary vip cycles. + SHOW_FLOW0( 2, "12"); + OUTREG( regs, RADEON_VIPH_TIMEOUT_STAT, + (INREG( regs, RADEON_VIPH_TIMEOUT_STAT) & 0xffffff00) | RADEON_VIPH_TIMEOUT_STAT_VIPH_REGR_DIS); + return true; + +} + +bool Radeon_VIPFifoRead(device_info *di, uint8 channel, uint32 address, uint32 count, uint8 *buffer, bool lock) +{ + bool res; + if( lock ) + ACQUIRE_BEN( di->si->cp.lock ); + + res = do_VIPFifoRead( di, channel, address, count, buffer ); + + if( lock ) RELEASE_BEN( di->si->cp.lock ); //SHOW_FLOW( 2, "address=%x, data=%lx, lock=%d", address, *data, lock ); @@ -95,31 +186,26 @@ // write data to VIP // CP must be hold -static bool do_VIPWrite( - device_info *di, uint8 channel, uint address, uint32 data ) +static bool do_VIPWrite( device_info *di, uint8 channel, uint address, uint32 data ) { vuint8 *regs = di->regs; - bool res; Radeon_WaitForFifo( di, 2 ); OUTREG( regs, RADEON_VIPH_REG_ADDR, (channel << 14) | (address & ~0x2000) ); - if( !Radeon_VIPWaitForIdle( di )) - return false; + if( !Radeon_VIPWaitForIdle( di )) return false; //SHOW_FLOW( 4, "channel=%d, address=%x, data=%lx", channel, address, data ); Radeon_WaitForFifo( di, 2 ); OUTREG( regs, RADEON_VIPH_REG_DATA, data ); - res = Radeon_VIPWaitForIdle( di ); + return Radeon_VIPWaitForIdle( di ); - return res; } // public function: write data to VIP -bool Radeon_VIPWrite( - device_info *di, uint8 channel, uint address, uint32 data, bool lock ) +bool Radeon_VIPWrite(device_info *di, uint8 channel, uint address, uint32 data, bool lock ) { bool res; @@ -137,8 +223,64 @@ } +static bool do_VIPFifoWrite(device_info *di, uint8 channel, uint32 address, uint32 count, uint8 *buffer) +{ + vuint8 *regs = di->regs; + + uint32 status; + uint32 i; + + SHOW_FLOW( 2, "address=%lx, count=%ld, ", address, count ); + + Radeon_WaitForFifo( di, 2 ); + OUTREG( regs, RADEON_VIPH_REG_ADDR, ((channel << 14) | address | 0x1000) & ~0x2000 ); + SHOW_FLOW0( 2, "1"); + while(B_BUSY == (status = RADEON_VIPFifoIdle( di, 0x0f))); + + + if(B_OK != status){ + SHOW_FLOW( 2 ,"cannot write %x to VIPH_REG_ADDR\n", (unsigned int)address); + return false; + } + + SHOW_FLOW0( 2, "2"); + for (i = 0; i < count; i+=4) + { + Radeon_WaitForFifo( di, 2); + SHOW_FLOW( 2, "count %ld", count); + OUTREG( regs, RADEON_VIPH_REG_DATA, *(uint32*)(buffer + i)); + while(B_BUSY == (status = RADEON_VIPFifoIdle( di, 0x0f))); + if(B_OK != status) + { + SHOW_FLOW0( 2 , "cannot write to VIPH_REG_DATA\n"); + return false; + } + } + + return true; +} + +bool Radeon_VIPFifoWrite(device_info *di, uint8 channel, uint32 address, uint32 count, uint8 *buffer, bool lock) +{ + bool res; + + //SHOW_FLOW( 2, "address=%x, data=%lx, lock=%d", address, data, lock ); + + if( lock ) + ACQUIRE_BEN( di->si->cp.lock ); + + Radeon_VIPReset( di, false); + res = do_VIPFifoWrite( di, channel, address, count, buffer ); + + if( lock ) + RELEASE_BEN( di->si->cp.lock ); + + return res; +} + + // reset VIP -static void VIPReset( +void Radeon_VIPReset( device_info *di, bool lock ) { vuint8 *regs = di->regs; @@ -146,27 +288,43 @@ if( lock ) ACQUIRE_BEN( di->si->cp.lock ); - Radeon_WaitForFifo( di, 5 ); - OUTREG( regs, RADEON_VIPH_CONTROL, - 4 | - (15 << RADEON_VIPH_CONTROL_VIPH_MAX_WAIT_SHIFT) | - RADEON_VIPH_CONTROL_VIPH_DMA_MODE | - RADEON_VIPH_CONTROL_VIPH_EN ); - OUTREGP( regs, RADEON_VIPH_TIMEOUT_STAT, RADEON_VIPH_TIMEOUT_STAT_VIPH_REGR_DIS, - ~RADEON_VIPH_TIMEOUT_STAT_AK_MASK & ~RADEON_VIPH_TIMEOUT_STAT_VIPH_REGR_DIS); - OUTREG( regs, RADEON_VIPH_DV_LAT, - 0xff | - (4 << RADEON_VIPH_DV_LAT_VIPH_DV0_LAT_SHIFT) | - (4 << RADEON_VIPH_DV_LAT_VIPH_DV1_LAT_SHIFT) | - (4 << RADEON_VIPH_DV_LAT_VIPH_DV2_LAT_SHIFT) | - (4 << RADEON_VIPH_DV_LAT_VIPH_DV3_LAT_SHIFT)); - OUTREG( regs, RADEON_VIPH_DMA_CHUNK, - 1 | - (1 << RADEON_VIPH_DMA_CHUNK_VIPH_CH1_CHUNK_SHIFT) | - (1 << RADEON_VIPH_DMA_CHUNK_VIPH_CH2_CHUNK_SHIFT) | - (1 << RADEON_VIPH_DMA_CHUNK_VIPH_CH3_CHUNK_SHIFT)); - OUTREGP( regs, RADEON_TEST_DEBUG_CNTL, 0, ~RADEON_TEST_DEBUG_CNTL_OUT_EN ); + Radeon_WaitForFifo( di, 5 ); // Radeon_WaitForIdle( di, false, false ); + switch(di->asic){ + case rt_r200: + case rt_rs200: + case rt_rv200: + case rt_rs100: + case rt_rv100: + case rt_r100: + OUTREG( regs, RADEON_VIPH_CONTROL, 4 | (15 << RADEON_VIPH_CONTROL_VIPH_MAX_WAIT_SHIFT) | + RADEON_VIPH_CONTROL_VIPH_DMA_MODE | RADEON_VIPH_CONTROL_VIPH_EN ); // slowest, timeout in 16 phases + OUTREG( regs, RADEON_VIPH_TIMEOUT_STAT, (INREG( regs, RADEON_VIPH_TIMEOUT_STAT) & 0xFFFFFF00) | + RADEON_VIPH_TIMEOUT_STAT_VIPH_REGR_DIS); + OUTREG( regs, RADEON_VIPH_DV_LAT, + 0xff | + (4 << RADEON_VIPH_DV_LAT_VIPH_DV0_LAT_SHIFT) | + (4 << RADEON_VIPH_DV_LAT_VIPH_DV1_LAT_SHIFT) | + (4 << RADEON_VIPH_DV_LAT_VIPH_DV2_LAT_SHIFT) | + (4 << RADEON_VIPH_DV_LAT_VIPH_DV3_LAT_SHIFT)); // set timeslice + OUTREG( regs, RADEON_VIPH_DMA_CHUNK, 0x151); + OUTREG( regs, RADEON_TEST_DEBUG_CNTL, INREG( regs, RADEON_TEST_DEBUG_CNTL) & (~RADEON_TEST_DEBUG_CNTL_OUT_EN)); + default: + OUTREG( regs, RADEON_VIPH_CONTROL, 9 | (15 << RADEON_VIPH_CONTROL_VIPH_MAX_WAIT_SHIFT) | + RADEON_VIPH_CONTROL_VIPH_DMA_MODE | RADEON_VIPH_CONTROL_VIPH_EN ); // slowest, timeout in 16 phases + OUTREG( regs, RADEON_VIPH_TIMEOUT_STAT, (INREG( regs, RADEON_VIPH_TIMEOUT_STAT) & 0xFFFFFF00) | + RADEON_VIPH_TIMEOUT_STAT_VIPH_REGR_DIS); + OUTREG( regs, RADEON_VIPH_DV_LAT, + 0xff | + (4 << RADEON_VIPH_DV_LAT_VIPH_DV0_LAT_SHIFT) | + (4 << RADEON_VIPH_DV_LAT_VIPH_DV1_LAT_SHIFT) | + (4 << RADEON_VIPH_DV_LAT_VIPH_DV2_LAT_SHIFT) | + (4 << RADEON_VIPH_DV_LAT_VIPH_DV3_LAT_SHIFT)); // set timeslice + OUTREG( regs, RADEON_VIPH_DMA_CHUNK, 0x0); + OUTREG( regs, RADEON_TEST_DEBUG_CNTL, INREG( regs, RADEON_TEST_DEBUG_CNTL) & (~RADEON_TEST_DEBUG_CNTL_OUT_EN)); + break; + } + if( lock ) RELEASE_BEN( di->si->cp.lock ); } @@ -184,25 +342,30 @@ // if there is a stuck transaction, acknowledge that timeout = INREG( regs, RADEON_VIPH_TIMEOUT_STAT ); - if( (timeout & RADEON_VIPH_TIMEOUT_STAT_VIPH_REG_STAT) != 0 ) { - OUTREGP( regs, RADEON_VIPH_TIMEOUT_STAT, - RADEON_VIPH_TIMEOUT_STAT_VIPH_REG_AK, - ~RADEON_VIPH_TIMEOUT_STAT_VIPH_REG_AK & ~RADEON_VIPH_TIMEOUT_STAT_AK_MASK ); - if( (INREG( regs, RADEON_VIPH_CONTROL) & RADEON_VIPH_CONTROL_VIPH_REG_RDY) != 0 ) - return B_BUSY; - else - return B_ERROR; + if( (timeout & RADEON_VIPH_TIMEOUT_STAT_VIPH_REG_STAT) != 0 ) + { + OUTREG( regs, RADEON_VIPH_TIMEOUT_STAT, + (timeout & 0xffffff00) | RADEON_VIPH_TIMEOUT_STAT_VIPH_REG_AK); + return (INREG( regs, RADEON_VIPH_CONTROL) & 0x2000) ? B_BUSY : B_ERROR; } - - //Radeon_WaitForIdle( di, false, false ); - - if( (INREG( regs, RADEON_VIPH_CONTROL) & RADEON_VIPH_CONTROL_VIPH_REG_RDY) != 0 ) - return B_BUSY; - else - return B_OK; + return (INREG( regs, RADEON_VIPH_CONTROL) & 0x2000) ? B_BUSY : B_OK; } +static status_t RADEON_VIPFifoIdle(device_info *di, uint8 channel) +{ + vuint8 *regs = di->regs; + uint32 timeout; + timeout = INREG( regs, RADEON_VIPH_TIMEOUT_STAT); + if((timeout & 0x0000000f) & channel) /* lockup ?? */ + { + OUTREG( regs, RADEON_VIPH_TIMEOUT_STAT, (timeout & 0xfffffff0) | channel); + return (INREG( regs, RADEON_VIPH_CONTROL) & 0x2000) ? B_BUSY : B_ERROR; + } + return (INREG( regs, RADEON_VIPH_CONTROL) & 0x2000) ? B_BUSY : B_OK ; +} + + // wait until VIP host is idle // lock must be hold static bool Radeon_VIPWaitForIdle( @@ -240,23 +403,28 @@ // if card has no VIP port, let hardware detection fail; // in this case, noone will bother us again - if( !di->has_vip ) + if( !di->has_vip ) { + SHOW_FLOW0( 3, "This Device has no VIP Bus."); return -1; - + } + ACQUIRE_BEN( di->si->cp.lock ); - VIPReset( di, false ); + Radeon_VIPReset( di, false ); // there are up to 4 devices, connected to one of 4 channels for( channel = 0; channel < 4; ++channel ) { + // read device id - if( !Radeon_VIPRead( di, channel, RADEON_VIP_VENDOR_DEVICE_ID, &cur_device_id, false )) + if( !Radeon_VIPRead( di, channel, RADEON_VIP_VENDOR_DEVICE_ID, &cur_device_id, false )) { + SHOW_FLOW( 3, "No device found on channel %d", channel); continue; + } // compare device id directly if( cur_device_id == device_id ) { + SHOW_FLOW( 3, "Device %08lx found on channel %d", device_id, channel); RELEASE_BEN( di->si->cp.lock ); - return channel; } } From axeld at mail.berlios.de Thu Mar 1 14:09:41 2007 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Thu, 1 Mar 2007 14:09:41 +0100 Subject: [Haiku-commits] r20279 - haiku/trunk/src/system/kernel/vm Message-ID: <200703011309.l21D9fSP004731@sheep.berlios.de> Author: axeld Date: 2007-03-01 14:09:41 +0100 (Thu, 01 Mar 2007) New Revision: 20279 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20279&view=rev Modified: haiku/trunk/src/system/kernel/vm/vm.cpp Log: * The KDL commands cache/cache_ref will now also print the type of the cache. * Made the output look a bit more like that of the other commands. Modified: haiku/trunk/src/system/kernel/vm/vm.cpp =================================================================== --- haiku/trunk/src/system/kernel/vm/vm.cpp 2007-03-01 09:43:33 UTC (rev 20278) +++ haiku/trunk/src/system/kernel/vm/vm.cpp 2007-03-01 13:09:41 UTC (rev 20279) @@ -2035,6 +2035,25 @@ } +static const char * +cache_type_to_string(int32 type) +{ + switch (type) { + case CACHE_TYPE_RAM: + return "RAM"; + case CACHE_TYPE_DEVICE: + return "device"; + case CACHE_TYPE_VNODE: + return "vnode"; + case CACHE_TYPE_NULL: + return "null"; + + default: + return "unknown"; + } +} + + static int dump_cache(int argc, char **argv) { @@ -2086,7 +2105,7 @@ } if (showCacheRef) { - kprintf("cache_ref at %p:\n", cacheRef); + kprintf("CACHE_REF %p:\n", cacheRef); if (!showCache) kprintf(" cache: %p\n", cacheRef->cache); kprintf(" ref_count: %ld\n", cacheRef->ref_count); @@ -2103,11 +2122,12 @@ } if (showCache) { - kprintf("cache at %p:\n", cache); + kprintf("CACHE %p:\n", cache); if (!showCacheRef) kprintf(" cache_ref: %p\n", cache->ref); kprintf(" source: %p\n", cache->source); kprintf(" store: %p\n", cache->store); + kprintf(" type: %s\n", cache_type_to_string(cache->type)); kprintf(" virtual_base: 0x%Lx\n", cache->virtual_base); kprintf(" virtual_size: 0x%Lx\n", cache->virtual_size); kprintf(" temporary: %ld\n", cache->temporary); From jackburton at mail.berlios.de Thu Mar 1 14:19:05 2007 From: jackburton at mail.berlios.de (jackburton at BerliOS) Date: Thu, 1 Mar 2007 14:19:05 +0100 Subject: [Haiku-commits] r20280 - haiku/trunk/src/tests/kits/interface/picture Message-ID: <200703011319.l21DJ5rF006881@sheep.berlios.de> Author: jackburton Date: 2007-03-01 14:19:05 +0100 (Thu, 01 Mar 2007) New Revision: 20280 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20280&view=rev Modified: haiku/trunk/src/tests/kits/interface/picture/PictureTest.cpp Log: Archive the 2 pictures to a message, in order to compare the data. Currently Archiving the Unflattened picture doesn't work, and it hangs inside assert_local_copy(), waiting for the app_server reply... Modified: haiku/trunk/src/tests/kits/interface/picture/PictureTest.cpp =================================================================== --- haiku/trunk/src/tests/kits/interface/picture/PictureTest.cpp 2007-03-01 13:09:41 UTC (rev 20279) +++ haiku/trunk/src/tests/kits/interface/picture/PictureTest.cpp 2007-03-01 13:19:05 UTC (rev 20280) @@ -109,12 +109,21 @@ DrawStuff(this); BPicture *picture = EndPicture(); - + if (picture == NULL) + return; + + BMessage message; + picture->Archive(&message); + message.PrintToStream(); + BMallocIO stream; status_t status = picture->Flatten(&stream); + delete picture; + if (status != B_OK) printf("Error flattening BPicture: %s\n", strerror(status)); + if (status == B_OK) { stream.Seek(0, SEEK_SET); fPicture = new BPicture(); @@ -123,7 +132,9 @@ printf("Error unflattening BPicture: %s\n", strerror(status)); } - delete picture; + BMessage message2; + //fPicture->Archive(&message2); + message2.PrintToStream(); } void From michael.pfeiffer at utanet.at Thu Mar 1 14:37:03 2007 From: michael.pfeiffer at utanet.at (Michael Pfeiffer) Date: Thu, 01 Mar 2007 14:37:03 +0100 Subject: [Haiku-commits] r20280 - haiku/trunk/src/tests/kits/interface/picture In-Reply-To: <200703011319.l21DJ5rF006881@sheep.berlios.de> References: <200703011319.l21DJ5rF006881@sheep.berlios.de> Message-ID: > Archive the 2 pictures to a message, in order to compare the data. You could also use the class PicturePrinter instead. Usage: haiku/trunk/src/tests/kits/interface/pictureprint/DumpPrintJob.cpp Implementation: haiku/trunk/headers/private/print/PicturePrinter.h haiku/trunk/src/add-ons/print/shared/PicturePrinter.cpp - Michael From axeld at mail.berlios.de Thu Mar 1 14:44:56 2007 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Thu, 1 Mar 2007 14:44:56 +0100 Subject: [Haiku-commits] r20281 - in haiku/trunk: headers/private/kernel src/system/kernel/vm Message-ID: <200703011344.l21DiuVS010500@sheep.berlios.de> Author: axeld Date: 2007-03-01 14:44:55 +0100 (Thu, 01 Mar 2007) New Revision: 20281 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20281&view=rev Modified: haiku/trunk/headers/private/kernel/vm_types.h haiku/trunk/src/system/kernel/vm/vm.cpp Log: * vm_map_physical_memory() now sets the wiring/locking type of the area created to B_FULL_LOCK. * vm_clone_area() now respects the source area's wiring and inherits it. This should fix bug #1055. * vm_cache::type is now duplicated in vm_area::cache_type - this allows looking it up without having to lock a vm_cache_ref; this also solves a locking bug in vm_unmap_pages() in this regard. Modified: haiku/trunk/headers/private/kernel/vm_types.h =================================================================== --- haiku/trunk/headers/private/kernel/vm_types.h 2007-03-01 13:19:05 UTC (rev 20280) +++ haiku/trunk/headers/private/kernel/vm_types.h 2007-03-01 13:44:55 UTC (rev 20281) @@ -158,6 +158,7 @@ struct vm_cache_ref *cache_ref; off_t cache_offset; + uint32 cache_type; vm_area_mappings mappings; struct vm_address_space *address_space; Modified: haiku/trunk/src/system/kernel/vm/vm.cpp =================================================================== --- haiku/trunk/src/system/kernel/vm/vm.cpp 2007-03-01 13:19:05 UTC (rev 20280) +++ haiku/trunk/src/system/kernel/vm/vm.cpp 2007-03-01 13:44:55 UTC (rev 20281) @@ -954,6 +954,7 @@ TRACE(("vm_create_anonymous_area: done\n")); + area->cache_type = CACHE_TYPE_RAM; return area->id; err3: @@ -1034,7 +1035,8 @@ cacheRef = cache->ref; status = map_backing_store(addressSpace, cacheRef, _address, 0, size, - addressSpec & ~B_MTR_MASK, 0, protection, REGION_NO_PRIVATE_MAP, &area, name); + addressSpec & ~B_MTR_MASK, B_FULL_LOCK, protection, + REGION_NO_PRIVATE_MAP, &area, name); if (status < B_OK) vm_cache_release_ref(cacheRef); @@ -1047,8 +1049,6 @@ } if (status >= B_OK) { - mutex_lock(&cacheRef->lock); - // make sure our area is mapped in completely vm_translation_map *map = &addressSpace->translation_map; @@ -1060,7 +1060,6 @@ } map->ops->unlock(map); - mutex_unlock(&cacheRef->lock); } vm_put_address_space(addressSpace); @@ -1071,6 +1070,7 @@ // the same way the physical address in was offset *_address = (void *)((addr_t)*_address + mapOffset); + area->cache_type = CACHE_TYPE_DEVICE; return area->id; err3: @@ -1132,6 +1132,7 @@ return status; } + area->cache_type = CACHE_TYPE_NULL; return area->id; err3: @@ -1241,6 +1242,7 @@ goto err1; vm_put_address_space(addressSpace); + area->cache_type = CACHE_TYPE_VNODE; return area->id; err1: @@ -1325,7 +1327,9 @@ status = B_NOT_ALLOWED; } else #endif - { + if (sourceArea->cache_type == CACHE_TYPE_NULL) + status = B_NOT_ALLOWED; + else { status = map_backing_store(addressSpace, sourceArea->cache_ref, address, sourceArea->cache_offset, sourceArea->size, addressSpec, sourceArea->wiring, protection, mapping, &newArea, name); @@ -1337,6 +1341,42 @@ // one. vm_cache_acquire_ref(sourceArea->cache_ref); } + if (status == B_OK && newArea->wiring == B_FULL_LOCK) { + // we need to map in everything at this point + if (newArea->cache_type == CACHE_TYPE_DEVICE) { + // we don't have actual pages to map but a physical area + vm_translation_map *map = &addressSpace->translation_map; + map->ops->lock(map); + + addr_t physicalAddress; + uint32 oldProtection; + map->ops->query(map, sourceArea->base, &physicalAddress, + &oldProtection); + + for (addr_t offset = 0; offset < newArea->size; + offset += B_PAGE_SIZE) { + map->ops->map(map, newArea->base + offset, + physicalAddress + offset, protection); + } + + map->ops->unlock(map); + } else { + // map in all pages from source + mutex_lock(&sourceArea->cache_ref->lock); + + for (vm_page *page = sourceArea->cache_ref->cache->page_list; + page != NULL; page = page->cache_next) { + vm_map_page(newArea, page, newArea->base + + ((page->cache_offset << PAGE_SHIFT) - newArea->cache_offset), + protection); + } + + mutex_unlock(&sourceArea->cache_ref->lock); + } + } + if (status == B_OK) + newArea->cache_type = sourceArea->cache_type; + vm_cache_release_ref(sourceArea->cache_ref); vm_put_area(sourceArea); @@ -1796,7 +1836,7 @@ map->ops->lock(map); - if (area->wiring != B_NO_LOCK && area->cache_ref->cache->type != CACHE_TYPE_DEVICE) { + if (area->wiring != B_NO_LOCK && area->cache_type != CACHE_TYPE_DEVICE) { // iterate through all pages and decrease their wired count for (addr_t virtualAddress = base; virtualAddress < base + (size - 1); virtualAddress += B_PAGE_SIZE) { @@ -1986,7 +2026,7 @@ static const char * -page_state_to_text(int state) +page_state_to_string(int state) { switch(state) { case PAGE_STATE_ACTIVE: @@ -2149,10 +2189,10 @@ if (page->type == PAGE_TYPE_PHYSICAL) { kprintf("\t%p ppn 0x%lx offset 0x%lx type %u state %u (%s) wired_count %u\n", page, page->physical_page_number, page->cache_offset, page->type, page->state, - page_state_to_text(page->state), page->wired_count); + page_state_to_string(page->state), page->wired_count); } else if(page->type == PAGE_TYPE_DUMMY) { kprintf("\t%p DUMMY PAGE state %u (%s)\n", - page, page->state, page_state_to_text(page->state)); + page, page->state, page_state_to_string(page->state)); } else kprintf("\t%p UNKNOWN PAGE type %u\n", page, page->type); } @@ -2179,6 +2219,7 @@ kprintf("memory_type:\t0x%x\n", area->memory_type); kprintf("ref_count:\t%ld\n", area->ref_count); kprintf("cache_ref:\t%p\n", area->cache_ref); + kprintf("cache_type:\t%s\n", cache_type_to_string(area->cache_type)); kprintf("cache_offset:\t0x%Lx\n", area->cache_offset); kprintf("cache_next:\t%p\n", area->cache_next); kprintf("cache_prev:\t%p\n", area->cache_prev); @@ -3476,15 +3517,11 @@ vm_area *area = vm_area_lookup(addressSpace, address); if (area != NULL) { - mutex_lock(&area->cache_ref->lock); - // This determines if we need to lock the memory at all - needsLocking = area->cache_ref->cache->type != CACHE_TYPE_NULL - && area->cache_ref->cache->type != CACHE_TYPE_DEVICE + needsLocking = area->cache_type != CACHE_TYPE_NULL + && area->cache_type != CACHE_TYPE_DEVICE && area->wiring != B_FULL_LOCK && area->wiring != B_CONTIGUOUS; - - mutex_unlock(&area->cache_ref->lock); } release_sem_etc(addressSpace->sem, READ_COUNT, 0); From axeld at mail.berlios.de Thu Mar 1 14:52:58 2007 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Thu, 1 Mar 2007 14:52:58 +0100 Subject: [Haiku-commits] r20282 - haiku/trunk/src/system/kernel/vm Message-ID: <200703011352.l21Dqw4x011481@sheep.berlios.de> Author: axeld Date: 2007-03-01 14:52:58 +0100 (Thu, 01 Mar 2007) New Revision: 20282 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20282&view=rev Modified: haiku/trunk/src/system/kernel/vm/vm.cpp Log: Of course, we need to query the address space of the source area, not the one of the target. Modified: haiku/trunk/src/system/kernel/vm/vm.cpp =================================================================== --- haiku/trunk/src/system/kernel/vm/vm.cpp 2007-03-01 13:44:55 UTC (rev 20281) +++ haiku/trunk/src/system/kernel/vm/vm.cpp 2007-03-01 13:52:58 UTC (rev 20282) @@ -1345,7 +1345,7 @@ // we need to map in everything at this point if (newArea->cache_type == CACHE_TYPE_DEVICE) { // we don't have actual pages to map but a physical area - vm_translation_map *map = &addressSpace->translation_map; + vm_translation_map *map = &sourceArea->address_space->translation_map; map->ops->lock(map); addr_t physicalAddress; @@ -1353,6 +1353,11 @@ map->ops->query(map, sourceArea->base, &physicalAddress, &oldProtection); + map->ops->unlock(map); + + map = &addressSpace->translation_map; + map->ops->lock(map); + for (addr_t offset = 0; offset < newArea->size; offset += B_PAGE_SIZE) { map->ops->map(map, newArea->base + offset, From axeld at mail.berlios.de Thu Mar 1 14:58:35 2007 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Thu, 1 Mar 2007 14:58:35 +0100 Subject: [Haiku-commits] r20283 - haiku/trunk/src/system/kernel/vm Message-ID: <200703011358.l21DwZsF011958@sheep.berlios.de> Author: axeld Date: 2007-03-01 14:58:34 +0100 (Thu, 01 Mar 2007) New Revision: 20283 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20283&view=rev Modified: haiku/trunk/src/system/kernel/vm/vm.cpp Log: And of course, we shouldn't test newArea->cache_type before it was set... Modified: haiku/trunk/src/system/kernel/vm/vm.cpp =================================================================== --- haiku/trunk/src/system/kernel/vm/vm.cpp 2007-03-01 13:52:58 UTC (rev 20282) +++ haiku/trunk/src/system/kernel/vm/vm.cpp 2007-03-01 13:58:34 UTC (rev 20283) @@ -1343,7 +1343,7 @@ } if (status == B_OK && newArea->wiring == B_FULL_LOCK) { // we need to map in everything at this point - if (newArea->cache_type == CACHE_TYPE_DEVICE) { + if (sourceArea->cache_type == CACHE_TYPE_DEVICE) { // we don't have actual pages to map but a physical area vm_translation_map *map = &sourceArea->address_space->translation_map; map->ops->lock(map); From axeld at mail.berlios.de Thu Mar 1 15:39:10 2007 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Thu, 1 Mar 2007 15:39:10 +0100 Subject: [Haiku-commits] r20284 - haiku/trunk/src/system/kernel/vm Message-ID: <200703011439.l21EdAiI015045@sheep.berlios.de> Author: axeld Date: 2007-03-01 15:39:09 +0100 (Thu, 01 Mar 2007) New Revision: 20284 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20284&view=rev Modified: haiku/trunk/src/system/kernel/vm/vm.cpp Log: Implemented printing the stack trace in vm_page_fault() for PPC as well. Not tested, though. Modified: haiku/trunk/src/system/kernel/vm/vm.cpp =================================================================== --- haiku/trunk/src/system/kernel/vm/vm.cpp 2007-03-01 13:58:34 UTC (rev 20283) +++ haiku/trunk/src/system/kernel/vm/vm.cpp 2007-03-01 14:39:09 UTC (rev 20284) @@ -2888,21 +2888,32 @@ #if 1 if (area) { struct stack_frame { - #ifdef __INTEL__ + #if defined(__INTEL__) || defined(__POWERPC__) struct stack_frame* previous; void* return_address; #else // ... #endif - }; + } frame; +#ifdef __INTEL__ struct iframe *iframe = i386_get_user_iframe(); if (iframe == NULL) panic("iframe is NULL!"); - struct stack_frame frame; status_t status = user_memcpy(&frame, (void *)iframe->ebp, sizeof(struct stack_frame)); +#elif defined(__POWERPC__) + struct iframe *iframe = ppc_get_user_iframe(); + if (iframe == NULL) + panic("iframe is NULL!"); + status_t status = user_memcpy(&frame, (void *)iframe->r1, + sizeof(struct stack_frame)); +#else +# warn "vm_page_fault() stack trace won't work" + status = B_ERROR; +#endif + dprintf("stack trace:\n"); while (status == B_OK) { dprintf(" %p", frame.return_address); From jackburton at mail.berlios.de Thu Mar 1 15:47:13 2007 From: jackburton at mail.berlios.de (jackburton at BerliOS) Date: Thu, 1 Mar 2007 15:47:13 +0100 Subject: [Haiku-commits] r20285 - haiku/trunk/src/servers/app Message-ID: <200703011447.l21ElDEI015674@sheep.berlios.de> Author: jackburton Date: 2007-03-01 15:47:10 +0100 (Thu, 01 Mar 2007) New Revision: 20285 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20285&view=rev Modified: haiku/trunk/src/servers/app/ServerApp.cpp haiku/trunk/src/servers/app/ServerPicture.cpp haiku/trunk/src/servers/app/ServerPicture.h Log: When creating a picture with data, the app_server was writing beyond the allocated memory, without telling anyone. That was causing bad things to happen. Flattening and unflattening BPictures now works, and consequently, printing works too. Bug #1014 is fixed. Modified: haiku/trunk/src/servers/app/ServerApp.cpp =================================================================== --- haiku/trunk/src/servers/app/ServerApp.cpp 2007-03-01 14:39:09 UTC (rev 20284) +++ haiku/trunk/src/servers/app/ServerApp.cpp 2007-03-01 14:47:10 UTC (rev 20285) @@ -686,18 +686,12 @@ { // TODO: Maybe rename this to AS_UPLOAD_PICTURE ? STRACE(("ServerApp %s: Create Picture\n", Signature())); + status_t status = B_ERROR; ServerPicture *picture = CreatePicture(); - if (picture != NULL) { - int32 subPicturesCount = 0; - link.Read(&subPicturesCount); - for (int32 c = 0; c < subPicturesCount; c++) { - // TODO: Support nested pictures - } - - int32 size = 0; - link.Read(&size); - link.Read(const_cast(picture->Data()), size); - + if (picture != NULL) + status = picture->ImportData(link); + + if (status == B_OK) { fLink.StartMessage(B_OK); fLink.Attach(picture->Token()); } else Modified: haiku/trunk/src/servers/app/ServerPicture.cpp =================================================================== --- haiku/trunk/src/servers/app/ServerPicture.cpp 2007-03-01 14:39:09 UTC (rev 20284) +++ haiku/trunk/src/servers/app/ServerPicture.cpp 2007-03-01 14:47:10 UTC (rev 20285) @@ -15,6 +15,7 @@ #include "ViewLayer.h" #include "WindowLayer.h" +#include #include #include #include @@ -661,3 +662,27 @@ PicturePlayer player(const_cast(fData.Buffer()), fData.BufferLength(), NULL); player.Play(const_cast(tableEntries), sizeof(tableEntries) / sizeof(void *), view); } + + +status_t +ServerPicture::ImportData(BPrivate::LinkReceiver &link) +{ + int32 subPicturesCount = 0; + link.Read(&subPicturesCount); + for (int32 c = 0; c < subPicturesCount; c++) { + // TODO: Support nested pictures + } + + int32 size = 0; + link.Read(&size); + if (fData.SetSize(size) != B_OK) + return B_ERROR; + + // TODO: The best way to do this would be to read the data into + // a temporary buffer, and then use the BMallocIO::Write() method, + // but this way we avoid an extra copy. Unfortunately BMallocIO::Write() + // only accepts a pointer to raw data... + link.Read(const_cast(fData.Buffer()), size); + + return B_OK; +} Modified: haiku/trunk/src/servers/app/ServerPicture.h =================================================================== --- haiku/trunk/src/servers/app/ServerPicture.h 2007-03-01 14:39:09 UTC (rev 20284) +++ haiku/trunk/src/servers/app/ServerPicture.h 2007-03-01 14:47:10 UTC (rev 20285) @@ -7,6 +7,7 @@ class ServerApp; class ViewLayer; +class BPrivate::LinkReceiver; class ServerPicture : public PictureDataWriter { public: int32 Token() { return fToken; } @@ -23,6 +24,8 @@ const void *Data() const { return fData.Buffer(); } int32 DataLength() const { return fData.BufferLength(); } + + status_t ImportData(BPrivate::LinkReceiver &link); private: friend class ServerApp; @@ -30,7 +33,7 @@ ServerPicture(); ServerPicture(const ServerPicture &); ~ServerPicture(); - + int32 fToken; BMallocIO fData; // DrawState *fState; From jackburton at mail.berlios.de Thu Mar 1 15:53:53 2007 From: jackburton at mail.berlios.de (jackburton at BerliOS) Date: Thu, 1 Mar 2007 15:53:53 +0100 Subject: [Haiku-commits] r20286 - haiku/trunk/src/tests/kits/interface/picture Message-ID: <200703011453.l21ErrSR016200@sheep.berlios.de> Author: jackburton Date: 2007-03-01 15:53:52 +0100 (Thu, 01 Mar 2007) New Revision: 20286 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20286&view=rev Modified: haiku/trunk/src/tests/kits/interface/picture/PictureTest.cpp Log: Archiving the picture now works Modified: haiku/trunk/src/tests/kits/interface/picture/PictureTest.cpp =================================================================== --- haiku/trunk/src/tests/kits/interface/picture/PictureTest.cpp 2007-03-01 14:47:10 UTC (rev 20285) +++ haiku/trunk/src/tests/kits/interface/picture/PictureTest.cpp 2007-03-01 14:53:52 UTC (rev 20286) @@ -133,7 +133,7 @@ } BMessage message2; - //fPicture->Archive(&message2); + fPicture->Archive(&message2); message2.PrintToStream(); } From jackburton at mail.berlios.de Thu Mar 1 15:57:36 2007 From: jackburton at mail.berlios.de (jackburton at BerliOS) Date: Thu, 1 Mar 2007 15:57:36 +0100 Subject: [Haiku-commits] r20287 - haiku/trunk/src/kits/interface Message-ID: <200703011457.l21EvaGD016377@sheep.berlios.de> Author: jackburton Date: 2007-03-01 15:57:36 +0100 (Thu, 01 Mar 2007) New Revision: 20287 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20287&view=rev Modified: haiku/trunk/src/kits/interface/Picture.cpp Log: Moved some functions around, some minor cleanups... Modified: haiku/trunk/src/kits/interface/Picture.cpp =================================================================== --- haiku/trunk/src/kits/interface/Picture.cpp 2007-03-01 14:53:52 UTC (rev 20286) +++ haiku/trunk/src/kits/interface/Picture.cpp 2007-03-01 14:57:36 UTC (rev 20287) @@ -22,6 +22,7 @@ #include #include +#include struct _BPictureExtent_ { _BPictureExtent_(const int32 &size = 0); @@ -115,23 +116,22 @@ { init_data(); - int32 version, size; - int8 endian; - const void *data; - + int32 version; if (archive->FindInt32("_ver", &version) != B_OK) version = 0; + int8 endian; if (archive->FindInt8("_endian", &endian) != B_OK) endian = 0; + const void *data; + int32 size; if (archive->FindData("_data", B_RAW_TYPE, &data, (ssize_t*)&size) != B_OK) return; // Load sub pictures BMessage picMsg; int32 i = 0; - while (archive->FindMessage("piclib", i++, &picMsg) == B_OK) { BPicture *pic = new BPicture(&picMsg); extent->AddPicture(pic); @@ -144,25 +144,8 @@ // swap_data(extent->fNewData, extent->fNewSize); - if (extent->Size() > 0) { - BPrivate::AppServerLink link; - - link.StartMessage(AS_CREATE_PICTURE); - link.Attach(extent->CountPictures()); - - for (int32 i = 0; i < extent->CountPictures(); i++) { - BPicture *picture = extent->PictureAt(i); - if (picture != NULL) - link.Attach(picture->token); - } - link.Attach(extent->Size()); - link.Attach(extent->Data(), extent->Size()); - - status_t status = B_ERROR; - if (link.FlushWithReply(status) == B_OK - && status == B_OK) - link.Read(&token); - } + if (extent->Size() > 0) + assert_server_copy(); } // Do we just free the data now? @@ -181,6 +164,23 @@ } +BPicture::BPicture(const void *data, int32 size) +{ + init_data(); + import_old_data(data, size); +} + + +void +BPicture::init_data() +{ + token = -1; + usurped = NULL; + + extent = new (nothrow) _BPictureExtent_; +} + + BPicture::~BPicture() { if (token != -1) { @@ -232,8 +232,8 @@ extent->PictureAt(i)->Archive(&picMsg, deep); err = archive->AddMessage("piclib", &picMsg); - if (err != B_OK) - break; + if (err != B_OK) + break; } return err; @@ -339,24 +339,10 @@ // swap_data(extent->fNewData, extent->fNewSize); - BPrivate::AppServerLink link; + if (!assert_server_copy()) + return B_ERROR; - link.StartMessage(AS_CREATE_PICTURE); - link.Attach(extent->CountPictures()); - - for (int32 i = 0; i < extent->CountPictures(); i++) { - BPicture *picture = extent->PictureAt(i); - if (picture) - link.Attach(picture->token); - } - link.Attach(extent->Size()); - link.Attach(extent->Data(), extent->Size()); - - status = B_ERROR; - if (link.FlushWithReply(status) == B_OK - && status == B_OK) - link.Read(&token); - + // Data is now kept server side, remove the local copy if (extent->Data() != NULL) extent->SetSize(0); @@ -364,32 +350,12 @@ } -void BPicture::_ReservedPicture1() {} -void BPicture::_ReservedPicture2() {} -void BPicture::_ReservedPicture3() {} - -BPicture & -BPicture::operator=(const BPicture &) -{ - return *this; -} - - void -BPicture::init_data() -{ - token = -1; - usurped = NULL; - - extent = new _BPictureExtent_; -} - - -void BPicture::import_data(const void *data, int32 size, BPicture **subs, int32 subCount) { + /* if (data == NULL || size == 0) return; @@ -407,7 +373,7 @@ status_t status = B_ERROR; if (link.FlushWithReply(status) == B_OK && status == B_OK) - link.Read(&token); + link.Read(&token);*/ } @@ -467,7 +433,7 @@ if (link.FlushWithReply(status) == B_OK && status == B_OK) { int32 count = 0; link.Read(&count); - + // Read sub picture tokens for (int32 i = 0; i < count; i++) { BPicture *pic = new BPicture; @@ -479,7 +445,7 @@ link.Read(&size); status = extent->SetSize(size); if (status == B_OK) - link.Read(const_cast(extent->Data()), extent->Size()); + link.Read(const_cast(extent->Data()), size); } return status == B_OK; @@ -515,28 +481,27 @@ extent->PictureAt(i)->assert_server_copy(); BPrivate::AppServerLink link; + link.StartMessage(AS_CREATE_PICTURE); link.Attach(extent->CountPictures()); - for (int32 i = 0; i < extent->CountPictures(); i++) - link.Attach(extent->PictureAt(i)->token); + + for (int32 i = 0; i < extent->CountPictures(); i++) { + BPicture *picture = extent->PictureAt(i); + if (picture) + link.Attach(picture->token); + } link.Attach(extent->Size()); link.Attach(extent->Data(), extent->Size()); - + status_t status = B_ERROR; - if (link.FlushWithReply(status) == B_OK && status == B_OK) + if (link.FlushWithReply(status) == B_OK + && status == B_OK) link.Read(&token); return token != -1; } -BPicture::BPicture(const void *data, int32 size) -{ - init_data(); - import_old_data(data, size); -} - - const void * BPicture::Data() const { @@ -598,6 +563,18 @@ } +void BPicture::_ReservedPicture1() {} +void BPicture::_ReservedPicture2() {} +void BPicture::_ReservedPicture3() {} + + +BPicture & +BPicture::operator=(const BPicture &) +{ + return *this; +} + + status_t do_playback(void * data, int32 size, BList* pictures, void **callBackTable, int32 tableEntries, void *user) @@ -608,7 +585,7 @@ } - +// _BPictureExtent_ _BPictureExtent_::_BPictureExtent_(const int32 &size) : fNewData(NULL), @@ -652,16 +629,27 @@ if (stream == NULL) return B_BAD_VALUE; - status_t status = B_OK; int32 size; - stream->Read(&size, sizeof(size)); + ssize_t bytesRead = stream->Read(&size, sizeof(size)); + if (bytesRead < B_OK) + return bytesRead; + if (bytesRead != (ssize_t)sizeof(size)) + return B_IO_ERROR; + + status_t status = B_OK; if (Size() != size) status = SetSize(size); - if (status == B_OK) - stream->Read(fNewData, size); + if (status < B_OK) + return status; + + bytesRead = stream->Read(fNewData, size); + if (bytesRead < B_OK) + return bytesRead; + if (bytesRead != (ssize_t)size) + return B_IO_ERROR; - return status; + return B_OK; } From jackburton at mail.berlios.de Thu Mar 1 16:45:57 2007 From: jackburton at mail.berlios.de (jackburton at BerliOS) Date: Thu, 1 Mar 2007 16:45:57 +0100 Subject: [Haiku-commits] r20288 - haiku/trunk/src/kits/interface Message-ID: <200703011545.l21FjvhQ025172@sheep.berlios.de> Author: jackburton Date: 2007-03-01 16:45:57 +0100 (Thu, 01 Mar 2007) New Revision: 20288 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20288&view=rev Modified: haiku/trunk/src/kits/interface/Picture.cpp Log: Removed commented code which implemented reading and writing of old style BPicture data. If we need to support it, we can always resurrect the code from the svn history. Modified: haiku/trunk/src/kits/interface/Picture.cpp =================================================================== --- haiku/trunk/src/kits/interface/Picture.cpp 2007-03-01 14:57:36 UTC (rev 20287) +++ haiku/trunk/src/kits/interface/Picture.cpp 2007-03-01 15:45:57 UTC (rev 20288) @@ -42,13 +42,11 @@ { return static_cast(fPictures.ItemAt(index)); } int32 CountPictures() const { return fPictures.CountItems(); } - BList &Pictures() { return fPictures; } + BList *Pictures() { return &fPictures; } private: void *fNewData; int32 fNewSize; - void *fOldStyleData; - int32 fOldStyleSize; BList fPictures; // In R5 this is a BArray which is completely inline. }; @@ -98,13 +96,7 @@ BPicture *picture = new BPicture(*otherPicture.extent->PictureAt(i)); extent->AddPicture(picture); } - } /*else if (otherPicture.extent->fOldStyleData != NULL) { - extent->fOldStyleSize = otherPicture.extent->fOldStyleSize; - extent->fOldStyleData = malloc(extent->fOldStyleSize); - memcpy(extent->fOldStyleData, otherPicture.extent->fOldStyleData, extent->fOldStyleSize); - - // In old data the sub pictures are inside the data - }*/ + } } @@ -137,9 +129,10 @@ extent->AddPicture(pic); } - if (version == 0) - import_old_data(data, size); - else if (version == 1) { + if (version == 0) { + // TODO: For now. We'll see if it's worth to support old style data + debugger("old style BPicture data is not supported"); + } else if (version == 1) { extent->ImportData(data, size); // swap_data(extent->fNewData, extent->fNewSize); @@ -152,12 +145,6 @@ if (extent->Size() > 0) extent->SetSize(0); - /*if (extent->fOldStyleData) { - free(extent->fOldStyleData); - extent->fOldStyleData = NULL; - extent->fOldStyleSize = 0; - }*/ - // What with the sub pictures? for (i = extent->CountPictures() - 1; i >= 0; i--) extent->DeletePicture(i); @@ -167,7 +154,8 @@ BPicture::BPicture(const void *data, int32 size) { init_data(); - import_old_data(data, size); + // TODO: For now. We'll see if it's worth to support old style data + debugger("old style BPicture data is not supported"); } @@ -253,9 +241,8 @@ if (!assert_local_copy()) return B_ERROR; - BList &pictures = extent->Pictures(); - return do_playback(const_cast(extent->Data()), extent->Size(), &pictures, - callBackTable, tableEntries, user); + return do_playback(const_cast(extent->Data()), extent->Size(), + extent->Pictures(), callBackTable, tableEntries, user); } @@ -380,31 +367,7 @@ void BPicture::import_old_data(const void *data, int32 size) { - // TODO: do we need to support old data, what is old data? - /*if (data == NULL) - return; - - if (size == 0) - return; - - convert_old_to_new(data, size, &extent->fNewData, &extent->fNewSize); - - BPrivate::BAppServerLink link; - link.StartMessage(AS_CREATE_PICTURE); - link.Attach(0L); - link.Attach(extent->fNewSize); - link.Attach(extent->fNewData,extent->fNewSize); - link.FlushWithReply(&code); - if (code == B_OK) - link.Read(&token) - - // Do we free all data now? - free(extent->fNewData); - extent->fNewData = 0; - extent->fNewSize = 0; - free(extent->fOldStyleData); - extent->fOldStyleData = 0; - extent->fOldStyleSize = 0;*/ + // TODO: We don't support old data for now } @@ -455,16 +418,9 @@ bool BPicture::assert_old_local_copy() { - //if (extent->fOldStyleData != NULL) - // return true; + // TODO: We don't support old data for now - if (!assert_local_copy()) - return false; - -// convert_new_to_old(extent->fNewData, extent->fNewSize, extent->fOldStyleData, -// extent->fOldStyleSize); - - return true; + return false; } @@ -505,10 +461,8 @@ const void * BPicture::Data() const { - if (extent->Data() == NULL) { + if (extent->Data() == NULL) const_cast(this)->assert_local_copy(); - //convert_new_to_old(void *, long, void **, long *); - } return extent->Data(); } @@ -517,10 +471,8 @@ int32 BPicture::DataSize() const { - if (extent->Data() == NULL) { + if (extent->Data() == NULL) const_cast(this)->assert_local_copy(); - //convert_new_to_old(void *, long, void **, long *); - } return extent->Size(); } @@ -536,13 +488,7 @@ link.Attach(token); link.Flush(); } -/* - if (extent->fOldStyleData != NULL) { - free(extent->fOldStyleData); - extent->fOldStyleData = NULL; - extent->fOldStyleSize = 0; - } -*/ + delete extent; // Reinitializes the BPicture @@ -589,9 +535,7 @@ _BPictureExtent_::_BPictureExtent_(const int32 &size) : fNewData(NULL), - fNewSize(0), - fOldStyleData(NULL), - fOldStyleSize(0) + fNewSize(0) { SetSize(size); } @@ -600,7 +544,6 @@ _BPictureExtent_::~_BPictureExtent_() { free(fNewData); - free(fOldStyleData); for (int32 i = 0; i < fPictures.CountItems(); i++) delete static_cast(fPictures.ItemAtFast(i)); } From bonefish at cs.tu-berlin.de Thu Mar 1 17:42:28 2007 From: bonefish at cs.tu-berlin.de (Ingo Weinhold) Date: Thu, 01 Mar 2007 17:42:28 +0100 Subject: [Haiku-commits] r20256 - in haiku/trunk: headers/os/drivers src/system/kernel/fs In-Reply-To: <6957990195-BeMail@zon> References: <6957990195-BeMail@zon> Message-ID: <20070301174228.713.2@cs.tu-berlin.de> On 2007-03-01 at 10:25:10 [+0100], Axel D?rfler wrote: > Marcus Overhagen wrote: > > bonefish at BerliOS wrote: > > > +extern "C" status_t > > > +is_vnode_removed(mount_id mountID, vnode_id vnodeID) > > > > > + if (vnode) > > > + result = vnode->remove ? 1 : 0; > > > + else > > > + result = B_BAD_VALUE; > > That mix of bool and status_t is really crude, especially because > > false == B_OK. > > Wouldn't it be enough to return a bool only, with B_BAD_VALUE = true > > ? > > > > or make it > > > > status_t is_vnode_removed(mount_id mountID, vnode_id vnodeID, bool * > > _removed) > > Indeed, there is little reason to keep that thing BeOS compatible. I find it quite consistent with other cases where an alternative error code/value is returned (e.g. create_{sem,port}(), ssize_t for reads/writes, FDs) -- a value < 0 is an error code, >= 0 means an actual value of the respective domain. B_OK is not a valid result (which is why I find the check < B_OK not correct in those cases, BTW). But anyway, I'll changed the function according to Marcus' second proposal, renaming it get_vnode_removed() then, though. CU, Ingo From korli at mail.berlios.de Thu Mar 1 19:12:01 2007 From: korli at mail.berlios.de (korli at BerliOS) Date: Thu, 1 Mar 2007 19:12:01 +0100 Subject: [Haiku-commits] r20289 - haiku/trunk/src/kits/interface Message-ID: <200703011812.l21IC1OD012356@sheep.berlios.de> Author: korli Date: 2007-03-01 19:12:01 +0100 (Thu, 01 Mar 2007) New Revision: 20289 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20289&view=rev Modified: haiku/trunk/src/kits/interface/Picture.cpp Log: fix gcc4 build Modified: haiku/trunk/src/kits/interface/Picture.cpp =================================================================== --- haiku/trunk/src/kits/interface/Picture.cpp 2007-03-01 15:45:57 UTC (rev 20288) +++ haiku/trunk/src/kits/interface/Picture.cpp 2007-03-01 18:12:01 UTC (rev 20289) @@ -165,7 +165,7 @@ token = -1; usurped = NULL; - extent = new (nothrow) _BPictureExtent_; + extent = new (std::nothrow) _BPictureExtent_; } From marcusoverhagen at mail.berlios.de Thu Mar 1 19:37:55 2007 From: marcusoverhagen at mail.berlios.de (marcusoverhagen at BerliOS) Date: Thu, 1 Mar 2007 19:37:55 +0100 Subject: [Haiku-commits] r20290 - in haiku/trunk: headers/private/interface src/kits/interface Message-ID: <200703011837.l21Ibt1u006408@sheep.berlios.de> Author: marcusoverhagen Date: 2007-03-01 19:37:55 +0100 (Thu, 01 Mar 2007) New Revision: 20290 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20290&view=rev Modified: haiku/trunk/headers/private/interface/PicturePlayer.h haiku/trunk/src/kits/interface/Picture.cpp Log: removed unnecessary use of const_cast<> and (global) do_playback() function Modified: haiku/trunk/headers/private/interface/PicturePlayer.h =================================================================== --- haiku/trunk/headers/private/interface/PicturePlayer.h 2007-03-01 18:12:01 UTC (rev 20289) +++ haiku/trunk/headers/private/interface/PicturePlayer.h 2007-03-01 18:37:55 UTC (rev 20290) @@ -85,8 +85,5 @@ int32 fSize; BList *fPictures; }; -//------------------------------------------------------------------------------ -status_t do_playback(void *, long, BList *, void **, long, void *); - #endif // _TPICTURE_H Modified: haiku/trunk/src/kits/interface/Picture.cpp =================================================================== --- haiku/trunk/src/kits/interface/Picture.cpp 2007-03-01 18:12:01 UTC (rev 20289) +++ haiku/trunk/src/kits/interface/Picture.cpp 2007-03-01 18:37:55 UTC (rev 20290) @@ -241,8 +241,9 @@ if (!assert_local_copy()) return B_ERROR; - return do_playback(const_cast(extent->Data()), extent->Size(), - extent->Pictures(), callBackTable, tableEntries, user); + PicturePlayer player(extent->Data(), extent->Size(), extent->Pictures()); + + return player.Play(callBackTable, tableEntries, user); } @@ -521,16 +522,6 @@ } -status_t -do_playback(void * data, int32 size, BList* pictures, - void **callBackTable, int32 tableEntries, void *user) -{ - PicturePlayer player(data, size, pictures); - - return player.Play(callBackTable, tableEntries, user); -} - - // _BPictureExtent_ _BPictureExtent_::_BPictureExtent_(const int32 &size) : From marcusoverhagen at mail.berlios.de Thu Mar 1 20:14:19 2007 From: marcusoverhagen at mail.berlios.de (marcusoverhagen at BerliOS) Date: Thu, 1 Mar 2007 20:14:19 +0100 Subject: [Haiku-commits] r20291 - haiku/trunk/src/servers/app Message-ID: <200703011914.l21JEJoU012500@sheep.berlios.de> Author: marcusoverhagen Date: 2007-03-01 20:14:19 +0100 (Thu, 01 Mar 2007) New Revision: 20291 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20291&view=rev Modified: haiku/trunk/src/servers/app/ServerPicture.cpp Log: removed unnecessary use of const_cast Modified: haiku/trunk/src/servers/app/ServerPicture.cpp =================================================================== --- haiku/trunk/src/servers/app/ServerPicture.cpp 2007-03-01 18:37:55 UTC (rev 20290) +++ haiku/trunk/src/servers/app/ServerPicture.cpp 2007-03-01 19:14:19 UTC (rev 20291) @@ -659,7 +659,7 @@ void ServerPicture::Play(ViewLayer *view) { - PicturePlayer player(const_cast(fData.Buffer()), fData.BufferLength(), NULL); + PicturePlayer player(fData.Buffer(), fData.BufferLength(), NULL); player.Play(const_cast(tableEntries), sizeof(tableEntries) / sizeof(void *), view); } From marcusoverhagen at mail.berlios.de Fri Mar 2 00:17:43 2007 From: marcusoverhagen at mail.berlios.de (marcusoverhagen at BerliOS) Date: Fri, 2 Mar 2007 00:17:43 +0100 Subject: [Haiku-commits] r20292 - in haiku/trunk: headers/os/interface headers/private/interface src/kits/interface src/servers/app Message-ID: <200703012317.l21NHh3k006324@sheep.berlios.de> Author: marcusoverhagen Date: 2007-03-02 00:17:40 +0100 (Fri, 02 Mar 2007) New Revision: 20292 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20292&view=rev Modified: haiku/trunk/headers/os/interface/Shape.h haiku/trunk/headers/private/interface/PicturePlayer.h haiku/trunk/src/kits/interface/PictureDataWriter.cpp haiku/trunk/src/kits/interface/PicturePlayer.cpp haiku/trunk/src/kits/interface/Shape.cpp haiku/trunk/src/servers/app/ServerPicture.cpp haiku/trunk/src/servers/app/ViewLayer.cpp haiku/trunk/src/servers/app/ViewLayer.h Log: Added "const" to many parameters. Removed most data allocations/copying from PicturePlayer, ServerPicture now has to do this when converting coordinates. Added additional functions to ViewLayer to copy&convert multiple BPoint, BRect, BRegion to Screen coordinates, those should be further optimized. Removed some function call overhead. Note: some functions of PicturePlayer don't appear to be implented by PictureDataWriter, Modified: haiku/trunk/headers/os/interface/Shape.h =================================================================== --- haiku/trunk/headers/os/interface/Shape.h 2007-03-01 19:14:19 UTC (rev 20291) +++ haiku/trunk/headers/os/interface/Shape.h 2007-03-01 23:17:40 UTC (rev 20292) @@ -81,7 +81,7 @@ friend class BPrivate::ServerLink; void GetData(int32 *opCount, int32 *ptCount, uint32 **opList, BPoint **ptList); - void SetData(int32 opCount, int32 ptCount, uint32 *opList, BPoint *ptList); + void SetData(int32 opCount, int32 ptCount, const uint32 *opList, const BPoint *ptList); void InitData(); void AllocatePts(int32 count); void AllocateOps(int32 count); Modified: haiku/trunk/headers/private/interface/PicturePlayer.h =================================================================== --- haiku/trunk/headers/private/interface/PicturePlayer.h 2007-03-01 19:14:19 UTC (rev 20291) +++ haiku/trunk/headers/private/interface/PicturePlayer.h 2007-03-01 23:17:40 UTC (rev 20292) @@ -1,13 +1,14 @@ /* - * Copyright 2001-2006, Haiku Inc. + * Copyright 2001-2007, Haiku Inc. * Distributed under the terms of the MIT License. * * Authors: * Marc Flerackers (mflerackers at androme.be) * Stefano Ceccherini (burton666 at libero.it) + * Marcus Overhagen (marcus at overhagen.de) */ -/** PicturePlayer is used to create and play picture data. */ +/** PicturePlayer is used to play picture data. */ #ifndef _TPICTURE_H #define _TPICTURE_H @@ -22,51 +23,9 @@ class PicturePlayer { public: PicturePlayer(); - PicturePlayer(const void *data, int32 size, BList *pictures); + PicturePlayer(const void *data, size_t size, BList *pictures); virtual ~PicturePlayer(); - int16 GetOp(); - int8 GetInt8(); - int16 GetInt16(); - int32 GetInt32(); - int64 GetInt64(); - float GetFloat(); - BPoint GetCoord(); - BRect GetRect(); - rgb_color GetColor(); - //void GetString(char *); - - void *GetData(int32); - void GetData(void *data, int32 size); - - void AddInt8(int8); - void AddInt16(int16); - void AddInt32(int32); - void AddInt64(int64); - void AddFloat(float); - void AddCoord(BPoint); - void AddRect(BRect); - void AddColor(rgb_color); - void AddString(char *); - - void AddData(void *data, int32 size); - - // SwapOp(); - // SwapInt8(); - // SwapInt16(); - // SwapInt32(); - // SwapInt64(); - // SwapFloat(); - // SwapCoord(); - // SwapRect(); - // SwapIRect(); - // SwapColor(); - // SwapString(); - - // Swap(); - - // CheckPattern(); - void BeginOp(int32); void EndOp(); @@ -78,11 +37,10 @@ status_t Play(void **callBackTable, int32 tableEntries, void *userData); - status_t Rewind(); private: - BMemoryIO fData; - int32 fSize; + const void *fData; + size_t fSize; BList *fPictures; }; Modified: haiku/trunk/src/kits/interface/PictureDataWriter.cpp =================================================================== --- haiku/trunk/src/kits/interface/PictureDataWriter.cpp 2007-03-01 19:14:19 UTC (rev 20291) +++ haiku/trunk/src/kits/interface/PictureDataWriter.cpp 2007-03-01 23:17:40 UTC (rev 20292) @@ -1,9 +1,9 @@ /* - * Copyright 2006, Haiku Inc. - * Distributed under the terms of the MIT License. - * - * Authors: - * Stefano Ceccherini (burton666 at libero.it) + * Copyright 2006, Haiku Inc. + * Distributed under the terms of the MIT License. + * + * Authors: + * Stefano Ceccherini (burton666 at libero.it) */ #include @@ -173,10 +173,11 @@ EndOp(); BeginOp(B_PIC_DRAW_STRING); - Write(length); - WriteData(string, length); Write(escapement.space); Write(escapement.nonspace); + //WriteData(string, length + 1); // TODO: is string 0 terminated? why is length given? + WriteData(string, length); + Write(0); EndOp(); return B_OK; @@ -189,8 +190,8 @@ { BeginOp(fill ? B_PIC_FILL_SHAPE : B_PIC_STROKE_SHAPE); Write(opCount); + Write(ptCount); WriteData(opList, opCount * sizeof(uint32)); - Write(ptCount); WriteData(ptList, ptCount * sizeof(BPoint)); EndOp(); @@ -203,6 +204,8 @@ const int32 &bytesPerRow, const int32 &colorSpace, const int32 &flags, const void *data, const int32 &length) { + if (length != height * bytesPerRow) + debugger("PictureDataWriter::WriteDrawBitmap: invalid length"); BeginOp(B_PIC_DRAW_PIXELS); Write(srcRect); Write(dstRect); @@ -211,7 +214,6 @@ Write(bytesPerRow); Write(colorSpace); Write(flags); - Write(length); WriteData(data, length); EndOp(); return B_OK; Modified: haiku/trunk/src/kits/interface/PicturePlayer.cpp =================================================================== --- haiku/trunk/src/kits/interface/PicturePlayer.cpp 2007-03-01 19:14:19 UTC (rev 20291) +++ haiku/trunk/src/kits/interface/PicturePlayer.cpp 2007-03-01 23:17:40 UTC (rev 20292) @@ -1,10 +1,11 @@ /* - * Copyright 2001-2006, Haiku Inc. + * Copyright 2001-2007, Haiku Inc. * Distributed under the terms of the MIT License. * * Authors: * Marc Flerackers (mflerackers at androme.be) * Stefano Ceccherini (burton666 at libero.it) + * Marcus Overhagen (marcus at overhagen.de) */ /** PicturePlayer is used to create and play picture data. */ @@ -21,12 +22,12 @@ typedef void (*fnc_BPointBPoint)(void*, BPoint, BPoint); typedef void (*fnc_BRect)(void*, BRect); typedef void (*fnc_BRectBPoint)(void*, BRect, BPoint); -typedef void (*fnc_PBPoint)(void*, BPoint*); +typedef void (*fnc_PBPoint)(void*, const BPoint*); typedef void (*fnc_i)(void*, int32); -typedef void (*fnc_iPBPointb)(void*, int32, BPoint*, bool); -typedef void (*fnc_iPBPoint)(void*, int32, BPoint*); -typedef void (*fnc_Pc)(void*, char*); -typedef void (*fnc_Pcff)(void*, char*, float, float); +typedef void (*fnc_iPBPointb)(void*, int32, const BPoint*, bool); +typedef void (*fnc_iPBPoint)(void*, int32, const BPoint*); +typedef void (*fnc_Pc)(void*, const char*); +typedef void (*fnc_Pcff)(void*, const char*, float, float); typedef void (*fnc_BPointBPointff)(void*, BPoint, BPoint, float, float); typedef void (*fnc_s)(void*, int16); typedef void (*fnc_ssf)(void*, int16, int16, float); @@ -34,14 +35,15 @@ typedef void (*fnc_Color)(void*, rgb_color); typedef void (*fnc_Pattern)(void*, pattern); typedef void (*fnc_ss)(void *, int16, int16); -typedef void (*fnc_PBRecti)(void*, BRect*, int32); +typedef void (*fnc_PBRecti)(void*, const BRect*, int32); typedef void (*fnc_DrawPixels)(void *, BRect, BRect, int32, int32, int32, - int32, int32, void*); + int32, int32, const void *); typedef void (*fnc_BShape)(void*, BShape*); -PicturePlayer::PicturePlayer(const void *data, int32 size, BList *pictures) - : fData(data, size), +PicturePlayer::PicturePlayer(const void *data, size_t size, BList *pictures) + : fData(data), + fSize(size), fPictures(pictures) { } @@ -52,290 +54,177 @@ } -int16 -PicturePlayer::GetOp() -{ - int16 data; - - fData.Read(&data, sizeof(int16)); - - return data; -} - - -int8 -PicturePlayer::GetInt8() -{ - int8 data; - - fData.Read(&data, sizeof(int8)); - - return data; -} - - -int16 -PicturePlayer::GetInt16() -{ - int16 data; - - fData.Read(&data, sizeof(int16)); - - return data; -} - - -int32 -PicturePlayer::GetInt32() -{ - int32 data; - - fData.Read(&data, sizeof(int32)); - - return data; -} - - -float -PicturePlayer::GetFloat() -{ - float data; - - fData.Read(&data, sizeof(float)); - - return data; -} - - -BPoint -PicturePlayer::GetCoord() -{ - BPoint data; - - fData.Read(&data, sizeof(BPoint)); - - return data; -} - - -BRect -PicturePlayer::GetRect() -{ - BRect data; - - fData.Read(&data, sizeof(BRect)); - - return data; -} - - -rgb_color -PicturePlayer::GetColor() -{ - rgb_color data; - - fData.Read(&data, sizeof(rgb_color)); - - return data; -} - - -void -PicturePlayer::GetData(void *data, int32 size) -{ - fData.Read(data, size); -} - - status_t PicturePlayer::Play(void **callBackTable, int32 tableEntries, void *userData) { // TODO: we should probably check if the functions in the table are not NULL // before calling them. - // lenght of the stream - size_t length = fData.Seek(0, SEEK_END); - fData.Seek(0, SEEK_SET); + const char *data = reinterpret_cast(fData); + size_t pos = 0; - while (fData.Position() < length) { - int16 op = GetOp(); - int32 size = GetInt32(); - off_t pos = fData.Position(); + while ((pos + 6) <= fSize) { + int16 op = *reinterpret_cast(data); + int32 size = *reinterpret_cast(data + 2); + pos += 6; + data += 6; + if (pos + size > fSize) + debugger("PicturePlayer::Play: buffer overrun\n"); + switch (op) { case B_PIC_MOVE_PEN_BY: { - BPoint where = GetCoord(); - ((fnc_BPoint)callBackTable[1])(userData, where); + ((fnc_BPoint)callBackTable[1])(userData, + *reinterpret_cast(data)); /* where */ break; } case B_PIC_STROKE_LINE: { - BPoint start = GetCoord(); - BPoint end = GetCoord(); - ((fnc_BPointBPoint)callBackTable[2])(userData, start, end); + ((fnc_BPointBPoint)callBackTable[2])(userData, + *reinterpret_cast(data), /* start */ + *reinterpret_cast(data + sizeof(BPoint))); /* end */ break; } case B_PIC_STROKE_RECT: { - BRect rect = GetRect(); - ((fnc_BRect)callBackTable[3])(userData, rect); + ((fnc_BRect)callBackTable[3])(userData, + *reinterpret_cast(data)); /* rect */ break; } case B_PIC_FILL_RECT: { - BRect rect = GetRect(); - ((fnc_BRect)callBackTable[4])(userData, rect); + ((fnc_BRect)callBackTable[4])(userData, + *reinterpret_cast(data)); /* rect */ break; } case B_PIC_STROKE_ROUND_RECT: { - BRect rect = GetRect(); - BPoint radii = GetCoord(); - ((fnc_BRectBPoint)callBackTable[5])(userData, rect, radii); + ((fnc_BRectBPoint)callBackTable[5])(userData, + *reinterpret_cast(data), /* rect */ + *reinterpret_cast(data + sizeof(BRect))); /* radii */ break; } case B_PIC_FILL_ROUND_RECT: { - BRect rect = GetRect(); - BPoint radii = GetCoord(); - ((fnc_BRectBPoint)callBackTable[6])(userData, rect, radii); + ((fnc_BRectBPoint)callBackTable[6])(userData, + *reinterpret_cast(data), /* rect */ + *reinterpret_cast(data + sizeof(BRect))); /* radii */ break; } case B_PIC_STROKE_BEZIER: { - BPoint control[4]; - GetData(control, sizeof(control)); - ((fnc_PBPoint)callBackTable[7])(userData, control); + ((fnc_PBPoint)callBackTable[7])(userData, + reinterpret_cast(data)); break; } case B_PIC_FILL_BEZIER: { - BPoint control[4]; - GetData(control, sizeof(control)); - ((fnc_PBPoint)callBackTable[8])(userData, control); + ((fnc_PBPoint)callBackTable[8])(userData, + reinterpret_cast(data)); break; } case B_PIC_STROKE_ARC: { - BPoint center = GetCoord(); - BPoint radii = GetCoord(); - float startTheta = GetFloat(); - float arcTheta = GetFloat(); - ((fnc_BPointBPointff)callBackTable[9])(userData, center, radii, - startTheta, arcTheta); + ((fnc_BPointBPointff)callBackTable[9])(userData, + *reinterpret_cast(data), /* center */ + *reinterpret_cast(data + sizeof(BPoint)), /* radii */ + *reinterpret_cast(data + 2 * sizeof(BPoint)), /* startTheta */ + *reinterpret_cast(data + 2 * sizeof(BPoint) + sizeof(float))); /* arcTheta */ break; } case B_PIC_FILL_ARC: { - BPoint center = GetCoord(); - BPoint radii = GetCoord(); - float startTheta = GetFloat(); - float arcTheta = GetFloat(); - ((fnc_BPointBPointff)callBackTable[10])(userData, center, radii, - startTheta, arcTheta); + ((fnc_BPointBPointff)callBackTable[10])(userData, + *reinterpret_cast(data), /* center */ + *reinterpret_cast(data + sizeof(BPoint)), /* radii */ + *reinterpret_cast(data + 2 * sizeof(BPoint)), /* startTheta */ + *reinterpret_cast(data + 2 * sizeof(BPoint) + sizeof(float))); /* arcTheta */ break; } case B_PIC_STROKE_ELLIPSE: { - BRect rect = GetRect(); - BPoint radii((rect.Width() + 1) / 2.0f, (rect.Height() + 1) / 2.0f); - BPoint center = rect.LeftTop() + radii; + const BRect *rect = reinterpret_cast(data); + BPoint radii((rect->Width() + 1) / 2.0f, (rect->Height() + 1) / 2.0f); + BPoint center = rect->LeftTop() + radii; ((fnc_BPointBPoint)callBackTable[11])(userData, center, radii); break; } case B_PIC_FILL_ELLIPSE: { - BRect rect = GetRect(); - BPoint radii((rect.Width() + 1) / 2.0f, (rect.Height() + 1) / 2.0f); - BPoint center = rect.LeftTop() + radii; + const BRect *rect = reinterpret_cast(data); + BPoint radii((rect->Width() + 1) / 2.0f, (rect->Height() + 1) / 2.0f); + BPoint center = rect->LeftTop() + radii; ((fnc_BPointBPoint)callBackTable[12])(userData, center, radii); break; } case B_PIC_STROKE_POLYGON: { - int32 numPoints = GetInt32(); - BPoint *points = new BPoint[numPoints]; - GetData(points, numPoints * sizeof(BPoint)); - bool isClosed = (bool)GetInt8(); - ((fnc_iPBPointb)callBackTable[13])(userData, numPoints, points, isClosed); - delete[] points; + int32 numPoints = *reinterpret_cast(data); + ((fnc_iPBPointb)callBackTable[13])(userData, + numPoints, + reinterpret_cast(data + sizeof(int32)), /* points */ + *reinterpret_cast(data + sizeof(int32) + numPoints * sizeof(BPoint))); /* is-closed */ break; } case B_PIC_FILL_POLYGON: { - int32 numPoints = GetInt32(); - BPoint *points = new BPoint[numPoints]; - GetData(points, numPoints * sizeof(BPoint)); - ((fnc_iPBPoint)callBackTable[14])(userData, numPoints, points); - delete[] points; + ((fnc_iPBPoint)callBackTable[14])(userData, + *reinterpret_cast(data), /* numPoints */ + reinterpret_cast(data + sizeof(int32))); /* points */ break; } case B_PIC_STROKE_SHAPE: case B_PIC_FILL_SHAPE: { - int32 opCount = GetInt32(); - uint32 *opList = new uint32[opCount]; - GetData(opList, opCount * sizeof(uint32)); - - int32 ptCount = GetInt32(); - BPoint *ptList = new BPoint[ptCount]; - GetData(ptList, ptCount * sizeof(BPoint)); + int32 opCount = *reinterpret_cast(data); + int32 ptCount = *reinterpret_cast(data + sizeof(int32)); + const uint32 *opList = reinterpret_cast(data + 2 * sizeof(int32)); + const BPoint *ptList = reinterpret_cast(data + 2 * sizeof(int32) + opCount * sizeof(uint32)); - BShape shape; + // TODO: remove BShape data copying + BShape shape; shape.SetData(opCount, ptCount, opList, ptList); const int32 tableIndex = (op == B_PIC_STROKE_SHAPE) ? 15 : 16; ((fnc_BShape)callBackTable[tableIndex])(userData, &shape); - - delete[] opList; - delete[] ptList; - break; } case B_PIC_DRAW_STRING: { - int32 len = GetInt32(); - char *string = new char[len + 1]; - GetData(string, len); - string[len] = '\0'; - float deltax = GetFloat(); - float deltay = GetFloat(); - ((fnc_Pcff)callBackTable[17])(userData, string, deltax, deltay); - delete[] string; + ((fnc_Pcff)callBackTable[17])(userData, + reinterpret_cast(data + 2 * sizeof(float)), /* string */ + *reinterpret_cast(data), /* escapement.space */ + *reinterpret_cast(data + sizeof(float))); /* escapement.nonspace */ break; } case B_PIC_DRAW_PIXELS: { - BRect src = GetRect(); - BRect dest = GetRect(); - int32 width = GetInt32(); - int32 height = GetInt32(); - int32 bytesPerRow = GetInt32(); - int32 pixelFormat = GetInt32(); - int32 flags = GetInt32(); - int32 length = GetInt32(); - char *data = new char[length]; - GetData(data, length); - ((fnc_DrawPixels)callBackTable[18])(userData, src, dest, - width, height, bytesPerRow, pixelFormat, flags, data); - delete[] data; + ((fnc_DrawPixels)callBackTable[18])(userData, + *reinterpret_cast(data), /* src */ + *reinterpret_cast(data + 1 * sizeof(BRect)), /* dst */ + *reinterpret_cast(data + 2 * sizeof(BRect)), /* width */ + *reinterpret_cast(data + 2 * sizeof(BRect) + 1 * sizeof(int32)), /* height */ + *reinterpret_cast(data + 2 * sizeof(BRect) + 2 * sizeof(int32)), /* bytesPerRow */ + *reinterpret_cast(data + 2 * sizeof(BRect) + 3 * sizeof(int32)), /* pixelFormat */ + *reinterpret_cast(data + 2 * sizeof(BRect) + 4 * sizeof(int32)), /* flags */ + reinterpret_cast(data + 2 * sizeof(BRect) + 5 * sizeof(int32))); /* data */ break; } @@ -386,148 +275,142 @@ case B_PIC_SET_ORIGIN: { - BPoint pt = GetCoord(); - ((fnc_BPoint)callBackTable[28])(userData, pt); + ((fnc_BPoint)callBackTable[28])(userData, + *reinterpret_cast(data)); /* origin */ break; } case B_PIC_SET_PEN_LOCATION: { - BPoint pt = GetCoord(); - ((fnc_BPoint)callBackTable[29])(userData, pt); + ((fnc_BPoint)callBackTable[29])(userData, + *reinterpret_cast(data)); /* location */ break; } case B_PIC_SET_DRAWING_MODE: { - int16 mode = GetInt16(); - ((fnc_s)callBackTable[30])(userData, mode); + ((fnc_s)callBackTable[30])(userData, + *reinterpret_cast(data)); /* mode */ break; } case B_PIC_SET_LINE_MODE: { - int16 capMode = GetInt16(); - int16 joinMode = GetInt16(); - float miterLimit = GetFloat(); - ((fnc_ssf)callBackTable[31])(userData, capMode, joinMode, miterLimit); + ((fnc_ssf)callBackTable[31])(userData, + *reinterpret_cast(data), /* cap-mode */ + *reinterpret_cast(data + 1 * sizeof(int16)), /* join-mode */ + *reinterpret_cast(data + 2 * sizeof(int16))); /* miter-limit */ break; } case B_PIC_SET_PEN_SIZE: { - float size = GetFloat(); - ((fnc_f)callBackTable[32])(userData, size); + ((fnc_f)callBackTable[32])(userData, + *reinterpret_cast(data)); /* size */ break; } case B_PIC_SET_FORE_COLOR: { - rgb_color color = GetColor(); - ((fnc_Color)callBackTable[33])(userData, color); + ((fnc_Color)callBackTable[33])(userData, + *reinterpret_cast(data)); /* color */ break; } case B_PIC_SET_BACK_COLOR: { - rgb_color color = GetColor(); - ((fnc_Color)callBackTable[34])(userData, color); + ((fnc_Color)callBackTable[34])(userData, + *reinterpret_cast(data)); /* color */ break; } case B_PIC_SET_STIPLE_PATTERN: { - pattern p; - GetData(&p, sizeof(p)); - ((fnc_Pattern)callBackTable[35])(userData, p); + ((fnc_Pattern)callBackTable[35])(userData, + *reinterpret_cast(data)); /* pattern */ break; } case B_PIC_SET_SCALE: { - float scale = GetFloat(); - ((fnc_f)callBackTable[36])(userData, scale); + ((fnc_f)callBackTable[36])(userData, + *reinterpret_cast(data)); /* scale */ break; } case B_PIC_SET_FONT_FAMILY: { - int32 len = GetInt32(); - char *string = new char[len + 1]; - GetData(string, len); - string[len] = '\0'; - ((fnc_Pc)callBackTable[37])(userData, string); - delete[] string; + debugger("B_PIC_SET_FONT_FAMILY"); // TODO: is this unused? + ((fnc_Pc)callBackTable[37])(userData, + reinterpret_cast(data)); /* string */ break; } case B_PIC_SET_FONT_STYLE: { - int32 len = GetInt32(); - char *string = new char[len + 1]; - GetData(string, len); - string[len] = '\0'; - ((fnc_Pc)callBackTable[38])(userData, string); - delete[] string; + debugger("B_PIC_SET_FONT_STYLE"); // TODO: is this unused? + ((fnc_Pc)callBackTable[38])(userData, + reinterpret_cast(data)); /* string */ break; } case B_PIC_SET_FONT_SPACING: { - int32 spacing = GetInt32(); - ((fnc_i)callBackTable[39])(userData, spacing); + ((fnc_i)callBackTable[39])(userData, + *reinterpret_cast(data)); /* spacing */ break; } case B_PIC_SET_FONT_SIZE: { - float size = GetFloat(); - ((fnc_f)callBackTable[40])(userData, size); + ((fnc_f)callBackTable[40])(userData, + *reinterpret_cast(data)); /* size */ break; } case B_PIC_SET_FONT_ROTATE: { - float rotation = GetFloat(); - ((fnc_f)callBackTable[41])(userData, rotation); + ((fnc_f)callBackTable[41])(userData, + *reinterpret_cast(data)); /* rotation */ break; } case B_PIC_SET_FONT_ENCODING: { - int32 encoding = GetInt32(); - ((fnc_i)callBackTable[42])(userData, encoding); + ((fnc_i)callBackTable[42])(userData, + *reinterpret_cast(data)); /* encoding */ break; } case B_PIC_SET_FONT_FLAGS: { - int32 flags = GetInt32(); - ((fnc_i)callBackTable[43])(userData, flags); + ((fnc_i)callBackTable[43])(userData, + *reinterpret_cast(data)); /* flags */ break; } case B_PIC_SET_FONT_SHEAR: { - float shear = GetFloat(); - ((fnc_f)callBackTable[44])(userData, shear); + ((fnc_f)callBackTable[44])(userData, + *reinterpret_cast(data)); /* shear */ break; } case B_PIC_SET_FONT_FACE: { - int32 flags = GetInt32(); - ((fnc_i)callBackTable[46])(userData, flags); + ((fnc_i)callBackTable[46])(userData, + *reinterpret_cast(data)); /* flags */ break; } + // TODO: Looks like R5 function table only exports 47 functions... // I added this here as a temporary workaround, because there seems to be // no room for this op, although it's obviously implemented in some way... case B_PIC_SET_BLENDING_MODE: { - int16 alphaSrcMode = GetInt16(); - int16 alphaFncMode = GetInt16(); - ((fnc_ss)callBackTable[47])(userData, alphaSrcMode, alphaFncMode); + ((fnc_ss)callBackTable[47])(userData, + *reinterpret_cast(data), /* alphaSrcMode */ + *reinterpret_cast(data + sizeof(int16))); /* alphaFncMode */ break; } @@ -535,11 +418,8 @@ break; } - // If we didn't read enough bytes, skip them. This is not a error - // since the instructions can change over time. - // Don't do that for state change ops, they don't have a fixed size - if (op != B_PIC_ENTER_STATE_CHANGE && op != B_PIC_ENTER_FONT_STATE && fData.Position() - pos < size) - fData.Seek(size - (fData.Position() - pos), SEEK_CUR); + pos += size; + data += size; // TODO: what if too much was read, should we return B_ERROR? } Modified: haiku/trunk/src/kits/interface/Shape.cpp =================================================================== --- haiku/trunk/src/kits/interface/Shape.cpp 2007-03-01 19:14:19 UTC (rev 20291) +++ haiku/trunk/src/kits/interface/Shape.cpp 2007-03-01 23:17:40 UTC (rev 20292) @@ -1,11 +1,12 @@ /* - * Copyright (c) 2001-2006, Haiku, Inc. + * Copyright (c) 2001-2007, Haiku, Inc. * Distributed under the terms of the MIT license. * * Authors: * Marc Flerackers (mflerackers at androme.be) * Stephan A?mus * Michael Lotz + * Marcus Overhagen */ /*! BShape encapsulates a Postscript-style "path" */ @@ -410,8 +411,8 @@ void -BShape::SetData(int32 opCount, int32 ptCount, uint32 *opList, - BPoint *ptList) +BShape::SetData(int32 opCount, int32 ptCount, const uint32 *opList, + const BPoint *ptList) { Clear(); Modified: haiku/trunk/src/servers/app/ServerPicture.cpp =================================================================== --- haiku/trunk/src/servers/app/ServerPicture.cpp 2007-03-01 19:14:19 UTC (rev 20291) +++ haiku/trunk/src/servers/app/ServerPicture.cpp 2007-03-01 23:17:40 UTC (rev 20292) @@ -1,10 +1,11 @@ /* - * Copyright 2001-2006, Haiku. + * Copyright 2001-2007, Haiku. * Distributed under the terms of the MIT License. * * Authors: * Marc Flerackers (mflerackers at androme.be) * Stefano Ceccherini (burton666 at libero.it) + * Marcus Overhagen */ @@ -34,6 +35,8 @@ ShapePainter(); virtual ~ShapePainter(); + status_t Iterate(const BShape *shape); + virtual status_t IterateMoveTo(BPoint *point); virtual status_t IterateLineTo(int32 lineCount, BPoint *linePts); virtual status_t IterateBezierTo(int32 bezierCount, BPoint *bezierPts); @@ -56,6 +59,13 @@ } status_t +ShapePainter::Iterate(const BShape *shape) +{ + // this class doesn't modify the shape data + return BShapeIterator::Iterate(const_cast(shape)); +} + +status_t ShapePainter::IterateMoveTo(BPoint *point) { fOpStack.push(OP_MOVETO); @@ -178,20 +188,20 @@ static void -stroke_bezier(ViewLayer *view, BPoint *points) +stroke_bezier(ViewLayer *view, const BPoint *viewPoints) { - for (int32 i = 0; i < 4; i++) - view->ConvertToScreenForDrawing(&points[i]); + BPoint points[4]; + view->ConvertToScreenForDrawing(points, viewPoints, 4); view->Window()->GetDrawingEngine()->DrawBezier(points, view->CurrentState(), false); } static void -fill_bezier(ViewLayer *view, BPoint *points) +fill_bezier(ViewLayer *view, const BPoint *viewPoints) { - for (int32 i = 0; i < 4; i++) - view->ConvertToScreenForDrawing(&points[i]); + BPoint points[4]; + view->ConvertToScreenForDrawing(points, viewPoints, 4); view->Window()->GetDrawingEngine()->DrawBezier(points, view->CurrentState(), true); } @@ -240,11 +250,14 @@ static void -stroke_polygon(ViewLayer *view, int32 numPoints, BPoint *points, bool isClosed) +stroke_polygon(ViewLayer *view, int32 numPoints, const BPoint *viewPoints, bool isClosed) { - for (int32 i = 0; i < numPoints; i++) - view->ConvertToScreenForDrawing(&points[i]); + BPoint *points = (BPoint *)malloc(numPoints * sizeof(BPoint)); + if (!points) + return; + view->ConvertToScreenForDrawing(points, viewPoints, numPoints); + BRect polyFrame = BRect(points[0], points[0]); for (int32 i = 1; i < numPoints; i++) { @@ -260,15 +273,20 @@ view->Window()->GetDrawingEngine()->DrawPolygon(points, numPoints, polyFrame, view->CurrentState(), false, isClosed && numPoints > 2); + + free(points); } static void -fill_polygon(ViewLayer *view, int32 numPoints, BPoint *points) +fill_polygon(ViewLayer *view, int32 numPoints, const BPoint *viewPoints) { - for (int32 i = 0; i < numPoints; i++) - view->ConvertToScreenForDrawing(&points[i]); + BPoint *points = (BPoint *)malloc(numPoints * sizeof(BPoint)); + if (!points) + return; + view->ConvertToScreenForDrawing(points, viewPoints, numPoints); + BRect polyFrame = BRect(points[0], points[0]); for (int32 i = 1; i < numPoints; i++) { @@ -284,11 +302,13 @@ view->Window()->GetDrawingEngine()->DrawPolygon(points, numPoints, polyFrame, view->CurrentState(), true, true); + + free(points); } static void -stroke_shape(ViewLayer *view, BShape *shape) +stroke_shape(ViewLayer *view, const BShape *shape) { ShapePainter drawShape; @@ -298,7 +318,7 @@ static void -fill_shape(ViewLayer *view, BShape *shape) +fill_shape(ViewLayer *view, const BShape *shape) { ShapePainter drawShape; @@ -308,7 +328,7 @@ static void -draw_string(ViewLayer *view, char *string, float deltaSpace, float deltaNonSpace) +draw_string(ViewLayer *view, const char *string, float deltaSpace, float deltaNonSpace) { BPoint location = view->CurrentState()->PenLocation(); escapement_delta delta = {deltaSpace, deltaNonSpace }; @@ -322,7 +342,7 @@ static void draw_pixels(ViewLayer *view, BRect src, BRect dest, int32 width, int32 height, - int32 bytesPerRow, int32 pixelFormat, int32 flags, void *data) + int32 bytesPerRow, int32 pixelFormat, int32 flags, const void *data) { // TODO: Review this UtilityBitmap bitmap(BRect(0, 0, width - 1, height - 1), (color_space)pixelFormat, flags, bytesPerRow); @@ -330,13 +350,7 @@ if (!bitmap.IsValid()) return; - uint8 *pixels = (uint8 *)data; - uint8 *destPixels = (uint8 *)bitmap.Bits(); - for (int32 h = 0; h < height; h++) { - memcpy(destPixels, pixels, bytesPerRow); - pixels += bytesPerRow; - destPixels += bytesPerRow; - } + memcpy(bitmap.Bits(), data, height * bytesPerRow); view->ConvertToScreenForDrawing(&dest); @@ -345,7 +359,7 @@ static void -set_clipping_rects(ViewLayer *view, BRect *rects, uint32 numRects) +set_clipping_rects(ViewLayer *view, const BRect *rects, uint32 numRects) { // TODO: This is too slow, we should copy the rects directly to BRegion's internal data BRegion region; @@ -473,14 +487,14 @@ static void -set_font_family(ViewLayer *view, char *family) [... truncated: 149 lines follow ...] From mmu_man at mail.berlios.de Fri Mar 2 01:04:52 2007 From: mmu_man at mail.berlios.de (mmu_man at BerliOS) Date: Fri, 2 Mar 2007 01:04:52 +0100 Subject: [Haiku-commits] r20293 - haiku/trunk/src/apps/mediaplayer Message-ID: <200703020004.l2204q7Q002484@sheep.berlios.de> Author: mmu_man Date: 2007-03-02 01:04:51 +0100 (Fri, 02 Mar 2007) New Revision: 20293 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20293&view=rev Added: haiku/trunk/src/apps/mediaplayer/InfoWin.cpp haiku/trunk/src/apps/mediaplayer/InfoWin.h Modified: haiku/trunk/src/apps/mediaplayer/Controller.h haiku/trunk/src/apps/mediaplayer/Jamfile haiku/trunk/src/apps/mediaplayer/MainWin.cpp haiku/trunk/src/apps/mediaplayer/MainWin.h Log: Add a File Info Window to MediaPlayer. Modified: haiku/trunk/src/apps/mediaplayer/Controller.h =================================================================== --- haiku/trunk/src/apps/mediaplayer/Controller.h 2007-03-01 23:17:40 UTC (rev 20292) +++ haiku/trunk/src/apps/mediaplayer/Controller.h 2007-03-02 00:04:51 UTC (rev 20293) @@ -92,6 +92,7 @@ void StopThreads(); private: + friend class InfoWin; enum { MAX_AUDIO_BUFFERS = 8, Added: haiku/trunk/src/apps/mediaplayer/InfoWin.cpp =================================================================== --- haiku/trunk/src/apps/mediaplayer/InfoWin.cpp 2007-03-01 23:17:40 UTC (rev 20292) +++ haiku/trunk/src/apps/mediaplayer/InfoWin.cpp 2007-03-02 00:04:51 UTC (rev 20293) @@ -0,0 +1,410 @@ +/* + * InfoWin.cpp - Media Player for the Haiku Operating System + * + * Copyright (C) 2006 Marcus Overhagen + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * version 2 as published by the Free Software Foundation. + * + * 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 "InfoWin.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "MainWin.h" + +#define NAME "File Info" +#define MIN_WIDTH 350 + +#define BASE_HEIGHT (32+32) + +//const rgb_color kGreen = { 152, 203, 152, 255 }; +const rgb_color kRed = { 203, 152, 152, 255 }; +const rgb_color kBlue = { 0, 0, 220, 255 }; +const rgb_color kGreen = { 171, 221, 161, 255 }; +const rgb_color kBlack = { 0, 0, 0, 255 }; + + +// should later draw an icon +class InfoView : public BView { +public: + InfoView(BRect frame, const char *name, float divider) + : BView(frame, name, B_FOLLOW_ALL, B_WILL_DRAW | B_FULL_UPDATE_ON_RESIZE) + , fDivider(divider) + { } + virtual ~InfoView() + { } + void Draw(BRect updateRect); + float fDivider; +}; + + +void +InfoView::Draw(BRect updateRect) +{ + SetHighColor(kGreen); + BRect r(Bounds()); + r.right = r.left + fDivider; + FillRect(r); + SetHighColor(ui_color(B_DOCUMENT_TEXT_COLOR)); + r.left = r.right; + FillRect(r); +} + + +InfoWin::InfoWin(MainWin *mainWin) + : BWindow(BRect(100,100,100+MIN_WIDTH-1,350), NAME, B_TITLED_WINDOW, B_ASYNCHRONOUS_CONTROLS | B_NOT_RESIZABLE /* | B_WILL_ACCEPT_FIRST_CLICK */), + fMainWin(mainWin), + fController() +{ + BRect rect; + if (fMainWin->Lock()) { + rect = fMainWin->Frame(); + MoveTo(rect.right, rect.top); + fMainWin->Unlock(); + } + + rect = Bounds(); + + // accomodate for big fonts + float div; + div = MAX(2*32, be_plain_font->StringWidth("Container") + 5); + + fInfoView = new InfoView(rect, "background", div); + fInfoView->SetViewColor(ui_color(B_DOCUMENT_BACKGROUND_COLOR)); + AddChild(fInfoView); + + BFont bigFont(be_plain_font); + bigFont.SetSize(bigFont.Size()+6); + font_height fh; + bigFont.GetHeight(&fh); + fFilenameView = new BStringView(BRect(div+10, 20, + rect.right - 10, + 20 + fh.ascent + 5), + "filename", "Foo.avi"); + fFilenameView->SetFont(&bigFont); + fFilenameView->SetViewColor(fInfoView->ViewColor()); + fFilenameView->SetLowColor(fInfoView->ViewColor()); + AddChild(fFilenameView); + + + rect.top = BASE_HEIGHT; + + BRect lr(rect); + BRect cr(rect); + lr.right = div - 1; + cr.left = div + 1; + BRect tr; + tr = lr.OffsetToCopy(0,0).InsetByCopy(1,1); + fLabelsView = new BTextView(lr, "labels", tr, B_FOLLOW_BOTTOM); + fLabelsView->SetViewColor(kGreen); + fLabelsView->SetAlignment(B_ALIGN_RIGHT); + fLabelsView->SetWordWrap(false); + AddChild(fLabelsView); + tr = cr.OffsetToCopy(0,0).InsetByCopy(1,1); + fContentsView = new BTextView(cr, "contents", tr, B_FOLLOW_BOTTOM); + fContentsView->SetWordWrap(false); + AddChild(fContentsView); + + fLabelsView->MakeSelectable(); + fContentsView->MakeSelectable(); + + + Show(); +} + + +InfoWin::~InfoWin() +{ + printf("InfoWin::~InfoWin\n"); + //fInfoListView->MakeEmpty(); + //delete [] fInfoItems; +} + + +void +InfoWin::ResizeToPreferred() +{ +#if 0 + int i; + float height = BASE_HEIGHT; + BListItem *li; + for (i = 0; (li = fInfoListView->ItemAt(i)); i++) { + height += li->Height(); + } + ResizeTo(Bounds().Width(), height); +#endif +} + + +void +InfoWin::Update(uint32 which) +{ + printf("InfoWin::Update(0x%08lx)\n", which); + rgb_color vFgCol = ui_color(B_DOCUMENT_TEXT_COLOR); + + fLabelsView->SelectAll(); + fContentsView->SelectAll(); + fLabelsView->Clear(); + fContentsView->Clear(); + fLabelsView->SetFontAndColor(be_plain_font, B_FONT_ALL, &kBlue); + fLabelsView->Insert("File Info\n"); + fContentsView->SetFontAndColor(be_plain_font, B_FONT_ALL, &vFgCol); + fContentsView->Insert("\n"); + + fLabelsView->SetFontAndColor(be_plain_font, B_FONT_ALL, &kRed); + //fContentsView->SetFontAndColor(be_plain_font, B_FONT_ALL, &vFgCol); + + // lock the Main Window as we must access some fields there... + if (fMainWin->LockWithTimeout(500000) < B_OK) + return; // XXX: resend msg to ourselves ? + + Controller *c = fMainWin->fController; + BMediaFile *mf = c->fMediaFile; + + if (which & INFO_VIDEO && c->VideoTrackCount() > 0) { + fLabelsView->Insert("Video\n\n"); + BString s; + media_format fmt; + media_raw_video_format vfmt; + float fps; + c->fVideoTrack->EncodedFormat(&fmt); + if (fmt.type == B_MEDIA_ENCODED_VIDEO) { + vfmt = fmt.u.encoded_video.output; + s << "(encoded video)"; // TODO: get codec + } else if (fmt.type == B_MEDIA_RAW_VIDEO) { + vfmt = fmt.u.raw_video; + s << "raw video"; + } else + s << "unknown format"; + s << "\n"; + s << fmt.Width() << " x " << fmt.Height(); + // encoded has output as 1st field... + fps = vfmt.field_rate; + s << ", " << fps << " fps"; + s << "\n"; + fContentsView->Insert(s.String()); + } + if (which & INFO_AUDIO && c->AudioTrackCount() > 0) { + fLabelsView->Insert("Sound\n\n"); + BString s; + media_format fmt; + media_raw_audio_format afmt; + c->fAudioTrack->EncodedFormat(&fmt); + if (fmt.type == B_MEDIA_ENCODED_AUDIO) { + afmt = fmt.u.encoded_audio.output; + s << "(encoded audio)"; // TODO: get codec + } else if (fmt.type == B_MEDIA_RAW_AUDIO) { + afmt = fmt.u.raw_audio; + s << "raw audio"; + } else + s << "unknown format"; + s << "\n"; + // encoded has output as 1st field... + uint32 bitps = 8 * afmt.format & media_raw_audio_format::B_AUDIO_SIZE_MASK; + uint32 chans = afmt.channel_count; + float sr = afmt.frame_rate; + + s << bitps << "Bit "; + if (chans == 1) + s << "Mono"; + else if (chans == 2) + s << "Stereo"; + else + s << chans << "Channels"; + s << ", "; + if (sr) + s << (1/sr); + else + s << "?"; + s<< " kHz"; + s << "\n"; + fContentsView->Insert(s.String()); + } + if (which & INFO_STATS) { + fLabelsView->Insert("Duration\n"); + BString s; + bigtime_t d = c->Duration(); + bigtime_t v; + + //s << d << "?s; "; + + d /= 1000; + + v = d / (3600 * 1000); + d = d % (3600 * 1000); + if (v) + s << v << ":"; + v = d / (60 * 1000); + d = d % (60 * 1000); + s << v << ":"; + v = d / 1000; + d = d % 1000; + s << v; + if (d) + s << "." << d / 10; + s << "\n"; + fContentsView->Insert(s.String()); + } + if (which & INFO_TRANSPORT) { + } + if ((which & INFO_FILE) && fMainWin->fHasFile) { + media_file_format ff; + if (mf && (mf->GetFileFormatInfo(&ff) == B_OK)) { + fLabelsView->Insert("Container\n"); + BString s; + s << ff.pretty_name; + s << "\n"; + fContentsView->Insert(s.String()); + } + fLabelsView->Insert("Location\n"); + fContentsView->Insert("file://\n"); + fFilenameView->SetText("Bar.avi"); + } + if (which & INFO_COPYRIGHT && mf && mf->Copyright()) { + + fLabelsView->Insert("Copyright\n\n"); + BString s; + s << mf->Copyright(); + s << "\n\n"; + fContentsView->Insert(s.String()); + } + + // we can unlock the main window now and let it work + fMainWin->Unlock(); + + // now resize the window to the list view size... + ResizeToPreferred(); + + if (IsHidden()) + Show(); +} + + +bool +InfoWin::QuitRequested() +{ + Hide(); + return false; +} + + +void +InfoWin::Show() +{ + // notify the main window first + fMainWin->fInfoWinShowing = true; + BWindow::Show(); + //SetPulseRate(1000000); +} + + +void +InfoWin::Hide() +{ + SetPulseRate(0); + BWindow::Hide(); + fMainWin->fInfoWinShowing = false; +} + + +void +InfoWin::Pulse() +{ + if (IsHidden()) + return; + Update(INFO_STATS); +} + +void +InfoWin::FrameResized(float new_width, float new_height) +{ +#if 0 + if (new_width != Bounds().Width() || new_height != Bounds().Height()) { + debugger("size wrong\n"); + } + + bool no_menu = fNoMenu || fIsFullscreen; + bool no_controls = fNoControls || fIsFullscreen; + + printf("FrameResized enter: new_width %.0f, new_height %.0f\n", new_width, new_height); + + int max_video_width = int(new_width) + 1; + int max_video_height = int(new_height) + 1 - (no_menu ? 0 : fMenuBarHeight) - (no_controls ? 0 : fControlsHeight); + + ASSERT(max_video_height >= 0); + + int y = 0; + + if (no_menu) { + if (!fMenuBar->IsHidden()) + fMenuBar->Hide(); + } else { +// fMenuBar->MoveTo(0, y); + fMenuBar->ResizeTo(new_width, fMenuBarHeight - 1); + if (fMenuBar->IsHidden()) + fMenuBar->Show(); + y += fMenuBarHeight; + } + + if (max_video_height == 0) { + if (!fVideoView->IsHidden()) + fVideoView->Hide(); + } else { +// fVideoView->MoveTo(0, y); +// fVideoView->ResizeTo(max_video_width - 1, max_video_height - 1); + ResizeVideoView(0, y, max_video_width, max_video_height); + if (fVideoView->IsHidden()) + fVideoView->Show(); + y += max_video_height; + } + + if (no_controls) { + if (!fControls->IsHidden()) + fControls->Hide(); + } else { + fControls->MoveTo(0, y); + fControls->ResizeTo(new_width, fControlsHeight - 1); + if (fControls->IsHidden()) + fControls->Show(); +// y += fControlsHeight; + } +#endif + + printf("FrameResized leave\n"); +} + + +void +InfoWin::MessageReceived(BMessage *msg) +{ + uint32 which; + switch (msg->what) { + case M_UPDATE_INFO: + if (msg->FindInt32("which", (int32 *)&which) < B_OK) + which = INFO_ALL; + Update(which); + break; + default: + BWindow::MessageReceived(msg); + break; + } +} Added: haiku/trunk/src/apps/mediaplayer/InfoWin.h =================================================================== --- haiku/trunk/src/apps/mediaplayer/InfoWin.h 2007-03-01 23:17:40 UTC (rev 20292) +++ haiku/trunk/src/apps/mediaplayer/InfoWin.h 2007-03-02 00:04:51 UTC (rev 20293) @@ -0,0 +1,69 @@ +/* + * MainWin.h - Media Player for the Haiku Operating System + * + * Copyright (C) 2006 Marcus Overhagen + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * version 2 as published by the Free Software Foundation. + * + * 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. + * + */ +#ifndef __FILE_INFO_WIN_H +#define __FILE_INFO_WIN_H + +#include +#include +#include + +class MainWin; +class Controller; +class InfoView; + +#define M_UPDATE_INFO 'upda' + +#define INFO_STATS 0x00000001 +#define INFO_TRANSPORT 0x00000002 +#define INFO_FILE 0x00000004 +#define INFO_AUDIO 0x00000008 +#define INFO_VIDEO 0x00000010 +#define INFO_COPYRIGHT 0x00000020 + +#define INFO_ALL 0xffffffff + + +class InfoWin : public BWindow +{ +public: + InfoWin(MainWin *mainWin); + ~InfoWin(); + + void FrameResized(float new_width, float new_height); + void MessageReceived(BMessage *msg); + bool QuitRequested(); + virtual void Show(); + virtual void Hide(); + virtual void Pulse(); + + void ResizeToPreferred(); + void Update(uint32 which=INFO_ALL); // threadsafe + + MainWin * fMainWin; + Controller * fController; + + InfoView * fInfoView; + BStringView * fFilenameView; + BTextView * fLabelsView; + BTextView * fContentsView; + +}; + +#endif Modified: haiku/trunk/src/apps/mediaplayer/Jamfile =================================================================== --- haiku/trunk/src/apps/mediaplayer/Jamfile 2007-03-01 23:17:40 UTC (rev 20292) +++ haiku/trunk/src/apps/mediaplayer/Jamfile 2007-03-02 00:04:51 UTC (rev 20293) @@ -8,6 +8,7 @@ Controller.cpp ControllerView.cpp DrawingTidbits.cpp + InfoWin.cpp MainApp.cpp MainWin.cpp Playlist.cpp Modified: haiku/trunk/src/apps/mediaplayer/MainWin.cpp =================================================================== --- haiku/trunk/src/apps/mediaplayer/MainWin.cpp 2007-03-01 23:17:40 UTC (rev 20292) +++ haiku/trunk/src/apps/mediaplayer/MainWin.cpp 2007-03-02 00:04:51 UTC (rev 20293) @@ -87,6 +87,8 @@ MainWin::MainWin() : BWindow(BRect(100,100,350,300), NAME, B_TITLED_WINDOW, B_ASYNCHRONOUS_CONTROLS /* | B_WILL_ACCEPT_FIRST_CLICK */) , fFilePanel(NULL) + , fInfoWin(NULL) + , fInfoWinShowing(false) , fHasFile(false) , fHasVideo(false) , fPlaylist(new Playlist) @@ -159,6 +161,10 @@ delete fPlaylist; delete fController; delete fFilePanel; + if (fInfoWin) { + fInfoWin->Lock(); + fInfoWin->Quit(); + } } @@ -189,7 +195,7 @@ { printf("MainWin::SetupWindow\n"); - // Pupulate the track menus + // Populate the track menus SetupTrackMenus(); // Enable both if a file was loaded fAudioMenu->SetEnabled(fHasFile); @@ -212,6 +218,8 @@ ResizeWindow(100); fVideoView->MakeFocus(); + + MaybeUpdateFileInfo(); } @@ -582,8 +590,26 @@ void MainWin::ShowFileInfo() { + if (!fInfoWin) + fInfoWin = new InfoWin(this); + BMessenger msgr(fInfoWin); + BMessage m(M_UPDATE_INFO); + m.AddInt32("which", INFO_ALL); + msgr.SendMessage(&m); + msgr.SendMessage(B_WINDOW_ACTIVATED); } +void +MainWin::MaybeUpdateFileInfo(uint32 which) +{ + // Update the Info Window if it's displayed. + if (!fInfoWinShowing) + return; + BMessenger msgr(fInfoWin); + BMessage m(M_UPDATE_INFO); + m.AddInt32("which", which); + msgr.SendMessage(&m); +} void MainWin::ResizeVideoView(int x, int y, int width, int height) @@ -1149,6 +1175,9 @@ SelectInterface(msg->what - M_SELECT_INTERFACE - 1); break; } -*/ +*/ + default: + // let BWindow handle the rest + BWindow::MessageReceived(msg); } } Modified: haiku/trunk/src/apps/mediaplayer/MainWin.h =================================================================== --- haiku/trunk/src/apps/mediaplayer/MainWin.h 2007-03-01 23:17:40 UTC (rev 20292) +++ haiku/trunk/src/apps/mediaplayer/MainWin.h 2007-03-02 00:04:51 UTC (rev 20293) @@ -27,6 +27,7 @@ #include #include "Controller.h" #include "ControllerView.h" +#include "InfoWin.h" #include "VideoView.h" #include "Player.h" #include "Playlist.h" @@ -57,6 +58,7 @@ void ResizeVideoView(int x, int y, int width, int height); void ShowFileInfo(); + void MaybeUpdateFileInfo(uint32 which=INFO_ALL); // from Player void OpenFile(const entry_ref &ref); @@ -78,6 +80,8 @@ VideoView * fVideoView; BFilePanel * fFilePanel; ControllerView * fControls; + InfoWin * fInfoWin; + bool fInfoWinShowing; BMenu * fFileMenu; BMenu * fViewMenu; From bonefish at mail.berlios.de Fri Mar 2 01:32:26 2007 From: bonefish at mail.berlios.de (bonefish at BerliOS) Date: Fri, 2 Mar 2007 01:32:26 +0100 Subject: [Haiku-commits] r20294 - haiku/trunk/src/tests/add-ons/kernel/file_systems/userlandfs/r5/src/test/ramfs Message-ID: <200703020032.l220WQYG032565@sheep.berlios.de> Author: bonefish Date: 2007-03-02 01:32:26 +0100 (Fri, 02 Mar 2007) New Revision: 20294 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20294&view=rev Modified: haiku/trunk/src/tests/add-ons/kernel/file_systems/userlandfs/r5/src/test/ramfs/BlockAllocatorArea.cpp Log: There's the supposed "out of memory" problem. Haiku is stricter than BeOS and rejects create_area() requests with B_ANY_KERNEL_ADDRESS address specification. Modified: haiku/trunk/src/tests/add-ons/kernel/file_systems/userlandfs/r5/src/test/ramfs/BlockAllocatorArea.cpp =================================================================== --- haiku/trunk/src/tests/add-ons/kernel/file_systems/userlandfs/r5/src/test/ramfs/BlockAllocatorArea.cpp 2007-03-02 00:04:51 UTC (rev 20293) +++ haiku/trunk/src/tests/add-ons/kernel/file_systems/userlandfs/r5/src/test/ramfs/BlockAllocatorArea.cpp 2007-03-02 00:32:26 UTC (rev 20294) @@ -30,10 +30,19 @@ { Area *area = NULL; void *base = NULL; +#if USER + area_id id = create_area("block alloc", &base, B_ANY_ADDRESS, + size, B_NO_LOCK, B_READ_AREA | B_WRITE_AREA); +#else area_id id = create_area("block alloc", &base, B_ANY_KERNEL_ADDRESS, size, B_FULL_LOCK, B_READ_AREA | B_WRITE_AREA); - if (id >= 0) +#endif + if (id >= 0) { area = new(base) Area(id, size); + } else { + ERROR(("BlockAllocator::Area::Create(%lu): Failed to create area: %s\n", + size, strerror(id))); + } return area; } From bonefish at mail.berlios.de Fri Mar 2 01:33:05 2007 From: bonefish at mail.berlios.de (bonefish at BerliOS) Date: Fri, 2 Mar 2007 01:33:05 +0100 Subject: [Haiku-commits] r20295 - haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on Message-ID: <200703020033.l220X5Y1032625@sheep.berlios.de> Author: bonefish Date: 2007-03-02 01:33:05 +0100 (Fri, 02 Mar 2007) New Revision: 20295 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20295&view=rev Modified: haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/kernel_interface.cpp Log: Fixed debug output. Modified: haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/kernel_interface.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/kernel_interface.cpp 2007-03-02 00:32:26 UTC (rev 20294) +++ haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/kernel_interface.cpp 2007-03-02 00:33:05 UTC (rev 20295) @@ -682,9 +682,9 @@ userlandfs_free_attr_cookie(fs_volume fs, fs_vnode node, fs_cookie cookie) { Volume* volume = (Volume*)fs; - PRINT(("userlandfs_close_attr(%p, %p, %p)\n", fs, node, cookie)); + PRINT(("userlandfs_free_attr_cookie(%p, %p, %p)\n", fs, node, cookie)); status_t error = volume->FreeAttrCookie(node, cookie); - PRINT(("userlandfs_close_attr() done: %lx\n", error)); + PRINT(("userlandfs_free_attr_cookie() done: %lx\n", error)); return error; } From marcusoverhagen at mail.berlios.de Fri Mar 2 01:33:23 2007 From: marcusoverhagen at mail.berlios.de (marcusoverhagen at BerliOS) Date: Fri, 2 Mar 2007 01:33:23 +0100 Subject: [Haiku-commits] r20296 - haiku/trunk/src/servers/app Message-ID: <200703020033.l220XNWJ032671@sheep.berlios.de> Author: marcusoverhagen Date: 2007-03-02 01:33:23 +0100 (Fri, 02 Mar 2007) New Revision: 20296 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20296&view=rev Modified: haiku/trunk/src/servers/app/ServerPicture.cpp Log: added fast path to BPicture polygon drawing Modified: haiku/trunk/src/servers/app/ServerPicture.cpp =================================================================== --- haiku/trunk/src/servers/app/ServerPicture.cpp 2007-03-02 00:33:05 UTC (rev 20295) +++ haiku/trunk/src/servers/app/ServerPicture.cpp 2007-03-02 00:33:23 UTC (rev 20296) @@ -134,6 +134,35 @@ } static void +get_polygon_frame(const BPoint *points, int32 numPoints, BRect *_frame) +{ + float l, t, r, b; + + ASSERT(numPoints > 0); + + l = r = points->x; + t = b = points->y; + + points++; + numPoints--; + + while (numPoints--) { + if (points->x < l) + l = points->x; + if (points->x > r) + r = points->x; + if (points->y < t) + t = points->y; + if (points->y > b) + b = points->y; + points++; + } + + _frame->Set(l, t, r, b); +} + + +static void nop() { } @@ -252,58 +281,72 @@ static void stroke_polygon(ViewLayer *view, int32 numPoints, const BPoint *viewPoints, bool isClosed) { - BPoint *points = (BPoint *)malloc(numPoints * sizeof(BPoint)); - if (!points) + if (numPoints <= 0) { return; + } else if (numPoints <= 200) { + // fast path: no malloc/free, also avoid constructor/destructor calls + char data[200 * sizeof(BPoint)]; + BPoint *points = (BPoint *)data; - view->ConvertToScreenForDrawing(points, viewPoints, numPoints); + view->ConvertToScreenForDrawing(points, viewPoints, numPoints); - BRect polyFrame = BRect(points[0], points[0]); + BRect polyFrame; + get_polygon_frame(points, numPoints, &polyFrame); - for (int32 i = 1; i < numPoints; i++) { - if (points[i].x < polyFrame.left) - polyFrame.left = points[i].x; - if (points[i].y < polyFrame.top) - polyFrame.top = points[i].y; - if (points[i].x > polyFrame.right) - polyFrame.right = points[i].x; - if (points[i].y > polyFrame.bottom) - polyFrame.bottom = points[i].y; - } + view->Window()->GetDrawingEngine()->DrawPolygon(points, numPoints, polyFrame, + view->CurrentState(), false, + isClosed && numPoints > 2); + } else { + // avoid constructor/destructor calls by using malloc instead of new [] + BPoint *points = (BPoint *)malloc(numPoints * sizeof(BPoint)); + if (!points) + return; - view->Window()->GetDrawingEngine()->DrawPolygon(points, numPoints, polyFrame, view->CurrentState(), - false, isClosed && numPoints > 2); + view->ConvertToScreenForDrawing(points, viewPoints, numPoints); - free(points); + BRect polyFrame; + get_polygon_frame(points, numPoints, &polyFrame); + + view->Window()->GetDrawingEngine()->DrawPolygon(points, numPoints, polyFrame, + view->CurrentState(), false, + isClosed && numPoints > 2); + free(points); + } } static void fill_polygon(ViewLayer *view, int32 numPoints, const BPoint *viewPoints) { - BPoint *points = (BPoint *)malloc(numPoints * sizeof(BPoint)); - if (!points) + if (numPoints <= 0) { return; + } else if (numPoints <= 200) { + // fast path: no malloc/free, also avoid constructor/destructor calls + char data[200 * sizeof(BPoint)]; + BPoint *points = (BPoint *)data; - view->ConvertToScreenForDrawing(points, viewPoints, numPoints); + view->ConvertToScreenForDrawing(points, viewPoints, numPoints); - BRect polyFrame = BRect(points[0], points[0]); + BRect polyFrame; + get_polygon_frame(points, numPoints, &polyFrame); - for (int32 i = 1; i < numPoints; i++) { - if (points[i].x < polyFrame.left) - polyFrame.left = points[i].x; - if (points[i].y < polyFrame.top) - polyFrame.top = points[i].y; - if (points[i].x > polyFrame.right) - polyFrame.right = points[i].x; - if (points[i].y > polyFrame.bottom) - polyFrame.bottom = points[i].y; - } + view->Window()->GetDrawingEngine()->DrawPolygon(points, numPoints, polyFrame, + view->CurrentState(), true, true); + } else { + // avoid constructor/destructor calls by using malloc instead of new [] + BPoint *points = (BPoint *)malloc(numPoints * sizeof(BPoint)); + if (!points) + return; - view->Window()->GetDrawingEngine()->DrawPolygon(points, numPoints, polyFrame, view->CurrentState(), - true, true); + view->ConvertToScreenForDrawing(points, viewPoints, numPoints); - free(points); + BRect polyFrame; + get_polygon_frame(points, numPoints, &polyFrame); + + view->Window()->GetDrawingEngine()->DrawPolygon(points, numPoints, polyFrame, + view->CurrentState(), true, true); + free(points); + } } From bonefish at mail.berlios.de Fri Mar 2 01:34:21 2007 From: bonefish at mail.berlios.de (bonefish at BerliOS) Date: Fri, 2 Mar 2007 01:34:21 +0100 Subject: [Haiku-commits] r20297 - in haiku/trunk: headers/os/drivers src/system/kernel/fs Message-ID: <200703020034.l220YLh9000103@sheep.berlios.de> Author: bonefish Date: 2007-03-02 01:34:20 +0100 (Fri, 02 Mar 2007) New Revision: 20297 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20297&view=rev Modified: haiku/trunk/headers/os/drivers/fs_interface.h haiku/trunk/src/system/kernel/fs/vfs.cpp Log: is_vnode_removed() is now known as get_vnode_removed() and returns its answer through a reference parameter. Modified: haiku/trunk/headers/os/drivers/fs_interface.h =================================================================== --- haiku/trunk/headers/os/drivers/fs_interface.h 2007-03-02 00:33:23 UTC (rev 20296) +++ haiku/trunk/headers/os/drivers/fs_interface.h 2007-03-02 00:34:20 UTC (rev 20297) @@ -266,7 +266,8 @@ extern status_t remove_vnode(mount_id mountID, vnode_id vnodeID); extern status_t unremove_vnode(mount_id mountID, vnode_id vnodeID); extern status_t unremove_vnode(mount_id mountID, vnode_id vnodeID); -extern status_t is_vnode_removed(mount_id mountID, vnode_id vnodeID); +extern status_t get_vnode_removed(mount_id mountID, vnode_id vnodeID, + bool* removed); extern status_t notify_listener(int op, mount_id device, vnode_id parentNode, vnode_id toParentNode, vnode_id node, const char *name); Modified: haiku/trunk/src/system/kernel/fs/vfs.cpp =================================================================== --- haiku/trunk/src/system/kernel/fs/vfs.cpp 2007-03-02 00:33:23 UTC (rev 20296) +++ haiku/trunk/src/system/kernel/fs/vfs.cpp 2007-03-02 00:34:20 UTC (rev 20297) @@ -2632,18 +2632,17 @@ extern "C" status_t -is_vnode_removed(mount_id mountID, vnode_id vnodeID) +get_vnode_removed(mount_id mountID, vnode_id vnodeID, bool* removed) { - struct vnode *vnode; - mutex_lock(&sVnodeMutex); status_t result; - vnode = lookup_vnode(mountID, vnodeID); - if (vnode) - result = vnode->remove ? 1 : 0; - else + if (struct vnode* vnode = lookup_vnode(mountID, vnodeID)) { + if (removed) + *removed = vnode->remove; + result = B_OK; + } else result = B_BAD_VALUE; mutex_unlock(&sVnodeMutex); From bonefish at mail.berlios.de Fri Mar 2 01:41:10 2007 From: bonefish at mail.berlios.de (bonefish at BerliOS) Date: Fri, 2 Mar 2007 01:41:10 +0100 Subject: [Haiku-commits] r20298 - in haiku/trunk: headers/private/userlandfs/private src/add-ons/kernel/file_systems/userlandfs/kernel_add_on src/add-ons/kernel/file_systems/userlandfs/private src/add-ons/kernel/file_systems/userlandfs/server Message-ID: <200703020041.l220fACg000677@sheep.berlios.de> Author: bonefish Date: 2007-03-02 01:41:09 +0100 (Fri, 02 Mar 2007) New Revision: 20298 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20298&view=rev Modified: haiku/trunk/headers/private/userlandfs/private/Requests.h haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/KernelRequestHandler.cpp haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/KernelRequestHandler.h haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/Volume.cpp haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/Volume.h haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/private/Requests.cpp haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/BeOSKernelVolume.cpp haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/beos_kernel_emu.cpp haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/kernel_emu.cpp haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/kernel_emu.h Log: * Adjusted according to the is_vnode_removed() -> get_vnode_removed() change. * The new notification functions are used instead of send_notification() and notify_listener() now. Mapped them in the BeOS kernel emulation accordingly. RamFS node monitoring seems to work now. Modified: haiku/trunk/headers/private/userlandfs/private/Requests.h =================================================================== --- haiku/trunk/headers/private/userlandfs/private/Requests.h 2007-03-02 00:34:20 UTC (rev 20297) +++ haiku/trunk/headers/private/userlandfs/private/Requests.h 2007-03-02 00:41:09 UTC (rev 20298) @@ -175,8 +175,8 @@ NOTIFY_LISTENER_REPLY, NOTIFY_SELECT_EVENT_REQUEST, NOTIFY_SELECT_EVENT_REPLY, - SEND_NOTIFICATION_REQUEST, - SEND_NOTIFICATION_REPLY, + NOTIFY_QUERY_REQUEST, + NOTIFY_QUERY_REPLY, // vnodes GET_VNODE_REQUEST, @@ -191,8 +191,8 @@ REMOVE_VNODE_REPLY, UNREMOVE_VNODE_REQUEST, UNREMOVE_VNODE_REPLY, - IS_VNODE_REMOVED_REQUEST, - IS_VNODE_REMOVED_REPLY, + GET_VNODE_REMOVED_REQUEST, + GET_VNODE_REMOVED_REPLY, // general reply RECEIPT_ACK_REPLY, @@ -1313,8 +1313,6 @@ // #pragma mark - // #pragma mark ----- notifications ----- -// TODO: notify_listener() and send_notifications() are obsolete! - // NotifyListenerRequest class NotifyListenerRequest : public Request { public: @@ -1322,10 +1320,13 @@ status_t GetAddressInfos(AddressInfo* infos, int32* count); int32 operation; - mount_id nsid; - vnode_id vnida; - vnode_id vnidb; - vnode_id vnidc; + uint32 details; // for B_STAT_CHANGED:statFields + // and B_ATTRIBUTE_CHANGED:cause + mount_id device; + vnode_id oldDirectory; + vnode_id directory; + vnode_id node; + Address oldName; Address name; }; @@ -1343,6 +1344,7 @@ selectsync* sync; uint32 ref; uint8 event; + bool unspecifiedEvent; }; // NotifySelectEventReply @@ -1351,28 +1353,25 @@ NotifySelectEventReply() : ReplyRequest(NOTIFY_SELECT_EVENT_REPLY) {} }; -// SendNotificationRequest -class SendNotificationRequest : public Request { +// NotifyQueryRequest +class NotifyQueryRequest : public Request { public: - SendNotificationRequest() : Request(SEND_NOTIFICATION_REQUEST) {} + NotifyQueryRequest() : Request(NOTIFY_QUERY_REQUEST) {} status_t GetAddressInfos(AddressInfo* infos, int32* count); port_id port; int32 token; - uint32 what; - int32 operation; - mount_id nsida; - mount_id nsidb; - vnode_id vnida; - vnode_id vnidb; - vnode_id vnidc; + int32 operation; // B_ENTRY_{CREATED,REMOVED} + mount_id device; + vnode_id directory; + vnode_id node; Address name; }; -// SendNotificationReply -class SendNotificationReply : public ReplyRequest { +// NotifyQueryReply +class NotifyQueryReply : public ReplyRequest { public: - SendNotificationReply() : ReplyRequest(SEND_NOTIFICATION_REPLY) {} + NotifyQueryReply() : ReplyRequest(NOTIFY_QUERY_REPLY) {} }; @@ -1473,21 +1472,21 @@ UnremoveVNodeReply() : ReplyRequest(UNREMOVE_VNODE_REPLY) {} }; -// IsVNodeRemovedRequest -class IsVNodeRemovedRequest : public Request { +// GetVNodeRemovedRequest +class GetVNodeRemovedRequest : public Request { public: - IsVNodeRemovedRequest() : Request(IS_VNODE_REMOVED_REQUEST) {} + GetVNodeRemovedRequest() : Request(GET_VNODE_REMOVED_REQUEST) {} mount_id nsid; vnode_id vnid; }; -// IsVNodeRemovedReply -class IsVNodeRemovedReply : public ReplyRequest { +// GetVNodeRemovedReply +class GetVNodeRemovedReply : public ReplyRequest { public: - IsVNodeRemovedReply() : ReplyRequest(IS_VNODE_REMOVED_REPLY) {} + GetVNodeRemovedReply() : ReplyRequest(GET_VNODE_REMOVED_REPLY) {} - int result; + bool removed; }; @@ -1789,10 +1788,10 @@ return task((NotifySelectEventRequest*)request); case NOTIFY_SELECT_EVENT_REPLY: return task((NotifySelectEventReply*)request); - case SEND_NOTIFICATION_REQUEST: - return task((SendNotificationRequest*)request); - case SEND_NOTIFICATION_REPLY: - return task((SendNotificationReply*)request); + case NOTIFY_QUERY_REQUEST: + return task((NotifyQueryRequest*)request); + case NOTIFY_QUERY_REPLY: + return task((NotifyQueryReply*)request); // vnodes case GET_VNODE_REQUEST: return task((GetVNodeRequest*)request); @@ -1818,10 +1817,10 @@ return task((UnremoveVNodeRequest*)request); case UNREMOVE_VNODE_REPLY: return task((UnremoveVNodeReply*)request); - case IS_VNODE_REMOVED_REQUEST: - return task((IsVNodeRemovedRequest*)request); - case IS_VNODE_REMOVED_REPLY: - return task((IsVNodeRemovedReply*)request); + case GET_VNODE_REMOVED_REQUEST: + return task((GetVNodeRemovedRequest*)request); + case GET_VNODE_REMOVED_REPLY: + return task((GetVNodeRemovedReply*)request); // general reply case RECEIPT_ACK_REPLY: return task((ReceiptAckReply*)request); @@ -1992,8 +1991,8 @@ using UserlandFSUtil::NotifyListenerReply; using UserlandFSUtil::NotifySelectEventRequest; using UserlandFSUtil::NotifySelectEventReply; -using UserlandFSUtil::SendNotificationRequest; -using UserlandFSUtil::SendNotificationReply; +using UserlandFSUtil::NotifyQueryRequest; +using UserlandFSUtil::NotifyQueryReply; // vnodes using UserlandFSUtil::GetVNodeRequest; using UserlandFSUtil::GetVNodeReply; @@ -2007,8 +2006,8 @@ using UserlandFSUtil::RemoveVNodeReply; using UserlandFSUtil::UnremoveVNodeRequest; using UserlandFSUtil::UnremoveVNodeReply; -using UserlandFSUtil::IsVNodeRemovedRequest; -using UserlandFSUtil::IsVNodeRemovedReply; +using UserlandFSUtil::GetVNodeRemovedRequest; +using UserlandFSUtil::GetVNodeRemovedReply; // general reply using UserlandFSUtil::ReceiptAckReply; Modified: haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/KernelRequestHandler.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/KernelRequestHandler.cpp 2007-03-02 00:34:20 UTC (rev 20297) +++ haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/KernelRequestHandler.cpp 2007-03-02 00:41:09 UTC (rev 20298) @@ -62,8 +62,8 @@ return _HandleRequest((NotifyListenerRequest*)request); case NOTIFY_SELECT_EVENT_REQUEST: return _HandleRequest((NotifySelectEventRequest*)request); - case SEND_NOTIFICATION_REQUEST: - return _HandleRequest((SendNotificationRequest*)request); + case NOTIFY_QUERY_REQUEST: + return _HandleRequest((NotifyQueryRequest*)request); // vnodes case GET_VNODE_REQUEST: return _HandleRequest((GetVNodeRequest*)request); @@ -77,8 +77,8 @@ return _HandleRequest((RemoveVNodeRequest*)request); case UNREMOVE_VNODE_REQUEST: return _HandleRequest((UnremoveVNodeRequest*)request); - case IS_VNODE_REMOVED_REQUEST: - return _HandleRequest((IsVNodeRemovedRequest*)request); + case GET_VNODE_REMOVED_REQUEST: + return _HandleRequest((GetVNodeRemovedRequest*)request); } PRINT(("KernelRequestHandler::HandleRequest(): unexpected request: %lu\n", request->GetType())); @@ -94,44 +94,109 @@ { // check and executed the request status_t result = B_OK; - if (fVolume && request->nsid != fVolume->GetID()) + if (fVolume && request->device != fVolume->GetID()) result = B_BAD_VALUE; - // check the name + + // get the names + // name char* name = (char*)request->name.GetData(); int32 nameLen = request->name.GetSize(); - if (name && (nameLen <= 0 || strnlen(name, nameLen) < 1)) + if (name && (nameLen <= 0)) name = NULL; else if (name) - name[nameLen - 1] = '\0'; - if (!name) { + name[nameLen - 1] = '\0'; // NULL-terminate to be safe + + // old name + char* oldName = (char*)request->oldName.GetData(); + int32 oldNameLen = request->oldName.GetSize(); + if (oldName && (oldNameLen <= 0)) + oldName = NULL; + else if (oldName) + oldName[oldNameLen - 1] = '\0'; // NULL-terminate to be safe + + // check the names + if (result == B_OK) { switch (request->operation) { + case B_ENTRY_MOVED: + if (!oldName) { + ERROR(("NotifyListenerRequest: NULL oldName for " + "B_ENTRY_MOVED\n")); + result = B_BAD_VALUE; + break; + } + // fall through... case B_ENTRY_CREATED: - case B_ENTRY_MOVED: + case B_ENTRY_REMOVED: case B_ATTR_CHANGED: - ERROR(("notify_listener(): NULL name for opcode: %ld\n", - request->operation)); - result = B_BAD_VALUE; + if (!name) { + ERROR(("NotifyListenerRequest: NULL name for opcode: %ld\n", + request->operation)); + result = B_BAD_VALUE; + } break; - case B_ENTRY_REMOVED: case B_STAT_CHANGED: break; } } + // execute the request if (result == B_OK) { - PRINT(("notify_listener(%ld, %ld, %Ld, %Ld, %Ld, `%s')\n", - request->operation, request->nsid, request->vnida, request->vnidb, - request->vnidc, name)); - result = notify_listener(request->operation, request->nsid, - request->vnida, request->vnidb, request->vnidc, name); + switch (request->operation) { + case B_ENTRY_CREATED: + PRINT(("notify_entry_created(%ld, %lld, \"%s\", %lld)\n", + request->device, request->directory, name, request->node)); + result = notify_entry_created(request->device, + request->directory, name, request->node); + break; + + case B_ENTRY_REMOVED: + PRINT(("notify_entry_removed(%ld, %lld, \"%s\", %lld)\n", + request->device, request->directory, name, request->node)); + result = notify_entry_removed(request->device, + request->directory, name, request->node); + break; + + case B_ENTRY_MOVED: + PRINT(("notify_entry_moved(%ld, %lld, \"%s\", %lld, \"%s\", " + "%lld)\n", request->device, request->oldDirectory, oldName, + request->directory, name, request->node)); + result = notify_entry_moved(request->device, + request->oldDirectory, oldName, request->directory, name, + request->node); + break; + + case B_STAT_CHANGED: + PRINT(("notify_stat_changed(%ld, %lld, 0x%lx)\n", + request->device, request->node, request->details)); + result = notify_stat_changed(request->device, request->node, + request->details); + break; + + case B_ATTR_CHANGED: + PRINT(("notify_attribute_changed(%ld, %lld, \"%s\", 0x%lx)\n", + request->device, request->node, name, + (int32)request->details)); + result = notify_attribute_changed(request->device, + request->node, name, (int32)request->details); + break; + + default: + ERROR(("NotifyQueryRequest: unsupported operation: %ld\n", + request->operation)); + result = B_BAD_VALUE; + break; + } } + // prepare the reply RequestAllocator allocator(fPort->GetPort()); NotifyListenerReply* reply; status_t error = AllocateRequest(allocator, &reply); if (error != B_OK) return error; + reply->error = result; + // send the reply return fPort->SendRequest(&allocator); } @@ -143,67 +208,90 @@ // check and executed the request status_t result = B_OK; if (fFileSystem->KnowsSelectSyncEntry(request->sync)) { - PRINT(("notify_select_event(%p, %lu)\n", request->sync, request->ref)); - notify_select_event(request->sync, request->ref, request->event); + if (request->unspecifiedEvent) { + // old style add-ons can't provide an event argument; we shoot + // all events + notify_select_event(request->sync, request->ref, B_SELECT_READ); + notify_select_event(request->sync, request->ref, B_SELECT_WRITE); + notify_select_event(request->sync, request->ref, B_SELECT_ERROR); + } else { + PRINT(("notify_select_event(%p, %lu, %d)\n", request->sync, + request->ref, (int)request->event)); + notify_select_event(request->sync, request->ref, request->event); + } } else result = B_BAD_VALUE; + // prepare the reply RequestAllocator allocator(fPort->GetPort()); NotifySelectEventReply* reply; status_t error = AllocateRequest(allocator, &reply); if (error != B_OK) return error; + reply->error = result; + // send the reply return fPort->SendRequest(&allocator); } // _HandleRequest status_t -KernelRequestHandler::_HandleRequest(SendNotificationRequest* request) +KernelRequestHandler::_HandleRequest(NotifyQueryRequest* request) { // check and executed the request status_t result = B_OK; - if (fVolume && request->nsida != fVolume->GetID() - && request->nsidb != fVolume->GetID()) { + if (fVolume && request->device != fVolume->GetID()) result = B_BAD_VALUE; - } + // check the name char* name = (char*)request->name.GetData(); int32 nameLen = request->name.GetSize(); - if (name && (nameLen <= 0 || strnlen(name, nameLen) < 1)) - name = NULL; - else if (name) - name[nameLen - 1] = '\0'; - if (!name) { + if (!name || nameLen <= 0) { + ERROR(("NotifyQueryRequest: NULL name!\n")); + result = B_BAD_VALUE; + } else + name[nameLen - 1] = '\0'; // NULL-terminate to be safe + + // execute the request + if (result == B_OK) { switch (request->operation) { case B_ENTRY_CREATED: + PRINT(("notify_query_entry_created(%ld, %ld, %ld, %lld," + " \"%s\", %lld)\n", request->port, request->token, + request->device, request->directory, name, request->node)); + result = notify_query_entry_created(request->port, + request->token, request->device, request->directory, name, + request->node); + break; + + case B_ENTRY_REMOVED: + PRINT(("notify_query_entry_removed(%ld, %ld, %ld, %lld," + " \"%s\", %lld)\n", request->port, request->token, + request->device, request->directory, name, request->node)); + result = notify_query_entry_removed(request->port, + request->token, request->device, request->directory, name, + request->node); + break; + case B_ENTRY_MOVED: - ERROR(("send_notification(): NULL name for opcode: %ld\n", + default: + ERROR(("NotifyQueryRequest: unsupported operation: %ld\n", request->operation)); result = B_BAD_VALUE; break; - case B_ENTRY_REMOVED: - break; } } - // execute the request - if (result == B_OK) { - PRINT(("send_notification(%ld, %ld, %lu, %ld, %ld, %ld, %Ld, %Ld, %Ld, " - "`%s')\n", request->port, request->token, request->what, - request->operation, request->nsida, request->nsidb, request->vnida, - request->vnidb, request->vnidc, name)); - result = send_notification(request->port, request->token, request->what, - request->operation, request->nsida, request->nsidb, request->vnida, - request->vnidb, request->vnidc, name); - } + // prepare the reply RequestAllocator allocator(fPort->GetPort()); - SendNotificationReply* reply; + NotifyQueryReply* reply; status_t error = AllocateRequest(allocator, &reply); if (error != B_OK) return error; + reply->error = result; + // send the reply return fPort->SendRequest(&allocator); } @@ -344,22 +432,26 @@ // _HandleRequest status_t -KernelRequestHandler::_HandleRequest(IsVNodeRemovedRequest* request) +KernelRequestHandler::_HandleRequest(GetVNodeRemovedRequest* request) { // check and executed the request Volume* volume = NULL; status_t result = _GetVolume(request->nsid, &volume); VolumePutter _(volume); + bool removed = false; if (result == B_OK) - result = volume->IsVNodeRemoved(request->vnid); + result = volume->GetVNodeRemoved(request->vnid, &removed); + // prepare the reply RequestAllocator allocator(fPort->GetPort()); - IsVNodeRemovedReply* reply; + GetVNodeRemovedReply* reply; status_t error = AllocateRequest(allocator, &reply); if (error != B_OK) return error; - reply->error = (result < 0 ? result : B_OK); - reply->result = result; + + reply->error = result; + reply->removed = removed; + // send the reply return fPort->SendRequest(&allocator); } Modified: haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/KernelRequestHandler.h =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/KernelRequestHandler.h 2007-03-02 00:34:20 UTC (rev 20297) +++ haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/KernelRequestHandler.h 2007-03-02 00:41:09 UTC (rev 20298) @@ -9,28 +9,28 @@ namespace UserlandFSUtil { +class GetVNodeRemovedRequest; class GetVNodeRequest; -class IsVNodeRemovedRequest; class NewVNodeRequest; class NotifyListenerRequest; +class NotifyQueryRequest; class NotifySelectEventRequest; class PublishVNodeRequest; class PutVNodeRequest; class RemoveVNodeRequest; -class SendNotificationRequest; class UnremoveVNodeRequest; } +using UserlandFSUtil::GetVNodeRemovedRequest; using UserlandFSUtil::GetVNodeRequest; -using UserlandFSUtil::IsVNodeRemovedRequest; using UserlandFSUtil::NewVNodeRequest; using UserlandFSUtil::NotifyListenerRequest; +using UserlandFSUtil::NotifyQueryRequest; using UserlandFSUtil::NotifySelectEventRequest; using UserlandFSUtil::PublishVNodeRequest; using UserlandFSUtil::PutVNodeRequest; using UserlandFSUtil::RemoveVNodeRequest; -using UserlandFSUtil::SendNotificationRequest; using UserlandFSUtil::UnremoveVNodeRequest; class Volume; @@ -50,8 +50,7 @@ status_t _HandleRequest(NotifyListenerRequest* request); status_t _HandleRequest( NotifySelectEventRequest* request); - status_t _HandleRequest( - SendNotificationRequest* request); + status_t _HandleRequest(NotifyQueryRequest* request); // vnodes status_t _HandleRequest(GetVNodeRequest* request); status_t _HandleRequest(PutVNodeRequest* request); @@ -59,7 +58,7 @@ status_t _HandleRequest(PublishVNodeRequest* request); status_t _HandleRequest(RemoveVNodeRequest* request); status_t _HandleRequest(UnremoveVNodeRequest* request); - status_t _HandleRequest(IsVNodeRemovedRequest* request); + status_t _HandleRequest(GetVNodeRemovedRequest* request); status_t _GetVolume(mount_id id, Volume** volume); Modified: haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/Volume.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/Volume.cpp 2007-03-02 00:34:20 UTC (rev 20297) +++ haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/Volume.cpp 2007-03-02 00:41:09 UTC (rev 20298) @@ -129,7 +129,7 @@ status_t Volume::GetVNode(vnode_id vnid, fs_vnode* node) { -PRINT(("get_vnode(%ld, %Ld)\n", fID, vnid)); +PRINT(("get_vnode(%ld, %lld)\n", fID, vnid)); if (IsMounting() && !fMountVNodes->ContainsKey(vnid)) { ERROR(("Volume::GetVNode(): get_vnode() invoked for unknown vnode " "while mounting!\n")); @@ -144,7 +144,7 @@ status_t Volume::PutVNode(vnode_id vnid) { -PRINT(("put_vnode(%ld, %Ld)\n", fID, vnid)); +PRINT(("put_vnode(%ld, %lld)\n", fID, vnid)); status_t error = put_vnode(fID, vnid); if (error == B_OK) _DecrementVNodeCount(vnid); @@ -155,7 +155,7 @@ status_t Volume::NewVNode(vnode_id vnid, fs_vnode node) { -PRINT(("new_vnode(%ld, %Ld)\n", fID, vnid)); +PRINT(("new_vnode(%ld, %lld)\n", fID, vnid)); status_t error = new_vnode(fID, vnid, node); if (error == B_OK) { if (IsMounting()) { @@ -168,7 +168,7 @@ return error; } } -// TODO: Check what need to do according to the new semantics. +// TODO: Check what we need to do according to the new semantics. // _IncrementVNodeCount(vnid); } return error; @@ -178,7 +178,7 @@ status_t Volume::PublishVNode(vnode_id vnid, fs_vnode node) { -PRINT(("publish_vnode(%ld, %Ld)\n", fID, vnid)); +PRINT(("publish_vnode(%ld, %lld)\n", fID, vnid)); status_t error = publish_vnode(fID, vnid, node); if (error == B_OK) { if (IsMounting()) { @@ -199,7 +199,7 @@ status_t Volume::RemoveVNode(vnode_id vnid) { -PRINT(("remove_vnode(%ld, %Ld)\n", fID, vnid)); +PRINT(("remove_vnode(%ld, %lld)\n", fID, vnid)); return remove_vnode(fID, vnid); } @@ -207,16 +207,16 @@ status_t Volume::UnremoveVNode(vnode_id vnid) { -PRINT(("unremove_vnode(%ld, %Ld)\n", fID, vnid)); +PRINT(("unremove_vnode(%ld, %lld)\n", fID, vnid)); return unremove_vnode(fID, vnid); } -// IsVNodeRemoved +// GetVNodeRemoved status_t -Volume::IsVNodeRemoved(vnode_id vnid) +Volume::GetVNodeRemoved(vnode_id vnid, bool* removed) { -PRINT(("is_vnode_removed(%ld, %Ld)\n", fID, vnid)); - return is_vnode_removed(fID, vnid); +PRINT(("get_vnode_removed(%ld, %lld, %p)\n", fID, vnid, removed)); + return get_vnode_removed(fID, vnid, removed); } Modified: haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/Volume.h =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/Volume.h 2007-03-02 00:34:20 UTC (rev 20297) +++ haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/Volume.h 2007-03-02 00:41:09 UTC (rev 20298) @@ -41,7 +41,7 @@ status_t PublishVNode(vnode_id vnid, fs_vnode node); status_t RemoveVNode(vnode_id vnid); status_t UnremoveVNode(vnode_id vnid); - status_t IsVNodeRemoved(vnode_id vnid); + status_t GetVNodeRemoved(vnode_id vnid, bool* removed); // FS status_t Mount(const char* device, uint32 flags, Modified: haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/private/Requests.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/private/Requests.cpp 2007-03-02 00:34:20 UTC (rev 20297) +++ haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/private/Requests.cpp 2007-03-02 00:41:09 UTC (rev 20298) @@ -276,13 +276,14 @@ status_t NotifyListenerRequest::GetAddressInfos(AddressInfo* infos, int32* count) { + ADD_STRING(oldName); ADD_STRING(name); return B_OK; } -// SendNotificationRequest +// NotifyQueryRequest status_t -SendNotificationRequest::GetAddressInfos(AddressInfo* infos, int32* count) +NotifyQueryRequest::GetAddressInfos(AddressInfo* infos, int32* count) { ADD_STRING(name); return B_OK; @@ -635,11 +636,11 @@ // notifications case NOTIFY_LISTENER_REQUEST: case NOTIFY_SELECT_EVENT_REQUEST: - case SEND_NOTIFICATION_REQUEST: + case NOTIFY_QUERY_REQUEST: return false; case NOTIFY_LISTENER_REPLY: case NOTIFY_SELECT_EVENT_REPLY: - case SEND_NOTIFICATION_REPLY: + case NOTIFY_QUERY_REPLY: return true; // vnodes case GET_VNODE_REQUEST: @@ -648,7 +649,7 @@ case PUBLISH_VNODE_REQUEST: case REMOVE_VNODE_REQUEST: case UNREMOVE_VNODE_REQUEST: - case IS_VNODE_REMOVED_REQUEST: + case GET_VNODE_REMOVED_REQUEST: return false; case GET_VNODE_REPLY: case PUT_VNODE_REPLY: @@ -656,7 +657,7 @@ case PUBLISH_VNODE_REPLY: case REMOVE_VNODE_REPLY: case UNREMOVE_VNODE_REPLY: - case IS_VNODE_REMOVED_REPLY: + case GET_VNODE_REMOVED_REPLY: return true; // general reply @@ -835,11 +836,11 @@ // notifications case NOTIFY_LISTENER_REQUEST: case NOTIFY_SELECT_EVENT_REQUEST: - case SEND_NOTIFICATION_REQUEST: + case NOTIFY_QUERY_REQUEST: return true; case NOTIFY_LISTENER_REPLY: case NOTIFY_SELECT_EVENT_REPLY: - case SEND_NOTIFICATION_REPLY: + case NOTIFY_QUERY_REPLY: return false; // vnodes case GET_VNODE_REQUEST: @@ -848,7 +849,7 @@ case PUBLISH_VNODE_REQUEST: case REMOVE_VNODE_REQUEST: case UNREMOVE_VNODE_REQUEST: - case IS_VNODE_REMOVED_REQUEST: + case GET_VNODE_REMOVED_REQUEST: return true; case GET_VNODE_REPLY: case PUT_VNODE_REPLY: @@ -856,7 +857,7 @@ case PUBLISH_VNODE_REPLY: case REMOVE_VNODE_REPLY: case UNREMOVE_VNODE_REPLY: - case IS_VNODE_REMOVED_REPLY: + case GET_VNODE_REMOVED_REPLY: return false; // general reply Modified: haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/BeOSKernelVolume.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/BeOSKernelVolume.cpp 2007-03-02 00:34:20 UTC (rev 20297) +++ haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/BeOSKernelVolume.cpp 2007-03-02 00:41:09 UTC (rev 20298) @@ -213,7 +213,7 @@ uint32 ref, selectsync* sync) { if (!fFSOps->select) { - UserlandFS::KernelEmu::notify_select_event(sync, ref, event); + UserlandFS::KernelEmu::notify_select_event(sync, ref, event, false); return B_OK; } return fFSOps->select(fVolumeCookie, node, cookie, event, ref, sync); Modified: haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/beos_kernel_emu.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/beos_kernel_emu.cpp 2007-03-02 00:34:20 UTC (rev 20297) +++ haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/beos_kernel_emu.cpp 2007-03-02 00:41:09 UTC (rev 20298) @@ -4,12 +4,15 @@ #include #include +#include + #include #include #include #include "beos_fs_cache.h" #include "beos_lock.h" +#include "Debug.h" #include "kernel_emu.h" @@ -39,26 +42,83 @@ notify_listener(int op, nspace_id nsid, vnode_id vnida, vnode_id vnidb, vnode_id vnidc, const char *name) { - return UserlandFS::KernelEmu::notify_listener(op, nsid, vnida, vnidb, vnidc, - name); + switch (op) { + case B_ENTRY_CREATED: + case B_ENTRY_REMOVED: + if (!name) + name = ""; + return UserlandFS::KernelEmu::notify_listener(op, 0, nsid, 0, + vnida, vnidc, NULL, name); + + case B_ENTRY_MOVED: + if (!name) + name = ""; + // the old entry name is not available with the old interface + return UserlandFS::KernelEmu::notify_listener(op, 0, nsid, vnida, + vnidb, vnidc, "", name); + + case B_STAT_CHANGED: + { + // we don't know what stat field changed, so we mark them all + uint32 statFields = B_STAT_MODE | B_STAT_UID | B_STAT_GID + | B_STAT_SIZE | B_STAT_ACCESS_TIME | B_STAT_MODIFICATION_TIME + | B_STAT_CREATION_TIME | B_STAT_CHANGE_TIME; + return UserlandFS::KernelEmu::notify_listener(op, statFields, nsid, + 0, vnida, vnidc, NULL, NULL); + } + + case B_ATTR_CHANGED: + if (!name) + name = ""; + return UserlandFS::KernelEmu::notify_listener(op, B_ATTR_CHANGED, + nsid, 0, vnida, vnidc, NULL, name); + + default: + return B_BAD_VALUE; + } } // notify_select_event void notify_select_event(selectsync *sync, uint32 ref) { - // TODO: Check what best to supply as event arg! - UserlandFS::KernelEmu::notify_select_event(sync, ref, 0); + UserlandFS::KernelEmu::notify_select_event(sync, ref, 0, true); } // send_notification int send_notification(port_id port, long token, ulong what, long op, - nspace_id nsida, nspace_id nsidb, vnode_id vnida, vnode_id vnidb, + nspace_id nsida, nspace_id /*nsidb*/, vnode_id vnida, vnode_id vnidb, vnode_id vnidc, const char *name) { - return UserlandFS::KernelEmu::send_notification(port, token, what, op, - nsida, nsidb, vnida, vnidb, vnidc, name); + if (what != B_QUERY_UPDATE) + return B_BAD_VALUE; + + // check the name + if (!name) + name = ""; + + switch (op) { + case B_ENTRY_CREATED: + case B_ENTRY_REMOVED: + return UserlandFS::KernelEmu::notify_query(port, token, op, nsida, + vnida, name, vnidc); + case B_ENTRY_MOVED: + { + // translate to a B_ENTRY_REMOVED + B_ENTRY_CREATED pair + // We do at least miss the original name though. + status_t error = UserlandFS::KernelEmu::notify_query(port, token, + B_ENTRY_REMOVED, nsida, vnida, "", vnidc); + if (error != B_OK) + return error; + + return UserlandFS::KernelEmu::notify_query(port, token, + B_ENTRY_CREATED, nsida, vnidb, name, vnidc); + } + + default: + return B_BAD_VALUE; + } } @@ -106,7 +166,12 @@ int is_vnode_removed(nspace_id nsid, vnode_id vnid) { - return UserlandFS::KernelEmu::is_vnode_removed(nsid, vnid); + bool removed; + status_t error = UserlandFS::KernelEmu::get_vnode_removed(nsid, vnid, + &removed); + if (error != B_OK) + return error; + return (removed ? 1 : 0); } Modified: haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/kernel_emu.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/kernel_emu.cpp 2007-03-02 00:34:20 UTC (rev 20297) +++ haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/kernel_emu.cpp 2007-03-02 00:41:09 UTC (rev 20298) @@ -123,8 +123,9 @@ // notify_listener status_t -UserlandFS::KernelEmu::notify_listener(int op, mount_id nsid, vnode_id vnida, - vnode_id vnidb, vnode_id vnidc, const char *name) +UserlandFS::KernelEmu::notify_listener(int32 operation, uint32 details, + mount_id device, vnode_id oldDirectory, vnode_id directory, + vnode_id node, const char* oldName, const char* name) { // get the request port and the file system RequestPort* port; @@ -140,11 +141,15 @@ if (error != B_OK) return error; - request->operation = op; - request->nsid = nsid; - request->vnida = vnida; - request->vnidb = vnidb; - request->vnidc = vnidc; + request->operation = operation; + request->details = details; + request->device = device; + request->oldDirectory = oldDirectory; + request->directory = directory; + request->node = node; + error = allocator.AllocateString(request->oldName, oldName); + if (error != B_OK) + return error; error = allocator.AllocateString(request->name, name); if (error != B_OK) return error; @@ -166,7 +171,7 @@ // notify_select_event void UserlandFS::KernelEmu::notify_select_event(selectsync *sync, uint32 ref, - uint8 event) + uint8 event, bool unspecifiedEvent) { // get the request port and the file system RequestPort* port; @@ -185,6 +190,7 @@ request->sync = sync; request->ref = ref; request->event = event; + request->unspecifiedEvent = unspecifiedEvent; // send the request UserlandRequestHandler handler(fileSystem, NOTIFY_SELECT_EVENT_REPLY); @@ -199,9 +205,9 @@ // send_notification status_t -UserlandFS::KernelEmu::send_notification(port_id targetPort, long token, - ulong what, long op, mount_id nsida, mount_id nsidb, vnode_id vnida, - vnode_id vnidb, vnode_id vnidc, const char *name) +UserlandFS::KernelEmu::notify_query(port_id targetPort, int32 token, + int32 operation, mount_id device, vnode_id directory, const char* name, + vnode_id node) { // get the request port and the file system RequestPort* port; @@ -212,27 +218,24 @@ // prepare the request RequestAllocator allocator(port->GetPort()); - SendNotificationRequest* request; + NotifyQueryRequest* request; error = AllocateRequest(allocator, &request); if (error != B_OK) return error; request->port = targetPort; request->token = token; - request->what = what; - request->operation = op; - request->nsida = nsida; - request->nsidb = nsidb; - request->vnida = vnida; - request->vnidb = vnidb; - request->vnidc = vnidc; + request->operation = operation; + request->device = device; + request->directory = directory; + request->node = node; error = allocator.AllocateString(request->name, name); if (error != B_OK) return error; // send the request - UserlandRequestHandler handler(fileSystem, SEND_NOTIFICATION_REPLY); - SendNotificationReply* reply; + UserlandRequestHandler handler(fileSystem, NOTIFY_QUERY_REPLY); + NotifyQueryReply* reply; error = port->SendRequest(&allocator, &handler, (Request**)&reply); if (error != B_OK) return error; @@ -462,9 +465,10 @@ return error; } -// is_vnode_removed +// get_vnode_removed status_t -UserlandFS::KernelEmu::is_vnode_removed(mount_id nsid, vnode_id vnid) +UserlandFS::KernelEmu::get_vnode_removed(mount_id nsid, vnode_id vnid, + bool* removed) { // get the request port and the file system RequestPort* port; @@ -475,7 +479,7 @@ // prepare the request RequestAllocator allocator(port->GetPort()); - IsVNodeRemovedRequest* request; + GetVNodeRemovedRequest* request; error = AllocateRequest(allocator, &request); if (error != B_OK) return error; @@ -484,17 +488,16 @@ request->vnid = vnid; // send the request - UserlandRequestHandler handler(fileSystem, IS_VNODE_REMOVED_REPLY); - IsVNodeRemovedReply* reply; + UserlandRequestHandler handler(fileSystem, GET_VNODE_REMOVED_REPLY); + GetVNodeRemovedReply* reply; error = port->SendRequest(&allocator, &handler, (Request**)&reply); if (error != B_OK) return error; RequestReleaser requestReleaser(port, reply); // process the reply - if (reply->error != B_OK) - return reply->error; [... truncated: 41 lines follow ...] From bonefish at mail.berlios.de Fri Mar 2 02:45:59 2007 From: bonefish at mail.berlios.de (bonefish at BerliOS) Date: Fri, 2 Mar 2007 02:45:59 +0100 Subject: [Haiku-commits] r20299 - in haiku/trunk/src/add-ons/kernel/file_systems/userlandfs: kernel_add_on server Message-ID: <200703020145.l221jx2O008718@sheep.berlios.de> Author: bonefish Date: 2007-03-02 02:45:58 +0100 (Fri, 02 Mar 2007) New Revision: 20299 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20299&view=rev Modified: haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/Volume.cpp haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/BeOSKernelVolume.cpp Log: read_attr() was broken. We passed a pointer to the node instead of the cookie. Modified: haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/Volume.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/Volume.cpp 2007-03-02 00:41:09 UTC (rev 20298) +++ haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/Volume.cpp 2007-03-02 01:45:58 UTC (rev 20299) @@ -1880,7 +1880,7 @@ request->volume = fUserlandVolume; request->node = node; - request->attrCookie = node; + request->attrCookie = cookie; request->pos = pos; request->size = bufferSize; Modified: haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/BeOSKernelVolume.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/BeOSKernelVolume.cpp 2007-03-02 00:41:09 UTC (rev 20298) +++ haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/BeOSKernelVolume.cpp 2007-03-02 01:45:58 UTC (rev 20299) @@ -8,6 +8,7 @@ #include #include "beos_fs_interface.h" +#include "Debug.h" #include "kernel_emu.h" From bonefish at mail.berlios.de Fri Mar 2 08:09:18 2007 From: bonefish at mail.berlios.de (bonefish at BerliOS) Date: Fri, 2 Mar 2007 08:09:18 +0100 Subject: [Haiku-commits] r20300 - haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on Message-ID: <200703020709.l2279IMW012032@sheep.berlios.de> Author: bonefish Date: 2007-03-02 08:09:18 +0100 (Fri, 02 Mar 2007) New Revision: 20300 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20300&view=rev Modified: haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/Volume.cpp haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/Volume.h Log: We fake read_stat() on the root node and read_fs_info() when the connection to the server is lost. The former is required by our mount command (it stat()s the mount point for some reason unknown to me). The latter is just to be a good citizen. Modified: haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/Volume.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/Volume.cpp 2007-03-02 01:45:58 UTC (rev 20299) +++ haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/Volume.cpp 2007-03-02 07:09:18 UTC (rev 20300) @@ -2,6 +2,7 @@ #include #include +#include #include "AutoLocker.h" #include "Compatibility.h" @@ -178,7 +179,7 @@ status_t Volume::PublishVNode(vnode_id vnid, fs_vnode node) { -PRINT(("publish_vnode(%ld, %lld)\n", fID, vnid)); +PRINT(("publish_vnode(%ld, %lld, %p)\n", fID, vnid, node)); status_t error = publish_vnode(fID, vnid, node); if (error == B_OK) { if (IsMounting()) { @@ -312,33 +313,23 @@ status_t Volume::ReadFSInfo(fs_info* info) { - // get a free port - RequestPort* port = fFileSystem->GetPortPool()->AcquirePort(); - if (!port) - return B_ERROR; - PortReleaser _(fFileSystem->GetPortPool(), port); + // When the connection to the userland server is lost, we serve + // read_fs_info() requests manually. + status_t error = _ReadFSInfo(info); + if (error != B_OK && fFileSystem->GetPortPool()->IsDisconnected()) { + WARN(("Volume::Lookup(): connection lost, emulating lookup `.'\n")); - // prepare the request - RequestAllocator allocator(port->GetPort()); - ReadFSInfoRequest* request; - status_t error = AllocateRequest(allocator, &request); - if (error != B_OK) - return error; + info->flags = B_FS_IS_PERSISTENT | B_FS_IS_READONLY; + info->block_size = 512; + info->io_size = 512; + info->total_blocks = 0; + info->free_blocks = 0; + strlcpy(info->volume_name, fFileSystem->GetName(), + sizeof(info->volume_name)); + strlcat(info->volume_name, ":disconnected", sizeof(info->volume_name)); - request->volume = fUserlandVolume; - - // send the request - KernelRequestHandler handler(this, READ_FS_INFO_REPLY); - ReadFSInfoReply* reply; - error = _SendRequest(port, &allocator, &handler, (Request**)&reply); - if (error != B_OK) - return error; - RequestReleaser requestReleaser(port, reply); - - // process the reply - if (reply->error != B_OK) - return reply->error; - *info = reply->info; + error = B_OK; + } return error; } @@ -1041,34 +1032,29 @@ status_t Volume::ReadStat(fs_vnode node, struct stat* st) { - // get a free port - RequestPort* port = fFileSystem->GetPortPool()->AcquirePort(); - if (!port) - return B_ERROR; - PortReleaser _(fFileSystem->GetPortPool(), port); + // When the connection to the userland server is lost, we serve + // read_stat(fRootNode) requests manually to allow clean unmounting. + status_t error = _ReadStat(node, st); + if (error != B_OK && fFileSystem->GetPortPool()->IsDisconnected() + && node == fRootNode) { + WARN(("Volume::ReadStat(): connection lost, emulating stat for the " + "root node\n")); - // prepare the request - RequestAllocator allocator(port->GetPort()); - ReadStatRequest* request; - status_t error = AllocateRequest(allocator, &request); - if (error != B_OK) - return error; + st->st_dev = fID; + st->st_ino = fRootID; + st->st_mode = ACCESSPERMS; + st->st_nlink = 1; + st->st_uid = 0; + st->st_gid = 0; + st->st_size = 512; + st->st_blksize = 512; + st->st_atime = 0; + st->st_mtime = 0; + st->st_ctime = 0; + st->st_crtime = 0; - request->volume = fUserlandVolume; - request->node = node; - - // send the request - KernelRequestHandler handler(this, READ_STAT_REPLY); - ReadStatReply* reply; - error = _SendRequest(port, &allocator, &handler, (Request**)&reply); - if (error != B_OK) - return error; - RequestReleaser requestReleaser(port, reply); - - // process the reply - if (reply->error != B_OK) - return reply->error; - *st = reply->st; + error = B_OK; + } return error; } @@ -2570,6 +2556,40 @@ return error; } +// _ReadFSInfo +status_t +Volume::_ReadFSInfo(fs_info* info) +{ + // get a free port + RequestPort* port = fFileSystem->GetPortPool()->AcquirePort(); + if (!port) + return B_ERROR; + PortReleaser _(fFileSystem->GetPortPool(), port); + + // prepare the request + RequestAllocator allocator(port->GetPort()); + ReadFSInfoRequest* request; + status_t error = AllocateRequest(allocator, &request); + if (error != B_OK) + return error; + + request->volume = fUserlandVolume; + + // send the request + KernelRequestHandler handler(this, READ_FS_INFO_REPLY); + ReadFSInfoReply* reply; + error = _SendRequest(port, &allocator, &handler, (Request**)&reply); + if (error != B_OK) + return error; + RequestReleaser requestReleaser(port, reply); + + // process the reply + if (reply->error != B_OK) + return reply->error; + *info = reply->info; + return error; +} + // _Lookup status_t Volume::_Lookup(fs_vnode dir, const char* entryName, vnode_id* vnid, int* type) @@ -2645,6 +2665,41 @@ return error; } +// _ReadStat +status_t +Volume::_ReadStat(fs_vnode node, struct stat* st) +{ + // get a free port + RequestPort* port = fFileSystem->GetPortPool()->AcquirePort(); + if (!port) + return B_ERROR; + PortReleaser _(fFileSystem->GetPortPool(), port); + + // prepare the request + RequestAllocator allocator(port->GetPort()); + ReadStatRequest* request; + status_t error = AllocateRequest(allocator, &request); + if (error != B_OK) + return error; + + request->volume = fUserlandVolume; + request->node = node; + + // send the request + KernelRequestHandler handler(this, READ_STAT_REPLY); + ReadStatReply* reply; + error = _SendRequest(port, &allocator, &handler, (Request**)&reply); + if (error != B_OK) + return error; + RequestReleaser requestReleaser(port, reply); + + // process the reply + if (reply->error != B_OK) + return reply->error; + *st = reply->st; + return error; +} + // _Close status_t Volume::_Close(fs_vnode node, fs_cookie cookie) Modified: haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/Volume.h =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/Volume.h 2007-03-02 01:45:58 UTC (rev 20299) +++ haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/Volume.h 2007-03-02 07:09:18 UTC (rev 20300) @@ -174,9 +174,11 @@ status_t _Mount(const char* device, uint32 flags, const char* parameters); status_t _Unmount(); + status_t _ReadFSInfo(fs_info* info); status_t _Lookup(fs_vnode dir, const char* entryName, vnode_id* vnid, int* type); status_t _WriteVNode(fs_vnode node, bool reenter); + status_t _ReadStat(fs_vnode node, struct stat* st); status_t _Close(fs_vnode node, fs_cookie cookie); status_t _FreeCookie(fs_vnode node, fs_cookie cookie); status_t _CloseDir(fs_vnode node, fs_vnode cookie); From stefano.ceccherini at gmail.com Fri Mar 2 08:26:32 2007 From: stefano.ceccherini at gmail.com (Stefano Ceccherini) Date: Fri, 2 Mar 2007 08:26:32 +0100 Subject: [Haiku-commits] r20292 - in haiku/trunk: headers/os/interface headers/private/interface src/kits/interface src/servers/app In-Reply-To: <200703012317.l21NHh3k006324@sheep.berlios.de> References: <200703012317.l21NHh3k006324@sheep.berlios.de> Message-ID: <894b9700703012326n4e807560q2565907e13dc5388@mail.gmail.com> > Added "const" to many parameters. > Removed most data allocations/copying from PicturePlayer, ServerPicture now has to do this when converting coordinates. > Added additional functions to ViewLayer to copy&convert multiple BPoint, BRect, BRegion to Screen coordinates, those should be further optimized. > Removed some function call overhead. Marcus, this creates a problem. BPictures can be replayed also with the Play() function, without passing through the app_server (and through ServerPicture). With this change, I think we are no longer compatible with this behaviour. > Note: some functions of PicturePlayer don't appear to be implented by PictureDataWriter, Indeed, we can safely remove them from the header, they are a legacy of past implementations. From stefano.ceccherini at gmail.com Fri Mar 2 08:31:49 2007 From: stefano.ceccherini at gmail.com (Stefano Ceccherini) Date: Fri, 2 Mar 2007 08:31:49 +0100 Subject: [Haiku-commits] r20292 - in haiku/trunk: headers/os/interface headers/private/interface src/kits/interface src/servers/app In-Reply-To: <894b9700703012326n4e807560q2565907e13dc5388@mail.gmail.com> References: <200703012317.l21NHh3k006324@sheep.berlios.de> <894b9700703012326n4e807560q2565907e13dc5388@mail.gmail.com> Message-ID: <894b9700703012331t62e57999q340690d179129286@mail.gmail.com> 2007/3/2, Stefano Ceccherini : > > Added "const" to many parameters. > > Removed most data allocations/copying from PicturePlayer, ServerPicture now has to do this when converting coordinates. > > Added additional functions to ViewLayer to copy&convert multiple BPoint, BRect, BRegion to Screen coordinates, those should be further optimized. > > Removed some function call overhead. > > Marcus, this creates a problem. BPictures can be replayed also with > the Play() function, without passing through the app_server (and > through ServerPicture). With this change, I think we are no longer > compatible with this behaviour. Also, for reference, check the file /haiku/trunk/docs/develop/interface/BPicture_specifications.html in our repository. We need to respect that format for BPicture, to be able to read and play R5 pictures. From threedeyes at mail.berlios.de Fri Mar 2 08:41:41 2007 From: threedeyes at mail.berlios.de (threedeyes at BerliOS) Date: Fri, 2 Mar 2007 08:41:41 +0100 Subject: [Haiku-commits] r20301 - haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs Message-ID: <200703020741.l227ffeP014540@sheep.berlios.de> Author: threedeyes Date: 2007-03-02 08:41:35 +0100 (Fri, 02 Mar 2007) New Revision: 20301 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20301&view=rev Modified: haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/Jamfile haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/attrib.c haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/bootsect.c haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/compat.c haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/device.c haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/dir.c haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/dir.h haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/endians.h haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/index.c haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/inode.c haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/lcnalloc.c haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/logfile.c haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/logging.c haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/mft.c haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/misc.c haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/misc.h haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/runlist.c haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/security.c haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/unistr.c haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/unix_io.c haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/volume.c haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/volume.h Log: update libntfs-3g to 1.0 Modified: haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/Jamfile =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/Jamfile 2007-03-02 07:09:18 UTC (rev 20300) +++ haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/Jamfile 2007-03-02 07:41:35 UTC (rev 20301) @@ -1,7 +1,9 @@ SubDir HAIKU_TOP src add-ons kernel file_systems ntfs libntfs ; -SubDirCcFlags -Wall -Wno-multichar -DHAVE_CONFIG_H=1 -D_BEOS_=1 ; +SetSubDirSupportedPlatformsBeOSCompatible ; +SubDirCcFlags -Wall -Wno-multichar -DHAVE_CONFIG_H=1 ; + StaticLibrary libntfs.a : attrib.c attrlist.c Modified: haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/attrib.c =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/attrib.c 2007-03-02 07:09:18 UTC (rev 20300) +++ haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/attrib.c 2007-03-02 07:41:35 UTC (rev 20301) @@ -4180,8 +4180,9 @@ memmove((u8*)a + le16_to_cpu(a->name_offset) - 8, (u8*)a + le16_to_cpu(a->name_offset), a->name_length * sizeof(ntfschar)); - a->name_offset = cpu_to_le16(le16_to_cpu( - a->name_offset) - 8); + if (le16_to_cpu(a->name_offset) >= 8) + a->name_offset = cpu_to_le16( + le16_to_cpu(a->name_offset) - 8); a->mapping_pairs_offset = cpu_to_le16(le16_to_cpu( a->mapping_pairs_offset) - 8); Modified: haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/bootsect.c =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/bootsect.c 2007-03-02 07:09:18 UTC (rev 20300) +++ haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/bootsect.c 2007-03-02 07:41:35 UTC (rev 20301) @@ -64,25 +64,6 @@ ntfs_log_debug("Beginning bootsector check.\n"); - /* Calculate the checksum. Note, this is just a simple addition of - all u32 values in the bootsector starting at the beginning and - finishing at the offset of the checksum itself (i.e. not including - the checksum...). */ - if ((void*)b < (void*)&b->checksum) { - u32 *u = (u32 *)b; - u32 *bi = (u32 *)(&b->checksum); - - ntfs_log_debug("Calculating bootsector checksum.\n"); - - for (i = 0; u < bi; ++u) - i += le32_to_cpup(u); - - if (le32_to_cpu(b->checksum) && le32_to_cpu(b->checksum) != i) { - ntfs_log_error("Bootsector checksum failed.\n"); - goto not_ntfs; - } - } - ntfs_log_debug("Checking OEMid, NTFS signature.\n"); if (b->oem_id != cpu_to_le64(0x202020205346544eULL)) { /* "NTFS " */ ntfs_log_error("NTFS signature is missing.\n"); @@ -215,7 +196,8 @@ if (vol->dev->d_ops->seek(vol->dev, (sectors - 1) << vol->sector_size_bits, SEEK_SET) == -1) { - ntfs_log_perror("Failed to read last sector (%lld)", sectors); + ntfs_log_perror("Failed to read last sector (%lld)", + (long long)sectors); ntfs_log_error("Perhaps the volume is a RAID/LDM but it wasn't " "setup yet, or the\nwrong device was used, " "or the partition table is incorrect.\n" ); @@ -232,7 +214,8 @@ vol->mftmirr_lcn > vol->nr_clusters) { ntfs_log_error("$MFT LCN (%lld) or $MFTMirr LCN (%lld) is " "greater than the number of clusters (%lld).\n", - vol->mft_lcn, vol->mftmirr_lcn, vol->nr_clusters); + (long long)vol->mft_lcn, (long long)vol->mftmirr_lcn, + (long long)vol->nr_clusters); return -1; } Modified: haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/compat.c =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/compat.c 2007-03-02 07:09:18 UTC (rev 20300) +++ haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/compat.c 2007-03-02 07:41:35 UTC (rev 20301) @@ -20,7 +20,7 @@ * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -//#ifdef WINDOWS +#if defined(WINDOWS) || defined(__BEOS__) || defined (__HAIKU__) #ifdef HAVE_CONFIG_H #include "config.h" @@ -69,5 +69,5 @@ } #endif /* HAVE_FFS */ -//#endif /* WINDOWS */ +#endif /* defined(WINDOWS) || defined(__BEOS__) || defined (__HAIKU__) */ Modified: haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/device.c =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/device.c 2007-03-02 07:09:18 UTC (rev 20300) +++ haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/device.c 2007-03-02 07:41:35 UTC (rev 20301) @@ -409,7 +409,8 @@ if (vol->nr_clusters < lcn + count) { errno = ESPIPE; ntfs_log_perror("Trying to read outside of volume " - "(%lld < %lld)", vol->nr_clusters, lcn + count); + "(%lld < %lld)", (long long)vol->nr_clusters, + (long long)lcn + count); return -1; } br = ntfs_pread(vol->dev, lcn << vol->cluster_size_bits, @@ -444,7 +445,8 @@ if (vol->nr_clusters < lcn + count) { errno = ESPIPE; ntfs_log_perror("Trying to write outside of volume " - "(%lld < %lld)", vol->nr_clusters, lcn + count); + "(%lld < %lld)", (long long)vol->nr_clusters, + (long long)lcn + count); return -1; } if (!NVolReadOnly(vol)) Modified: haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/dir.c =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/dir.c 2007-03-02 07:09:18 UTC (rev 20300) +++ haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/dir.c 2007-03-02 07:41:35 UTC (rev 20301) @@ -259,7 +259,8 @@ if (br != 1) { if (br != -1) errno = EIO; - ntfs_log_perror("Failed to read vcn 0x%llx", vcn); + ntfs_log_perror("Failed to read vcn 0x%llx", + (unsigned long long)vcn); goto close_err_out; } @@ -1047,10 +1048,7 @@ /* Allocate MFT record for new file. */ ni = ntfs_mft_record_alloc(dir_ni->vol, NULL); if (!ni) { - err = errno; - ntfs_log_error("Could not allocate new MFT record: %s.\n", - strerror(err)); - errno = err; + ntfs_log_perror("Could not allocate new MFT record"); return NULL; } /* @@ -1158,12 +1156,10 @@ memcpy(data->target, target, target_len * sizeof(ntfschar)); break; -#ifndef _BEOS_ case S_IFSOCK: data = NULL; data_len = 1; break; -#endif default: /* FIFO or regular file. */ data = NULL; data_len = 0; @@ -1258,7 +1254,8 @@ ntfs_inode *ntfs_create(ntfs_inode *dir_ni, ntfschar *name, u8 name_len, dev_t type) { - if (type != S_IFREG && type != S_IFDIR && type != S_IFIFO /*&& type != S_IFSOCK*/) { + if (type != S_IFREG && type != S_IFDIR && type != S_IFIFO && + type != S_IFSOCK) { ntfs_log_error("Invalid arguments.\n"); return NULL; } @@ -1302,7 +1299,7 @@ } /* Non-empty directory? */ - if ((na->data_size != sizeof(INDEX_ROOT) + sizeof(INDEX_ENTRY_HEADER))){ + if ((na->data_size != sizeof(INDEX_ROOT) + sizeof(INDEX_ENTRY_HEADER))) { /* Both ENOTEMPTY and EEXIST are ok. We use the more common. */ errno = EEXIST; ntfs_log_debug("Directory is not empty\n"); @@ -1419,7 +1416,7 @@ if (ntfs_names_are_equal(fn->file_name, fn->file_name_length, name, name_len, case_sensitive, - ni->vol->upcase, ni->vol->upcase_len)){ + ni->vol->upcase, ni->vol->upcase_len)) { if (fn->file_name_type == FILE_NAME_WIN32) { looking_for_dos_name = TRUE; @@ -1532,7 +1529,7 @@ ntfs_inode_close(ni); if (err) { errno = err; - ntfs_log_perror("Could not delete file"); + ntfs_log_debug("Could not delete file: %s\n", strerror(errno)); return -1; } ntfs_log_trace("Done.\n"); Modified: haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/dir.h =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/dir.h 2007-03-02 07:09:18 UTC (rev 20300) +++ haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/dir.h 2007-03-02 07:41:35 UTC (rev 20301) @@ -33,6 +33,14 @@ #endif /* + * We do not have S_IFSOCK under BeOS/Haiku + */ +#if defined(__BEOS__) || defined(__HAIKU__) +#ifndef S_IFSOCK +#define S_IFSOCK 0140000 +#endif +#endif +/* * We do not have these under DJGPP, so define our version that do not conflict * with other S_IFs defined under DJGPP. */ Modified: haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/endians.h =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/endians.h 2007-03-02 07:09:18 UTC (rev 20300) +++ haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/endians.h 2007-03-02 07:41:35 UTC (rev 20301) @@ -1,6 +1,6 @@ /* - * endians.h - Definitions related to handling of byte ordering. Part of the - * Linux-NTFS project. + * endians.h - Definitions related to handling of byte ordering. + * Originated from the Linux-NTFS project. * * Copyright (c) 2000-2005 Anton Altaparmakov * @@ -15,7 +15,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program (in the main directory of the Linux-NTFS + * along with this program (in the main directory of the NTFS-3G * distribution in the file COPYING); if not, write to the Free Software * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ @@ -48,6 +48,9 @@ #ifdef HAVE_SYS_BYTEORDER_H #include #endif +#ifdef HAVE_BYTEORDER_H +#include +#endif #ifdef HAVE_SYS_PARAM_H #include #endif Modified: haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/index.c =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/index.c 2007-03-02 07:09:18 UTC (rev 20300) +++ haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/index.c 2007-03-02 07:41:35 UTC (rev 20301) @@ -88,7 +88,8 @@ 1, icx->block_size, buf); if (ret != 1) { ntfs_log_perror("Failed to write index block %lld of inode " - "%llu", vcn, icx->ni->mft_no); + "%llu", (long long)vcn, + (unsigned long long)icx->ni->mft_no); return STATUS_ERROR; } @@ -397,7 +398,8 @@ if (!ntfs_is_indx_record(ib->magic)) { ntfs_log_error("Corrupt index block signature: vcn %lld inode " - "%llu\n", (long long)vcn, icx->ni->mft_no); + "%llu\n", (long long)vcn, + (unsigned long long)icx->ni->mft_no); return -1; } @@ -405,8 +407,9 @@ ntfs_log_error("Corrupt index block: VCN (%lld) is different " "from expected VCN (%lld) in inode %llu\n", - (long long) sle64_to_cpu(ib->index_block_vcn), - (long long)vcn, icx->ni->mft_no); + (long long)sle64_to_cpu(ib->index_block_vcn), + (long long)vcn, + (unsigned long long)icx->ni->mft_no); return -1; } @@ -415,7 +418,8 @@ ntfs_log_error("Corrupt index block : VCN (%lld) of inode %llu " "has a size (%u) differing from the index " "specified size (%u)\n", (long long)vcn, - icx->ni->mft_no, ib_size, icx->block_size); + (unsigned long long)icx->ni->mft_no, ib_size, + icx->block_size); return -1; } return 0; @@ -489,7 +493,8 @@ (u8 *)ie + le16_to_cpu(ie->length) > index_end) { errno = ERANGE; ntfs_log_error("Index entry out of bounds in inode " - "%llu.\n", icx->ni->mft_no); + "%llu.\n", + (unsigned long long)icx->ni->mft_no); return STATUS_ERROR; } /* @@ -543,7 +548,8 @@ *vcn = ntfs_ie_get_vcn(ie); if (*vcn < 0) { errno = EINVAL; - ntfs_log_perror("Negative vcn in inode %llu\n", icx->ni->mft_no); + ntfs_log_perror("Negative vcn in inode %llu\n", + (unsigned long long)icx->ni->mft_no); return STATUS_ERROR; } @@ -560,7 +566,7 @@ na = ntfs_attr_open(ni, AT_INDEX_ALLOCATION, icx->name, icx->name_len); if (!na) { ntfs_log_perror("Failed to open index allocation of inode " - "%llu", ni->mft_no); + "%llu", (unsigned long long)ni->mft_no); return NULL; } @@ -581,7 +587,7 @@ ntfs_log_perror("Failed to read index block"); else ntfs_log_error("Failed to read full index block at " - "%lld\n", pos); + "%lld\n", (long long)pos); return -1; } @@ -755,7 +761,8 @@ if ((ib->index.ih_flags & NODE_MASK) == LEAF_NODE) { ntfs_log_error("Index entry with child node found in a leaf " - "node in inode 0x%llx.\n", ni->mft_no); + "node in inode 0x%llx.\n", + (unsigned long long)ni->mft_no); goto err_out; } Modified: haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/inode.c =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/inode.c 2007-03-02 07:09:18 UTC (rev 20300) +++ haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/inode.c 2007-03-02 07:41:35 UTC (rev 20301) @@ -1099,12 +1099,11 @@ */ void ntfs_inode_update_time(ntfs_inode *ni) { - if (!NVolReadOnly(ni->vol) && !NVolNoATime(ni->vol) && (ni->mft_no >= - FILE_first_user || ni->mft_no == FILE_root)) { + if (!NVolReadOnly(ni->vol) && + (ni->mft_no >= FILE_first_user || ni->mft_no == FILE_root)) { time_t now; now = time(NULL); - ni->last_access_time = now; ni->last_data_change_time = now; ni->last_mft_change_time = now; NInoFileNameSetDirty(ni); Modified: haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/lcnalloc.c =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/lcnalloc.c 2007-03-02 07:09:18 UTC (rev 20300) +++ haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/lcnalloc.c 2007-03-02 07:41:35 UTC (rev 20301) @@ -49,10 +49,10 @@ #define NTFS_LCNALLOC_SKIP 4096 -void ntfs_cluster_set_zone_pos(u8 zone, LCN zone_start, LCN zone_end, - LCN *zone_pos, LCN tc, LCN bmp_initial_pos) +static void ntfs_cluster_set_zone_pos(LCN zone_start, LCN zone_end, + LCN *zone_pos, LCN tc, LCN bmp_initial_pos) { - ntfs_log_trace("Before: zone %d = %lld\n", zone, (long long)*zone_pos); + ntfs_log_trace("Before: zone_pos: %lld\n", (long long)*zone_pos); if (tc >= zone_end) { *zone_pos = zone_start; @@ -63,29 +63,29 @@ tc >= zone_start) *zone_pos = tc; - ntfs_log_trace("After: zone %d = %lld\n", zone, (long long)*zone_pos); + ntfs_log_trace("After: zone_pos: %lld\n", (long long)*zone_pos); } -int ntfs_cluster_update_zone_pos(ntfs_volume *vol, u8 zone, LCN tc, - LCN bmp_initial_pos) +static int ntfs_cluster_update_zone_pos(ntfs_volume *vol, u8 zone, LCN tc, + LCN bmp_initial_pos) { ntfs_log_trace("tc = %lld, zone = %d\n", (long long)tc, zone); switch (zone) { case 1: - ntfs_cluster_set_zone_pos(zone, vol->mft_lcn, + ntfs_cluster_set_zone_pos(vol->mft_lcn, vol->mft_zone_end, &vol->mft_zone_pos, tc, bmp_initial_pos); break; case 2: - ntfs_cluster_set_zone_pos(zone, vol->mft_zone_end, + ntfs_cluster_set_zone_pos(vol->mft_zone_end, vol->nr_clusters, &vol->data1_zone_pos, tc, bmp_initial_pos); break; case 4: - ntfs_cluster_set_zone_pos(zone, 0, + ntfs_cluster_set_zone_pos(0, vol->mft_zone_start, &vol->data2_zone_pos, tc, bmp_initial_pos); Modified: haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/logfile.c =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/logfile.c 2007-03-02 07:09:18 UTC (rev 20300) +++ haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/logfile.c 2007-03-02 07:41:35 UTC (rev 20301) @@ -655,19 +655,16 @@ ntfs_log_trace("Entering.\n"); /* An empty $LogFile must have been clean before it got emptied. */ if (NVolLogFileEmpty(log_na->ni->vol)) { - ntfs_log_trace("Done. ($LogFile is empty.)\n"); + ntfs_log_trace("$LogFile is empty\n"); return TRUE; } if (!rp) { - ntfs_log_error("Restart page header is NULL.\n"); + ntfs_log_error("Restart page header is NULL\n"); return FALSE; } if (!ntfs_is_rstr_record(rp->magic) && !ntfs_is_chkd_record(rp->magic)) { - ntfs_log_error("Restart page buffer is invalid. This is " - "probably a bug in that the $LogFile should " - "have been consistency checked before calling " - "this function.\n"); + ntfs_log_error("Restart page buffer is invalid\n"); return FALSE; } @@ -679,11 +676,13 @@ */ if (ra->client_in_use_list != LOGFILE_NO_CLIENT && !(ra->flags & RESTART_VOLUME_IS_CLEAN)) { - ntfs_log_debug("Done. $LogFile indicates a dirty shutdown.\n"); + ntfs_log_error("$LogFile indicates unclean shutdown (%d, %d)\n", + le16_to_cpu(ra->client_in_use_list), + le16_to_cpu(ra->flags)); return FALSE; } /* $LogFile indicates a clean shutdown. */ - ntfs_log_trace("Done. $LogFile indicates a clean shutdown.\n"); + ntfs_log_trace("$LogFile indicates a clean shutdown\n"); return TRUE; } Modified: haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/logging.c =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/logging.c 2007-03-02 07:09:18 UTC (rev 20300) +++ haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/logging.c 2007-03-02 07:41:35 UTC (rev 20301) @@ -195,9 +195,9 @@ */ static FILE * ntfs_log_get_stream(u32 level) { -#ifdef _BEOS_ +#if defined(__BEOS__) || defined(__HAIKU__) return NULL; -#else +#elif FILE *stream; switch (level) { @@ -220,7 +220,7 @@ } return stream; -#endif +#endif } /** @@ -415,9 +415,9 @@ int ntfs_log_handler_fprintf(const char *function, const char *file, int line, u32 level, void *data, const char *format, va_list args) { -#ifdef _BEOS_ +#if defined(__BEOS__) || defined(__HAIKU__) return 0; -#else +#elif int ret = 0; int olderr = errno; FILE *stream; @@ -487,7 +487,7 @@ fflush(stream); errno = olderr; return ret; -#endif +#endif } /** @@ -536,13 +536,13 @@ int ntfs_log_handler_stdout(const char *function, const char *file, int line, u32 level, void *data, const char *format, va_list args) { -#ifndef _BEOS_ +#if defined(__BEOS__) || defined(__HAIKU__) + return 0; +#elif if (!data) data = stdout; return ntfs_log_handler_fprintf(function, file, line, level, data, format, args); -#else - return NULL; #endif } @@ -571,10 +571,14 @@ int ntfs_log_handler_outerr(const char *function, const char *file, int line, u32 level, void *data, const char *format, va_list args) { +#if defined(__BEOS__) || defined(__HAIKU__) + return 0; +#elif if (!data) data = ntfs_log_get_stream(level); return ntfs_log_handler_fprintf(function, file, line, level, data, format, args); +#endif } /** @@ -601,10 +605,14 @@ int ntfs_log_handler_stderr(const char *function, const char *file, int line, u32 level, void *data, const char *format, va_list args) { +#if defined(__BEOS__) || defined(__HAIKU__) + return 0; +#elif if (!data) data = stderr; return ntfs_log_handler_fprintf(function, file, line, level, data, format, args); +#endif } Modified: haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/mft.c =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/mft.c 2007-03-02 07:09:18 UTC (rev 20300) +++ haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/mft.c 2007-03-02 07:41:35 UTC (rev 20301) @@ -92,8 +92,8 @@ vol->mft_record_size_bits) { errno = ESPIPE; ntfs_log_perror("Trying to read non-allocated mft records " - "(%lld > %lld)", m + count, - vol->mft_na->initialized_size >> + "(%lld > %lld)", (long long)m + count, + (long long)vol->mft_na->initialized_size >> vol->mft_record_size_bits); return -1; } @@ -155,8 +155,8 @@ vol->mft_record_size_bits) { errno = ESPIPE; ntfs_log_perror("Trying to write non-allocated mft records " - "(%lld > %lld)", m + count, - vol->mft_na->initialized_size >> + "(%lld > %lld)", (long long)m + count, + (long long)vol->mft_na->initialized_size >> vol->mft_record_size_bits); return -1; } Modified: haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/misc.c =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/misc.c 2007-03-02 07:09:18 UTC (rev 20300) +++ haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/misc.c 2007-03-02 07:41:35 UTC (rev 20301) @@ -3,6 +3,10 @@ #endif #ifdef HAVE_STDLIB_H +#include +#endif + +#ifdef HAVE_STDLIB_H #include #endif @@ -34,3 +38,17 @@ return p; } +#if defined(__BEOS__) || defined(__HAIKU__) +int ntfs_snprintf(char *buff, size_t size, const char *format, ...) +{ + int ret; + char buffer[BUFSIZ]; + va_list args; + va_start(args, format); + memset(buffer,0,BUFSIZ); + ret = sprintf(buffer, format, args); + va_end(args); + strncpy(buff,buffer,size); + return ret; + } +#endif \ No newline at end of file Modified: haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/misc.h =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/misc.h 2007-03-02 07:09:18 UTC (rev 20300) +++ haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/misc.h 2007-03-02 07:41:35 UTC (rev 20301) @@ -4,5 +4,8 @@ void *ntfs_calloc(size_t size); void *ntfs_malloc(size_t size); +#if defined(__BEOS__) || defined(__HAIKU__) +#define snprintf ntfs_snprintf +#endif /* defined(__BEOS__) || defined(__HAIKU__) */ #endif /* _NTFS_MISC_H_ */ Modified: haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/runlist.c =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/runlist.c 2007-03-02 07:09:18 UTC (rev 20300) +++ haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/runlist.c 2007-03-02 07:41:35 UTC (rev 20301) @@ -1040,7 +1040,8 @@ if (!vol || !rl || pos < 0 || count < 0) { errno = EINVAL; ntfs_log_perror("Failed to read runlist [vol: %p rl: %p " - "pos: %lld count: %lld]", vol, rl, pos, count); + "pos: %lld count: %lld]", vol, rl, + (long long)pos, (long long)count); return -1; } if (!count) @@ -1127,7 +1128,8 @@ if (!vol || !rl || pos < 0 || count < 0) { errno = EINVAL; ntfs_log_perror("Failed to write runlist [vol: %p rl: %p " - "pos: %lld count: %lld]", vol, rl, pos, count); + "pos: %lld count: %lld]", vol, rl, + (long long)pos, (long long)count); goto errno_set; } if (!count) Modified: haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/security.c =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/security.c 2007-03-02 07:09:18 UTC (rev 20300) +++ haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/security.c 2007-03-02 07:41:35 UTC (rev 20301) @@ -44,21 +44,6 @@ #include "security.h" #include "misc.h" -#ifdef _BEOS_ -int be_snprintf(char *buff, size_t size, const char *format, ...) -{ - int ret; - char temp[1024]; - va_list args; - va_start(args, format); - ret = sprintf(temp, format, args); - va_end(args); - strncpy(buff,temp,size); - return ret; -} -#define snprintf be_snprintf -#endif - /* * The zero GUID. */ Modified: haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/unistr.c =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/unistr.c 2007-03-02 07:09:18 UTC (rev 20300) +++ haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/unistr.c 2007-03-02 07:41:35 UTC (rev 20301) @@ -373,27 +373,28 @@ err_val, ic, upcase, upcase_len); } -#ifdef _BEOS_ - - +#if defined(__BEOS__) || defined(__HAIKU__) +/* Encode a single wide character into a sequence of utf8 bytes. + * Returns the number of bytes consumed, or 0 on error. + */ static int -to_utf8(wchar_t c,unsigned char* buf) +ntfs_wc_to_utf8(wchar_t c,unsigned char* buf) { if(c==0) return 0; /* No support for embedded 0 runes */ - if(c<0x80){ + if(c<0x80) { if(buf)buf[0]=(unsigned char)c; return 1; } - if(c<0x800){ - if(buf){ + if(c<0x800) { + if(buf) { buf[0] = 0xc0 | (c>>6); buf[1] = 0x80 | (c & 0x3f); } return 2; } - if(c<0x10000){ - if(buf){ + if(c<0x10000) { + if(buf) { buf[0] = 0xe0 | (c>>12); buf[1] = 0x80 | ((c>>6) & 0x3f); buf[2] = 0x80 | (c & 0x3f); @@ -410,30 +411,30 @@ * Returns the number of bytes consumed, or 0 on error. */ static int -from_utf8(const unsigned char* str,wchar_t *c) +ntfs_wc_from_utf8(const unsigned char* str,wchar_t *c) { int l=0,i; - if(*str<0x80){ + if(*str<0x80) { *c = *str; return 1; } if(*str<0xc0) /* lead byte must not be 10xxxxxx */ return 0; /* is c0 a possible lead byte? */ - if(*str<0xe0){ /* 110xxxxx */ + if(*str<0xe0) { /* 110xxxxx */ *c = *str & 0x1f; l=2; - }else if(*str<0xf0){ /* 1110xxxx */ + } else if(*str<0xf0) { /* 1110xxxx */ *c = *str & 0xf; l=3; - }else if(*str<0xf8){ /* 11110xxx */ + } else if(*str<0xf8) { /* 11110xxx */ *c = *str & 7; l=4; - }else /* We don't support characters above 0xFFFF in NTFS */ + } else /* We don't support characters above 0xFFFF in NTFS */ return 0; - for(i=1;id_name); goto err_out; } -#endif - +#endif NDevSetOpen(dev); return 0; err_out: @@ -157,8 +157,10 @@ } if (NDevDirty(dev)) fsync(DEV_FD(dev)); - /* Release exclusive (mandatory) lock on the whole device. */ -#ifndef _BEOS_ + +/* locking not implemented in BeOS */ +#if !defined(__BEOS__) && !defined(__HAIKU__) + /* Release exclusive (mandatory) lock on the whole device. */ memset(&flk, 0, sizeof(flk)); flk.l_type = F_UNLCK; flk.l_whence = SEEK_SET; @@ -243,7 +245,7 @@ static s64 ntfs_device_unix_io_pread(struct ntfs_device *dev, void *buf, s64 count, s64 offset) { -#ifdef _BEOS_ +#if defined(__BEOS__) || defined(__HAIKU__) return read_pos(DEV_FD(dev), offset, buf,count); #else return pread(DEV_FD(dev), buf, count, offset); @@ -269,11 +271,11 @@ return -1; } NDevSetDirty(dev); -#ifdef _BEOS_ +#if defined(__BEOS__) || defined(__HAIKU__) return write_pos(DEV_FD(dev), offset, buf,count); #else return pwrite(DEV_FD(dev), buf, count, offset); -#endif +#endif } /** Modified: haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/volume.c =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/volume.c 2007-03-02 07:09:18 UTC (rev 20300) +++ haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/volume.c 2007-03-02 07:41:35 UTC (rev 20301) @@ -203,7 +203,8 @@ NInoSetAttrList(vol->mft_ni); l = ntfs_get_attribute_value_length(ctx->attr); if (l <= 0 || l > 0x40000) { - ntfs_log_error("$MFT/$ATTR_LIST invalid length (%lld).\n", l); + ntfs_log_error("$MFT/$ATTR_LIST invalid length (%lld).\n", + (long long)l); goto io_error_exit; } vol->mft_ni->attr_list_size = l; @@ -218,7 +219,8 @@ } if (l != vol->mft_ni->attr_list_size) { ntfs_log_error("Partial read of $MFT/$ATTR_LIST (%lld != " - "%u).\n", l, vol->mft_ni->attr_list_size); + "%u).\n", (long long)l, + vol->mft_ni->attr_list_size); goto io_error_exit; } @@ -774,7 +776,8 @@ ntfs_log_perror("Failed to read $MFT"); else { ntfs_log_error("Failed to read $MFT, unexpected length " - "(%lld != %d).\n", l, vol->mftmirr_size); + "(%lld != %d).\n", (long long)l, + vol->mftmirr_size); errno = EIO; } goto error_exit; @@ -790,7 +793,8 @@ else { ntfs_log_error("Failed to read $MFTMirr " "unexpected length (%d != %lld)." - "\n", vol->mftmirr_size, l); + "\n", vol->mftmirr_size, + (long long)l); errno = EIO; } goto error_exit; @@ -917,7 +921,8 @@ if (l != na->data_size) { ntfs_log_debug(FAILED); ntfs_log_error("Failed to read $UpCase, unexpected length " - "(%lld != %lld).\n", l, na->data_size); + "(%lld != %lld).\n", (long long)l, + (long long)na->data_size); errno = EIO; goto error_exit; } @@ -1076,7 +1081,8 @@ if (l != na->data_size) { ntfs_log_debug(FAILED); ntfs_log_error("Failed to read $AttrDef, unexpected length " - "(%lld != %lld).\n", l, na->data_size); + "(%lld != %lld).\n", (long long)l, + (long long)na->data_size); errno = EIO; goto error_exit; } Modified: haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/volume.h =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/volume.h 2007-03-02 07:09:18 UTC (rev 20300) +++ haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/volume.h 2007-03-02 07:41:35 UTC (rev 20301) @@ -61,6 +61,8 @@ #endif #endif +#define MS_EXCLUSIVE 0x08000000 + /* Forward declaration */ typedef struct _ntfs_volume ntfs_volume; From threedeyes at mail.berlios.de Fri Mar 2 08:48:35 2007 From: threedeyes at mail.berlios.de (threedeyes at BerliOS) Date: Fri, 2 Mar 2007 08:48:35 +0100 Subject: [Haiku-commits] r20302 - haiku/trunk/src/add-ons/kernel/file_systems/ntfs Message-ID: <200703020748.l227mZcH015094@sheep.berlios.de> Author: threedeyes Date: 2007-03-02 08:48:19 +0100 (Fri, 02 Mar 2007) New Revision: 20302 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20302&view=rev Removed: haiku/trunk/src/add-ons/kernel/file_systems/ntfs/kernel_interface.cpp Modified: haiku/trunk/src/add-ons/kernel/file_systems/ntfs/Jamfile haiku/trunk/src/add-ons/kernel/file_systems/ntfs/attributes.c haiku/trunk/src/add-ons/kernel/file_systems/ntfs/attributes.h haiku/trunk/src/add-ons/kernel/file_systems/ntfs/fs_func.c haiku/trunk/src/add-ons/kernel/file_systems/ntfs/lock.h haiku/trunk/src/add-ons/kernel/file_systems/ntfs/ntfs.h haiku/trunk/src/add-ons/kernel/file_systems/ntfs/ntfsdir.c haiku/trunk/src/add-ons/kernel/file_systems/ntfs/ntfsdir.h haiku/trunk/src/add-ons/kernel/file_systems/ntfs/volume_util.c haiku/trunk/src/add-ons/kernel/file_systems/ntfs/volume_util.h Log: Fixed build for R5 and dano targets. Bug fixes for fs_rename and fs_walk functions. Added simple identify functions for haiku. Modified: haiku/trunk/src/add-ons/kernel/file_systems/ntfs/Jamfile =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/ntfs/Jamfile 2007-03-02 07:41:35 UTC (rev 20301) +++ haiku/trunk/src/add-ons/kernel/file_systems/ntfs/Jamfile 2007-03-02 07:48:19 UTC (rev 20302) @@ -2,9 +2,11 @@ SubDirHdrs [ FDirName $(SUBDIR) libntfs ] ; -SubDirCcFlags -DHAVE_CONFIG_H=1 -D_READ_ONLY_=1 ; -SubDirC++Flags -DHAVE_CONFIG_H=1 -D_READ_ONLY_=1 ; +SetSubDirSupportedPlatformsBeOSCompatible ; +SubDirCcFlags -DHAVE_CONFIG_H=1 ; +SubDirC++Flags -DHAVE_CONFIG_H=1 ; + UsePrivateHeaders kernel ; KernelAddon ntfs : @@ -14,8 +16,7 @@ ntfsdir.c volume_util.c fs_func.c - kernel_interface.cpp - kernel_cpp.cpp + kernel_interface.c : libntfs.a ; Modified: haiku/trunk/src/add-ons/kernel/file_systems/ntfs/attributes.c =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/ntfs/attributes.c 2007-03-02 07:41:35 UTC (rev 20301) +++ haiku/trunk/src/add-ons/kernel/file_systems/ntfs/attributes.c 2007-03-02 07:48:19 UTC (rev 20302) @@ -54,8 +54,13 @@ } +#ifdef __HAIKU__ status_t fs_open_attrib_dir(void *_ns, void *_node, void **_cookie) +#else +int +fs_open_attrib_dir(void *_ns, void *_node, void **_cookie) +#endif { nspace *ns = (nspace *)_ns; int result = B_NO_ERROR; @@ -80,8 +85,13 @@ return result; } +#ifdef __HAIKU__ status_t fs_close_attrib_dir(void *_ns, void *_node, void *_cookie) +#else +int +fs_close_attrib_dir(void *_ns, void *_node, void *_cookie) +#endif { nspace *ns = (nspace *)_ns; @@ -98,9 +108,13 @@ return B_NO_ERROR; } - +#ifdef __HAIKU__ status_t fs_free_attrib_dir_cookie(void *_ns, void *_node, void *_cookie) +#else +int +fs_free_attrib_dir_cookie(void *_ns, void *_node, void *_cookie) +#endif { nspace *ns = (nspace *)_ns; int result = B_NO_ERROR; @@ -127,9 +141,13 @@ return result; } - +#ifdef __HAIKU__ status_t fs_rewind_attrib_dir(void *_ns, void *_node, void *_cookie) +#else +int +fs_rewind_attrib_dir(void *_ns, void *_node, void *_cookie) +#endif { nspace *ns = (nspace *)_ns; int result = B_NO_ERROR; @@ -156,8 +174,13 @@ } +#ifdef __HAIKU__ status_t fs_read_attrib_dir(void *_ns, void *_node, void *_cookie, struct dirent *entry, size_t bufsize, uint32 *num) +#else +int +fs_read_attrib_dir(void *_ns, void *_node, void *_cookie, long *num, struct dirent *entry, size_t bufsize) +#endif { nspace *ns = (nspace *)_ns; vnode *node = (vnode *)_node; @@ -187,7 +210,28 @@ return B_NO_ERROR; } +#ifndef __HAIKU__ +int +fs_read_attrib_stat(void *_ns, void *_node, const char *name, struct attr_info *buf) +{ + nspace *ns = (nspace *)_ns; + vnode *node = (vnode *)_node; + if (strcmp(name, "BEOS:TYPE")) + return ENOENT; + + if (node->mime == NULL) { + return ENOENT; + } + + buf->type = MIME_STRING_TYPE; + buf->size = strlen(node->mime) + 1; + + return 0; +} +#endif + +#ifdef __HAIKU__ status_t fs_open_attrib(void *_ns, void *_node, const char *name, int openMode, fs_cookie *_cookie) { @@ -219,22 +263,25 @@ return result; } +#endif - +#ifdef __HAIKU__ status_t fs_close_attrib(void *_ns, void *_node, fs_cookie cookie) { return B_NO_ERROR; } +#endif - +#ifdef __HAIKU__ status_t fs_free_attrib_cookie(void *_ns, void *_node, fs_cookie cookie) { return B_NO_ERROR; } +#endif - +#ifdef __HAIKU__ status_t fs_read_attrib_stat(void *_ns, void *_node, fs_cookie _cookie, struct stat *stat) { @@ -267,10 +314,15 @@ return B_NO_ERROR; } +#endif - +#ifdef __HAIKU__ status_t fs_read_attrib(void *_ns, void *_node, fs_cookie _cookie, off_t pos, void *buffer, size_t *_length) +#else +int +fs_read_attrib(void *_ns, void *_node, const char *name, int type, void *buffer, size_t *_length, off_t pos) +#endif { nspace *ns = (nspace *)_ns; vnode *node = (vnode *)_node; @@ -280,10 +332,12 @@ ERRPRINT("fs_read_attr - ENTER\n"); +#ifdef __HAIKU_ if (_cookie != &kBeOSTypeCookie) { result = ENOENT; goto exit; } +#endif if (node->mime == NULL) { result = ENOENT; @@ -309,9 +363,13 @@ } +#ifdef __HAIKU__ status_t -fs_write_attrib(void *_ns, void *_node, fs_cookie _cookie, off_t pos, - const void *buffer, size_t *_length) +fs_write_attrib(void *_ns, void *_node, fs_cookie _cookie, off_t pos,const void *buffer, size_t *_length) +#else +int +fs_write_attrib(void *_ns, void *_node, const char *name, int type, const void *buffer, size_t *_length, off_t pos) +#endif { nspace *ns = (nspace *)_ns; int result = B_NO_ERROR; @@ -321,11 +379,12 @@ ERRPRINT("fs_write_attr - ENTER\n"); *_length = 0; - +#ifdef __HAIKU_ if (_cookie != &kBeOSTypeCookie) { result = ENOSYS; goto exit; } +#endif exit: ERRPRINT("fs_write_attrib - EXIT, result is %s\n", strerror(result)); Modified: haiku/trunk/src/add-ons/kernel/file_systems/ntfs/attributes.h =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/ntfs/attributes.h 2007-03-02 07:41:35 UTC (rev 20301) +++ haiku/trunk/src/add-ons/kernel/file_systems/ntfs/attributes.h 2007-03-02 07:48:19 UTC (rev 20302) @@ -14,6 +14,9 @@ status_t set_mime(vnode *node, const char *filename); + +#ifdef __HAIKU__ + status_t fs_open_attrib_dir(void *_vol, void *_node, void **_cookie); status_t fs_close_attrib_dir(void *_vol, void *_node, void *_cookie); status_t fs_free_attrib_dir_cookie(void *_vol, void *_node, void *_cookie); @@ -26,4 +29,17 @@ status_t fs_read_attrib(void *_vol, void *_node, fs_cookie _cookie, off_t pos,void *buffer, size_t *_length); status_t fs_write_attrib(void *_vol, void *_node, fs_cookie _cookie, off_t pos, const void *buffer, size_t *_length); +#else + +int fs_open_attrib_dir(void *_vol, void *_node, void **_cookie); +int fs_close_attrib_dir(void *_vol, void *_node, void *_cookie); +int fs_free_attrib_dir_cookie(void *_vol, void *_node, void *_cookie); +int fs_rewind_attrib_dir(void *_vol, void *_node, void *_cookie); +int fs_read_attrib_dir(void *_vol, void *_node, void *_cookie, long *num, struct dirent *buf, size_t bufsize); +int fs_read_attrib_stat(void *_vol, void *_node, const char *name, struct attr_info *buf); +int fs_read_attrib(void *_vol, void *_node, const char *name, int type, void *buf, size_t *len, off_t pos); +int fs_write_attrib(void *_vol, void *_node, const char *name, int type, const void *buf, size_t *len, off_t pos); + +#endif //__HAIKU__ + #endif Modified: haiku/trunk/src/add-ons/kernel/file_systems/ntfs/fs_func.c =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/ntfs/fs_func.c 2007-03-02 07:41:35 UTC (rev 20301) +++ haiku/trunk/src/add-ons/kernel/file_systems/ntfs/fs_func.c 2007-03-02 07:48:19 UTC (rev 20302) @@ -2,7 +2,7 @@ * Copyright (c) 2000-2004 Anton Altaparmakov * Copyright (c) 2002-2006 Szabolcs Szakacsits * - * Copyright (c) 2006 Troeglazov Gerasim (3dEyes**) + * Copyright (c) 2006-2007 Troeglazov Gerasim (3dEyes**) * * This program/include file is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as published by @@ -34,84 +34,85 @@ #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include - #include "ntfs.h" #include "attributes.h" #include "lock.h" #include "volume_util.h" +#include "fs_func.h" -status_t fs_mount( mount_id nsid, const char *device, ulong flags, const char *args, void **data, vnode_id *vnid ); -status_t fs_unmount(void *_ns); -status_t fs_rfsstat(void *_ns, struct fs_info *); -status_t fs_wfsstat(void *_vol, const struct fs_info *fss, uint32 mask); -status_t fs_sync(void *_ns); -status_t fs_walk(void *_ns, void *_base, const char *file, vnode_id *vnid,int *_type); -status_t fs_get_vnode_name(void *_ns, void *_node, char *buffer, size_t bufferSize); -status_t fs_read_vnode(void *_ns, vnode_id vnid, void **_node, bool reenter); -status_t fs_write_vnode(void *_ns, void *_node, bool reenter); -status_t fs_remove_vnode( void *_ns, void *_node, bool reenter ); -status_t fs_access( void *ns, void *node, int mode ); -status_t fs_rstat(void *_ns, void *_node, struct stat *st); -status_t fs_wstat(void *_vol, void *_node, const struct stat *st, uint32 mask); -status_t fs_create(void *_ns, void *_dir, const char *name, int omode, int perms, void **_cookie, vnode_id *_vnid); -status_t fs_open(void *_ns, void *_node, int omode, void **cookie); -status_t fs_close(void *ns, void *node, void *cookie); -status_t fs_free_cookie(void *ns, void *node, void *cookie); -status_t fs_read(void *_ns, void *_node, void *cookie, off_t pos, void *buf, size_t *len); -status_t fs_write(void *ns, void *node, void *cookie, off_t pos, const void *buf, size_t *len); -status_t fs_mkdir(void *_ns, void *_node, const char *name, int perms, vnode_id *_vnid); -status_t fs_rmdir(void *_ns, void *dir, const char *name); -status_t fs_opendir(void* _ns, void* _node, void** cookie); -status_t fs_readdir( void *_ns, void *_node, void *_cookie, struct dirent *buf, size_t bufsize, uint32 *num ); -status_t fs_rewinddir(void *_ns, void *_node, void *cookie); -status_t fs_closedir(void *_ns, void *_node, void *cookie); -status_t fs_free_dircookie(void *_ns, void *_node, void *cookie); -status_t fs_readlink(void *_ns, void *_node, char *buf, size_t *bufsize); -status_t fs_fsync(void *_ns, void *_node); -status_t fs_rename(void *_ns, void *_odir, const char *oldname, void *_ndir, const char *newname); -status_t fs_unlink(void *_ns, void *_node, const char *name); -status_t fs_create_symlink(void *_ns, void *_dir, const char *name, const char *target, int mode); - -void fs_free_identify_partition_cookie(partition_data *partition, void *_cookie); -status_t fs_scan_partition(int fd, partition_data *partition, void *_cookie); -float fs_identify_partition(int fd, partition_data *partition, void **_cookie); - #ifndef _READ_ONLY_ static status_t do_unlink(nspace *vol, vnode *dir, const char *name, bool isdir); #endif -//not emplemented now +#ifdef __HAIKU__ + +typedef struct identify_cookie { + NTFS_BOOT_SECTOR boot; +} identify_cookie; + float fs_identify_partition(int fd, partition_data *partition, void **_cookie) { - return 0.0f; + NTFS_BOOT_SECTOR boot; + identify_cookie *cookie; + uint8 *buf=(uint8*)&boot; + + // read in the boot sector + ERRPRINT("fs_identify_partition: read in the boot sector\n"); + if (read_pos(fd, 0, (void*)&boot, 512) != 512) { + return -1; + } + + // only check boot signature on hard disks to account for broken mtools + // behavior + + // check boot signature + if (((buf[0x1fe] != 0x55) || (buf[0x1ff] != 0xaa)) && (buf[0x15] == 0xf8)) + return -1; + + //check boot signature NTFS + if (memcmp(buf+3, "NTFS ", 8)!=0) + return -1; + + //allocate identify_cookie + cookie = (identify_cookie *)malloc(sizeof(identify_cookie)); + if (!cookie) + return -1; + + memcpy(&(cookie->boot),&boot,512); + + *_cookie = cookie; + + return 0.8f; } -//not emplemented now status_t fs_scan_partition(int fd, partition_data *partition, void *_cookie) { + identify_cookie *cookie = (identify_cookie *)_cookie; + partition->status = B_PARTITION_VALID; + partition->flags |= B_PARTITION_FILE_SYSTEM; + partition->content_size = sle64_to_cpu(cookie->boot.number_of_sectors) * le16_to_cpu(cookie->boot.bpb.bytes_per_sector); + partition->block_size = le16_to_cpu(cookie->boot.bpb.bytes_per_sector); + partition->content_name = strdup("NTFS Volume"); return B_OK; } -//not emplemented now void fs_free_identify_partition_cookie(partition_data *partition, void *_cookie) { + identify_cookie *cookie = (identify_cookie *)_cookie; + free(cookie); } +#endif //__HAIKU__ - +#ifdef __HAIKU__ status_t fs_mount( mount_id nsid, const char *device, ulong flags, const char *args, void **data, vnode_id *vnid ) +#else +int +fs_mount(nspace_id nsid, const char *device, ulong flags, void *parms, size_t len, void **data, vnode_id *vnid) +#endif { nspace *ns; vnode *newNode = NULL; @@ -119,7 +120,7 @@ status_t result = B_NO_ERROR; ERRPRINT("fs_mount - ENTER\n"); - + ns = ntfs_malloc(sizeof(nspace)); if (!ns) { result = ENOMEM; @@ -138,11 +139,17 @@ strcpy(ns->devicePath,device); sprintf(lockname, "ntfs_lock %lx", ns->id); - if ((result = recursive_lock_init(&(ns->vlock), lockname)) != 0) { + +#ifdef __HAIKU__ + if ((result = recursive_lock_init(&(ns->vlock), lockname)) != 0) +#else + if ((result = new_lock(&(ns->vlock), lockname)) != B_OK) +#endif + { ERRPRINT("fs_mount - error creating lock (%s)\n", strerror(result)); goto exit; } - + ns->ntvol=utils_mount_volume(device,0,true); if(ns->ntvol!=NULL) result = B_NO_ERROR; @@ -183,8 +190,13 @@ return result; } +#ifdef __HAIKU__ status_t fs_unmount(void *_ns) +#else +int +fs_unmount(void *_ns) +#endif { nspace *ns = (nspace*)_ns; status_t result = B_NO_ERROR; @@ -192,8 +204,12 @@ ERRPRINT("fs_unmount - ENTER\n"); ntfs_device_umount( ns->ntvol, true ); - + +#ifdef __HAIKU__ recursive_lock_destroy(&(ns->vlock)); +#else + free_lock(&(ns->vlock)); +#endif free( ns ); @@ -202,8 +218,13 @@ return result; } +#ifdef __HAIKU__ status_t fs_rfsstat( void *_ns, struct fs_info * fss ) +#else +int +fs_rfsstat( void *_ns, struct fs_info * fss ) +#endif { nspace *ns = (nspace*)_ns; int i; @@ -242,15 +263,24 @@ } #ifndef _READ_ONLY_ +#ifdef __HAIKU__ status_t fs_wfsstat(void *_vol, const struct fs_info * fss, uint32 mask) +#else +int +fs_wfsstat(void *_vol, struct fs_info *fss, long mask) +#endif { nspace* ns = (nspace*)_vol; status_t result = B_NO_ERROR; LOCK_VOL(ns); +#ifdef __HAIKU__ if (mask & FS_WRITE_FSINFO_NAME) { +#else + if (mask & WFSSTAT_NAME) { +#endif result = ntfs_change_label( ns->ntvol, (char*)fss->volume_name ); goto exit; } @@ -263,8 +293,13 @@ } #endif +#ifdef __HAIKU__ status_t fs_walk(void *_ns, void *_base, const char *file, vnode_id *vnid,int *_type) +#else +int +fs_walk(void *_ns, void *_base, const char *file, char **newpath, vnode_id *vnid) +#endif { nspace *ns = (nspace*)_ns; vnode *baseNode = (vnode*)_base; @@ -317,6 +352,9 @@ if( get_vnode( ns->id, *vnid, (void**)&newNode ) !=0 ) result = ENOENT; + + if(newNode!=NULL) + newNode->parent_vnid = baseNode->vnid; } exit: @@ -328,7 +366,7 @@ return result; } - +#ifdef __HAIKU__ status_t fs_get_vnode_name(void *_ns, void *_node, char *buffer, size_t bufferSize) { @@ -366,12 +404,17 @@ return result; } +#endif - +#ifdef __HAIKU__ status_t fs_read_vnode(void *_ns, vnode_id vnid, void **node, bool reenter) +#else +int +fs_read_vnode(void *_ns, vnode_id vnid, char reenter, void **node) +#endif { nspace *ns = (nspace*)_ns; vnode *newNode = NULL; @@ -424,8 +467,13 @@ return result; } +#ifdef __HAIKU__ status_t fs_write_vnode( void *_ns, void *_node, bool reenter ) +#else +int +fs_write_vnode( void *_ns, void *_node, char reenter ) +#endif { nspace *ns = (nspace*)_ns; vnode *node = (vnode*)_node; @@ -448,8 +496,13 @@ } #ifndef _READ_ONLY_ +#ifdef __HAIKU__ status_t fs_remove_vnode( void *_ns, void *_node, bool reenter ) +#else +int +fs_remove_vnode( void *_ns, void *_node, char reenter ) +#endif { nspace *ns = (nspace*)_ns; vnode *node = (vnode*)_node; @@ -471,9 +524,14 @@ return result; } #endif - + +#ifdef __HAIKU__ status_t fs_rstat( void *_ns, void *_node, struct stat *stbuf ) +#else +int +fs_rstat( void *_ns, void *_node, struct stat *stbuf ) +#endif { nspace *ns = (nspace*)_ns; vnode *node = (vnode*)_node; @@ -570,8 +628,13 @@ } #ifndef _READ_ONLY_ +#ifdef __HAIKU__ status_t fs_wstat(void *_vol, void *_node, const struct stat *st, uint32 mask) +#else +int +fs_wstat(void *_vol, void *_node, struct stat *st, long mask) +#endif { nspace *ns = (nspace*)_vol; vnode *node = (vnode*)_node; @@ -588,8 +651,11 @@ goto exit; } +#ifdef __HAIKU__ if ( mask & FS_WRITE_STAT_SIZE ) { - +#else + if (mask & WSTAT_SIZE) { +#endif ERRPRINT("fs_wstat: setting file size to %Lx\n", st->st_size); if ( ni->mrec->flags & MFT_RECORD_IS_DIRECTORY ) { @@ -606,22 +672,31 @@ ntfs_attr_close(na); ntfs_mark_free_space_outdated(ns); - - //notify_listener(B_STAT_CHANGED, ns->id, 0, 0, MREF(ni->mft_no), NULL); + +#ifdef __HAIKU__ notify_stat_changed(ns->id, MREF(ni->mft_no), mask); - +#else + notify_listener(B_STAT_CHANGED, ns->id, 0, 0, MREF(ni->mft_no), NULL); +#endif + } } +#ifdef __HAIKU__ if (mask & FS_WRITE_STAT_MTIME) { - +#else + if (mask & WSTAT_MTIME) { +#endif ERRPRINT("fs_wstat: setting modification time\n"); ni->last_access_time = st->st_atime; ni->last_data_change_time = st->st_mtime; ni->last_mft_change_time = st->st_ctime; - //notify_listener(B_STAT_CHANGED, ns->id, 0, 0, MREF(ni->mft_no), NULL); +#ifdef __HAIKU__ notify_stat_changed(ns->id, MREF(ni->mft_no), mask); +#else + notify_listener(B_STAT_CHANGED, ns->id, 0, 0, MREF(ni->mft_no), NULL); +#endif } exit: @@ -629,7 +704,7 @@ if(ni) ntfs_inode_close(ni); - ERRPRINT("dosfs_wstat: EXIT with (%s)\n", strerror(err)); + ERRPRINT("dosfs_wstat: EXIT with (%s)\n", strerror(result)); UNLOCK_VOL(ns); @@ -638,17 +713,24 @@ #endif #ifndef _READ_ONLY_ +#ifdef __HAIKU__ status_t fs_sync(void *_ns) +#else +int +fs_sync(void *_ns) +#endif { nspace *ns = (nspace *)_ns; LOCK_VOL(ns); ERRPRINT("fs_sync - ENTER\n"); - -// flush_device(DEV_FD(ns->ntvol->dev), 0); +#ifndef __HAIKU__ + flush_device(DEV_FD(ns->ntvol->dev), 0); +#endif + ERRPRINT("fs_sync - EXIT\n"); UNLOCK_VOL(ns); @@ -658,8 +740,13 @@ #endif #ifndef _READ_ONLY_ +#ifdef __HAIKU__ status_t fs_fsync(void *_ns, void *_node) +#else +int +fs_fsync(void *_ns, void *_node) +#endif { nspace *ns = (nspace*)_ns; vnode *node = (vnode*)_node; @@ -696,9 +783,13 @@ } #endif - +#ifdef __HAIKU__ status_t fs_open(void *_ns, void *_node, int omode, void **_cookie) +#else +int +fs_open(void *_ns, void *_node, int omode, void **_cookie) +#endif { nspace *ns = (nspace*)_ns; vnode *node = (vnode*)_node; @@ -758,8 +849,13 @@ #ifndef _READ_ONLY_ +#ifdef __HAIKU__ status_t fs_create(void *_ns, void *_dir, const char *name, int omode, int perms, void **_cookie, vnode_id *_vnid) +#else +int +fs_create(void *_ns, void *_dir, const char *name, int omode, int perms, vnode_id *_vnid, void **_cookie) +#endif { nspace *ns = (nspace*)_ns; vnode *dir = (vnode*)_dir; @@ -842,9 +938,14 @@ result = B_NO_ERROR; result = publish_vnode(ns->id, *_vnid, (void*)newNode); - ntfs_mark_free_space_outdated(ns); + ntfs_mark_free_space_outdated(ns); + +#ifdef __HAIKU__ notify_entry_created(ns->id, MREF( bi->mft_no ), name, *_vnid); - //notify_listener(B_ENTRY_CREATED, ns->id, MREF( bi->mft_no ), 0, *_vnid, name); +#else + notify_listener(B_ENTRY_CREATED, ns->id, MREF( bi->mft_no ), 0, *_vnid, name); +#endif + } else result = errno; } @@ -873,9 +974,13 @@ } #endif - +#ifdef __HAIKU__ status_t fs_read( void *_ns, void *_node, void *_cookie, off_t offset, void *buf, size_t *len ) +#else +int +fs_read( void *_ns, void *_node, void *_cookie, off_t offset, void *buf, size_t *len ) +#endif { nspace *ns = (nspace*)_ns; vnode *node = (vnode*)_node; @@ -952,8 +1057,13 @@ #ifndef _READ_ONLY_ +#ifdef __HAIKU__ status_t fs_write( void *_ns, void *_node, void *_cookie, off_t offset, const void *buf, size_t *len ) +#else +int +fs_write( void *_ns, void *_node, void *_cookie, off_t offset, const void *buf, size_t *len ) +#endif { nspace *ns = (nspace*)_ns; vnode *node = (vnode*)_node; @@ -1005,9 +1115,12 @@ if(ntfs_attr_truncate(na, offset + size)) size = na->data_size - offset; else +#ifdef __HAIKU__ notify_stat_changed(ns->id, MREF(ni->mft_no), B_STAT_SIZE); +#else + notify_listener(B_STAT_CHANGED, ns->id, 0, 0, MREF(ni->mft_no), NULL); +#endif } - //notify_listener(B_STAT_CHANGED, ns->id, 0, 0, MREF(ni->mft_no), NULL); } while (size) { result = ntfs_attr_pwrite(na, offset, size, buf); @@ -1042,8 +1155,13 @@ } #endif +#ifdef __HAIKU__ status_t fs_close(void *ns, void *node, void *cookie) +#else +int +fs_close(void *ns, void *node, void *cookie) +#endif { ERRPRINT("fs_close - ENTER\n"); @@ -1051,8 +1169,13 @@ return B_NO_ERROR; } +#ifdef __HAIKU__ status_t fs_free_cookie( void *ns, void *node, void *cookie ) +#else +int +fs_free_cookie( void *ns, void *node, void *cookie ) +#endif { ERRPRINT("fs_free_cookie - ENTER\n"); @@ -1063,9 +1186,13 @@ return B_NO_ERROR; } - +#ifdef __HAIKU__ status_t fs_access( void *ns, void *node, int mode ) +#else +int +fs_access( void *ns, void *node, int mode ) +#endif { ERRPRINT("fs_access - ENTER\n"); @@ -1073,8 +1200,13 @@ return B_NO_ERROR; } +#ifdef __HAIKU__ status_t fs_readlink(void *_ns, void *_node, char *buff, size_t *buff_size) +#else +int +fs_readlink(void *_ns, void *_node, char *buff, size_t *buff_size) +#endif { nspace *ns = (nspace*)_ns; vnode *node = (vnode*)_node; @@ -1169,8 +1301,13 @@ } #ifndef _READ_ONLY_ +#ifdef __HAIKU__ status_t fs_create_symlink(void *_ns, void *_dir, const char *name, const char *target, int mode) +#else +int +fs_create_symlink(void *_ns, void *_dir, const char *name, const char *target) +#endif { nspace *ns = (nspace*)_ns; vnode *dir = (vnode*)_dir; @@ -1231,12 +1368,15 @@ set_mime(symnode, name); if ((result = publish_vnode(ns->id, MREF(sym->mft_no), symnode)) != 0) - ERRPRINT("fs_symlink - new_vnode failed for vnid %Ld: %s\n", MREF(sym->mft_no), strerror(res)); + ERRPRINT("fs_symlink - new_vnode failed for vnid %Ld: %s\n", MREF(sym->mft_no), strerror(result)); put_vnode(ns->id, MREF(sym->mft_no) ); - -// notify_listener(B_ENTRY_CREATED, ns->id, MREF(dir->ntnode->mft_no), 0, MREF(sym->mft_no), name); + +#ifdef __HAIKU__ notify_entry_created(ns->id, MREF( bi->mft_no ), name, MREF(sym->mft_no)); +#else + notify_listener(B_ENTRY_CREATED, ns->id, MREF(bi->mft_no), 0, MREF(sym->mft_no), name); +#endif exit: @@ -1254,8 +1394,13 @@ #endif #ifndef _READ_ONLY_ +#ifdef __HAIKU__ status_t fs_mkdir(void *_ns, void *_node, const char *name, int perms, vnode_id *_vnid) +#else +int +fs_mkdir(void *_ns, void *_node, const char *name, int perms) +#endif { nspace *ns = (nspace*)_ns; vnode *dir = (vnode*)_node; @@ -1280,14 +1425,15 @@ result = ENOENT; goto exit; } + +#ifndef __HAIKU__ + if (is_vnode_removed(ns->id, MREF(bi->mft_no)) > 0) { + ERRPRINT("fs_mkdir - called in removed directory\n"); + result = EPERM; + goto exit; + } +#endif -// if (is_vnode_removed(ns->id, MREF(dir->ntnode->mft_no)) > 0) -// { -// ERRPRINT("fs_mkdir - called in removed directory\n"); -// result = EPERM; -// goto exit; -// } - if (! bi->mrec->flags & MFT_RECORD_IS_DIRECTORY) { result = EINVAL; goto exit; @@ -1316,15 +1462,19 @@ set_mime(newNode, ".***"); result = publish_vnode(ns->id, vnid, (void*)newNode); - +#ifdef __HAIKU__ *_vnid = vnid; - +#endif put_vnode(ns->id, MREF(ni->mft_no)); ntfs_mark_free_space_outdated(ns); - -// notify_listener(B_ENTRY_CREATED, ns->id, MREF( bi->mft_no ), 0, vnid, name); + +#ifdef __HAIKU__ notify_entry_created(ns->id, MREF( bi->mft_no ), name, vnid); +#else + notify_listener(B_ENTRY_CREATED, ns->id, MREF( bi->mft_no ), 0, vnid, name); +#endif + } else result = errno; @@ -1345,8 +1495,13 @@ #endif #ifndef _READ_ONLY_ +#ifdef __HAIKU__ status_t fs_rename(void *_ns, void *_odir, const char *oldname, void *_ndir, const char *newname) +#else +int +fs_rename(void *_ns, void *_odir, const char *oldname, void *_ndir, const char *newname) +#endif { nspace *ns = (nspace*)_ns; vnode *odir = (vnode*)_odir; @@ -1460,11 +1615,15 @@ ntfs_delete(oi, odi, uoldname, uoldname_len); onode->parent_vnid = MREF( ndi->mft_no ); - + +#ifdef __HAIKU__ notify_entry_moved(ns->id, MREF( odi->mft_no ), oldname, MREF( ndi->mft_no ), newname, onode->vnid ); notify_attribute_changed(ns->id, onode->vnid, "BEOS:TYPE", B_ATTR_CHANGED); - //notify_listener(B_ENTRY_MOVED, ns->id, MREF( odir->ntnode->mft_no ), MREF( ndir->ntnode->mft_no ), MREF( onode->ntnode->mft_no ), newname); - //notify_listener(B_ATTR_CHANGED, ns->id, 0, 0, nvnid, "BEOS:TYPE"); +#else + notify_listener(B_ENTRY_MOVED, ns->id, MREF( odi->mft_no ), MREF( ndi->mft_no ), MREF( onode->vnid ), newname); + notify_listener(B_ATTR_CHANGED, ns->id, 0, 0, onode->vnid, "BEOS:TYPE"); +#endif + put_vnode(ns->id, onode->vnid ); } else { //renaming @@ -1505,11 +1664,13 @@ } ntfs_delete(oi, odi, uoldname, uoldname_len); - +#ifdef __HAIKU__ notify_entry_moved(ns->id, MREF( odi->mft_no ), oldname, MREF( odi->mft_no ), newname, onode->vnid ); notify_attribute_changed(ns->id, onode->vnid, "BEOS:TYPE", B_ATTR_CHANGED); - //notify_listener(B_ENTRY_MOVED, ns->id, MREF( odir->ntnode->mft_no ), MREF( ndir->ntnode->mft_no ), MREF( onode->ntnode->mft_no ), newname); - //notify_listener(B_ATTR_CHANGED, ns->id, 0, 0, nvnid, "BEOS:TYPE"); +#else + notify_listener(B_ENTRY_MOVED, ns->id, MREF( odi->mft_no ), MREF( odi->mft_no ), MREF( onode->vnid ), newname); + notify_listener(B_ATTR_CHANGED, ns->id, 0, 0, onode->vnid, "BEOS:TYPE"); +#endif [... truncated: 663 lines follow ...] From stefano.ceccherini at gmail.com Fri Mar 2 08:54:17 2007 From: stefano.ceccherini at gmail.com (Stefano Ceccherini) Date: Fri, 2 Mar 2007 08:54:17 +0100 Subject: [Haiku-commits] r20292 - in haiku/trunk: headers/os/interface headers/private/interface src/kits/interface src/servers/app In-Reply-To: <894b9700703012326n4e807560q2565907e13dc5388@mail.gmail.com> References: <200703012317.l21NHh3k006324@sheep.berlios.de> <894b9700703012326n4e807560q2565907e13dc5388@mail.gmail.com> Message-ID: <894b9700703012354v63f36d13g4786037dd46c10cb@mail.gmail.com> 2007/3/2, Stefano Ceccherini : > > Note: some functions of PicturePlayer don't appear to be implented by PictureDataWriter, > > Indeed, we can safely remove them from the header, they are a legacy > of past implementations. Sorry, I misinterpreted what you said. There are missing implementations of some functions, I only implemented the needed stuff. From threedeyes at mail.berlios.de Fri Mar 2 08:57:58 2007 From: threedeyes at mail.berlios.de (threedeyes at BerliOS) Date: Fri, 2 Mar 2007 08:57:58 +0100 Subject: [Haiku-commits] r20303 - haiku/trunk/src/add-ons/kernel/file_systems/ntfs Message-ID: <200703020757.l227vwEa016215@sheep.berlios.de> Author: threedeyes Date: 2007-03-02 08:57:56 +0100 (Fri, 02 Mar 2007) New Revision: 20303 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20303&view=rev Added: haiku/trunk/src/add-ons/kernel/file_systems/ntfs/fs_func.h haiku/trunk/src/add-ons/kernel/file_systems/ntfs/fsproto.h haiku/trunk/src/add-ons/kernel/file_systems/ntfs/kernel_interface.c Log: Fixed build for R5 and dano targets. Bug fixes for fs_rename and fs_walk functions. Added simple identify functions for haiku. Added: haiku/trunk/src/add-ons/kernel/file_systems/ntfs/fs_func.h =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/ntfs/fs_func.h 2007-03-02 07:48:19 UTC (rev 20302) +++ haiku/trunk/src/add-ons/kernel/file_systems/ntfs/fs_func.h 2007-03-02 07:57:56 UTC (rev 20303) @@ -0,0 +1,123 @@ +/* + * Copyright (c) 2000-2004 Anton Altaparmakov + * Copyright (c) 2002-2006 Szabolcs Szakacsits + * + * Copyright (c) 2006 Troeglazov Gerasim (3dEyes**) + * + * This program/include file 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/include file 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 (in the main directory of the Linux-NTFS distribution in the + * file COPYING); if not, write to the Free Software Foundation,Inc., 59 Temple + * Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef _fs_FUNC_H_ +#define _fs_FUNC_H_ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "ntfs.h" +#include "attributes.h" +#include "lock.h" +#include "volume_util.h" + + +#ifdef __HAIKU__ + +float fs_identify_partition(int fd, partition_data *partition, void **_cookie); +status_t fs_scan_partition(int fd, partition_data *partition, void *_cookie); +void fs_free_identify_partition_cookie(partition_data *partition, void *_cookie); + +status_t fs_mount( mount_id nsid, const char *device, ulong flags, const char *args, void **data, vnode_id *vnid ); +status_t fs_create_symlink(void *_ns, void *_dir, const char *name, const char *target, int mode); +status_t fs_create(void *_ns, void *_dir, const char *name, int omode, int perms, void **_cookie, vnode_id *_vnid); +status_t fs_walk(void *_ns, void *_base, const char *file, vnode_id *vnid,int *_type); +status_t fs_get_vnode_name(void *_ns, void *_node, char *buffer, size_t bufferSize); +status_t fs_unmount(void *_ns); +status_t fs_rfsstat(void *_ns, struct fs_info *); +status_t fs_wfsstat(void *_vol, const struct fs_info *fss, uint32 mask); +status_t fs_sync(void *_ns); +status_t fs_read_vnode(void *_ns, vnode_id vnid, void **_node, bool reenter); +status_t fs_write_vnode(void *_ns, void *_node, bool reenter); +status_t fs_remove_vnode( void *_ns, void *_node, bool reenter ); +status_t fs_access( void *ns, void *node, int mode ); +status_t fs_rstat(void *_ns, void *_node, struct stat *st); +status_t fs_wstat(void *_vol, void *_node, const struct stat *st, uint32 mask); +status_t fs_open(void *_ns, void *_node, int omode, void **cookie); +status_t fs_close(void *ns, void *node, void *cookie); +status_t fs_free_cookie(void *ns, void *node, void *cookie); +status_t fs_read(void *_ns, void *_node, void *cookie, off_t pos, void *buf, size_t *len); +status_t fs_write(void *ns, void *node, void *cookie, off_t pos, const void *buf, size_t *len); +status_t fs_mkdir(void *_ns, void *_node, const char *name, int perms, vnode_id *_vnid); +status_t fs_rmdir(void *_ns, void *dir, const char *name); +status_t fs_opendir(void* _ns, void* _node, void** cookie); +status_t fs_readdir( void *_ns, void *_node, void *_cookie, struct dirent *buf, size_t bufsize, uint32 *num ); +status_t fs_rewinddir(void *_ns, void *_node, void *cookie); +status_t fs_closedir(void *_ns, void *_node, void *cookie); +status_t fs_free_dircookie(void *_ns, void *_node, void *cookie); +status_t fs_readlink(void *_ns, void *_node, char *buf, size_t *bufsize); +status_t fs_fsync(void *_ns, void *_node); +status_t fs_rename(void *_ns, void *_odir, const char *oldname, void *_ndir, const char *newname); +status_t fs_unlink(void *_ns, void *_node, const char *name); + +#else + +int fs_mount(nspace_id nsid, const char *device, ulong flags, void *parms, size_t len, void **data, vnode_id *vnid); +int fs_unmount(void *_ns); +int fs_walk(void *_ns, void *_base, const char *file, char **newpath, vnode_id *vnid); +int fs_read_vnode(void *_ns, vnode_id vnid, char r, void **node); +int fs_write_vnode(void *_ns, void *_node, char r); +int fs_rstat(void *_ns, void *_node, struct stat *st); +int fs_wstat(void *_vol, void *_node, struct stat *st, long mask); +int fs_open(void *_ns, void *_node, int omode, void **cookie); +int fs_read(void *_ns, void *_node, void *cookie, off_t pos, void *buf, size_t *len); +int fs_write(void *ns, void *node, void *cookie, off_t pos, const void *buf, size_t *len); +int fs_free_cookie(void *ns, void *node, void *cookie); +int fs_close(void *ns, void *node, void *cookie); +int fs_access(void *_ns, void *_node, int mode); +int fs_opendir(void* _ns, void* _node, void** cookie); +int fs_readdir(void *_ns, void *_node, void *cookie, long *num, struct dirent *buf, size_t bufsize); +int fs_rewinddir(void *_ns, void *_node, void *cookie); +int fs_closedir(void *_ns, void *_node, void *cookie); +int fs_free_dircookie(void *_ns, void *_node, void *cookie); +int fs_rfsstat(void *_ns, struct fs_info *); +int fs_wfsstat(void *_vol, struct fs_info *fss, long mask); +int fs_readlink(void *_ns, void *_node, char *buf, size_t *bufsize); +int fs_mkdir(void *_ns, void *_node, const char *name, int perms); +int fs_rmdir(void *_ns, void *dir, const char *name); +int fs_remove_vnode( void *_ns, void *_node, char reenter ); +int fs_rename(void *_ns, void *_odir, const char *oldname, void *_ndir, const char *newname); +int fs_create(void *_ns, void *_dir, const char *name, int omode, int perms, vnode_id *_vnid, void **_cookie); +int fs_unlink(void *_ns, void *_node, const char *name); +int fs_fsync(void *_ns, void *_node); +int fs_sync(void *_ns); +int fs_create_symlink(void *ns, void *_dir, const char *name, const char *path); + +#endif //__HAIKU__ + +#ifndef _READ_ONLY_ +static status_t do_unlink(nspace *vol, vnode *dir, const char *name, bool isdir); +#endif + +#endif Added: haiku/trunk/src/add-ons/kernel/file_systems/ntfs/fsproto.h =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/ntfs/fsproto.h 2007-03-02 07:48:19 UTC (rev 20302) +++ haiku/trunk/src/add-ons/kernel/file_systems/ntfs/fsproto.h 2007-03-02 07:57:56 UTC (rev 20303) @@ -0,0 +1,247 @@ +#ifndef _FSPROTO_H +#define _FSPROTO_H + +//#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +typedef dev_t nspace_id; +typedef ino_t vnode_id; + +/* UGLY UGLY UGLY */ +#ifndef _DRIVERS_H +struct selectsync; +typedef struct selectsync selectsync; +#endif + + +/* + * PUBLIC PART OF THE FILE SYSTEM PROTOCOL + */ + +#define WSTAT_MODE 0x0001 +#define WSTAT_UID 0x0002 +#define WSTAT_GID 0x0004 +#define WSTAT_SIZE 0x0008 +#define WSTAT_ATIME 0x0010 +#define WSTAT_MTIME 0x0020 +#define WSTAT_CRTIME 0x0040 + +#define WFSSTAT_NAME 0x0001 + +#define B_ENTRY_CREATED 1 +#define B_ENTRY_REMOVED 2 +#define B_ENTRY_MOVED 3 +#define B_STAT_CHANGED 4 +#define B_ATTR_CHANGED 5 +#define B_DEVICE_MOUNTED 6 +#define B_DEVICE_UNMOUNTED 7 + +#define B_STOP_WATCHING 0x0000 +#define B_WATCH_NAME 0x0001 +#define B_WATCH_STAT 0x0002 +#define B_WATCH_ATTR 0x0004 +#define B_WATCH_DIRECTORY 0x0008 + +#define SELECT_READ 1 +#define SELECT_WRITE 2 +#define SELECT_EXCEPTION 3 + +#define B_CUR_FS_API_VERSION 2 + +struct attr_info; +struct index_info; + +typedef int op_read_vnode(void *ns, vnode_id vnid, char r, void **node); +typedef int op_write_vnode(void *ns, void *node, char r); +typedef int op_remove_vnode(void *ns, void *node, char r); +typedef int op_secure_vnode(void *ns, void *node); + +typedef int op_walk(void *ns, void *base, const char *file, char **newpath, + vnode_id *vnid); + +typedef int op_access(void *ns, void *node, int mode); + +typedef int op_create(void *ns, void *dir, const char *name, + int omode, int perms, vnode_id *vnid, void **cookie); +typedef int op_mkdir(void *ns, void *dir, const char *name, int perms); +typedef int op_symlink(void *ns, void *dir, const char *name, + const char *path); +typedef int op_link(void *ns, void *dir, const char *name, void *node); + +typedef int op_rename(void *ns, void *olddir, const char *oldname, + void *newdir, const char *newname); +typedef int op_unlink(void *ns, void *dir, const char *name); +typedef int op_rmdir(void *ns, void *dir, const char *name); + +typedef int op_readlink(void *ns, void *node, char *buf, size_t *bufsize); + +typedef int op_opendir(void *ns, void *node, void **cookie); +typedef int op_closedir(void *ns, void *node, void *cookie); +typedef int op_rewinddir(void *ns, void *node, void *cookie); +typedef int op_readdir(void *ns, void *node, void *cookie, long *num, + struct dirent *buf, size_t bufsize); + +typedef int op_open(void *ns, void *node, int omode, void **cookie); +typedef int op_close(void *ns, void *node, void *cookie); +typedef int op_free_cookie(void *ns, void *node, void *cookie); +typedef int op_read(void *ns, void *node, void *cookie, off_t pos, void *buf, + size_t *len); +typedef int op_write(void *ns, void *node, void *cookie, off_t pos, + const void *buf, size_t *len); +typedef int op_readv(void *ns, void *node, void *cookie, off_t pos, const iovec *vec, + size_t count, size_t *len); +typedef int op_writev(void *ns, void *node, void *cookie, off_t pos, const iovec *vec, + size_t count, size_t *len); +typedef int op_ioctl(void *ns, void *node, void *cookie, int cmd, void *buf, + size_t len); +typedef int op_setflags(void *ns, void *node, void *cookie, int flags); + +typedef int op_rstat(void *ns, void *node, struct stat *); +typedef int op_wstat(void *ns, void *node, struct stat *, long mask); +typedef int op_fsync(void *ns, void *node); + +typedef int op_select(void *ns, void *node, void *cookie, uint8 event, + uint32 ref, selectsync *sync); +typedef int op_deselect(void *ns, void *node, void *cookie, uint8 event, + selectsync *sync); + +typedef int op_initialize(const char *devname, void *parms, size_t len); +typedef int op_mount(nspace_id nsid, const char *devname, ulong flags, + void *parms, size_t len, void **data, vnode_id *vnid); +typedef int op_unmount(void *ns); +typedef int op_sync(void *ns); +typedef int op_rfsstat(void *ns, struct fs_info *); +typedef int op_wfsstat(void *ns, struct fs_info *, long mask); + + +typedef int op_open_attrdir(void *ns, void *node, void **cookie); +typedef int op_close_attrdir(void *ns, void *node, void *cookie); +typedef int op_rewind_attrdir(void *ns, void *node, void *cookie); +typedef int op_read_attrdir(void *ns, void *node, void *cookie, long *num, + struct dirent *buf, size_t bufsize); +typedef int op_remove_attr(void *ns, void *node, const char *name); +typedef int op_rename_attr(void *ns, void *node, const char *oldname, + const char *newname); +typedef int op_stat_attr(void *ns, void *node, const char *name, + struct attr_info *buf); + +typedef int op_write_attr(void *ns, void *node, const char *name, int type, + const void *buf, size_t *len, off_t pos); +typedef int op_read_attr(void *ns, void *node, const char *name, int type, + void *buf, size_t *len, off_t pos); + +typedef int op_open_indexdir(void *ns, void **cookie); +typedef int op_close_indexdir(void *ns, void *cookie); +typedef int op_rewind_indexdir(void *ns, void *cookie); +typedef int op_read_indexdir(void *ns, void *cookie, long *num, + struct dirent *buf, size_t bufsize); +typedef int op_create_index(void *ns, const char *name, int type, int flags); +typedef int op_remove_index(void *ns, const char *name); +typedef int op_rename_index(void *ns, const char *oldname, + const char *newname); +typedef int op_stat_index(void *ns, const char *name, struct index_info *buf); + +typedef int op_open_query(void *ns, const char *query, ulong flags, + port_id port, long token, void **cookie); +typedef int op_close_query(void *ns, void *cookie); +typedef int op_read_query(void *ns, void *cookie, long *num, + struct dirent *buf, size_t bufsize); + +typedef struct vnode_ops { + op_read_vnode (*read_vnode); + op_write_vnode (*write_vnode); + op_remove_vnode (*remove_vnode); + op_secure_vnode (*secure_vnode); + op_walk (*walk); + op_access (*access); + op_create (*create); + op_mkdir (*mkdir); + op_symlink (*symlink); + op_link (*link); + op_rename (*rename); + op_unlink (*unlink); + op_rmdir (*rmdir); + op_readlink (*readlink); + op_opendir (*opendir); + op_closedir (*closedir); + op_free_cookie (*free_dircookie); + op_rewinddir (*rewinddir); + op_readdir (*readdir); + op_open (*open); + op_close (*close); + op_free_cookie (*free_cookie); + op_read (*read); + op_write (*write); + op_readv (*readv); + op_writev (*writev); + op_ioctl (*ioctl); + op_setflags (*setflags); + op_rstat (*rstat); + op_wstat (*wstat); + op_fsync (*fsync); + op_initialize (*initialize); + op_mount (*mount); + op_unmount (*unmount); + op_sync (*sync); + op_rfsstat (*rfsstat); + op_wfsstat (*wfsstat); + op_select (*select); + op_deselect (*deselect); + op_open_indexdir (*open_indexdir); + op_close_indexdir (*close_indexdir); + op_free_cookie (*free_indexdircookie); + op_rewind_indexdir (*rewind_indexdir); + op_read_indexdir (*read_indexdir); + op_create_index (*create_index); + op_remove_index (*remove_index); + op_rename_index (*rename_index); + op_stat_index (*stat_index); + op_open_attrdir (*open_attrdir); + op_close_attrdir (*close_attrdir); + op_free_cookie (*free_attrdircookie); + op_rewind_attrdir (*rewind_attrdir); + op_read_attrdir (*read_attrdir); + op_write_attr (*write_attr); + op_read_attr (*read_attr); + op_remove_attr (*remove_attr); + op_rename_attr (*rename_attr); + op_stat_attr (*stat_attr); + op_open_query (*open_query); + op_close_query (*close_query); + op_free_cookie (*free_querycookie); + op_read_query (*read_query); +} vnode_ops; + +extern int new_path(const char *path, char **copy); +extern void free_path(char *p); + +extern int notify_listener(int op, nspace_id nsid, + vnode_id vnida, vnode_id vnidb, + vnode_id vnidc, const char *name); +extern void notify_select_event(selectsync *sync, uint32 ref); +extern int send_notification(port_id port, long token, + ulong what, long op, nspace_id nsida, + nspace_id nsidb, vnode_id vnida, + vnode_id vnidb, vnode_id vnidc, + const char *name); +extern int get_vnode(nspace_id nsid, vnode_id vnid, void **data); +extern int put_vnode(nspace_id nsid, vnode_id vnid); +extern int new_vnode(nspace_id nsid, vnode_id vnid, void *data); +extern int remove_vnode(nspace_id nsid, vnode_id vnid); +extern int unremove_vnode(nspace_id nsid, vnode_id vnid); +extern int is_vnode_removed(nspace_id nsid, vnode_id vnid); + + +extern _EXPORT vnode_ops fs_entry; +extern _EXPORT int32 api_version; + +#endif Added: haiku/trunk/src/add-ons/kernel/file_systems/ntfs/kernel_interface.c =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/ntfs/kernel_interface.c 2007-03-02 07:48:19 UTC (rev 20302) +++ haiku/trunk/src/add-ons/kernel/file_systems/ntfs/kernel_interface.c 2007-03-02 07:57:56 UTC (rev 20303) @@ -0,0 +1,306 @@ +/* kernel_interface - file system interface to Haiku's vnode layer + * + * Copyright (c) 2006-2007 Troeglazov Gerasim (3dEyes**) + * + * This program/include file 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/include file 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 (in the main directory of the Linux-NTFS + * distribution in the file COPYING); if not, write to the Free Software + * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef __HAIKU__ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#else + +#include "fsproto.h" +#include "lock.h" + +#define publish_vnode new_vnode + +#endif + +#include "fs_func.h" +#include "ntfsdir.h" +#include "attributes.h" + + +#ifdef __HAIKU__ + +static status_t +ntfs_std_ops(int32 op, ...) +{ + switch (op) { + case B_MODULE_INIT: + return B_OK; + case B_MODULE_UNINIT: + return B_OK; + default: + return B_ERROR; + } +} + + +static file_system_module_info sNTFSFileSystem = { + { + "file_systems/ntfs" B_CURRENT_FS_API_VERSION, + 0, + ntfs_std_ops, + }, + + "ntfs File System", + + // scanning + fs_identify_partition, + fs_scan_partition, + fs_free_identify_partition_cookie, + NULL, // free_partition_content_cookie() + + &fs_mount, + &fs_unmount, + &fs_rfsstat, +#ifdef _READ_ONLY_ + NULL, +#else + &fs_wfsstat, +#endif + NULL, + + /* vnode operations */ + &fs_walk, + &fs_get_vnode_name, + &fs_read_vnode, + &fs_write_vnode, +#ifdef _READ_ONLY_ + NULL, +#else + &fs_remove_vnode, +#endif + + /* VM file access */ + NULL, // &fs_can_page + NULL, // &fs_read_pages + NULL, // &fs_write_pages + + NULL, // &fs_get_file_map + + NULL, // &fs_ioctl + NULL, // &fs_set_flags + NULL, // &fs_select + NULL, // &fs_deselect + +#ifdef _READ_ONLY_ + NULL, +#else + &fs_fsync, +#endif + + &fs_readlink, + +#ifdef _READ_ONLY_ + NULL, + NULL, + NULL, + NULL, + NULL, +#else + NULL, // write link + &fs_create_symlink, + NULL, // &fs_link, + &fs_unlink, + &fs_rename, +#endif + + &fs_access, + &fs_rstat, +#ifdef _READ_ONLY_ + NULL, +#else + &fs_wstat, +#endif + + /* file operations */ +#ifdef _READ_ONLY_ + NULL, +#else + &fs_create, +#endif + &fs_open, + &fs_close, + &fs_free_cookie, + &fs_read, +#ifdef _READ_ONLY_ + NULL, +#else + &fs_write, +#endif + + /* directory operations */ +#ifdef _READ_ONLY_ + NULL, + NULL, +#else + &fs_mkdir, + &fs_rmdir, +#endif + &fs_opendir, + &fs_closedir, + &fs_free_dircookie, + &fs_readdir, + &fs_rewinddir, + + /* attribute directory operations */ + &fs_open_attrib_dir, + &fs_close_attrib_dir, + &fs_free_attrib_dir_cookie, + &fs_read_attrib_dir, + &fs_rewind_attrib_dir, + + /* attribute operations */ + NULL, //&fs_create_attr, + &fs_open_attrib, + &fs_close_attrib, + &fs_free_attrib_cookie, + &fs_read_attrib, + &fs_write_attrib, + + &fs_read_attrib_stat, + NULL, //&fs_write_attr_stat, + NULL, //&fs_rename_attr, + NULL, //&fs_remove_attr, + + /* index directory & index operations */ + NULL, // &fs_open_index_dir + NULL, // &fs_close_index_dir + NULL, // &fs_free_index_dir_cookie + NULL, // &fs_read_index_dir + NULL, // &fs_rewind_index_dir + + NULL, // &fs_create_index + NULL, // &fs_remove_index + NULL, // &fs_stat_index + + /* query operations */ + NULL, // &fs_open_query + NULL, // &fs_close_query + NULL, // &fs_free_query_cookie + NULL, // &fs_read_query + NULL, // &fs_rewind_query +}; + +module_info *modules[] = { + (module_info *)&sNTFSFileSystem, + NULL, +}; + +#else + +int32 api_version = B_CUR_FS_API_VERSION; + +vnode_ops fs_entry = { + &fs_read_vnode, /* read_vnode func ptr */ + &fs_write_vnode, /* write_vnode func ptr */ + &fs_remove_vnode, /* remove_vnode func ptr */ + NULL, /* secure_vnode func ptr */ + &fs_walk, /* walk func ptr */ + &fs_access, /* access func ptr */ + &fs_create, /* create func ptr */ + &fs_mkdir, /* mkdir func ptr */ + &fs_create_symlink, + NULL, + &fs_rename, + &fs_unlink, /* unlink func ptr */ + &fs_rmdir, /* rmdir func ptr */ + &fs_readlink, /* readlink func ptr */ + &fs_opendir, /* opendir func ptr */ + &fs_closedir, /* closedir func ptr */ + &fs_free_dircookie, /* free_dircookie func ptr */ + &fs_rewinddir, /* rewinddir func ptr */ + &fs_readdir, /* readdir func ptr */ + &fs_open, /* open file func ptr */ + &fs_close, /* close file func ptr */ + &fs_free_cookie, /* free cookie func ptr */ + &fs_read, /* read file func ptr */ + &fs_write, /* write file func ptr */ + NULL, /* readv */ + NULL, /* writev */ + NULL, /* ioctl func ptr */ + NULL, /* setflags file func ptr */ + &fs_rstat, /* rstat func ptr */ + &fs_wstat, /* wstat func ptr */ + &fs_fsync, + NULL, /* initialize func ptr */ + &fs_mount, /* mount func ptr */ + &fs_unmount, /* unmount func ptr */ + &fs_sync, /* sync func ptr */ + &fs_rfsstat, /* rfsstat func ptr */ + &fs_wfsstat, /* wfsstat func ptr */ + NULL, // select + NULL, // deselect + + NULL, // open_indexdir + NULL, // close_indexdir + NULL, // free_indexdircookie + NULL, // rewind_indexdir + NULL, // read_indexdir + + NULL, // create_index + NULL, // remove_index + NULL, // rename_index + NULL, // stat_index + + &fs_open_attrib_dir, // open_attrdir + &fs_close_attrib_dir, // close_attrdir + &fs_free_attrib_dir_cookie, // free_attrdircookie + &fs_rewind_attrib_dir, // rewind_attrdir + &fs_read_attrib_dir, // read_attrdir + + &fs_write_attrib, // write_attr + &fs_read_attrib, // read_attr + NULL, // remove_attr + NULL, // rename_attr + &fs_read_attrib_stat, // stat_attr + + NULL, // open_query + NULL, // close_query + NULL, // free_querycookie + NULL // read_query +}; + +#endif From wkornewald at haiku-os.org Fri Mar 2 09:11:04 2007 From: wkornewald at haiku-os.org (Waldemar Kornewald) Date: Fri, 2 Mar 2007 09:11:04 +0100 Subject: [Haiku-commits] r20301 - haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs In-Reply-To: <200703020741.l227ffeP014540@sheep.berlios.de> References: <200703020741.l227ffeP014540@sheep.berlios.de> Message-ID: Hi! On 3/2/07, threedeyes at BerliOS wrote: > Author: threedeyes > Date: 2007-03-02 08:41:35 +0100 (Fri, 02 Mar 2007) > New Revision: 20301 > ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20301&view=rev > > Modified: > haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/Jamfile > haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/attrib.c > haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/bootsect.c > haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/compat.c > haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/device.c > haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/dir.c > haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/dir.h > haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/endians.h > haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/index.c > haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/inode.c > haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/lcnalloc.c > haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/logfile.c > haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/logging.c > haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/mft.c > haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/misc.c > haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/misc.h > haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/runlist.c > haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/security.c > haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/unistr.c > haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/unix_io.c > haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/volume.c > haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/volume.h > Log: > update libntfs-3g to 1.0 Thank you *so* much! Do we already have write support? Shall I close #1046? http://dev.haiku-os.org/ticket/1046 Do you want to become the owner for the NTFS component in Trac (bugs will automatically be assigned to you, then)? Is your website username "3deyes"? Bye, Waldemar Kornewald From stefano.ceccherini at gmail.com Fri Mar 2 09:21:44 2007 From: stefano.ceccherini at gmail.com (Stefano Ceccherini) Date: Fri, 2 Mar 2007 09:21:44 +0100 Subject: [Haiku-commits] r20280 - haiku/trunk/src/tests/kits/interface/picture In-Reply-To: References: <200703011319.l21DJ5rF006881@sheep.berlios.de> Message-ID: <894b9700703020021u47f9e13ha851e7a2e63ddbf@mail.gmail.com> 2007/3/1, Michael Pfeiffer : > > Archive the 2 pictures to a message, in order to compare the data. > > You could also use the class PicturePrinter instead. Thank you :) Anyway it's working now. From stefano.ceccherini at gmail.com Fri Mar 2 09:25:14 2007 From: stefano.ceccherini at gmail.com (Stefano Ceccherini) Date: Fri, 2 Mar 2007 09:25:14 +0100 Subject: [Haiku-commits] r20292 - in haiku/trunk: headers/os/interface headers/private/interface src/kits/interface src/servers/app In-Reply-To: <894b9700703012331t62e57999q340690d179129286@mail.gmail.com> References: <200703012317.l21NHh3k006324@sheep.berlios.de> <894b9700703012326n4e807560q2565907e13dc5388@mail.gmail.com> <894b9700703012331t62e57999q340690d179129286@mail.gmail.com> Message-ID: <894b9700703020025k4b1be976p32966129bb1aad9b@mail.gmail.com> 2007/3/2, Stefano Ceccherini : > 2007/3/2, Stefano Ceccherini : > > > Added "const" to many parameters. > > > Removed most data allocations/copying from PicturePlayer, ServerPicture now has to do this when converting coordinates. > > > Added additional functions to ViewLayer to copy&convert multiple BPoint, BRect, BRegion to Screen coordinates, those should be further optimized. > > > Removed some function call overhead. > > > > Marcus, this creates a problem. BPictures can be replayed also with > > the Play() function, without passing through the app_server (and > > through ServerPicture). With this change, I think we are no longer > > compatible with this behaviour. > > Also, for reference, check the file > /haiku/trunk/docs/develop/interface/BPicture_specifications.html > in our repository. > We need to respect that format for BPicture, to be able to read and > play R5 pictures. And also, the print drivers expect a certain format, so we shouldn't change it. I had a look at the rest of your changes and they look good, but at least the last change in PictureDataWriter.cpp (20292) should be reverted. I think we should also add a comment to that file, saying that the order of the instructions shouldn't be changed as it breaks the flattened format. From mmu_man at mail.berlios.de Fri Mar 2 10:00:14 2007 From: mmu_man at mail.berlios.de (mmu_man at BerliOS) Date: Fri, 2 Mar 2007 10:00:14 +0100 Subject: [Haiku-commits] r20304 - haiku/trunk/build/jam Message-ID: <200703020900.l2290Ewj023127@sheep.berlios.de> Author: mmu_man Date: 2007-03-02 10:00:13 +0100 (Fri, 02 Mar 2007) New Revision: 20304 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20304&view=rev Modified: haiku/trunk/build/jam/HaikuImage Log: Add usb_dev_info and kdlhangman (yay) to the image Modified: haiku/trunk/build/jam/HaikuImage =================================================================== --- haiku/trunk/build/jam/HaikuImage 2007-03-02 07:57:56 UTC (rev 20303) +++ haiku/trunk/build/jam/HaikuImage 2007-03-02 09:00:13 UTC (rev 20304) @@ -31,7 +31,7 @@ query quit release renice rescan rm rmattr rmindex rmdir roster route safemode screen_blanker sed settype setversion setvolume sh shutdown sleep sort split strace su sum sync sysinfo tail tar tcpdump tee telnet test top touch tput traceroute translate true tty uname unmount unrar unzip - unzipsfx uptime version vim waitfor wc wget whoami xargs xres yes zdiff zforce zgrep zip + unzipsfx uptime usb_dev_info version vim waitfor wc wget whoami xargs xres yes zdiff zforce zgrep zip zipcloak zipnote zipsplit zmore znew ; @@ -115,6 +115,7 @@ AddFilesToHaikuImage beos system add-ons kernel busses usb : uhci ohci ehci ; AddFilesToHaikuImage beos system add-ons kernel console : vga_text ; +AddFilesToHaikuImage beos system add-ons kernel debugger : hangman ; AddFilesToHaikuImage beos system add-ons kernel file_systems : $(BEOS_ADD_ONS_FILESYSTEMS) ; AddFilesToHaikuImage beos system add-ons kernel generic : block_io fast_log ide_adapter locked_pool mpu401 scsi_periph ; From bonefish at mail.berlios.de Fri Mar 2 10:34:33 2007 From: bonefish at mail.berlios.de (bonefish at BerliOS) Date: Fri, 2 Mar 2007 10:34:33 +0100 Subject: [Haiku-commits] r20305 - haiku/trunk/src/system/kernel/fs Message-ID: <200703020934.l229YX71027979@sheep.berlios.de> Author: bonefish Date: 2007-03-02 10:34:33 +0100 (Fri, 02 Mar 2007) New Revision: 20305 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20305&view=rev Modified: haiku/trunk/src/system/kernel/fs/vfs.cpp Log: * Changed get_vnode_name() to take a dirent* parameter instead of the name (saves copying the name, if that has to be done anyway) and added a wrapper version with the old interface. * dir_vnode_to_path() was broken for file systems that didn't support the get_vnode_name() hook. It resolved the mount point too early, so that it was searching the mount point and not the FS root dir for the node. It uses the get_vnode_name() function now (before resolving the mount point). Modified: haiku/trunk/src/system/kernel/fs/vfs.cpp =================================================================== --- haiku/trunk/src/system/kernel/fs/vfs.cpp 2007-03-02 09:00:13 UTC (rev 20304) +++ haiku/trunk/src/system/kernel/fs/vfs.cpp 2007-03-02 09:34:33 UTC (rev 20305) @@ -1784,14 +1784,19 @@ } +/** Returns a vnode's name in the d_name field of a supplied dirent buffer. + */ + static status_t -get_vnode_name(struct vnode *vnode, struct vnode *parent, - char *name, size_t nameSize) +get_vnode_name(struct vnode *vnode, struct vnode *parent, struct dirent *buffer, + size_t bufferSize) { - VNodePutter vnodePutter; + if (bufferSize < sizeof(struct dirent)) + return B_BAD_VALUE; // See if vnode is the root of a mount and move to the covered // vnode so we get the underlying file system + VNodePutter vnodePutter; if (vnode->mount->root_vnode == vnode && vnode->mount->covers_vnode != NULL) { vnode = vnode->mount->covers_vnode; inc_vnode_ref_count(vnode); @@ -1801,7 +1806,8 @@ if (FS_CALL(vnode, get_vnode_name)) { // The FS supports getting the name of a vnode. return FS_CALL(vnode, get_vnode_name)(vnode->mount->cookie, - vnode->private_node, name, nameSize); + vnode->private_node, buffer->d_name, + (char*)buffer + bufferSize - buffer->d_name); } // The FS doesn't support getting the name of a vnode. So we search the @@ -1815,18 +1821,14 @@ status_t status = FS_CALL(parent, open_dir)(parent->mount->cookie, parent->private_node, &cookie); if (status >= B_OK) { - char buffer[sizeof(struct dirent) + B_FILE_NAME_LENGTH]; - struct dirent *dirent = (struct dirent *)buffer; while (true) { uint32 num = 1; - status = dir_read(parent, cookie, dirent, sizeof(buffer), &num); + status = dir_read(parent, cookie, buffer, bufferSize, &num); if (status < B_OK) break; - if (vnode->id == dirent->d_ino) { + if (vnode->id == buffer->d_ino) { // found correct entry! - if (strlcpy(name, dirent->d_name, nameSize) >= nameSize) - status = B_BUFFER_OVERFLOW; break; } } @@ -1836,6 +1838,24 @@ } +static status_t +get_vnode_name(struct vnode *vnode, struct vnode *parent, char *name, + size_t nameSize) +{ + char buffer[sizeof(struct dirent) + B_FILE_NAME_LENGTH]; + struct dirent *dirent = (struct dirent *)buffer; + + status_t status = get_vnode_name(vnode, parent, buffer, sizeof(buffer)); + if (status != B_OK) + return status; + + if (strlcpy(name, dirent->d_name, nameSize) >= nameSize) + return B_BUFFER_OVERFLOW; + + return B_OK; +} + + /** Gets the full path to a given directory vnode. * It uses the fs_get_vnode_name() call to get the name of a vnode; if a * file system doesn't support this call, it will fall back to iterating @@ -1889,7 +1909,7 @@ char nameBuffer[sizeof(struct dirent) + B_FILE_NAME_LENGTH]; char *name = &((struct dirent *)nameBuffer)->d_name[0]; struct vnode *parentVnode; - vnode_id parentID, id; + vnode_id parentID; int type; // lookup the parent vnode @@ -1909,6 +1929,10 @@ goto out; } + // get the node's name + status = get_vnode_name(vnode, parentVnode, (struct dirent*)nameBuffer, + sizeof(nameBuffer)); + // resolve a volume root to its mount point mountPoint = resolve_volume_root_to_mount_point(parentVnode); if (mountPoint) { @@ -1919,17 +1943,6 @@ bool hitRoot = (parentVnode == vnode); - // Does the file system support getting the name of a vnode? - // If so, get it here... - if (status == B_OK && FS_CALL(vnode, get_vnode_name)) { - status = FS_CALL(vnode, get_vnode_name)(vnode->mount->cookie, vnode->private_node, - name, B_FILE_NAME_LENGTH); - } - - // ... if not, find it out later (by iterating through - // the parent directory, searching for the id) - id = vnode->id; - // release the current vnode, we only need its parent from now on put_vnode(vnode); vnode = parentVnode; @@ -1937,6 +1950,12 @@ if (status < B_OK) goto out; + if (hitRoot) { + // we have reached "/", which means we have constructed the full + // path + break; + } + // ToDo: add an explicit check for loops in about 10 levels to do // real loop detection @@ -1946,41 +1965,7 @@ goto out; } - if (hitRoot) { - // we have reached "/", which means we have constructed the full - // path - break; - } - - if (!FS_CALL(vnode, get_vnode_name)) { - // If we haven't got the vnode's name yet, we have to search for it - // in the parent directory now - fs_cookie cookie; - - status = FS_CALL(vnode, open_dir)(vnode->mount->cookie, vnode->private_node, - &cookie); - if (status >= B_OK) { - struct dirent *dirent = (struct dirent *)nameBuffer; - while (true) { - uint32 num = 1; - status = dir_read(vnode, cookie, dirent, sizeof(nameBuffer), - &num); - - if (status < B_OK) - break; - - if (id == dirent->d_ino) - // found correct entry! - break; - } - FS_CALL(vnode, close_dir)(vnode->mount->cookie, vnode->private_node, cookie); - } - - if (status < B_OK) - goto out; - } - - // add the name infront of the current path + // add the name in front of the current path name[B_FILE_NAME_LENGTH - 1] = '\0'; length = strlen(name); insert -= length; @@ -6915,14 +6900,15 @@ return B_FILE_ERROR; // get the vnode name - char name[B_FILE_NAME_LENGTH]; - status_t status = get_vnode_name(dirVNode, parentVNode, - name, sizeof(name)); + char _buffer[sizeof(struct dirent) + B_FILE_NAME_LENGTH]; + struct dirent *buffer = (struct dirent*)_buffer; + status_t status = get_vnode_name(dirVNode, parentVNode, buffer, + sizeof(_buffer)); if (status != B_OK) return status; // copy the name to the userland buffer - int len = user_strlcpy(userName, name, nameLength); + int len = user_strlcpy(userName, buffer->d_name, nameLength); if (len < 0) return len; if (len >= (int)nameLength) From bonefish at mail.berlios.de Fri Mar 2 12:18:15 2007 From: bonefish at mail.berlios.de (bonefish at BerliOS) Date: Fri, 2 Mar 2007 12:18:15 +0100 Subject: [Haiku-commits] r20306 - haiku/trunk/src/tests/add-ons/kernel/file_systems/userlandfs/r5/src/test/ramfs Message-ID: <200703021118.l22BIFAN021177@sheep.berlios.de> Author: bonefish Date: 2007-03-02 12:18:14 +0100 (Fri, 02 Mar 2007) New Revision: 20306 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20306&view=rev Modified: haiku/trunk/src/tests/add-ons/kernel/file_systems/userlandfs/r5/src/test/ramfs/NameIndex.cpp haiku/trunk/src/tests/add-ons/kernel/file_systems/userlandfs/r5/src/test/ramfs/Query.cpp Log: Fixed two query bugs: * For B_EQUALS queries the first match would be skipped. * Exact entry name matches were broken, since the used NameIndex::Find() expected null-terminated keys with the \0 included in the key length while it was fed only the raw string length. Modified: haiku/trunk/src/tests/add-ons/kernel/file_systems/userlandfs/r5/src/test/ramfs/NameIndex.cpp =================================================================== --- haiku/trunk/src/tests/add-ons/kernel/file_systems/userlandfs/r5/src/test/ramfs/NameIndex.cpp 2007-03-02 09:34:33 UTC (rev 20305) +++ haiku/trunk/src/tests/add-ons/kernel/file_systems/userlandfs/r5/src/test/ramfs/NameIndex.cpp 2007-03-02 11:18:14 UTC (rev 20306) @@ -189,8 +189,21 @@ AbstractIndexEntryIterator * NameIndex::InternalFind(const uint8 *key, size_t length) { - if (!key || length == 0 || key[length - 1] != '\0') + if (!key || length == 0) return NULL; + + // if the key is not null-terminated, copy it + uint8 clonedKey[kMaxIndexKeyLength]; + if (key[length - 1] != '\0') { + if (length >= kMaxIndexKeyLength) + length = kMaxIndexKeyLength - 1; + + memcpy(clonedKey, key, length); + clonedKey[length] = '\0'; + length++; + key = clonedKey; + } + NameIndexEntryIterator *iterator = new(nothrow) NameIndexEntryIterator; if (iterator) { if (!iterator->SetTo(this, (const char *)key)) { Modified: haiku/trunk/src/tests/add-ons/kernel/file_systems/userlandfs/r5/src/test/ramfs/Query.cpp =================================================================== --- haiku/trunk/src/tests/add-ons/kernel/file_systems/userlandfs/r5/src/test/ramfs/Query.cpp 2007-03-02 09:34:33 UTC (rev 20305) +++ haiku/trunk/src/tests/add-ons/kernel/file_systems/userlandfs/r5/src/test/ramfs/Query.cpp 2007-03-02 11:18:14 UTC (rev 20306) @@ -96,6 +96,8 @@ { status_t error = B_ENTRY_NOT_FOUND; if (fIndexWrapper && fIndexWrapper->fIndex) { + // TODO: We actually don't want an exact Find() here, but rather a + // FindClose(). fInitialized = fIndexWrapper->fIndex->Find(key, keyLength, &fIterator); if (fInitialized) error = B_OK; @@ -110,20 +112,22 @@ { status_t error = B_ENTRY_NOT_FOUND; if (fIndexWrapper && fIndexWrapper->fIndex) { - // get next entry - size_t keyLength; - if (fInitialized) - fIterator.GetNext(); - else { + // init iterator, if not done yet + if (!fInitialized) { fIndexWrapper->fIndex->GetIterator(&fIterator); fInitialized = true; } + // get key + size_t keyLength; if (Entry *entry = fIterator.GetCurrent(buffer, &keyLength)) { *_keyLength = keyLength; *_entry = entry; error = B_OK; } + + // get next entry + fIterator.GetNext(); } return error; } From axeld at pinc-software.de Fri Mar 2 12:38:37 2007 From: axeld at pinc-software.de (Axel =?iso-8859-15?q?D=F6rfler?=) Date: Fri, 02 Mar 2007 12:38:37 +0100 CET Subject: [Haiku-commits] =?iso-8859-15?q?r20301_-_haiku/trunk/src/add-ons/?= =?iso-8859-15?q?kernel/file=5Fsystems/ntfs/libntfs?= In-Reply-To: <200703020741.l227ffeP014540@sheep.berlios.de> Message-ID: <735511963-BeMail@zon> threedeyes at BerliOS wrote: > +#if defined(__BEOS__) || defined(__HAIKU__) __BEOS__ is always defined under Haiku as well, so checking for __BEOS__ sufficient here. But thanks for updating! :-) Bye, Axel. From nielx at mail.berlios.de Fri Mar 2 14:36:34 2007 From: nielx at mail.berlios.de (nielx at BerliOS) Date: Fri, 2 Mar 2007 14:36:34 +0100 Subject: [Haiku-commits] r20307 - in haiku/trunk/docs/user: . midi2 support Message-ID: <200703021336.l22DaYY6008873@sheep.berlios.de> Author: nielx Date: 2007-03-02 14:36:32 +0100 (Fri, 02 Mar 2007) New Revision: 20307 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20307&view=rev Added: haiku/trunk/docs/user/compatibility.dox haiku/trunk/docs/user/support/Beep.dox haiku/trunk/docs/user/support/BufferIO.dox haiku/trunk/docs/user/support/DataIO.dox haiku/trunk/docs/user/support/support_archiving.dox Modified: haiku/trunk/docs/user/Doxyfile haiku/trunk/docs/user/book.dox haiku/trunk/docs/user/midi2/midi2intro.dox haiku/trunk/docs/user/midi2/midiendpoint.dox haiku/trunk/docs/user/midi2/midiroster.dox haiku/trunk/docs/user/support/Autolock.dox haiku/trunk/docs/user/support/string.dox haiku/trunk/docs/user/support/support_intro.dox Log: * Take a document on compatibility from the Haiku website (experimenting with pages) - Originally written by Ingo and updated by others, I have permission from Ingo. * book.dox Rework a bit of the structure * midi2/support Separate the overview (or Introduction) from the list of elements in a module. * support Wrote initial documentation for Beep/BufferIO/DataIO * Stub for article on archiving. Modified: haiku/trunk/docs/user/Doxyfile =================================================================== --- haiku/trunk/docs/user/Doxyfile 2007-03-02 11:18:14 UTC (rev 20306) +++ haiku/trunk/docs/user/Doxyfile 2007-03-02 13:36:32 UTC (rev 20307) @@ -100,7 +100,7 @@ # members were ordinary class members. Constructors, destructors and assignment # operators of the base classes will not be shown. -INLINE_INHERITED_MEMB = NO +INLINE_INHERITED_MEMB = YES # If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full # path before files name in the file list and in the header files. If set @@ -1022,8 +1022,10 @@ # undefined via #undef or recursively expanded use the := operator # instead of the = operator. -PREDEFINED = +# Beep.h requires __cplusplus to be defined. +PREDEFINED = __cplusplus + # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then # this tag can be used to specify a list of macro names that should be expanded. # The macro definition that is found in the sources will be used. Modified: haiku/trunk/docs/user/book.dox =================================================================== --- haiku/trunk/docs/user/book.dox 2007-03-02 11:18:14 UTC (rev 20306) +++ haiku/trunk/docs/user/book.dox 2007-03-02 13:36:32 UTC (rev 20307) @@ -4,14 +4,21 @@ \section kits Kits and Servers - \ref midi1 -- \ref midi2 -- \ref support +- \ref midi2 | \link midi2_intro \em Introduction \endlink +- \ref support | \link support_intro \em Introduction \endlink + +\section notes General Notes and Information +- \ref compatibility */ +// Define main kits + /*! \defgroup midi2 MIDI 2 Kit +\brief API for producing and consuming MIDI events. \defgroup libmidi2 (libmidi2.so) \defgroup support Support Kit +\brief Collection of utility classes that are used throughout the API. \defgroup libbe (libbe.so) \defgroup libroot (libroot.so) */ Added: haiku/trunk/docs/user/compatibility.dox =================================================================== --- haiku/trunk/docs/user/compatibility.dox 2007-03-02 11:18:14 UTC (rev 20306) +++ haiku/trunk/docs/user/compatibility.dox 2007-03-02 13:36:32 UTC (rev 20307) @@ -0,0 +1,45 @@ +/*! +\page compatibility Application Level API Incompatibilities with BeOS + +\author Ingo Weinhold + +Haiku R1 (x86) was designed and is being implemented to be binary and source +compatible with applications written for BeOS R5 (x86) to a large extent, but +not the other way around. In some cases we deliberately broke source +compatibility while at the same time maintaining binary compatibility. Here are +some specific examples: + +- The \c "be" header path is gone - it's called \c "os" in Haiku; since it is + always part of the default header search path anyway, you can always just + remove it to let your software compile on both platforms, ie. replace: +\code +#include +\endcode + with: +\code +#include +\endcode + or rather use the preferred method of omitting the first part and use: +\code +#include +\endcode + +- BeOS contains a deprecated \c add-ons/TrackerAddons.h header, and a + header called \c add-ons/TrackerAddOns.h - Haiku only contains the + latter. +- Likewise, you'll find \c support/byteorder.h and \c support/ByteOrder.h + in BeOS; Haiku only has ByteOrder.h. +- If you have subclassed BString and if you are using its \c _privateData + member, you might notice that it has been renamed to \link BString::fPrivateData + fPrivateData \endlink. However, it's use is deprecated, and it might even be + made private in the future. +- The undocumented functions defined in the headers are not implemented. +- The private Device Map API (used by OpenTracker) has been replaced by a + different API (Disk Device API). +- The application debugging interface is conceptually similar, but nevertheless + source and binary incompatible. +- The file system API has changed; file systems that worked on BeOS will no + longer work on Haiku. +- In several places we also dropped compatibility support for older BeOS + versions (PR2, R3, R4), which BeOS R5 still featured. +*/ \ No newline at end of file Modified: haiku/trunk/docs/user/midi2/midi2intro.dox =================================================================== --- haiku/trunk/docs/user/midi2/midi2intro.dox 2007-03-02 11:18:14 UTC (rev 20306) +++ haiku/trunk/docs/user/midi2/midi2intro.dox 2007-03-02 13:36:32 UTC (rev 20307) @@ -1,16 +1,12 @@ /*! -\ingroup midi2 -*/ +\page midi2_intro Introduction to the MIDI2 Kit -/*\{*/ - -/*! -\page midi2intro - The Midi Kit is the API that implements support for generating, processing, and playing music in MIDI format. MIDI, which stands for 'Musical Instrument Digital Interface', is a well-established -standard for representing and communicating musical data. +standard for representing and communicating musical data. This document serves +as an overview. If you would like to see all the components, please look at +\link midi2 the list with classes \endlink . \section midi2twokits The two kits @@ -273,7 +269,7 @@ \section midi2apidiffs API differences -As far as the end user is concerned, the OpenBeOS Midi Kit is mostly the same +As far as the end user is concerned, the Haiku Midi Kit is mostly the same as the BeOS R5 kits, although there are a few small differences in the API (mostly bug fixes): @@ -308,4 +304,9 @@ */ -/*\}*/ +/*! +\addtogroup midi2 + +Please have a look at the \link midi2_intro introduction \endlink for a more +comprehensive overview on how everything ties together. +*/ Modified: haiku/trunk/docs/user/midi2/midiendpoint.dox =================================================================== --- haiku/trunk/docs/user/midi2/midiendpoint.dox 2007-03-02 11:18:14 UTC (rev 20306) +++ haiku/trunk/docs/user/midi2/midiendpoint.dox 2007-03-02 13:36:32 UTC (rev 20307) @@ -1,5 +1,5 @@ /*! -\class BMidiEndpoint MidiEndpoint.h +\class BMidiEndpoint \ingroup midi2 \ingroup libmidi2 \brief Base class for all MIDI endpoints Modified: haiku/trunk/docs/user/midi2/midiroster.dox =================================================================== --- haiku/trunk/docs/user/midi2/midiroster.dox 2007-03-02 11:18:14 UTC (rev 20306) +++ haiku/trunk/docs/user/midi2/midiroster.dox 2007-03-02 13:36:32 UTC (rev 20307) @@ -1,4 +1,10 @@ /*! +\var B_MIDI_EVENT +\ingroup midi2 +\brief BMessage identifier of MIDI messages. +*/ + +/*! \class BMidiRoster MidiRoster.h \ingroup midi2 \ingroup libmidi2 Modified: haiku/trunk/docs/user/support/Autolock.dox =================================================================== --- haiku/trunk/docs/user/support/Autolock.dox 2007-03-02 11:18:14 UTC (rev 20306) +++ haiku/trunk/docs/user/support/Autolock.dox 2007-03-02 13:36:32 UTC (rev 20307) @@ -64,7 +64,7 @@ Since the object is created on stack, it is destroyed as soon as we leave the function. Because the destruction of the object causes it to unlock the BLocker or BLooper, you don't have to manually make sure that every -exit from the function is properly written. +exit from the function is properly unlocked. */ /*! @@ -96,8 +96,8 @@ BLocker or BLooper are destroyed though. The semaphore will be released and the Lock() call will fail. -If you might get this behaviour, you can use this method to help you -protect yourself from it. +If you expect this to happen, you can use this method to help you +protect yourself from any harm. \retval true The lock was acquired. \retval false Failed to acquire the lock. */ Added: haiku/trunk/docs/user/support/Beep.dox =================================================================== --- haiku/trunk/docs/user/support/Beep.dox 2007-03-02 11:18:14 UTC (rev 20306) +++ haiku/trunk/docs/user/support/Beep.dox 2007-03-02 13:36:32 UTC (rev 20307) @@ -0,0 +1,32 @@ +/*! +\file Beep.h +\brief Functions to generate sounds from the computer. +*/ + +/*! +\addtogroup support_globals +@{ +*/ + +/*! +\fn status_t beep() +\brief TODO: Not implemented nor documented. + +From Beep.h and in libbe.so. +*/ + +/*! +\fn status_t system_beep(const char* eventName) +\brief TODO: Not implemented nor documented. + +From Beep.h and in libbe.so. +*/ + +/*! +\fn status_t add_system_beep_event(const char* eventName, uint32 flags = 0) +\brief TODO: Not implemented nor documented. + +From Beep.h and in libbe.so. +*/ + +//! @} \ No newline at end of file Added: haiku/trunk/docs/user/support/BufferIO.dox =================================================================== --- haiku/trunk/docs/user/support/BufferIO.dox 2007-03-02 11:18:14 UTC (rev 20306) +++ haiku/trunk/docs/user/support/BufferIO.dox 2007-03-02 13:36:32 UTC (rev 20307) @@ -0,0 +1,163 @@ +/*! +\file BufferIO.h +\brief Provides the BBufferIO class. +*/ + +/*! +\class BBufferIO +\ingroup support +\ingroup libbe +\brief A buffered adapter for BPositionIO objects. +\author Stefano Ceccherini \ + +This class differs from other classes derived from BPositionIO in a sense that +it does not actually provide an actual entity to be read or written to, but +rather acts like a "frontend" to a stream. This class especially comes in +handy when working with files that are constantly written and rewritten and +where you want do this writing buffered so that the hard disk or the network +will not have to be accessed so frequently. + +This class works as follows. After constructing a BBufferIO object that you +want to be buffered, you can create this object. The constructor takes a +\c stream parameter that points to the object to be buffered. You then use +this object as a proxy to the resource you want to read of or write to. As +soon as you use ReadAt(), the buffer will be initialised to the contents +of the original stream, +and subsequent calls to the positions within the buffer will not be +routed to the original stream. In the same way WriteAt() will change +the data in the buffer, but not in the actual stream. In order to flush +the changes to the original stream, use the Flush() method. Deleting +the object when you are done with it will also flush the stream and +update the original stream. + +\note This class is not meant to be used in cases where the +original stream requires to be in a consistent state. Neither should this +class be used as a way to perform 'atomic' writes, because the object +might need to do partial writes if it needs to 'move' the buffer. This +happens for instance if the original stream is bigger than the buffer. +*/ + +/*! +\fn BBufferIO::BBufferIO(BPositionIO *stream, size_t bufferSize, bool ownsStream) +\brief Initialize a BBufferIO object. + +The constructor will create a buffer of the given size +and associate the object with the given BPositionIO stream. + +\param stream A pointer to a BPositionIO object. +\param bufferSize The size of the buffer that the object will allocate and use. +\param ownsStream Specifies if the object will delete the stream on destruction. +*/ + +/*! +\fn BBufferIO::~BBufferIO() +\brief Free the resources allocated by the object + +Flush pending changes to the stream and free the allocated memory. +If the \c owns_stream property is \c true, the destructor also +deletes the stream associated with the BBufferIO object. +*/ + + +/*! +\fn ssize_t BBufferIO::ReadAt(off_t pos, void *buffer, size_t size) +\brief Read the specified amount of bytes at the given position. +\param pos The offset into the stream where to read. +\param buffer A pointer to a buffer where to copy the read data. +\param size The amount of bytes to read. +\return The amount of bytes actually read, or an error code. +\retval B_NO_INIT The object is not associated with a valid BPositionIO stream. +\retval B_BAD_VALUE The \c buffer parameter is not valid. +*/ + +/*! +\fn ssize_t BBufferIO::WriteAt(off_t pos, const void *buffer, size_t size) +\brief Write the specified amount of bytes at the given position. +\param pos The offset into the stream where to write. +\param buffer A pointer to a buffer which contains the data to write. +\param size The amount of bytes to write. +\return The amount of bytes actually written, or an error code. +\retval B_NO_INIT The object is not associated with a valid BPositionIO stream. +\retval B_BAD_VALUE The \c buffer parameter is not valid. +*/ + +/*! +\fn off_t BBufferIO::Seek(off_t position, uint32 seekMode) +\brief Set the position in the stream. + + Set the position in the stream where the Read() and Write() functions + (inherited from BPositionIO) begin reading and writing. + How the position argument is understood depends on the seek_mode flag. + + \param position The position where you want to seek. + \param seekMode Can have three values: + - \c SEEK_SET. The position passed is an offset from the beginning of the stream; + in other words, the current position is set to position. + For this mode, position should be a positive value. + - \c SEEK_CUR. The position argument is an offset from the current position; + the value of the argument is added to the current position. + - \c SEEK_END. The position argument is an offset from the end of the stream. + In this mode the position argument should be negative (or zero). + + \return The current position as an offset in bytes + from the beginning of the stream. + + \retval B_NO_INIT The object is not associated with a valid BPositionIO stream. +*/ + +/*! +\fn off_t BBufferIO::Position() const +\brief Return the current position in the stream. +\return The current position as an offset in bytes + from the beginning of the stream. +\retval B_NO_INIT The object is not associated with a valid BPositionIO stream. +*/ + +/*! +\fn status_t BBufferIO::SetSize(off_t size) +\brief Call the SetSize() function of the assigned BPositionIO stream. +\param size The new size of the BPositionIO object. +\retval B_OK The stream is resized. +\retval B_NO_INIT The object is not associated with a valid BPositionIO stream. +*/ + +/*! +\fn status_t BBufferIO::Flush() +\brief Write pending modifications to the stream. +\return The amount of bytes written, or if it failed it will return an error code. +*/ + + +/*! +\fn BPositionIO *BBufferIO::Stream() const +\brief Return a pointer to the stream specified on construction. +\return A pointer to the BPositionIO stream specified on construction. +*/ + + +/*! +\fn size_t BBufferIO::BufferSize() const +\brief Return the size of the internal buffer. +\return The size of the buffer allocated by the object. +*/ + +/*! +\fn bool BBufferIO::OwnsStream() const +\brief Tell if the BBufferIO object "owns" the specified stream. +\retval true The object "owns" the stream and will destroy it upon destruction. +\retval false The object does not own the stream. +\sa SetOwnsStream() +*/ + +/*! +\fn void BBufferIO::SetOwnsStream(bool owns_stream) +\brief Set the \c owns_stream property of the object. +\param owns_stream If you pass \c true, the object will delete the stream + upon destruction, if you pass \c false it will not. +*/ + + +/*! +\fn void BBufferIO::PrintToStream() const +\brief Print the object to stdout. +*/ Added: haiku/trunk/docs/user/support/DataIO.dox =================================================================== --- haiku/trunk/docs/user/support/DataIO.dox 2007-03-02 11:18:14 UTC (rev 20306) +++ haiku/trunk/docs/user/support/DataIO.dox 2007-03-02 13:36:32 UTC (rev 20307) @@ -0,0 +1,405 @@ +/*! +\file DataIO.h +\brief Provides abstract BDataIO and BPositionIO and the derived BMallocIO and BMemoryIO classes. + +Pure virtual BDataIO and BPositioIO classes provide +the protocol for Read()/Write()/Seek(). + +BMallocIO and BMemoryIO classes implement the protocol, +as does BFile in the Storage Kit. +*/ + +//////////// BDataIO + +/*! +\class BDataIO +\ingroup support +\ingroup libbe +\brief Abstract interface for objects that provides read and write access to data. + +The interface provided by this class applies to objects or data that are +limited to reading and writing data. Classes derived from this class should +reimplement both the Read() and Write() method from this class. + +Candidates of types of data or objects that should be derived from this class +are probably broadcasting media streams (which don't support reading at a +certain point in the data) or network streams that output data continously. +Objects and data that support more advanced operations like seeking or +reading at writing at defined positions should derive their classes from +BPositionIO, which inherits this class. +*/ + +/*! +\fn BDataIO::BDataIO() +\brief This constructor does nothing. +*/ + +/*! +\fn BDataIO::~BDataIO() +\brief This destructor does nothing. +*/ + +/*! +\fn virtual ssize_t BDataIO::Read(void *buffer, size_t size) = 0 +\brief Pure virtual to read data. + +Your implementation should copy data into \c buffer, with the maximum size +of \c size. +\return You should return the amount of bytes actually read, or an error code + in case of failure. +*/ + +/*! +\fn virtual ssize_t BDataIO::Write(const void *buffer, size_t size) = 0 +\brief Pure virtual to write data. + +Your implementation should copy data from \c buffer, with the maximum size +of \c size. +\return You should return the amount of bytes actually written, or an error code + in case of failure. +*/ + +//////////// BPositionIO +/*! +\class BPositionIO +\ingroup support +\ingroup libbe +\brief Abstract interface that provides advanced read, write and seek access to data. + +The interface of this object applies to objects or data that allows +position-aware reading and writing of data. Classes that derive from this +class should at least reimplement ReadAt(), WriteAt(), Seek(), Position(), +SetSize() and GetSize() methods. + +A good example of a form of data that can derive from this object, are files. +The BFile class derives from BPositionIO and provides this interface to files. +If your object or data only supports linear reading and writing, consider +deriving from the baseclass BDataIO. + +A final note, from BDataIO this class inherits Read() and Write(). The default +implementation is to read or write the data at the current position indicated +by Position(). Reimplement the methods if you require a different behaviour. +*/ + +/*! +\fn BPositionIO::BPositionIO() +\brief This constructor does nothing. +*/ + +/*! +\fn virtual BPositionIO::~BPositionIO() +\brief This destructor does nothing. +*/ + +/*! +\fn virtual ssize_t BPositionIO::Read(void *buffer, size_t size) +\brief Read data from current position. + +This method is derived from BDataIO. The default implementation reads data from +the current position of the cursor, pointed at by Position(). If you require +different behaviour, please look at BDataIO::Read() for what is expected of +this method. +*/ + +/*! +\fn virtual ssize_t BPositionIO::Write(const void *buffer, size_t size) +\brief Write data to the current position. + +This method is derived from BDataIO. The default implementation writes data to +the current position of the cursor, pointed at by Position(). If you require +different behaviour, please look at BDataIO::Write() for what is expected of +this method. +*/ + +/*! +\fn virtual ssize_t BPositionIO::ReadAt(off_t position, void *buffer, size_t size) = 0 +\brief Pure virtual to read data from a certain position. + +Your implementation should copy data from the position indicated by \c position +into the \c buffer with the maximum size of \c size. + +\return The amount of bytes actually read, or an error code. +*/ + +/*! +\fn virtual ssize_t BPositionIO::WriteAt(off_t position, const void *buffer, size_t size) = 0 +\brief Pure virtual to write data to a certain position. + +Your implementation should copy data from \c buffer to the position indicated +by \c buffer with the maximum size of \c size. + +\return The amount of bytes actually written, or an error code. +*/ + +/*! +\fn virtual off_t BPositionIO::Seek(off_t position, uint32 seekMode) = 0 +\brief Pure virtual to move the cursor to a certain position. + +Your implementation should move the position of the cursor to the provided +point. What this actually means, depends on your object or data. + +\param position An integer that defines a position. +\param seekMode You will get one of the following values: + - \c SEEK_SET Set the cursor to the position indicated by \c position. + - \c SEEK_END Set the cursor to the end of the buffer, and go + \c position beyond that. + - \c SEEK_CUR Set the cursor the the current position plus \c position. +\return The new position. +*/ + +/*! +\fn virtual off_t BPositionIO::Position() const = 0 +\brief Pure virtual to return the current position of the cursor. + +\return +Your implementation should return the current position of the cursor. +*/ + +/*! +\fn virtual status_t BPositionIO::SetSize(off_t size) +\brief Set the size of the object or data. + +The default implementation returns \c B_ERROR. If your object or data allows +the size to be changed, reimplement this method. + +\return Return \c B_OK if everything succeeded, else return the appropriate + error code. +*/ + +/*! +\fn virtual status_t BPositionIO::GetSize(off_t* size) const +\brief Get the size of the object or data. + +The default implementation uses Seek() with the \c SEEK_END flag to +determine the size of the buffer. If your data or object has a different way +of determining size, reimplement this method. + +Please check that NULL is not passed into \c size if you reimplement it in +your class. + +\param[out] size The size of the object is put into this parameter. +\return This method returns \c B_OK on success or an error code on error. +\sa Seek() +*/ + +//////////// BMemoryIO +/*! +\class BMemoryIO +\ingroup support +\ingroup libbe +\brief A BPositionIO derived class that works on memory buffers. + +This class is used if you require access that confirms to the BPositionIO +interface on memory buffers that you created. If you would like to use that +interface on new buffers, have a look at BMallocIO. + +This class is particularly useful if you would like to use a class or method +that are written to make use of the BPositionIO interface. It might also +be used for 'secure' reading and writing from buffers, since this class +automatically checks the bounds of anything you might want to do. + +This class reimplements the Read(), Write(), ReadAt(), Writeat(), Seek() and +Position() interface from BPositionIO. +*/ + +/*! +\fn BMemoryIO::BMemoryIO(void *data, size_t length) +\brief Create a read/write object. + +\param data A pointer to the buffer to adopt. +\param length The size of the buffer. +\sa BMemoryIO(const void *buffer, size_t length) for a read-only implementation. +*/ + +/*! +\fn BMemoryIO::BMemoryIO(const void *buffer, size_t length) +\brief Create a read-only object. + +\param buffer A pointer to the \c const (read-only) buffer to adopt. +\param length The size of the buffer. +\sa BMemoryIO(void *buffer, size_t length) for a read-write implementation. +*/ + +/*! +\fn BMemoryIO::~BMemoryIO() +\brief The destructor does nothing. +*/ + +/*! +\fn ssize_t BMemoryIO::ReadAt(off_t pos, void *buffer, size_t size) +\brief Read from a given position. + +\param[in] pos The offset where to start reading data. +\param[out] buffer The buffer to copy the read bytes into. +\param[in] size The size of the \c buffer. +\return The amount of read bytes or an error code. +\retval B_BAD_VALUE The position is less than zero or the buffer given on + construction is invalid. +*/ + +/*! +\fn ssize_t BMemoryIO::WriteAt(off_t pos, const void *buffer, size_t size) +\brief Write to a given position. + +\param pos The offset to write to. +\param buffer The buffer to copy the bytes from. +\param size The number of bytes to write. +\return The amount of bytes written or an error code. +\retval B_NOT_ALLOWED The object is constructed as a read-only object. +\retval B_BAD_VALUE The position is less than zero or the buffer given on + construction is invalid. +*/ + +/*! +\fn off_t BMemoryIO::Seek(off_t position, uint32 seek_mode) +\brief Move the cursor to a given position. + +\param position The position to move the cursor to. +\param seek_mode The mode determines where the cursor is placed. Possibilities: + - \c SEEK_SET The cursor is set to \c position. + - \c SEEK_CUR The \c position is added to the current position of the cursor. + - \c SEEK_END The cursor is put at the end of the data, plus + \c position added to it. +\return The new position. +*/ + +/*! +\fn off_t BMemoryIO::Position() const +\brief Return the current position. +*/ + +/*! +\fn status_t BMemoryIO::SetSize(off_t size) +\brief Resize the buffer. + +This method does not actually resize the buffer. If the new size is greater +than the size of the buffer, resizing will fail. It will only succeed if the new +size is less than the size of the buffer. The buffer itself will not be resized +though. + +This method might be useful in some cases. If the buffer is larger than the +data it holds, changing the size will enable you to use the Seek() method +with the flag \c SEEK_END and not get an error if you read or write from +that position, since you actually have a buffer at the end. + +\retval B_OK The buffer is resized. +\retval B_NOT_ALLOWED The buffer is read-only. +\retval B_ERROR The \c size is larger than the size of the buffer. +*/ + +//////////// BMallocIO +/*! +\class BMallocIO +\ingroup support +\ingroup libbe +\brief A BPositionIO derived class that creates a memory buffer. + +This class creates a memory buffer and provides a BPositionIO interface to work +on it. The memory buffer grows and shrinks automatically. +This is especially useful if you want to use a method or function that +works on an object derived from BPositionIO and you want to do something with +the resulting data, or it could be useful if you want to read and write to +memory in a safe way, since this class has boundary checking. + +BMallocIO allocates a buffer based on a certain blocksize. This provides a +mechanism that will prevent it from needing to allocate new memory too often. +The default blocksize is 256 bytes, you can change it with SetBlockSize(). If you +are sure you are going to use a bigger buffer, change the blocksize so that +you won't have to allocate more memory too often, especially if you use this +class in performance-critical code. + +If you require a BPositionIO derived object that works on buffers you provide, +have a look at BMemoryIO. +*/ + +/*! +\fn BMallocIO::BMallocIO() +\brief Create a new memory buffer with block size 256. +\sa SetBlockSize() +*/ + +/*! +\fn BMallocIO::~BMallocIO() +\brief Destroy the object and free the internal buffer. +*/ + +/*! +\fn ssize_t BMallocIO::ReadAt(off_t pos, void *buffer, size_t size) +\brief Read data at a certain position. + +\param[in] pos Offset into the data where to read from. +\param[out] buffer The buffer to copy the read bytes in. +\param [in] size Size of the buffer. +\return The number of read bytes, or \c B_BAD_VALUE if + the provided \c buffer is invalid. +*/ + +/*! +\fn ssize_t BMallocIO::WriteAt(off_t pos, const void *buffer, size_t size) +\brief Write data to a certain position. + +\param pos Offset into the data where to write to. +\param buffer The buffer to copy from. +\param size The size of the buffer. +\return The number of bytes written or \c B_BAD_VALUE if the provided \c buffer +is invalid. +*/ + +/*! +\fn off_t BMallocIO::Seek(off_t position, uint32 seekMode) +\brief Move the cursor to a given position. + +\param position The position to move the cursor to. +\param seekMode The mode determines where the cursor is placed. Possibilities: + - \c SEEK_SET The cursor is set to \c position. + - \c SEEK_CUR The \c position is added to the current position of the cursor. + - \c SEEK_END The cursor is put at the end of the data, plus + \c position added to it. +\return The new position. +*/ + +/*! +\fn off_t BMallocIO::Position() const +\brief Return the position of the cursor. +*/ + +/*! +\fn status_t BMallocIO::SetSize(off_t size) +\brief Change the size of the buffer. + +This method changes the size of the current buffer. If \c size is smaller than +the current size, the data will be cleared. + +\param size The new size of the buffer. +\retval B_OK Resizing the data succeeded. +\retval B_NO_MEMORY Failed to allocate the necessary memory. +*/ + +/*! +\fn void BMallocIO::SetBlockSize(size_t blockSize) +\brief Change the block size to a certain value. + +This class allocates memory in blocks. If you are in performance-critical code +you might want to tweak this setting to create a better performance in case you +know you are going to allocate more than the default blocksize of 256. + +\param blockSize The new block size. +*/ + +/*! +\fn const void *BMallocIO::Buffer() const +\brief Return a pointer to the internal buffer. + +As with any pointer to internal buffers you can retrieve with the Haiku API, +make sure you don't change anything since it doesn't belong to you. +*/ + +/*! +\fn size_t BMallocIO::BufferLength() const +\brief Return the number of bytes in the buffer. + +This number doesn't have to be the same size as the buffer is. Because memory +is allocated in blocks the actual size of the buffer may be greater, but this +method only returns the number of bytes that are actually used. +*/ + Modified: haiku/trunk/docs/user/support/string.dox =================================================================== --- haiku/trunk/docs/user/support/string.dox 2007-03-02 11:18:14 UTC (rev 20306) +++ haiku/trunk/docs/user/support/string.dox 2007-03-02 13:36:32 UTC (rev 20307) @@ -28,6 +28,8 @@ \var char* BString::fPrivateData \brief BString's storage for data +This member is deprecated and might even go \c private in future releases. + If you are planning to derive from this object and you want to manipulate the raw string data, please have a look at LockBuffer() and UnlockBuffer(). */ @@ -1309,38 +1311,56 @@ /*! -\fn bool operator<(const char *str, const BString &string) -\brief Lexographically compare if \c str is less than a given BString. +\fn bool operator<(const char *a, const BString &b) +\brief Lexographically compare if \c a is less than a given BString. + +From String.h and in libbe.so. + \sa BString::operator<(const char *string) const */ /*! -\fn bool operator<=(const char *str, const BString &string) -\brief Lexographically compare if \c str is less than or equal to a given BString. +\fn bool operator<=(const char *a, const BString &b) +\brief Lexographically compare if \c a is less than or equal to a given BString. + +From String.h and in libbe.so. + \sa BString::operator<=(const char *string) const */ /*! -\fn bool operator==(const char *str, const BString &string) -\brief Lexographically compare if \c str is equal to a given BString. +\fn bool operator==(const char *a, const BString &b) +\brief Lexographically compare if \c a is equal to a given BString. + +From String.h and in libbe.so. + \sa BString::operator==(const char *string) const */ /*! -\fn bool operator>(const char *str, const BString &string) -\brief Lexographically compare if \c str is more than a given BString. +\fn bool operator>(const char *a, const BString &b) +\brief Lexographically compare if \c a is more than a given BString. + +From String.h and in libbe.so. + \sa BString::operator>(const char *string) const */ /*! -\fn bool operator>=(const char *str, const BString &string) -\brief Lexographically compare if \c str is more than or equal to a given BString. +\fn bool operator>=(const char *a, const BString &b) +\brief Lexographically compare if \c a is more than or equal to a given BString. + +From String.h and in libbe.so. + \sa BString::operator>=(const char *string) const */ /*! -\fn bool operator!=(const char *str, const BString &string) -\brief Lexographically compare if \c str is not equal to given BString. +\fn bool operator!=(const char *a, const BString &b) +\brief Lexographically compare if \c a is not equal to given BString. + +From String.h and in libbe.so. + \sa BString::operator!=(const char *string) const */ @@ -1351,6 +1371,8 @@ This function is useful if you need a global compare function to feed to BList::SortItems() for example. +From String.h and in libbe.so. + \sa BString::Compare(const BString &string) const */ @@ -1361,6 +1383,8 @@ This function is useful if you need a global compare function to feed to BList::SortItems() for example. +From String.h and in libbe.so. + \sa BString::Compare(const BString &string) const */ @@ -1371,16 +1395,20 @@ This function is useful if you need a global compare function to feed to BList::SortItems() for example. +From String.h and in libbe.so. + \sa BString::Compare(const BString &string) const */ /*! \fn int ICompare(const BString *, const BString *) +\brief Lexographically compare two strings in a case insensitive way. This function is useful if you need a global compare function to feed to BList::SortItems() for example. -\brief Lexographically compare two strings in a case insensitive way. +From String.h and in libbe.so. + \sa BString::Compare(const BString &string) const */ Added: haiku/trunk/docs/user/support/support_archiving.dox =================================================================== --- haiku/trunk/docs/user/support/support_archiving.dox 2007-03-02 11:18:14 UTC (rev 20306) +++ haiku/trunk/docs/user/support/support_archiving.dox 2007-03-02 13:36:32 UTC (rev 20307) @@ -0,0 +1,7 @@ +/*! +\page support_archiving Archiving and unarchiving objects. + +This document is also in the original BeBook, where it describes: +-# How to archive and unarchive an object +-# How to create an archivable object. +*/ \ No newline at end of file Modified: haiku/trunk/docs/user/support/support_intro.dox =================================================================== --- haiku/trunk/docs/user/support/support_intro.dox 2007-03-02 11:18:14 UTC (rev 20306) +++ haiku/trunk/docs/user/support/support_intro.dox 2007-03-02 13:36:32 UTC (rev 20307) @@ -1,10 +1,11 @@ /*! -\ingroup support -\page supportintro The Support Kit +\page support_intro Introduction to the Support Kit The Support Kit provides a handy set of functions and classes that you can -use in your applications. +use in your applications. Have a look at the overview, or go straight to +the complete \link support list of components \endlink of this kit. +\section Overview
  • Threading utility classes:
    • @@ -14,12 +15,13 @@
  • Archiving and IO:
    • -
    • BArchivable
    • +
    • BArchivable (\link support_archiving tutorial\endlink)
    • BFlattenable
    • BDataIO
      • BPositionIO
        • +
        • BBufferIO
        • BMemoryIO
        • BMallocIO
        @@ -32,8 +34,20 @@
      • BString
    • BStopWatch
    • [... truncated: 18 lines follow ...] From marcusoverhagen at arcor.de Fri Mar 2 16:26:26 2007 From: marcusoverhagen at arcor.de (Marcus Overhagen) Date: Fri, 2 Mar 2007 16:26:26 +0100 (CET) Subject: [Haiku-commits] r20292 - in haiku/trunk: headers/os/interface headers/private/interface src/kits/interface src/servers/app In-Reply-To: <894b9700703020025k4b1be976p32966129bb1aad9b@mail.gmail.com> References: <894b9700703020025k4b1be976p32966129bb1aad9b@mail.gmail.com> <200703012317.l21NHh3k006324@sheep.berlios.de> <894b9700703012326n4e807560q2565907e13dc5388@mail.gmail.com> <894b9700703012331t62e57999q340690d179129286@mail.gmail.com> Message-ID: <27558602.1172849186037.JavaMail.ngmail@webmail14> Stefano Ceccherini wrote: > > > Marcus, this creates a problem. BPictures can be replayed also with > > > the Play() function, without passing through the app_server (and > > > through ServerPicture). With this change, I think we are no longer > > > compatible with this behaviour. That should still work. > > /haiku/trunk/docs/develop/interface/BPicture_specifications.html > > in our repository. > > We need to respect that format for BPicture, to be able to read and > > play R5 pictures. I thought that "old style" format compatiblity had been droppped, thats why I changed a small part of this format implementation. However, I couldn't find the part which is responsible to write it except the PictureDataWriter, but that one only implements a small part. > And also, the print drivers expect a certain format, so we shouldn't change > it. I greped the whole "src" and "header" directories recursively before doing the change, but I didn't find any further reference to the BPicture opcodes. I also can't find where this is used by printers, can you give me a pointer? Where does the data come from, do you have some example flattened data for me? > I had a look at the rest of your changes and they look good, but at > least the last change in PictureDataWriter.cpp (20292) should be > reverted. I'm willing to revert whatever is necessary to remain compatible. > I think we should also add a comment to that file, saying > that the order of the instructions shouldn't be changed as it breaks > the flattened format. Definitely, I was looking for something like that. regards Marcus Viel oder wenig? Schnell oder langsam? Unbegrenzt surfen + telefonieren ohne Zeit- und Volumenbegrenzung? DAS TOP ANGEBOT JETZT bei Arcor: g?nstig und schnell mit DSL - das All-Inclusive-Paket f?r clevere Doppel-Sparer, nur 39,85 ? inkl. DSL- und ISDN-Grundgeb?hr! http://www.arcor.de/rd/emf-dsl-2 From philippe.houdoin at free.fr Fri Mar 2 17:29:19 2007 From: philippe.houdoin at free.fr (Philippe Houdoin) Date: Fri, 02 Mar 2007 17:29:19 +0100 Subject: [Haiku-commits] r20292 - in haiku/trunk: headers/os/interface headers/private/interface src/kits/interface src/servers/app Message-ID: <1172852959.45e850df502ad@imp.free.fr> >> And also, the print drivers expect a certain format, so we shouldn't >> change it. > > I greped the whole "src" and "header" directories recursively > before doing the change, but I didn't find any further reference > to the BPicture opcodes. > > I also can't find where this is used by printers, can you give me a pointer? The PDF Writer print driver does it. Check src/add-ons/print/drivers/pdf/source/PictureIterator.cpp, it does indeed assert opcodes order. - Philippe Houdoin From bonefish at mail.berlios.de Sat Mar 3 03:42:37 2007 From: bonefish at mail.berlios.de (bonefish at BerliOS) Date: Sat, 3 Mar 2007 03:42:37 +0100 Subject: [Haiku-commits] r20308 - haiku/trunk/src/system/kernel/fs Message-ID: <200703030242.l232gbgx016245@sheep.berlios.de> Author: bonefish Date: 2007-03-03 03:42:36 +0100 (Sat, 03 Mar 2007) New Revision: 20308 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20308&view=rev Modified: haiku/trunk/src/system/kernel/fs/vfs.cpp Log: * Introduced the new static lock sVnodeCoveredByMutex to guard the vnode::covered_by fields. Together with sMountOpLock it allows write access, either lock alone suffices for read access. Before sMountOpLock had to be acquired for read (and write) access, which meant that while mounting/unmounting a FS path resolution would have to wait. In case of the UserlandFS this would even cause a deadlock while mounting if the client tried to resolve the path of the device to be mounted (e.g. by opening it). * Added a clarifying comment about read access to the fs_mount::covers_vnode/root_vnode field and removed locking in resolve_volume_root_to_mount_point() which was not necessary for explained reasons. Modified: haiku/trunk/src/system/kernel/fs/vfs.cpp =================================================================== --- haiku/trunk/src/system/kernel/fs/vfs.cpp 2007-03-02 13:36:32 UTC (rev 20307) +++ haiku/trunk/src/system/kernel/fs/vfs.cpp 2007-03-03 02:42:36 UTC (rev 20308) @@ -88,6 +88,18 @@ #define FS_CALL(vnode, op) (vnode->mount->fs->op) #define FS_MOUNT_CALL(mount, op) (mount->fs->op) +/** \brief Structure to manage a mounted file system + + Note: The root_vnode and covers_vnode fields (what others?) are + initialized in fs_mount() and not changed afterwards. That is as soon + as the mount is mounted and it is made sure it won't be unmounted + (e.g. by holding a reference to a vnode of that mount) (read) access + to those fields is always safe, even without additional locking. Morever + while mounted the mount holds a reference to the covers_vnode, and thus + making the access path vnode->mount->covers_vnode->mount->... safe if a + reference to vnode is held (note that for the root mount covers_vnode + is NULL, though). + */ struct fs_mount { struct fs_mount *next; file_system_module_info *fs; @@ -136,20 +148,29 @@ * - sMountsTable will not be modified, * - the fields immutable after initialization of the fs_mount structures in * sMountsTable will not be modified, - * - vnode::covered_by of any vnode in sVnodeTable will not be modified, + * - vnode::covered_by of any vnode in sVnodeTable will not be modified. * * The thread trying to lock the lock must not hold sVnodeMutex or * sMountMutex. */ static recursive_lock sMountOpLock; +/** \brief Guards the vnode::covered_by field of any vnode + * + * The holder is allowed to read access the vnode::covered_by field of any + * vnode. Additionally holding sMountOpLock allows for write access. + * + * The thread trying to lock the must not hold sVnodeMutex. + */ +static mutex sVnodeCoveredByMutex; + /** \brief Guards sVnodeTable. * * The holder is allowed to read/write access sVnodeTable and to * to any unbusy vnode in that table, save * to the immutable fields (device, id, private_node, mount) to which * only read-only access is allowed, and to the field covered_by, which is - * guarded by sMountOpLock. + * guarded by sMountOpLock and sVnodeCoveredByMutex. * * The thread trying to lock the mutex must not hold sMountMutex. * You must not have this mutex held when calling create_sem(), as this @@ -1305,6 +1326,8 @@ if (context->cwd != NULL && context->cwd->mount == mount) { put_vnode(context->cwd); + // Note: We're only accessing the pointer, not the vnode itself + // in the lines below. if (context->cwd == mount->root_vnode) { // redirect the current working directory to the covered vnode @@ -1357,12 +1380,12 @@ struct vnode *volumeRoot = NULL; - recursive_lock_lock(&sMountOpLock); + mutex_lock(&sVnodeCoveredByMutex); if (vnode->covered_by) { volumeRoot = vnode->covered_by; inc_vnode_ref_count(volumeRoot); } - recursive_lock_unlock(&sMountOpLock); + mutex_unlock(&sVnodeCoveredByMutex); return volumeRoot; } @@ -1422,7 +1445,7 @@ * root of a volume. If it is (and if it is not "/"), the function obtains * a reference to the underlying mount point node and returns it. * - * \param vnode The vnode in question. + * \param vnode The vnode in question (caller must have a reference). * \return The mount point vnode the vnode covers, if it is indeed a volume * root and not "/", or \c NULL otherwise. */ @@ -1435,13 +1458,11 @@ struct vnode *mountPoint = NULL; - recursive_lock_lock(&sMountOpLock); struct fs_mount *mount = vnode->mount; if (vnode == mount->root_vnode && mount->covers_vnode) { mountPoint = mount->covers_vnode; inc_vnode_ref_count(mountPoint); } - recursive_lock_unlock(&sMountOpLock); return mountPoint; } @@ -3475,6 +3496,9 @@ if (mutex_init(&sMountMutex, "vfs_mount_lock") < 0) panic("vfs_init: error allocating mount lock\n"); + if (mutex_init(&sVnodeCoveredByMutex, "vfs_vnode_covered_by_lock") < 0) + panic("vfs_init: error allocating vnode::covered_by lock\n"); + if (mutex_init(&sVnodeMutex, "vfs_vnode_lock") < 0) panic("vfs_init: error allocating vnode lock\n"); @@ -4016,12 +4040,12 @@ if (status != B_OK) return; - recursive_lock_lock(&sMountOpLock); + mutex_lock(&sVnodeCoveredByMutex); if (vnode->covered_by) { entry->d_dev = vnode->covered_by->device; entry->d_ino = vnode->covered_by->id; } - recursive_lock_unlock(&sMountOpLock); + mutex_unlock(&sVnodeCoveredByMutex); put_vnode(vnode); } @@ -5422,8 +5446,10 @@ // No race here, since fs_mount() is the only function changing // covers_vnode (and holds sMountOpLock at that time). + mutex_lock(&sVnodeCoveredByMutex); if (mount->covers_vnode) mount->covers_vnode->covered_by = mount->root_vnode; + mutex_unlock(&sVnodeCoveredByMutex); if (!sRoot) sRoot = mount->root_vnode; @@ -5593,7 +5619,9 @@ mutex_unlock(&sVnodeMutex); + mutex_lock(&sVnodeCoveredByMutex); mount->covers_vnode->covered_by = NULL; + mutex_unlock(&sVnodeCoveredByMutex); put_vnode(mount->covers_vnode); // Free all vnodes associated with this mount. From threedeyes at mail.berlios.de Sat Mar 3 07:59:36 2007 From: threedeyes at mail.berlios.de (threedeyes at BerliOS) Date: Sat, 3 Mar 2007 07:59:36 +0100 Subject: [Haiku-commits] r20309 - haiku/trunk/src/add-ons/kernel/file_systems/ntfs Message-ID: <200703030659.l236xaeA005365@sheep.berlios.de> Author: threedeyes Date: 2007-03-03 07:59:35 +0100 (Sat, 03 Mar 2007) New Revision: 20309 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20309&view=rev Modified: haiku/trunk/src/add-ons/kernel/file_systems/ntfs/fs_func.c haiku/trunk/src/add-ons/kernel/file_systems/ntfs/fs_func.h haiku/trunk/src/add-ons/kernel/file_systems/ntfs/ntfs.h haiku/trunk/src/add-ons/kernel/file_systems/ntfs/ntfsdir.c Log: Some code and style cleanup Modified: haiku/trunk/src/add-ons/kernel/file_systems/ntfs/fs_func.c =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/ntfs/fs_func.c 2007-03-03 02:42:36 UTC (rev 20308) +++ haiku/trunk/src/add-ons/kernel/file_systems/ntfs/fs_func.c 2007-03-03 06:59:35 UTC (rev 20309) @@ -40,10 +40,6 @@ #include "volume_util.h" #include "fs_func.h" -#ifndef _READ_ONLY_ -static status_t do_unlink(nspace *vol, vnode *dir, const char *name, bool isdir); -#endif - #ifdef __HAIKU__ typedef struct identify_cookie { @@ -129,10 +125,6 @@ *ns = (nspace) { .state = NF_FreeClustersOutdate | NF_FreeMFTOutdate, - .uid = 0, - .gid = 0, - .fmask = 0177, - .dmask = 0777, .show_sys_files = false, }; @@ -558,7 +550,7 @@ stbuf->st_ino = MREF(ni->mft_no); if ( ni->mrec->flags & MFT_RECORD_IS_DIRECTORY ) { - stbuf->st_mode = S_IFDIR | (0777 & ~ns->dmask); + stbuf->st_mode = S_IFDIR | 0777; na = ntfs_attr_open(ni, AT_INDEX_ALLOCATION, NTFS_INDEX_I30, 4); if (na) { stbuf->st_size = na->data_size; @@ -606,10 +598,10 @@ free(intx_file); } ntfs_attr_close(na); - stbuf->st_mode |= (0777 & ~ns->fmask); + stbuf->st_mode |= 0666; } - stbuf->st_uid = ns->uid; - stbuf->st_gid = ns->gid; + stbuf->st_uid = 0; + stbuf->st_gid = 0; stbuf->st_atime = ni->last_access_time; stbuf->st_ctime = ni->last_mft_change_time; stbuf->st_mtime = ni->last_data_change_time; @@ -704,7 +696,7 @@ if(ni) ntfs_inode_close(ni); - ERRPRINT("dosfs_wstat: EXIT with (%s)\n", strerror(result)); + ERRPRINT("fs_wstat: EXIT with (%s)\n", strerror(result)); UNLOCK_VOL(ns); @@ -1694,7 +1686,6 @@ #endif #ifndef _READ_ONLY_ -static status_t do_unlink(nspace *vol, vnode *dir, const char *name, bool isdir) { Modified: haiku/trunk/src/add-ons/kernel/file_systems/ntfs/fs_func.h =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/ntfs/fs_func.h 2007-03-03 02:42:36 UTC (rev 20308) +++ haiku/trunk/src/add-ons/kernel/file_systems/ntfs/fs_func.h 2007-03-03 06:59:35 UTC (rev 20309) @@ -117,7 +117,7 @@ #endif //__HAIKU__ #ifndef _READ_ONLY_ -static status_t do_unlink(nspace *vol, vnode *dir, const char *name, bool isdir); +status_t do_unlink(nspace *vol, vnode *dir, const char *name, bool isdir); #endif #endif Modified: haiku/trunk/src/add-ons/kernel/file_systems/ntfs/ntfs.h =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/ntfs/ntfs.h 2007-03-03 02:42:36 UTC (rev 20308) +++ haiku/trunk/src/add-ons/kernel/file_systems/ntfs/ntfs.h 2007-03-03 06:59:35 UTC (rev 20309) @@ -122,10 +122,6 @@ int state; s64 free_clusters; long free_mft; - unsigned int uid; - unsigned int gid; - unsigned int fmask; - unsigned int dmask; BOOL ro; BOOL show_sys_files; BOOL silent; Modified: haiku/trunk/src/add-ons/kernel/file_systems/ntfs/ntfsdir.c =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/ntfs/ntfsdir.c 2007-03-03 02:42:36 UTC (rev 20308) +++ haiku/trunk/src/add-ons/kernel/file_systems/ntfs/ntfsdir.c 2007-03-03 06:59:35 UTC (rev 20309) @@ -46,17 +46,16 @@ char *filename = NULL; dircookie *cookie = (dircookie*)_dirent; - if (name_type == FILE_NAME_DOS)return 0; + if (name_type == FILE_NAME_DOS) + return 0; - if (ntfs_ucstombs(name, name_len, &filename, 0) < 0) - { + if (ntfs_ucstombs(name, name_len, &filename, 0) < 0) { ERRPRINT("Skipping unrepresentable filename\n"); return 0; } - if(strcmp(filename,".")==0 || strcmp(filename,"..")==0) - if (MREF(mref) == FILE_root || MREF(mref) >= FILE_first_user || false) - { + if(strcmp(filename,".")==0 || strcmp(filename,"..")==0) { + if (MREF(mref) == FILE_root || MREF(mref) >= FILE_first_user || false) { struct direntry *ent = (direntry*)ntfs_calloc(sizeof(direntry)); ent->name = (char*)ntfs_calloc(strlen(filename)+1); strcpy(ent->name,filename); @@ -64,8 +63,7 @@ ent->ino=MREF(mref); ent->next = NULL; - if(cookie->root==NULL) - { + if(cookie->root==NULL) { cookie->root = ent; cookie->walk = ent; } @@ -74,12 +72,11 @@ cookie->last->next = ent; cookie->last = ent; - } else { - - free(filename); - return -1; - } - + } else { + free(filename); + return -1; + } + } free(filename); return 0; } @@ -92,19 +89,18 @@ char *filename = NULL; dircookie *cookie = (dircookie*)_dirent; - if (name_type == FILE_NAME_DOS)return 0; + if (name_type == FILE_NAME_DOS) + return 0; - if (ntfs_ucstombs(name, name_len, &filename, 0) < 0) - { + if (ntfs_ucstombs(name, name_len, &filename, 0) < 0) { ERRPRINT("Skipping unrepresentable filename\n"); return 0; } if(strcmp(filename,".")==0 || strcmp(filename,"..")==0) - return 0; + return 0; - if (MREF(mref) == FILE_root || MREF(mref) >= FILE_first_user || false) - { + if (MREF(mref) == FILE_root || MREF(mref) >= FILE_first_user || false) { struct direntry *ent = (direntry*)ntfs_calloc(sizeof(direntry)); ent->name = (char*)ntfs_calloc(strlen(filename)+1); strcpy(ent->name,filename); @@ -112,8 +108,7 @@ ent->ino=MREF(mref); ent->next = NULL; - if(cookie->root==NULL) - { + if(cookie->root==NULL) { cookie->root = ent; cookie->walk = ent; } @@ -163,7 +158,6 @@ int result = B_NO_ERROR; ntfs_inode *ni=NULL; dircookie *cookie = (dircookie*)ntfs_calloc( sizeof(dircookie) ); - u64 pos=0; LOCK_VOL(ns); @@ -180,8 +174,7 @@ goto exit; } - if ( cookie != NULL ) - { + if ( cookie != NULL ) { cookie->dev = ns->id; cookie->pos = 0; //cookie->walk_dir = ni; @@ -190,9 +183,9 @@ cookie->last = NULL; cookie->walk = NULL; *_cookie = (void*)cookie; - } - else + } else { result = ENOMEM; + } exit: if(ni) @@ -222,22 +215,22 @@ ERRPRINT("fs_closedir - ENTER\n"); entry=cookie->root; - if(entry) - for(;;) - { - entrynext = entry->next; + if(entry) { + for(;;) { + entrynext = entry->next; - if(entry->name) - free(entry->name); + if(entry->name) + free(entry->name); - if(entry) - free(entry); + if(entry) + free(entry); - entry = entrynext; + entry = entrynext; - if(!entry) - break; + if(!entry) + break; } + } ERRPRINT("fs_closedir - EXIT\n"); @@ -266,14 +259,12 @@ ERRPRINT("fs_readdir - ENTER:\n"); - if (!ns || !node || !cookie || !num || bufsize < sizeof(buf)) - { + if (!ns || !node || !cookie || !num || bufsize < sizeof(buf)) { result = -1; goto quit; } - if(cookie->pos==0) - { + if(cookie->pos==0) { ni = ntfs_inode_open(ns->ntvol, node->vnid); if(ni==NULL) { result = ENOENT; @@ -281,28 +272,25 @@ } ntfs_readdir(ni, &pos, cookie, (ntfs_filldir_t)_ntfs_dirent_dot_filler); cookie->pos+=2; - } - else - if(cookie->pos==2) - { - ni = ntfs_inode_open(ns->ntvol, node->vnid); + } else { + if(cookie->pos==2) { + ni = ntfs_inode_open(ns->ntvol, node->vnid); if(ni==NULL) { result = ENOENT; goto quit; } ntfs_readdir(ni, &pos, cookie, (ntfs_filldir_t)_ntfs_dirent_filler); cookie->pos++; + } } - if(cookie->root==NULL || cookie->last==NULL) - { + if(cookie->root==NULL || cookie->last==NULL) { result = -1; goto quit; } - if(cookie->walk==NULL) - { + if(cookie->walk==NULL) { result = ENOENT; goto quit; } @@ -354,9 +342,8 @@ LOCK_VOL(ns); ERRPRINT("fs_rewinddir - ENTER\n"); - if ( cookie != NULL ) - { - //cookie->pos = 0; + if ( cookie != NULL ) { + cookie->pos = 0; cookie->walk = cookie->root; result = B_NO_ERROR; } From bonefish at mail.berlios.de Sat Mar 3 11:26:35 2007 From: bonefish at mail.berlios.de (bonefish at BerliOS) Date: Sat, 3 Mar 2007 11:26:35 +0100 Subject: [Haiku-commits] r20310 - haiku/trunk/src/add-ons/kernel/file_systems/userlandfs Message-ID: <200703031026.l23AQZMu015383@sheep.berlios.de> Author: bonefish Date: 2007-03-03 11:26:35 +0100 (Sat, 03 Mar 2007) New Revision: 20310 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20310&view=rev Removed: haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/ufs_mount/ Modified: haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/Jamfile Log: We don't need ufs_mount anymore. One can simply use mount: mount -t userlandfs -p " " ... The parameters may change later in order to become a proper driver settings string. Modified: haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/Jamfile =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/Jamfile 2007-03-03 06:59:35 UTC (rev 20309) +++ haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/Jamfile 2007-03-03 10:26:35 UTC (rev 20310) @@ -2,4 +2,3 @@ SubInclude HAIKU_TOP src add-ons kernel file_systems userlandfs kernel_add_on ; SubInclude HAIKU_TOP src add-ons kernel file_systems userlandfs server ; -#SubInclude HAIKU_TOP src add-ons kernel file_systems userlandfs ufs_mount ; From bonefish at mail.berlios.de Sat Mar 3 14:14:37 2007 From: bonefish at mail.berlios.de (bonefish at BerliOS) Date: Sat, 3 Mar 2007 14:14:37 +0100 Subject: [Haiku-commits] r20312 - buildtools/vendor/gcc Message-ID: <200703031314.l23DEbns005463@sheep.berlios.de> Author: bonefish Date: 2007-03-03 14:14:36 +0100 (Sat, 03 Mar 2007) New Revision: 20312 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20312&view=rev Added: buildtools/vendor/gcc/4.1.2/ Log: Tagging gcc 4.1.2. Copied: buildtools/vendor/gcc/4.1.2 (from rev 20311, buildtools/vendor/gcc/current) From korli at mail.berlios.de Sat Mar 3 14:20:26 2007 From: korli at mail.berlios.de (korli at BerliOS) Date: Sat, 3 Mar 2007 14:20:26 +0100 Subject: [Haiku-commits] r20313 - haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs Message-ID: <200703031320.l23DKQYZ005902@sheep.berlios.de> Author: korli Date: 2007-03-03 14:20:26 +0100 (Sat, 03 Mar 2007) New Revision: 20313 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20313&view=rev Modified: haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/config.h Log: gcc4 complains a lot of these #undef followed by values ... Modified: haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/config.h =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/config.h 2007-03-03 13:14:36 UTC (rev 20312) +++ haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/config.h 2007-03-03 13:20:26 UTC (rev 20313) @@ -182,7 +182,7 @@ #undef HAVE_SYSLOG_H /* Define to 1 if you have the header file. */ -#undef HAVE_SYS_BYTEORDER_H 1 +#undef HAVE_SYS_BYTEORDER_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_ENDIAN_H @@ -203,7 +203,7 @@ #define HAVE_SYS_STAT_H 1 /* Define to 1 if you have the header file. */ -#undef HAVE_SYS_SYSMACROS_H 1 +#undef HAVE_SYS_SYSMACROS_H /* Define to 1 if you have the header file. */ #define HAVE_SYS_TYPES_H 1 From korli at mail.berlios.de Sat Mar 3 16:26:59 2007 From: korli at mail.berlios.de (korli at BerliOS) Date: Sat, 3 Mar 2007 16:26:59 +0100 Subject: [Haiku-commits] r20314 - haiku/trunk/src/apps/expander Message-ID: <200703031526.l23FQx37014848@sheep.berlios.de> Author: korli Date: 2007-03-03 16:26:57 +0100 (Sat, 03 Mar 2007) New Revision: 20314 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20314&view=rev Modified: haiku/trunk/src/apps/expander/DirectoryFilePanel.cpp haiku/trunk/src/apps/expander/DirectoryFilePanel.h haiku/trunk/src/apps/expander/ExpanderApp.cpp haiku/trunk/src/apps/expander/ExpanderApp.h haiku/trunk/src/apps/expander/ExpanderPreferences.cpp haiku/trunk/src/apps/expander/ExpanderPreferences.h haiku/trunk/src/apps/expander/ExpanderRules.cpp haiku/trunk/src/apps/expander/ExpanderRules.h haiku/trunk/src/apps/expander/ExpanderSettings.cpp haiku/trunk/src/apps/expander/ExpanderSettings.h haiku/trunk/src/apps/expander/ExpanderThread.cpp haiku/trunk/src/apps/expander/ExpanderThread.h haiku/trunk/src/apps/expander/ExpanderWindow.cpp haiku/trunk/src/apps/expander/ExpanderWindow.h haiku/trunk/src/apps/expander/GenericThread.cpp haiku/trunk/src/apps/expander/GenericThread.h Log: fixing indenting style issues Modified: haiku/trunk/src/apps/expander/DirectoryFilePanel.cpp =================================================================== --- haiku/trunk/src/apps/expander/DirectoryFilePanel.cpp 2007-03-03 13:20:26 UTC (rev 20313) +++ haiku/trunk/src/apps/expander/DirectoryFilePanel.cpp 2007-03-03 15:26:57 UTC (rev 20314) @@ -22,7 +22,7 @@ bool -DirectoryRefFilter::Filter(const entry_ref *ref, BNode* node, struct stat *st, +DirectoryRefFilter::Filter(const entry_ref *ref, BNode* node, struct stat *st, const char *filetype) { return node->IsDirectory(); @@ -32,13 +32,13 @@ // #pragma mark - -DirectoryFilePanel::DirectoryFilePanel(file_panel_mode mode, BMessenger *target, - const entry_ref *startDirectory, uint32 nodeFlavors, - bool allowMultipleSelection, BMessage *message, BRefFilter *filter, +DirectoryFilePanel::DirectoryFilePanel(file_panel_mode mode, BMessenger *target, + const entry_ref *startDirectory, uint32 nodeFlavors, + bool allowMultipleSelection, BMessage *message, BRefFilter *filter, bool modal, bool hideWhenDone) - : BFilePanel(mode, target, startDirectory, nodeFlavors, + : BFilePanel(mode, target, startDirectory, nodeFlavors, allowMultipleSelection, message, filter, modal, hideWhenDone), - fCurrentButton(NULL) + fCurrentButton(NULL) { } @@ -48,7 +48,7 @@ { if (fCurrentButton == NULL) { Window()->Lock(); - BView* background = Window()->ChildAt(0); + BView* background = Window()->ChildAt(0); BView* cancel = background->FindView("cancel button"); BRect rect; Modified: haiku/trunk/src/apps/expander/DirectoryFilePanel.h =================================================================== --- haiku/trunk/src/apps/expander/DirectoryFilePanel.h 2007-03-03 13:20:26 UTC (rev 20313) +++ haiku/trunk/src/apps/expander/DirectoryFilePanel.h 2007-03-03 15:26:57 UTC (rev 20314) @@ -9,18 +9,18 @@ // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation -// the rights to use, copy, modify, merge, publish, distribute, sublicense, -// and/or sell copies of the Software, and to permit persons to whom the +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // -// The above copyright notice and this permission notice shall be included +// The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. /*****************************************************************************/ @@ -37,7 +37,7 @@ class DirectoryRefFilter : public BRefFilter { public: DirectoryRefFilter(); - bool Filter(const entry_ref *ref, BNode* node, struct stat *st, + bool Filter(const entry_ref *ref, BNode* node, struct stat *st, const char *filetype); }; @@ -51,7 +51,7 @@ bool modal = false, bool hide_when_done = true); virtual void SelectionChanged(void); virtual void Show(); - + protected: BButton *fCurrentButton; }; Modified: haiku/trunk/src/apps/expander/ExpanderApp.cpp =================================================================== --- haiku/trunk/src/apps/expander/ExpanderApp.cpp 2007-03-03 13:20:26 UTC (rev 20313) +++ haiku/trunk/src/apps/expander/ExpanderApp.cpp 2007-03-03 15:26:57 UTC (rev 20314) @@ -37,7 +37,7 @@ view->GetFont(&font); font.SetSize(18); - font.SetFace(B_BOLD_FACE); + font.SetFace(B_BOLD_FACE); view->SetFontAndColor(0, 14, &font); alert->Go(); @@ -72,14 +72,14 @@ void ExpanderApp::RefsReceived(BMessage *msg) -{ - BMessenger messenger(fWindow); - msg->AddBool("fromApp", true); - messenger.SendMessage(msg); +{ + BMessenger messenger(fWindow); + msg->AddBool("fromApp", true); + messenger.SendMessage(msg); } -void +void ExpanderApp::UpdateSettingsFrom(BMessage *message) { fSettings.UpdateFrom(message); Modified: haiku/trunk/src/apps/expander/ExpanderApp.h =================================================================== --- haiku/trunk/src/apps/expander/ExpanderApp.h 2007-03-03 13:20:26 UTC (rev 20313) +++ haiku/trunk/src/apps/expander/ExpanderApp.h 2007-03-03 15:26:57 UTC (rev 20314) @@ -10,18 +10,18 @@ // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation -// the rights to use, copy, modify, merge, publish, distribute, sublicense, -// and/or sell copies of the Software, and to permit persons to whom the +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // -// The above copyright notice and this permission notice shall be included +// The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. /*****************************************************************************/ @@ -34,19 +34,19 @@ #include "ExpanderWindow.h" class ExpanderApp : public BApplication { -public: - ExpanderApp(); + public: + ExpanderApp(); -public: - virtual void AboutRequested(); - virtual void ArgvReceived(int32 argc, char **argv); - virtual void ReadyToRun(); - virtual void RefsReceived(BMessage *msg); - - ExpanderSettings fSettings; - void UpdateSettingsFrom(BMessage *message); -private: - ExpanderWindow *fWindow; + public: + virtual void AboutRequested(); + virtual void ArgvReceived(int32 argc, char **argv); + virtual void ReadyToRun(); + virtual void RefsReceived(BMessage *msg); + + ExpanderSettings fSettings; + void UpdateSettingsFrom(BMessage *message); + private: + ExpanderWindow *fWindow; }; #endif /* _ExpanderApp_h */ Modified: haiku/trunk/src/apps/expander/ExpanderPreferences.cpp =================================================================== --- haiku/trunk/src/apps/expander/ExpanderPreferences.cpp 2007-03-03 13:20:26 UTC (rev 20313) +++ haiku/trunk/src/apps/expander/ExpanderPreferences.cpp 2007-03-03 15:26:57 UTC (rev 20314) @@ -2,7 +2,7 @@ * Copyright 2004-2006, J?r?me DUVAL. All rights reserved. * Distributed under the terms of the MIT License. */ - + #include "ExpanderPreferences.h" #include #include @@ -18,169 +18,169 @@ const uint32 MSG_DESTSELECT = 'mDes'; ExpanderPreferences::ExpanderPreferences(BMessage *settings) - : BWindow(BRect(0, 0, 325, 305), "Expand-O-Matic", B_MODAL_WINDOW, + : BWindow(BRect(0, 0, 325, 305), "Expand-O-Matic", B_MODAL_WINDOW, B_NOT_CLOSABLE | B_NOT_RESIZABLE), fSettings(settings), fUsePanel(NULL) { BRect rect = Bounds(); - BBox *background = new BBox(rect, "background", B_FOLLOW_ALL, + BBox *background = new BBox(rect, "background", B_FOLLOW_ALL, B_WILL_DRAW | B_FRAME_EVENTS, B_PLAIN_BORDER); AddChild(background); - rect.OffsetBy(11,9); + rect.OffsetBy(11, 9); rect.bottom -= 64; rect.right -= 22; - BBox *box = new BBox(rect, "background", B_FOLLOW_NONE, + BBox *box = new BBox(rect, "background", B_FOLLOW_NONE, B_WILL_DRAW | B_FRAME_EVENTS, B_FANCY_BORDER); box->SetLabel("Expander Preferences"); background->AddChild(box); - - float maxWidth=box->Bounds().right; - + + float maxWidth = box->Bounds().right; + BRect frameRect = box->Bounds(); - frameRect.OffsetBy(15,23); + frameRect.OffsetBy(15, 23); frameRect.right = frameRect.left + 200; frameRect.bottom = frameRect.top + 20; BRect textRect(frameRect); textRect.OffsetTo(B_ORIGIN); - textRect.InsetBy(1,1); + textRect.InsetBy(1, 1); BStringView *stringView = new BStringView(frameRect, "expansion", "Expansion:", B_FOLLOW_LEFT | B_FOLLOW_TOP, B_WILL_DRAW); stringView->ResizeToPreferred(); if (stringView->Frame().right > maxWidth) - maxWidth = stringView->Frame().right; + maxWidth = stringView->Frame().right; box->AddChild(stringView); - - frameRect.top = stringView->Frame().bottom + 5; + + frameRect.top = stringView->Frame().bottom + 5; frameRect.left += 10; - + fAutoExpand = new BCheckBox(frameRect, "autoExpand", "Automatically expand files", NULL); fAutoExpand->ResizeToPreferred(); if (fAutoExpand->Frame().right > maxWidth) - maxWidth = fAutoExpand->Frame().right; + maxWidth = fAutoExpand->Frame().right; box->AddChild(fAutoExpand); - + frameRect = fAutoExpand->Frame(); frameRect.top = fAutoExpand->Frame().bottom + 1; fCloseWindow = new BCheckBox(frameRect, "closeWindowWhenDone", "Close window when done expanding", NULL); fCloseWindow->ResizeToPreferred(); if (fCloseWindow->Frame().right > maxWidth) - maxWidth = fCloseWindow->Frame().right; + maxWidth = fCloseWindow->Frame().right; box->AddChild(fCloseWindow); - + frameRect = stringView->Frame(); frameRect.top = fCloseWindow->Frame().bottom + 10; stringView = new BStringView(frameRect, "destinationFolder", "Destination Folder:", B_FOLLOW_LEFT | B_FOLLOW_TOP, B_WILL_DRAW); - stringView->ResizeToPreferred(); + stringView->ResizeToPreferred(); if (stringView->Frame().right > maxWidth) - maxWidth = stringView->Frame().right; + maxWidth = stringView->Frame().right; box->AddChild(stringView); - - frameRect.top = stringView->Frame().bottom + 5; + + frameRect.top = stringView->Frame().bottom + 5; frameRect.left += 10; - - fLeaveDest = new BRadioButton(frameRect, "leaveDest", "Leave destination folder path empty", + + fLeaveDest = new BRadioButton(frameRect, "leaveDest", "Leave destination folder path empty", new BMessage(MSG_LEAVEDEST)); fLeaveDest->ResizeToPreferred(); if (fLeaveDest->Frame().right > maxWidth) - maxWidth = fLeaveDest->Frame().right; + maxWidth = fLeaveDest->Frame().right; box->AddChild(fLeaveDest); - + frameRect = fLeaveDest->Frame(); frameRect.top = fLeaveDest->Frame().bottom + 1; - fSameDest = new BRadioButton(frameRect, "sameDir", "Same directory as source (archive) file", + fSameDest = new BRadioButton(frameRect, "sameDir", "Same directory as source (archive) file", new BMessage(MSG_SAMEDIR)); fSameDest->ResizeToPreferred(); if (fSameDest->Frame().right > maxWidth) - maxWidth = fSameDest->Frame().right; + maxWidth = fSameDest->Frame().right; box->AddChild(fSameDest); frameRect = fSameDest->Frame(); frameRect.top = frameRect.bottom + 1; - fDestUse = new BRadioButton(frameRect, "destUse", "Use:",new BMessage(MSG_DESTUSE)); + fDestUse = new BRadioButton(frameRect, "destUse", "Use:", new BMessage(MSG_DESTUSE)); fDestUse->ResizeToPreferred(); if (fDestUse->Frame().right > maxWidth) - maxWidth = fDestUse->Frame().right; + maxWidth = fDestUse->Frame().right; box->AddChild(fDestUse); - + frameRect = fDestUse->Frame(); frameRect.left = fDestUse->Frame().right + 1; frameRect.right = frameRect.left + 58; frameRect.bottom = frameRect.top + 38; - + fDestText = new BTextControl(frameRect, "destText", "", "", new BMessage(MSG_DESTTEXT)); box->AddChild(fDestText); fDestText->ResizeToPreferred(); fDestText->SetDivider(0); fDestText->TextView()->MakeEditable(false); - fDestText->ResizeTo(158,fDestText->Frame().Height()); - + fDestText->ResizeTo(158, fDestText->Frame().Height()); + fDestText->SetEnabled(false); - + frameRect = fDestText->Frame(); frameRect.left = frameRect.right + 5; fSelect = new BButton(frameRect, "selectButton", "Select", new BMessage(MSG_DESTSELECT)); fSelect->ResizeToPreferred(); if (fSelect->Frame().right > maxWidth) - maxWidth = fSelect->Frame().right; + maxWidth = fSelect->Frame().right; box->AddChild(fSelect); fSelect->SetEnabled(false); - - fDestText->MoveBy(0,(fSelect->Frame().Height() - fDestText->Frame().Height())/2.0); - fDestText->ResizeTo(158,fDestText->Frame().Height()); - + + fDestText->MoveBy(0, (fSelect->Frame().Height() - fDestText->Frame().Height()) / 2.0); + fDestText->ResizeTo(158, fDestText->Frame().Height()); + frameRect = stringView->Frame(); frameRect.top = fDestUse->Frame().bottom + 10; - - stringView = new BStringView(frameRect, "other", "Other:",B_FOLLOW_LEFT | B_FOLLOW_TOP, B_WILL_DRAW); + + stringView = new BStringView(frameRect, "other", "Other:", B_FOLLOW_LEFT | B_FOLLOW_TOP, B_WILL_DRAW); stringView->ResizeToPreferred(); if (stringView->Frame().right > maxWidth) - maxWidth = stringView->Frame().right; + maxWidth = stringView->Frame().right; box->AddChild(stringView); - - frameRect.top = stringView->Frame().bottom + 5; + + frameRect.top = stringView->Frame().bottom + 5; frameRect.left += 10; fOpenDest = new BCheckBox(frameRect, "openDestination", "Open destination folder after extraction", NULL); fOpenDest->ResizeToPreferred(); if (fOpenDest->Frame().right > maxWidth) - maxWidth = fOpenDest->Frame().right; + maxWidth = fOpenDest->Frame().right; box->AddChild(fOpenDest); - + frameRect = fOpenDest->Frame(); - frameRect.top = frameRect.bottom + 1; + frameRect.top = frameRect.bottom + 1; fAutoShow = new BCheckBox(frameRect, "autoShow", "Automatically show contents listing", NULL); fAutoShow->ResizeToPreferred(); if (fAutoShow->Frame().right > maxWidth) - maxWidth = fAutoShow->Frame().right; + maxWidth = fAutoShow->Frame().right; box->AddChild(fAutoShow); - - box->ResizeTo(maxWidth + 15,fAutoShow->Frame().bottom + 10); - - rect = BRect(Bounds().right-89, Bounds().bottom-40, Bounds().right-14, Bounds().bottom-16); - + + box->ResizeTo(maxWidth + 15, fAutoShow->Frame().bottom + 10); + + rect = BRect(Bounds().right - 89, Bounds().bottom - 40, Bounds().right - 14, Bounds().bottom - 16); + rect = Bounds(); - BButton *button = new BButton(rect, "OKButton", "OK",new BMessage(MSG_OK)); + BButton *button = new BButton(rect, "OKButton", "OK", new BMessage(MSG_OK)); button->MakeDefault(true); button->ResizeToPreferred(); - button->MoveTo(box->Frame().right - button->Frame().Width(),box->Frame().bottom + 10 ); + button->MoveTo(box->Frame().right - button->Frame().Width(), box->Frame().bottom + 10); background->AddChild(button); - + rect = button->Frame(); BButton *cancel = new BButton(rect, "CancelButton", "Cancel", new BMessage(MSG_CANCEL)); cancel->ResizeToPreferred(); - cancel->MoveBy(-cancel->Frame().Width() - 10, (button->Frame().Height() - cancel->Frame().Height()) /2.0); + cancel->MoveBy(-cancel->Frame().Width() - 10, (button->Frame().Height() - cancel->Frame().Height()) / 2.0); background->AddChild(cancel); - - ResizeTo(box->Frame().right + 11 ,button->Frame().bottom + 11); - + + ResizeTo(box->Frame().right + 11 , button->Frame().bottom + 11); + BScreen screen(this); - MoveBy((screen.Frame().Width()-Bounds().Width())/2, - (screen.Frame().Height()-Bounds().Height())/2); - + MoveBy((screen.Frame().Width() - Bounds().Width()) / 2, + (screen.Frame().Height() - Bounds().Height()) / 2); + bool automatically_expand_files; bool close_when_done; int8 destination_folder; @@ -190,11 +190,11 @@ if ((settings->FindBool("automatically_expand_files", &automatically_expand_files) == B_OK) && automatically_expand_files) fAutoExpand->SetValue(B_CONTROL_ON); - + if ((settings->FindBool("close_when_done", &close_when_done) == B_OK) && close_when_done) fCloseWindow->SetValue(B_CONTROL_ON); - + if (settings->FindInt8("destination_folder", &destination_folder) == B_OK) { switch (destination_folder) { case 0x63: @@ -210,21 +210,21 @@ break; } } - + if (settings->FindRef("destination_folder_use", &fRef) == B_OK) { BEntry entry(&fRef); if (entry.Exists()) { BPath path(&entry); fDestText->SetText(path.Path()); - } + } } - + if ((settings->FindBool("open_destination_folder", &open_destination_folder) == B_OK) && open_destination_folder) fOpenDest->SetValue(B_CONTROL_ON); - + if ((settings->FindBool("show_contents_listing", &show_contents_listing) == B_OK) - && show_contents_listing) + && show_contents_listing) fAutoShow->SetValue(B_CONTROL_ON); } @@ -240,21 +240,21 @@ switch (msg->what) { case MSG_DESTSELECT: if (!fUsePanel) - fUsePanel = new DirectoryFilePanel(B_OPEN_PANEL, new BMessenger(this), NULL, + fUsePanel = new DirectoryFilePanel(B_OPEN_PANEL, new BMessenger(this), NULL, B_DIRECTORY_NODE, false, NULL, new DirectoryRefFilter(), true); fUsePanel->Show(); break; case MSG_DIRECTORY: - { - entry_ref ref; - fUsePanel->GetPanelDirectory(&ref); - fRef = ref; - BEntry entry(&ref); - BPath path(&entry); - fDestText->SetText(path.Path()); - fUsePanel->Hide(); - } - break; + { + entry_ref ref; + fUsePanel->GetPanelDirectory(&ref); + fRef = ref; + BEntry entry(&ref); + BPath path(&entry); + fDestText->SetText(path.Path()); + fUsePanel->Hide(); + } + break; case B_REFS_RECEIVED: if (msg->FindRef("refs", 0, &fRef) == B_OK) { BEntry entry(&fRef, true); @@ -278,8 +278,8 @@ case MSG_OK: fSettings->ReplaceBool("automatically_expand_files", fAutoExpand->Value() == B_CONTROL_ON); fSettings->ReplaceBool("close_when_done", fCloseWindow->Value() == B_CONTROL_ON); - fSettings->ReplaceInt8("destination_folder", (fSameDest->Value() == B_CONTROL_ON) ? 0x63 - : ( (fLeaveDest->Value() == B_CONTROL_ON) ? 0x66 : 0x65) ); + fSettings->ReplaceInt8("destination_folder", (fSameDest->Value() == B_CONTROL_ON) ? 0x63 + : ((fLeaveDest->Value() == B_CONTROL_ON) ? 0x66 : 0x65)); fSettings->ReplaceRef("destination_folder_use", &fRef); fSettings->ReplaceBool("open_destination_folder", fOpenDest->Value() == B_CONTROL_ON); fSettings->ReplaceBool("show_contents_listing", fAutoShow->Value() == B_CONTROL_ON); Modified: haiku/trunk/src/apps/expander/ExpanderPreferences.h =================================================================== --- haiku/trunk/src/apps/expander/ExpanderPreferences.h 2007-03-03 13:20:26 UTC (rev 20313) +++ haiku/trunk/src/apps/expander/ExpanderPreferences.h 2007-03-03 15:26:57 UTC (rev 20314) @@ -10,18 +10,18 @@ // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation -// the rights to use, copy, modify, merge, publish, distribute, sublicense, -// and/or sell copies of the Software, and to permit persons to whom the +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // -// The above copyright notice and this permission notice shall be included +// The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. /*****************************************************************************/ @@ -39,19 +39,19 @@ #include class ExpanderPreferences : public BWindow { -public: - ExpanderPreferences(BMessage *settings); - virtual ~ExpanderPreferences(); - virtual void MessageReceived(BMessage *msg); + public: + ExpanderPreferences(BMessage *settings); + virtual ~ExpanderPreferences(); + virtual void MessageReceived(BMessage *msg); -private: - BMessage *fSettings; - BCheckBox *fAutoExpand, *fCloseWindow, *fAutoShow, *fOpenDest; - BRadioButton *fDestUse, *fSameDest, *fLeaveDest; - BButton *fSelect; - BTextControl *fDestText; - entry_ref fRef; - DirectoryFilePanel *fUsePanel; + private: + BMessage *fSettings; + BCheckBox *fAutoExpand, *fCloseWindow, *fAutoShow, *fOpenDest; + BRadioButton *fDestUse, *fSameDest, *fLeaveDest; + BButton *fSelect; + BTextControl *fDestText; + entry_ref fRef; + DirectoryFilePanel *fUsePanel; }; #endif /* _ExpanderPreferences_h */ Modified: haiku/trunk/src/apps/expander/ExpanderRules.cpp =================================================================== --- haiku/trunk/src/apps/expander/ExpanderRules.cpp 2007-03-03 13:20:26 UTC (rev 20313) +++ haiku/trunk/src/apps/expander/ExpanderRules.cpp 2007-03-03 15:26:57 UTC (rev 20314) @@ -14,8 +14,8 @@ #include -ExpanderRule::ExpanderRule(BString mimetype, BString filenameExtension, - BString listingCmd, BString expandCmd) +ExpanderRule::ExpanderRule(BString mimetype, BString filenameExtension, + BString listingCmd, BString expandCmd) : fMimeType(mimetype.String()), fFilenameExtension(filenameExtension), @@ -26,7 +26,7 @@ ExpanderRule::ExpanderRule(const char* mimetype, const char* filenameExtension, - const char* listingCmd, const char* expandCmd) + const char* listingCmd, const char* expandCmd) : fMimeType(mimetype), fFilenameExtension(filenameExtension), @@ -58,31 +58,31 @@ char buffer[1024]; BString strings[4]; - while (fgets(buffer, 1024-1, f)!=NULL) { + while (fgets(buffer, 1024 - 1, f) != NULL) { int32 i = 0, j = 0; int32 firstQuote = -1; while (buffer[i] != '#' && buffer[i] != '\n' && j < 4) { if ((j == 0 || j > 1) && buffer[i] == '"') { if (firstQuote >= 0) { - strings[j++].SetTo(&buffer[firstQuote+1], i-firstQuote-1); + strings[j++].SetTo(&buffer[firstQuote+1], i - firstQuote - 1); firstQuote = -1; } else firstQuote = i; } else if (j == 1 && (buffer[i] == ' ' || buffer[i] == '\t')) { if (firstQuote >= 0) { if (firstQuote + 1 != i) { - strings[j++].SetTo(&buffer[firstQuote+1], i-firstQuote-1); + strings[j++].SetTo(&buffer[firstQuote+1], i - firstQuote - 1); firstQuote = -1; } else firstQuote = i; } else firstQuote = i; - } + } i++; } if (j == 4) { fList.AddItem(new ExpanderRule(strings[0], strings[1], strings[2], strings[3])); - } + } } fclose(f); close(fd); @@ -97,7 +97,7 @@ } -status_t +status_t ExpanderRules::Open(BFile *file) { BPath path; @@ -107,13 +107,13 @@ path.Append("etc/expander.rules"); if (file->SetTo(path.Path(), B_READ_ONLY) == B_OK) return B_OK; - + if (find_directory(B_COMMON_ETC_DIRECTORY, &path) != B_OK) return B_ERROR; path.Append("expander.rules"); - return file->SetTo(path.Path(), B_READ_ONLY); + return file->SetTo(path.Path(), B_READ_ONLY); } @@ -122,7 +122,7 @@ { int32 count = fList.CountItems(); int32 length = fileName.Length(); - for (int32 i=0; iMimeType().IsValid() && rule->MimeType() == filetype) || (fileName.FindLast(rule->FilenameExtension()) == (length - rule->FilenameExtension().Length()))) @@ -141,7 +141,7 @@ char type[B_MIME_TYPE_LENGTH]; nodeInfo.GetType(type); BString fileName(ref->name); - return MatchingRule(fileName, type); + return MatchingRule(fileName, type); } @@ -153,7 +153,7 @@ bool -RuleRefFilter::Filter(const entry_ref *ref, BNode* node, struct stat *st, +RuleRefFilter::Filter(const entry_ref *ref, BNode* node, struct stat *st, const char *filetype) { if (node->IsDirectory() || node->IsSymLink()) Modified: haiku/trunk/src/apps/expander/ExpanderRules.h =================================================================== --- haiku/trunk/src/apps/expander/ExpanderRules.h 2007-03-03 13:20:26 UTC (rev 20313) +++ haiku/trunk/src/apps/expander/ExpanderRules.h 2007-03-03 15:26:57 UTC (rev 20314) @@ -14,9 +14,9 @@ class ExpanderRule { public: - ExpanderRule(BString mimetype, BString filenameExtension, + ExpanderRule(BString mimetype, BString filenameExtension, BString listingCmd, BString expandCmd); - ExpanderRule(const char* mimetype, const char* filenameExtension, + ExpanderRule(const char* mimetype, const char* filenameExtension, const char* listingCmd, const char* expandCmd); BMimeType &MimeType() { return fMimeType;} BString &FilenameExtension() { return fFilenameExtension;} @@ -46,7 +46,7 @@ class RuleRefFilter : public BRefFilter { public: RuleRefFilter(ExpanderRules &rules); - bool Filter(const entry_ref *ref, BNode* node, struct stat *st, + bool Filter(const entry_ref *ref, BNode* node, struct stat *st, const char *filetype); protected: ExpanderRules &fRules; Modified: haiku/trunk/src/apps/expander/ExpanderSettings.cpp =================================================================== --- haiku/trunk/src/apps/expander/ExpanderSettings.cpp 2007-03-03 13:20:26 UTC (rev 20313) +++ haiku/trunk/src/apps/expander/ExpanderSettings.cpp 2007-03-03 15:26:57 UTC (rev 20314) @@ -11,18 +11,18 @@ // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation -// the rights to use, copy, modify, merge, publish, distribute, sublicense, -// and/or sell copies of the Software, and to permit persons to whom the +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // -// The above copyright notice and this permission notice shall be included +// The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. /*****************************************************************************/ @@ -40,7 +40,7 @@ // 1st byte : unknown (0x1) // 2nd byte : Automatically expand files (default : 0x0) // 3rd byte : Close when done (default : 0x0) -// 4th byte : 0x66 +// 4th byte : 0x66 // 0x63 (default) // 0x65 // 5th byte : unknown (0x0) @@ -91,13 +91,13 @@ && (file.Read(&ref.device, sizeof(ref.device)) == sizeof(ref.device)) && (file.Read(&ref.directory, sizeof(ref.directory)) == sizeof(ref.directory)) && (file.Read(&name_size, sizeof(name_size)) == sizeof(name_size)) - && ((name_size <= 0) || (ref.name = (char*)malloc(name_size+1))) + && ((name_size <= 0) || (ref.name = (char*)malloc(name_size + 1))) && (file.Read(ref.name, name_size) == name_size) && (file.Read(&open_destination_folder, sizeof(open_destination_folder)) == sizeof(open_destination_folder)) && (file.Read(&show_contents_listing, sizeof(show_contents_listing)) == sizeof(show_contents_listing)) && (file.Read(&position, sizeof(position)) == sizeof(position)) - ) { - + ) { + // check if the window position is on screen at all BScreen screen; if (screen.Frame().Contains(position)) @@ -105,16 +105,16 @@ fMessage.ReplaceBool("automatically_expand_files", automatically_expand_files); fMessage.ReplaceBool("close_when_done", close_when_done); - if(destination_folder == 0x66 || destination_folder == 0x63 || destination_folder == 0x65) + if (destination_folder == 0x66 || destination_folder == 0x63 || destination_folder == 0x65) fMessage.ReplaceInt8("destination_folder", destination_folder); if (name_size > 0) ref.name[name_size] = '\0'; BEntry entry(&ref); - if(entry.Exists()) + if (entry.Exists()) fMessage.ReplaceRef("destination_folder_use", &ref); fMessage.ReplaceBool("open_destination_folder", open_destination_folder); fMessage.ReplaceBool("show_contents_listing", show_contents_listing); - } + } } @@ -127,7 +127,7 @@ BFile file; if (Open(&file, B_CREATE_FILE | B_WRITE_ONLY) != B_OK) return; - + bool automatically_expand_files; bool close_when_done; int8 destination_folder; @@ -136,15 +136,15 @@ bool show_contents_listing; BPoint position; bool unknown = 1; - + if ((fMessage.FindPoint("window_position", &position) == B_OK) && (fMessage.FindBool("automatically_expand_files", &automatically_expand_files) == B_OK) && (fMessage.FindBool("close_when_done", &close_when_done) == B_OK) && (fMessage.FindInt8("destination_folder", &destination_folder) == B_OK) - && (fMessage.FindRef("destination_folder_use", &ref) == B_OK) + && (fMessage.FindRef("destination_folder_use", &ref) == B_OK) && (fMessage.FindBool("open_destination_folder", &open_destination_folder) == B_OK) - && (fMessage.FindBool("show_contents_listing", &show_contents_listing) == B_OK) ) { - + && (fMessage.FindBool("show_contents_listing", &show_contents_listing) == B_OK)) { + file.Write(&unknown, sizeof(unknown)); file.Write(&automatically_expand_files, sizeof(automatically_expand_files)); file.Write(&close_when_done, sizeof(close_when_done)); @@ -154,7 +154,7 @@ file.Write(&ref.device, sizeof(ref.device)); file.Write(&ref.directory, sizeof(ref.directory)); int32 name_size = 0; - if(ref.name) + if (ref.name) name_size = strlen(ref.name); file.Write(&name_size, sizeof(name_size)); file.Write(ref.name, name_size); @@ -166,7 +166,7 @@ } -status_t +status_t ExpanderSettings::Open(BFile *file, int32 mode) { BPath path; @@ -179,7 +179,7 @@ } -void +void ExpanderSettings::UpdateFrom(BMessage *message) { bool automatically_expand_files; @@ -189,27 +189,27 @@ bool open_destination_folder; bool show_contents_listing; BPoint position; - + if (message->FindPoint("window_position", &position) == B_OK) fMessage.ReplacePoint("window_position", position); - + if (message->FindBool("automatically_expand_files", &automatically_expand_files) == B_OK) fMessage.ReplaceBool("automatically_expand_files", automatically_expand_files); - + if (message->FindBool("close_when_done", &close_when_done) == B_OK) fMessage.ReplaceBool("close_when_done", close_when_done); - + if (message->FindInt8("destination_folder", &destination_folder) == B_OK) fMessage.ReplaceInt8("destination_folder", destination_folder); - - if (message->FindRef("destination_folder_use", &ref) == B_OK) + + if (message->FindRef("destination_folder_use", &ref) == B_OK) fMessage.ReplaceRef("destination_folder_use", &ref); - + if (message->FindBool("open_destination_folder", &open_destination_folder) == B_OK) fMessage.ReplaceBool("open_destination_folder", open_destination_folder); - - if (message->FindBool("show_contents_listing", &show_contents_listing) == B_OK) - fMessage.ReplaceBool("show_contents_listing", show_contents_listing); - + + if (message->FindBool("show_contents_listing", &show_contents_listing) == B_OK) + fMessage.ReplaceBool("show_contents_listing", show_contents_listing); + fUpdated = true; } Modified: haiku/trunk/src/apps/expander/ExpanderSettings.h =================================================================== --- haiku/trunk/src/apps/expander/ExpanderSettings.h 2007-03-03 13:20:26 UTC (rev 20313) +++ haiku/trunk/src/apps/expander/ExpanderSettings.h 2007-03-03 15:26:57 UTC (rev 20314) @@ -10,18 +10,18 @@ // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation -// the rights to use, copy, modify, merge, publish, distribute, sublicense, -// and/or sell copies of the Software, and to permit persons to whom the +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // -// The above copyright notice and this permission notice shall be included +// The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. /*****************************************************************************/ Modified: haiku/trunk/src/apps/expander/ExpanderThread.cpp =================================================================== --- haiku/trunk/src/apps/expander/ExpanderThread.cpp 2007-03-03 13:20:26 UTC (rev 20313) +++ haiku/trunk/src/apps/expander/ExpanderThread.cpp 2007-03-03 15:26:57 UTC (rev 20314) @@ -13,8 +13,8 @@ const char * ExpanderThreadName = "ExpanderThread"; -ExpanderThread::ExpanderThread (BMessage * refs_message, BMessenger * messenger) -: GenericThread(ExpanderThreadName, B_NORMAL_PRIORITY, refs_message), +ExpanderThread::ExpanderThread(BMessage * refs_message, BMessenger * messenger) + : GenericThread(ExpanderThreadName, B_NORMAL_PRIORITY, refs_message), fWindowMessenger(messenger), fThreadId(-1), fStdIn(-1), @@ -24,12 +24,12 @@ fExpanderOutputString(), fExpanderOutputBuffer(new char [4096]) { - SetDataStore(new BMessage (* refs_message)); // leak? - // prevents bug with B_SIMPLE_DATA - // (drag&drop messages) + SetDataStore(new BMessage(* refs_message)); // leak? + // prevents bug with B_SIMPLE_DATA + // (drag&drop messages) } -ExpanderThread::~ExpanderThread() +ExpanderThread::~ExpanderThread() { delete fWindowMessenger; delete [] fExpanderOutputBuffer; @@ -41,64 +41,64 @@ status_t status = B_OK; entry_ref srcRef, destRef; BString cmd; - - if ((status = GetDataStore()->FindRef("srcRef", &srcRef))!=B_OK) + + if ((status = GetDataStore()->FindRef("srcRef", &srcRef)) != B_OK) return status; - if ((status = GetDataStore()->FindRef("destRef", &destRef))==B_OK) { + if ((status = GetDataStore()->FindRef("destRef", &destRef)) == B_OK) { BPath path(&destRef); chdir(path.Path()); } - if ((status = GetDataStore()->FindString("cmd", &cmd))!=B_OK) + if ((status = GetDataStore()->FindString("cmd", &cmd)) != B_OK) return status; - + BPath path(&srcRef); BString pathString(path.Path()); pathString.CharacterEscape("\"$`", '\\'); - pathString.Prepend("\""); - pathString.Append("\""); + pathString.Prepend("\""); + pathString.Append("\""); cmd.ReplaceAll("%s", pathString.String()); - + int32 argc = 3; const char ** argv = new const char * [argc + 1]; - + argv[0] = strdup("/bin/sh"); argv[1] = strdup("-c"); argv[2] = strdup(cmd.String()); argv[argc] = NULL; - - fThreadId = PipeCommand(argc, argv, fStdIn, fStdOut, fStdErr); + fThreadId = PipeCommand(argc, argv, fStdIn, fStdOut, fStdErr); + delete [] argv; if (fThreadId < 0) - return fThreadId; - - resume_thread(fThreadId); - - fExpanderOutput = fdopen(fStdOut, "r"); - + return fThreadId; [... truncated: 1271 lines follow ...] From zooey at mail.berlios.de Sat Mar 3 17:35:29 2007 From: zooey at mail.berlios.de (zooey at BerliOS) Date: Sat, 3 Mar 2007 17:35:29 +0100 Subject: [Haiku-commits] r20315 - buildtools/trunk/binutils/gas/config Message-ID: <200703031635.l23GZTUr021629@sheep.berlios.de> Author: zooey Date: 2007-03-03 17:35:28 +0100 (Sat, 03 Mar 2007) New Revision: 20315 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20315&view=rev Added: buildtools/trunk/binutils/gas/config/te-beos.h buildtools/trunk/binutils/gas/config/te-haiku.h Log: * oops, forgot to commit these files, thanks to Jerome for telling me about the resulting problems Added: buildtools/trunk/binutils/gas/config/te-beos.h =================================================================== --- buildtools/trunk/binutils/gas/config/te-beos.h 2007-03-03 15:26:57 UTC (rev 20314) +++ buildtools/trunk/binutils/gas/config/te-beos.h 2007-03-03 16:35:28 UTC (rev 20315) @@ -0,0 +1,10 @@ +/* Target environment for BeOS/haiku. It is the same as the generic + target, except that it arranges via the TE_BeOS define to + suppress the use of "/" as a comment character. Some code in the + haiku kernel uses "/" to mean division. (What a concept!) */ +#define TE_BeOS 1 + +#define LOCAL_LABELS_DOLLAR 1 +#define LOCAL_LABELS_FB 1 + +#include "obj-format.h" Added: buildtools/trunk/binutils/gas/config/te-haiku.h =================================================================== --- buildtools/trunk/binutils/gas/config/te-haiku.h 2007-03-03 15:26:57 UTC (rev 20314) +++ buildtools/trunk/binutils/gas/config/te-haiku.h 2007-03-03 16:35:28 UTC (rev 20315) @@ -0,0 +1,10 @@ +/* Target environment for BeOS/haiku. It is the same as the generic + target, except that it arranges via the TE_BeOS define to + suppress the use of "/" as a comment character. Some code in the + haiku kernel uses "/" to mean division. (What a concept!) */ +#define TE_BeOS 1 + +#define LOCAL_LABELS_DOLLAR 1 +#define LOCAL_LABELS_FB 1 + +#include "obj-format.h" From mmu_man at mail.berlios.de Sat Mar 3 17:49:51 2007 From: mmu_man at mail.berlios.de (mmu_man at BerliOS) Date: Sat, 3 Mar 2007 17:49:51 +0100 Subject: [Haiku-commits] r20316 - haiku/trunk/src/apps/mediaplayer Message-ID: <200703031649.l23Gnpoi022296@sheep.berlios.de> Author: mmu_man Date: 2007-03-03 17:49:51 +0100 (Sat, 03 Mar 2007) New Revision: 20316 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20316&view=rev Modified: haiku/trunk/src/apps/mediaplayer/InfoWin.cpp Log: Display codec name, some more fixes. Modified: haiku/trunk/src/apps/mediaplayer/InfoWin.cpp =================================================================== --- haiku/trunk/src/apps/mediaplayer/InfoWin.cpp 2007-03-03 16:35:28 UTC (rev 20315) +++ haiku/trunk/src/apps/mediaplayer/InfoWin.cpp 2007-03-03 16:49:51 UTC (rev 20316) @@ -99,10 +99,13 @@ fFilenameView = new BStringView(BRect(div+10, 20, rect.right - 10, 20 + fh.ascent + 5), - "filename", "Foo.avi"); + "filename", ""); fFilenameView->SetFont(&bigFont); fFilenameView->SetViewColor(fInfoView->ViewColor()); fFilenameView->SetLowColor(fInfoView->ViewColor()); +#ifdef B_BEOS_VERSION_DANO /* maybe we should support that as well ? */ + fFilenameView->SetTruncation(B_TRUNCATE_END); +#endif AddChild(fFilenameView); @@ -158,6 +161,8 @@ void InfoWin::Update(uint32 which) { + status_t err; + //char buf[256]; printf("InfoWin::Update(0x%08lx)\n", which); rgb_color vFgCol = ui_color(B_DOCUMENT_TEXT_COLOR); @@ -186,10 +191,19 @@ media_format fmt; media_raw_video_format vfmt; float fps; - c->fVideoTrack->EncodedFormat(&fmt); - if (fmt.type == B_MEDIA_ENCODED_VIDEO) { + err = c->fVideoTrack->EncodedFormat(&fmt); + //string_for_format(fmt, buf, sizeof(buf)); + //printf("%s\n", buf); + if (err < 0) { + s << "(" << strerror(err) << ")"; + } else if (fmt.type == B_MEDIA_ENCODED_VIDEO) { vfmt = fmt.u.encoded_video.output; - s << "(encoded video)"; // TODO: get codec + media_codec_info mci; + err = c->fVideoTrack->GetCodecInfo(&mci); + if (err < 0) + s << "(" << strerror(err) << ")"; + else + s << mci.pretty_name; //<< "(" << mci.short_name << ")"; } else if (fmt.type == B_MEDIA_RAW_VIDEO) { vfmt = fmt.u.raw_video; s << "raw video"; @@ -208,22 +222,31 @@ BString s; media_format fmt; media_raw_audio_format afmt; - c->fAudioTrack->EncodedFormat(&fmt); - if (fmt.type == B_MEDIA_ENCODED_AUDIO) { + err = c->fAudioTrack->EncodedFormat(&fmt); + //string_for_format(fmt, buf, sizeof(buf)); + //printf("%s\n", buf); + if (err < 0) { + s << "(" << strerror(err) << ")"; + } else if (fmt.type == B_MEDIA_ENCODED_AUDIO) { afmt = fmt.u.encoded_audio.output; - s << "(encoded audio)"; // TODO: get codec + media_codec_info mci; + err = c->fAudioTrack->GetCodecInfo(&mci); + if (err < 0) + s << "(" << strerror(err) << ")"; + else + s << mci.pretty_name; //<< "(" << mci.short_name << ")"; } else if (fmt.type == B_MEDIA_RAW_AUDIO) { afmt = fmt.u.raw_audio; s << "raw audio"; } else s << "unknown format"; s << "\n"; - // encoded has output as 1st field... - uint32 bitps = 8 * afmt.format & media_raw_audio_format::B_AUDIO_SIZE_MASK; + uint32 bitps = 8 * (afmt.format & media_raw_audio_format::B_AUDIO_SIZE_MASK); uint32 chans = afmt.channel_count; float sr = afmt.frame_rate; - s << bitps << "Bit "; + if (bitps) + s << bitps << " Bit "; if (chans == 1) s << "Mono"; else if (chans == 2) @@ -232,14 +255,15 @@ s << chans << "Channels"; s << ", "; if (sr) - s << (1/sr); + s << sr/1000; else s << "?"; s<< " kHz"; s << "\n"; fContentsView->Insert(s.String()); } - if (which & INFO_STATS) { + if (which & INFO_STATS && fMainWin->fHasFile) { + // TODO: check for live streams (no duration) fLabelsView->Insert("Duration\n"); BString s; bigtime_t d = c->Duration(); @@ -263,6 +287,7 @@ s << "." << d / 10; s << "\n"; fContentsView->Insert(s.String()); + // TODO: demux/video/audio/... perfs (Kb/s) } if (which & INFO_TRANSPORT) { } @@ -276,8 +301,9 @@ fContentsView->Insert(s.String()); } fLabelsView->Insert("Location\n"); + // TODO: make Controller save the entry_ref (url actually). fContentsView->Insert("file://\n"); - fFilenameView->SetText("Bar.avi"); + fFilenameView->SetText(c->fName.String()); } if (which & INFO_COPYRIGHT && mf && mf->Copyright()) { From bonefish at mail.berlios.de Sun Mar 4 03:31:44 2007 From: bonefish at mail.berlios.de (bonefish at BerliOS) Date: Sun, 4 Mar 2007 03:31:44 +0100 Subject: [Haiku-commits] r20317 - haiku/trunk/headers/posix Message-ID: <200703040231.l242Viv6020174@sheep.berlios.de> Author: bonefish Date: 2007-03-04 03:31:43 +0100 (Sun, 04 Mar 2007) New Revision: 20317 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20317&view=rev Modified: haiku/trunk/headers/posix/wchar.h Log: Added C++ guard. I don't know, why we define the protos both there and in . Any reason for not removing them in ? Or maybe even nicer reverse the inclusion direction, i.e. remove the duplicate protos in and include instead. Modified: haiku/trunk/headers/posix/wchar.h =================================================================== --- haiku/trunk/headers/posix/wchar.h 2007-03-03 16:49:51 UTC (rev 20316) +++ haiku/trunk/headers/posix/wchar.h 2007-03-04 02:31:43 UTC (rev 20317) @@ -21,6 +21,10 @@ #include +#ifdef __cplusplus +extern "C" { +#endif + extern wint_t fgetwc(FILE *); extern wchar_t *fgetws(wchar_t *, int, FILE *); extern wint_t fputwc(wchar_t, FILE *); @@ -82,6 +86,10 @@ extern wctype_t wctype(const char *); extern int wcwidth(wchar_t); +#ifdef __cplusplus +} +#endif + #define WEOF ((wint_t)(-1)) #endif /* _WCHAR_H */ From bonefish at mail.berlios.de Sun Mar 4 05:47:55 2007 From: bonefish at mail.berlios.de (bonefish at BerliOS) Date: Sun, 4 Mar 2007 05:47:55 +0100 Subject: [Haiku-commits] r20319 - haiku/trunk/build/scripts Message-ID: <200703040447.l244ltGa024372@sheep.berlios.de> Author: bonefish Date: 2007-03-04 05:47:55 +0100 (Sun, 04 Mar 2007) New Revision: 20319 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20319&view=rev Modified: haiku/trunk/build/scripts/build_cross_tools_gcc4 Log: gcc 4.1.2 conveniently saves the version number in a separate file. Modified: haiku/trunk/build/scripts/build_cross_tools_gcc4 =================================================================== --- haiku/trunk/build/scripts/build_cross_tools_gcc4 2007-03-04 04:07:35 UTC (rev 20318) +++ haiku/trunk/build/scripts/build_cross_tools_gcc4 2007-03-04 04:47:55 UTC (rev 20319) @@ -54,8 +54,7 @@ # get gcc version -gccVersion=$(grep "const char version_string" $gccSourceDir/gcc/version.c \ - | sed -e 's at .*"\(.*\)".*@\1@') +gccVersion=$(cat $gccSourceDir/gcc/BASE-VER) if [ -z "$gccVersion" ]; then echo "Failed to find out gcc version." >&2 From bonefish at mail.berlios.de Sun Mar 4 06:00:42 2007 From: bonefish at mail.berlios.de (bonefish at BerliOS) Date: Sun, 4 Mar 2007 06:00:42 +0100 Subject: [Haiku-commits] r20320 - in haiku/trunk: headers/private/app headers/private/storage src/add-ons/media/plugins/ogg src/add-ons/translators/bmp src/apps/cortex/DiagramView src/apps/cortex/DormantNodeView src/apps/cortex/MediaRoutingView src/kits/app src/kits/interface/qoca src/kits/mail src/kits/tracker src/preferences/screen Message-ID: <200703040500.l2450gfO024807@sheep.berlios.de> Author: bonefish Date: 2007-03-04 06:00:40 +0100 (Sun, 04 Mar 2007) New Revision: 20320 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20320&view=rev Modified: haiku/trunk/headers/private/app/MessageUtils.h haiku/trunk/headers/private/storage/DiskDevice.h haiku/trunk/src/add-ons/media/plugins/ogg/OggSeekable.cpp haiku/trunk/src/add-ons/translators/bmp/BMPTranslator.cpp haiku/trunk/src/apps/cortex/DiagramView/DiagramItem.h haiku/trunk/src/apps/cortex/DormantNodeView/DormantNodeListItem.h haiku/trunk/src/apps/cortex/MediaRoutingView/MediaJack.h haiku/trunk/src/apps/cortex/MediaRoutingView/MediaNodePanel.h haiku/trunk/src/kits/app/Message.cpp haiku/trunk/src/kits/interface/qoca/QcLinEqSolver.hh haiku/trunk/src/kits/mail/MailProtocol.cpp haiku/trunk/src/kits/mail/ProtocolConfigView.cpp haiku/trunk/src/kits/mail/RemoteStorageProtocol.cpp haiku/trunk/src/kits/tracker/DesktopPoseView.h haiku/trunk/src/preferences/screen/MonitorView.h Log: Fixed gcc 4(.1.2) build problems. Modified: haiku/trunk/headers/private/app/MessageUtils.h =================================================================== --- haiku/trunk/headers/private/app/MessageUtils.h 2007-03-04 04:47:55 UTC (rev 20319) +++ haiku/trunk/headers/private/app/MessageUtils.h 2007-03-04 05:00:40 UTC (rev 20320) @@ -112,14 +112,6 @@ }; -template -inline status_t -read_helper(BDataIO *stream, T &data) -{ - return normalize_err(stream->Read((void *)&data, sizeof(T))); -} - - template<> inline void byte_swap(double &data) Modified: haiku/trunk/headers/private/storage/DiskDevice.h =================================================================== --- haiku/trunk/headers/private/storage/DiskDevice.h 2007-03-04 04:47:55 UTC (rev 20319) +++ haiku/trunk/headers/private/storage/DiskDevice.h 2007-03-04 05:00:40 UTC (rev 20320) @@ -40,8 +40,8 @@ friend class BDiskDeviceList; friend class BDiskDeviceRoster; - BDiskDevice::BDiskDevice(const BDiskDevice &); - BDiskDevice &BDiskDevice::operator=(const BDiskDevice &); + BDiskDevice(const BDiskDevice &); + BDiskDevice &operator=(const BDiskDevice &); static status_t _GetData(partition_id id, bool deviceOnly, bool shadow, size_t neededSize, user_disk_device_data **data); Modified: haiku/trunk/src/add-ons/media/plugins/ogg/OggSeekable.cpp =================================================================== --- haiku/trunk/src/add-ons/media/plugins/ogg/OggSeekable.cpp 2007-03-04 04:47:55 UTC (rev 20319) +++ haiku/trunk/src/add-ons/media/plugins/ogg/OggSeekable.cpp 2007-03-04 05:00:40 UTC (rev 20320) @@ -4,6 +4,7 @@ #include "OggVorbisSeekable.h" #include "OggFormats.h" #include +#include #include #define TRACE_THIS 1 Modified: haiku/trunk/src/add-ons/translators/bmp/BMPTranslator.cpp =================================================================== --- haiku/trunk/src/add-ons/translators/bmp/BMPTranslator.cpp 2007-03-04 04:47:55 UTC (rev 20319) +++ haiku/trunk/src/add-ons/translators/bmp/BMPTranslator.cpp 2007-03-04 05:00:40 UTC (rev 20320) @@ -694,6 +694,7 @@ break; case B_CMAP8: + { bitspixel = bitsRowData + (i * bitsBytesPerPixel); bmppixel = bmpRowData + (i * 3); rgb_color c = pmap->color_list[bitspixel[0]]; @@ -701,6 +702,7 @@ bmppixel[1] = c.green; bmppixel[2] = c.red; break; + } case B_GRAY8: bitspixel = bitsRowData + (i * bitsBytesPerPixel); Modified: haiku/trunk/src/apps/cortex/DiagramView/DiagramItem.h =================================================================== --- haiku/trunk/src/apps/cortex/DiagramView/DiagramItem.h 2007-03-04 04:47:55 UTC (rev 20319) +++ haiku/trunk/src/apps/cortex/DiagramView/DiagramItem.h 2007-03-04 05:00:40 UTC (rev 20320) @@ -28,6 +28,8 @@ class DiagramView; class DiagramBox; +int compareSelectionTime(const void *lValue, const void *rValue); + class DiagramItem { friend class DiagramItemGroup; Modified: haiku/trunk/src/apps/cortex/DormantNodeView/DormantNodeListItem.h =================================================================== --- haiku/trunk/src/apps/cortex/DormantNodeView/DormantNodeListItem.h 2007-03-04 04:47:55 UTC (rev 20319) +++ haiku/trunk/src/apps/cortex/DormantNodeView/DormantNodeListItem.h 2007-03-04 05:00:40 UTC (rev 20320) @@ -25,6 +25,10 @@ class DormantNodeView; class MediaIcon; +int compareName(const void *lValue, const void *rValue); +int compareAddOnID(const void *lValue, const void *rValue); + + class DormantNodeListItem : public BListItem { typedef BListItem _inherited; Modified: haiku/trunk/src/apps/cortex/MediaRoutingView/MediaJack.h =================================================================== --- haiku/trunk/src/apps/cortex/MediaRoutingView/MediaJack.h 2007-03-04 04:47:55 UTC (rev 20319) +++ haiku/trunk/src/apps/cortex/MediaRoutingView/MediaJack.h 2007-03-04 05:00:40 UTC (rev 20320) @@ -24,6 +24,8 @@ #include "cortex_defs.h" __BEGIN_CORTEX_NAMESPACE +int compareTypeAndID(const void *lValue, const void *rValue); + class MediaJack : public DiagramEndPoint { Modified: haiku/trunk/src/apps/cortex/MediaRoutingView/MediaNodePanel.h =================================================================== --- haiku/trunk/src/apps/cortex/MediaRoutingView/MediaNodePanel.h 2007-03-04 04:47:55 UTC (rev 20319) +++ haiku/trunk/src/apps/cortex/MediaRoutingView/MediaNodePanel.h 2007-03-04 05:00:40 UTC (rev 20320) @@ -22,6 +22,8 @@ #include "cortex_defs.h" __BEGIN_CORTEX_NAMESPACE +int compareID(const void *lValue, const void *rValue); + class MediaIcon; class NodeRef; Modified: haiku/trunk/src/kits/app/Message.cpp =================================================================== --- haiku/trunk/src/kits/app/Message.cpp 2007-03-04 04:47:55 UTC (rev 20319) +++ haiku/trunk/src/kits/app/Message.cpp 2007-03-04 05:00:40 UTC (rev 20320) @@ -30,6 +30,7 @@ #include #include +#include #include #include #include Modified: haiku/trunk/src/kits/interface/qoca/QcLinEqSolver.hh =================================================================== --- haiku/trunk/src/kits/interface/qoca/QcLinEqSolver.hh 2007-03-04 04:47:55 UTC (rev 20319) +++ haiku/trunk/src/kits/interface/qoca/QcLinEqSolver.hh 2007-03-04 05:00:40 UTC (rev 20320) @@ -172,7 +172,7 @@ void GetVariableSet(vector &vars) { fSystem.GetVariableSet(vars); } - virtual void QcLinEqSolver::Print(ostream &os) const; + virtual void Print(ostream &os) const; }; inline QcLinEqSolver::QcLinEqSolver() Modified: haiku/trunk/src/kits/mail/MailProtocol.cpp =================================================================== --- haiku/trunk/src/kits/mail/MailProtocol.cpp 2007-03-04 04:47:55 UTC (rev 20319) +++ haiku/trunk/src/kits/mail/MailProtocol.cpp 2007-03-04 05:00:40 UTC (rev 20320) @@ -58,6 +58,7 @@ BEntry *entry; }; +} // unnamed namspace inline void BMailProtocol::error_alert(const char *process, status_t error) @@ -73,6 +74,8 @@ } +namespace { + class DeleteHandler : public BHandler { public: DeleteHandler(BMailProtocol *a) @@ -150,6 +153,8 @@ int32 id; }; +} // unnamed namspace + BMailProtocol::BMailProtocol(BMessage *settings, BMailChainRunner *run) : BMailFilter(settings), runner(run), trash_monitor(NULL), uids_on_disk(NULL) @@ -374,5 +379,3 @@ if ((always && strcmp(B_MAIL_TYPE,type) == 0) || result == B_MAIL_DISCARD) us->DeleteMessage(message_id); } - -} Modified: haiku/trunk/src/kits/mail/ProtocolConfigView.cpp =================================================================== --- haiku/trunk/src/kits/mail/ProtocolConfigView.cpp 2007-03-04 04:47:55 UTC (rev 20319) +++ haiku/trunk/src/kits/mail/ProtocolConfigView.cpp 2007-03-04 05:00:40 UTC (rev 20320) @@ -84,7 +84,9 @@ return width; } +} // unnamed namspace + //----------------Real code---------------------- BMailProtocolConfigView::BMailProtocolConfigView(uint32 options_mask) : BView (BRect(0,0,100,20), "protocol_config_view", B_FOLLOW_LEFT | B_FOLLOW_TOP, B_WILL_DRAW) { BRect rect(5,5,245,25); @@ -326,5 +328,3 @@ *width = minWidth + 10; *height = (CountChildren() * gItemHeight) + 5; } - -} // namespace Modified: haiku/trunk/src/kits/mail/RemoteStorageProtocol.cpp =================================================================== --- haiku/trunk/src/kits/mail/RemoteStorageProtocol.cpp 2007-03-04 04:47:55 UTC (rev 20319) +++ haiku/trunk/src/kits/mail/RemoteStorageProtocol.cpp 2007-03-04 05:00:40 UTC (rev 20320) @@ -285,7 +285,9 @@ } } +} // unnamed namspace + BRemoteMailStorageProtocol::BRemoteMailStorageProtocol(BMessage *settings, BMailChainRunner *runner) : BMailProtocol(settings, runner) @@ -301,9 +303,7 @@ delete handler; } -} // empty namespace - //----BMailProtocol stuff Modified: haiku/trunk/src/kits/tracker/DesktopPoseView.h =================================================================== --- haiku/trunk/src/kits/tracker/DesktopPoseView.h 2007-03-04 04:47:55 UTC (rev 20319) +++ haiku/trunk/src/kits/tracker/DesktopPoseView.h 2007-03-04 05:00:40 UTC (rev 20320) @@ -43,6 +43,8 @@ namespace BPrivate { +bool ShouldShowDesktopPose(dev_t device, const Model *model, const PoseInfo *); + class DesktopPoseView : public BPoseView { // overrides BPoseView to add desktop-view specific code public: Modified: haiku/trunk/src/preferences/screen/MonitorView.h =================================================================== --- haiku/trunk/src/preferences/screen/MonitorView.h 2007-03-04 04:47:55 UTC (rev 20319) +++ haiku/trunk/src/preferences/screen/MonitorView.h 2007-03-04 05:00:40 UTC (rev 20320) @@ -28,7 +28,7 @@ void SetResolution(int32 width, int32 height); private: - BRect MonitorView::MonitorBounds(); + BRect MonitorBounds(); rgb_color fDesktopColor; int32 fWidth; From bonefish at mail.berlios.de Sun Mar 4 06:08:46 2007 From: bonefish at mail.berlios.de (bonefish at BerliOS) Date: Sun, 4 Mar 2007 06:08:46 +0100 Subject: [Haiku-commits] r20318 - in buildtools/trunk/gcc: . INSTALL config contrib contrib/reghunt contrib/regression fixincludes fixincludes/tests/base fixincludes/tests/base/sys gcc gcc/config gcc/config/alpha gcc/config/arc gcc/config/arm gcc/config/avr gcc/config/bfin gcc/config/c4x gcc/config/cris gcc/config/fr30 gcc/config/frv gcc/config/h8300 gcc/config/i386 gcc/config/ia64 gcc/config/iq2000 gcc/config/m32r gcc/config/m68hc11 gcc/config/m68k gcc/config/mcore gcc/config/mips gcc/config/mmix gcc/config/mn10300 gcc/config/pa gcc/config/pdp11 gcc/config/rs6000 gcc/config/s390 gcc/config/sh gcc/config/sparc gcc/config/stormy16 gcc/config/v850 gcc/config/vax gcc/config/xtensa gcc/cp gcc/doc gcc/doc/include gcc/ginclude gcc/po gcc/treelang include intl libcpp libcpp/include libcpp/po libiberty libiberty/testsuite libmudflap libmudflap/testsuite libmudflap/testsuite/lib libmudflap/testsuite/libmudflap.c libmudflap/testsuite/libmudflap.c++ libmudflap/testsuite/libmudflap.cth libstdc++-v3 lib! stdc++-v3/config libstdc++-v3/config/abi libstdc++-v3/config/allocator libstdc++-v3/config/cpu/alpha libstdc++-v3/config/cpu/arm libstdc++-v3/config/cpu/cris libstdc++-v3/config/cpu/generic libstdc++-v3/config/cpu/hppa libstdc++-v3/config/cpu/i386 libstdc++-v3/config/cpu/i486 libstdc++-v3/config/cpu/ia64 libstdc++-v3/config/cpu/m68k libstdc++-v3/config/cpu/mips libstdc++-v3/config/cpu/powerpc libstdc++-v3/config/cpu/s390 libstdc++-v3/config/cpu/sh libstdc++-v3/config/cpu/sparc libstdc++-v3/config/io libstdc++-v3/config/locale/darwin libstdc++-v3/config/locale/generic libstdc++-v3/config/locale/gnu libstdc++-v3/config/locale/ieee_1003.1-2001 libstdc++-v3/config/os/aix libstdc++-v3/config/os/bsd/darwin libstdc++-v3/config/os/bsd/freebsd libstdc++-v3/config/os/bsd/netbsd libstdc++-v3/config/os/djgpp libstdc++-v3/config/os/generic libstdc++-v3/config/os/gnu-linux libstdc++-v3/config/os/hpux libstdc++-v3/config/os/irix libstdc++-v3/config/os/irix/irix5.2 libstdc++-v3/config/os/i! rix/irix6.5 libstdc++-v3/config/os/mingw32 libstdc++-v3/config! /os/newl Message-ID: <200703040508.l2458kC0024964@sheep.berlios.de> Author: bonefish Date: 2007-03-04 05:07:35 +0100 (Sun, 04 Mar 2007) New Revision: 20318 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20318&view=rev Added: buildtools/trunk/gcc/config/depstand.m4 buildtools/trunk/gcc/config/enable.m4 buildtools/trunk/gcc/config/lead-dot.m4 buildtools/trunk/gcc/config/stdint.m4 buildtools/trunk/gcc/config/tls.m4 buildtools/trunk/gcc/fixincludes/tests/base/errno.h buildtools/trunk/gcc/fixincludes/tests/base/ia64/ buildtools/trunk/gcc/fixincludes/tests/base/sys/pthread.h buildtools/trunk/gcc/gcc/BASE-VER buildtools/trunk/gcc/gcc/ChangeLog-1997 buildtools/trunk/gcc/gcc/ChangeLog-1998 buildtools/trunk/gcc/gcc/ChangeLog-1999 buildtools/trunk/gcc/gcc/ChangeLog-2000 buildtools/trunk/gcc/gcc/ChangeLog-2001 buildtools/trunk/gcc/gcc/ChangeLog-2002 buildtools/trunk/gcc/gcc/ChangeLog-2003 buildtools/trunk/gcc/gcc/ChangeLog-2004 buildtools/trunk/gcc/gcc/ChangeLog-2005 buildtools/trunk/gcc/gcc/DATESTAMP buildtools/trunk/gcc/gcc/DEV-PHASE buildtools/trunk/gcc/gcc/acinclude.m4 buildtools/trunk/gcc/gcc/c-parser.c buildtools/trunk/gcc/gcc/config/alpha/alpha.opt buildtools/trunk/gcc/gcc/config/alpha/sync.md buildtools/trunk/gcc/gcc/config/arc/arc.opt buildtools/trunk/gcc/gcc/config/arm/arm.opt buildtools/trunk/gcc/gcc/config/arm/arm1020e.md buildtools/trunk/gcc/gcc/config/arm/libunwind.S buildtools/trunk/gcc/gcc/config/arm/linux-eabi.h buildtools/trunk/gcc/gcc/config/arm/pe.opt buildtools/trunk/gcc/gcc/config/arm/pr-support.c buildtools/trunk/gcc/gcc/config/arm/t-linux-eabi buildtools/trunk/gcc/gcc/config/arm/unaligned-funcs.c buildtools/trunk/gcc/gcc/config/arm/unwind-arm.c buildtools/trunk/gcc/gcc/config/arm/unwind-arm.h buildtools/trunk/gcc/gcc/config/avr/avr.opt buildtools/trunk/gcc/gcc/config/bfin/crtlibid.s buildtools/trunk/gcc/gcc/config/c4x/c4x.opt buildtools/trunk/gcc/gcc/config/c4x/predicates.md buildtools/trunk/gcc/gcc/config/cris/aout.opt buildtools/trunk/gcc/gcc/config/cris/cris.opt buildtools/trunk/gcc/gcc/config/cris/elf.opt buildtools/trunk/gcc/gcc/config/cris/linux.opt buildtools/trunk/gcc/gcc/config/cris/predicates.md buildtools/trunk/gcc/gcc/config/crx/ buildtools/trunk/gcc/gcc/config/darwin.opt buildtools/trunk/gcc/gcc/config/fr30/fr30.opt buildtools/trunk/gcc/gcc/config/fr30/predicates.md buildtools/trunk/gcc/gcc/config/frv/frv.opt buildtools/trunk/gcc/gcc/config/frv/predicates.md buildtools/trunk/gcc/gcc/config/h8300/h8300.opt buildtools/trunk/gcc/gcc/config/h8300/predicates.md buildtools/trunk/gcc/gcc/config/host-darwin.c buildtools/trunk/gcc/gcc/config/host-darwin.h buildtools/trunk/gcc/gcc/config/host-hpux.c buildtools/trunk/gcc/gcc/config/i386/crtfastmath.c buildtools/trunk/gcc/gcc/config/i386/cygming.opt buildtools/trunk/gcc/gcc/config/i386/darwin-libgcc.10.4.ver buildtools/trunk/gcc/gcc/config/i386/darwin-libgcc.10.5.ver buildtools/trunk/gcc/gcc/config/i386/djgpp.opt buildtools/trunk/gcc/gcc/config/i386/host-i386-darwin.c buildtools/trunk/gcc/gcc/config/i386/i386.opt buildtools/trunk/gcc/gcc/config/i386/sco5.opt buildtools/trunk/gcc/gcc/config/i386/sync.md buildtools/trunk/gcc/gcc/config/i386/t-crtfm buildtools/trunk/gcc/gcc/config/i386/t-darwin buildtools/trunk/gcc/gcc/config/i386/t-vxworksae buildtools/trunk/gcc/gcc/config/i386/vxworksae.h buildtools/trunk/gcc/gcc/config/i386/winnt-cxx.c buildtools/trunk/gcc/gcc/config/i386/winnt-stubs.c buildtools/trunk/gcc/gcc/config/i386/x-darwin buildtools/trunk/gcc/gcc/config/ia64/ia64.opt buildtools/trunk/gcc/gcc/config/ia64/ilp32.opt buildtools/trunk/gcc/gcc/config/ia64/sync.md buildtools/trunk/gcc/gcc/config/iq2000/iq2000.opt buildtools/trunk/gcc/gcc/config/iq2000/predicates.md buildtools/trunk/gcc/gcc/config/lynx.opt buildtools/trunk/gcc/gcc/config/m32c/ buildtools/trunk/gcc/gcc/config/m32r/m32r.opt buildtools/trunk/gcc/gcc/config/m32r/predicates.md buildtools/trunk/gcc/gcc/config/m68hc11/m68hc11.opt buildtools/trunk/gcc/gcc/config/m68hc11/predicates.md buildtools/trunk/gcc/gcc/config/m68k/ieee.opt buildtools/trunk/gcc/gcc/config/m68k/m68k.opt buildtools/trunk/gcc/gcc/config/m68k/predicates.md buildtools/trunk/gcc/gcc/config/mcore/mcore.opt buildtools/trunk/gcc/gcc/config/mcore/predicates.md buildtools/trunk/gcc/gcc/config/mips/24k.md buildtools/trunk/gcc/gcc/config/mips/4k.md buildtools/trunk/gcc/gcc/config/mips/5k.md buildtools/trunk/gcc/gcc/config/mips/mips-dsp.md buildtools/trunk/gcc/gcc/config/mips/mips.opt buildtools/trunk/gcc/gcc/config/mmix/mmix.opt buildtools/trunk/gcc/gcc/config/mmix/predicates.md buildtools/trunk/gcc/gcc/config/mn10300/mn10300.opt buildtools/trunk/gcc/gcc/config/mn10300/predicates.md buildtools/trunk/gcc/gcc/config/mt/ buildtools/trunk/gcc/gcc/config/pa/hpux-unwind.h buildtools/trunk/gcc/gcc/config/pa/pa-hpux.opt buildtools/trunk/gcc/gcc/config/pa/pa-hpux1010.opt buildtools/trunk/gcc/gcc/config/pa/pa-hpux1111.opt buildtools/trunk/gcc/gcc/config/pa/pa.opt buildtools/trunk/gcc/gcc/config/pa/pa64-hpux.opt buildtools/trunk/gcc/gcc/config/pa/predicates.md buildtools/trunk/gcc/gcc/config/pa/stublib.c buildtools/trunk/gcc/gcc/config/pa/t-pa-hpux10 buildtools/trunk/gcc/gcc/config/pa/t-pa-hpux11 buildtools/trunk/gcc/gcc/config/pa/t-slibgcc-dwarf-ver buildtools/trunk/gcc/gcc/config/pa/t-slibgcc-sjlj-ver buildtools/trunk/gcc/gcc/config/pa/x-ada-hpux10 buildtools/trunk/gcc/gcc/config/pdp11/pdp11.opt buildtools/trunk/gcc/gcc/config/rs6000/aix.opt buildtools/trunk/gcc/gcc/config/rs6000/aix41.opt buildtools/trunk/gcc/gcc/config/rs6000/aix64.opt buildtools/trunk/gcc/gcc/config/rs6000/darwin-libgcc.10.4.ver buildtools/trunk/gcc/gcc/config/rs6000/darwin-libgcc.10.5.ver buildtools/trunk/gcc/gcc/config/rs6000/darwin.opt buildtools/trunk/gcc/gcc/config/rs6000/darwin7.h buildtools/trunk/gcc/gcc/config/rs6000/darwin8.h buildtools/trunk/gcc/gcc/config/rs6000/libgcc-ppc-glibc.ver buildtools/trunk/gcc/gcc/config/rs6000/linux64.opt buildtools/trunk/gcc/gcc/config/rs6000/predicates.md buildtools/trunk/gcc/gcc/config/rs6000/rs6000.opt buildtools/trunk/gcc/gcc/config/rs6000/secureplt.h buildtools/trunk/gcc/gcc/config/rs6000/sync.md buildtools/trunk/gcc/gcc/config/rs6000/sysv4.opt buildtools/trunk/gcc/gcc/config/rs6000/t-vxworksae buildtools/trunk/gcc/gcc/config/rs6000/vxworksae.h buildtools/trunk/gcc/gcc/config/s390/predicates.md buildtools/trunk/gcc/gcc/config/s390/s390.opt buildtools/trunk/gcc/gcc/config/s390/t-linux buildtools/trunk/gcc/gcc/config/s390/tpf.md buildtools/trunk/gcc/gcc/config/s390/tpf.opt buildtools/trunk/gcc/gcc/config/sh/divtab.c buildtools/trunk/gcc/gcc/config/sh/newlib.h buildtools/trunk/gcc/gcc/config/sh/predicates.md buildtools/trunk/gcc/gcc/config/sh/sh-c.c buildtools/trunk/gcc/gcc/config/sh/sh.opt buildtools/trunk/gcc/gcc/config/sh/superh.h buildtools/trunk/gcc/gcc/config/sh/superh64.h buildtools/trunk/gcc/gcc/config/sh/t-superh buildtools/trunk/gcc/gcc/config/sparc/little-endian.opt buildtools/trunk/gcc/gcc/config/sparc/long-double-switch.opt buildtools/trunk/gcc/gcc/config/sparc/predicates.md buildtools/trunk/gcc/gcc/config/sparc/sparc.opt buildtools/trunk/gcc/gcc/config/stormy16/predicates.md buildtools/trunk/gcc/gcc/config/stormy16/stormy16.opt buildtools/trunk/gcc/gcc/config/v850/predicates.md buildtools/trunk/gcc/gcc/config/v850/v850.opt buildtools/trunk/gcc/gcc/config/vax/vax.opt buildtools/trunk/gcc/gcc/config/vx-common.h buildtools/trunk/gcc/gcc/config/vxworks.opt buildtools/trunk/gcc/gcc/config/vxworksae.h buildtools/trunk/gcc/gcc/config/x-darwin buildtools/trunk/gcc/gcc/config/x-hpux buildtools/trunk/gcc/gcc/config/xtensa/predicates.md buildtools/trunk/gcc/gcc/config/xtensa/xtensa.opt buildtools/trunk/gcc/gcc/cp/ChangeLog-1993 buildtools/trunk/gcc/gcc/cp/ChangeLog-1994 buildtools/trunk/gcc/gcc/cp/ChangeLog-1995 buildtools/trunk/gcc/gcc/cp/ChangeLog-1996 buildtools/trunk/gcc/gcc/cp/ChangeLog-1997 buildtools/trunk/gcc/gcc/cp/ChangeLog-1998 buildtools/trunk/gcc/gcc/cp/ChangeLog-1999 buildtools/trunk/gcc/gcc/cp/ChangeLog-2000 buildtools/trunk/gcc/gcc/cp/ChangeLog-2001 buildtools/trunk/gcc/gcc/cp/ChangeLog-2002 buildtools/trunk/gcc/gcc/cp/ChangeLog-2003 buildtools/trunk/gcc/gcc/cp/ChangeLog-2004 buildtools/trunk/gcc/gcc/doc/options.texi buildtools/trunk/gcc/gcc/dummy-checksum.c buildtools/trunk/gcc/gcc/genchecksum.c buildtools/trunk/gcc/gcc/ipa-cp.c buildtools/trunk/gcc/gcc/ipa-inline.c buildtools/trunk/gcc/gcc/ipa-prop.c buildtools/trunk/gcc/gcc/ipa-prop.h buildtools/trunk/gcc/gcc/ipa-pure-const.c buildtools/trunk/gcc/gcc/ipa-reference.c buildtools/trunk/gcc/gcc/ipa-reference.h buildtools/trunk/gcc/gcc/ipa-type-escape.c buildtools/trunk/gcc/gcc/ipa-type-escape.h buildtools/trunk/gcc/gcc/ipa-utils.c buildtools/trunk/gcc/gcc/ipa-utils.h buildtools/trunk/gcc/gcc/ipa.c buildtools/trunk/gcc/gcc/mode-switching.c buildtools/trunk/gcc/gcc/objcp/ buildtools/trunk/gcc/gcc/po/ru.gmo buildtools/trunk/gcc/gcc/po/ru.po buildtools/trunk/gcc/gcc/po/zh_TW.gmo buildtools/trunk/gcc/gcc/po/zh_TW.po buildtools/trunk/gcc/gcc/tree-cfgcleanup.c buildtools/trunk/gcc/gcc/tree-object-size.c buildtools/trunk/gcc/gcc/tree-ssa-address.c buildtools/trunk/gcc/gcc/tree-ssa-math-opts.c buildtools/trunk/gcc/gcc/tree-ssa-opfinalize.h buildtools/trunk/gcc/gcc/tree-ssa-reassoc.c buildtools/trunk/gcc/gcc/tree-ssa-sink.c buildtools/trunk/gcc/gcc/tree-ssa-structalias.c buildtools/trunk/gcc/gcc/tree-ssa-structalias.h buildtools/trunk/gcc/gcc/tree-ssa-uncprop.c buildtools/trunk/gcc/gcc/tree-stdarg.c buildtools/trunk/gcc/gcc/tree-stdarg.h buildtools/trunk/gcc/gcc/tree-vect-generic.c buildtools/trunk/gcc/gcc/tree-vrp.c buildtools/trunk/gcc/gcc/treestruct.def buildtools/trunk/gcc/gcc/unwind-generic.h buildtools/trunk/gcc/libcpp/makeucnid.c buildtools/trunk/gcc/libcpp/po/zh_CN.gmo buildtools/trunk/gcc/libcpp/po/zh_CN.po buildtools/trunk/gcc/libcpp/po/zh_TW.gmo buildtools/trunk/gcc/libcpp/po/zh_TW.po buildtools/trunk/gcc/libiberty/at-file.texi buildtools/trunk/gcc/libiberty/gettimeofday.c buildtools/trunk/gcc/libiberty/pex-common.c buildtools/trunk/gcc/libiberty/pex-one.c buildtools/trunk/gcc/libiberty/pexecute.c buildtools/trunk/gcc/libiberty/strndup.c buildtools/trunk/gcc/libiberty/strverscmp.c buildtools/trunk/gcc/libiberty/testsuite/test-pexecute.c buildtools/trunk/gcc/libiberty/unlink-if-ordinary.c buildtools/trunk/gcc/libiberty/xstrndup.c buildtools/trunk/gcc/libmudflap/acinclude.m4 buildtools/trunk/gcc/libmudflap/testsuite/libmudflap.c++/error1-frag.cxx buildtools/trunk/gcc/libmudflap/testsuite/libmudflap.c++/pass57-frag.cxx buildtools/trunk/gcc/libmudflap/testsuite/libmudflap.c++/pass58-frag.cxx buildtools/trunk/gcc/libmudflap/testsuite/libmudflap.c/externs-1.c buildtools/trunk/gcc/libmudflap/testsuite/libmudflap.c/externs-2.c buildtools/trunk/gcc/libmudflap/testsuite/libmudflap.c/externs.exp buildtools/trunk/gcc/libmudflap/testsuite/libmudflap.c/fail39-frag.c buildtools/trunk/gcc/libmudflap/testsuite/libmudflap.c/fail40-frag.c buildtools/trunk/gcc/libmudflap/testsuite/libmudflap.c/hook2-allocstuff.c buildtools/trunk/gcc/libmudflap/testsuite/libmudflap.c/pass56-frag.c buildtools/trunk/gcc/libssp/ buildtools/trunk/gcc/libstdc++-v3/ChangeLog-1998 buildtools/trunk/gcc/libstdc++-v3/ChangeLog-1999 buildtools/trunk/gcc/libstdc++-v3/config/cpu/generic/cpu_defines.h buildtools/trunk/gcc/libstdc++-v3/config/cpu/powerpc/cpu_defines.h buildtools/trunk/gcc/libstdc++-v3/config/os/bsd/darwin/ppc-extra.ver buildtools/trunk/gcc/libstdc++-v3/docs/html/ext/pb_assoc/ buildtools/trunk/gcc/libstdc++-v3/docs/html/ext/tr1.html buildtools/trunk/gcc/libstdc++-v3/include/debug/functions.h buildtools/trunk/gcc/libstdc++-v3/include/debug/macros.h buildtools/trunk/gcc/libstdc++-v3/include/ext/pb_assoc/ buildtools/trunk/gcc/libstdc++-v3/include/ext/rc_string_base.h buildtools/trunk/gcc/libstdc++-v3/include/ext/sso_string_base.h buildtools/trunk/gcc/libstdc++-v3/include/ext/typelist.h buildtools/trunk/gcc/libstdc++-v3/include/ext/vstring.h buildtools/trunk/gcc/libstdc++-v3/include/ext/vstring.tcc buildtools/trunk/gcc/libstdc++-v3/include/ext/vstring_fwd.h buildtools/trunk/gcc/libstdc++-v3/include/ext/vstring_util.h buildtools/trunk/gcc/libstdc++-v3/libsupc++/eh_arm.cc buildtools/trunk/gcc/libstdc++-v3/libsupc++/eh_call.cc buildtools/trunk/gcc/libstdc++-v3/scripts/make_exports.pl buildtools/trunk/gcc/libstdc++-v3/src/ios-inst.cc buildtools/trunk/gcc/libstdc++-v3/src/iostream-inst.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/17_intro/no_assert_neg.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/18_support/numeric_limits/ buildtools/trunk/gcc/libstdc++-v3/testsuite/19_diagnostics/23591_thread-1.c buildtools/trunk/gcc/libstdc++-v3/testsuite/20_util/functional/binders/ buildtools/trunk/gcc/libstdc++-v3/testsuite/21_strings/basic_string/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/21_strings/basic_string/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/21_strings/basic_string/element_access/char/21674.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/21_strings/basic_string/element_access/wchar_t/21674.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/21_strings/basic_string/types/ buildtools/trunk/gcc/libstdc++-v3/testsuite/21_strings/c_strings/wchar_t/24559.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/facet/25421.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/money_get/get/char/22131.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/money_get/get/wchar_t/22131.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/num_get/get/char/22131.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/num_get/get/char/23953.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/num_get/get/wchar_t/22131.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/num_get/get/wchar_t/23953.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/num_put/put/char/10.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/num_put/put/char/23953.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/num_put/put/wchar_t/10.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/num_put/put/wchar_t/23953.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/23_containers/deque/explicit_instantiation/ buildtools/trunk/gcc/libstdc++-v3/testsuite/23_containers/list/23781.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/23_containers/list/explicit_instantiation/ buildtools/trunk/gcc/libstdc++-v3/testsuite/23_containers/map/23781.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/23_containers/map/element_access/ buildtools/trunk/gcc/libstdc++-v3/testsuite/23_containers/map/explicit_instantiation/ buildtools/trunk/gcc/libstdc++-v3/testsuite/23_containers/multimap/23781.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/23_containers/multimap/explicit_instantiation/ buildtools/trunk/gcc/libstdc++-v3/testsuite/23_containers/multiset/23781.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/23_containers/multiset/explicit_instantiation/ buildtools/trunk/gcc/libstdc++-v3/testsuite/23_containers/set/23781.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/23_containers/set/explicit_instantiation/ buildtools/trunk/gcc/libstdc++-v3/testsuite/23_containers/vector/bool/23632.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/23_containers/vector/data_access/ buildtools/trunk/gcc/libstdc++-v3/testsuite/23_containers/vector/explicit_instantiation/ buildtools/trunk/gcc/libstdc++-v3/testsuite/23_containers/vector/types/ buildtools/trunk/gcc/libstdc++-v3/testsuite/24_iterators/reverse_iterator/11729.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/25_algorithms/adjacent_find/ buildtools/trunk/gcc/libstdc++-v3/testsuite/25_algorithms/binary_search/ buildtools/trunk/gcc/libstdc++-v3/testsuite/25_algorithms/count/ buildtools/trunk/gcc/libstdc++-v3/testsuite/25_algorithms/count_if/ buildtools/trunk/gcc/libstdc++-v3/testsuite/25_algorithms/equal/ buildtools/trunk/gcc/libstdc++-v3/testsuite/25_algorithms/equal_range/ buildtools/trunk/gcc/libstdc++-v3/testsuite/25_algorithms/find/ buildtools/trunk/gcc/libstdc++-v3/testsuite/25_algorithms/find_end/ buildtools/trunk/gcc/libstdc++-v3/testsuite/25_algorithms/find_first_of/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/25_algorithms/find_first_of/check_type.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/25_algorithms/find_if/ buildtools/trunk/gcc/libstdc++-v3/testsuite/25_algorithms/heap/ buildtools/trunk/gcc/libstdc++-v3/testsuite/25_algorithms/includes/ buildtools/trunk/gcc/libstdc++-v3/testsuite/25_algorithms/inplace_merge/ buildtools/trunk/gcc/libstdc++-v3/testsuite/25_algorithms/lexicographical_compare/ buildtools/trunk/gcc/libstdc++-v3/testsuite/25_algorithms/lower_bound/ buildtools/trunk/gcc/libstdc++-v3/testsuite/25_algorithms/max_element/ buildtools/trunk/gcc/libstdc++-v3/testsuite/25_algorithms/merge/ buildtools/trunk/gcc/libstdc++-v3/testsuite/25_algorithms/min_element/ buildtools/trunk/gcc/libstdc++-v3/testsuite/25_algorithms/mismatch/ buildtools/trunk/gcc/libstdc++-v3/testsuite/25_algorithms/next_permutation/ buildtools/trunk/gcc/libstdc++-v3/testsuite/25_algorithms/nth_element/ buildtools/trunk/gcc/libstdc++-v3/testsuite/25_algorithms/partial_sort/ buildtools/trunk/gcc/libstdc++-v3/testsuite/25_algorithms/partial_sort_copy/ buildtools/trunk/gcc/libstdc++-v3/testsuite/25_algorithms/partition/ buildtools/trunk/gcc/libstdc++-v3/testsuite/25_algorithms/prev_permutation/ buildtools/trunk/gcc/libstdc++-v3/testsuite/25_algorithms/remove/ buildtools/trunk/gcc/libstdc++-v3/testsuite/25_algorithms/remove_if/ buildtools/trunk/gcc/libstdc++-v3/testsuite/25_algorithms/replace/ buildtools/trunk/gcc/libstdc++-v3/testsuite/25_algorithms/replace_copy/ buildtools/trunk/gcc/libstdc++-v3/testsuite/25_algorithms/replace_copy_if/ buildtools/trunk/gcc/libstdc++-v3/testsuite/25_algorithms/replace_if/ buildtools/trunk/gcc/libstdc++-v3/testsuite/25_algorithms/rotate/ buildtools/trunk/gcc/libstdc++-v3/testsuite/25_algorithms/search/ buildtools/trunk/gcc/libstdc++-v3/testsuite/25_algorithms/set_difference/ buildtools/trunk/gcc/libstdc++-v3/testsuite/25_algorithms/set_intersection/ buildtools/trunk/gcc/libstdc++-v3/testsuite/25_algorithms/set_symmetric_difference/ buildtools/trunk/gcc/libstdc++-v3/testsuite/25_algorithms/set_union/ buildtools/trunk/gcc/libstdc++-v3/testsuite/25_algorithms/stable_sort/ buildtools/trunk/gcc/libstdc++-v3/testsuite/25_algorithms/swap_ranges/ buildtools/trunk/gcc/libstdc++-v3/testsuite/25_algorithms/unique_copy/ buildtools/trunk/gcc/libstdc++-v3/testsuite/25_algorithms/upper_bound/ buildtools/trunk/gcc/libstdc++-v3/testsuite/26_numerics/cstdlib/ buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/char/26777.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istream/extractors_character/char/4.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istream/extractors_character/wchar_t/4.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_arithmetic/pod/ buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_stringbuf/seekpos/char/29354.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_stringbuf/seekpos/wchar_t/29354.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/ext/is_heap/ buildtools/trunk/gcc/libstdc++-v3/testsuite/ext/median.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/ext/mt_allocator/22309_thread.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_local-6.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_local-8.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_local_thread-5.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_local_thread-7.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/ext/pb_assoc/ buildtools/trunk/gcc/libstdc++-v3/testsuite/ext/slist/23781.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/ext/vstring/ buildtools/trunk/gcc/libstdc++-v3/testsuite/performance/23_containers/create/ buildtools/trunk/gcc/libstdc++-v3/testsuite/performance/23_containers/create_from_sorted/ buildtools/trunk/gcc/libstdc++-v3/testsuite/performance/23_containers/create_sort/ buildtools/trunk/gcc/libstdc++-v3/testsuite/performance/23_containers/find/ buildtools/trunk/gcc/libstdc++-v3/testsuite/performance/23_containers/index/ buildtools/trunk/gcc/libstdc++-v3/testsuite/performance/23_containers/insert/ buildtools/trunk/gcc/libstdc++-v3/testsuite/performance/23_containers/insert_erase/ buildtools/trunk/gcc/libstdc++-v3/testsuite/performance/23_containers/insert_from_sorted/ buildtools/trunk/gcc/libstdc++-v3/testsuite/performance/23_containers/producer_consumer/ buildtools/trunk/gcc/libstdc++-v3/testsuite/performance/23_containers/sort_search/ buildtools/trunk/gcc/libstdc++-v3/testsuite/performance/27_io/ifstream_extract_chars.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/testsuite_common_types.h buildtools/trunk/gcc/libstdc++-v3/testsuite/testsuite_shared.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/testsuite_visualization.h buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/2_general_utilities/memory/shared_ptr/misc/24595.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/2_general_utilities/memory/shared_ptr/modifiers/24805.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/4_metaprogramming/composite_type_traits/is_object/24808.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/4_metaprogramming/helper_classes/static_definition.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/4_metaprogramming/primary_type_categories/is_enum/24808.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/4_metaprogramming/primary_type_categories/is_function/24808.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/4_metaprogramming/type_properties/is_polymorphic/24809.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/6_containers/array/requirements/assign.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/6_containers/array/requirements/member_swap.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/6_containers/array/specialized_algorithms/ buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/6_containers/tuple/creation_functions/23978.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/6_containers/unordered/23781.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/6_containers/unordered/erase/ buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/6_containers/unordered/hash/ buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/6_containers/unordered/hashtable/24054.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/6_containers/unordered/hashtable/24064.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/6_containers/unordered/hashtable/26127.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/6_containers/unordered/hashtable/26132.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/6_containers/unordered/hashtable/iterators_default_constructor.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/6_containers/unordered/insert/24061-map.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/6_containers/unordered/insert/24061-multimap.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/6_containers/unordered/insert/24061-multiset.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/6_containers/unordered/insert/24061-set.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/6_containers/unordered/types/ buildtools/trunk/gcc/maintainer-scripts/update_version_svn buildtools/trunk/gcc/maintainer-scripts/update_web_docs_libstdcxx_svn buildtools/trunk/gcc/maintainer-scripts/update_web_docs_svn Removed: buildtools/trunk/gcc/.cvsignore buildtools/trunk/gcc/config/accross.m4 buildtools/trunk/gcc/config/gcc-lib-path.m4 buildtools/trunk/gcc/config/gcc-version.m4 buildtools/trunk/gcc/config/mh-mingw32 buildtools/trunk/gcc/fixincludes/.cvsignore buildtools/trunk/gcc/gcc/.cvsignore buildtools/trunk/gcc/gcc/ChangeLog.0 buildtools/trunk/gcc/gcc/ChangeLog.1 buildtools/trunk/gcc/gcc/ChangeLog.10 buildtools/trunk/gcc/gcc/ChangeLog.11 buildtools/trunk/gcc/gcc/ChangeLog.12 buildtools/trunk/gcc/gcc/ChangeLog.2 buildtools/trunk/gcc/gcc/ChangeLog.3 buildtools/trunk/gcc/gcc/ChangeLog.4 buildtools/trunk/gcc/gcc/ChangeLog.5 buildtools/trunk/gcc/gcc/ChangeLog.6 buildtools/trunk/gcc/gcc/ChangeLog.7 buildtools/trunk/gcc/gcc/ChangeLog.8 buildtools/trunk/gcc/gcc/ChangeLog.9 buildtools/trunk/gcc/gcc/c-parse.c buildtools/trunk/gcc/gcc/c-parse.in buildtools/trunk/gcc/gcc/c-parse.y buildtools/trunk/gcc/gcc/config/darwin7.h buildtools/trunk/gcc/gcc/config/darwin8.h buildtools/trunk/gcc/gcc/config/i860/ buildtools/trunk/gcc/gcc/config/ip2k/ buildtools/trunk/gcc/gcc/config/m32r/xm-linux.h buildtools/trunk/gcc/gcc/config/m32r/xm-m32r.h buildtools/trunk/gcc/gcc/config/mips/_tilib.c buildtools/trunk/gcc/gcc/config/mips/cross64.h buildtools/trunk/gcc/gcc/config/mips/t-cross64 buildtools/trunk/gcc/gcc/config/ns32k/ buildtools/trunk/gcc/gcc/config/pa/pa-host.c buildtools/trunk/gcc/gcc/config/pa/rtems.h buildtools/trunk/gcc/gcc/config/pa/t-slibgcc-elf-ver buildtools/trunk/gcc/gcc/config/pa/x-hpux buildtools/trunk/gcc/gcc/config/pa/x-linux buildtools/trunk/gcc/gcc/config/sparc/lite.h buildtools/trunk/gcc/gcc/config/sparc/litecoff.h buildtools/trunk/gcc/gcc/config/sparc/liteelf.h buildtools/trunk/gcc/gcc/config/sparc/openbsd.h buildtools/trunk/gcc/gcc/config/sparc/sp86x-elf.h buildtools/trunk/gcc/gcc/config/sparc/t-openbsd buildtools/trunk/gcc/gcc/config/sparc/t-sp86x buildtools/trunk/gcc/gcc/config/sparc/t-sparclite buildtools/trunk/gcc/gcc/cp/ChangeLog.1 buildtools/trunk/gcc/gcc/cp/ChangeLog.2 buildtools/trunk/gcc/gcc/cp/ChangeLog.3 buildtools/trunk/gcc/gcc/cp/ChangeLog.egcs buildtools/trunk/gcc/gcc/gmon.c buildtools/trunk/gcc/gcc/unwind.h buildtools/trunk/gcc/intl/.cvsignore buildtools/trunk/gcc/libcpp/.cvsignore buildtools/trunk/gcc/libcpp/ucnid.pl buildtools/trunk/gcc/libiberty/config.table buildtools/trunk/gcc/libiberty/mpw-config.in buildtools/trunk/gcc/libiberty/mpw-make.sed buildtools/trunk/gcc/libiberty/mpw.c buildtools/trunk/gcc/libiberty/pex-mpw.c buildtools/trunk/gcc/libiberty/pex-os2.c buildtools/trunk/gcc/libmudflap/.cvsignore buildtools/trunk/gcc/libstdc++-v3/.cvsignore buildtools/trunk/gcc/libstdc++-v3/acconfig.h buildtools/trunk/gcc/libstdc++-v3/src/io-inst.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/18_support/numeric_limits.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/20_util/functional/binders.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/23_containers/deque/explicit_instantiation.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/23_containers/list/explicit_instantiation.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/23_containers/map/explicit_instantiation.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/23_containers/multimap/explicit_instantiation.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/23_containers/multiset/explicit_instantiation.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/23_containers/set/explicit_instantiation.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/23_containers/vector/explicit_instantiation.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/25_algorithms/equal.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/25_algorithms/heap.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/25_algorithms/lower_bound.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/25_algorithms/partition.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/25_algorithms/rotate.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/performance/20_util/ buildtools/trunk/gcc/libstdc++-v3/testsuite/performance/23_containers/container_benchmark.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/performance/23_containers/list_create_fill_sort.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/performance/23_containers/map_create_fill.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/performance/23_containers/set_create_from_sorted.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/performance/23_containers/set_insert_from_sorted.cc buildtools/trunk/gcc/maintainer-scripts/update_web_docs_old Modified: buildtools/trunk/gcc/BUGS buildtools/trunk/gcc/COPYING buildtools/trunk/gcc/COPYING.LIB buildtools/trunk/gcc/ChangeLog buildtools/trunk/gcc/FAQ buildtools/trunk/gcc/INSTALL/binaries.html buildtools/trunk/gcc/INSTALL/build.html buildtools/trunk/gcc/INSTALL/configure.html buildtools/trunk/gcc/INSTALL/download.html buildtools/trunk/gcc/INSTALL/finalinstall.html buildtools/trunk/gcc/INSTALL/gfdl.html buildtools/trunk/gcc/INSTALL/prerequisites.html buildtools/trunk/gcc/INSTALL/specific.html buildtools/trunk/gcc/INSTALL/test.html buildtools/trunk/gcc/LAST_UPDATED buildtools/trunk/gcc/MAINTAINERS buildtools/trunk/gcc/MD5SUMS buildtools/trunk/gcc/Makefile.def buildtools/trunk/gcc/Makefile.in buildtools/trunk/gcc/Makefile.tpl buildtools/trunk/gcc/NEWS buildtools/trunk/gcc/bugs.html buildtools/trunk/gcc/compile buildtools/trunk/gcc/config-ml.in buildtools/trunk/gcc/config.guess buildtools/trunk/gcc/config.rpath buildtools/trunk/gcc/config.sub buildtools/trunk/gcc/config/ChangeLog buildtools/trunk/gcc/config/acx.m4 buildtools/trunk/gcc/config/gxx-include-dir.m4 buildtools/trunk/gcc/config/mt-gnu buildtools/trunk/gcc/config/no-executables.m4 buildtools/trunk/gcc/config/warnings.m4 buildtools/trunk/gcc/configure buildtools/trunk/gcc/configure.in buildtools/trunk/gcc/contrib/ChangeLog buildtools/trunk/gcc/contrib/analyze_brprob buildtools/trunk/gcc/contrib/compare_tests buildtools/trunk/gcc/contrib/filter_gcc_for_doxygen buildtools/trunk/gcc/contrib/filter_knr2ansi.pl buildtools/trunk/gcc/contrib/filter_params.pl buildtools/trunk/gcc/contrib/gcc_build buildtools/trunk/gcc/contrib/gcc_update buildtools/trunk/gcc/contrib/gennews buildtools/trunk/gcc/contrib/index-prop buildtools/trunk/gcc/contrib/newcvsroot buildtools/trunk/gcc/contrib/reghunt/ChangeLog buildtools/trunk/gcc/contrib/reghunt/reg_periodic buildtools/trunk/gcc/contrib/reghunt/reg_search buildtools/trunk/gcc/contrib/reghunt/reg_test_template buildtools/trunk/gcc/contrib/regression/ChangeLog buildtools/trunk/gcc/contrib/regression/btest-gcc.sh buildtools/trunk/gcc/contrib/regression/objs-gcc.sh buildtools/trunk/gcc/contrib/test_installed buildtools/trunk/gcc/contrib/test_summary buildtools/trunk/gcc/contrib/texi2pod.pl buildtools/trunk/gcc/contrib/warn_summary buildtools/trunk/gcc/depcomp buildtools/trunk/gcc/faq.html buildtools/trunk/gcc/fixincludes/ChangeLog buildtools/trunk/gcc/fixincludes/Makefile.in buildtools/trunk/gcc/fixincludes/aclocal.m4 buildtools/trunk/gcc/fixincludes/check.tpl buildtools/trunk/gcc/fixincludes/configure buildtools/trunk/gcc/fixincludes/configure.ac buildtools/trunk/gcc/fixincludes/fixfixes.c buildtools/trunk/gcc/fixincludes/fixinc.in buildtools/trunk/gcc/fixincludes/fixincl.c buildtools/trunk/gcc/fixincludes/fixincl.x buildtools/trunk/gcc/fixincludes/fixlib.c buildtools/trunk/gcc/fixincludes/fixlib.h buildtools/trunk/gcc/fixincludes/fixopts.c buildtools/trunk/gcc/fixincludes/fixtests.c buildtools/trunk/gcc/fixincludes/genfixes buildtools/trunk/gcc/fixincludes/inclhack.def buildtools/trunk/gcc/fixincludes/mkfixinc.sh buildtools/trunk/gcc/fixincludes/mkheaders.in buildtools/trunk/gcc/fixincludes/procopen.c buildtools/trunk/gcc/fixincludes/server.c buildtools/trunk/gcc/fixincludes/server.h buildtools/trunk/gcc/fixincludes/system.h buildtools/trunk/gcc/fixincludes/tests/base/math.h buildtools/trunk/gcc/fixincludes/tests/base/pthread.h buildtools/trunk/gcc/fixincludes/tests/base/string.h buildtools/trunk/gcc/fixincludes/tests/base/sys/socket.h buildtools/trunk/gcc/gcc/COPYING buildtools/trunk/gcc/gcc/COPYING.LIB buildtools/trunk/gcc/gcc/ChangeLog buildtools/trunk/gcc/gcc/Makefile.in buildtools/trunk/gcc/gcc/aclocal.m4 buildtools/trunk/gcc/gcc/alias.c buildtools/trunk/gcc/gcc/alias.h buildtools/trunk/gcc/gcc/alloc-pool.c buildtools/trunk/gcc/gcc/alloc-pool.h buildtools/trunk/gcc/gcc/attribs.c buildtools/trunk/gcc/gcc/basic-block.h buildtools/trunk/gcc/gcc/bb-reorder.c buildtools/trunk/gcc/gcc/bitmap.c buildtools/trunk/gcc/gcc/bitmap.h buildtools/trunk/gcc/gcc/bt-load.c buildtools/trunk/gcc/gcc/builtin-attrs.def buildtools/trunk/gcc/gcc/builtin-types.def buildtools/trunk/gcc/gcc/builtins.c buildtools/trunk/gcc/gcc/builtins.def buildtools/trunk/gcc/gcc/c-aux-info.c buildtools/trunk/gcc/gcc/c-common.c buildtools/trunk/gcc/gcc/c-common.def buildtools/trunk/gcc/gcc/c-common.h buildtools/trunk/gcc/gcc/c-config-lang.in buildtools/trunk/gcc/gcc/c-convert.c buildtools/trunk/gcc/gcc/c-cppbuiltin.c buildtools/trunk/gcc/gcc/c-decl.c buildtools/trunk/gcc/gcc/c-dump.c buildtools/trunk/gcc/gcc/c-errors.c buildtools/trunk/gcc/gcc/c-format.c buildtools/trunk/gcc/gcc/c-format.h buildtools/trunk/gcc/gcc/c-gimplify.c buildtools/trunk/gcc/gcc/c-incpath.c buildtools/trunk/gcc/gcc/c-incpath.h buildtools/trunk/gcc/gcc/c-lang.c buildtools/trunk/gcc/gcc/c-lex.c buildtools/trunk/gcc/gcc/c-objc-common.c buildtools/trunk/gcc/gcc/c-objc-common.h buildtools/trunk/gcc/gcc/c-opts.c buildtools/trunk/gcc/gcc/c-pch.c buildtools/trunk/gcc/gcc/c-ppoutput.c buildtools/trunk/gcc/gcc/c-pragma.c buildtools/trunk/gcc/gcc/c-pragma.h buildtools/trunk/gcc/gcc/c-pretty-print.c buildtools/trunk/gcc/gcc/c-pretty-print.h buildtools/trunk/gcc/gcc/c-semantics.c buildtools/trunk/gcc/gcc/c-tree.h buildtools/trunk/gcc/gcc/c-typeck.c buildtools/trunk/gcc/gcc/c.opt buildtools/trunk/gcc/gcc/caller-save.c buildtools/trunk/gcc/gcc/calls.c buildtools/trunk/gcc/gcc/cfg.c buildtools/trunk/gcc/gcc/cfganal.c buildtools/trunk/gcc/gcc/cfgbuild.c buildtools/trunk/gcc/gcc/cfgcleanup.c buildtools/trunk/gcc/gcc/cfgexpand.c buildtools/trunk/gcc/gcc/cfghooks.c buildtools/trunk/gcc/gcc/cfghooks.h buildtools/trunk/gcc/gcc/cfglayout.c buildtools/trunk/gcc/gcc/cfglayout.h buildtools/trunk/gcc/gcc/cfgloop.c buildtools/trunk/gcc/gcc/cfgloop.h buildtools/trunk/gcc/gcc/cfgloopanal.c buildtools/trunk/gcc/gcc/cfgloopmanip.c buildtools/trunk/gcc/gcc/cfgrtl.c buildtools/trunk/gcc/gcc/cgraph.c buildtools/trunk/gcc/gcc/cgraph.h buildtools/trunk/gcc/gcc/cgraphunit.c buildtools/trunk/gcc/gcc/collect2.c buildtools/trunk/gcc/gcc/collect2.h buildtools/trunk/gcc/gcc/combine.c buildtools/trunk/gcc/gcc/common.opt buildtools/trunk/gcc/gcc/conditions.h buildtools/trunk/gcc/gcc/config.build buildtools/trunk/gcc/gcc/config.gcc buildtools/trunk/gcc/gcc/config.host buildtools/trunk/gcc/gcc/config.in buildtools/trunk/gcc/gcc/config/alpha/alpha-modes.def buildtools/trunk/gcc/gcc/config/alpha/alpha-protos.h buildtools/trunk/gcc/gcc/config/alpha/alpha.c buildtools/trunk/gcc/gcc/config/alpha/alpha.h buildtools/trunk/gcc/gcc/config/alpha/alpha.md buildtools/trunk/gcc/gcc/config/alpha/crtfastmath.c buildtools/trunk/gcc/gcc/config/alpha/elf.h buildtools/trunk/gcc/gcc/config/alpha/ev4.md buildtools/trunk/gcc/gcc/config/alpha/ev5.md buildtools/trunk/gcc/gcc/config/alpha/ev6.md buildtools/trunk/gcc/gcc/config/alpha/freebsd.h buildtools/trunk/gcc/gcc/config/alpha/lib1funcs.asm buildtools/trunk/gcc/gcc/config/alpha/linux-elf.h buildtools/trunk/gcc/gcc/config/alpha/linux-unwind.h buildtools/trunk/gcc/gcc/config/alpha/linux.h buildtools/trunk/gcc/gcc/config/alpha/netbsd.h buildtools/trunk/gcc/gcc/config/alpha/openbsd.h buildtools/trunk/gcc/gcc/config/alpha/osf.h buildtools/trunk/gcc/gcc/config/alpha/osf5.h buildtools/trunk/gcc/gcc/config/alpha/predicates.md buildtools/trunk/gcc/gcc/config/alpha/qrnnd.asm buildtools/trunk/gcc/gcc/config/alpha/unicosmk.h buildtools/trunk/gcc/gcc/config/alpha/vms-cc.c buildtools/trunk/gcc/gcc/config/alpha/vms-crt0-64.c buildtools/trunk/gcc/gcc/config/alpha/vms-crt0.c buildtools/trunk/gcc/gcc/config/alpha/vms-dwarf2.asm buildtools/trunk/gcc/gcc/config/alpha/vms-dwarf2eh.asm buildtools/trunk/gcc/gcc/config/alpha/vms-ld.c buildtools/trunk/gcc/gcc/config/alpha/vms-psxcrt0-64.c buildtools/trunk/gcc/gcc/config/alpha/vms-psxcrt0.c buildtools/trunk/gcc/gcc/config/alpha/vms-unwind.h buildtools/trunk/gcc/gcc/config/alpha/vms.h buildtools/trunk/gcc/gcc/config/alpha/vms64.h buildtools/trunk/gcc/gcc/config/alpha/vms_tramp.asm buildtools/trunk/gcc/gcc/config/alpha/x-vms buildtools/trunk/gcc/gcc/config/alpha/xm-vms.h buildtools/trunk/gcc/gcc/config/arc/arc-modes.def buildtools/trunk/gcc/gcc/config/arc/arc-protos.h buildtools/trunk/gcc/gcc/config/arc/arc.c buildtools/trunk/gcc/gcc/config/arc/arc.h buildtools/trunk/gcc/gcc/config/arc/arc.md buildtools/trunk/gcc/gcc/config/arc/initfini.c buildtools/trunk/gcc/gcc/config/arc/lib1funcs.asm buildtools/trunk/gcc/gcc/config/arm/aof.h buildtools/trunk/gcc/gcc/config/arm/aout.h buildtools/trunk/gcc/gcc/config/arm/arm-cores.def buildtools/trunk/gcc/gcc/config/arm/arm-generic.md buildtools/trunk/gcc/gcc/config/arm/arm-modes.def buildtools/trunk/gcc/gcc/config/arm/arm-protos.h buildtools/trunk/gcc/gcc/config/arm/arm.c buildtools/trunk/gcc/gcc/config/arm/arm.h buildtools/trunk/gcc/gcc/config/arm/arm.md buildtools/trunk/gcc/gcc/config/arm/arm1026ejs.md buildtools/trunk/gcc/gcc/config/arm/arm1136jfs.md buildtools/trunk/gcc/gcc/config/arm/arm926ejs.md buildtools/trunk/gcc/gcc/config/arm/bpabi.S buildtools/trunk/gcc/gcc/config/arm/bpabi.c buildtools/trunk/gcc/gcc/config/arm/bpabi.h buildtools/trunk/gcc/gcc/config/arm/cirrus.md buildtools/trunk/gcc/gcc/config/arm/coff.h buildtools/trunk/gcc/gcc/config/arm/crti.asm buildtools/trunk/gcc/gcc/config/arm/crtn.asm buildtools/trunk/gcc/gcc/config/arm/ecos-elf.h buildtools/trunk/gcc/gcc/config/arm/elf.h buildtools/trunk/gcc/gcc/config/arm/fpa.md buildtools/trunk/gcc/gcc/config/arm/freebsd.h buildtools/trunk/gcc/gcc/config/arm/gentune.sh buildtools/trunk/gcc/gcc/config/arm/ieee754-df.S buildtools/trunk/gcc/gcc/config/arm/ieee754-sf.S buildtools/trunk/gcc/gcc/config/arm/iwmmxt.md buildtools/trunk/gcc/gcc/config/arm/kaos-arm.h buildtools/trunk/gcc/gcc/config/arm/kaos-strongarm.h buildtools/trunk/gcc/gcc/config/arm/lib1funcs.asm buildtools/trunk/gcc/gcc/config/arm/libgcc-bpabi.ver buildtools/trunk/gcc/gcc/config/arm/linux-elf.h buildtools/trunk/gcc/gcc/config/arm/linux-gas.h buildtools/trunk/gcc/gcc/config/arm/mmintrin.h buildtools/trunk/gcc/gcc/config/arm/netbsd-elf.h buildtools/trunk/gcc/gcc/config/arm/netbsd.h buildtools/trunk/gcc/gcc/config/arm/pe.c buildtools/trunk/gcc/gcc/config/arm/pe.h buildtools/trunk/gcc/gcc/config/arm/predicates.md buildtools/trunk/gcc/gcc/config/arm/rtems-elf.h buildtools/trunk/gcc/gcc/config/arm/semi.h buildtools/trunk/gcc/gcc/config/arm/semiaof.h buildtools/trunk/gcc/gcc/config/arm/strongarm-coff.h buildtools/trunk/gcc/gcc/config/arm/strongarm-elf.h buildtools/trunk/gcc/gcc/config/arm/strongarm-pe.h buildtools/trunk/gcc/gcc/config/arm/symbian.h buildtools/trunk/gcc/gcc/config/arm/t-arm buildtools/trunk/gcc/gcc/config/arm/t-bpabi buildtools/trunk/gcc/gcc/config/arm/t-symbian buildtools/trunk/gcc/gcc/config/arm/uclinux-elf.h buildtools/trunk/gcc/gcc/config/arm/unknown-elf.h buildtools/trunk/gcc/gcc/config/arm/vfp.md buildtools/trunk/gcc/gcc/config/arm/vxworks.h buildtools/trunk/gcc/gcc/config/arm/wince-pe.h buildtools/trunk/gcc/gcc/config/arm/xscale-coff.h buildtools/trunk/gcc/gcc/config/arm/xscale-elf.h buildtools/trunk/gcc/gcc/config/avr/avr-protos.h buildtools/trunk/gcc/gcc/config/avr/avr.c buildtools/trunk/gcc/gcc/config/avr/avr.h buildtools/trunk/gcc/gcc/config/avr/avr.md buildtools/trunk/gcc/gcc/config/avr/libgcc.S buildtools/trunk/gcc/gcc/config/avr/rtems.h buildtools/trunk/gcc/gcc/config/bfin/bfin-protos.h buildtools/trunk/gcc/gcc/config/bfin/bfin.c buildtools/trunk/gcc/gcc/config/bfin/bfin.h buildtools/trunk/gcc/gcc/config/bfin/bfin.md buildtools/trunk/gcc/gcc/config/bfin/bfin.opt buildtools/trunk/gcc/gcc/config/bfin/crti.s buildtools/trunk/gcc/gcc/config/bfin/crtn.s buildtools/trunk/gcc/gcc/config/bfin/elf.h buildtools/trunk/gcc/gcc/config/bfin/lib1funcs.asm buildtools/trunk/gcc/gcc/config/bfin/predicates.md buildtools/trunk/gcc/gcc/config/bfin/t-bfin-elf buildtools/trunk/gcc/gcc/config/bfin/uclinux.h buildtools/trunk/gcc/gcc/config/c4x/c4x-c.c buildtools/trunk/gcc/gcc/config/c4x/c4x-modes.def buildtools/trunk/gcc/gcc/config/c4x/c4x-protos.h buildtools/trunk/gcc/gcc/config/c4x/c4x.c buildtools/trunk/gcc/gcc/config/c4x/c4x.h buildtools/trunk/gcc/gcc/config/c4x/c4x.md buildtools/trunk/gcc/gcc/config/c4x/libgcc.S buildtools/trunk/gcc/gcc/config/c4x/rtems.h buildtools/trunk/gcc/gcc/config/chorus.h buildtools/trunk/gcc/gcc/config/cris/aout.h buildtools/trunk/gcc/gcc/config/cris/arit.c buildtools/trunk/gcc/gcc/config/cris/cris-protos.h buildtools/trunk/gcc/gcc/config/cris/cris.c buildtools/trunk/gcc/gcc/config/cris/cris.h buildtools/trunk/gcc/gcc/config/cris/cris.md buildtools/trunk/gcc/gcc/config/cris/cris_abi_symbol.c buildtools/trunk/gcc/gcc/config/cris/linux.h buildtools/trunk/gcc/gcc/config/cris/t-linux buildtools/trunk/gcc/gcc/config/darwin-c.c buildtools/trunk/gcc/gcc/config/darwin-crt2.c buildtools/trunk/gcc/gcc/config/darwin-protos.h buildtools/trunk/gcc/gcc/config/darwin.c buildtools/trunk/gcc/gcc/config/darwin.h buildtools/trunk/gcc/gcc/config/dbx.h buildtools/trunk/gcc/gcc/config/dbxcoff.h buildtools/trunk/gcc/gcc/config/dbxelf.h buildtools/trunk/gcc/gcc/config/elfos.h buildtools/trunk/gcc/gcc/config/fp-bit.c buildtools/trunk/gcc/gcc/config/fp-bit.h buildtools/trunk/gcc/gcc/config/fr30/crti.asm buildtools/trunk/gcc/gcc/config/fr30/crtn.asm buildtools/trunk/gcc/gcc/config/fr30/fr30-protos.h buildtools/trunk/gcc/gcc/config/fr30/fr30.c buildtools/trunk/gcc/gcc/config/fr30/fr30.h buildtools/trunk/gcc/gcc/config/fr30/fr30.md buildtools/trunk/gcc/gcc/config/fr30/lib1funcs.asm buildtools/trunk/gcc/gcc/config/freebsd-nthr.h buildtools/trunk/gcc/gcc/config/freebsd-spec.h buildtools/trunk/gcc/gcc/config/freebsd.h buildtools/trunk/gcc/gcc/config/frv/cmovd.c buildtools/trunk/gcc/gcc/config/frv/cmovh.c buildtools/trunk/gcc/gcc/config/frv/cmovw.c buildtools/trunk/gcc/gcc/config/frv/frv-abi.h buildtools/trunk/gcc/gcc/config/frv/frv-asm.h buildtools/trunk/gcc/gcc/config/frv/frv-modes.def buildtools/trunk/gcc/gcc/config/frv/frv-protos.h buildtools/trunk/gcc/gcc/config/frv/frv.c buildtools/trunk/gcc/gcc/config/frv/frv.h buildtools/trunk/gcc/gcc/config/frv/frv.md buildtools/trunk/gcc/gcc/config/frv/frvbegin.c buildtools/trunk/gcc/gcc/config/frv/frvend.c buildtools/trunk/gcc/gcc/config/frv/lib1funcs.asm buildtools/trunk/gcc/gcc/config/frv/linux.h buildtools/trunk/gcc/gcc/config/gofast.h buildtools/trunk/gcc/gcc/config/h8300/clzhi2.c buildtools/trunk/gcc/gcc/config/h8300/coff.h buildtools/trunk/gcc/gcc/config/h8300/crti.asm buildtools/trunk/gcc/gcc/config/h8300/crtn.asm buildtools/trunk/gcc/gcc/config/h8300/ctzhi2.c buildtools/trunk/gcc/gcc/config/h8300/elf.h buildtools/trunk/gcc/gcc/config/h8300/fixunssfsi.c buildtools/trunk/gcc/gcc/config/h8300/h8300-protos.h buildtools/trunk/gcc/gcc/config/h8300/h8300.c buildtools/trunk/gcc/gcc/config/h8300/h8300.h buildtools/trunk/gcc/gcc/config/h8300/h8300.md buildtools/trunk/gcc/gcc/config/h8300/lib1funcs.asm buildtools/trunk/gcc/gcc/config/h8300/parityhi2.c buildtools/trunk/gcc/gcc/config/h8300/popcounthi2.c buildtools/trunk/gcc/gcc/config/h8300/rtems.h buildtools/trunk/gcc/gcc/config/host-linux.c buildtools/trunk/gcc/gcc/config/host-solaris.c buildtools/trunk/gcc/gcc/config/i386/athlon.md buildtools/trunk/gcc/gcc/config/i386/att.h buildtools/trunk/gcc/gcc/config/i386/beos-elf.h buildtools/trunk/gcc/gcc/config/i386/biarch64.h buildtools/trunk/gcc/gcc/config/i386/bsd.h buildtools/trunk/gcc/gcc/config/i386/crtdll.h buildtools/trunk/gcc/gcc/config/i386/cygming.h buildtools/trunk/gcc/gcc/config/i386/cygwin.asm buildtools/trunk/gcc/gcc/config/i386/cygwin.h buildtools/trunk/gcc/gcc/config/i386/cygwin1.c buildtools/trunk/gcc/gcc/config/i386/cygwin2.c buildtools/trunk/gcc/gcc/config/i386/darwin.h buildtools/trunk/gcc/gcc/config/i386/djgpp.h buildtools/trunk/gcc/gcc/config/i386/emmintrin.h buildtools/trunk/gcc/gcc/config/i386/freebsd.h buildtools/trunk/gcc/gcc/config/i386/freebsd64.h buildtools/trunk/gcc/gcc/config/i386/gas.h buildtools/trunk/gcc/gcc/config/i386/gmm_malloc.h buildtools/trunk/gcc/gcc/config/i386/gthr-win32.c buildtools/trunk/gcc/gcc/config/i386/host-cygwin.c buildtools/trunk/gcc/gcc/config/i386/host-mingw32.c buildtools/trunk/gcc/gcc/config/i386/i386-aout.h buildtools/trunk/gcc/gcc/config/i386/i386-coff.h buildtools/trunk/gcc/gcc/config/i386/i386-interix.h buildtools/trunk/gcc/gcc/config/i386/i386-interix3.h buildtools/trunk/gcc/gcc/config/i386/i386-modes.def buildtools/trunk/gcc/gcc/config/i386/i386-protos.h buildtools/trunk/gcc/gcc/config/i386/i386.c buildtools/trunk/gcc/gcc/config/i386/i386.h buildtools/trunk/gcc/gcc/config/i386/i386.md buildtools/trunk/gcc/gcc/config/i386/i386elf.h buildtools/trunk/gcc/gcc/config/i386/k6.md buildtools/trunk/gcc/gcc/config/i386/kaos-i386.h buildtools/trunk/gcc/gcc/config/i386/kfreebsd-gnu.h buildtools/trunk/gcc/gcc/config/i386/knetbsd-gnu.h buildtools/trunk/gcc/gcc/config/i386/linux-unwind.h buildtools/trunk/gcc/gcc/config/i386/linux.h buildtools/trunk/gcc/gcc/config/i386/linux64.h buildtools/trunk/gcc/gcc/config/i386/lynx.h buildtools/trunk/gcc/gcc/config/i386/mingw32.h buildtools/trunk/gcc/gcc/config/i386/mm3dnow.h buildtools/trunk/gcc/gcc/config/i386/mmintrin.h buildtools/trunk/gcc/gcc/config/i386/mmx.md buildtools/trunk/gcc/gcc/config/i386/netbsd-elf.h buildtools/trunk/gcc/gcc/config/i386/netbsd64.h buildtools/trunk/gcc/gcc/config/i386/netware-crt0.c buildtools/trunk/gcc/gcc/config/i386/netware-libgcc.c buildtools/trunk/gcc/gcc/config/i386/netware.c buildtools/trunk/gcc/gcc/config/i386/netware.h buildtools/trunk/gcc/gcc/config/i386/nto.h buildtools/trunk/gcc/gcc/config/i386/nwld.c buildtools/trunk/gcc/gcc/config/i386/nwld.h buildtools/trunk/gcc/gcc/config/i386/openbsd.h buildtools/trunk/gcc/gcc/config/i386/openbsdelf.h buildtools/trunk/gcc/gcc/config/i386/pentium.md buildtools/trunk/gcc/gcc/config/i386/pmm_malloc.h buildtools/trunk/gcc/gcc/config/i386/pmmintrin.h buildtools/trunk/gcc/gcc/config/i386/ppro.md buildtools/trunk/gcc/gcc/config/i386/predicates.md buildtools/trunk/gcc/gcc/config/i386/ptx4-i.h buildtools/trunk/gcc/gcc/config/i386/rtemself.h buildtools/trunk/gcc/gcc/config/i386/sco5.h buildtools/trunk/gcc/gcc/config/i386/sol2-10.h buildtools/trunk/gcc/gcc/config/i386/sol2-c1.asm buildtools/trunk/gcc/gcc/config/i386/sol2-ci.asm buildtools/trunk/gcc/gcc/config/i386/sol2-cn.asm buildtools/trunk/gcc/gcc/config/i386/sol2-gc1.asm buildtools/trunk/gcc/gcc/config/i386/sol2.h buildtools/trunk/gcc/gcc/config/i386/sse.md buildtools/trunk/gcc/gcc/config/i386/sysv4-cpp.h buildtools/trunk/gcc/gcc/config/i386/sysv4.h buildtools/trunk/gcc/gcc/config/i386/sysv5.h buildtools/trunk/gcc/gcc/config/i386/t-cygming buildtools/trunk/gcc/gcc/config/i386/t-linux64 buildtools/trunk/gcc/gcc/config/i386/t-mingw32 buildtools/trunk/gcc/gcc/config/i386/t-netware buildtools/trunk/gcc/gcc/config/i386/t-nwld buildtools/trunk/gcc/gcc/config/i386/t-vxworks buildtools/trunk/gcc/gcc/config/i386/unix.h buildtools/trunk/gcc/gcc/config/i386/uwin.h buildtools/trunk/gcc/gcc/config/i386/vxworks.h buildtools/trunk/gcc/gcc/config/i386/winnt.c buildtools/trunk/gcc/gcc/config/i386/x-cygwin buildtools/trunk/gcc/gcc/config/i386/x86-64.h buildtools/trunk/gcc/gcc/config/i386/xm-cygwin.h buildtools/trunk/gcc/gcc/config/i386/xm-djgpp.h buildtools/trunk/gcc/gcc/config/i386/xm-mingw32.h buildtools/trunk/gcc/gcc/config/i386/xmmintrin.h buildtools/trunk/gcc/gcc/config/ia64/crtbegin.asm buildtools/trunk/gcc/gcc/config/ia64/crtend.asm buildtools/trunk/gcc/gcc/config/ia64/crtfastmath.c buildtools/trunk/gcc/gcc/config/ia64/crti.asm buildtools/trunk/gcc/gcc/config/ia64/crtn.asm buildtools/trunk/gcc/gcc/config/ia64/fde-glibc.c buildtools/trunk/gcc/gcc/config/ia64/freebsd.h buildtools/trunk/gcc/gcc/config/ia64/hpux.h buildtools/trunk/gcc/gcc/config/ia64/ia64-c.c buildtools/trunk/gcc/gcc/config/ia64/ia64-modes.def buildtools/trunk/gcc/gcc/config/ia64/ia64-protos.h buildtools/trunk/gcc/gcc/config/ia64/ia64.c buildtools/trunk/gcc/gcc/config/ia64/ia64.h buildtools/trunk/gcc/gcc/config/ia64/ia64.md buildtools/trunk/gcc/gcc/config/ia64/ia64intrin.h buildtools/trunk/gcc/gcc/config/ia64/itanium1.md buildtools/trunk/gcc/gcc/config/ia64/itanium2.md buildtools/trunk/gcc/gcc/config/ia64/lib1funcs.asm buildtools/trunk/gcc/gcc/config/ia64/linux-unwind.h buildtools/trunk/gcc/gcc/config/ia64/linux.h buildtools/trunk/gcc/gcc/config/ia64/predicates.md buildtools/trunk/gcc/gcc/config/ia64/quadlib.c buildtools/trunk/gcc/gcc/config/ia64/sysv4.h buildtools/trunk/gcc/gcc/config/ia64/t-hpux buildtools/trunk/gcc/gcc/config/ia64/t-ia64 buildtools/trunk/gcc/gcc/config/ia64/unwind-ia64.c buildtools/trunk/gcc/gcc/config/ia64/unwind-ia64.h buildtools/trunk/gcc/gcc/config/ia64/vect.md buildtools/trunk/gcc/gcc/config/interix.h buildtools/trunk/gcc/gcc/config/interix3.h buildtools/trunk/gcc/gcc/config/iq2000/iq2000-protos.h buildtools/trunk/gcc/gcc/config/iq2000/iq2000.c buildtools/trunk/gcc/gcc/config/iq2000/iq2000.h buildtools/trunk/gcc/gcc/config/iq2000/iq2000.md buildtools/trunk/gcc/gcc/config/kaos.h buildtools/trunk/gcc/gcc/config/kfreebsd-gnu.h buildtools/trunk/gcc/gcc/config/knetbsd-gnu.h buildtools/trunk/gcc/gcc/config/libgloss.h buildtools/trunk/gcc/gcc/config/linux.h buildtools/trunk/gcc/gcc/config/lynx.h buildtools/trunk/gcc/gcc/config/m32r/initfini.c buildtools/trunk/gcc/gcc/config/m32r/linux.h buildtools/trunk/gcc/gcc/config/m32r/little.h buildtools/trunk/gcc/gcc/config/m32r/m32r-protos.h buildtools/trunk/gcc/gcc/config/m32r/m32r.c buildtools/trunk/gcc/gcc/config/m32r/m32r.h buildtools/trunk/gcc/gcc/config/m32r/m32r.md buildtools/trunk/gcc/gcc/config/m68hc11/larith.asm buildtools/trunk/gcc/gcc/config/m68hc11/m68hc11-crt0.S buildtools/trunk/gcc/gcc/config/m68hc11/m68hc11-protos.h buildtools/trunk/gcc/gcc/config/m68hc11/m68hc11.c buildtools/trunk/gcc/gcc/config/m68hc11/m68hc11.h buildtools/trunk/gcc/gcc/config/m68hc11/m68hc11.md buildtools/trunk/gcc/gcc/config/m68hc11/m68hc12.h buildtools/trunk/gcc/gcc/config/m68k/coff.h buildtools/trunk/gcc/gcc/config/m68k/crti.s buildtools/trunk/gcc/gcc/config/m68k/crtn.s buildtools/trunk/gcc/gcc/config/m68k/fpgnulib.c buildtools/trunk/gcc/gcc/config/m68k/lb1sf68.asm buildtools/trunk/gcc/gcc/config/m68k/linux.h buildtools/trunk/gcc/gcc/config/m68k/m68020-elf.h buildtools/trunk/gcc/gcc/config/m68k/m68k-aout.h buildtools/trunk/gcc/gcc/config/m68k/m68k-modes.def buildtools/trunk/gcc/gcc/config/m68k/m68k-none.h buildtools/trunk/gcc/gcc/config/m68k/m68k-protos.h buildtools/trunk/gcc/gcc/config/m68k/m68k.c buildtools/trunk/gcc/gcc/config/m68k/m68k.h buildtools/trunk/gcc/gcc/config/m68k/m68k.md buildtools/trunk/gcc/gcc/config/m68k/m68kelf.h buildtools/trunk/gcc/gcc/config/m68k/netbsd-elf.h buildtools/trunk/gcc/gcc/config/m68k/openbsd.h buildtools/trunk/gcc/gcc/config/m68k/rtemself.h buildtools/trunk/gcc/gcc/config/m68k/t-m68kelf buildtools/trunk/gcc/gcc/config/m68k/t-uclinux buildtools/trunk/gcc/gcc/config/m68k/uclinux.h buildtools/trunk/gcc/gcc/config/mcore/crti.asm buildtools/trunk/gcc/gcc/config/mcore/crtn.asm buildtools/trunk/gcc/gcc/config/mcore/lib1.asm buildtools/trunk/gcc/gcc/config/mcore/mcore-elf.h buildtools/trunk/gcc/gcc/config/mcore/mcore-pe.h buildtools/trunk/gcc/gcc/config/mcore/mcore-protos.h buildtools/trunk/gcc/gcc/config/mcore/mcore.c buildtools/trunk/gcc/gcc/config/mcore/mcore.h buildtools/trunk/gcc/gcc/config/mcore/mcore.md buildtools/trunk/gcc/gcc/config/mips/3000.md buildtools/trunk/gcc/gcc/config/mips/4000.md buildtools/trunk/gcc/gcc/config/mips/4100.md buildtools/trunk/gcc/gcc/config/mips/4130.md buildtools/trunk/gcc/gcc/config/mips/4300.md buildtools/trunk/gcc/gcc/config/mips/4600.md buildtools/trunk/gcc/gcc/config/mips/5000.md buildtools/trunk/gcc/gcc/config/mips/5400.md buildtools/trunk/gcc/gcc/config/mips/5500.md buildtools/trunk/gcc/gcc/config/mips/6000.md buildtools/trunk/gcc/gcc/config/mips/7000.md buildtools/trunk/gcc/gcc/config/mips/9000.md buildtools/trunk/gcc/gcc/config/mips/elf.h buildtools/trunk/gcc/gcc/config/mips/elforion.h buildtools/trunk/gcc/gcc/config/mips/generic.md buildtools/trunk/gcc/gcc/config/mips/iris.h buildtools/trunk/gcc/gcc/config/mips/iris5.h buildtools/trunk/gcc/gcc/config/mips/iris6.h buildtools/trunk/gcc/gcc/config/mips/linux-unwind.h buildtools/trunk/gcc/gcc/config/mips/linux.h buildtools/trunk/gcc/gcc/config/mips/linux64.h buildtools/trunk/gcc/gcc/config/mips/mips-modes.def buildtools/trunk/gcc/gcc/config/mips/mips-protos.h buildtools/trunk/gcc/gcc/config/mips/mips-ps-3d.md buildtools/trunk/gcc/gcc/config/mips/mips.c buildtools/trunk/gcc/gcc/config/mips/mips.h buildtools/trunk/gcc/gcc/config/mips/mips.md buildtools/trunk/gcc/gcc/config/mips/mips16.S buildtools/trunk/gcc/gcc/config/mips/netbsd.h buildtools/trunk/gcc/gcc/config/mips/openbsd.h buildtools/trunk/gcc/gcc/config/mips/predicates.md buildtools/trunk/gcc/gcc/config/mips/r3900.h buildtools/trunk/gcc/gcc/config/mips/rtems.h buildtools/trunk/gcc/gcc/config/mips/sb1.md buildtools/trunk/gcc/gcc/config/mips/sdb.h buildtools/trunk/gcc/gcc/config/mips/sr71k.md buildtools/trunk/gcc/gcc/config/mips/t-iris6 buildtools/trunk/gcc/gcc/config/mips/t-linux64 buildtools/trunk/gcc/gcc/config/mips/t-mips buildtools/trunk/gcc/gcc/config/mips/t-rtems buildtools/trunk/gcc/gcc/config/mips/vr.h buildtools/trunk/gcc/gcc/config/mips/vr4120-div.S buildtools/trunk/gcc/gcc/config/mips/vxworks.h buildtools/trunk/gcc/gcc/config/mips/windiss.h buildtools/trunk/gcc/gcc/config/mmix/crti.asm buildtools/trunk/gcc/gcc/config/mmix/crtn.asm buildtools/trunk/gcc/gcc/config/mmix/mmix-modes.def buildtools/trunk/gcc/gcc/config/mmix/mmix-protos.h buildtools/trunk/gcc/gcc/config/mmix/mmix.c buildtools/trunk/gcc/gcc/config/mmix/mmix.h buildtools/trunk/gcc/gcc/config/mmix/mmix.md buildtools/trunk/gcc/gcc/config/mn10300/linux.h buildtools/trunk/gcc/gcc/config/mn10300/mn10300-protos.h buildtools/trunk/gcc/gcc/config/mn10300/mn10300.c buildtools/trunk/gcc/gcc/config/mn10300/mn10300.h buildtools/trunk/gcc/gcc/config/mn10300/mn10300.md buildtools/trunk/gcc/gcc/config/netbsd-aout.h buildtools/trunk/gcc/gcc/config/netbsd-elf.h buildtools/trunk/gcc/gcc/config/netbsd.h buildtools/trunk/gcc/gcc/config/openbsd-oldgas.h buildtools/trunk/gcc/gcc/config/openbsd.h buildtools/trunk/gcc/gcc/config/pa/elf.h buildtools/trunk/gcc/gcc/config/pa/fptr.c buildtools/trunk/gcc/gcc/config/pa/lib2funcs.asm buildtools/trunk/gcc/gcc/config/pa/linux-unwind.h buildtools/trunk/gcc/gcc/config/pa/pa-64.h buildtools/trunk/gcc/gcc/config/pa/pa-hpux.h buildtools/trunk/gcc/gcc/config/pa/pa-hpux10.h buildtools/trunk/gcc/gcc/config/pa/pa-hpux1010.h buildtools/trunk/gcc/gcc/config/pa/pa-hpux11.h buildtools/trunk/gcc/gcc/config/pa/pa-hpux1111.h buildtools/trunk/gcc/gcc/config/pa/pa-linux.h buildtools/trunk/gcc/gcc/config/pa/pa-modes.def buildtools/trunk/gcc/gcc/config/pa/pa-osf.h buildtools/trunk/gcc/gcc/config/pa/pa-pro-end.h buildtools/trunk/gcc/gcc/config/pa/pa-protos.h buildtools/trunk/gcc/gcc/config/pa/pa.c buildtools/trunk/gcc/gcc/config/pa/pa.h buildtools/trunk/gcc/gcc/config/pa/pa.md buildtools/trunk/gcc/gcc/config/pa/pa32-linux.h buildtools/trunk/gcc/gcc/config/pa/pa32-regs.h buildtools/trunk/gcc/gcc/config/pa/pa64-hpux.h buildtools/trunk/gcc/gcc/config/pa/pa64-linux.h buildtools/trunk/gcc/gcc/config/pa/pa64-regs.h buildtools/trunk/gcc/gcc/config/pa/pa64-start.h buildtools/trunk/gcc/gcc/config/pa/quadlib.c buildtools/trunk/gcc/gcc/config/pa/som.h buildtools/trunk/gcc/gcc/config/pa/t-hpux-shlib buildtools/trunk/gcc/gcc/config/pa/t-pa buildtools/trunk/gcc/gcc/config/pa/t-pa-hpux buildtools/trunk/gcc/gcc/config/pa/t-pa64 buildtools/trunk/gcc/gcc/config/pdp11/2bsd.h buildtools/trunk/gcc/gcc/config/pdp11/pdp11-modes.def buildtools/trunk/gcc/gcc/config/pdp11/pdp11-protos.h buildtools/trunk/gcc/gcc/config/pdp11/pdp11.c buildtools/trunk/gcc/gcc/config/pdp11/pdp11.h buildtools/trunk/gcc/gcc/config/pdp11/pdp11.md buildtools/trunk/gcc/gcc/config/ptx4.h buildtools/trunk/gcc/gcc/config/rs6000/40x.md buildtools/trunk/gcc/gcc/config/rs6000/440.md buildtools/trunk/gcc/gcc/config/rs6000/603.md buildtools/trunk/gcc/gcc/config/rs6000/6xx.md buildtools/trunk/gcc/gcc/config/rs6000/7450.md buildtools/trunk/gcc/gcc/config/rs6000/7xx.md buildtools/trunk/gcc/gcc/config/rs6000/8540.md buildtools/trunk/gcc/gcc/config/rs6000/aix.h buildtools/trunk/gcc/gcc/config/rs6000/aix41.h buildtools/trunk/gcc/gcc/config/rs6000/aix43.h buildtools/trunk/gcc/gcc/config/rs6000/aix51.h buildtools/trunk/gcc/gcc/config/rs6000/aix52.h buildtools/trunk/gcc/gcc/config/rs6000/altivec.h buildtools/trunk/gcc/gcc/config/rs6000/altivec.md buildtools/trunk/gcc/gcc/config/rs6000/beos.h buildtools/trunk/gcc/gcc/config/rs6000/biarch64.h buildtools/trunk/gcc/gcc/config/rs6000/crtsavres.asm buildtools/trunk/gcc/gcc/config/rs6000/darwin-asm.h buildtools/trunk/gcc/gcc/config/rs6000/darwin-fallback.c buildtools/trunk/gcc/gcc/config/rs6000/darwin-fpsave.asm buildtools/trunk/gcc/gcc/config/rs6000/darwin-ldouble.c buildtools/trunk/gcc/gcc/config/rs6000/darwin-tramp.asm buildtools/trunk/gcc/gcc/config/rs6000/darwin-unwind.h buildtools/trunk/gcc/gcc/config/rs6000/darwin-vecsave.asm buildtools/trunk/gcc/gcc/config/rs6000/darwin-world.asm buildtools/trunk/gcc/gcc/config/rs6000/darwin.h buildtools/trunk/gcc/gcc/config/rs6000/darwin.md buildtools/trunk/gcc/gcc/config/rs6000/default64.h buildtools/trunk/gcc/gcc/config/rs6000/e500-double.h buildtools/trunk/gcc/gcc/config/rs6000/eabi-ci.asm buildtools/trunk/gcc/gcc/config/rs6000/eabi-cn.asm buildtools/trunk/gcc/gcc/config/rs6000/eabi.asm buildtools/trunk/gcc/gcc/config/rs6000/eabi.h buildtools/trunk/gcc/gcc/config/rs6000/eabialtivec.h buildtools/trunk/gcc/gcc/config/rs6000/eabisim.h buildtools/trunk/gcc/gcc/config/rs6000/eabispe.h buildtools/trunk/gcc/gcc/config/rs6000/freebsd.h buildtools/trunk/gcc/gcc/config/rs6000/gnu.h buildtools/trunk/gcc/gcc/config/rs6000/haiku-ppc.h buildtools/trunk/gcc/gcc/config/rs6000/host-darwin.c buildtools/trunk/gcc/gcc/config/rs6000/kaos-ppc.h buildtools/trunk/gcc/gcc/config/rs6000/linux-unwind.h buildtools/trunk/gcc/gcc/config/rs6000/linux.h buildtools/trunk/gcc/gcc/config/rs6000/linux64.h buildtools/trunk/gcc/gcc/config/rs6000/linuxaltivec.h buildtools/trunk/gcc/gcc/config/rs6000/linuxspe.h buildtools/trunk/gcc/gcc/config/rs6000/lynx.h buildtools/trunk/gcc/gcc/config/rs6000/mpc.md buildtools/trunk/gcc/gcc/config/rs6000/netbsd.h buildtools/trunk/gcc/gcc/config/rs6000/power4.md buildtools/trunk/gcc/gcc/config/rs6000/power5.md buildtools/trunk/gcc/gcc/config/rs6000/ppc64-fp.c buildtools/trunk/gcc/gcc/config/rs6000/rios1.md buildtools/trunk/gcc/gcc/config/rs6000/rios2.md buildtools/trunk/gcc/gcc/config/rs6000/rs6000-c.c buildtools/trunk/gcc/gcc/config/rs6000/rs6000-modes.def buildtools/trunk/gcc/gcc/config/rs6000/rs6000-protos.h buildtools/trunk/gcc/gcc/config/rs6000/rs6000.c buildtools/trunk/gcc/gcc/config/rs6000/rs6000.h buildtools/trunk/gcc/gcc/config/rs6000/rs6000.md buildtools/trunk/gcc/gcc/config/rs6000/rs64.md buildtools/trunk/gcc/gcc/config/rs6000/rtems.h buildtools/trunk/gcc/gcc/config/rs6000/sol-ci.asm buildtools/trunk/gcc/gcc/config/rs6000/sol-cn.asm buildtools/trunk/gcc/gcc/config/rs6000/spe.h buildtools/trunk/gcc/gcc/config/rs6000/spe.md buildtools/trunk/gcc/gcc/config/rs6000/sysv4.h buildtools/trunk/gcc/gcc/config/rs6000/sysv4le.h buildtools/trunk/gcc/gcc/config/rs6000/t-aix43 buildtools/trunk/gcc/gcc/config/rs6000/t-aix52 buildtools/trunk/gcc/gcc/config/rs6000/t-darwin buildtools/trunk/gcc/gcc/config/rs6000/t-darwin8 buildtools/trunk/gcc/gcc/config/rs6000/t-fprules buildtools/trunk/gcc/gcc/config/rs6000/t-linux64 buildtools/trunk/gcc/gcc/config/rs6000/t-ppccomm buildtools/trunk/gcc/gcc/config/rs6000/t-vxworks buildtools/trunk/gcc/gcc/config/rs6000/tramp.asm buildtools/trunk/gcc/gcc/config/rs6000/vxworks.h buildtools/trunk/gcc/gcc/config/rs6000/windiss.h buildtools/trunk/gcc/gcc/config/rs6000/x-darwin buildtools/trunk/gcc/gcc/config/rs6000/xcoff.h buildtools/trunk/gcc/gcc/config/rtems.h buildtools/trunk/gcc/gcc/config/s390/2064.md buildtools/trunk/gcc/gcc/config/s390/2084.md buildtools/trunk/gcc/gcc/config/s390/fixdfdi.h buildtools/trunk/gcc/gcc/config/s390/libgcc-glibc.ver buildtools/trunk/gcc/gcc/config/s390/linux-unwind.h buildtools/trunk/gcc/gcc/config/s390/linux.h buildtools/trunk/gcc/gcc/config/s390/s390-modes.def buildtools/trunk/gcc/gcc/config/s390/s390-protos.h buildtools/trunk/gcc/gcc/config/s390/s390.c buildtools/trunk/gcc/gcc/config/s390/s390.h buildtools/trunk/gcc/gcc/config/s390/s390.md buildtools/trunk/gcc/gcc/config/s390/s390x.h buildtools/trunk/gcc/gcc/config/s390/t-crtstuff buildtools/trunk/gcc/gcc/config/s390/t-linux64 buildtools/trunk/gcc/gcc/config/s390/t-tpf buildtools/trunk/gcc/gcc/config/s390/tpf-unwind.h buildtools/trunk/gcc/gcc/config/s390/tpf.h buildtools/trunk/gcc/gcc/config/sh/coff.h buildtools/trunk/gcc/gcc/config/sh/crt1.asm buildtools/trunk/gcc/gcc/config/sh/crti.asm buildtools/trunk/gcc/gcc/config/sh/crtn.asm buildtools/trunk/gcc/gcc/config/sh/elf.h buildtools/trunk/gcc/gcc/config/sh/embed-elf.h buildtools/trunk/gcc/gcc/config/sh/kaos-sh.h buildtools/trunk/gcc/gcc/config/sh/lib1funcs.asm buildtools/trunk/gcc/gcc/config/sh/libgcc-excl.ver buildtools/trunk/gcc/gcc/config/sh/linux-unwind.h buildtools/trunk/gcc/gcc/config/sh/linux.h buildtools/trunk/gcc/gcc/config/sh/little.h buildtools/trunk/gcc/gcc/config/sh/netbsd-elf.h buildtools/trunk/gcc/gcc/config/sh/rtems.h buildtools/trunk/gcc/gcc/config/sh/rtemself.h buildtools/trunk/gcc/gcc/config/sh/sh-modes.def buildtools/trunk/gcc/gcc/config/sh/sh-protos.h buildtools/trunk/gcc/gcc/config/sh/sh.c buildtools/trunk/gcc/gcc/config/sh/sh.h buildtools/trunk/gcc/gcc/config/sh/sh.md buildtools/trunk/gcc/gcc/config/sh/sh1.md buildtools/trunk/gcc/gcc/config/sh/sh4.md buildtools/trunk/gcc/gcc/config/sh/sh4a.md buildtools/trunk/gcc/gcc/config/sh/sh64.h buildtools/trunk/gcc/gcc/config/sh/shmedia.h buildtools/trunk/gcc/gcc/config/sh/shmedia.md buildtools/trunk/gcc/gcc/config/sh/sshmedia.h buildtools/trunk/gcc/gcc/config/sh/symbian-post.h buildtools/trunk/gcc/gcc/config/sh/symbian-pre.h buildtools/trunk/gcc/gcc/config/sh/symbian.c buildtools/trunk/gcc/gcc/config/sh/t-linux buildtools/trunk/gcc/gcc/config/sh/t-sh buildtools/trunk/gcc/gcc/config/sh/t-sh64 buildtools/trunk/gcc/gcc/config/sh/ushmedia.h buildtools/trunk/gcc/gcc/config/sh/vxworks.h buildtools/trunk/gcc/gcc/config/sol2-c.c buildtools/trunk/gcc/gcc/config/sol2-protos.h buildtools/trunk/gcc/gcc/config/sol2.c buildtools/trunk/gcc/gcc/config/sol2.h buildtools/trunk/gcc/gcc/config/sol26.h buildtools/trunk/gcc/gcc/config/sparc/biarch64.h buildtools/trunk/gcc/gcc/config/sparc/crtfastmath.c buildtools/trunk/gcc/gcc/config/sparc/cypress.md buildtools/trunk/gcc/gcc/config/sparc/freebsd.h buildtools/trunk/gcc/gcc/config/sparc/gmon-sol2.c buildtools/trunk/gcc/gcc/config/sparc/hypersparc.md buildtools/trunk/gcc/gcc/config/sparc/linux-unwind.h buildtools/trunk/gcc/gcc/config/sparc/linux.h buildtools/trunk/gcc/gcc/config/sparc/linux64.h buildtools/trunk/gcc/gcc/config/sparc/netbsd-elf.h buildtools/trunk/gcc/gcc/config/sparc/openbsd1-64.h buildtools/trunk/gcc/gcc/config/sparc/openbsd64.h buildtools/trunk/gcc/gcc/config/sparc/rtemself.h buildtools/trunk/gcc/gcc/config/sparc/sol2-bi.h buildtools/trunk/gcc/gcc/config/sparc/sol2-c1.asm buildtools/trunk/gcc/gcc/config/sparc/sol2-ci.asm buildtools/trunk/gcc/gcc/config/sparc/sol2-cn.asm buildtools/trunk/gcc/gcc/config/sparc/sol2-gas.h buildtools/trunk/gcc/gcc/config/sparc/sol2.h buildtools/trunk/gcc/gcc/config/sparc/sp-elf.h buildtools/trunk/gcc/gcc/config/sparc/sp64-elf.h buildtools/trunk/gcc/gcc/config/sparc/sparc-modes.def buildtools/trunk/gcc/gcc/config/sparc/sparc-protos.h buildtools/trunk/gcc/gcc/config/sparc/sparc.c buildtools/trunk/gcc/gcc/config/sparc/sparc.h buildtools/trunk/gcc/gcc/config/sparc/sparc.md buildtools/trunk/gcc/gcc/config/sparc/sparclet.md buildtools/trunk/gcc/gcc/config/sparc/supersparc.md buildtools/trunk/gcc/gcc/config/sparc/sysv4-only.h buildtools/trunk/gcc/gcc/config/sparc/sysv4.h buildtools/trunk/gcc/gcc/config/sparc/ultra1_2.md buildtools/trunk/gcc/gcc/config/sparc/ultra3.md buildtools/trunk/gcc/gcc/config/stormy16/stormy-abi buildtools/trunk/gcc/gcc/config/stormy16/stormy16-lib2.c buildtools/trunk/gcc/gcc/config/stormy16/stormy16-protos.h buildtools/trunk/gcc/gcc/config/stormy16/stormy16.c buildtools/trunk/gcc/gcc/config/stormy16/stormy16.h buildtools/trunk/gcc/gcc/config/stormy16/stormy16.md buildtools/trunk/gcc/gcc/config/svr3.h buildtools/trunk/gcc/gcc/config/svr4.h buildtools/trunk/gcc/gcc/config/t-darwin buildtools/trunk/gcc/gcc/config/t-slibgcc-darwin buildtools/trunk/gcc/gcc/config/t-vxworks buildtools/trunk/gcc/gcc/config/usegas.h buildtools/trunk/gcc/gcc/config/v850/lib1funcs.asm buildtools/trunk/gcc/gcc/config/v850/v850-c.c buildtools/trunk/gcc/gcc/config/v850/v850-protos.h buildtools/trunk/gcc/gcc/config/v850/v850.c buildtools/trunk/gcc/gcc/config/v850/v850.h buildtools/trunk/gcc/gcc/config/v850/v850.md buildtools/trunk/gcc/gcc/config/vax/bsd.h buildtools/trunk/gcc/gcc/config/vax/elf.h buildtools/trunk/gcc/gcc/config/vax/netbsd-elf.h buildtools/trunk/gcc/gcc/config/vax/netbsd.h buildtools/trunk/gcc/gcc/config/vax/openbsd.h buildtools/trunk/gcc/gcc/config/vax/openbsd1.h buildtools/trunk/gcc/gcc/config/vax/ultrix.h buildtools/trunk/gcc/gcc/config/vax/vax-modes.def buildtools/trunk/gcc/gcc/config/vax/vax-protos.h buildtools/trunk/gcc/gcc/config/vax/vax.c buildtools/trunk/gcc/gcc/config/vax/vax.h buildtools/trunk/gcc/gcc/config/vax/vax.md buildtools/trunk/gcc/gcc/config/vax/vaxv.h buildtools/trunk/gcc/gcc/config/vxlib.c buildtools/trunk/gcc/gcc/config/vxworks.h buildtools/trunk/gcc/gcc/config/windiss.h buildtools/trunk/gcc/gcc/config/xtensa/crti.asm buildtools/trunk/gcc/gcc/config/xtensa/crtn.asm buildtools/trunk/gcc/gcc/config/xtensa/elf.h buildtools/trunk/gcc/gcc/config/xtensa/lib1funcs.asm buildtools/trunk/gcc/gcc/config/xtensa/lib2funcs.S buildtools/trunk/gcc/gcc/config/xtensa/linux.h buildtools/trunk/gcc/gcc/config/xtensa/xtensa-protos.h buildtools/trunk/gcc/gcc/config/xtensa/xtensa.c buildtools/trunk/gcc/gcc/config/xtensa/xtensa.h buildtools/trunk/gcc/gcc/config/xtensa/xtensa.md buildtools/trunk/gcc/gcc/configure buildtools/trunk/gcc/gcc/configure.ac buildtools/trunk/gcc/gcc/conflict.c buildtools/trunk/gcc/gcc/convert.c buildtools/trunk/gcc/gcc/convert.h buildtools/trunk/gcc/gcc/coretypes.h buildtools/trunk/gcc/gcc/coverage.c buildtools/trunk/gcc/gcc/coverage.h buildtools/trunk/gcc/gcc/cp/ChangeLog buildtools/trunk/gcc/gcc/cp/ChangeLog.tree-ssa buildtools/trunk/gcc/gcc/cp/Make-lang.in buildtools/trunk/gcc/gcc/cp/NEWS buildtools/trunk/gcc/gcc/cp/call.c buildtools/trunk/gcc/gcc/cp/class.c buildtools/trunk/gcc/gcc/cp/config-lang.in buildtools/trunk/gcc/gcc/cp/cp-gimplify.c buildtools/trunk/gcc/gcc/cp/cp-lang.c buildtools/trunk/gcc/gcc/cp/cp-objcp-common.c buildtools/trunk/gcc/gcc/cp/cp-objcp-common.h buildtools/trunk/gcc/gcc/cp/cp-tree.def buildtools/trunk/gcc/gcc/cp/cp-tree.h buildtools/trunk/gcc/gcc/cp/cvt.c buildtools/trunk/gcc/gcc/cp/cxx-pretty-print.c buildtools/trunk/gcc/gcc/cp/cxx-pretty-print.h buildtools/trunk/gcc/gcc/cp/decl.c buildtools/trunk/gcc/gcc/cp/decl.h buildtools/trunk/gcc/gcc/cp/decl2.c buildtools/trunk/gcc/gcc/cp/dump.c buildtools/trunk/gcc/gcc/cp/error.c buildtools/trunk/gcc/gcc/cp/except.c buildtools/trunk/gcc/gcc/cp/expr.c buildtools/trunk/gcc/gcc/cp/friend.c buildtools/trunk/gcc/gcc/cp/g++spec.c buildtools/trunk/gcc/gcc/cp/init.c buildtools/trunk/gcc/gcc/cp/lang-specs.h buildtools/trunk/gcc/gcc/cp/lex.c buildtools/trunk/gcc/gcc/cp/mangle.c buildtools/trunk/gcc/gcc/cp/method.c buildtools/trunk/gcc/gcc/cp/name-lookup.c buildtools/trunk/gcc/gcc/cp/name-lookup.h buildtools/trunk/gcc/gcc/cp/operators.def buildtools/trunk/gcc/gcc/cp/optimize.c buildtools/trunk/gcc/gcc/cp/parser.c buildtools/trunk/gcc/gcc/cp/pt.c buildtools/trunk/gcc/gcc/cp/ptree.c buildtools/trunk/gcc/gcc/cp/repo.c buildtools/trunk/gcc/gcc/cp/rtti.c buildtools/trunk/gcc/gcc/cp/search.c buildtools/trunk/gcc/gcc/cp/semantics.c buildtools/trunk/gcc/gcc/cp/tree.c buildtools/trunk/gcc/gcc/cp/typeck.c buildtools/trunk/gcc/gcc/cp/typeck2.c buildtools/trunk/gcc/gcc/cppdefault.c buildtools/trunk/gcc/gcc/cppdefault.h buildtools/trunk/gcc/gcc/cppspec.c buildtools/trunk/gcc/gcc/crtstuff.c buildtools/trunk/gcc/gcc/cse.c buildtools/trunk/gcc/gcc/cselib.c buildtools/trunk/gcc/gcc/cselib.h buildtools/trunk/gcc/gcc/dbxout.c buildtools/trunk/gcc/gcc/dbxout.h buildtools/trunk/gcc/gcc/ddg.c buildtools/trunk/gcc/gcc/ddg.h buildtools/trunk/gcc/gcc/debug.c buildtools/trunk/gcc/gcc/debug.h buildtools/trunk/gcc/gcc/defaults.h buildtools/trunk/gcc/gcc/df.c buildtools/trunk/gcc/gcc/df.h buildtools/trunk/gcc/gcc/diagnostic.c buildtools/trunk/gcc/gcc/diagnostic.h buildtools/trunk/gcc/gcc/doc/c-tree.texi buildtools/trunk/gcc/gcc/doc/cfg.texi buildtools/trunk/gcc/gcc/doc/contrib.texi buildtools/trunk/gcc/gcc/doc/cpp.1 buildtools/trunk/gcc/gcc/doc/cpp.info buildtools/trunk/gcc/gcc/doc/cpp.texi buildtools/trunk/gcc/gcc/doc/cppinternals.info buildtools/trunk/gcc/gcc/doc/cppinternals.texi buildtools/trunk/gcc/gcc/doc/cppopts.texi buildtools/trunk/gcc/gcc/doc/extend.texi buildtools/trunk/gcc/gcc/doc/fragments.texi buildtools/trunk/gcc/gcc/doc/fsf-funding.7 buildtools/trunk/gcc/gcc/doc/g++.1 buildtools/trunk/gcc/gcc/doc/gcc.1 buildtools/trunk/gcc/gcc/doc/gcc.info buildtools/trunk/gcc/gcc/doc/gcc.texi buildtools/trunk/gcc/gcc/doc/gccinstall.info buildtools/trunk/gcc/gcc/doc/gccint.info buildtools/trunk/gcc/gcc/doc/gccint.texi buildtools/trunk/gcc/gcc/doc/gcj-dbtool.1 buildtools/trunk/gcc/gcc/doc/gcj.1 buildtools/trunk/gcc/gcc/doc/gcj.info buildtools/trunk/gcc/gcc/doc/gcjh.1 buildtools/trunk/gcc/gcc/doc/gcov.1 buildtools/trunk/gcc/gcc/doc/gcov.texi buildtools/trunk/gcc/gcc/doc/gfdl.7 buildtools/trunk/gcc/gcc/doc/gij.1 buildtools/trunk/gcc/gcc/doc/gjnih.1 buildtools/trunk/gcc/gcc/doc/gpl.7 buildtools/trunk/gcc/gcc/doc/grmic.1 buildtools/trunk/gcc/gcc/doc/grmiregistry.1 buildtools/trunk/gcc/gcc/doc/implement-c.texi buildtools/trunk/gcc/gcc/doc/include/fdl.texi buildtools/trunk/gcc/gcc/doc/include/gcc-common.texi buildtools/trunk/gcc/gcc/doc/include/gpl.texi buildtools/trunk/gcc/gcc/doc/include/texinfo.tex buildtools/trunk/gcc/gcc/doc/install.texi buildtools/trunk/gcc/gcc/doc/install.texi2html buildtools/trunk/gcc/gcc/doc/invoke.texi buildtools/trunk/gcc/gcc/doc/jcf-dump.1 buildtools/trunk/gcc/gcc/doc/jv-convert.1 buildtools/trunk/gcc/gcc/doc/jv-scan.1 buildtools/trunk/gcc/gcc/doc/md.texi buildtools/trunk/gcc/gcc/doc/objc.texi buildtools/trunk/gcc/gcc/doc/passes.texi buildtools/trunk/gcc/gcc/doc/rtl.texi buildtools/trunk/gcc/gcc/doc/sourcebuild.texi buildtools/trunk/gcc/gcc/doc/standards.texi buildtools/trunk/gcc/gcc/doc/tm.texi buildtools/trunk/gcc/gcc/doc/tree-ssa.texi buildtools/trunk/gcc/gcc/doc/trouble.texi buildtools/trunk/gcc/gcc/dojump.c buildtools/trunk/gcc/gcc/dominance.c buildtools/trunk/gcc/gcc/domwalk.c buildtools/trunk/gcc/gcc/domwalk.h buildtools/trunk/gcc/gcc/dummy-conditions.c buildtools/trunk/gcc/gcc/dwarf.h buildtools/trunk/gcc/gcc/dwarf2.h buildtools/trunk/gcc/gcc/dwarf2asm.c buildtools/trunk/gcc/gcc/dwarf2asm.h buildtools/trunk/gcc/gcc/dwarf2out.c buildtools/trunk/gcc/gcc/dwarf2out.h buildtools/trunk/gcc/gcc/emit-rtl.c buildtools/trunk/gcc/gcc/emit-rtl.h buildtools/trunk/gcc/gcc/errors.c buildtools/trunk/gcc/gcc/errors.h buildtools/trunk/gcc/gcc/et-forest.c buildtools/trunk/gcc/gcc/et-forest.h buildtools/trunk/gcc/gcc/except.c buildtools/trunk/gcc/gcc/except.h buildtools/trunk/gcc/gcc/explow.c buildtools/trunk/gcc/gcc/expmed.c buildtools/trunk/gcc/gcc/expr.c buildtools/trunk/gcc/gcc/expr.h buildtools/trunk/gcc/gcc/final.c buildtools/trunk/gcc/gcc/fix-header.c buildtools/trunk/gcc/gcc/fixproto buildtools/trunk/gcc/gcc/flags.h buildtools/trunk/gcc/gcc/flow.c buildtools/trunk/gcc/gcc/fold-const.c buildtools/trunk/gcc/gcc/fp-test.c buildtools/trunk/gcc/gcc/function.c buildtools/trunk/gcc/gcc/function.h buildtools/trunk/gcc/gcc/gbl-ctors.h buildtools/trunk/gcc/gcc/gcc.c buildtools/trunk/gcc/gcc/gcc.h buildtools/trunk/gcc/gcc/gccbug.in buildtools/trunk/gcc/gcc/gccspec.c buildtools/trunk/gcc/gcc/gcov-dump.c buildtools/trunk/gcc/gcc/gcov-io.c buildtools/trunk/gcc/gcc/gcov-io.h buildtools/trunk/gcc/gcc/gcov-iov.c buildtools/trunk/gcc/gcc/gcov.c buildtools/trunk/gcc/gcc/gcse.c buildtools/trunk/gcc/gcc/gen-protos.c buildtools/trunk/gcc/gcc/genattr.c buildtools/trunk/gcc/gcc/genattrtab.c buildtools/trunk/gcc/gcc/genattrtab.h buildtools/trunk/gcc/gcc/genautomata.c buildtools/trunk/gcc/gcc/gencheck.c buildtools/trunk/gcc/gcc/gencodes.c buildtools/trunk/gcc/gcc/genconditions.c buildtools/trunk/gcc/gcc/genconfig.c buildtools/trunk/gcc/gcc/genconstants.c buildtools/trunk/gcc/gcc/genemit.c buildtools/trunk/gcc/gcc/genextract.c buildtools/trunk/gcc/gcc/genflags.c buildtools/trunk/gcc/gcc/gengenrtl.c buildtools/trunk/gcc/gcc/gengtype-lex.c buildtools/trunk/gcc/gcc/gengtype-lex.l buildtools/trunk/gcc/gcc/gengtype-yacc.y buildtools/trunk/gcc/gcc/gengtype.c buildtools/trunk/gcc/gcc/gengtype.h buildtools/trunk/gcc/gcc/genmddeps.c buildtools/trunk/gcc/gcc/genmodes.c buildtools/trunk/gcc/gcc/genmultilib buildtools/trunk/gcc/gcc/genopinit.c buildtools/trunk/gcc/gcc/genoutput.c buildtools/trunk/gcc/gcc/genpeep.c buildtools/trunk/gcc/gcc/genpreds.c buildtools/trunk/gcc/gcc/genrecog.c buildtools/trunk/gcc/gcc/gensupport.c buildtools/trunk/gcc/gcc/gensupport.h buildtools/trunk/gcc/gcc/ggc-common.c buildtools/trunk/gcc/gcc/ggc-none.c buildtools/trunk/gcc/gcc/ggc-page.c buildtools/trunk/gcc/gcc/ggc-zone.c buildtools/trunk/gcc/gcc/ggc.h buildtools/trunk/gcc/gcc/gimple-low.c buildtools/trunk/gcc/gcc/gimplify.c buildtools/trunk/gcc/gcc/ginclude/float.h buildtools/trunk/gcc/gcc/ginclude/iso646.h buildtools/trunk/gcc/gcc/ginclude/stdarg.h buildtools/trunk/gcc/gcc/ginclude/stdbool.h buildtools/trunk/gcc/gcc/ginclude/stddef.h buildtools/trunk/gcc/gcc/global.c buildtools/trunk/gcc/gcc/graph.c buildtools/trunk/gcc/gcc/graph.h buildtools/trunk/gcc/gcc/gthr-aix.h buildtools/trunk/gcc/gcc/gthr-dce.h buildtools/trunk/gcc/gcc/gthr-gnat.c buildtools/trunk/gcc/gcc/gthr-gnat.h buildtools/trunk/gcc/gcc/gthr-lynx.h buildtools/trunk/gcc/gcc/gthr-nks.h buildtools/trunk/gcc/gcc/gthr-posix.c buildtools/trunk/gcc/gcc/gthr-posix.h buildtools/trunk/gcc/gcc/gthr-posix95.h buildtools/trunk/gcc/gcc/gthr-rtems.h buildtools/trunk/gcc/gcc/gthr-single.h buildtools/trunk/gcc/gcc/gthr-solaris.h buildtools/trunk/gcc/gcc/gthr-tpf.h buildtools/trunk/gcc/gcc/gthr-vxworks.h buildtools/trunk/gcc/gcc/gthr-win32.h buildtools/trunk/gcc/gcc/gthr.h buildtools/trunk/gcc/gcc/haifa-sched.c buildtools/trunk/gcc/gcc/hard-reg-set.h buildtools/trunk/gcc/gcc/hooks.c buildtools/trunk/gcc/gcc/hooks.h buildtools/trunk/gcc/gcc/host-default.c buildtools/trunk/gcc/gcc/hosthooks-def.h buildtools/trunk/gcc/gcc/hosthooks.h buildtools/trunk/gcc/gcc/hwint.h buildtools/trunk/gcc/gcc/ifcvt.c buildtools/trunk/gcc/gcc/input.h buildtools/trunk/gcc/gcc/insn-addr.h buildtools/trunk/gcc/gcc/insn-notes.def buildtools/trunk/gcc/gcc/integrate.c buildtools/trunk/gcc/gcc/integrate.h buildtools/trunk/gcc/gcc/intl.c buildtools/trunk/gcc/gcc/intl.h buildtools/trunk/gcc/gcc/jump.c buildtools/trunk/gcc/gcc/lambda-code.c buildtools/trunk/gcc/gcc/lambda-mat.c buildtools/trunk/gcc/gcc/lambda-trans.c buildtools/trunk/gcc/gcc/lambda.h buildtools/trunk/gcc/gcc/langhooks-def.h buildtools/trunk/gcc/gcc/langhooks.c buildtools/trunk/gcc/gcc/langhooks.h buildtools/trunk/gcc/gcc/lcm.c buildtools/trunk/gcc/gcc/libada-mk.in buildtools/trunk/gcc/gcc/libfuncs.h buildtools/trunk/gcc/gcc/libgcc-std.ver buildtools/trunk/gcc/gcc/libgcc2.c buildtools/trunk/gcc/gcc/libgcc2.h buildtools/trunk/gcc/gcc/libgcov.c buildtools/trunk/gcc/gcc/lists.c buildtools/trunk/gcc/gcc/local-alloc.c buildtools/trunk/gcc/gcc/longlong.h buildtools/trunk/gcc/gcc/loop-doloop.c buildtools/trunk/gcc/gcc/loop-init.c buildtools/trunk/gcc/gcc/loop-invariant.c buildtools/trunk/gcc/gcc/loop-iv.c buildtools/trunk/gcc/gcc/loop-unroll.c buildtools/trunk/gcc/gcc/loop-unswitch.c buildtools/trunk/gcc/gcc/loop.c buildtools/trunk/gcc/gcc/machmode.def buildtools/trunk/gcc/gcc/machmode.h buildtools/trunk/gcc/gcc/main.c buildtools/trunk/gcc/gcc/mips-tdump.c buildtools/trunk/gcc/gcc/mips-tfile.c buildtools/trunk/gcc/gcc/mkconfig.sh buildtools/trunk/gcc/gcc/mklibgcc.in buildtools/trunk/gcc/gcc/mkmap-flat.awk buildtools/trunk/gcc/gcc/mkmap-symver.awk buildtools/trunk/gcc/gcc/mode-classes.def buildtools/trunk/gcc/gcc/modulo-sched.c buildtools/trunk/gcc/gcc/opt-functions.awk buildtools/trunk/gcc/gcc/opt-gather.awk buildtools/trunk/gcc/gcc/optabs.c buildtools/trunk/gcc/gcc/optabs.h buildtools/trunk/gcc/gcc/optc-gen.awk buildtools/trunk/gcc/gcc/opth-gen.awk buildtools/trunk/gcc/gcc/opts.c buildtools/trunk/gcc/gcc/opts.h buildtools/trunk/gcc/gcc/output.h buildtools/trunk/gcc/gcc/params.c buildtools/trunk/gcc/gcc/params.def buildtools/trunk/gcc/gcc/params.h buildtools/trunk/gcc/gcc/passes.c buildtools/trunk/gcc/gcc/po/ChangeLog buildtools/trunk/gcc/gcc/po/be.gmo buildtools/trunk/gcc/gcc/po/be.po buildtools/trunk/gcc/gcc/po/ca.gmo buildtools/trunk/gcc/gcc/po/ca.po buildtools/trunk/gcc/gcc/po/da.gmo buildtools/trunk/gcc/gcc/po/da.po buildtools/trunk/gcc/gcc/po/de.gmo buildtools/trunk/gcc/gcc/po/de.po buildtools/trunk/gcc/gcc/po/el.gmo buildtools/trunk/gcc/gcc/po/el.po buildtools/trunk/gcc/gcc/po/es.gmo buildtools/trunk/gcc/gcc/po/es.po buildtools/trunk/gcc/gcc/po/exgettext buildtools/trunk/gcc/gcc/po/fr.gmo buildtools/trunk/gcc/gcc/po/fr.po buildtools/trunk/gcc/gcc/po/gcc.pot buildtools/trunk/gcc/gcc/po/ja.gmo buildtools/trunk/gcc/gcc/po/ja.po buildtools/trunk/gcc/gcc/po/nl.gmo buildtools/trunk/gcc/gcc/po/nl.po buildtools/trunk/gcc/gcc/po/rw.gmo buildtools/trunk/gcc/gcc/po/rw.po buildtools/trunk/gcc/gcc/po/sv.gmo buildtools/trunk/gcc/gcc/po/sv.po buildtools/trunk/gcc/gcc/po/tr.gmo buildtools/trunk/gcc/gcc/po/tr.po buildtools/trunk/gcc/gcc/po/zh_CN.gmo buildtools/trunk/gcc/gcc/po/zh_CN.po buildtools/trunk/gcc/gcc/pointer-set.c buildtools/trunk/gcc/gcc/pointer-set.h buildtools/trunk/gcc/gcc/postreload-gcse.c buildtools/trunk/gcc/gcc/postreload.c buildtools/trunk/gcc/gcc/predict.c buildtools/trunk/gcc/gcc/predict.def buildtools/trunk/gcc/gcc/predict.h buildtools/trunk/gcc/gcc/prefix.c buildtools/trunk/gcc/gcc/prefix.h buildtools/trunk/gcc/gcc/pretty-print.c buildtools/trunk/gcc/gcc/pretty-print.h buildtools/trunk/gcc/gcc/print-rtl.c buildtools/trunk/gcc/gcc/print-tree.c buildtools/trunk/gcc/gcc/profile.c buildtools/trunk/gcc/gcc/protoize.c buildtools/trunk/gcc/gcc/read-rtl.c buildtools/trunk/gcc/gcc/real.c buildtools/trunk/gcc/gcc/real.h buildtools/trunk/gcc/gcc/recog.c buildtools/trunk/gcc/gcc/recog.h buildtools/trunk/gcc/gcc/reg-notes.def buildtools/trunk/gcc/gcc/reg-stack.c buildtools/trunk/gcc/gcc/regclass.c buildtools/trunk/gcc/gcc/regmove.c buildtools/trunk/gcc/gcc/regrename.c buildtools/trunk/gcc/gcc/regs.h buildtools/trunk/gcc/gcc/reload.c buildtools/trunk/gcc/gcc/reload.h buildtools/trunk/gcc/gcc/reload1.c buildtools/trunk/gcc/gcc/reorg.c buildtools/trunk/gcc/gcc/resource.c buildtools/trunk/gcc/gcc/resource.h buildtools/trunk/gcc/gcc/rtl-error.c buildtools/trunk/gcc/gcc/rtl-profile.c buildtools/trunk/gcc/gcc/rtl.c buildtools/trunk/gcc/gcc/rtl.def buildtools/trunk/gcc/gcc/rtl.h buildtools/trunk/gcc/gcc/rtlanal.c buildtools/trunk/gcc/gcc/rtlhooks-def.h buildtools/trunk/gcc/gcc/rtlhooks.c buildtools/trunk/gcc/gcc/sbitmap.c buildtools/trunk/gcc/gcc/sbitmap.h buildtools/trunk/gcc/gcc/scan-decls.c buildtools/trunk/gcc/gcc/scan-types.sh buildtools/trunk/gcc/gcc/scan.c buildtools/trunk/gcc/gcc/scan.h buildtools/trunk/gcc/gcc/sched-deps.c buildtools/trunk/gcc/gcc/sched-ebb.c buildtools/trunk/gcc/gcc/sched-int.h buildtools/trunk/gcc/gcc/sched-rgn.c buildtools/trunk/gcc/gcc/sched-vis.c buildtools/trunk/gcc/gcc/sdbout.c buildtools/trunk/gcc/gcc/sdbout.h buildtools/trunk/gcc/gcc/simplify-rtx.c buildtools/trunk/gcc/gcc/sort-protos buildtools/trunk/gcc/gcc/sreal.c buildtools/trunk/gcc/gcc/sreal.h buildtools/trunk/gcc/gcc/stab.def buildtools/trunk/gcc/gcc/statistics.h buildtools/trunk/gcc/gcc/stmt.c buildtools/trunk/gcc/gcc/stor-layout.c buildtools/trunk/gcc/gcc/stringpool.c buildtools/trunk/gcc/gcc/stub-objc.c buildtools/trunk/gcc/gcc/system.h buildtools/trunk/gcc/gcc/target-def.h buildtools/trunk/gcc/gcc/target.h buildtools/trunk/gcc/gcc/targhooks.c buildtools/trunk/gcc/gcc/targhooks.h buildtools/trunk/gcc/gcc/timevar.c buildtools/trunk/gcc/gcc/timevar.def buildtools/trunk/gcc/gcc/timevar.h buildtools/trunk/gcc/gcc/tlink.c buildtools/trunk/gcc/gcc/toplev.c buildtools/trunk/gcc/gcc/toplev.h buildtools/trunk/gcc/gcc/tracer.c buildtools/trunk/gcc/gcc/tree-browser.c buildtools/trunk/gcc/gcc/tree-browser.def buildtools/trunk/gcc/gcc/tree-cfg.c buildtools/trunk/gcc/gcc/tree-chrec.c buildtools/trunk/gcc/gcc/tree-chrec.h buildtools/trunk/gcc/gcc/tree-complex.c buildtools/trunk/gcc/gcc/tree-data-ref.c buildtools/trunk/gcc/gcc/tree-data-ref.h buildtools/trunk/gcc/gcc/tree-dfa.c buildtools/trunk/gcc/gcc/tree-dump.c buildtools/trunk/gcc/gcc/tree-dump.h buildtools/trunk/gcc/gcc/tree-eh.c buildtools/trunk/gcc/gcc/tree-flow-inline.h buildtools/trunk/gcc/gcc/tree-flow.h buildtools/trunk/gcc/gcc/tree-gimple.c buildtools/trunk/gcc/gcc/tree-gimple.h buildtools/trunk/gcc/gcc/tree-if-conv.c buildtools/trunk/gcc/gcc/tree-inline.c buildtools/trunk/gcc/gcc/tree-inline.h buildtools/trunk/gcc/gcc/tree-into-ssa.c buildtools/trunk/gcc/gcc/tree-iterator.c buildtools/trunk/gcc/gcc/tree-iterator.h buildtools/trunk/gcc/gcc/tree-loop-linear.c buildtools/trunk/gcc/gcc/tree-mudflap.c buildtools/trunk/gcc/gcc/tree-mudflap.h buildtools/trunk/gcc/gcc/tree-nested.c buildtools/trunk/gcc/gcc/tree-nomudflap.c buildtools/trunk/gcc/gcc/tree-nrv.c buildtools/trunk/gcc/gcc/tree-optimize.c buildtools/trunk/gcc/gcc/tree-outof-ssa.c buildtools/trunk/gcc/gcc/tree-pass.h buildtools/trunk/gcc/gcc/tree-phinodes.c buildtools/trunk/gcc/gcc/tree-pretty-print.c buildtools/trunk/gcc/gcc/tree-profile.c buildtools/trunk/gcc/gcc/tree-scalar-evolution.c buildtools/trunk/gcc/gcc/tree-scalar-evolution.h buildtools/trunk/gcc/gcc/tree-sra.c buildtools/trunk/gcc/gcc/tree-ssa-alias.c buildtools/trunk/gcc/gcc/tree-ssa-ccp.c buildtools/trunk/gcc/gcc/tree-ssa-copy.c buildtools/trunk/gcc/gcc/tree-ssa-copyrename.c buildtools/trunk/gcc/gcc/tree-ssa-dce.c buildtools/trunk/gcc/gcc/tree-ssa-dom.c buildtools/trunk/gcc/gcc/tree-ssa-dse.c buildtools/trunk/gcc/gcc/tree-ssa-forwprop.c buildtools/trunk/gcc/gcc/tree-ssa-live.c buildtools/trunk/gcc/gcc/tree-ssa-live.h buildtools/trunk/gcc/gcc/tree-ssa-loop-ch.c buildtools/trunk/gcc/gcc/tree-ssa-loop-im.c buildtools/trunk/gcc/gcc/tree-ssa-loop-ivcanon.c buildtools/trunk/gcc/gcc/tree-ssa-loop-ivopts.c buildtools/trunk/gcc/gcc/tree-ssa-loop-manip.c buildtools/trunk/gcc/gcc/tree-ssa-loop-niter.c buildtools/trunk/gcc/gcc/tree-ssa-loop-unswitch.c buildtools/trunk/gcc/gcc/tree-ssa-loop.c buildtools/trunk/gcc/gcc/tree-ssa-operands.c buildtools/trunk/gcc/gcc/tree-ssa-operands.h buildtools/trunk/gcc/gcc/tree-ssa-phiopt.c buildtools/trunk/gcc/gcc/tree-ssa-pre.c buildtools/trunk/gcc/gcc/tree-ssa-propagate.c buildtools/trunk/gcc/gcc/tree-ssa-propagate.h buildtools/trunk/gcc/gcc/tree-ssa-threadupdate.c buildtools/trunk/gcc/gcc/tree-ssa.c buildtools/trunk/gcc/gcc/tree-ssanames.c buildtools/trunk/gcc/gcc/tree-tailcall.c buildtools/trunk/gcc/gcc/tree-vect-analyze.c buildtools/trunk/gcc/gcc/tree-vect-transform.c buildtools/trunk/gcc/gcc/tree-vectorizer.c buildtools/trunk/gcc/gcc/tree-vectorizer.h buildtools/trunk/gcc/gcc/tree-vn.c buildtools/trunk/gcc/gcc/tree.c buildtools/trunk/gcc/gcc/tree.def buildtools/trunk/gcc/gcc/tree.h buildtools/trunk/gcc/gcc/treelang/ChangeLog buildtools/trunk/gcc/gcc/treelang/Make-lang.in buildtools/trunk/gcc/gcc/treelang/config-lang.in buildtools/trunk/gcc/gcc/treelang/lang-specs.h buildtools/trunk/gcc/gcc/treelang/lang.opt buildtools/trunk/gcc/gcc/treelang/lex.l buildtools/trunk/gcc/gcc/treelang/parse.y buildtools/trunk/gcc/gcc/treelang/spec.c buildtools/trunk/gcc/gcc/treelang/tree-convert.c buildtools/trunk/gcc/gcc/treelang/tree1.c buildtools/trunk/gcc/gcc/treelang/treelang.h buildtools/trunk/gcc/gcc/treelang/treelang.texi buildtools/trunk/gcc/gcc/treelang/treetree.c buildtools/trunk/gcc/gcc/treelang/treetree.h buildtools/trunk/gcc/gcc/tsystem.h buildtools/trunk/gcc/gcc/typeclass.h buildtools/trunk/gcc/gcc/unwind-c.c buildtools/trunk/gcc/gcc/unwind-compat.c buildtools/trunk/gcc/gcc/unwind-compat.h buildtools/trunk/gcc/gcc/unwind-dw2-fde-compat.c buildtools/trunk/gcc/gcc/unwind-dw2-fde-darwin.c buildtools/trunk/gcc/gcc/unwind-dw2-fde-glibc.c buildtools/trunk/gcc/gcc/unwind-dw2-fde.c buildtools/trunk/gcc/gcc/unwind-dw2-fde.h buildtools/trunk/gcc/gcc/unwind-dw2.c buildtools/trunk/gcc/gcc/unwind-dw2.h buildtools/trunk/gcc/gcc/unwind-pe.h buildtools/trunk/gcc/gcc/unwind-sjlj.c buildtools/trunk/gcc/gcc/unwind.inc buildtools/trunk/gcc/gcc/value-prof.c buildtools/trunk/gcc/gcc/value-prof.h buildtools/trunk/gcc/gcc/var-tracking.c buildtools/trunk/gcc/gcc/varasm.c buildtools/trunk/gcc/gcc/varray.c buildtools/trunk/gcc/gcc/varray.h buildtools/trunk/gcc/gcc/vec.c buildtools/trunk/gcc/gcc/vec.h buildtools/trunk/gcc/gcc/version.c buildtools/trunk/gcc/gcc/vmsdbg.h buildtools/trunk/gcc/gcc/vmsdbgout.c buildtools/trunk/gcc/gcc/web.c buildtools/trunk/gcc/gcc/xcoffout.c buildtools/trunk/gcc/gcc/xcoffout.h buildtools/trunk/gcc/include/COPYING buildtools/trunk/gcc/include/ChangeLog buildtools/trunk/gcc/include/ChangeLog-9103 buildtools/trunk/gcc/include/ansidecl.h buildtools/trunk/gcc/include/demangle.h buildtools/trunk/gcc/include/dyn-string.h buildtools/trunk/gcc/include/fibheap.h buildtools/trunk/gcc/include/filenames.h buildtools/trunk/gcc/include/floatformat.h buildtools/trunk/gcc/include/fnmatch.h buildtools/trunk/gcc/include/getopt.h buildtools/trunk/gcc/include/hashtab.h buildtools/trunk/gcc/include/libiberty.h buildtools/trunk/gcc/include/md5.h buildtools/trunk/gcc/include/objalloc.h buildtools/trunk/gcc/include/obstack.h buildtools/trunk/gcc/include/partition.h buildtools/trunk/gcc/include/safe-ctype.h buildtools/trunk/gcc/include/sort.h buildtools/trunk/gcc/include/splay-tree.h buildtools/trunk/gcc/include/symcat.h buildtools/trunk/gcc/include/ternary.h buildtools/trunk/gcc/include/xregex2.h buildtools/trunk/gcc/include/xtensa-config.h buildtools/trunk/gcc/install-sh buildtools/trunk/gcc/intl/ChangeLog buildtools/trunk/gcc/intl/Makefile.in buildtools/trunk/gcc/intl/bindtextdom.c buildtools/trunk/gcc/intl/configure buildtools/trunk/gcc/intl/dcgettext.c buildtools/trunk/gcc/intl/dcigettext.c buildtools/trunk/gcc/intl/dcngettext.c buildtools/trunk/gcc/intl/dgettext.c buildtools/trunk/gcc/intl/dngettext.c buildtools/trunk/gcc/intl/eval-plural.h buildtools/trunk/gcc/intl/explodename.c buildtools/trunk/gcc/intl/finddomain.c buildtools/trunk/gcc/intl/gettext.c buildtools/trunk/gcc/intl/gettextP.h buildtools/trunk/gcc/intl/gmo.h buildtools/trunk/gcc/intl/hash-string.h buildtools/trunk/gcc/intl/intl-compat.c buildtools/trunk/gcc/intl/l10nflist.c buildtools/trunk/gcc/intl/libgnuintl.h buildtools/trunk/gcc/intl/loadinfo.h buildtools/trunk/gcc/intl/loadmsgcat.c buildtools/trunk/gcc/intl/localcharset.c buildtools/trunk/gcc/intl/localcharset.h buildtools/trunk/gcc/intl/locale.alias buildtools/trunk/gcc/intl/localealias.c buildtools/trunk/gcc/intl/localename.c buildtools/trunk/gcc/intl/log.c buildtools/trunk/gcc/intl/ngettext.c buildtools/trunk/gcc/intl/osdep.c buildtools/trunk/gcc/intl/plural-exp.c buildtools/trunk/gcc/intl/plural-exp.h buildtools/trunk/gcc/intl/plural.c buildtools/trunk/gcc/intl/plural.y buildtools/trunk/gcc/intl/relocatable.c buildtools/trunk/gcc/intl/relocatable.h buildtools/trunk/gcc/intl/textdomain.c buildtools/trunk/gcc/libcpp/ChangeLog buildtools/trunk/gcc/libcpp/Makefile.in buildtools/trunk/gcc/libcpp/aclocal.m4 buildtools/trunk/gcc/libcpp/charset.c buildtools/trunk/gcc/libcpp/config.in buildtools/trunk/gcc/libcpp/configure buildtools/trunk/gcc/libcpp/configure.ac buildtools/trunk/gcc/libcpp/directives.c buildtools/trunk/gcc/libcpp/errors.c buildtools/trunk/gcc/libcpp/expr.c buildtools/trunk/gcc/libcpp/files.c buildtools/trunk/gcc/libcpp/identifiers.c buildtools/trunk/gcc/libcpp/include/cpp-id-data.h buildtools/trunk/gcc/libcpp/include/cpplib.h buildtools/trunk/gcc/libcpp/include/line-map.h buildtools/trunk/gcc/libcpp/include/mkdeps.h buildtools/trunk/gcc/libcpp/include/symtab.h buildtools/trunk/gcc/libcpp/init.c buildtools/trunk/gcc/libcpp/internal.h buildtools/trunk/gcc/libcpp/lex.c buildtools/trunk/gcc/libcpp/line-map.c buildtools/trunk/gcc/libcpp/macro.c buildtools/trunk/gcc/libcpp/makedepend.c buildtools/trunk/gcc/libcpp/mkdeps.c buildtools/trunk/gcc/libcpp/pch.c buildtools/trunk/gcc/libcpp/po/ChangeLog buildtools/trunk/gcc/libcpp/po/be.gmo buildtools/trunk/gcc/libcpp/po/be.po buildtools/trunk/gcc/libcpp/po/ca.gmo buildtools/trunk/gcc/libcpp/po/ca.po buildtools/trunk/gcc/libcpp/po/cpplib.pot buildtools/trunk/gcc/libcpp/po/da.gmo buildtools/trunk/gcc/libcpp/po/da.po buildtools/trunk/gcc/libcpp/po/de.gmo buildtools/trunk/gcc/libcpp/po/de.po buildtools/trunk/gcc/libcpp/po/el.gmo buildtools/trunk/gcc/libcpp/po/el.po buildtools/trunk/gcc/libcpp/po/es.gmo buildtools/trunk/gcc/libcpp/po/es.po buildtools/trunk/gcc/libcpp/po/fr.gmo buildtools/trunk/gcc/libcpp/po/fr.po buildtools/trunk/gcc/libcpp/po/ja.gmo buildtools/trunk/gcc/libcpp/po/ja.po buildtools/trunk/gcc/libcpp/po/nl.gmo buildtools/trunk/gcc/libcpp/po/nl.po buildtools/trunk/gcc/libcpp/po/rw.gmo buildtools/trunk/gcc/libcpp/po/rw.po buildtools/trunk/gcc/libcpp/po/sv.gmo buildtools/trunk/gcc/libcpp/po/sv.po buildtools/trunk/gcc/libcpp/po/tr.gmo buildtools/trunk/gcc/libcpp/po/tr.po buildtools/trunk/gcc/libcpp/po/vi.gmo buildtools/trunk/gcc/libcpp/po/vi.po buildtools/trunk/gcc/libcpp/symtab.c buildtools/trunk/gcc/libcpp/system.h buildtools/trunk/gcc/libcpp/traditional.c buildtools/trunk/gcc/libcpp/ucnid.h buildtools/trunk/gcc/libcpp/ucnid.tab buildtools/trunk/gcc/libiberty/COPYING.LIB buildtools/trunk/gcc/libiberty/ChangeLog buildtools/trunk/gcc/libiberty/Makefile.in buildtools/trunk/gcc/libiberty/_doprnt.c buildtools/trunk/gcc/libiberty/aclocal.m4 buildtools/trunk/gcc/libiberty/alloca.c buildtools/trunk/gcc/libiberty/argv.c buildtools/trunk/gcc/libiberty/asprintf.c buildtools/trunk/gcc/libiberty/atexit.c buildtools/trunk/gcc/libiberty/basename.c buildtools/trunk/gcc/libiberty/bcmp.c buildtools/trunk/gcc/libiberty/bcopy.c buildtools/trunk/gcc/libiberty/bsearch.c buildtools/trunk/gcc/libiberty/bzero.c buildtools/trunk/gcc/libiberty/calloc.c buildtools/trunk/gcc/libiberty/choose-temp.c buildtools/trunk/gcc/libiberty/clock.c buildtools/trunk/gcc/libiberty/concat.c buildtools/trunk/gcc/libiberty/config.in buildtools/trunk/gcc/libiberty/configure buildtools/trunk/gcc/libiberty/configure.ac buildtools/trunk/gcc/libiberty/copying-lib.texi buildtools/trunk/gcc/libiberty/copysign.c buildtools/trunk/gcc/libiberty/cp-demangle.c buildtools/trunk/gcc/libiberty/cp-demangle.h buildtools/trunk/gcc/libiberty/cp-demint.c buildtools/trunk/gcc/libiberty/cplus-dem.c buildtools/trunk/gcc/libiberty/dyn-string.c buildtools/trunk/gcc/libiberty/fdmatch.c buildtools/trunk/gcc/libiberty/ffs.c buildtools/trunk/gcc/libiberty/fibheap.c buildtools/trunk/gcc/libiberty/floatformat.c buildtools/trunk/gcc/libiberty/fnmatch.c buildtools/trunk/gcc/libiberty/fopen_unlocked.c buildtools/trunk/gcc/libiberty/functions.texi buildtools/trunk/gcc/libiberty/gather-docs buildtools/trunk/gcc/libiberty/getcwd.c buildtools/trunk/gcc/libiberty/getopt.c buildtools/trunk/gcc/libiberty/getopt1.c buildtools/trunk/gcc/libiberty/getpagesize.c buildtools/trunk/gcc/libiberty/getpwd.c buildtools/trunk/gcc/libiberty/getruntime.c buildtools/trunk/gcc/libiberty/hashtab.c buildtools/trunk/gcc/libiberty/hex.c buildtools/trunk/gcc/libiberty/index.c buildtools/trunk/gcc/libiberty/insque.c buildtools/trunk/gcc/libiberty/lbasename.c buildtools/trunk/gcc/libiberty/lrealpath.c buildtools/trunk/gcc/libiberty/maint-tool buildtools/trunk/gcc/libiberty/make-relative-prefix.c buildtools/trunk/gcc/libiberty/make-temp-file.c buildtools/trunk/gcc/libiberty/md5.c buildtools/trunk/gcc/libiberty/memchr.c buildtools/trunk/gcc/libiberty/memcmp.c buildtools/trunk/gcc/libiberty/memcpy.c buildtools/trunk/gcc/libiberty/memmove.c buildtools/trunk/gcc/libiberty/mempcpy.c buildtools/trunk/gcc/libiberty/memset.c buildtools/trunk/gcc/libiberty/mkstemps.c buildtools/trunk/gcc/libiberty/objalloc.c buildtools/trunk/gcc/libiberty/obstack.c buildtools/trunk/gcc/libiberty/partition.c buildtools/trunk/gcc/libiberty/pex-common.h buildtools/trunk/gcc/libiberty/pex-djgpp.c buildtools/trunk/gcc/libiberty/pex-msdos.c buildtools/trunk/gcc/libiberty/pex-unix.c buildtools/trunk/gcc/libiberty/pex-win32.c buildtools/trunk/gcc/libiberty/pexecute.txh buildtools/trunk/gcc/libiberty/physmem.c buildtools/trunk/gcc/libiberty/putenv.c buildtools/trunk/gcc/libiberty/random.c buildtools/trunk/gcc/libiberty/regex.c buildtools/trunk/gcc/libiberty/rename.c buildtools/trunk/gcc/libiberty/rindex.c buildtools/trunk/gcc/libiberty/safe-ctype.c buildtools/trunk/gcc/libiberty/setenv.c buildtools/trunk/gcc/libiberty/sigsetmask.c buildtools/trunk/gcc/libiberty/snprintf.c buildtools/trunk/gcc/libiberty/sort.c buildtools/trunk/gcc/libiberty/spaces.c buildtools/trunk/gcc/libiberty/splay-tree.c buildtools/trunk/gcc/libiberty/stpcpy.c buildtools/trunk/gcc/libiberty/stpncpy.c buildtools/trunk/gcc/libiberty/strcasecmp.c buildtools/trunk/gcc/libiberty/strchr.c buildtools/trunk/gcc/libiberty/strdup.c buildtools/trunk/gcc/libiberty/strerror.c buildtools/trunk/gcc/libiberty/strncasecmp.c buildtools/trunk/gcc/libiberty/strncmp.c buildtools/trunk/gcc/libiberty/strrchr.c buildtools/trunk/gcc/libiberty/strsignal.c buildtools/trunk/gcc/libiberty/strstr.c buildtools/trunk/gcc/libiberty/strtod.c buildtools/trunk/gcc/libiberty/strtol.c buildtools/trunk/gcc/libiberty/strtoul.c buildtools/trunk/gcc/libiberty/ternary.c buildtools/trunk/gcc/libiberty/testsuite/Makefile.in buildtools/trunk/gcc/libiberty/testsuite/demangle-expected buildtools/trunk/gcc/libiberty/testsuite/test-demangle.c buildtools/trunk/gcc/libiberty/tmpnam.c buildtools/trunk/gcc/libiberty/vasprintf.c buildtools/trunk/gcc/libiberty/vfork.c buildtools/trunk/gcc/libiberty/vfprintf.c buildtools/trunk/gcc/libiberty/vprintf.c buildtools/trunk/gcc/libiberty/vsnprintf.c buildtools/trunk/gcc/libiberty/vsprintf.c buildtools/trunk/gcc/libiberty/waitpid.c buildtools/trunk/gcc/libiberty/xatexit.c buildtools/trunk/gcc/libiberty/xexit.c buildtools/trunk/gcc/libiberty/xmalloc.c buildtools/trunk/gcc/libiberty/xmemdup.c buildtools/trunk/gcc/libiberty/xstrdup.c buildtools/trunk/gcc/libiberty/xstrerror.c buildtools/trunk/gcc/libmudflap/ChangeLog buildtools/trunk/gcc/libmudflap/Makefile.am buildtools/trunk/gcc/libmudflap/Makefile.in buildtools/trunk/gcc/libmudflap/aclocal.m4 buildtools/trunk/gcc/libmudflap/config.h.in buildtools/trunk/gcc/libmudflap/configure buildtools/trunk/gcc/libmudflap/configure.ac buildtools/trunk/gcc/libmudflap/mf-heuristics.c buildtools/trunk/gcc/libmudflap/mf-hooks1.c buildtools/trunk/gcc/libmudflap/mf-hooks2.c buildtools/trunk/gcc/libmudflap/mf-hooks3.c buildtools/trunk/gcc/libmudflap/mf-impl.h buildtools/trunk/gcc/libmudflap/mf-runtime.c buildtools/trunk/gcc/libmudflap/mf-runtime.h buildtools/trunk/gcc/libmudflap/testsuite/Makefile.in buildtools/trunk/gcc/libmudflap/testsuite/lib/libmudflap.exp buildtools/trunk/gcc/libmudflap/testsuite/lib/mfdg.exp buildtools/trunk/gcc/libmudflap/testsuite/libmudflap.c++/c++frags.exp buildtools/trunk/gcc/libmudflap/testsuite/libmudflap.c++/ctors.exp buildtools/trunk/gcc/libmudflap/testsuite/libmudflap.c/cfrags.exp buildtools/trunk/gcc/libmudflap/testsuite/libmudflap.c/pass-stratcliff.c buildtools/trunk/gcc/libmudflap/testsuite/libmudflap.cth/pass37-frag.c buildtools/trunk/gcc/libmudflap/testsuite/libmudflap.cth/pass39-frag.c buildtools/trunk/gcc/libstdc++-v3/ChangeLog buildtools/trunk/gcc/libstdc++-v3/ChangeLog-2000 buildtools/trunk/gcc/libstdc++-v3/Makefile.am buildtools/trunk/gcc/libstdc++-v3/Makefile.in buildtools/trunk/gcc/libstdc++-v3/acinclude.m4 buildtools/trunk/gcc/libstdc++-v3/aclocal.m4 buildtools/trunk/gcc/libstdc++-v3/config.h.in buildtools/trunk/gcc/libstdc++-v3/config/abi/compatibility.h buildtools/trunk/gcc/libstdc++-v3/config/allocator/bitmap_allocator_base.h buildtools/trunk/gcc/libstdc++-v3/config/allocator/malloc_allocator_base.h buildtools/trunk/gcc/libstdc++-v3/config/allocator/mt_allocator_base.h buildtools/trunk/gcc/libstdc++-v3/config/allocator/new_allocator_base.h buildtools/trunk/gcc/libstdc++-v3/config/allocator/pool_allocator_base.h buildtools/trunk/gcc/libstdc++-v3/config/cpu/alpha/atomic_word.h buildtools/trunk/gcc/libstdc++-v3/config/cpu/alpha/atomicity.h buildtools/trunk/gcc/libstdc++-v3/config/cpu/arm/cxxabi_tweaks.h buildtools/trunk/gcc/libstdc++-v3/config/cpu/cris/atomic_word.h buildtools/trunk/gcc/libstdc++-v3/config/cpu/cris/atomicity.h buildtools/trunk/gcc/libstdc++-v3/config/cpu/generic/atomic_word.h buildtools/trunk/gcc/libstdc++-v3/config/cpu/generic/atomicity.h buildtools/trunk/gcc/libstdc++-v3/config/cpu/generic/cxxabi_tweaks.h buildtools/trunk/gcc/libstdc++-v3/config/cpu/hppa/atomicity.h buildtools/trunk/gcc/libstdc++-v3/config/cpu/i386/atomicity.h buildtools/trunk/gcc/libstdc++-v3/config/cpu/i486/atomicity.h buildtools/trunk/gcc/libstdc++-v3/config/cpu/ia64/atomic_word.h buildtools/trunk/gcc/libstdc++-v3/config/cpu/ia64/atomicity.h buildtools/trunk/gcc/libstdc++-v3/config/cpu/m68k/atomicity.h buildtools/trunk/gcc/libstdc++-v3/config/cpu/mips/atomicity.h buildtools/trunk/gcc/libstdc++-v3/config/cpu/powerpc/atomic_word.h buildtools/trunk/gcc/libstdc++-v3/config/cpu/powerpc/atomicity.h buildtools/trunk/gcc/libstdc++-v3/config/cpu/s390/atomicity.h buildtools/trunk/gcc/libstdc++-v3/config/cpu/sh/atomicity.h buildtools/trunk/gcc/libstdc++-v3/config/cpu/sparc/atomic_word.h buildtools/trunk/gcc/libstdc++-v3/config/cpu/sparc/atomicity.h buildtools/trunk/gcc/libstdc++-v3/config/io/basic_file_stdio.cc buildtools/trunk/gcc/libstdc++-v3/config/io/basic_file_stdio.h buildtools/trunk/gcc/libstdc++-v3/config/io/c_io_stdio.h buildtools/trunk/gcc/libstdc++-v3/config/linker-map.gnu buildtools/trunk/gcc/libstdc++-v3/config/locale/darwin/ctype_members.cc buildtools/trunk/gcc/libstdc++-v3/config/locale/generic/c++locale_internal.h buildtools/trunk/gcc/libstdc++-v3/config/locale/generic/c_locale.cc buildtools/trunk/gcc/libstdc++-v3/config/locale/generic/c_locale.h buildtools/trunk/gcc/libstdc++-v3/config/locale/generic/codecvt_members.cc buildtools/trunk/gcc/libstdc++-v3/config/locale/generic/collate_members.cc buildtools/trunk/gcc/libstdc++-v3/config/locale/generic/ctype_members.cc buildtools/trunk/gcc/libstdc++-v3/config/locale/generic/messages_members.cc buildtools/trunk/gcc/libstdc++-v3/config/locale/generic/messages_members.h buildtools/trunk/gcc/libstdc++-v3/config/locale/generic/monetary_members.cc buildtools/trunk/gcc/libstdc++-v3/config/locale/generic/numeric_members.cc buildtools/trunk/gcc/libstdc++-v3/config/locale/generic/time_members.cc buildtools/trunk/gcc/libstdc++-v3/config/locale/generic/time_members.h buildtools/trunk/gcc/libstdc++-v3/config/locale/gnu/c++locale_internal.h buildtools/trunk/gcc/libstdc++-v3/config/locale/gnu/c_locale.cc buildtools/trunk/gcc/libstdc++-v3/config/locale/gnu/c_locale.h buildtools/trunk/gcc/libstdc++-v3/config/locale/gnu/codecvt_members.cc buildtools/trunk/gcc/libstdc++-v3/config/locale/gnu/collate_members.cc buildtools/trunk/gcc/libstdc++-v3/config/locale/gnu/ctype_members.cc buildtools/trunk/gcc/libstdc++-v3/config/locale/gnu/messages_members.cc buildtools/trunk/gcc/libstdc++-v3/config/locale/gnu/messages_members.h buildtools/trunk/gcc/libstdc++-v3/config/locale/gnu/monetary_members.cc buildtools/trunk/gcc/libstdc++-v3/config/locale/gnu/numeric_members.cc buildtools/trunk/gcc/libstdc++-v3/config/locale/gnu/time_members.cc buildtools/trunk/gcc/libstdc++-v3/config/locale/gnu/time_members.h buildtools/trunk/gcc/libstdc++-v3/config/locale/ieee_1003.1-2001/c_locale.cc buildtools/trunk/gcc/libstdc++-v3/config/locale/ieee_1003.1-2001/c_locale.h buildtools/trunk/gcc/libstdc++-v3/config/locale/ieee_1003.1-2001/messages_members.cc buildtools/trunk/gcc/libstdc++-v3/config/locale/ieee_1003.1-2001/messages_members.h buildtools/trunk/gcc/libstdc++-v3/config/os/aix/atomic_word.h buildtools/trunk/gcc/libstdc++-v3/config/os/aix/atomicity.h buildtools/trunk/gcc/libstdc++-v3/config/os/aix/ctype_base.h buildtools/trunk/gcc/libstdc++-v3/config/os/aix/ctype_inline.h buildtools/trunk/gcc/libstdc++-v3/config/os/aix/ctype_noninline.h buildtools/trunk/gcc/libstdc++-v3/config/os/aix/os_defines.h buildtools/trunk/gcc/libstdc++-v3/config/os/bsd/darwin/ctype_base.h buildtools/trunk/gcc/libstdc++-v3/config/os/bsd/darwin/ctype_inline.h buildtools/trunk/gcc/libstdc++-v3/config/os/bsd/darwin/ctype_noninline.h buildtools/trunk/gcc/libstdc++-v3/config/os/bsd/darwin/os_defines.h buildtools/trunk/gcc/libstdc++-v3/config/os/bsd/freebsd/ctype_base.h buildtools/trunk/gcc/libstdc++-v3/config/os/bsd/freebsd/ctype_inline.h buildtools/trunk/gcc/libstdc++-v3/config/os/bsd/freebsd/ctype_noninline.h buildtools/trunk/gcc/libstdc++-v3/config/os/bsd/freebsd/os_defines.h buildtools/trunk/gcc/libstdc++-v3/config/os/bsd/netbsd/ctype_base.h buildtools/trunk/gcc/libstdc++-v3/config/os/bsd/netbsd/ctype_inline.h buildtools/trunk/gcc/libstdc++-v3/config/os/bsd/netbsd/ctype_noninline.h buildtools/trunk/gcc/libstdc++-v3/config/os/bsd/netbsd/os_defines.h buildtools/trunk/gcc/libstdc++-v3/config/os/djgpp/ctype_base.h buildtools/trunk/gcc/libstdc++-v3/config/os/djgpp/ctype_inline.h buildtools/trunk/gcc/libstdc++-v3/config/os/djgpp/ctype_noninline.h buildtools/trunk/gcc/libstdc++-v3/config/os/djgpp/os_defines.h buildtools/trunk/gcc/libstdc++-v3/config/os/generic/ctype_base.h buildtools/trunk/gcc/libstdc++-v3/config/os/generic/ctype_inline.h buildtools/trunk/gcc/libstdc++-v3/config/os/generic/ctype_noninline.h buildtools/trunk/gcc/libstdc++-v3/config/os/generic/os_defines.h buildtools/trunk/gcc/libstdc++-v3/config/os/gnu-linux/ctype_base.h buildtools/trunk/gcc/libstdc++-v3/config/os/gnu-linux/ctype_inline.h buildtools/trunk/gcc/libstdc++-v3/config/os/gnu-linux/ctype_noninline.h buildtools/trunk/gcc/libstdc++-v3/config/os/gnu-linux/os_defines.h buildtools/trunk/gcc/libstdc++-v3/config/os/hpux/ctype_base.h buildtools/trunk/gcc/libstdc++-v3/config/os/hpux/ctype_inline.h buildtools/trunk/gcc/libstdc++-v3/config/os/hpux/ctype_noninline.h buildtools/trunk/gcc/libstdc++-v3/config/os/hpux/os_defines.h buildtools/trunk/gcc/libstdc++-v3/config/os/irix/atomic_word.h buildtools/trunk/gcc/libstdc++-v3/config/os/irix/atomicity.h buildtools/trunk/gcc/libstdc++-v3/config/os/irix/irix5.2/ctype_base.h buildtools/trunk/gcc/libstdc++-v3/config/os/irix/irix5.2/ctype_inline.h buildtools/trunk/gcc/libstdc++-v3/config/os/irix/irix5.2/ctype_noninline.h buildtools/trunk/gcc/libstdc++-v3/config/os/irix/irix5.2/os_defines.h buildtools/trunk/gcc/libstdc++-v3/config/os/irix/irix6.5/ctype_base.h buildtools/trunk/gcc/libstdc++-v3/config/os/irix/irix6.5/ctype_inline.h buildtools/trunk/gcc/libstdc++-v3/config/os/irix/irix6.5/ctype_noninline.h buildtools/trunk/gcc/libstdc++-v3/config/os/irix/irix6.5/os_defines.h buildtools/trunk/gcc/libstdc++-v3/config/os/mingw32/ctype_base.h buildtools/trunk/gcc/libstdc++-v3/config/os/mingw32/ctype_inline.h buildtools/trunk/gcc/libstdc++-v3/config/os/mingw32/ctype_noninline.h buildtools/trunk/gcc/libstdc++-v3/config/os/mingw32/os_defines.h buildtools/trunk/gcc/libstdc++-v3/config/os/newlib/ctype_base.h buildtools/trunk/gcc/libstdc++-v3/config/os/newlib/ctype_inline.h buildtools/trunk/gcc/libstdc++-v3/config/os/newlib/ctype_noninline.h buildtools/trunk/gcc/libstdc++-v3/config/os/newlib/os_defines.h buildtools/trunk/gcc/libstdc++-v3/config/os/qnx/qnx6.1/ctype_base.h buildtools/trunk/gcc/libstdc++-v3/config/os/qnx/qnx6.1/ctype_inline.h buildtools/trunk/gcc/libstdc++-v3/config/os/qnx/qnx6.1/ctype_noninline.h buildtools/trunk/gcc/libstdc++-v3/config/os/qnx/qnx6.1/os_defines.h buildtools/trunk/gcc/libstdc++-v3/config/os/solaris/solaris2.5/ctype_base.h buildtools/trunk/gcc/libstdc++-v3/config/os/solaris/solaris2.5/ctype_inline.h buildtools/trunk/gcc/libstdc++-v3/config/os/solaris/solaris2.5/ctype_noninline.h buildtools/trunk/gcc/libstdc++-v3/config/os/solaris/solaris2.5/os_defines.h buildtools/trunk/gcc/libstdc++-v3/config/os/solaris/solaris2.6/ctype_base.h buildtools/trunk/gcc/libstdc++-v3/config/os/solaris/solaris2.6/ctype_inline.h buildtools/trunk/gcc/libstdc++-v3/config/os/solaris/solaris2.6/ctype_noninline.h buildtools/trunk/gcc/libstdc++-v3/config/os/solaris/solaris2.6/os_defines.h buildtools/trunk/gcc/libstdc++-v3/config/os/solaris/solaris2.7/ctype_base.h buildtools/trunk/gcc/libstdc++-v3/config/os/solaris/solaris2.7/ctype_inline.h buildtools/trunk/gcc/libstdc++-v3/config/os/solaris/solaris2.7/ctype_noninline.h buildtools/trunk/gcc/libstdc++-v3/config/os/solaris/solaris2.7/os_defines.h buildtools/trunk/gcc/libstdc++-v3/config/os/tpf/ctype_base.h buildtools/trunk/gcc/libstdc++-v3/config/os/tpf/ctype_inline.h buildtools/trunk/gcc/libstdc++-v3/config/os/tpf/ctype_noninline.h buildtools/trunk/gcc/libstdc++-v3/config/os/tpf/os_defines.h buildtools/trunk/gcc/libstdc++-v3/config/os/vxworks/ctype_base.h buildtools/trunk/gcc/libstdc++-v3/config/os/vxworks/ctype_inline.h buildtools/trunk/gcc/libstdc++-v3/config/os/vxworks/ctype_noninline.h buildtools/trunk/gcc/libstdc++-v3/config/os/vxworks/os_defines.h buildtools/trunk/gcc/libstdc++-v3/config/os/windiss/ctype_base.h buildtools/trunk/gcc/libstdc++-v3/config/os/windiss/ctype_inline.h buildtools/trunk/gcc/libstdc++-v3/config/os/windiss/ctype_noninline.h buildtools/trunk/gcc/libstdc++-v3/config/os/windiss/os_defines.h buildtools/trunk/gcc/libstdc++-v3/configure buildtools/trunk/gcc/libstdc++-v3/configure.ac buildtools/trunk/gcc/libstdc++-v3/configure.host buildtools/trunk/gcc/libstdc++-v3/crossconfig.m4 buildtools/trunk/gcc/libstdc++-v3/docs/doxygen/user.cfg.in buildtools/trunk/gcc/libstdc++-v3/docs/html/17_intro/COPYING buildtools/trunk/gcc/libstdc++-v3/docs/html/17_intro/COPYING.DOC buildtools/trunk/gcc/libstdc++-v3/docs/html/17_intro/headers_cc.txt buildtools/trunk/gcc/libstdc++-v3/docs/html/17_intro/porting.html buildtools/trunk/gcc/libstdc++-v3/docs/html/17_intro/porting.texi buildtools/trunk/gcc/libstdc++-v3/docs/html/27_io/howto.html buildtools/trunk/gcc/libstdc++-v3/docs/html/configopts.html buildtools/trunk/gcc/libstdc++-v3/docs/html/debug.html buildtools/trunk/gcc/libstdc++-v3/docs/html/documentation.html buildtools/trunk/gcc/libstdc++-v3/docs/html/ext/howto.html buildtools/trunk/gcc/libstdc++-v3/docs/html/ext/lwg-active.html buildtools/trunk/gcc/libstdc++-v3/docs/html/ext/lwg-defects.html buildtools/trunk/gcc/libstdc++-v3/docs/html/ext/mt_allocator.html buildtools/trunk/gcc/libstdc++-v3/docs/html/faq/index.html buildtools/trunk/gcc/libstdc++-v3/docs/html/faq/index.txt buildtools/trunk/gcc/libstdc++-v3/docs/html/install.html buildtools/trunk/gcc/libstdc++-v3/docs/html/test.html buildtools/trunk/gcc/libstdc++-v3/fragment.am buildtools/trunk/gcc/libstdc++-v3/include/Makefile.am buildtools/trunk/gcc/libstdc++-v3/include/Makefile.in buildtools/trunk/gcc/libstdc++-v3/include/backward/algo.h buildtools/trunk/gcc/libstdc++-v3/include/backward/algobase.h buildtools/trunk/gcc/libstdc++-v3/include/backward/alloc.h buildtools/trunk/gcc/libstdc++-v3/include/backward/backward_warning.h buildtools/trunk/gcc/libstdc++-v3/include/backward/bvector.h buildtools/trunk/gcc/libstdc++-v3/include/backward/complex.h buildtools/trunk/gcc/libstdc++-v3/include/backward/defalloc.h buildtools/trunk/gcc/libstdc++-v3/include/backward/deque.h buildtools/trunk/gcc/libstdc++-v3/include/backward/fstream.h buildtools/trunk/gcc/libstdc++-v3/include/backward/function.h buildtools/trunk/gcc/libstdc++-v3/include/backward/hash_map.h buildtools/trunk/gcc/libstdc++-v3/include/backward/hash_set.h buildtools/trunk/gcc/libstdc++-v3/include/backward/hashtable.h buildtools/trunk/gcc/libstdc++-v3/include/backward/heap.h buildtools/trunk/gcc/libstdc++-v3/include/backward/iomanip.h buildtools/trunk/gcc/libstdc++-v3/include/backward/iostream.h buildtools/trunk/gcc/libstdc++-v3/include/backward/istream.h buildtools/trunk/gcc/libstdc++-v3/include/backward/iterator.h buildtools/trunk/gcc/libstdc++-v3/include/backward/list.h buildtools/trunk/gcc/libstdc++-v3/include/backward/map.h buildtools/trunk/gcc/libstdc++-v3/include/backward/multimap.h buildtools/trunk/gcc/libstdc++-v3/include/backward/multiset.h buildtools/trunk/gcc/libstdc++-v3/include/backward/new.h buildtools/trunk/gcc/libstdc++-v3/include/backward/ostream.h buildtools/trunk/gcc/libstdc++-v3/include/backward/pair.h buildtools/trunk/gcc/libstdc++-v3/include/backward/queue.h buildtools/trunk/gcc/libstdc++-v3/include/backward/rope.h buildtools/trunk/gcc/libstdc++-v3/include/backward/set.h buildtools/trunk/gcc/libstdc++-v3/include/backward/slist.h buildtools/trunk/gcc/libstdc++-v3/include/backward/stack.h buildtools/trunk/gcc/libstdc++-v3/include/backward/stream.h buildtools/trunk/gcc/libstdc++-v3/include/backward/streambuf.h buildtools/trunk/gcc/libstdc++-v3/include/backward/strstream buildtools/trunk/gcc/libstdc++-v3/include/backward/tempbuf.h buildtools/trunk/gcc/libstdc++-v3/include/backward/tree.h buildtools/trunk/gcc/libstdc++-v3/include/backward/vector.h buildtools/trunk/gcc/libstdc++-v3/include/bits/allocator.h buildtools/trunk/gcc/libstdc++-v3/include/bits/atomicity.h buildtools/trunk/gcc/libstdc++-v3/include/bits/basic_ios.h buildtools/trunk/gcc/libstdc++-v3/include/bits/basic_ios.tcc buildtools/trunk/gcc/libstdc++-v3/include/bits/basic_string.h buildtools/trunk/gcc/libstdc++-v3/include/bits/basic_string.tcc buildtools/trunk/gcc/libstdc++-v3/include/bits/boost_concept_check.h buildtools/trunk/gcc/libstdc++-v3/include/bits/c++config buildtools/trunk/gcc/libstdc++-v3/include/bits/char_traits.h buildtools/trunk/gcc/libstdc++-v3/include/bits/codecvt.h buildtools/trunk/gcc/libstdc++-v3/include/bits/concept_check.h buildtools/trunk/gcc/libstdc++-v3/include/bits/concurrence.h buildtools/trunk/gcc/libstdc++-v3/include/bits/cpp_type_traits.h buildtools/trunk/gcc/libstdc++-v3/include/bits/deque.tcc buildtools/trunk/gcc/libstdc++-v3/include/bits/fstream.tcc buildtools/trunk/gcc/libstdc++-v3/include/bits/functexcept.h buildtools/trunk/gcc/libstdc++-v3/include/bits/gslice.h buildtools/trunk/gcc/libstdc++-v3/include/bits/gslice_array.h buildtools/trunk/gcc/libstdc++-v3/include/bits/indirect_array.h buildtools/trunk/gcc/libstdc++-v3/include/bits/ios_base.h buildtools/trunk/gcc/libstdc++-v3/include/bits/istream.tcc buildtools/trunk/gcc/libstdc++-v3/include/bits/list.tcc buildtools/trunk/gcc/libstdc++-v3/include/bits/locale_classes.h buildtools/trunk/gcc/libstdc++-v3/include/bits/locale_facets.h buildtools/trunk/gcc/libstdc++-v3/include/bits/locale_facets.tcc buildtools/trunk/gcc/libstdc++-v3/include/bits/localefwd.h buildtools/trunk/gcc/libstdc++-v3/include/bits/mask_array.h buildtools/trunk/gcc/libstdc++-v3/include/bits/ostream.tcc buildtools/trunk/gcc/libstdc++-v3/include/bits/postypes.h buildtools/trunk/gcc/libstdc++-v3/include/bits/slice_array.h buildtools/trunk/gcc/libstdc++-v3/include/bits/sstream.tcc buildtools/trunk/gcc/libstdc++-v3/include/bits/stl_algo.h buildtools/trunk/gcc/libstdc++-v3/include/bits/stl_algobase.h buildtools/trunk/gcc/libstdc++-v3/include/bits/stl_bvector.h buildtools/trunk/gcc/libstdc++-v3/include/bits/stl_construct.h buildtools/trunk/gcc/libstdc++-v3/include/bits/stl_deque.h buildtools/trunk/gcc/libstdc++-v3/include/bits/stl_function.h buildtools/trunk/gcc/libstdc++-v3/include/bits/stl_heap.h buildtools/trunk/gcc/libstdc++-v3/include/bits/stl_iterator.h buildtools/trunk/gcc/libstdc++-v3/include/bits/stl_iterator_base_funcs.h buildtools/trunk/gcc/libstdc++-v3/include/bits/stl_iterator_base_types.h buildtools/trunk/gcc/libstdc++-v3/include/bits/stl_list.h buildtools/trunk/gcc/libstdc++-v3/include/bits/stl_map.h buildtools/trunk/gcc/libstdc++-v3/include/bits/stl_multimap.h buildtools/trunk/gcc/libstdc++-v3/include/bits/stl_multiset.h buildtools/trunk/gcc/libstdc++-v3/include/bits/stl_numeric.h buildtools/trunk/gcc/libstdc++-v3/include/bits/stl_pair.h buildtools/trunk/gcc/libstdc++-v3/include/bits/stl_queue.h buildtools/trunk/gcc/libstdc++-v3/include/bits/stl_raw_storage_iter.h buildtools/trunk/gcc/libstdc++-v3/include/bits/stl_relops.h buildtools/trunk/gcc/libstdc++-v3/include/bits/stl_set.h buildtools/trunk/gcc/libstdc++-v3/include/bits/stl_stack.h buildtools/trunk/gcc/libstdc++-v3/include/bits/stl_tempbuf.h buildtools/trunk/gcc/libstdc++-v3/include/bits/stl_tree.h buildtools/trunk/gcc/libstdc++-v3/include/bits/stl_uninitialized.h buildtools/trunk/gcc/libstdc++-v3/include/bits/stl_vector.h buildtools/trunk/gcc/libstdc++-v3/include/bits/stream_iterator.h buildtools/trunk/gcc/libstdc++-v3/include/bits/streambuf.tcc buildtools/trunk/gcc/libstdc++-v3/include/bits/streambuf_iterator.h buildtools/trunk/gcc/libstdc++-v3/include/bits/stringfwd.h buildtools/trunk/gcc/libstdc++-v3/include/bits/valarray_after.h buildtools/trunk/gcc/libstdc++-v3/include/bits/valarray_array.h buildtools/trunk/gcc/libstdc++-v3/include/bits/valarray_array.tcc buildtools/trunk/gcc/libstdc++-v3/include/bits/valarray_before.h buildtools/trunk/gcc/libstdc++-v3/include/bits/vector.tcc buildtools/trunk/gcc/libstdc++-v3/include/c/std_cassert.h buildtools/trunk/gcc/libstdc++-v3/include/c/std_cctype.h buildtools/trunk/gcc/libstdc++-v3/include/c/std_cerrno.h buildtools/trunk/gcc/libstdc++-v3/include/c/std_cfloat.h buildtools/trunk/gcc/libstdc++-v3/include/c/std_ciso646.h buildtools/trunk/gcc/libstdc++-v3/include/c/std_climits.h buildtools/trunk/gcc/libstdc++-v3/include/c/std_clocale.h buildtools/trunk/gcc/libstdc++-v3/include/c/std_cmath.h buildtools/trunk/gcc/libstdc++-v3/include/c/std_csetjmp.h buildtools/trunk/gcc/libstdc++-v3/include/c/std_csignal.h buildtools/trunk/gcc/libstdc++-v3/include/c/std_cstdarg.h buildtools/trunk/gcc/libstdc++-v3/include/c/std_cstddef.h buildtools/trunk/gcc/libstdc++-v3/include/c/std_cstdio.h buildtools/trunk/gcc/libstdc++-v3/include/c/std_cstdlib.h buildtools/trunk/gcc/libstdc++-v3/include/c/std_cstring.h buildtools/trunk/gcc/libstdc++-v3/include/c/std_ctime.h buildtools/trunk/gcc/libstdc++-v3/include/c/std_cwchar.h buildtools/trunk/gcc/libstdc++-v3/include/c/std_cwctype.h buildtools/trunk/gcc/libstdc++-v3/include/c_compatibility/assert.h buildtools/trunk/gcc/libstdc++-v3/include/c_compatibility/ctype.h buildtools/trunk/gcc/libstdc++-v3/include/c_compatibility/errno.h buildtools/trunk/gcc/libstdc++-v3/include/c_compatibility/float.h buildtools/trunk/gcc/libstdc++-v3/include/c_compatibility/iso646.h buildtools/trunk/gcc/libstdc++-v3/include/c_compatibility/limits.h buildtools/trunk/gcc/libstdc++-v3/include/c_compatibility/locale.h buildtools/trunk/gcc/libstdc++-v3/include/c_compatibility/math.h buildtools/trunk/gcc/libstdc++-v3/include/c_compatibility/setjmp.h buildtools/trunk/gcc/libstdc++-v3/include/c_compatibility/signal.h buildtools/trunk/gcc/libstdc++-v3/include/c_compatibility/stdarg.h buildtools/trunk/gcc/libstdc++-v3/include/c_compatibility/stddef.h buildtools/trunk/gcc/libstdc++-v3/include/c_compatibility/stdio.h buildtools/trunk/gcc/libstdc++-v3/include/c_compatibility/stdlib.h buildtools/trunk/gcc/libstdc++-v3/include/c_compatibility/string.h buildtools/trunk/gcc/libstdc++-v3/include/c_compatibility/time.h buildtools/trunk/gcc/libstdc++-v3/include/c_compatibility/wchar.h buildtools/trunk/gcc/libstdc++-v3/include/c_compatibility/wctype.h buildtools/trunk/gcc/libstdc++-v3/include/c_std/cmath.tcc buildtools/trunk/gcc/libstdc++-v3/include/c_std/std_cassert.h buildtools/trunk/gcc/libstdc++-v3/include/c_std/std_cctype.h buildtools/trunk/gcc/libstdc++-v3/include/c_std/std_cerrno.h buildtools/trunk/gcc/libstdc++-v3/include/c_std/std_cfloat.h buildtools/trunk/gcc/libstdc++-v3/include/c_std/std_ciso646.h buildtools/trunk/gcc/libstdc++-v3/include/c_std/std_climits.h buildtools/trunk/gcc/libstdc++-v3/include/c_std/std_clocale.h buildtools/trunk/gcc/libstdc++-v3/include/c_std/std_cmath.h buildtools/trunk/gcc/libstdc++-v3/include/c_std/std_csetjmp.h buildtools/trunk/gcc/libstdc++-v3/include/c_std/std_csignal.h buildtools/trunk/gcc/libstdc++-v3/include/c_std/std_cstdarg.h buildtools/trunk/gcc/libstdc++-v3/include/c_std/std_cstddef.h buildtools/trunk/gcc/libstdc++-v3/include/c_std/std_cstdio.h buildtools/trunk/gcc/libstdc++-v3/include/c_std/std_cstdlib.h buildtools/trunk/gcc/libstdc++-v3/include/c_std/std_cstring.h buildtools/trunk/gcc/libstdc++-v3/include/c_std/std_ctime.h buildtools/trunk/gcc/libstdc++-v3/include/c_std/std_cwchar.h buildtools/trunk/gcc/libstdc++-v3/include/c_std/std_cwctype.h buildtools/trunk/gcc/libstdc++-v3/include/debug/bitset buildtools/trunk/gcc/libstdc++-v3/include/debug/debug.h buildtools/trunk/gcc/libstdc++-v3/include/debug/deque buildtools/trunk/gcc/libstdc++-v3/include/debug/formatter.h buildtools/trunk/gcc/libstdc++-v3/include/debug/hash_map buildtools/trunk/gcc/libstdc++-v3/include/debug/hash_map.h buildtools/trunk/gcc/libstdc++-v3/include/debug/hash_multimap.h buildtools/trunk/gcc/libstdc++-v3/include/debug/hash_multiset.h buildtools/trunk/gcc/libstdc++-v3/include/debug/hash_set buildtools/trunk/gcc/libstdc++-v3/include/debug/hash_set.h buildtools/trunk/gcc/libstdc++-v3/include/debug/list buildtools/trunk/gcc/libstdc++-v3/include/debug/map buildtools/trunk/gcc/libstdc++-v3/include/debug/map.h buildtools/trunk/gcc/libstdc++-v3/include/debug/multimap.h buildtools/trunk/gcc/libstdc++-v3/include/debug/multiset.h buildtools/trunk/gcc/libstdc++-v3/include/debug/safe_base.h buildtools/trunk/gcc/libstdc++-v3/include/debug/safe_iterator.h buildtools/trunk/gcc/libstdc++-v3/include/debug/safe_iterator.tcc buildtools/trunk/gcc/libstdc++-v3/include/debug/safe_sequence.h buildtools/trunk/gcc/libstdc++-v3/include/debug/set buildtools/trunk/gcc/libstdc++-v3/include/debug/set.h buildtools/trunk/gcc/libstdc++-v3/include/debug/string buildtools/trunk/gcc/libstdc++-v3/include/debug/vector buildtools/trunk/gcc/libstdc++-v3/include/ext/algorithm buildtools/trunk/gcc/libstdc++-v3/include/ext/array_allocator.h buildtools/trunk/gcc/libstdc++-v3/include/ext/bitmap_allocator.h buildtools/trunk/gcc/libstdc++-v3/include/ext/codecvt_specializations.h buildtools/trunk/gcc/libstdc++-v3/include/ext/debug_allocator.h buildtools/trunk/gcc/libstdc++-v3/include/ext/functional buildtools/trunk/gcc/libstdc++-v3/include/ext/hash_fun.h buildtools/trunk/gcc/libstdc++-v3/include/ext/hash_map buildtools/trunk/gcc/libstdc++-v3/include/ext/hash_set buildtools/trunk/gcc/libstdc++-v3/include/ext/hashtable.h buildtools/trunk/gcc/libstdc++-v3/include/ext/iterator buildtools/trunk/gcc/libstdc++-v3/include/ext/malloc_allocator.h buildtools/trunk/gcc/libstdc++-v3/include/ext/memory buildtools/trunk/gcc/libstdc++-v3/include/ext/mt_allocator.h buildtools/trunk/gcc/libstdc++-v3/include/ext/new_allocator.h buildtools/trunk/gcc/libstdc++-v3/include/ext/numeric buildtools/trunk/gcc/libstdc++-v3/include/ext/pod_char_traits.h buildtools/trunk/gcc/libstdc++-v3/include/ext/pool_allocator.h buildtools/trunk/gcc/libstdc++-v3/include/ext/rb_tree buildtools/trunk/gcc/libstdc++-v3/include/ext/rope buildtools/trunk/gcc/libstdc++-v3/include/ext/ropeimpl.h buildtools/trunk/gcc/libstdc++-v3/include/ext/slist buildtools/trunk/gcc/libstdc++-v3/include/ext/stdio_filebuf.h buildtools/trunk/gcc/libstdc++-v3/include/ext/stdio_sync_filebuf.h buildtools/trunk/gcc/libstdc++-v3/include/std/std_algorithm.h buildtools/trunk/gcc/libstdc++-v3/include/std/std_bitset.h buildtools/trunk/gcc/libstdc++-v3/include/std/std_complex.h buildtools/trunk/gcc/libstdc++-v3/include/std/std_deque.h buildtools/trunk/gcc/libstdc++-v3/include/std/std_fstream.h buildtools/trunk/gcc/libstdc++-v3/include/std/std_functional.h buildtools/trunk/gcc/libstdc++-v3/include/std/std_iomanip.h buildtools/trunk/gcc/libstdc++-v3/include/std/std_ios.h buildtools/trunk/gcc/libstdc++-v3/include/std/std_iosfwd.h buildtools/trunk/gcc/libstdc++-v3/include/std/std_iostream.h buildtools/trunk/gcc/libstdc++-v3/include/std/std_istream.h buildtools/trunk/gcc/libstdc++-v3/include/std/std_iterator.h buildtools/trunk/gcc/libstdc++-v3/include/std/std_limits.h buildtools/trunk/gcc/libstdc++-v3/include/std/std_list.h buildtools/trunk/gcc/libstdc++-v3/include/std/std_locale.h buildtools/trunk/gcc/libstdc++-v3/include/std/std_map.h buildtools/trunk/gcc/libstdc++-v3/include/std/std_memory.h buildtools/trunk/gcc/libstdc++-v3/include/std/std_numeric.h buildtools/trunk/gcc/libstdc++-v3/include/std/std_ostream.h buildtools/trunk/gcc/libstdc++-v3/include/std/std_queue.h buildtools/trunk/gcc/libstdc++-v3/include/std/std_set.h buildtools/trunk/gcc/libstdc++-v3/include/std/std_sstream.h buildtools/trunk/gcc/libstdc++-v3/include/std/std_stack.h buildtools/trunk/gcc/libstdc++-v3/include/std/std_stdexcept.h buildtools/trunk/gcc/libstdc++-v3/include/std/std_streambuf.h buildtools/trunk/gcc/libstdc++-v3/include/std/std_string.h buildtools/trunk/gcc/libstdc++-v3/include/std/std_utility.h buildtools/trunk/gcc/libstdc++-v3/include/std/std_valarray.h buildtools/trunk/gcc/libstdc++-v3/include/std/std_vector.h buildtools/trunk/gcc/libstdc++-v3/include/stdc++.h buildtools/trunk/gcc/libstdc++-v3/include/tr1/array buildtools/trunk/gcc/libstdc++-v3/include/tr1/bind_iterate.h buildtools/trunk/gcc/libstdc++-v3/include/tr1/bind_repeat.h buildtools/trunk/gcc/libstdc++-v3/include/tr1/boost_shared_ptr.h buildtools/trunk/gcc/libstdc++-v3/include/tr1/functional buildtools/trunk/gcc/libstdc++-v3/include/tr1/functional_iterate.h buildtools/trunk/gcc/libstdc++-v3/include/tr1/hashtable buildtools/trunk/gcc/libstdc++-v3/include/tr1/memory buildtools/trunk/gcc/libstdc++-v3/include/tr1/mu_iterate.h buildtools/trunk/gcc/libstdc++-v3/include/tr1/ref_fwd.h buildtools/trunk/gcc/libstdc++-v3/include/tr1/ref_wrap_iterate.h buildtools/trunk/gcc/libstdc++-v3/include/tr1/repeat.h buildtools/trunk/gcc/libstdc++-v3/include/tr1/tuple buildtools/trunk/gcc/libstdc++-v3/include/tr1/tuple_iterate.h buildtools/trunk/gcc/libstdc++-v3/include/tr1/type_traits buildtools/trunk/gcc/libstdc++-v3/include/tr1/type_traits_fwd.h buildtools/trunk/gcc/libstdc++-v3/include/tr1/unordered_map buildtools/trunk/gcc/libstdc++-v3/include/tr1/unordered_set buildtools/trunk/gcc/libstdc++-v3/include/tr1/utility buildtools/trunk/gcc/libstdc++-v3/libmath/Makefile.am buildtools/trunk/gcc/libstdc++-v3/libmath/Makefile.in buildtools/trunk/gcc/libstdc++-v3/libmath/copysignf.c buildtools/trunk/gcc/libstdc++-v3/libmath/mathconf.h buildtools/trunk/gcc/libstdc++-v3/libmath/signbit.c buildtools/trunk/gcc/libstdc++-v3/libmath/signbitf.c buildtools/trunk/gcc/libstdc++-v3/libmath/signbitl.c buildtools/trunk/gcc/libstdc++-v3/libmath/stubs.c buildtools/trunk/gcc/libstdc++-v3/libsupc++/Makefile.am buildtools/trunk/gcc/libstdc++-v3/libsupc++/Makefile.in buildtools/trunk/gcc/libstdc++-v3/libsupc++/cxxabi.h buildtools/trunk/gcc/libstdc++-v3/libsupc++/del_op.cc buildtools/trunk/gcc/libstdc++-v3/libsupc++/del_opnt.cc buildtools/trunk/gcc/libstdc++-v3/libsupc++/del_opv.cc buildtools/trunk/gcc/libstdc++-v3/libsupc++/del_opvnt.cc buildtools/trunk/gcc/libstdc++-v3/libsupc++/eh_alloc.cc buildtools/trunk/gcc/libstdc++-v3/libsupc++/eh_aux_runtime.cc buildtools/trunk/gcc/libstdc++-v3/libsupc++/eh_catch.cc buildtools/trunk/gcc/libstdc++-v3/libsupc++/eh_exception.cc buildtools/trunk/gcc/libstdc++-v3/libsupc++/eh_globals.cc buildtools/trunk/gcc/libstdc++-v3/libsupc++/eh_personality.cc buildtools/trunk/gcc/libstdc++-v3/libsupc++/eh_term_handler.cc buildtools/trunk/gcc/libstdc++-v3/libsupc++/eh_terminate.cc buildtools/trunk/gcc/libstdc++-v3/libsupc++/eh_throw.cc buildtools/trunk/gcc/libstdc++-v3/libsupc++/eh_type.cc buildtools/trunk/gcc/libstdc++-v3/libsupc++/eh_unex_handler.cc buildtools/trunk/gcc/libstdc++-v3/libsupc++/exception buildtools/trunk/gcc/libstdc++-v3/libsupc++/exception_defines.h buildtools/trunk/gcc/libstdc++-v3/libsupc++/guard.cc buildtools/trunk/gcc/libstdc++-v3/libsupc++/new buildtools/trunk/gcc/libstdc++-v3/libsupc++/new_handler.cc buildtools/trunk/gcc/libstdc++-v3/libsupc++/new_op.cc buildtools/trunk/gcc/libstdc++-v3/libsupc++/new_opnt.cc buildtools/trunk/gcc/libstdc++-v3/libsupc++/new_opv.cc buildtools/trunk/gcc/libstdc++-v3/libsupc++/new_opvnt.cc buildtools/trunk/gcc/libstdc++-v3/libsupc++/pure.cc buildtools/trunk/gcc/libstdc++-v3/libsupc++/tinfo.cc buildtools/trunk/gcc/libstdc++-v3/libsupc++/tinfo.h buildtools/trunk/gcc/libstdc++-v3/libsupc++/tinfo2.cc buildtools/trunk/gcc/libstdc++-v3/libsupc++/typeinfo buildtools/trunk/gcc/libstdc++-v3/libsupc++/unwind-cxx.h buildtools/trunk/gcc/libstdc++-v3/libsupc++/vec.cc buildtools/trunk/gcc/libstdc++-v3/libsupc++/vterminate.cc buildtools/trunk/gcc/libstdc++-v3/linkage.m4 buildtools/trunk/gcc/libstdc++-v3/po/Makefile.am buildtools/trunk/gcc/libstdc++-v3/po/Makefile.in buildtools/trunk/gcc/libstdc++-v3/po/POTFILES.in buildtools/trunk/gcc/libstdc++-v3/po/string_literals.cc buildtools/trunk/gcc/libstdc++-v3/scripts/check_compile buildtools/trunk/gcc/libstdc++-v3/scripts/check_performance buildtools/trunk/gcc/libstdc++-v3/scripts/create_testsuite_files buildtools/trunk/gcc/libstdc++-v3/scripts/extract_symvers buildtools/trunk/gcc/libstdc++-v3/scripts/testsuite_flags.in buildtools/trunk/gcc/libstdc++-v3/src/Makefile.am buildtools/trunk/gcc/libstdc++-v3/src/Makefile.in buildtools/trunk/gcc/libstdc++-v3/src/allocator-inst.cc buildtools/trunk/gcc/libstdc++-v3/src/bitmap_allocator.cc buildtools/trunk/gcc/libstdc++-v3/src/codecvt.cc buildtools/trunk/gcc/libstdc++-v3/src/compatibility.cc buildtools/trunk/gcc/libstdc++-v3/src/complex_io.cc buildtools/trunk/gcc/libstdc++-v3/src/concept-inst.cc buildtools/trunk/gcc/libstdc++-v3/src/ctype.cc buildtools/trunk/gcc/libstdc++-v3/src/debug.cc buildtools/trunk/gcc/libstdc++-v3/src/debug_list.cc buildtools/trunk/gcc/libstdc++-v3/src/ext-inst.cc buildtools/trunk/gcc/libstdc++-v3/src/fstream-inst.cc buildtools/trunk/gcc/libstdc++-v3/src/functexcept.cc buildtools/trunk/gcc/libstdc++-v3/src/globals_io.cc buildtools/trunk/gcc/libstdc++-v3/src/globals_locale.cc buildtools/trunk/gcc/libstdc++-v3/src/ios.cc buildtools/trunk/gcc/libstdc++-v3/src/ios_failure.cc buildtools/trunk/gcc/libstdc++-v3/src/ios_init.cc buildtools/trunk/gcc/libstdc++-v3/src/ios_locale.cc buildtools/trunk/gcc/libstdc++-v3/src/istream-inst.cc buildtools/trunk/gcc/libstdc++-v3/src/istream.cc buildtools/trunk/gcc/libstdc++-v3/src/limits.cc buildtools/trunk/gcc/libstdc++-v3/src/list.cc buildtools/trunk/gcc/libstdc++-v3/src/locale-inst.cc buildtools/trunk/gcc/libstdc++-v3/src/locale-misc-inst.cc buildtools/trunk/gcc/libstdc++-v3/src/locale.cc buildtools/trunk/gcc/libstdc++-v3/src/locale_facets.cc buildtools/trunk/gcc/libstdc++-v3/src/locale_init.cc buildtools/trunk/gcc/libstdc++-v3/src/localename.cc buildtools/trunk/gcc/libstdc++-v3/src/misc-inst.cc buildtools/trunk/gcc/libstdc++-v3/src/mt_allocator.cc buildtools/trunk/gcc/libstdc++-v3/src/ostream-inst.cc buildtools/trunk/gcc/libstdc++-v3/src/pool_allocator.cc buildtools/trunk/gcc/libstdc++-v3/src/sstream-inst.cc buildtools/trunk/gcc/libstdc++-v3/src/stdexcept.cc buildtools/trunk/gcc/libstdc++-v3/src/streambuf-inst.cc buildtools/trunk/gcc/libstdc++-v3/src/streambuf.cc buildtools/trunk/gcc/libstdc++-v3/src/string-inst.cc buildtools/trunk/gcc/libstdc++-v3/src/strstream.cc buildtools/trunk/gcc/libstdc++-v3/src/tree.cc buildtools/trunk/gcc/libstdc++-v3/src/valarray-inst.cc buildtools/trunk/gcc/libstdc++-v3/src/wlocale-inst.cc buildtools/trunk/gcc/libstdc++-v3/src/wstring-inst.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/17_intro/header_cassert.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/17_intro/header_cerrno.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/17_intro/header_csetjmp.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/17_intro/header_cstdarg.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/17_intro/header_cstddef.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/17_intro/header_cstdio.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/17_intro/header_cstdlib.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/17_intro/header_cstring.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/17_intro/header_ctime.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/17_intro/header_cwchar.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/17_intro/header_cwctype.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/17_intro/header_fstream.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/17_intro/header_iomanip.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/17_intro/header_ios.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/17_intro/header_iosfwd.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/17_intro/header_iostream.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/17_intro/header_istream.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/17_intro/header_ostream.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/17_intro/header_sstream.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/17_intro/header_streambuf.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/17_intro/headers.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/17_intro/headers_c++.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/17_intro/headers_c.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/18_support/new_delete_placement.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/19_diagnostics/stdexceptions.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/20_util/functional/comparisons.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/20_util/memory/16505.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/20_util/memory/allocator/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/20_util/memory/allocator/10378.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/20_util/memory/allocator/14176.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/20_util/memory/allocator/8230.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/20_util/memory/auto_ptr/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/20_util/memory/auto_ptr/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/20_util/memory/auto_ptr/3.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/20_util/memory/auto_ptr/3946.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/20_util/memory/auto_ptr/4.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/20_util/memory/auto_ptr/5.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/20_util/memory/auto_ptr/6.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/20_util/memory/auto_ptr/7.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/20_util/memory/auto_ptr/assign_neg.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/20_util/memory/raw_storage_iterator.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/20_util/memory/temporary_buffer.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/20_util/utility/pair/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/20_util/utility/pair/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/20_util/utility/pair/3.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/20_util/utility/pair/4.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/20_util/utility/rel_ops.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/21_strings/basic_string/append/char/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/21_strings/basic_string/append/char/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/21_strings/basic_string/append/char/3.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/21_strings/basic_string/append/wchar_t/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/21_strings/basic_string/append/wchar_t/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/21_strings/basic_string/append/wchar_t/3.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/21_strings/basic_string/assign/char/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/21_strings/basic_string/assign/char/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/21_strings/basic_string/assign/char/3.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/21_strings/basic_string/assign/wchar_t/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/21_strings/basic_string/assign/wchar_t/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/21_strings/basic_string/assign/wchar_t/3.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/21_strings/basic_string/capacity/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/21_strings/basic_string/capacity/char/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/21_strings/basic_string/capacity/char/18654.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/21_strings/basic_string/capacity/char/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/21_strings/basic_string/capacity/wchar_t/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/21_strings/basic_string/capacity/wchar_t/18654.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/21_strings/basic_string/capacity/wchar_t/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/21_strings/basic_string/compare/char/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/21_strings/basic_string/compare/char/13650.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/21_strings/basic_string/compare/wchar_t/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/21_strings/basic_string/compare/wchar_t/13650.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/21_strings/basic_string/cons/char/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/21_strings/basic_string/cons/char/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/21_strings/basic_string/cons/char/3.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/21_strings/basic_string/cons/char/4.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/21_strings/basic_string/cons/char/5.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/21_strings/basic_string/cons/char/6.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/21_strings/basic_string/cons/wchar_t/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/21_strings/basic_string/cons/wchar_t/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/21_strings/basic_string/cons/wchar_t/3.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/21_strings/basic_string/cons/wchar_t/4.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/21_strings/basic_string/cons/wchar_t/5.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/21_strings/basic_string/cons/wchar_t/6.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/21_strings/basic_string/element_access/char/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/21_strings/basic_string/element_access/char/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/21_strings/basic_string/element_access/char/3.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/21_strings/basic_string/element_access/char/4.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/21_strings/basic_string/element_access/char/empty.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/21_strings/basic_string/element_access/wchar_t/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/21_strings/basic_string/element_access/wchar_t/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/21_strings/basic_string/element_access/wchar_t/3.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/21_strings/basic_string/element_access/wchar_t/4.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/21_strings/basic_string/element_access/wchar_t/empty.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/21_strings/basic_string/find/char/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/21_strings/basic_string/find/char/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/21_strings/basic_string/find/char/3.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/21_strings/basic_string/find/wchar_t/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/21_strings/basic_string/find/wchar_t/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/21_strings/basic_string/find/wchar_t/3.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/21_strings/basic_string/insert/char/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/21_strings/basic_string/insert/char/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/21_strings/basic_string/insert/wchar_t/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/21_strings/basic_string/insert/wchar_t/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/char/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/char/10.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/char/11.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/char/4.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/char/5.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/char/6.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/char/7.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/char/8.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/char/9.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/pod/10081-in.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/pod/10081-out.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/wchar_t/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/wchar_t/10.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/wchar_t/11.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/wchar_t/4.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/wchar_t/5.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/wchar_t/6.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/wchar_t/7.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/wchar_t/8.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/wchar_t/9.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/21_strings/basic_string/operations/char/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/21_strings/basic_string/operations/wchar_t/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/21_strings/basic_string/operators/char/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/21_strings/basic_string/operators/char/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/21_strings/basic_string/operators/wchar_t/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/21_strings/basic_string/operators/wchar_t/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/21_strings/basic_string/replace/char/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/21_strings/basic_string/replace/char/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/21_strings/basic_string/replace/char/3.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/21_strings/basic_string/replace/char/4.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/21_strings/basic_string/replace/char/5.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/21_strings/basic_string/replace/char/6.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/21_strings/basic_string/replace/wchar_t/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/21_strings/basic_string/replace/wchar_t/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/21_strings/basic_string/replace/wchar_t/3.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/21_strings/basic_string/replace/wchar_t/4.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/21_strings/basic_string/replace/wchar_t/5.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/21_strings/basic_string/replace/wchar_t/6.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/21_strings/basic_string/rfind/char/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/21_strings/basic_string/rfind/char/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/21_strings/basic_string/rfind/char/3.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/21_strings/basic_string/rfind/wchar_t/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/21_strings/basic_string/rfind/wchar_t/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/21_strings/basic_string/rfind/wchar_t/3.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/21_strings/basic_string/substr/char/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/21_strings/basic_string/substr/wchar_t/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/21_strings/c_strings/char/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/21_strings/c_strings/char/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/21_strings/c_strings/wchar_t/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/21_strings/c_strings/wchar_t/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/21_strings/char_traits/requirements/char/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/21_strings/char_traits/requirements/short/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/21_strings/char_traits/requirements/wchar_t/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/21_strings/char_traits/typedefs/char/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/codecvt/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/codecvt/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/codecvt/always_noconv/char/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/codecvt/always_noconv/char/wrapped_env.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/codecvt/always_noconv/char/wrapped_locale.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/codecvt/always_noconv/wchar_t/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/codecvt/always_noconv/wchar_t/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/codecvt/always_noconv/wchar_t/3.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/codecvt/always_noconv/wchar_t/4.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/codecvt/always_noconv/wchar_t/wrapped_env.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/codecvt/always_noconv/wchar_t/wrapped_locale.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/codecvt/encoding/char/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/codecvt/encoding/char/wrapped_env.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/codecvt/encoding/char/wrapped_locale.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/codecvt/encoding/wchar_t/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/codecvt/encoding/wchar_t/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/codecvt/encoding/wchar_t/3.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/codecvt/encoding/wchar_t/4.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/codecvt/encoding/wchar_t/wrapped_env.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/codecvt/encoding/wchar_t/wrapped_locale.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/codecvt/in/char/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/codecvt/in/char/wrapped_env.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/codecvt/in/char/wrapped_locale.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/codecvt/in/wchar_t/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/codecvt/in/wchar_t/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/codecvt/in/wchar_t/3.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/codecvt/in/wchar_t/4.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/codecvt/in/wchar_t/5.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/codecvt/in/wchar_t/6.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/codecvt/in/wchar_t/7.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/codecvt/in/wchar_t/8.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/codecvt/in/wchar_t/9.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/codecvt/in/wchar_t/wrapped_env.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/codecvt/in/wchar_t/wrapped_locale.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/codecvt/length/char/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/codecvt/length/char/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/codecvt/length/char/wrapped_env.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/codecvt/length/char/wrapped_locale.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/codecvt/length/wchar_t/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/codecvt/length/wchar_t/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/codecvt/length/wchar_t/3.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/codecvt/length/wchar_t/4.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/codecvt/length/wchar_t/5.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/codecvt/length/wchar_t/6.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/codecvt/length/wchar_t/7.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/codecvt/length/wchar_t/wrapped_env.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/codecvt/length/wchar_t/wrapped_locale.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/codecvt/max_length/char/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/codecvt/max_length/char/wrapped_env.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/codecvt/max_length/char/wrapped_locale.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/codecvt/max_length/wchar_t/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/codecvt/max_length/wchar_t/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/codecvt/max_length/wchar_t/3.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/codecvt/max_length/wchar_t/4.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/codecvt/max_length/wchar_t/wrapped_env.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/codecvt/max_length/wchar_t/wrapped_locale.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/codecvt/out/char/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/codecvt/out/char/wrapped_env.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/codecvt/out/char/wrapped_locale.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/codecvt/out/wchar_t/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/codecvt/out/wchar_t/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/codecvt/out/wchar_t/3.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/codecvt/out/wchar_t/4.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/codecvt/out/wchar_t/5.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/codecvt/out/wchar_t/6.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/codecvt/out/wchar_t/7.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/codecvt/out/wchar_t/wrapped_env.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/codecvt/out/wchar_t/wrapped_locale.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/codecvt/unicode/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/codecvt/unicode/char.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/codecvt/unicode/wchar_t.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/codecvt/unshift/char/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/codecvt/unshift/char/wrapped_env.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/codecvt/unshift/char/wrapped_locale.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/codecvt/unshift/wchar_t/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/codecvt/unshift/wchar_t/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/codecvt/unshift/wchar_t/3.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/codecvt/unshift/wchar_t/4.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/codecvt/unshift/wchar_t/wrapped_env.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/codecvt/unshift/wchar_t/wrapped_locale.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/codecvt_byname/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/collate/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/collate/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/collate/compare/char/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/collate/compare/char/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/collate/compare/char/3.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/collate/compare/char/wrapped_env.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/collate/compare/char/wrapped_locale.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/collate/compare/wchar_t/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/collate/compare/wchar_t/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/collate/compare/wchar_t/3.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/collate/compare/wchar_t/wrapped_env.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/collate/compare/wchar_t/wrapped_locale.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/collate/hash/char/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/collate/hash/char/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/collate/hash/char/wrapped_env.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/collate/hash/char/wrapped_locale.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/collate/hash/wchar_t/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/collate/hash/wchar_t/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/collate/hash/wchar_t/wrapped_env.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/collate/hash/wchar_t/wrapped_locale.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/collate/transform/char/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/collate/transform/char/3.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/collate/transform/char/wrapped_env.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/collate/transform/char/wrapped_locale.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/collate/transform/wchar_t/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/collate/transform/wchar_t/3.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/collate/transform/wchar_t/wrapped_env.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/collate/transform/wchar_t/wrapped_locale.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/collate_byname/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/collate_byname/named_equivalence.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/ctype/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/ctype/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/ctype/cons/char/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/ctype/cons/char/wrapped_env.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/ctype/cons/char/wrapped_locale.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/ctype/is/char/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/ctype/is/char/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/ctype/is/char/3.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/ctype/is/char/9858.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/ctype/is/char/wrapped_env.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/ctype/is/char/wrapped_locale.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/ctype/is/wchar_t/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/ctype/is/wchar_t/11740.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/ctype/is/wchar_t/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/ctype/is/wchar_t/wrapped_env.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/ctype/is/wchar_t/wrapped_locale.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/ctype/narrow/char/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/ctype/narrow/char/19955.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/ctype/narrow/char/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/ctype/narrow/char/wrapped_env.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/ctype/narrow/char/wrapped_locale.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/ctype/narrow/wchar_t/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/ctype/narrow/wchar_t/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/ctype/narrow/wchar_t/3.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/ctype/narrow/wchar_t/wrapped_env.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/ctype/narrow/wchar_t/wrapped_locale.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/ctype/scan/char/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/ctype/scan/char/wrapped_env.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/ctype/scan/char/wrapped_locale.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/ctype/scan/wchar_t/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/ctype/scan/wchar_t/wrapped_env.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/ctype/scan/wchar_t/wrapped_locale.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/ctype/to/char/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/ctype/to/char/wrapped_env.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/ctype/to/char/wrapped_locale.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/ctype/to/wchar_t/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/ctype/to/wchar_t/wrapped_env.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/ctype/to/wchar_t/wrapped_locale.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/ctype/widen/char/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/ctype/widen/char/wrapped_env.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/ctype/widen/char/wrapped_locale.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/ctype/widen/wchar_t/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/ctype/widen/wchar_t/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/ctype/widen/wchar_t/3.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/ctype/widen/wchar_t/wrapped_env.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/ctype/widen/wchar_t/wrapped_locale.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/ctype_base/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/ctype_base/11844.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/ctype_byname/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/facet/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/facet/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/global_templates/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/locale/13630.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/locale/cons/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/locale/cons/12352.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/locale/cons/12438.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/locale/cons/12658_thread-1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/locale/cons/12658_thread-2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/locale/cons/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/locale/cons/4.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/locale/cons/5.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/locale/cons/6.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/locale/cons/7.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/locale/cons/7222-c.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/locale/cons/7222-env.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/locale/cons/8.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/locale/global_locale_objects/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/locale/global_locale_objects/14071.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/locale/global_locale_objects/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/locale/global_locale_objects/3.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/locale/operations/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/locale/operations/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/messages/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/messages/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/messages/members/char/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/messages/members/char/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/messages/members/char/3.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/messages/members/char/wrapped_env.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/messages/members/char/wrapped_locale.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/messages_byname/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/messages_byname/named_equivalence.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/money_get/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/money_get/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/money_get/3.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/money_get/get/char/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/money_get/get/char/10.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/money_get/get/char/11.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/money_get/get/char/11528.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/money_get/get/char/12.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/money_get/get/char/13.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/money_get/get/char/14.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/money_get/get/char/15.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/money_get/get/char/16.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/money_get/get/char/17.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/money_get/get/char/18.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/money_get/get/char/19.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/money_get/get/char/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/money_get/get/char/3.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/money_get/get/char/4.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/money_get/get/char/5.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/money_get/get/char/6.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/money_get/get/char/7.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/money_get/get/char/8.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/money_get/get/char/9.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/money_get/get/char/wrapped_env.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/money_get/get/char/wrapped_locale.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/money_get/get/wchar_t/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/money_get/get/wchar_t/10.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/money_get/get/wchar_t/11.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/money_get/get/wchar_t/11528.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/money_get/get/wchar_t/12.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/money_get/get/wchar_t/13.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/money_get/get/wchar_t/14.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/money_get/get/wchar_t/15.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/money_get/get/wchar_t/16.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/money_get/get/wchar_t/17.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/money_get/get/wchar_t/18.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/money_get/get/wchar_t/19.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/money_get/get/wchar_t/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/money_get/get/wchar_t/3.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/money_get/get/wchar_t/4.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/money_get/get/wchar_t/5.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/money_get/get/wchar_t/6.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/money_get/get/wchar_t/7.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/money_get/get/wchar_t/8.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/money_get/get/wchar_t/9.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/money_get/get/wchar_t/wrapped_env.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/money_get/get/wchar_t/wrapped_locale.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/money_put/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/money_put/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/money_put/3.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/money_put/put/char/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/money_put/put/char/12971.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/money_put/put/char/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/money_put/put/char/3.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/money_put/put/char/4.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/money_put/put/char/5.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/money_put/put/char/6.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/money_put/put/char/9780-3.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/money_put/put/char/wrapped_env.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/money_put/put/char/wrapped_locale.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/money_put/put/wchar_t/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/money_put/put/wchar_t/12971.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/money_put/put/wchar_t/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/money_put/put/wchar_t/3.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/money_put/put/wchar_t/4.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/money_put/put/wchar_t/5.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/money_put/put/wchar_t/6.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/money_put/put/wchar_t/wrapped_env.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/money_put/put/wchar_t/wrapped_locale.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/moneypunct/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/moneypunct/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/moneypunct/3.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/moneypunct/members/char/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/moneypunct/members/char/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/moneypunct/members/char/wrapped_env.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/moneypunct/members/char/wrapped_locale.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/moneypunct/members/wchar_t/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/moneypunct/members/wchar_t/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/moneypunct/members/wchar_t/wrapped_env.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/moneypunct/members/wchar_t/wrapped_locale.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/moneypunct_byname/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/moneypunct_byname/named_equivalence.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/num_get/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/num_get/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/num_get/3.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/num_get/get/char/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/num_get/get/char/10.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/num_get/get/char/11.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/num_get/get/char/12.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/num_get/get/char/13.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/num_get/get/char/14.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/num_get/get/char/15.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/num_get/get/char/16.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/num_get/get/char/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/num_get/get/char/3.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/num_get/get/char/4.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/num_get/get/char/5.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/num_get/get/char/6.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/num_get/get/char/7.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/num_get/get/char/8.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/num_get/get/char/9.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/num_get/get/char/wrapped_env.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/num_get/get/char/wrapped_locale.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/num_get/get/wchar_t/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/num_get/get/wchar_t/10.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/num_get/get/wchar_t/11.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/num_get/get/wchar_t/12.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/num_get/get/wchar_t/13.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/num_get/get/wchar_t/14.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/num_get/get/wchar_t/15.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/num_get/get/wchar_t/16.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/num_get/get/wchar_t/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/num_get/get/wchar_t/3.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/num_get/get/wchar_t/4.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/num_get/get/wchar_t/5.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/num_get/get/wchar_t/6.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/num_get/get/wchar_t/7.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/num_get/get/wchar_t/8.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/num_get/get/wchar_t/9.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/num_get/get/wchar_t/wrapped_env.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/num_get/get/wchar_t/wrapped_locale.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/num_put/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/num_put/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/num_put/3.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/num_put/put/char/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/num_put/put/char/14220.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/num_put/put/char/15565.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/num_put/put/char/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/num_put/put/char/20909.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/num_put/put/char/20914.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/num_put/put/char/3.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/num_put/put/char/4.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/num_put/put/char/5.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/num_put/put/char/6.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/num_put/put/char/7.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/num_put/put/char/8.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/num_put/put/char/9.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/num_put/put/char/9780-2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/num_put/put/char/wrapped_env.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/num_put/put/char/wrapped_locale.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/num_put/put/wchar_t/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/num_put/put/wchar_t/14220.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/num_put/put/wchar_t/15565.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/num_put/put/wchar_t/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/num_put/put/wchar_t/20909.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/num_put/put/wchar_t/20914.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/num_put/put/wchar_t/3.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/num_put/put/wchar_t/4.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/num_put/put/wchar_t/5.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/num_put/put/wchar_t/6.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/num_put/put/wchar_t/7.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/num_put/put/wchar_t/8.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/num_put/put/wchar_t/9.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/num_put/put/wchar_t/wrapped_env.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/num_put/put/wchar_t/wrapped_locale.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/numpunct/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/numpunct/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/numpunct/members/char/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/numpunct/members/char/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/numpunct/members/char/3.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/numpunct/members/char/cache_1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/numpunct/members/char/cache_2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/numpunct/members/char/wrapped_env.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/numpunct/members/char/wrapped_locale.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/numpunct/members/pod/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/numpunct/members/pod/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/numpunct/members/wchar_t/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/numpunct/members/wchar_t/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/numpunct/members/wchar_t/cache_1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/numpunct/members/wchar_t/cache_2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/numpunct/members/wchar_t/wrapped_env.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/numpunct/members/wchar_t/wrapped_locale.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/numpunct_byname/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/numpunct_byname/named_equivalence.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/time_get/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/time_get/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/time_get/date_order/char/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/time_get/date_order/char/wrapped_env.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/time_get/date_order/char/wrapped_locale.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/time_get/date_order/wchar_t/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/time_get/date_order/wchar_t/wrapped_env.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/time_get/date_order/wchar_t/wrapped_locale.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/time_get/get_date/char/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/time_get/get_date/char/12750.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/time_get/get_date/char/12791.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/time_get/get_date/char/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/time_get/get_date/char/3.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/time_get/get_date/char/wrapped_env.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/time_get/get_date/char/wrapped_locale.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/time_get/get_date/wchar_t/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/time_get/get_date/wchar_t/12750.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/time_get/get_date/wchar_t/12791.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/time_get/get_date/wchar_t/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/time_get/get_date/wchar_t/3.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/time_get/get_date/wchar_t/4.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/time_get/get_date/wchar_t/wrapped_env.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/time_get/get_date/wchar_t/wrapped_locale.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/time_get/get_monthname/char/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/time_get/get_monthname/char/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/time_get/get_monthname/char/3.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/time_get/get_monthname/char/4.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/time_get/get_monthname/char/wrapped_env.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/time_get/get_monthname/char/wrapped_locale.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/time_get/get_monthname/wchar_t/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/time_get/get_monthname/wchar_t/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/time_get/get_monthname/wchar_t/3.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/time_get/get_monthname/wchar_t/4.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/time_get/get_monthname/wchar_t/wrapped_env.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/time_get/get_monthname/wchar_t/wrapped_locale.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/time_get/get_time/char/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/time_get/get_time/char/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/time_get/get_time/char/3.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/time_get/get_time/char/4.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/time_get/get_time/char/wrapped_env.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/time_get/get_time/char/wrapped_locale.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/time_get/get_time/wchar_t/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/time_get/get_time/wchar_t/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/time_get/get_time/wchar_t/3.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/time_get/get_time/wchar_t/4.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/time_get/get_time/wchar_t/wrapped_env.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/time_get/get_time/wchar_t/wrapped_locale.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/time_get/get_weekday/char/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/time_get/get_weekday/char/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/time_get/get_weekday/char/3.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/time_get/get_weekday/char/wrapped_env.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/time_get/get_weekday/char/wrapped_locale.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/time_get/get_weekday/wchar_t/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/time_get/get_weekday/wchar_t/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/time_get/get_weekday/wchar_t/3.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/time_get/get_weekday/wchar_t/wrapped_env.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/time_get/get_weekday/wchar_t/wrapped_locale.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/time_get/get_year/char/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/time_get/get_year/char/3.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/time_get/get_year/char/wrapped_env.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/time_get/get_year/char/wrapped_locale.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/time_get/get_year/wchar_t/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/time_get/get_year/wchar_t/3.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/time_get/get_year/wchar_t/wrapped_env.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/time_get/get_year/wchar_t/wrapped_locale.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/time_put/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/time_put/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/time_put/put/char/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/time_put/put/char/10.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/time_put/put/char/12439_1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/time_put/put/char/12439_3.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/time_put/put/char/17038.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/time_put/put/char/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/time_put/put/char/3.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/time_put/put/char/4.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/time_put/put/char/5.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/time_put/put/char/6.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/time_put/put/char/7.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/time_put/put/char/8.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/time_put/put/char/9.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/time_put/put/char/9780-1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/time_put/put/char/wrapped_env.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/time_put/put/char/wrapped_locale.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/10.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/12439_1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/12439_2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/12439_3.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/17038.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/3.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/4.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/5.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/6.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/7.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/8.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/9.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/wrapped_env.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/22_locale/time_put/put/wchar_t/wrapped_locale.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/23_containers/bitset/18604.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/23_containers/bitset/cons/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/23_containers/bitset/cons/16020.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/23_containers/bitset/cons/6282.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/23_containers/bitset/count/6124.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/23_containers/bitset/ext/15361.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/23_containers/bitset/input/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/23_containers/bitset/invalidation/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/23_containers/bitset/operations/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/23_containers/bitset/operations/13838.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/23_containers/bitset/operations/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/23_containers/bitset/test/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/23_containers/bitset/to_string/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/23_containers/bitset/to_ulong/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/23_containers/deque/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/23_containers/deque/14340.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/23_containers/deque/18604.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/23_containers/deque/check_construct_destroy.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/23_containers/deque/cons/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/23_containers/deque/cons/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/23_containers/deque/cons/clear_allocator.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/23_containers/deque/invalidation/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/23_containers/deque/invalidation/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/23_containers/deque/invalidation/3.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/23_containers/deque/invalidation/4.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/23_containers/deque/modifiers/swap.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/23_containers/deque/operators/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/23_containers/list/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/23_containers/list/14340.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/23_containers/list/18604.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/23_containers/list/capacity/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/23_containers/list/check_construct_destroy.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/23_containers/list/cons/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/23_containers/list/cons/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/23_containers/list/cons/3.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/23_containers/list/cons/4.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/23_containers/list/cons/5.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/23_containers/list/cons/6.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/23_containers/list/cons/7.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/23_containers/list/cons/8.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/23_containers/list/cons/9.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/23_containers/list/cons/clear_allocator.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/23_containers/list/invalidation/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/23_containers/list/invalidation/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/23_containers/list/invalidation/3.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/23_containers/list/invalidation/4.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/23_containers/list/modifiers/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/23_containers/list/modifiers/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/23_containers/list/modifiers/3.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/23_containers/list/modifiers/swap.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/23_containers/list/operators/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/23_containers/list/operators/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/23_containers/list/operators/3.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/23_containers/list/operators/4.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/23_containers/map/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/23_containers/map/14340.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/23_containers/map/18604.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/23_containers/map/insert/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/23_containers/map/insert/16813.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/23_containers/map/invalidation/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/23_containers/map/invalidation/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/23_containers/map/modifiers/swap.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/23_containers/map/operators/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/23_containers/map/operators/1_neg.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/23_containers/multimap/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/23_containers/multimap/14340.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/23_containers/multimap/invalidation/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/23_containers/multimap/invalidation/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/23_containers/multimap/modifiers/swap.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/23_containers/multiset/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/23_containers/multiset/14340.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/23_containers/multiset/insert/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/23_containers/multiset/insert/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/23_containers/multiset/invalidation/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/23_containers/multiset/invalidation/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/23_containers/multiset/modifiers/swap.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/23_containers/priority_queue/members/7161.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/23_containers/queue/members/7157.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/23_containers/set/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/23_containers/set/14340.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/23_containers/set/18604.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/23_containers/set/check_construct_destroy.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/23_containers/set/insert/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/23_containers/set/invalidation/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/23_containers/set/invalidation/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/23_containers/set/modifiers/16728.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/23_containers/set/modifiers/17948.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/23_containers/set/modifiers/swap.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/23_containers/set/operators/1_neg.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/23_containers/stack/members/7158.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/23_containers/vector/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/23_containers/vector/14340.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/23_containers/vector/18604.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/23_containers/vector/bool/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/23_containers/vector/bool/21244.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/23_containers/vector/bool/6886.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/23_containers/vector/bool/clear_allocator.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/23_containers/vector/capacity/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/23_containers/vector/capacity/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/23_containers/vector/capacity/8230.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/23_containers/vector/check_construct_destroy.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/23_containers/vector/cons/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/23_containers/vector/cons/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/23_containers/vector/cons/3.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/23_containers/vector/cons/4.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/23_containers/vector/cons/6513.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/23_containers/vector/cons/clear_allocator.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/23_containers/vector/element_access/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/23_containers/vector/invalidation/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/23_containers/vector/invalidation/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/23_containers/vector/invalidation/3.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/23_containers/vector/invalidation/4.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/23_containers/vector/modifiers/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/23_containers/vector/modifiers/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/23_containers/vector/modifiers/insert/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/23_containers/vector/modifiers/swap.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/23_containers/vector/resize/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/24_iterators/back_insert_iterator.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/24_iterators/front_insert_iterator.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/24_iterators/insert_iterator.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/24_iterators/istream_iterator.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/24_iterators/istreambuf_iterator/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/24_iterators/istreambuf_iterator/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/24_iterators/istreambuf_iterator/2627.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/24_iterators/iterator.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/24_iterators/ostream_iterator.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/24_iterators/ostreambuf_iterator/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/24_iterators/ostreambuf_iterator/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/24_iterators/reverse_iterator/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/24_iterators/reverse_iterator/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/24_iterators/reverse_iterator/3.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/25_algorithms/binary_search.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/25_algorithms/copy/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/25_algorithms/copy/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/25_algorithms/copy/3.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/25_algorithms/copy/4.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/25_algorithms/fill/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/25_algorithms/fill/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/25_algorithms/find_first_of/concept_check_1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/25_algorithms/iter_swap/20577.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/25_algorithms/min_max.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/25_algorithms/search_n/11400.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/25_algorithms/search_n/check_type.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/25_algorithms/search_n/iterator.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/25_algorithms/sort.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/25_algorithms/unique/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/25_algorithms/unique/11480.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/25_algorithms/unique/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/26_numerics/cmath/19322.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/26_numerics/cmath/c99_classification_macros_c++.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/26_numerics/cmath/c99_classification_macros_c.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/26_numerics/cmath/c_math.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/26_numerics/cmath/c_math_dynamic.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/26_numerics/cmath/fabs_inline.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/26_numerics/cmath/powi.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/26_numerics/complex/13450.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/26_numerics/complex/buggy_complex.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/26_numerics/complex/complex_inserters_extractors.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/26_numerics/complex/complex_value.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/26_numerics/numeric/sum_diff.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/26_numerics/valarray/slice.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/26_numerics/valarray/slice_array_assignment.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/26_numerics/valarray/valarray.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/26_numerics/valarray/valarray_const_bracket.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/26_numerics/valarray/valarray_name_lookup.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/26_numerics/valarray/valarray_operators.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/26_numerics/valarray/valarray_subset_assignment.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/3.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/4.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/close/12790-1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/close/char/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/close/char/12790-1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/close/char/12790-2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/close/char/12790-3.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/close/char/12790-4.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/close/char/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/close/char/3.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/close/char/4.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/close/char/4879.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/close/char/5.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/close/char/9964.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/close/wchar_t/12790-1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/close/wchar_t/12790-2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/close/wchar_t/12790-3.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/close/wchar_t/12790-4.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/cons/char/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/cons/wchar_t/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/cons/wchar_t/10132-1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/imbue/12206.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/imbue/char/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/imbue/char/13007.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/imbue/char/13171-1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/imbue/char/13171-2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/imbue/char/13171-4.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/imbue/char/13582-2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/imbue/char/14975-1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/imbue/char/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/imbue/char/3.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/imbue/char/9322.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/imbue/wchar_t/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/imbue/wchar_t/12868.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/imbue/wchar_t/13007.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/imbue/wchar_t/13171-3.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/imbue/wchar_t/13582-2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/imbue/wchar_t/13582-3.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/imbue/wchar_t/14975-2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/imbue/wchar_t/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/imbue/wchar_t/3.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/imbue/wchar_t/9322.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/in_avail/char/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/in_avail/char/9701-3.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/is_open/char/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/open/12790-1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/open/char/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/open/char/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/open/char/3.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/open/char/9507.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/overflow/char/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/overflow/char/13858.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/overflow/char/2-unbuf.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/overflow/char/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/overflow/char/3599.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/overflow/char/9169.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/overflow/char/9182-2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/overflow/char/9988.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/overflow/wchar_t/11305-1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/overflow/wchar_t/11305-2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/overflow/wchar_t/11305-3.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/overflow/wchar_t/11305-4.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/overflow/wchar_t/13858.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/pbackfail/char/9761.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/sbumpc/char/1-in.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/sbumpc/char/1-io.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/sbumpc/char/1-out.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/sbumpc/char/2-in.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/sbumpc/char/2-io.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/sbumpc/char/2-out.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/sbumpc/char/9825.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/10132-2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/12790-1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/12790-2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/12790-3.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/12790-4.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/char/1-in.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/char/1-io.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/char/1-out.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/char/11543.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/char/12232.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/char/12790-1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/char/12790-2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/char/12790-3.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/char/12790-4.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/char/2-in.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/char/2-io.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/char/2-out.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/char/3-in.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/char/3-io.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/char/3-out.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/wchar_t/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/wchar_t/11543.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-3.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-4.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/wchar_t/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/wchar_t/3.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/wchar_t/9875_seekoff.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/10132-3.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/12790-1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/12790-2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/12790-3.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/char/1-in.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/char/1-io.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/char/1-out.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/char/12790-1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/char/12790-2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/char/12790-3.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/char/12790-4.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/char/2-in.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/char/2-io.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/char/2-out.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/char/3-in.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/char/3-io.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/char/3-out.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/wchar_t/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-3.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-4.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/wchar_t/9874.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/wchar_t/9875_seekpos.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/setbuf/char/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/setbuf/char/12875-1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/setbuf/char/12875-2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/setbuf/char/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/setbuf/char/3.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/sgetc/char/1-in.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/sgetc/char/1-io.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/sgetc/char/1-out.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/sgetc/char/2-in.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/sgetc/char/2-io.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/sgetc/char/2-out.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/sgetn/char/1-in.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/sgetn/char/1-io.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/sgetn/char/1-out.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/sgetn/char/2-in.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/sgetn/char/2-io.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/sgetn/char/2-out.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/sgetn/char/3.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/showmanyc/char/9533-1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/showmanyc/char/9533-2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/snextc/char/1-in.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/snextc/char/1-io.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/snextc/char/1-out.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/snextc/char/2-in.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/snextc/char/2-io.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/snextc/char/2-out.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/sputbackc/char/1-in.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/sputbackc/char/1-io.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/sputbackc/char/1-out.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/sputbackc/char/2-in.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/sputbackc/char/2-io.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/sputbackc/char/2-out.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/sputbackc/char/9425.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/sputc/char/1-in.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/sputc/char/1-io.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/sputc/char/1-out.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/sputc/char/1057.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/sputc/char/2-in.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/sputc/char/2-io.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/sputc/char/2-out.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/sputc/char/9701-2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/sputn/char/1-in.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/sputn/char/1-io.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/sputn/char/1-out.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/sputn/char/1057.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/sputn/char/2-in.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/sputn/char/2-io.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/sputn/char/2-out.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/sputn/char/9339.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/sputn/char/9701-1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/sungetc/char/1-in.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/sungetc/char/1-io.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/sungetc/char/1-out.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/sungetc/char/2-in.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/sungetc/char/2-io.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/sungetc/char/2-out.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/sync/char/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/sync/char/1057.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/sync/char/9182-1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/sync/wchar_t/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/underflow/10096.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/underflow/char/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/underflow/char/10097.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/underflow/char/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/underflow/char/9027.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/underflow/wchar_t/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/underflow/wchar_t/11389-1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/underflow/wchar_t/11389-2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/underflow/wchar_t/11389-3.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/underflow/wchar_t/11389-4.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/underflow/wchar_t/11544-1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/underflow/wchar_t/11544-2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/underflow/wchar_t/11603.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/underflow/wchar_t/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/underflow/wchar_t/3.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/underflow/wchar_t/4.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/underflow/wchar_t/5.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/underflow/wchar_t/9178.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/underflow/wchar_t/9520.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_fstream/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_fstream/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_fstream/3.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_fstream/4.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_fstream/rdbuf/char/2832.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_ifstream/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_ifstream/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_ifstream/3.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_ifstream/4.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_ifstream/cons/char/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_ifstream/open/char/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_ifstream/rdbuf/char/2832.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_ios/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_ios/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_ios/3.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_ios/4.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_ios/clear/char/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_ios/cons/char/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_ios/cons/char/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_ios/cons/char/3.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_ios/copyfmt/char/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_ios/copyfmt/char/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_ios/exceptions/char/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_ios/exceptions/char/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_ios/imbue/14072.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_ios/locales/char/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_iostream/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_iostream/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_iostream/3.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_iostream/4.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istream/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istream/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istream/3.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istream/4.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istream/exceptions/char/9561.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istream/exceptions/wchar_t/9561.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istream/extractors_arithmetic/char/01.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istream/extractors_arithmetic/char/02.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istream/extractors_arithmetic/char/03.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istream/extractors_arithmetic/char/06.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istream/extractors_arithmetic/char/07.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istream/extractors_arithmetic/char/08.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istream/extractors_arithmetic/char/09.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istream/extractors_arithmetic/char/10.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istream/extractors_arithmetic/char/11.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istream/extractors_arithmetic/char/12.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istream/extractors_arithmetic/char/13.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istream/extractors_arithmetic/char/9555-ia.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istream/extractors_arithmetic/char/exceptions_badbit_throw.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istream/extractors_arithmetic/char/exceptions_failbit.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istream/extractors_arithmetic/char/exceptions_failbit_throw.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istream/extractors_arithmetic/pod/3983-1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istream/extractors_arithmetic/wchar_t/01.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istream/extractors_arithmetic/wchar_t/02.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istream/extractors_arithmetic/wchar_t/03.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istream/extractors_arithmetic/wchar_t/06.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istream/extractors_arithmetic/wchar_t/07.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istream/extractors_arithmetic/wchar_t/08.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istream/extractors_arithmetic/wchar_t/09.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istream/extractors_arithmetic/wchar_t/10.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istream/extractors_arithmetic/wchar_t/11.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istream/extractors_arithmetic/wchar_t/12.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istream/extractors_arithmetic/wchar_t/13.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istream/extractors_arithmetic/wchar_t/9555-ia.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istream/extractors_arithmetic/wchar_t/exceptions_badbit_throw.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istream/extractors_arithmetic/wchar_t/exceptions_failbit.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istream/extractors_arithmetic/wchar_t/exceptions_failbit_throw.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istream/extractors_character/char/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istream/extractors_character/char/11095-i.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istream/extractors_character/char/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istream/extractors_character/char/3.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istream/extractors_character/char/9555-ic.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istream/extractors_character/char/9826.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istream/extractors_character/pod/3983-2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istream/extractors_character/wchar_t/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istream/extractors_character/wchar_t/11095-i.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istream/extractors_character/wchar_t/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istream/extractors_character/wchar_t/3.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istream/extractors_character/wchar_t/9555-ic.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istream/extractors_other/char/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istream/extractors_other/char/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istream/extractors_other/char/3.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istream/extractors_other/char/9318-in.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istream/extractors_other/char/9424-in.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istream/extractors_other/char/9555-io.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istream/extractors_other/char/error_failbit.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istream/extractors_other/char/exceptions_badbit_throw.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istream/extractors_other/char/exceptions_failbit_throw.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istream/extractors_other/char/exceptions_null.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istream/extractors_other/pod/3983-3.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istream/extractors_other/wchar_t/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istream/extractors_other/wchar_t/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istream/extractors_other/wchar_t/3.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istream/extractors_other/wchar_t/9318-in.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istream/extractors_other/wchar_t/9424-in.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istream/extractors_other/wchar_t/9555-io.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istream/extractors_other/wchar_t/error_failbit.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istream/extractors_other/wchar_t/exceptions_badbit_throw.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istream/extractors_other/wchar_t/exceptions_failbit_throw.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istream/extractors_other/wchar_t/exceptions_null.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istream/get/char/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istream/get/char/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istream/get/char/3.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istream/get/wchar_t/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istream/get/wchar_t/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istream/get/wchar_t/3.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istream/getline/char/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istream/getline/char/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istream/getline/char/3.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istream/getline/char/4.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istream/getline/char/5.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istream/getline/char/6.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istream/getline/wchar_t/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istream/getline/wchar_t/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istream/getline/wchar_t/3.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istream/getline/wchar_t/4.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istream/getline/wchar_t/5.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istream/getline/wchar_t/6.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istream/ignore/char/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istream/ignore/char/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istream/ignore/char/3.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istream/ignore/char/6360.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istream/ignore/char/7220.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istream/ignore/wchar_t/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istream/ignore/wchar_t/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istream/ignore/wchar_t/3.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istream/ignore/wchar_t/6360.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istream/ignore/wchar_t/7220.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istream/peek/char/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istream/peek/char/12296.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istream/peek/char/6414.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istream/peek/wchar_t/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istream/peek/wchar_t/12296.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istream/peek/wchar_t/6414.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istream/putback/char/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istream/putback/wchar_t/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istream/read/char/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istream/read/char/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istream/read/char/3.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istream/read/wchar_t/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istream/read/wchar_t/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istream/read/wchar_t/3.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istream/readsome/char/6746-1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istream/readsome/char/6746-2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istream/readsome/char/8258.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istream/readsome/wchar_t/6746-1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istream/readsome/wchar_t/6746-2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istream/readsome/wchar_t/8258.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istream/seekg/char/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istream/seekg/char/8348-1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istream/seekg/char/8348-2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istream/seekg/char/exceptions_badbit_throw.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istream/seekg/char/fstream.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istream/seekg/char/sstream.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istream/seekg/wchar_t/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istream/seekg/wchar_t/8348-1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istream/seekg/wchar_t/8348-2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istream/seekg/wchar_t/exceptions_badbit_throw.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istream/seekg/wchar_t/fstream.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istream/seekg/wchar_t/sstream.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istream/sentry/char/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istream/sentry/char/12297.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istream/sentry/char/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istream/sentry/char/3.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istream/sentry/pod/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istream/sentry/wchar_t/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istream/sentry/wchar_t/12297.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istream/sentry/wchar_t/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istream/sentry/wchar_t/3.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istream/tellg/char/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istream/tellg/char/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istream/tellg/char/8348.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istream/tellg/char/exceptions_badbit_throw.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istream/tellg/char/fstream.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istream/tellg/char/sstream.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istream/tellg/wchar_t/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istream/tellg/wchar_t/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istream/tellg/wchar_t/8348.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istream/tellg/wchar_t/exceptions_badbit_throw.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istream/tellg/wchar_t/fstream.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istream/tellg/wchar_t/sstream.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istream/ws/char/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istream/ws/wchar_t/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istringstream/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istringstream/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istringstream/3.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istringstream/4.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istringstream/rdbuf/char/2832.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istringstream/rdbuf/wchar_t/2832.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istringstream/str/char/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_istringstream/str/wchar_t/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_ofstream/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_ofstream/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_ofstream/3.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_ofstream/4.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_ofstream/cons/char/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_ofstream/open/char/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_ofstream/rdbuf/char/2832.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_ostream/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_ostream/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_ostream/3.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_ostream/4.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_ostream/cons/char/9827.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_ostream/cons/wchar_t/9827.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_ostream/endl/char/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_ostream/endl/wchar_t/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_ostream/ends/char/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_ostream/ends/char/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_ostream/ends/wchar_t/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_ostream/ends/wchar_t/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_ostream/exceptions/char/9561.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_ostream/exceptions/wchar_t/9561.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_ostream/flush/char/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_ostream/flush/char/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_ostream/flush/char/exceptions_badbit_throw.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_ostream/flush/wchar_t/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_ostream/flush/wchar_t/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_ostream/flush/wchar_t/exceptions_badbit_throw.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_arithmetic/char/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_arithmetic/char/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_arithmetic/char/3.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_arithmetic/char/4.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_arithmetic/char/4402.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_arithmetic/char/5.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_arithmetic/char/6.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_arithmetic/char/9555-oa.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_arithmetic/char/exceptions_badbit_throw.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_arithmetic/char/exceptions_failbit_throw.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_arithmetic/wchar_t/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_arithmetic/wchar_t/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_arithmetic/wchar_t/3.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_arithmetic/wchar_t/4.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_arithmetic/wchar_t/4402.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_arithmetic/wchar_t/5.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_arithmetic/wchar_t/6.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_arithmetic/wchar_t/9555-oa.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_arithmetic/wchar_t/exceptions_badbit_throw.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_arithmetic/wchar_t/exceptions_failbit_throw.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_character/char/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_character/char/11095-oa.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_character/char/11095-ob.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_character/char/11095-oc.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_character/char/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_character/char/3.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_character/char/4.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_character/char/5.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_character/char/6.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_character/char/8.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_character/char/9555-oc.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_character/wchar_t/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_character/wchar_t/11095-od.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_character/wchar_t/11095-oe.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_character/wchar_t/11095-of.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_character/wchar_t/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_character/wchar_t/3.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_character/wchar_t/4.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_character/wchar_t/5.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_character/wchar_t/6.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_character/wchar_t/7.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_character/wchar_t/8.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_character/wchar_t/9555-oc.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_other/char/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_other/char/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_other/char/3.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_other/char/4.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_other/char/5.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_other/char/9318-out.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_other/char/9424-out.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_other/char/9555-oo.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_other/char/error_failbit.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_other/char/exceptions_badbit_throw.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_other/char/exceptions_failbit_throw.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_other/char/exceptions_null.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_other/wchar_t/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_other/wchar_t/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_other/wchar_t/3.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_other/wchar_t/4.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_other/wchar_t/5.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_other/wchar_t/9318-out.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_other/wchar_t/9424-out.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_other/wchar_t/9555-oo.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_other/wchar_t/error_failbit.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_other/wchar_t/exceptions_badbit_throw.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_other/wchar_t/exceptions_failbit_throw.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_other/wchar_t/exceptions_null.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_ostream/put/char/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_ostream/put/wchar_t/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_ostream/seekp/char/2346-fstream.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_ostream/seekp/char/2346-sstream.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_ostream/seekp/char/exceptions_badbit_throw.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_ostream/seekp/wchar_t/2346-fstream.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_ostream/seekp/wchar_t/2346-sstream.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_ostream/seekp/wchar_t/exceptions_badbit_throw.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_ostream/sentry/char/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_ostream/sentry/char/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_ostream/sentry/pod/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_ostream/sentry/wchar_t/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_ostream/sentry/wchar_t/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_ostream/tellp/char/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_ostream/tellp/char/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_ostream/tellp/char/exceptions_badbit_throw.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_ostream/tellp/wchar_t/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_ostream/tellp/wchar_t/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_ostream/tellp/wchar_t/exceptions_badbit_throw.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_ostream/write/char/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_ostream/write/wchar_t/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_ostringstream/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_ostringstream/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_ostringstream/3.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_ostringstream/4.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_ostringstream/cons/char/3.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_ostringstream/cons/wchar_t/3.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_ostringstream/rdbuf/char/2832.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_ostringstream/rdbuf/wchar_t/2832.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_ostringstream/str/char/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_ostringstream/str/char/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_ostringstream/str/wchar_t/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_ostringstream/str/wchar_t/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_streambuf/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_streambuf/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_streambuf/3.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_streambuf/cons/char/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_streambuf/cons/wchar_t/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_streambuf/imbue/char/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_streambuf/imbue/char/13007-1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_streambuf/imbue/char/13007-2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_streambuf/imbue/char/9322.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_streambuf/imbue/wchar_t/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_streambuf/imbue/wchar_t/13007-1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_streambuf/imbue/wchar_t/13007-2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_streambuf/imbue/wchar_t/9322.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_streambuf/in_avail/char/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_streambuf/in_avail/wchar_t/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_streambuf/overflow/char/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_streambuf/overflow/char/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_streambuf/overflow/char/3599.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_streambuf/overflow/wchar_t/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_streambuf/overflow/wchar_t/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_streambuf/overflow/wchar_t/3599.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_streambuf/sgetc/char/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_streambuf/sgetc/wchar_t/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_streambuf/sgetn/char/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_streambuf/sgetn/wchar_t/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_streambuf/sputbackc/char/9538.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_streambuf/sputbackc/wchar_t/9538.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_streambuf/sputc/char/1057.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_streambuf/sputc/wchar_t/1057.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_streambuf/sputn/char/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_streambuf/sputn/char/1057.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_streambuf/sputn/wchar_t/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_streambuf/sputn/wchar_t/1057.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_streambuf/sync/char/1057.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_streambuf/sync/wchar_t/1057.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_stringbuf/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_stringbuf/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_stringbuf/3.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_stringbuf/4.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_stringbuf/5.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_stringbuf/cons/char/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_stringbuf/cons/wchar_t/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_stringbuf/imbue/char/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_stringbuf/imbue/char/9322.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_stringbuf/imbue/wchar_t/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_stringbuf/imbue/wchar_t/9322.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_stringbuf/in_avail/char/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_stringbuf/in_avail/char/21955.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_stringbuf/in_avail/wchar_t/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_stringbuf/overflow/char/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_stringbuf/overflow/char/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_stringbuf/overflow/char/3599.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_stringbuf/overflow/char/9988.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_stringbuf/overflow/wchar_t/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_stringbuf/overflow/wchar_t/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_stringbuf/overflow/wchar_t/3599.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_stringbuf/overflow/wchar_t/9988.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_stringbuf/pbackfail/char/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_stringbuf/pbackfail/char/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_stringbuf/pbackfail/wchar_t/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_stringbuf/pbackfail/wchar_t/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_stringbuf/sbumpc/char/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_stringbuf/sbumpc/char/9825.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_stringbuf/sbumpc/wchar_t/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_stringbuf/sbumpc/wchar_t/9825.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_stringbuf/seekoff/char/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_stringbuf/seekoff/char/10975.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_stringbuf/seekoff/char/16956.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_stringbuf/seekoff/char/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_stringbuf/seekoff/wchar_t/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_stringbuf/seekoff/wchar_t/10975.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_stringbuf/seekoff/wchar_t/16956.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_stringbuf/seekoff/wchar_t/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_stringbuf/seekpos/char/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_stringbuf/seekpos/char/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_stringbuf/seekpos/char/3.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_stringbuf/seekpos/wchar_t/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_stringbuf/seekpos/wchar_t/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_stringbuf/seekpos/wchar_t/3.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_stringbuf/setbuf/char/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_stringbuf/setbuf/char/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_stringbuf/setbuf/char/3.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_stringbuf/setbuf/char/4.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_stringbuf/setbuf/wchar_t/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_stringbuf/setbuf/wchar_t/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_stringbuf/setbuf/wchar_t/3.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_stringbuf/setbuf/wchar_t/4.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_stringbuf/sgetc/char/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_stringbuf/sgetc/wchar_t/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_stringbuf/sgetn/char/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_stringbuf/sgetn/wchar_t/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_stringbuf/snextc/char/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_stringbuf/snextc/wchar_t/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_stringbuf/sputbackc/char/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_stringbuf/sputbackc/char/9425.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_stringbuf/sputbackc/wchar_t/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_stringbuf/sputbackc/wchar_t/9425.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_stringbuf/sputc/char/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_stringbuf/sputc/char/1057.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_stringbuf/sputc/char/9404-1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_stringbuf/sputc/wchar_t/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_stringbuf/sputc/wchar_t/1057.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_stringbuf/sputc/wchar_t/9404-1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_stringbuf/sputn/char/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_stringbuf/sputn/char/1057.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_stringbuf/sputn/char/9404-2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_stringbuf/sputn/wchar_t/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_stringbuf/sputn/wchar_t/1057.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_stringbuf/sputn/wchar_t/9404-2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_stringbuf/str/char/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_stringbuf/str/char/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_stringbuf/str/char/3.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_stringbuf/str/char/3955.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_stringbuf/str/wchar_t/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_stringbuf/str/wchar_t/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_stringbuf/str/wchar_t/3.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_stringbuf/str/wchar_t/3955.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_stringbuf/sungetc/char/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_stringbuf/sungetc/wchar_t/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_stringbuf/sync/char/1057.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_stringbuf/sync/wchar_t/1057.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_stringstream/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_stringstream/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_stringstream/3.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_stringstream/4.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_stringstream/rdbuf/char/2832.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_stringstream/rdbuf/wchar_t/2832.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_stringstream/str/char/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_stringstream/str/char/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_stringstream/str/char/3.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_stringstream/str/char/4.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_stringstream/str/wchar_t/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_stringstream/str/wchar_t/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_stringstream/str/wchar_t/3.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/basic_stringstream/str/wchar_t/4.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/fpos/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/fpos/11450.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/fpos/14252.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/fpos/14320-1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/fpos/14320-2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/fpos/14320-3.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/fpos/14320-4.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/fpos/14320-5.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/fpos/14775.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/fpos/mbstate_t/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/fpos/mbstate_t/12065.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/fpos/mbstate_t/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/fpos/mbstate_t/3.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/fpos/mbstate_t/4_neg.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/ios_base/callbacks/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/ios_base/cons/assign_neg.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/ios_base/cons/copy_neg.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/ios_base/state/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/ios_base/storage/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/ios_base/storage/11584.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/ios_base/storage/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/ios_base/storage/3.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/ios_base/sync_with_stdio/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/ios_base/sync_with_stdio/16959.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/ios_base/sync_with_stdio/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/ios_base/sync_with_stdio/9523.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/ios_base/types/fmtflags/bitmask_operators.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/ios_base/types/fmtflags/case_label.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/ios_base/types/iostate/bitmask_operators.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/ios_base/types/iostate/case_label.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/ios_base/types/openmode/bitmask_operators.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/ios_base/types/openmode/case_label.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/ios_base/types/seekdir/case_label.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/manipulators/adjustfield/char/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/manipulators/adjustfield/char/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/manipulators/adjustfield/wchar_t/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/manipulators/adjustfield/wchar_t/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/manipulators/basefield/char/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/manipulators/basefield/wchar_t/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/manipulators/standard/char/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/manipulators/standard/char/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/manipulators/standard/wchar_t/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/manipulators/standard/wchar_t/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/objects/char/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/objects/char/10.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/objects/char/12048-1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/objects/char/12048-2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/objects/char/12048-3.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/objects/char/12048-4.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/objects/char/12048-5.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/objects/char/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/objects/char/2523-1_xin.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/objects/char/2523-2_xin.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/objects/char/3045.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/objects/char/3647.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/objects/char/3_xin.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/objects/char/4_xin.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/objects/char/5.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/objects/char/5268.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/objects/char/5280_xin.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/objects/char/6.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/objects/char/6548_xin.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/objects/char/6648-1_xin.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/objects/char/6648-2_xin.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/objects/char/7.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/objects/char/7744_xin.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/objects/char/8.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/objects/char/9.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/objects/char/9661-1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/objects/char/9661-2_xin.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/objects/wchar_t/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/objects/wchar_t/10.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/objects/wchar_t/11.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/objects/wchar_t/12.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/objects/wchar_t/12048-1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/objects/wchar_t/12048-2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/objects/wchar_t/12048-3.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/objects/wchar_t/12048-4.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/objects/wchar_t/12048-5.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/objects/wchar_t/13.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/objects/wchar_t/13582-1_xin.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/objects/wchar_t/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/objects/wchar_t/2523-1_xin.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/objects/wchar_t/2523-2_xin.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/objects/wchar_t/3045.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/objects/wchar_t/3647.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/objects/wchar_t/3_xin.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/objects/wchar_t/4_xin.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/objects/wchar_t/5.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/objects/wchar_t/5268.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/objects/wchar_t/5280_xin.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/objects/wchar_t/6.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/objects/wchar_t/6548_xin.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/objects/wchar_t/6648-1_xin.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/objects/wchar_t/6648-2_xin.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/objects/wchar_t/7.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/objects/wchar_t/7744_xin.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/objects/wchar_t/8.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/objects/wchar_t/9520.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/objects/wchar_t/9661-1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/objects/wchar_t/9661-2_xin.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/objects/wchar_t/9662.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/objects/wchar_t/9_xin.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/types/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/types/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/27_io/types/3.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/Makefile.am buildtools/trunk/gcc/libstdc++-v3/testsuite/Makefile.in buildtools/trunk/gcc/libstdc++-v3/testsuite/backward/11460.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/backward/header_deque_h.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/backward/header_hash_map_h.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/backward/header_hash_set_h.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/backward/header_hashtable_h.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/backward/header_iterator_h.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/backward/header_rope_h.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/backward/header_slist_h.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/backward/header_tempbuf_h.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/backward/strstream_members.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/config/default.exp buildtools/trunk/gcc/libstdc++-v3/testsuite/data/filebuf_virtuals-1.tst buildtools/trunk/gcc/libstdc++-v3/testsuite/data/filebuf_virtuals-1.txt buildtools/trunk/gcc/libstdc++-v3/testsuite/data/istream_extractor_other-1.tst buildtools/trunk/gcc/libstdc++-v3/testsuite/data/istream_extractor_other-1.txt buildtools/trunk/gcc/libstdc++-v3/testsuite/data/istream_extractor_other-2.tst buildtools/trunk/gcc/libstdc++-v3/testsuite/data/ostream_inserter_other-1.tst buildtools/trunk/gcc/libstdc++-v3/testsuite/data/ostream_inserter_other-2.tst buildtools/trunk/gcc/libstdc++-v3/testsuite/data/wistream_extractor_other-1.tst buildtools/trunk/gcc/libstdc++-v3/testsuite/data/wistream_extractor_other-1.txt buildtools/trunk/gcc/libstdc++-v3/testsuite/data/wistream_extractor_other-2.tst buildtools/trunk/gcc/libstdc++-v3/testsuite/data/wostream_inserter_other-1.tst buildtools/trunk/gcc/libstdc++-v3/testsuite/data/wostream_inserter_other-2.tst buildtools/trunk/gcc/libstdc++-v3/testsuite/demangle/abi_examples/01.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/demangle/abi_examples/02.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/demangle/abi_examples/03.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/demangle/abi_examples/04.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/demangle/abi_examples/05.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/demangle/abi_examples/06.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/demangle/abi_examples/07.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/demangle/abi_examples/08.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/demangle/abi_examples/09.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/demangle/abi_examples/10.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/demangle/abi_examples/11.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/demangle/abi_examples/12.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/demangle/abi_examples/13.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/demangle/abi_examples/14.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/demangle/abi_examples/15.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/demangle/abi_examples/16.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/demangle/abi_examples/17.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/demangle/abi_examples/18.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/demangle/abi_examples/19.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/demangle/abi_examples/20.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/demangle/abi_examples/21.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/demangle/abi_examples/22.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/demangle/abi_examples/23.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/demangle/abi_examples/24.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/demangle/abi_examples/25.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/demangle/abi_examples/26.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/demangle/abi_text/01.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/demangle/abi_text/02.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/demangle/abi_text/03.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/demangle/abi_text/04.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/demangle/abi_text/05.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/demangle/abi_text/06.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/demangle/abi_text/07.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/demangle/abi_text/08.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/demangle/abi_text/09.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/demangle/abi_text/10.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/demangle/abi_text/11.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/demangle/abi_text/12.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/demangle/abi_text/13.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/demangle/abi_text/14.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/demangle/regression/3111-1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/demangle/regression/3111-2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/demangle/regression/7986-01.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/demangle/regression/7986-02.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/demangle/regression/7986-03.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/demangle/regression/7986-04.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/demangle/regression/7986-05.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/demangle/regression/7986-06.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/demangle/regression/7986-07.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/demangle/regression/7986-08.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/demangle/regression/7986-09.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/demangle/regression/7986-10.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/demangle/regression/7986-11.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/demangle/regression/7986-12.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/demangle/regression/7986.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/demangle/regression/8897.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/demangle/regression/cw-01.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/demangle/regression/cw-02.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/demangle/regression/cw-03.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/demangle/regression/cw-04.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/demangle/regression/cw-05.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/demangle/regression/cw-06.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/demangle/regression/cw-07.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/demangle/regression/cw-08.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/demangle/regression/cw-09.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/demangle/regression/cw-10.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/demangle/regression/cw-11.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/demangle/regression/cw-12.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/demangle/regression/cw-13.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/demangle/regression/cw-14.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/demangle/regression/cw-15.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/demangle/regression/cw-16.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/demangle/regression/old.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/ext/array_allocator/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/ext/array_allocator/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/ext/array_allocator/3.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/ext/array_allocator/check_allocate_max_size.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/ext/array_allocator/check_deallocate_null.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/ext/array_allocator/check_delete.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/ext/array_allocator/check_new.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/ext/bitmap_allocator/check_allocate_max_size.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/ext/bitmap_allocator/check_deallocate_null.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/ext/bitmap_allocator/check_delete.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/ext/bitmap_allocator/check_new.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/ext/concept_checks.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/ext/debug_allocator/check_deallocate_null.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/ext/debug_allocator/check_delete.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/ext/debug_allocator/check_new.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/ext/debug_allocator/instantiate.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/ext/enc_filebuf/char/13189.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/ext/enc_filebuf/char/13598.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/ext/enc_filebuf/wchar_t/13189.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/ext/hash_map/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/ext/hash_map/14648.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/ext/hash_map/instantiate.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/ext/hash_set/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/ext/hash_set/check_construct_destroy.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/ext/hash_set/instantiate.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/ext/headers.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/ext/malloc_allocator/check_allocate_max_size.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/ext/malloc_allocator/check_deallocate_null.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/ext/malloc_allocator/check_delete.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/ext/malloc_allocator/check_new.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/ext/malloc_allocator/deallocate_global.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/ext/malloc_allocator/deallocate_local.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/ext/malloc_allocator/instantiate.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/ext/mt_allocator/check_allocate_big_per_type.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/ext/mt_allocator/check_allocate_max_size.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/ext/mt_allocator/check_deallocate_null.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/ext/mt_allocator/check_deallocate_null_thread.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/ext/mt_allocator/check_delete.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/ext/mt_allocator/check_new.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_global-2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_global-4.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_global_thread-1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_global_thread-3.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_local-2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_local-4.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_local_thread-1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/ext/mt_allocator/deallocate_local_thread-3.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/ext/mt_allocator/instantiate.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/ext/mt_allocator/tune-1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/ext/mt_allocator/tune-2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/ext/mt_allocator/tune-3.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/ext/mt_allocator/tune-4.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/ext/new_allocator/check_allocate_max_size.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/ext/new_allocator/check_deallocate_null.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/ext/new_allocator/check_delete.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/ext/new_allocator/check_new.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/ext/new_allocator/deallocate_global.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/ext/new_allocator/deallocate_local.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/ext/new_allocator/instantiate.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/ext/pod_char_traits.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/ext/pool_allocator/allocate_chunk.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/ext/pool_allocator/check_allocate_max_size.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/ext/pool_allocator/check_deallocate_null.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/ext/pool_allocator/check_delete.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/ext/pool_allocator/check_new.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/ext/pool_allocator/instantiate.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/ext/rope/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/ext/rope/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/ext/rope/3.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/ext/rope/4.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/ext/slist/check_construct_destroy.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/ext/slist/instantiate.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/ext/stdio_filebuf/char/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/ext/stdio_filebuf/char/10063-1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/ext/stdio_filebuf/char/10063-2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/ext/stdio_filebuf/char/10063-3.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/ext/stdio_filebuf/char/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/ext/stdio_sync_filebuf/char/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/ext/stdio_sync_filebuf/char/12048-1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/ext/stdio_sync_filebuf/char/12048-2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/ext/stdio_sync_filebuf/char/12048-3.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/ext/stdio_sync_filebuf/char/12048-4.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/ext/stdio_sync_filebuf/wchar_t/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/ext/stdio_sync_filebuf/wchar_t/12077.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/ext/stdio_sync_filebuf/wchar_t/12948-1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/ext/stdio_sync_filebuf/wchar_t/12948-2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/ext/stdio_sync_filebuf/wchar_t/12948-3.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/ext/stdio_sync_filebuf/wchar_t/12948-4.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/lib/dg-options.exp buildtools/trunk/gcc/libstdc++-v3/testsuite/lib/libstdc++.exp buildtools/trunk/gcc/libstdc++-v3/testsuite/lib/prune.exp buildtools/trunk/gcc/libstdc++-v3/testsuite/libstdc++-abi/abi.exp buildtools/trunk/gcc/libstdc++-v3/testsuite/libstdc++-dg/normal.exp buildtools/trunk/gcc/libstdc++-v3/testsuite/performance/21_strings/string_append.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/performance/21_strings/string_append_2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/performance/21_strings/string_cons_input_iterator.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/performance/21_strings/string_find.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/performance/22_locale/is_wchar_t.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/performance/22_locale/narrow_widen_char.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/performance/22_locale/narrow_widen_wchar_t.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/performance/22_locale/wchar_t_in.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/performance/22_locale/wchar_t_length.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/performance/22_locale/wchar_t_out.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/performance/25_algorithms/search_n.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/performance/26_numerics/complex_norm.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/performance/27_io/cout_insert_int.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/performance/27_io/filebuf_copy.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/performance/27_io/filebuf_sgetn_unbuf.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/performance/27_io/filebuf_sputc.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/performance/27_io/filebuf_sputn_unbuf.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/performance/27_io/fmtflags_manipulators.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/performance/27_io/fstream_seek_write.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/performance/27_io/ifstream_extract_float.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/performance/27_io/ifstream_extract_int.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/performance/27_io/ifstream_getline-2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/performance/27_io/ifstream_getline.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/performance/27_io/ofstream_insert_float.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/performance/27_io/ofstream_insert_int.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/performance/27_io/stringbuf_overflow.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/testsuite_abi.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/testsuite_abi.h buildtools/trunk/gcc/libstdc++-v3/testsuite/testsuite_abi_check.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/testsuite_allocator.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/testsuite_allocator.h buildtools/trunk/gcc/libstdc++-v3/testsuite/testsuite_character.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/testsuite_character.h buildtools/trunk/gcc/libstdc++-v3/testsuite/testsuite_hooks.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/testsuite_hooks.h buildtools/trunk/gcc/libstdc++-v3/testsuite/testsuite_io.h buildtools/trunk/gcc/libstdc++-v3/testsuite/testsuite_iterators.h buildtools/trunk/gcc/libstdc++-v3/testsuite/testsuite_performance.h buildtools/trunk/gcc/libstdc++-v3/testsuite/testsuite_tr1.h buildtools/trunk/gcc/libstdc++-v3/testsuite/thread/18185.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/thread/pthread1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/thread/pthread2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/thread/pthread3.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/thread/pthread4.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/thread/pthread5.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/thread/pthread6.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/thread/pthread7-rope.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/2_general_utilities/memory/enable_shared_from_this/not_shared.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/2_general_utilities/memory/enable_shared_from_this/not_shared2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/2_general_utilities/memory/enable_shared_from_this/not_shared3.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/2_general_utilities/memory/enable_shared_from_this/shared.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/2_general_utilities/memory/enable_shared_from_this/still_shared.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/2_general_utilities/memory/shared_ptr/assign/assign.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/2_general_utilities/memory/shared_ptr/assign/auto_ptr.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/2_general_utilities/memory/shared_ptr/assign/auto_ptr_neg.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/2_general_utilities/memory/shared_ptr/assign/auto_ptr_rvalue_neg.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/2_general_utilities/memory/shared_ptr/assign/shared_ptr.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/2_general_utilities/memory/shared_ptr/assign/shared_ptr_neg.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/2_general_utilities/memory/shared_ptr/comparison/cmp.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/2_general_utilities/memory/shared_ptr/cons/auto_ptr.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/2_general_utilities/memory/shared_ptr/cons/auto_ptr_neg.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/2_general_utilities/memory/shared_ptr/cons/copy.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/2_general_utilities/memory/shared_ptr/cons/default.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/2_general_utilities/memory/shared_ptr/cons/pointer.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/2_general_utilities/memory/shared_ptr/cons/weak_ptr.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/2_general_utilities/memory/shared_ptr/cons/weak_ptr_expired.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/2_general_utilities/memory/shared_ptr/dest/dest.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/2_general_utilities/memory/shared_ptr/misc/io.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/2_general_utilities/memory/shared_ptr/misc/swap.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/2_general_utilities/memory/shared_ptr/modifiers/reset.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/2_general_utilities/memory/shared_ptr/modifiers/reset_neg.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/2_general_utilities/memory/shared_ptr/modifiers/swap.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/2_general_utilities/memory/shared_ptr/modifiers/swap_neg.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/2_general_utilities/memory/shared_ptr/observers/bool_conv.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/2_general_utilities/memory/shared_ptr/observers/get.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/2_general_utilities/memory/shared_ptr/observers/unique.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/2_general_utilities/memory/shared_ptr/observers/use_count.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/3_function_objects/bind/all_bound.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/3_function_objects/bind/nested.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/3_function_objects/bind/placeholders.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/3_function_objects/bind/ref.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/3_function_objects/function/1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/3_function_objects/function/2.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/3_function_objects/function/3.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/3_function_objects/function/4.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/3_function_objects/function/5.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/3_function_objects/function/6.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/3_function_objects/function/7.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/3_function_objects/function/8.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/3_function_objects/function/9.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/3_function_objects/mem_fn.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/3_function_objects/reference_wrapper/invoke.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/3_function_objects/reference_wrapper/typedefs.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/3_function_objects/result_of.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/4_metaprogramming/array_modifications/remove_all_extents.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/4_metaprogramming/array_modifications/remove_extent.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/4_metaprogramming/composite_type_traits/is_arithmetic/is_arithmetic.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/4_metaprogramming/composite_type_traits/is_arithmetic/typedefs.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/4_metaprogramming/composite_type_traits/is_compound/is_compound.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/4_metaprogramming/composite_type_traits/is_compound/typedefs.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/4_metaprogramming/composite_type_traits/is_fundamental/is_fundamental.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/4_metaprogramming/composite_type_traits/is_fundamental/typedefs.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/4_metaprogramming/composite_type_traits/is_member_pointer/is_member_pointer.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/4_metaprogramming/composite_type_traits/is_member_pointer/typedefs.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/4_metaprogramming/composite_type_traits/is_object/is_object.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/4_metaprogramming/composite_type_traits/is_object/typedefs.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/4_metaprogramming/composite_type_traits/is_scalar/is_scalar.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/4_metaprogramming/composite_type_traits/is_scalar/typedefs.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/4_metaprogramming/composite_type_traits/is_union_or_class/is_union_or_class.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/4_metaprogramming/composite_type_traits/is_union_or_class/typedefs.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/4_metaprogramming/const_volatile_modifications/add_const.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/4_metaprogramming/const_volatile_modifications/add_cv.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/4_metaprogramming/const_volatile_modifications/add_volatile.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/4_metaprogramming/const_volatile_modifications/remove_const.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/4_metaprogramming/const_volatile_modifications/remove_cv.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/4_metaprogramming/const_volatile_modifications/remove_volatile.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/4_metaprogramming/helper_classes/true_false_type.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/4_metaprogramming/helper_classes/true_false_type_typedefs.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/4_metaprogramming/helper_classes/typedefs.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/4_metaprogramming/other_transformations/aligned_storage/aligned_storage.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/4_metaprogramming/other_transformations/aligned_storage/typedefs.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/4_metaprogramming/pointer_modifications/add_pointer.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/4_metaprogramming/pointer_modifications/remove_pointer.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/4_metaprogramming/primary_type_categories/is_array/is_array.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/4_metaprogramming/primary_type_categories/is_array/typedefs.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/4_metaprogramming/primary_type_categories/is_enum/is_enum.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/4_metaprogramming/primary_type_categories/is_enum/typedefs.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/4_metaprogramming/primary_type_categories/is_floating_point/is_floating_point.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/4_metaprogramming/primary_type_categories/is_floating_point/typedefs.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/4_metaprogramming/primary_type_categories/is_function/is_function.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/4_metaprogramming/primary_type_categories/is_function/typedefs.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/4_metaprogramming/primary_type_categories/is_integral/is_integral.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/4_metaprogramming/primary_type_categories/is_integral/typedefs.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/4_metaprogramming/primary_type_categories/is_member_function_pointer/is_member_function_pointer.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/4_metaprogramming/primary_type_categories/is_member_function_pointer/typedefs.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/4_metaprogramming/primary_type_categories/is_member_object_pointer/is_member_object_pointer.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/4_metaprogramming/primary_type_categories/is_member_object_pointer/typedefs.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/4_metaprogramming/primary_type_categories/is_pointer/is_pointer.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/4_metaprogramming/primary_type_categories/is_pointer/typedefs.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/4_metaprogramming/primary_type_categories/is_reference/is_reference.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/4_metaprogramming/primary_type_categories/is_reference/typedefs.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/4_metaprogramming/primary_type_categories/is_void/is_void.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/4_metaprogramming/primary_type_categories/is_void/typedefs.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/4_metaprogramming/reference_modifications/add_reference.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/4_metaprogramming/reference_modifications/remove_reference.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/4_metaprogramming/relationships_between_types/is_base_of/is_base_of.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/4_metaprogramming/relationships_between_types/is_base_of/typedefs.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/4_metaprogramming/relationships_between_types/is_convertible/is_convertible.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/4_metaprogramming/relationships_between_types/is_convertible/typedefs.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/4_metaprogramming/relationships_between_types/is_same/is_same.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/4_metaprogramming/relationships_between_types/is_same/typedefs.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/4_metaprogramming/type_properties/alignment_of/alignment_of.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/4_metaprogramming/type_properties/alignment_of/typedefs.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/4_metaprogramming/type_properties/extent/extent.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/4_metaprogramming/type_properties/extent/typedefs.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/4_metaprogramming/type_properties/has_nothrow_assign/has_nothrow_assign.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/4_metaprogramming/type_properties/has_nothrow_assign/typedefs.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/4_metaprogramming/type_properties/has_nothrow_constructor/has_nothrow_constructor.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/4_metaprogramming/type_properties/has_nothrow_constructor/typedefs.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/4_metaprogramming/type_properties/has_nothrow_copy/has_nothrow_copy.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/4_metaprogramming/type_properties/has_nothrow_copy/typedefs.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/4_metaprogramming/type_properties/has_trivial_assign/has_trivial_assign.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/4_metaprogramming/type_properties/has_trivial_assign/typedefs.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/4_metaprogramming/type_properties/has_trivial_constructor/has_trivial_constructor.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/4_metaprogramming/type_properties/has_trivial_constructor/typedefs.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/4_metaprogramming/type_properties/has_trivial_copy/has_trivial_copy.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/4_metaprogramming/type_properties/has_trivial_copy/typedefs.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/4_metaprogramming/type_properties/has_trivial_destructor/has_trivial_destructor.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/4_metaprogramming/type_properties/has_trivial_destructor/typedefs.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/4_metaprogramming/type_properties/is_abstract/is_abstract.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/4_metaprogramming/type_properties/is_abstract/typedefs.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/4_metaprogramming/type_properties/is_const/is_const.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/4_metaprogramming/type_properties/is_const/typedefs.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/4_metaprogramming/type_properties/is_empty/is_empty.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/4_metaprogramming/type_properties/is_empty/typedefs.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/4_metaprogramming/type_properties/is_pod/is_pod.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/4_metaprogramming/type_properties/is_pod/typedefs.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/4_metaprogramming/type_properties/is_polymorphic/is_polymorphic.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/4_metaprogramming/type_properties/is_polymorphic/typedefs.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/4_metaprogramming/type_properties/is_signed/is_signed.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/4_metaprogramming/type_properties/is_signed/typedefs.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/4_metaprogramming/type_properties/is_unsigned/is_unsigned.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/4_metaprogramming/type_properties/is_unsigned/typedefs.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/4_metaprogramming/type_properties/is_volatile/is_volatile.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/4_metaprogramming/type_properties/is_volatile/typedefs.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/4_metaprogramming/type_properties/rank/rank.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/4_metaprogramming/type_properties/rank/typedefs.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/6_containers/array/capacity/empty.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/6_containers/array/capacity/max_size.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/6_containers/array/capacity/size.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/6_containers/array/comparison_operators/equal.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/6_containers/array/comparison_operators/greater.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/6_containers/array/comparison_operators/greater_or_equal.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/6_containers/array/comparison_operators/less.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/6_containers/array/comparison_operators/less_or_equal.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/6_containers/array/comparison_operators/not_equal.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/6_containers/array/cons/aggregate_initialization.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/6_containers/array/element_access/at_out_of_range.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/6_containers/array/iterators/end_is_one_past.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/6_containers/array/requirements/contiguous.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/6_containers/array/requirements/instantiate.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/6_containers/array/requirements/typedefs.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/6_containers/array/requirements/zero_sized_arrays.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/6_containers/tuple/comparison_operators/comparisons.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/6_containers/tuple/cons/assignment.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/6_containers/tuple/cons/big_tuples.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/6_containers/tuple/cons/constructor.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/6_containers/tuple/creation_functions/make_tuple.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/6_containers/tuple/creation_functions/tie.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/6_containers/tuple/element_access/get.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/6_containers/tuple/tuple_element.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/6_containers/tuple/tuple_size.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/6_containers/unordered/find/map1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/6_containers/unordered/find/multimap1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/6_containers/unordered/find/multiset1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/6_containers/unordered/find/set1.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/6_containers/unordered/hashtable/23053.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/6_containers/unordered/insert/array_syntax.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/6_containers/unordered/insert/map_range.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/6_containers/unordered/insert/map_single.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/6_containers/unordered/insert/multimap_range.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/6_containers/unordered/insert/multimap_single.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/6_containers/unordered/insert/multiset_range.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/6_containers/unordered/insert/multiset_single.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/6_containers/unordered/insert/set_range.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/6_containers/unordered/insert/set_single.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/6_containers/unordered/instantiate/hash.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/6_containers/unordered/instantiate/map.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/6_containers/unordered/instantiate/multimap.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/6_containers/unordered/instantiate/multiset.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/6_containers/unordered/instantiate/set.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/6_containers/utility/19535.cc buildtools/trunk/gcc/libstdc++-v3/testsuite/tr1/6_containers/utility/pair.cc buildtools/trunk/gcc/libtool.m4 buildtools/trunk/gcc/ltcf-c.sh buildtools/trunk/gcc/ltcf-cxx.sh buildtools/trunk/gcc/ltcf-gcj.sh buildtools/trunk/gcc/ltconfig buildtools/trunk/gcc/ltmain.sh buildtools/trunk/gcc/maintainer-scripts/ChangeLog buildtools/trunk/gcc/maintainer-scripts/README buildtools/trunk/gcc/maintainer-scripts/crontab buildtools/trunk/gcc/maintainer-scripts/gcc_release buildtools/trunk/gcc/maintainer-scripts/maintainer-addresses buildtools/trunk/gcc/maintainer-scripts/update_version buildtools/trunk/gcc/maintainer-scripts/update_web_docs buildtools/trunk/gcc/maintainer-scripts/update_web_docs_libstdcxx buildtools/trunk/gcc/missing buildtools/trunk/gcc/mkdep buildtools/trunk/gcc/mkinstalldirs buildtools/trunk/gcc/move-if-change buildtools/trunk/gcc/symlink-tree buildtools/trunk/gcc/ylwrap Log: Merged in the changes to version 4.1.2. * Solved conflicts with the libtool related files by simply using the vendor versions. IIRC the haiku related changes to libtool and autoconf were relevant only for the binutils. * Solved {libstdc++-v3,libmudflap}/configure conflicts by re-running autoconf for these directories. I'm already working on fixing the Haiku build, so please don't do the same. Deleted: buildtools/trunk/gcc/.cvsignore Modified: buildtools/trunk/gcc/BUGS =================================================================== --- buildtools/trunk/gcc/BUGS 2007-03-04 02:31:43 UTC (rev 20317) +++ buildtools/trunk/gcc/BUGS 2007-03-04 04:07:35 UTC (rev 20318) @@ -297,7 +297,7 @@ Fortran - Fortran bugs are documented in the G77 manual rather than explicitly + G77 bugs are documented in the G77 manual rather than explicitly listed here. Please see [29]Known Causes of Trouble with GNU Fortran in the G77 manual. _________________________________________________________________ @@ -799,7 +799,7 @@ 26. http://gcc.gnu.org/bugs.html#detailed 27. http://gcc.gnu.org/bugs.html#detailed 28. http://gcc.gnu.org/bugs.html#new34 - 29. http://gcc.gnu.org/onlinedocs/g77/Trouble.html + 29. http://gcc.gnu.org/onlinedocs/gcc-3.4.6/g77/Trouble.html 30. http://gcc.gnu.org/PR323 31. http://www.validlab.com/goldberg/paper.ps 32. http://gcc.gnu.org/PR11751 Modified: buildtools/trunk/gcc/COPYING =================================================================== --- buildtools/trunk/gcc/COPYING 2007-03-04 02:31:43 UTC (rev 20317) +++ buildtools/trunk/gcc/COPYING 2007-03-04 04:07:35 UTC (rev 20318) @@ -2,7 +2,7 @@ Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. - 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. @@ -305,7 +305,7 @@ 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. Modified: buildtools/trunk/gcc/COPYING.LIB =================================================================== --- buildtools/trunk/gcc/COPYING.LIB 2007-03-04 02:31:43 UTC (rev 20317) +++ buildtools/trunk/gcc/COPYING.LIB 2007-03-04 04:07:35 UTC (rev 20318) @@ -1,8 +1,9 @@ - GNU LESSER GENERAL PUBLIC LICENSE - Version 2.1, February 1999 + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + Copyright (C) 1991, 1999 Free Software Foundation, Inc. - 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. @@ -10,7 +11,7 @@ as the successor of the GNU Library Public License, version 2, hence the version number 2.1.] - Preamble + Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public @@ -22,7 +23,8 @@ Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better -strategy to use in any particular case, based on the explanations below. +strategy to use in any particular case, based on the explanations +below. When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that @@ -87,9 +89,9 @@ special circumstances. For example, on rare occasions, there may be a special need to -encourage the widest possible use of a certain library, so that it becomes -a de-facto standard. To achieve this, non-free programs must be -allowed to use the library. A more frequent case is that a free +encourage the widest possible use of a certain library, so that it +becomes a de-facto standard. To achieve this, non-free programs must +be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. @@ -112,7 +114,7 @@ former contains code derived from the library, whereas the latter must be combined with the library in order to run. - GNU LESSER GENERAL PUBLIC LICENSE + GNU LESSER GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library or other @@ -136,8 +138,8 @@ "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated -interface definition files, plus the scripts used to control compilation -and installation of the library. +interface definition files, plus the scripts used to control +compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of @@ -146,7 +148,7 @@ on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. - + 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an @@ -303,10 +305,10 @@ the user installs one, as long as the modified version is interface-compatible with the version that the work was made with. - c) Accompany the work with a written offer, valid for at - least three years, to give the same user the materials - specified in Subsection 6a, above, for a charge no more - than the cost of performing this distribution. + c) Accompany the work with a written offer, valid for at least + three years, to give the same user the materials specified in + Subsection 6a, above, for a charge no more than the cost of + performing this distribution. d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above @@ -384,9 +386,10 @@ the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. -If any portion of this section is held invalid or unenforceable under any -particular circumstance, the balance of the section is intended to apply, -and the section as a whole is intended to apply in other circumstances. +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply, and the section as a whole is intended to apply in other +circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any @@ -404,11 +407,11 @@ 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Library under this License may add -an explicit geographical distribution limitation excluding those countries, -so that distribution is permitted only in or among countries not thus -excluded. In such case, this License incorporates the limitation as if -written in the body of this License. +original copyright holder who places the Library under this License +may add an explicit geographical distribution limitation excluding those +countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. @@ -432,7 +435,7 @@ of all derivatives of our free software and of promoting the sharing and reuse of software generally. - NO WARRANTY + NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. @@ -455,21 +458,23 @@ SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - END OF TERMS AND CONDITIONS + END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting -redistribution under these terms (or, alternatively, under the terms of the -ordinary General Public License). +redistribution under these terms (or, alternatively, under the terms +of the ordinary General Public License). - To apply these terms, attach the following notices to the library. It is -safest to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least the -"copyright" line and a pointer to where the full notice is found. + To apply these terms, attach the following notices to the library. +It is safest to attach them to the start of each source file to most +effectively convey the exclusion of warranty; and each file should +have at least the "copyright" line and a pointer to where the full +notice is found. + Copyright (C) @@ -485,16 +490,17 @@ You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the library, if -necessary. Here is a sample; alter the names: +You should also get your employer (if you work as a programmer) or +your school, if any, to sign a "copyright disclaimer" for the library, +if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the - library `Frob' (a library for tweaking knobs) written by James Random Hacker. + library `Frob' (a library for tweaking knobs) written by James + Random Hacker. , 1 April 1990 Ty Coon, President of Vice Modified: buildtools/trunk/gcc/ChangeLog =================================================================== --- buildtools/trunk/gcc/ChangeLog 2007-03-04 02:31:43 UTC (rev 20317) +++ buildtools/trunk/gcc/ChangeLog 2007-03-04 04:07:35 UTC (rev 20318) @@ -1,38 +1,528 @@ -2005-09-20 Release Manager +2007-02-13 Release Manager - * GCC 4.0.2 released. + * GCC 4.1.2 released. +2006-11-21 Kaveh R. Ghazi + + * configure.in (--with-mpfr-dir): Also look in .libs and _libs for + libmpfr.a. + * configure: Regenerate. + +2006-11-14 Jie Zhang + + * configure.in: Remove target-libgloss from noconfigdirs for + bfin-*-*. + * configure: Regenerated. + +2006-07-04 Peter O'Gorman + + * ltconfig: chmod 644 before ranlib during install. + +2006-05-24 Release Manager + + * GCC 4.1.1 released. + +2006-04-04 Alex Deiter + + PR bootstrap/27023 + * Makefile.tpl (multilib.out): Remove trailing backslash. + * Makefile.in: Regenerate. + +2006-03-22 Janne Blomqvist + + * MAINTAINERS (Write After Approval): Remove myself. + (Language Front End Maintainers): Add myself as fortran 95 maintainer. + +2006-03-01 Thomas Koenig + + * MAINTAINERS (Write After Approval): Remove myself. + (Language Front End Maintainers): Add myself as + fortran 95 maintainer. + +2006-02-28 Release Manager + + * GCC 4.1.0 released. + +2005-12-16 Nathan Sidwell + + * configure.in: Replace ms1 with mt. + * configure: Rebuilt. + * config.sub: Replace ms1 with mt. Allow ms1 as an alias. + +2005-12-14 Paolo Bonzini + + * Makefile.in: Regenerate. + +2005-12-14 Paolo Bonzini + + * configure.in (CONFIGURED_BISON, CONFIGURED_YACC, CONFIGURED_M4, + CONFIGURED_FLEX, CONFIGURED_LEX, CONFIGURED_MAKEINFO): Remove + "CONFIGURED_" from the AC_CHECK_PROGS invocation. Move below. + Find in-tree tools if available. + (EXPECT, RUNTEST, LIPO, STRIP): Find them and substitute them. + (CONFIGURED_*_FOR_TARGET): Don't set nor substitute. + (*_FOR_TARGET): Set them with GCC_TARGET_TOOL. + (COMPILER_*_FOR_TARGET): New. + * Makefile.tpl (HOST_EXPORTS): Add *_FOR_TARGET symbols that gcc needs. + (BASE_TARGET_EXPORTS): Use COMPILER_*_FOR_TARGET symbols. + (CONFIGURED_*, USUAL_*): Remove. + (BISON, YACC, FLEX, LEX, M4, MAKEINFO, EXPECT, RUNTEST, LIPO, + STRIP): Use autoconf substitutions. + (COMPILER_AS_FOR_TARGET, COMPILER_LD_FOR_TARGET, + COMPILER_NM_FOR_TARGET): New. + (EXTRA_HOST_FLAGS): Pass LIPO and STRIP. + + (all): Make all-host and all-target in parallel. + (do-[+make_target+], do-check, install, [+compare-target+]): Ensure + that $$r and $$s are set before invoking a recursive make. + (stage[+id+]-bubble): Likewise, and invoke the comparison at the end. + ([+bootstrap-target+]): Inline most of the `all' target. + +2005-10-24 Kean Johnston + + * config.sub, config.guess: Sync from upstream sources. + +2005-11-18 Andreas Tobler + + * ltcf-c.sh (whole_archive_flag_spec): Remove '-all_load $convenience' + to match upstream libtool for darwin. + +2005-11-11 Daniel Jacobowitz + + * Makefile.def: Remove gdb dependencies for gdbtk. + * Makefile.tpl (CONFIGURE_GDB_TK, INSTALL_GDB_TK): New variables. + (configure-gdb, install-gdb): New rules. + * configure.in: Set CONFIGURE_GDB_TK and INSTALL_GDB_TK. + * Makefile.in, configure: Regenerated. + +2005-11-06 Janne Blomqvist + + * MAINTAINERS (Write After Approval): Add myself. + +2005-11-06 Erik Edelmann + + * MAINTAINERS (Write After Approval): Add myself. + +2005-10-24 Diego Novillo + + * MAINTAINERS (alias analysis): Add Daniel Berlin and + Diego Novillo. + +2005-10-22 Paolo Bonzini + + PR bootstrap/24297 + * Makefile.tpl (do-[+make-target+], do-check, install, + stage[+id+]-bubble, [+compare-target+]): Ensure $$r and $$s + are set before recursing. + * Makefile.in: Regenerate. + +2005-10-20 Eric Botcazou + + PR bootstrap/18939 + * Makefile.def (gcc) : Fix thinko. + * Makefile.in: Regenerate. + +2005-10-17 Bernd Schmidt + + * configure.in (bfin-*-*): Use test, not brackets, in if statement. + * configure: Regenerate. + +2005-10-15 Jie Zhang + + * MAINTAINERS (Write After Approval): Add self. + +2005-10-08 Kazu Hirata + + * configure.in (arm-*-linux-gnueabi): Add to noconfigdirs + target-libffi, target-qthreads, target-libjava, and + targetlibobjc. + * configure: Regenerate. + +2005-10-06 Daniel Jacobowitz + + * Makefile.def (flags_to_pass): Add OBJDUMP_FOR_TARGET. + * Makefile.tpl (BASE_TARGET_EXPORTS): Add OBJDUMP. + (OBJDUMP_FOR_TARGET, CONFIGURED_OBJDUMP_FOR_TARGET) + (USUAL_OBJDUMP_FOR_TARGET): New. + (EXTRA_TARGET_FLAGS): Add OBJDUMP. + * configure.in: Check for $OBJDUMP_FOR_TARGET. + * configure, Makefile: Regenerated. + +2005-10-05 Paolo Bonzini + + * Makefile.tpl (all) [gcc-no-bootstrap]: Make prebootstrap packages + before other host packages. + +2005-10-05 Kaz Kojima + + * MAINTAINERS: Add self as sh libraries/configury maintainer. + +2005-10-05 Paolo Bonzini + + PR bootstrap/22340 + + * configure.in (default_target): Remove. + * Makefile.tpl (all): Do not use prerequisites as subroutines + (all) [gcc-bootstrap]: Bootstrap gcc first if it was not done yet. + (do-[+make_target+], check, install, [+bootstrap_target+]): Do not + use prerequisites as subroutines. + (check-host, check-target): New. + (bootstrap configure & all targets): Do not use stage*-start + if the directory layout is already ok. + (non-bootstrap configure & all targets): Prepend a $(unstage). + (stage[+id+]-bubble): Do that here. Do not use NOTPARALLEL. + (NOTPARALLEL): Remove. + (unstage, stage variables): New variables. + (unstage, stage targets): Simply expand to those variables. + + * configure: Regenerate. + * Makefile.in: Regenerate. + +2005-10-04 James E Wilson + + * Makefile.def (lang_env_dependencies): Add libmudflap. + * Makefile.in: Regenerate. + +2005-10-03 Andreas Schwab + + Backport from libtool CVS: + 2002-11-03 Ossama Othman + + * ltmain.sh: add support for installing into temporary + staging area (e.g. 'make install DESTDIR=...') + +2005-10-03 H.J. Lu + + * configure.in (*-*-darwin*): Build bfd, binutils and opcodes. + * configure: Regenerated. + +2005-09-30 Andrew Pinski + + * configure: Regenerate with the correct + autoconf version. + +2005-09-30 Catherine Moore + + * configure.in (bfin-*-*): New. + * configure: Regenerated. + +2005-09-28 Geoffrey Keating + + * Makefile.tpl (BASE_TARGET_EXPORTS): Add LIPO, STRIP. + (LIPO_FOR_TARGET): New. + (CONFIGURED_LIPO_FOR_TARGET): New. + (USUAL_LIPO_FOR_TARGET): New. + (STRIP_FOR_TARGET): New. + (CONFIGURED_STRIP_FOR_TARGET): New. + (USUAL_STRIP_FOR_TARGET): New. + * Makefile.def (flags_to_pass): Add LIPO_FOR_TARGET and + STRIP_FOR_TARGET. + * configure.in: Set LIPO_FOR_TARGET, STRIP_FOR_TARGET, + CONFIGURED_LIPO_FOR_TARGET, CONFIGURED_STRIP_FOR_TARGET. + * Makefile.in: Regenerate. + * configure: Regenerate. + +2005-09-19 David Edelsohn + + * configure.in (powerpc-*-aix*): Add target-libssp to noconfigdirs. + (rs6000-*-aix*): Same. + * configure: Regenerate. + +2005-09-16 Tom Tromey + + * MAINTAINERS: Add self as java maintainer. + 2005-09-14 Francois-Xavier Coudert - * configure.in: Recognize fortran in the --enable-languages option, - and substitute it for f95, issuing a warning. + * configure.in: Recognize f95 in the --enable-languages option, + and substitute it for fortran, issuing a warning. * configure: Regenerate. -2005-08-12 Thomas Schwinge +2005-08-30 Phil Edwards - * Makefile.tpl: Add whitespace between FLAGS_TO_PASS and - extra_make_flags. + * configure.in (*-*-vxworks*): Add target-libstdc++-v3 to noconfigdirs. + * configure: Regenerated. + +2005-08-22 Aldy Hernandez + + * MAINTAINERS: Add self as ms1 maintainer. + +2005-08-20 Richard Earnshaw + + * Makefile.def (libssp): Add to lang_env_dependencies. * Makefile.in: Regenerate. -2005-07-07 Release Manager +2005-08-18 Ian Lance Taylor - * GCC 4.0.1 released. + * MAINTAINERS: Add myself as middle-end maintainer. -2005-06-22 Eric Christopher +2005-08-17 Christian Groessler - PR bootstrap/17383 - * configure.in: Reject building in the source directory. + * Makefile.tpl: (USUAL_CC_FOR_TARGET): Add missing trailing slash. + * Makefile.in: Regenerate. + +2005-08-15 Andreas Krebbel + + * MAINTAINERS (write after approval): Added myself. + +2005-08-12 Maciej W. Rozycki + + * MAINTAINERS (Write After Approval): Add myself. + +2005-08-12 Paolo Bonzini + + * configure.in: Replace NCN_STRICT_CHECK_TOOL with + NCN_STRICT_CHECK_TOOLS, and likewise for NCN_STRICT_CHECK_TARGET_TOOLS. + Look for alternate names of the target cc and c++ * configure: Regenerate. -2005-06-06 Tobias Schl"uter +2005-08-08 Paolo Bonzini - * configure.in: Don't add another '/mpfr' to the directory given - in --with-mpfr-dir. + * configure.in (CC_FOR_TARGET, CXX_FOR_TARGET, GCJ_FOR_TARGET, + GCC_FOR_TARGET, RAW_CXX_FOR_TARGET, GFORTRAN_FOR_TARGET): Find + them with NCN_STRICT_CHECK_TARGET_TOOL, like the other target + tools; remove code to manually set them. + (Target tools): Look in the environment for them. + * Makefile.tpl (CC_FOR_TARGET, CXX_FOR_TARGET, GCJ_FOR_TARGET, + GCC_FOR_TARGET, RAW_CXX_FOR_TARGET, GFORTRAN_FOR_TARGET): Redefine. + (AS_FOR_TARGET, LD_FOR_TARGET, NM_FOR_TARGET): Look into gcc + build directory. + (CONFIGURED_CC_FOR_TARGET, CONFIGURED_CXX_FOR_TARGET, + CONFIGURED_GCJ_FOR_TARGET, CONFIGURED_GCC_FOR_TARGET, + CONFIGURED_GFORTRAN_FOR_TARGET, USUAL_CC_FOR_TARGET, + USUAL_CXX_FOR_TARGET, USUAL_GCJ_FOR_TARGET, USUAL_GCC_FOR_TARGET, + USUAL_RAW_CXX_FOR_TARGET, USUAL_GFORTRAN_FOR_TARGET): New. + (CXX_FOR_TARGET_FOR_RECURSIVE_MAKE, + RAW_CXX_FOR_TARGET_FOR_RECURSIVE_MAKE, RECURSE_FLAGS): Delete. * configure: Regenerate. + * Makefile.in: Regenerate. -2005-05-13 David Edelsohn +2005-07-28 Ben Elliston - Backport from mainline: + * MAINTAINERS: Update for removed CPU targets. + +2005-07-27 Mark Mitchell + + * Makefile.tpl (EXTRA_TARGET_FLAGS): Set LDFLAGS=LDFLAGS_FOR_TARGET. + * Makefile.def (flags_to_pass): Add LDFLAGS_FOR_TARGET. + * Makefile.in: Regenerated. + +2005-07-26 Mark Mitchell + + * Makefile.tpl (SYSROOT_CFLAGS_FOR_TARGET): New variable. + (CFLAGS_FOR_TARGET): Use it. + (CXXFLAGS_FOR_TARGET): Likewise. + * Makefile.in: Regenerated. + * configure.in (--with-build-sysroot): New option. + * configure: Regenerated. + +2005-07-24 Paolo Bonzini + + * Makefile.tpl: Wrap install between unstage and stage + * Makefile.in: Regenerate. + +2005-07-21 Eric Christopher + + * MAINTAINERS: Update affiliation. + +2005-07-21 Paul Woegerer + + * MAINTAINERS: Add self as crx port maintainer. + +2005-07-20 DJ Delorie + + * MAINTAINERS: Add self as m32c maintainer. + +2005-07-16 Kelley Cook + + * all files: Update FSF address. + +2005-07-15 Eric Christopher + + * MAINTAINERS: Change affiliation. + +2005-07-14 Jim Blandy + + * configure.in: Add cases for Renesas m32c. + * configure: Regenerated. + +2005-07-14 Kelley Cook + + * COPYING.LIB: Update from fsf.org. + +2005-07-14 Kelley Cook + + * COPYING, compile, config.guess, + config.sub, install-sh, missing, mkinstalldirs, + symlink-tree, ylwrap: Sync from upstream sources. + * config-ml.in: Update FSF address. + +2005-07-13 Eric Christopher + + * configure.in: Add toplevel noconfigdir support for tpf. + * configure: Regenerate. + +2005-07-11 Paolo Bonzini + + PR ada/22340 + + * Makefile.tpl (POSTSTAGE1_FLAGS_TO_PASS): Fix pasto. + * Makefile.in: Regenerate. + +2005-07-07 Mark Mitchell + + * MAINTAINERS: Remove Dave Brolley as a cpplib maintainer. Add Dave + Brolley to write-after-approval. + +2005-07-07 Andreas Schwab + + * Makefile.def (flags_to_pass): Add CFLAGS_FOR_BUILD. + * Makefile.tpl (EXTRA_GCC_FLAGS): Don't pass CFLAGS_FOR_BUILD here. + * Makefile.in: Regenerated. + +2005-07-06 Geoffrey Keating + + * configure.in: Don't build sim or rda when targetting darwin. + * configure: Regenerate. + +2005-07-06 Kazu Hirata + + * configure.in: Add --enable-libssp and --disable-libssp. + * configure: Regenerate with autoconf-2.13. + +2005-07-02 Jakub Jelinek + + * Makefile.def (target_modules): Add libssp. + * configure.in (target_libraries): Add target-libssp. + * configure: Rebuilt. + * Makefile.in: Rebuilt. + +2005-07-01 Zack Weinberg + + * MAINTAINERS: Change email address. Resign from maintainership. + +2005-07-01 Richard Guenther + + * MAINTAINERS: Change my e-mail address and affiliation. + +2005-06-22 Paolo Bonzini + + * Makefile.def (stagefeedback): Come after profile. + Define profiledbootstrap target. + * Makefile.tpl (profiledbootstrap): Remove. + (stageprofile-end): Zap stagefeedback. + (stagefeedback-start): Copy all .gcda files, not only GCC's. + * Makefile.in: Regenerate. + +2005-06-13 Richard Sandiford + + * MAINTAINERS: Update my email address. + +2005-06-13 Zack Weinberg + + * depcomp: Update from automake CVS. Add 'ia64hp' stanza. + In 'cpp' stanza, support '#line' as well as '# '. + +2005-06-08 Andreas Schwab + + * MAINTAINERS: Move myself from 'Write After Approval' to + 'CPU Port Maintainers' section as m68k maintainer. + +2005-06-07 Hans-Peter Nilsson + + * configure.in (unsupported_languages): New macro. + : Set unsupported_languages. Name explicit + non-ported target libraries in noconfigdirs. + Ditto, except for non-aout, non-elf, + non-linux-gnu. Remove libgcj_ex_libffi. + : Set add_this_lang=no if the language is in + unsupported_languages. + * configure: Regenerate. + +2005-06-04 Tobias Schl"uter + + * configure.in: Fix typo in handling of --with-mpfr-dir. + * configure: Regenerate. + +2005-06-04 Richard Sandiford + + * MAINTAINERS: Update my email address. + +2005-06-02 Jim Blandy + + * config.sub: Add cases for the Renesas m32c. (This patch has been + accepted into the master sources.) + +2005-06-02 Aldy Hernandez + Michael Snyder + Stan Cox + + * configure.in: Set noconfigdirs for ms1. + + * configure: Regenerate. + +2005-06-01 Jerry DeLisle + + * MAINTAINERS (Write After Approval): Add self. + +2005-06-01 Josh Conner + + * MAINTAINERS (Write After Approval): Add self. + +2005-06-01 Kazu Hirata + + * MAINTAINERS: Update my email address. + +2005-05-27 Ziga Mahkovec + + * MAINTAINERS (Write After Approval): Add self. + +2005-05-26 Chris Demetriou + + * MAINTAINERS (Write After Approval): Remove self. + +2005-05-25 Paolo Bonzini + + * Makefile.tpl (stage[+id+]-start): Iterate over target module as well. + (Dependencies): Consider target modules for bootstrap dependencies. + Make target bootstrap modules depend on each stage's gcc. + * Makefile.in: Regenerate. + +2005-05-20 Paolo Bonzini + + * Makefile.def (configure-gcc): Depend on binutils having been built. + (all-gcc): No need to do it here. + * Makefile.in: Regenerate. + +2005-05-19 Paul Brook + + * configure.in: Rewrite misleading error message when requested + language cannot be built. + * configure: Regenerate. + +2005-05-15 Daniel Jacobowitz + + * ylwrap: Import from Automake 1.9.5. + +2005-05-13 David Ung + + * MAINTAINERS (Write After Approval): Add self. + +2005-05-09 Mike Stump + + * libtool.m4 (AC_LIBTOOL_SYS_MAX_CMD_LEN): Use quotes on + lt_cv_sys_max_cmd_len for now. + +2005-05-09 Stan Cox + + * MAINTAINERS: Remove self, add Nick Clifton as iq2000 maintainer. + +2005-05-08 Matt Kraai + + * README.SCO: Update the URL. + +2005-05-05 David Edelsohn + * ltconfig: Define file_list_spec. Pass file_list_spec and with_gnu_ld to libtool. * ltcf-c.sh (aix[45]): Define file_list_spec. @@ -41,49 +531,134 @@ * ltmain.sh: If command exceeds max_cmd_len and file_list_spec exists, write list of input files to temporary file. -2005-05-08 Matt Kraai +2005-05-04 Mike Stump - * README.SCO: Update the URL. + * configure.in: Always pass --target to target configures as + otherwise rebuilds that do --recheck will fail. + * confiugure: Rebuilt. -2005-05-06 Andreas Tobler +2005-05-04 Paolo Bonzini - PR target/21325 - * configure.in (powerpc-*-darwin*): Remove ${libgcj} from noconfigdirs. - * configure: Regenerated. + * Makefile.tpl (POSTSTAGE1_HOST_EXPORTS): Rename from + STAGE_HOST_EXPORTS. + (configure, all): Add bootstrap support. + (Host modules, target modules): Pass post-stage1 flags and exports. + (Top-level bootstrap): Remove bootstrap rules, expanded elsewhere. + * Makefile.in: Regenerate. -2005-04-25 Bernd Schmidt +2005-04-29 Paolo Bonzini - * MAINTAINERS: Add self as Blackfin maintainer - * config.sub: Import from master version. + * configure: Regenerate. -2005-04-20 Release Manager +2005-04-27 Mike Stump - * GCC 4.0.0 released. + * MAINTAINERS: Add self as darwin maintainer. -2005-04-20 Geoffrey Keating +2005-04-22 Bernd Schmidt - * configure.in (powerpc-*-darwin*): Add ${libgcj} to noconfigdirs. - * configure: Regenerated. + * config.sub: Update from master copy. -2005-04-19 Paolo Bonzini +2005-04-21 Mike Stump - * configure: Regenerate after change to config/acx.m4. + * MAINTAINERS: Add self as Objective-C/Objective-C++ maintainer. + * MAINTAINERS: Add Zem as Objective-C++ maintainer. +2005-04-19 Hans-Peter Nilsson + + * configure.in : New local variable + libgcj_ex_libffi. Have specific match for *-*-linux*. Separate + matches for "*-*-aout" and "*-*-elf". Don't disable libffi for + "*-*-elf" and "*-*-linux*". + * configure: Regenerate. + 2005-04-14 Joseph S. Myers * MAINTAINERS (Various Maintainers): Add self as i18n maintainer. +2005-04-12 Mike Stump + + * libtool.m4: Update AC_LIBTOOL_SYS_MAX_CMD_LEN bits from upstream. + 2005-04-04 Thomas Koenig - * MAINTAINERS (Write After Approval): Add myself. + * MAINTAINERS (Write After Approval): Add myself. +2005-04-07 Bernd Schmidt + + * MAINTAINERS (Port Maintainers): Add self for Blackfin. + +2005-04-06 Paolo Bonzini + + * Makefile.tpl (BUILD_CONFIGARGS): Include --with-build-subdir. + (TARGET_CONFIGARGS): Include --with-target-subdir. + (configure, all): New macros. Use them throughout. + * Makefile.in: Regenerate. + +2005-04-04 Jon Grimm + + * MAINTAINERS (Write After Approval): Add myself. + +2005-03-31 Zdenek Dvorak + + * MAINTAINERS: Remove 'loop unrolling' maintainer. + +2005-03-30 Gerald Pfeifer + + * MAINTAINERS: Move John Carr to Write After Approval. + +2005-03-30 J"orn Rennecke + + * config/mh-mingw32: Delete. + * configure.in: Don't use it. + * configure: Regenerate. + +2005-03-31 Paolo Bonzini + + * Makefile.def (bfd, opcodes, libstdc++-v3, libmudflap): Set lib_path. + * Makefile.tpl (SET_LIB_PATH, REALLY_SET_LIB_PATH): Remove. + (HOST_EXPORTS, STAGE_HOST_EXPORTS, TARGET_EXPORTS): Set $(RPATH_ENVVAR). + (HOST_LIB_PATH): Generate from Makefile.def. + (TARGET_LIB_PATH): Likewise. + (Old bootstrap targets): Include TARGET_LIB_PATH into RPATH_ENVVAR. + * Makefile.in: Regenerate. + * configure.in (set_lib_path, SET_LIB_PATH, SET_GCC_LIB_PATH): Remove. + (RPATH_ENVVAR): Include Darwin case. + * configure: Regenerate. + +2005-03-29 Thomas Fitzsimmons + + * MAINTAINERS (Various Maintainers): Remove self. + (Write After Approval): Add self. + +2005-03-26 Thomas Fitzsimmons + + * MAINTAINERS (Various Maintainers): Add self. + 2005-03-25 Paolo Bonzini * configure.in (RPATH_ENVVAR): Set to DYLD_LIBRARY_PATH on Darwin. * configure: Regenerate. -2005-03-14 Feng Wang +2005-03-21 Zack Weinberg + * Makefile.def: Remove libstdcxx_incdir, libsubdir, gxx_include_dir, + gcc_version, and gcc_version_trigger from set of flags to pass. + * Makefile.tpl: Remove definitions of above variables. + (config.status): Remove dependency on $(gcc_version_trigger). + * Makefile.in: Regenerate. + * configure.in: Do not reference config/gcc-version.m4 nor + config/gxx-include-dir.m4. Do not invoke TL_AC_GCC_VERSION nor + TL_AC_GXX_INCLUDE_DIR. Do not set gcc_version_trigger. + * configure: Regenerate. + +2005-03-16 Manfred Hollstein + Andrew Pinski + + * Makefile.tpl (check-[+module+]): Fix shell statement inside if ... fi. + * Makefile.in: Regenerate. + +2005-03-13 Feng Wang + * MAINTAINERS (Write After Approval): Add myself. 2005-03-03 David Ayers @@ -96,6 +671,50 @@ * ltmain.sh: Avoid creating archives with components that have duplicate basenames. +2005-02-28 Andrew Pinski + + PR bootstrap/20250 + * Makefile.tpl (HOST target installs): Fix copy and pasto, use install + instead of check. + * Makefile.in: Regenerate. + +2005-02-28 Paolo Bonzini + + * Makefile.in: Regenerate to fix conflict between the previous two + patches. + +2005-02-28 Paolo Bonzini + + PR bootstrap/17383 + * Makefile.def (target_modules): Remove "stage", now unnecessary. + * Makefile.tpl (HOST_SUBDIR): New substitution. + (STAGE_HOST_EXPORTS, EXPECT, HOST_LIB_PATH, USUAL_AR_FOR_TARGET, + USUAL_AS_FOR_TARGET, USUAL_DLLTOOL_FOR_TARGET, USUAL_GCC_FOR_TARGET, + USUAL_LD_FOR_TARGET, USUAL_NM_FOR_TARGET, USUAL_OBJDUMP_FOR_TARGET, + USUAL_RANLIB_FOR_TARGET, USUAL_WINDRES_FOR_TARGET): Use it. + (Host modules, Bootstrapped modules): Use it. + (Build modules, Target modules): Do not create symlink trees, + always configure out-of-srcdir. + (distclean): Try removing $(host_subdir) with rm before using rm -rf. + * configure.in (FLAGS_FOR_TARGET, CC_FOR_TARGET, GCJ_FOR_TARGET, + GFORTRAN_FOR_TARGET, CXX_FOR_TARGET, RAW_CXX_FOR_TARGET): Use + $(HOST_SUBDIR). Create a symlink for host_subdir. + + * Makefile.in: Regenerate. + * configure: Regenerate. + +2005-02-28 Nathanael Nerode + + Merged from libada-gnattools-branch: + 2004-11-28 Nathanael Nerode + + * gnattools: New directory. + * Makefile.def: Add gnattools as a module, depending on target-libada. + * Makefile.in: Regenerate. + * configure.in: Include gnattools in host_tools; disable it if ada + is disabled. + * configure: Regenerate. + 2005-02-24 James A. Morrison * MAINTAINERS (Language Front Ends Maintainers): Add myself as @@ -414,7 +1033,7 @@ 2004-10-05 Tomer Levi * configure.in: Enable target-libgloss for crx-*-*. - * configure: Regenerate. + * configure: Regenerate. 2004-10-04 Kazu Hirata @@ -626,7 +1245,7 @@ [... truncated: 1400691 lines follow ...] From bonefish at mail.berlios.de Sun Mar 4 06:10:00 2007 From: bonefish at mail.berlios.de (bonefish at BerliOS) Date: Sun, 4 Mar 2007 06:10:00 +0100 Subject: [Haiku-commits] r20321 - in haiku/trunk: . build/jam Message-ID: <200703040510.l245A0Zn025024@sheep.berlios.de> Author: bonefish Date: 2007-03-04 06:09:59 +0100 (Sun, 04 Mar 2007) New Revision: 20321 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20321&view=rev Modified: haiku/trunk/Jamfile haiku/trunk/build/jam/HeadersRules haiku/trunk/build/jam/UserBuildConfig.sample Log: Introduced new build system features: The variable HAIKU_DONT_INCLUDE_SRC to turn off the inclusion of src/Jamfile, and the rule DeferredSubInclude to include a subdirectory in UserBuildConfig. Together they allow a developer working on a subproject to reduce jam's parsing time when only building the subproject. Relevant mostly on BeOS; on Linux jam is pretty fast anyway. Modified: haiku/trunk/Jamfile =================================================================== --- haiku/trunk/Jamfile 2007-03-04 05:00:40 UTC (rev 20320) +++ haiku/trunk/Jamfile 2007-03-04 05:09:59 UTC (rev 20321) @@ -132,4 +132,15 @@ Haiku ; -SubInclude HAIKU_TOP src ; +# Optionally we allow not to include the "src" subdirectory. +if $(HAIKU_DONT_INCLUDE_SRC) { + # Don't include "src", but at least include the stuff needed for the + # build. + SubInclude HAIKU_TOP src build ; + SubInclude HAIKU_TOP src tools ; +} else { + SubInclude HAIKU_TOP src ; +} + +# Perform deferred SubIncludes. +ExecuteDeferredSubIncludes ; Modified: haiku/trunk/build/jam/HeadersRules =================================================================== --- haiku/trunk/build/jam/HeadersRules 2007-03-04 05:00:40 UTC (rev 20320) +++ haiku/trunk/build/jam/HeadersRules 2007-03-04 05:09:59 UTC (rev 20321) @@ -397,5 +397,44 @@ return $(headers) ; } +rule DeferredSubInclude params +{ + # DeferredSubInclude ; + # + # Takes the same parameter as SubInclude. The the subdirectory referred to + # by will be included when ExecuteDeferredSubIncludes is + # invoked, i.e. at the end of the root Jamfile. + + HAIKU_DEFERRED_SUB_INCLUDES += "/" $(params) ; +} + +rule ExecuteDeferredSubIncludes +{ + # ExecuteDeferredSubIncludes ; + # + # Performs the deferred SubIncludes scheduled by DeferredSubInclude. + + local tokensList = $(HAIKU_DEFERRED_SUB_INCLUDES) ; + while $(tokensList) { + # chop off leading "/" + tokensList = $(tokensList[2-]) ; + + # get the tokens for the next include + local tokens ; + while $(tokensList) && $(tokensList[1]) != "/" { + tokens += $(tokensList[1]) ; + tokensList = $(tokensList[2-]) ; + } + + # perform the include + if $(tokens) { + SubInclude $(tokens) ; + } + } +} + +# The variable used to collect the deferred SubIncludes. +HAIKU_DEFERRED_SUB_INCLUDES = ; + # SUBDIRSYSHDRS shall be reset automatically for each subdir SUBDIRRESET += SYSHDRS ; Modified: haiku/trunk/build/jam/UserBuildConfig.sample =================================================================== --- haiku/trunk/build/jam/UserBuildConfig.sample 2007-03-04 05:00:40 UTC (rev 20320) +++ haiku/trunk/build/jam/UserBuildConfig.sample 2007-03-04 05:09:59 UTC (rev 20321) @@ -75,3 +75,19 @@ # used, i.e. a variable "rc" referring to the rc command built for the host # platform is defined in the script. AddTargetVariableToScript test.inc : rc ; + + +# Optimizing Jamfile Parsing Times + +# Setting this variable will prevent the root Jamfile to include the Jamfile +# in the src directory. Instead only the directories required for building the +# build tools are included. Only useful in combination with DeferredSubInclude. +HAIKU_DONT_INCLUDE_SRC = 1 ; + +# Schedule the given subdirectory for inclusion at the end of the root +# Jamfile (directly using SubInclude here is not possible). Using this +# feature together with HAIKU_DONT_INCLUDE_SRC allows developers working +# only on a subproject to reduce Jamfile parsing times considerably. +DeferredSubInclude HAIKU_TOP src tests add-ons kernel file_systems + userlandfs ; + From bonefish at mail.berlios.de Sun Mar 4 09:26:46 2007 From: bonefish at mail.berlios.de (bonefish at BerliOS) Date: Sun, 4 Mar 2007 09:26:46 +0100 Subject: [Haiku-commits] r20322 - in haiku/trunk: headers/private/userlandfs/private headers/private/userlandfs/shared src/add-ons/kernel/file_systems/userlandfs/kernel_add_on src/add-ons/kernel/file_systems/userlandfs/private src/add-ons/kernel/file_systems/userlandfs/server Message-ID: <200703040826.l248QkW8008889@sheep.berlios.de> Author: bonefish Date: 2007-03-04 09:26:45 +0100 (Sun, 04 Mar 2007) New Revision: 20322 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20322&view=rev Modified: haiku/trunk/headers/private/userlandfs/private/Port.h haiku/trunk/headers/private/userlandfs/private/RequestPort.h haiku/trunk/headers/private/userlandfs/shared/HashMap.h haiku/trunk/headers/private/userlandfs/shared/Vector.h haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/Jamfile haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/RequestPortPool.cpp haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/Settings.cpp haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/UserlandFS.cpp haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/UserlandFS.h haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/private/DispatcherDefs.cpp haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/private/Port.cpp haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/private/RequestAllocator.cpp haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/private/RequestPort.cpp haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/private/userlandfs_ioctl.cpp haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/BeOSKernelFileSystem.cpp haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/FSInfo.h haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/RequestThread.cpp haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/ServerDefs.cpp Log: Made the UserlandFS code gcc4 friendly. Modified: haiku/trunk/headers/private/userlandfs/private/Port.h =================================================================== --- haiku/trunk/headers/private/userlandfs/private/Port.h 2007-03-04 05:09:59 UTC (rev 20321) +++ haiku/trunk/headers/private/userlandfs/private/Port.h 2007-03-04 08:26:45 UTC (rev 20322) @@ -5,6 +5,8 @@ #include +class KernelDebug; + namespace UserlandFSUtil { struct PortInfo { @@ -40,7 +42,7 @@ status_t Receive(bigtime_t timeout = -1); private: - friend class KernelDebug; + friend class ::KernelDebug; Info fInfo; uint8* fBuffer; Modified: haiku/trunk/headers/private/userlandfs/private/RequestPort.h =================================================================== --- haiku/trunk/headers/private/userlandfs/private/RequestPort.h 2007-03-04 05:09:59 UTC (rev 20321) +++ haiku/trunk/headers/private/userlandfs/private/RequestPort.h 2007-03-04 08:26:45 UTC (rev 20322) @@ -41,7 +41,7 @@ void _PopAllocator(); private: - friend class KernelDebug; + friend class ::KernelDebug; struct AllocatorNode; Port fPort; Modified: haiku/trunk/headers/private/userlandfs/shared/HashMap.h =================================================================== --- haiku/trunk/headers/private/userlandfs/shared/HashMap.h 2007-03-04 05:09:59 UTC (rev 20321) +++ haiku/trunk/headers/private/userlandfs/shared/HashMap.h 2007-03-04 08:26:45 UTC (rev 20322) @@ -190,8 +190,8 @@ template class SynchronizedHashMap : public Locker { public: - typedef HashMap::Entry Entry; - typedef HashMap::Iterator Iterator; + typedef typename HashMap::Entry Entry; + typedef typename HashMap::Iterator Iterator; SynchronizedHashMap() : Locker("synchronized hash map") {} ~SynchronizedHashMap() { Lock(); } @@ -420,7 +420,7 @@ // GetIterator template -HashMap::Iterator +typename HashMap::Iterator HashMap::GetIterator() { return Iterator(this); @@ -428,7 +428,7 @@ // _FindElement template -HashMap::Element * +typename HashMap::Element * HashMap::_FindElement(const Key& key) const { Element* element = fTable.FindFirst(key.GetHashCode()); Modified: haiku/trunk/headers/private/userlandfs/shared/Vector.h =================================================================== --- haiku/trunk/headers/private/userlandfs/shared/Vector.h 2007-03-04 05:09:59 UTC (rev 20321) +++ haiku/trunk/headers/private/userlandfs/shared/Vector.h 2007-03-04 08:26:45 UTC (rev 20322) @@ -382,7 +382,7 @@ removed), or Null(), if \a index was out of range. */ _VECTOR_TEMPLATE_LIST -_VECTOR_CLASS_NAME::Iterator +typename _VECTOR_CLASS_NAME::Iterator _VECTOR_CLASS_NAME::Erase(int32 index) { if (index >= 0 && index < fItemCount) { @@ -403,7 +403,7 @@ (in this case including End()). */ _VECTOR_TEMPLATE_LIST -_VECTOR_CLASS_NAME::Iterator +typename _VECTOR_CLASS_NAME::Iterator _VECTOR_CLASS_NAME::Erase(const Iterator &iterator) { int32 index = _IteratorIndex(iterator); @@ -458,7 +458,7 @@ */ _VECTOR_TEMPLATE_LIST inline -_VECTOR_CLASS_NAME::Iterator +typename _VECTOR_CLASS_NAME::Iterator _VECTOR_CLASS_NAME::Begin() { return Iterator(fItems); @@ -474,7 +474,7 @@ */ _VECTOR_TEMPLATE_LIST inline -_VECTOR_CLASS_NAME::ConstIterator +typename _VECTOR_CLASS_NAME::ConstIterator _VECTOR_CLASS_NAME::Begin() const { return ConstIterator(fItems); @@ -490,7 +490,7 @@ */ _VECTOR_TEMPLATE_LIST inline -_VECTOR_CLASS_NAME::Iterator +typename _VECTOR_CLASS_NAME::Iterator _VECTOR_CLASS_NAME::End() { return Iterator(fItems + fItemCount); @@ -506,7 +506,7 @@ */ _VECTOR_TEMPLATE_LIST inline -_VECTOR_CLASS_NAME::ConstIterator +typename _VECTOR_CLASS_NAME::ConstIterator _VECTOR_CLASS_NAME::End() const { return ConstIterator(fItems + fItemCount); @@ -522,7 +522,7 @@ */ _VECTOR_TEMPLATE_LIST inline -_VECTOR_CLASS_NAME::Iterator +typename _VECTOR_CLASS_NAME::Iterator _VECTOR_CLASS_NAME::Null() { return Iterator(NULL); @@ -538,7 +538,7 @@ */ _VECTOR_TEMPLATE_LIST inline -_VECTOR_CLASS_NAME::ConstIterator +typename _VECTOR_CLASS_NAME::ConstIterator _VECTOR_CLASS_NAME::Null() const { return ConstIterator(NULL); @@ -551,7 +551,7 @@ */ _VECTOR_TEMPLATE_LIST inline -_VECTOR_CLASS_NAME::Iterator +typename _VECTOR_CLASS_NAME::Iterator _VECTOR_CLASS_NAME::IteratorForIndex(int32 index) { if (index >= 0 && index <= fItemCount) @@ -566,7 +566,7 @@ */ _VECTOR_TEMPLATE_LIST inline -_VECTOR_CLASS_NAME::ConstIterator +typename _VECTOR_CLASS_NAME::ConstIterator _VECTOR_CLASS_NAME::IteratorForIndex(int32 index) const { if (index >= 0 && index <= fItemCount) @@ -637,7 +637,7 @@ */ _VECTOR_TEMPLATE_LIST inline -_VECTOR_CLASS_NAME::Iterator +typename _VECTOR_CLASS_NAME::Iterator _VECTOR_CLASS_NAME::Find(const Value &value) { return Find(value, Begin()); @@ -654,7 +654,7 @@ invalid. */ _VECTOR_TEMPLATE_LIST -_VECTOR_CLASS_NAME::Iterator +typename _VECTOR_CLASS_NAME::Iterator _VECTOR_CLASS_NAME::Find(const Value &value, const Iterator &start) { int32 index = IndexOf(value, _IteratorIndex(start)); @@ -672,7 +672,7 @@ */ _VECTOR_TEMPLATE_LIST inline -_VECTOR_CLASS_NAME::ConstIterator +typename _VECTOR_CLASS_NAME::ConstIterator _VECTOR_CLASS_NAME::Find(const Value &value) const { return Find(value, Begin()); @@ -689,7 +689,7 @@ invalid. */ _VECTOR_TEMPLATE_LIST -_VECTOR_CLASS_NAME::ConstIterator +typename _VECTOR_CLASS_NAME::ConstIterator _VECTOR_CLASS_NAME::Find(const Value &value, const ConstIterator &start) const { int32 index = IndexOf(value, _IteratorIndex(start)); Modified: haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/Jamfile =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/Jamfile 2007-03-04 05:09:59 UTC (rev 20321) +++ haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/Jamfile 2007-03-04 08:26:45 UTC (rev 20322) @@ -4,7 +4,6 @@ userlandfs ] ; local userlandFSIncludes = [ PrivateHeaders userlandfs ] ; -#SubDirSysHdrs [ FDirName $(userlandFSIncludes) legacy ] ; SubDirHdrs [ FDirName $(userlandFSIncludes) private ] ; SubDirHdrs [ FDirName $(userlandFSIncludes) shared ] ; @@ -13,12 +12,6 @@ DEFINES += DEBUG_APP="\\\"userlandfs\\\"" ; -local kernelC++ ; -if $(OSPLAT) = X86 { - kernelC++ += kernel-cpp.cpp ; - SubDirC++Flags -include [ FDirName $(SUBDIR) kernel-cpp.h ] ; -} - KernelAddon userlandfs : AreaSupport.cpp Debug.cpp @@ -46,7 +39,5 @@ UserlandFS.cpp Volume.cpp -# $(kernelC++) - - : $(TARGET_GCC_LIBGCC) + : $(TARGET_GCC_LIBGCC) $(HAIKU_LIBSUPC++) ; Modified: haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/RequestPortPool.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/RequestPortPool.cpp 2007-03-04 05:09:59 UTC (rev 20321) +++ haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/RequestPortPool.cpp 2007-03-04 08:26:45 UTC (rev 20322) @@ -1,9 +1,12 @@ // RequestPortPool.cpp +#include "RequestPortPool.h" + +#include + #include "AutoLocker.h" #include "Debug.h" #include "RequestPort.h" -#include "RequestPortPool.h" typedef AutoLocker PoolLocker; Modified: haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/Settings.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/Settings.cpp 2007-03-04 05:09:59 UTC (rev 20321) +++ haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/Settings.cpp 2007-03-04 08:26:45 UTC (rev 20322) @@ -2,6 +2,8 @@ #include +#include + #include #include "Debug.h" @@ -9,6 +11,8 @@ #include "IOCtlInfo.h" #include "Settings.h" +using std::nothrow; + static const char *kFSName = "userlandfs"; // IOCtlInfoMap Modified: haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/UserlandFS.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/UserlandFS.cpp 2007-03-04 05:09:59 UTC (rev 20321) +++ haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/UserlandFS.cpp 2007-03-04 08:26:45 UTC (rev 20322) @@ -2,7 +2,6 @@ #include -#include "AutoLocker.h" #include "Compatibility.h" #include "Debug.h" #include "DispatcherDefs.h" @@ -12,7 +11,6 @@ #include "Requests.h" #include "UserlandFS.h" -typedef AutoLocker FileSystemLocker; UserlandFS* UserlandFS::sUserlandFS = NULL; Modified: haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/UserlandFS.h =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/UserlandFS.h 2007-03-04 05:09:59 UTC (rev 20321) +++ haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/UserlandFS.h 2007-03-04 08:26:45 UTC (rev 20322) @@ -5,6 +5,7 @@ #include +#include "AutoLocker.h" #include "HashMap.h" #include "String.h" @@ -40,6 +41,7 @@ private: friend class KernelDebug; typedef SynchronizedHashMap FileSystemMap; + typedef AutoLocker FileSystemLocker; static UserlandFS* sUserlandFS; Modified: haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/private/DispatcherDefs.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/private/DispatcherDefs.cpp 2007-03-04 05:09:59 UTC (rev 20321) +++ haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/private/DispatcherDefs.cpp 2007-03-04 08:26:45 UTC (rev 20322) @@ -2,5 +2,9 @@ #include "DispatcherDefs.h" +namespace UserlandFSUtil { + const char* kUserlandFSDispatcherPortName = "userland fs dispatcher"; const char* kUserlandFSDispatcherReplyPortName = "userland fs dispatcher reply"; + +} Modified: haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/private/Port.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/private/Port.cpp 2007-03-04 05:09:59 UTC (rev 20321) +++ haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/private/Port.cpp 2007-03-04 08:26:45 UTC (rev 20322) @@ -6,6 +6,8 @@ #include "Compatibility.h" #include "Port.h" +using std::nothrow; + // minimal and maximal port size static const int32 kMinPortSize = 1024; // 1 kB static const int32 kMaxPortSize = 64 * 1024; // 64 kB Modified: haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/private/RequestAllocator.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/private/RequestAllocator.cpp 2007-03-04 05:09:59 UTC (rev 20321) +++ haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/private/RequestAllocator.cpp 2007-03-04 08:26:45 UTC (rev 20322) @@ -8,6 +8,8 @@ #include "Port.h" #include "RequestAllocator.h" +using std::nothrow; + // constructor RequestAllocator::RequestAllocator(Port* port) : fError(B_NO_INIT), Modified: haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/private/RequestPort.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/private/RequestPort.cpp 2007-03-04 05:09:59 UTC (rev 20321) +++ haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/private/RequestPort.cpp 2007-03-04 08:26:45 UTC (rev 20322) @@ -8,6 +8,8 @@ #include "RequestHandler.h" #include "RequestPort.h" +using std::nothrow; + // TODO: Limit the stacking of requests? // AllocatorNode Modified: haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/private/userlandfs_ioctl.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/private/userlandfs_ioctl.cpp 2007-03-04 05:09:59 UTC (rev 20321) +++ haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/private/userlandfs_ioctl.cpp 2007-03-04 08:26:45 UTC (rev 20322) @@ -2,5 +2,9 @@ #include "userlandfs_ioctl.h" +namespace UserlandFSUtil { + const char kUserlandFSIOCtlMagic[USERLAND_IOCTL_MAGIC_LENGTH] = "userlandfs mAGiC666"; + +} Modified: haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/BeOSKernelFileSystem.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/BeOSKernelFileSystem.cpp 2007-03-04 05:09:59 UTC (rev 20321) +++ haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/BeOSKernelFileSystem.cpp 2007-03-04 08:26:45 UTC (rev 20322) @@ -6,6 +6,8 @@ #include "BeOSKernelVolume.h" +using std::nothrow; + // constructor BeOSKernelFileSystem::BeOSKernelFileSystem(beos_vnode_ops* fsOps) : FileSystem(), Modified: haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/FSInfo.h =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/FSInfo.h 2007-03-04 05:09:59 UTC (rev 20321) +++ haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/FSInfo.h 2007-03-04 08:26:45 UTC (rev 20322) @@ -12,6 +12,8 @@ #include "Port.h" #include "String.h" +using std::nothrow; + namespace UserlandFS { // FSInfo Modified: haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/RequestThread.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/RequestThread.cpp 2007-03-04 05:09:59 UTC (rev 20321) +++ haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/RequestThread.cpp 2007-03-04 08:26:45 UTC (rev 20322) @@ -8,6 +8,8 @@ #include "ServerDefs.h" #include "UserlandRequestHandler.h" +using std::nothrow; + static const int32 sTLSVariable = tls_allocate(); // constructor Modified: haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/ServerDefs.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/ServerDefs.cpp 2007-03-04 05:09:59 UTC (rev 20321) +++ haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/ServerDefs.cpp 2007-03-04 08:26:45 UTC (rev 20322) @@ -28,7 +28,8 @@ } // the global settings -ServerSettings gServerSettings; +ServerSettings UserlandFS::gServerSettings; -const char* kUserlandFSDispatcherClipboardName = "userland fs dispatcher"; +const char* UserlandFS::kUserlandFSDispatcherClipboardName + = "userland fs dispatcher"; From bonefish at mail.berlios.de Sun Mar 4 10:02:12 2007 From: bonefish at mail.berlios.de (bonefish at BerliOS) Date: Sun, 4 Mar 2007 10:02:12 +0100 Subject: [Haiku-commits] r20323 - haiku/trunk/src/tests/add-ons/kernel/file_systems/userlandfs/r5/src/test/ramfs Message-ID: <200703040902.l2492CCm010294@sheep.berlios.de> Author: bonefish Date: 2007-03-04 10:02:12 +0100 (Sun, 04 Mar 2007) New Revision: 20323 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20323&view=rev Modified: haiku/trunk/src/tests/add-ons/kernel/file_systems/userlandfs/r5/src/test/ramfs/AVLTree.h haiku/trunk/src/tests/add-ons/kernel/file_systems/userlandfs/r5/src/test/ramfs/AreaUtils.cpp haiku/trunk/src/tests/add-ons/kernel/file_systems/userlandfs/r5/src/test/ramfs/List.h haiku/trunk/src/tests/add-ons/kernel/file_systems/userlandfs/r5/src/test/ramfs/Locking.h haiku/trunk/src/tests/add-ons/kernel/file_systems/userlandfs/r5/src/test/ramfs/NodeChildTable.h haiku/trunk/src/tests/add-ons/kernel/file_systems/userlandfs/r5/src/test/ramfs/Query.cpp haiku/trunk/src/tests/add-ons/kernel/file_systems/userlandfs/r5/src/test/ramfs/TwoKeyAVLTree.h Log: Made RamFS code gcc4 friendly. Modified: haiku/trunk/src/tests/add-ons/kernel/file_systems/userlandfs/r5/src/test/ramfs/AVLTree.h =================================================================== --- haiku/trunk/src/tests/add-ons/kernel/file_systems/userlandfs/r5/src/test/ramfs/AVLTree.h 2007-03-04 08:26:45 UTC (rev 20322) +++ haiku/trunk/src/tests/add-ons/kernel/file_systems/userlandfs/r5/src/test/ramfs/AVLTree.h 2007-03-04 09:02:12 UTC (rev 20323) @@ -30,10 +30,14 @@ #include +#include + #include #include "Misc.h" +using std::nothrow; + // maximal height of a tree static const int kMaxAVLTreeHeight = 32; Modified: haiku/trunk/src/tests/add-ons/kernel/file_systems/userlandfs/r5/src/test/ramfs/AreaUtils.cpp =================================================================== --- haiku/trunk/src/tests/add-ons/kernel/file_systems/userlandfs/r5/src/test/ramfs/AreaUtils.cpp 2007-03-04 08:26:45 UTC (rev 20322) +++ haiku/trunk/src/tests/add-ons/kernel/file_systems/userlandfs/r5/src/test/ramfs/AreaUtils.cpp 2007-03-04 09:02:12 UTC (rev 20323) @@ -25,11 +25,11 @@ // dealings in this Software without prior written authorization of the // copyright holder. -#include #include #include "AreaUtils.h" #include "Debug.h" +#include "Misc.h" #ifndef USE_STANDARD_FUNCTIONS #define USE_STANDARD_FUNCTIONS 0 Modified: haiku/trunk/src/tests/add-ons/kernel/file_systems/userlandfs/r5/src/test/ramfs/List.h =================================================================== --- haiku/trunk/src/tests/add-ons/kernel/file_systems/userlandfs/r5/src/test/ramfs/List.h 2007-03-04 08:26:45 UTC (rev 20322) +++ haiku/trunk/src/tests/add-ons/kernel/file_systems/userlandfs/r5/src/test/ramfs/List.h 2007-03-04 09:02:12 UTC (rev 20323) @@ -101,7 +101,7 @@ // sDefaultItem template -List::item_t +typename List::item_t List::sDefaultItem( DEFAULT_ITEM_SUPPLIER::GetItem()); @@ -129,7 +129,7 @@ // GetDefaultItem template inline -const List::item_t & +const typename List::item_t & List::GetDefaultItem() const { return sDefaultItem; @@ -138,7 +138,7 @@ // GetDefaultItem template inline -List::item_t & +typename List::item_t & List::GetDefaultItem() { return sDefaultItem; @@ -310,7 +310,7 @@ // ItemAt template -const List::item_t & +const typename List::item_t & List::ItemAt(int32 index) const { if (index >= 0 && index < fItemCount) @@ -320,7 +320,7 @@ // ItemAt template -List::item_t & +typename List::item_t & List::ItemAt(int32 index) { if (index >= 0 && index < fItemCount) @@ -330,7 +330,7 @@ // Items template -const List::item_t * +const typename List::item_t * List::Items() const { return fItems; Modified: haiku/trunk/src/tests/add-ons/kernel/file_systems/userlandfs/r5/src/test/ramfs/Locking.h =================================================================== --- haiku/trunk/src/tests/add-ons/kernel/file_systems/userlandfs/r5/src/test/ramfs/Locking.h 2007-03-04 08:26:45 UTC (rev 20322) +++ haiku/trunk/src/tests/add-ons/kernel/file_systems/userlandfs/r5/src/test/ramfs/Locking.h 2007-03-04 09:02:12 UTC (rev 20323) @@ -11,4 +11,4 @@ typedef AutoLocker > VolumeReadLocker; typedef AutoLocker > VolumeWriteLocker; -#endif LOCKING_H +#endif // LOCKING_H Modified: haiku/trunk/src/tests/add-ons/kernel/file_systems/userlandfs/r5/src/test/ramfs/NodeChildTable.h =================================================================== --- haiku/trunk/src/tests/add-ons/kernel/file_systems/userlandfs/r5/src/test/ramfs/NodeChildTable.h 2007-03-04 08:26:45 UTC (rev 20322) +++ haiku/trunk/src/tests/add-ons/kernel/file_systems/userlandfs/r5/src/test/ramfs/NodeChildTable.h 2007-03-04 09:02:12 UTC (rev 20323) @@ -224,7 +224,7 @@ // _FindElement template -NodeChildTable::Element * +typename NodeChildTable::Element * NodeChildTable::_FindElement(vnode_id id, const char *name) const { Modified: haiku/trunk/src/tests/add-ons/kernel/file_systems/userlandfs/r5/src/test/ramfs/Query.cpp =================================================================== --- haiku/trunk/src/tests/add-ons/kernel/file_systems/userlandfs/r5/src/test/ramfs/Query.cpp 2007-03-04 08:26:45 UTC (rev 20322) +++ haiku/trunk/src/tests/add-ons/kernel/file_systems/userlandfs/r5/src/test/ramfs/Query.cpp 2007-03-04 09:02:12 UTC (rev 20323) @@ -1449,13 +1449,13 @@ { skipWhitespace(expr); - bool not = false; + bool nott = false; // note: not is a C++ keyword if (**expr == '!') { skipWhitespace(expr, 1); if (**expr != '(') return NULL; - not = true; + nott = true; } if (**expr == ')') { @@ -1475,7 +1475,7 @@ // If the term is negated, we just complement the tree, to get // rid of the not, a.k.a. DeMorgan's Law. - if (not) + if (nott) term->Complement(); skipWhitespace(expr, 1); Modified: haiku/trunk/src/tests/add-ons/kernel/file_systems/userlandfs/r5/src/test/ramfs/TwoKeyAVLTree.h =================================================================== --- haiku/trunk/src/tests/add-ons/kernel/file_systems/userlandfs/r5/src/test/ramfs/TwoKeyAVLTree.h 2007-03-04 08:26:45 UTC (rev 20322) +++ haiku/trunk/src/tests/add-ons/kernel/file_systems/userlandfs/r5/src/test/ramfs/TwoKeyAVLTree.h 2007-03-04 09:02:12 UTC (rev 20323) @@ -141,6 +141,8 @@ GetKey; typedef AVLTree BaseClass; +public: + typedef typename BaseClass::Iterator Iterator; public: TwoKeyAVLTree(); @@ -210,7 +212,7 @@ TWO_KEY_AVL_TREE_CLASS_NAME::FindFirst(const PrimaryKey &key, Iterator *iterator) { - Node *node = fRoot; + Node *node = BaseClass::fRoot; while (node) { int cmp = fPrimaryKeyCompare(key, fGetPrimaryKey(fGetValue(node))); if (cmp == 0) { @@ -237,7 +239,7 @@ TWO_KEY_AVL_TREE_CLASS_NAME::FindLast(const PrimaryKey &key, Iterator *iterator) { - Node *node = fRoot; + Node *node = BaseClass::fRoot; while (node) { int cmp = fPrimaryKeyCompare(key, fGetPrimaryKey(fGetValue(node))); if (cmp == 0) { From bonefish at mail.berlios.de Sun Mar 4 10:18:55 2007 From: bonefish at mail.berlios.de (bonefish at BerliOS) Date: Sun, 4 Mar 2007 10:18:55 +0100 Subject: [Haiku-commits] r20324 - haiku/trunk/src/tests/add-ons/kernel/file_systems/userlandfs/r5/src/test/reiserfs Message-ID: <200703040918.l249It4B010948@sheep.berlios.de> Author: bonefish Date: 2007-03-04 10:18:55 +0100 (Sun, 04 Mar 2007) New Revision: 20324 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20324&view=rev Modified: haiku/trunk/src/tests/add-ons/kernel/file_systems/userlandfs/r5/src/test/reiserfs/BlockCache.cpp haiku/trunk/src/tests/add-ons/kernel/file_systems/userlandfs/r5/src/test/reiserfs/Item.h haiku/trunk/src/tests/add-ons/kernel/file_systems/userlandfs/r5/src/test/reiserfs/Iterators.cpp haiku/trunk/src/tests/add-ons/kernel/file_systems/userlandfs/r5/src/test/reiserfs/Key.h haiku/trunk/src/tests/add-ons/kernel/file_systems/userlandfs/r5/src/test/reiserfs/List.h haiku/trunk/src/tests/add-ons/kernel/file_systems/userlandfs/r5/src/test/reiserfs/Settings.cpp haiku/trunk/src/tests/add-ons/kernel/file_systems/userlandfs/r5/src/test/reiserfs/StatItem.h haiku/trunk/src/tests/add-ons/kernel/file_systems/userlandfs/r5/src/test/reiserfs/String.cpp haiku/trunk/src/tests/add-ons/kernel/file_systems/userlandfs/r5/src/test/reiserfs/SuperBlock.cpp Log: Made ReiserFS code gcc 4 friendly. Modified: haiku/trunk/src/tests/add-ons/kernel/file_systems/userlandfs/r5/src/test/reiserfs/BlockCache.cpp =================================================================== --- haiku/trunk/src/tests/add-ons/kernel/file_systems/userlandfs/r5/src/test/reiserfs/BlockCache.cpp 2007-03-04 09:02:12 UTC (rev 20323) +++ haiku/trunk/src/tests/add-ons/kernel/file_systems/userlandfs/r5/src/test/reiserfs/BlockCache.cpp 2007-03-04 09:18:55 UTC (rev 20324) @@ -19,6 +19,8 @@ // You can alternatively use *this file* under the terms of the the MIT // license included in this package. +#include + #include #include #include @@ -32,6 +34,8 @@ #include "Debug.h" #include "reiserfs.h" +using std::nothrow; + /*! \class BlockCache \brief Implements a cache for disk blocks. Modified: haiku/trunk/src/tests/add-ons/kernel/file_systems/userlandfs/r5/src/test/reiserfs/Item.h =================================================================== --- haiku/trunk/src/tests/add-ons/kernel/file_systems/userlandfs/r5/src/test/reiserfs/Item.h 2007-03-04 09:02:12 UTC (rev 20323) +++ haiku/trunk/src/tests/add-ons/kernel/file_systems/userlandfs/r5/src/test/reiserfs/Item.h 2007-03-04 09:18:55 UTC (rev 20324) @@ -36,7 +36,7 @@ uint16 GetLen() const { return le2h(ih_item_len); } uint16 GetLocation() const { return le2h(ih_item_location); } uint16 GetVersion() const { return le2h(ih_version); } - const Key *GetKey() const { return static_cast(&ih_key); } + const Key *GetKey() const { return Key::CastFrom(&ih_key); } VKey *GetKey(VKey *k) const { k->SetTo(GetKey(), GetVersion()); return k; } // indirect item only Modified: haiku/trunk/src/tests/add-ons/kernel/file_systems/userlandfs/r5/src/test/reiserfs/Iterators.cpp =================================================================== --- haiku/trunk/src/tests/add-ons/kernel/file_systems/userlandfs/r5/src/test/reiserfs/Iterators.cpp 2007-03-04 09:02:12 UTC (rev 20323) +++ haiku/trunk/src/tests/add-ons/kernel/file_systems/userlandfs/r5/src/test/reiserfs/Iterators.cpp 2007-03-04 09:18:55 UTC (rev 20324) @@ -313,7 +313,7 @@ \return \c B_OK, if everything went fine */ status_t -TreeIterator::GoToPreviousLeaf(LeafNode **node = NULL) +TreeIterator::GoToPreviousLeaf(LeafNode **node) { status_t error = InitCheck(); if (error == B_OK) { @@ -355,7 +355,7 @@ \return \c B_OK, if everything went fine */ status_t -TreeIterator::GoToNextLeaf(LeafNode **node = NULL) +TreeIterator::GoToNextLeaf(LeafNode **node) { status_t error = InitCheck(); if (error == B_OK) { @@ -392,7 +392,7 @@ \return \c B_OK, if everything went fine. */ status_t -TreeIterator::FindRightMostLeaf(const VKey *k, LeafNode **node = NULL) +TreeIterator::FindRightMostLeaf(const VKey *k, LeafNode **node) { //printf("TreeIterator::FindRightMostLeaf()\n"); status_t error = (k ? InitCheck() : B_BAD_VALUE); Modified: haiku/trunk/src/tests/add-ons/kernel/file_systems/userlandfs/r5/src/test/reiserfs/Key.h =================================================================== --- haiku/trunk/src/tests/add-ons/kernel/file_systems/userlandfs/r5/src/test/reiserfs/Key.h 2007-03-04 09:02:12 UTC (rev 20323) +++ haiku/trunk/src/tests/add-ons/kernel/file_systems/userlandfs/r5/src/test/reiserfs/Key.h 2007-03-04 09:18:55 UTC (rev 20324) @@ -49,6 +49,11 @@ Key(const Key &k) : key(k) {} ~Key() {} + static Key* CastFrom(key* k) + { return static_cast(k); } + static const Key* CastFrom(const key* k) + { return static_cast(k); } + void SetTo(uint32 dirID, uint32 objectID, uint64 offset, uint32 type, uint16 version) { Modified: haiku/trunk/src/tests/add-ons/kernel/file_systems/userlandfs/r5/src/test/reiserfs/List.h =================================================================== --- haiku/trunk/src/tests/add-ons/kernel/file_systems/userlandfs/r5/src/test/reiserfs/List.h 2007-03-04 09:02:12 UTC (rev 20323) +++ haiku/trunk/src/tests/add-ons/kernel/file_systems/userlandfs/r5/src/test/reiserfs/List.h 2007-03-04 09:18:55 UTC (rev 20324) @@ -88,7 +88,7 @@ // sDefaultItem template -List::item_t +typename List::item_t List::sDefaultItem( DEFAULT_ITEM_SUPPLIER::GetItem()); @@ -116,7 +116,7 @@ // GetDefaultItem template inline -const List::item_t & +const typename List::item_t & List::GetDefaultItem() const { return sDefaultItem; @@ -125,7 +125,7 @@ // GetDefaultItem template inline -List::item_t & +typename List::item_t & List::GetDefaultItem() { return sDefaultItem; @@ -264,7 +264,7 @@ // ItemAt template -const List::item_t & +const typename List::item_t & List::ItemAt(int32 index) const { if (index >= 0 && index < fItemCount) @@ -274,7 +274,7 @@ // ItemAt template -List::item_t & +typename List::item_t & List::ItemAt(int32 index) { if (index >= 0 && index < fItemCount) @@ -284,7 +284,7 @@ // Items template -const List::item_t * +const typename List::item_t * List::Items() const { return fItems; Modified: haiku/trunk/src/tests/add-ons/kernel/file_systems/userlandfs/r5/src/test/reiserfs/Settings.cpp =================================================================== --- haiku/trunk/src/tests/add-ons/kernel/file_systems/userlandfs/r5/src/test/reiserfs/Settings.cpp 2007-03-04 09:02:12 UTC (rev 20323) +++ haiku/trunk/src/tests/add-ons/kernel/file_systems/userlandfs/r5/src/test/reiserfs/Settings.cpp 2007-03-04 09:18:55 UTC (rev 20324) @@ -24,6 +24,8 @@ #include "Settings.h" #include "Debug.h" +using std::nothrow; + /*! \class Settings \brief Manages the ReiserFS settings. Modified: haiku/trunk/src/tests/add-ons/kernel/file_systems/userlandfs/r5/src/test/reiserfs/StatItem.h =================================================================== --- haiku/trunk/src/tests/add-ons/kernel/file_systems/userlandfs/r5/src/test/reiserfs/StatItem.h 2007-03-04 09:02:12 UTC (rev 20323) +++ haiku/trunk/src/tests/add-ons/kernel/file_systems/userlandfs/r5/src/test/reiserfs/StatItem.h 2007-03-04 09:18:55 UTC (rev 20324) @@ -42,13 +42,13 @@ */ class StatData { public: - StatData() : fVersion(STAT_DATA_V2), fCurrentData(NULL) {} + StatData() : fCurrentData(NULL), fVersion(STAT_DATA_V2) {} StatData(const StatData &data) - : fVersion(STAT_DATA_V2), fCurrentData(NULL) { *this = data; } + : fCurrentData(NULL), fVersion(STAT_DATA_V2) { *this = data; } StatData(stat_data_v1 *data, bool clone = false) - : fVersion(STAT_DATA_V2), fCurrentData(NULL) { SetTo(data, clone); } + : fCurrentData(NULL), fVersion(STAT_DATA_V2) { SetTo(data, clone); } StatData(stat_data *data, bool clone = false) - : fVersion(STAT_DATA_V2), fCurrentData(NULL) { SetTo(data, clone); } + : fCurrentData(NULL), fVersion(STAT_DATA_V2) { SetTo(data, clone); } ~StatData() { Unset(); } status_t SetTo(stat_data_v1 *data, bool clone = false) Modified: haiku/trunk/src/tests/add-ons/kernel/file_systems/userlandfs/r5/src/test/reiserfs/String.cpp =================================================================== --- haiku/trunk/src/tests/add-ons/kernel/file_systems/userlandfs/r5/src/test/reiserfs/String.cpp 2007-03-04 09:02:12 UTC (rev 20323) +++ haiku/trunk/src/tests/add-ons/kernel/file_systems/userlandfs/r5/src/test/reiserfs/String.cpp 2007-03-04 09:18:55 UTC (rev 20324) @@ -24,6 +24,8 @@ #include "String.h" +using std::nothrow; + /*! \class String \brief A very simple string class. Modified: haiku/trunk/src/tests/add-ons/kernel/file_systems/userlandfs/r5/src/test/reiserfs/SuperBlock.cpp =================================================================== --- haiku/trunk/src/tests/add-ons/kernel/file_systems/userlandfs/r5/src/test/reiserfs/SuperBlock.cpp 2007-03-04 09:02:12 UTC (rev 20323) +++ haiku/trunk/src/tests/add-ons/kernel/file_systems/userlandfs/r5/src/test/reiserfs/SuperBlock.cpp 2007-03-04 09:18:55 UTC (rev 20324) @@ -26,6 +26,8 @@ #include "Debug.h" #include "SuperBlock.h" +using std::nothrow; + /*! \class DirEntry \brief Represents the on-disk structure for super block of the FS. From bonefish at mail.berlios.de Sun Mar 4 20:53:36 2007 From: bonefish at mail.berlios.de (bonefish at BerliOS) Date: Sun, 4 Mar 2007 20:53:36 +0100 Subject: [Haiku-commits] r20325 - buildtools/trunk/gcc/gcc Message-ID: <200703041953.l24Jrahu013468@sheep.berlios.de> Author: bonefish Date: 2007-03-04 20:53:35 +0100 (Sun, 04 Mar 2007) New Revision: 20325 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20325&view=rev Modified: buildtools/trunk/gcc/gcc/config.gcc Log: Fixed PPC compiler build. Modified: buildtools/trunk/gcc/gcc/config.gcc =================================================================== --- buildtools/trunk/gcc/gcc/config.gcc 2007-03-04 09:18:55 UTC (rev 20324) +++ buildtools/trunk/gcc/gcc/config.gcc 2007-03-04 19:53:35 UTC (rev 20325) @@ -1716,6 +1716,7 @@ powerpc-*-haiku*) tmake_file="rs6000/t-fprules rs6000/t-ppcos rs6000/t-ppccomm t-haiku" tm_file="${tm_file} dbxelf.h elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h haiku.h rs6000/haiku-ppc.h" + extra_options="${extra_options} rs6000/sysv4.opt" extra_parts='crtbegin.o crtend.o' ;; powerpc-*-rtems*) From jackburton at mail.berlios.de Sun Mar 4 22:06:52 2007 From: jackburton at mail.berlios.de (jackburton at BerliOS) Date: Sun, 4 Mar 2007 22:06:52 +0100 Subject: [Haiku-commits] r20326 - haiku/trunk/src/apps/terminal Message-ID: <200703042106.l24L6qfK022817@sheep.berlios.de> Author: jackburton Date: 2007-03-04 22:06:51 +0100 (Sun, 04 Mar 2007) New Revision: 20326 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20326&view=rev Modified: haiku/trunk/src/apps/terminal/FindDlg.cpp haiku/trunk/src/apps/terminal/FindDlg.h haiku/trunk/src/apps/terminal/TermWindow.cpp Log: Patch by Vasilis Kaoutsis: * Use a BMessenger instead of a BWindow pointer * Removed an useless SetTitle() call * Lock the window before quitting it * Style changes and cleanups Modified: haiku/trunk/src/apps/terminal/FindDlg.cpp =================================================================== --- haiku/trunk/src/apps/terminal/FindDlg.cpp 2007-03-04 19:53:35 UTC (rev 20325) +++ haiku/trunk/src/apps/terminal/FindDlg.cpp 2007-03-04 21:06:51 UTC (rev 20326) @@ -1,69 +1,31 @@ /* - * Copyright (c) 2003-4 Kian Duffy - * Parts Copyright (C) 1998,99 Kazuho Okui and Takashi Murai. - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files or portions - * thereof (the "Software"), to deal in the Software without restriction, - * including without limitation the rights to use, copy, modify, merge, - * publish, distribute, sublicense, and/or sell copies of the Software, - * and to permit persons to whom the Software is furnished to do so, subject - * to the following conditions: - * - * * Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright notice - * in the binary, as well as this list of conditions and the following - * disclaimer in the documentation and/or other materials provided with - * the distribution. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - * + * Copyright 2007, Haiku, Inc. + * Copyright 2003-2004 Kian Duffy, myob at users.sourceforge.net + * Parts Copyright 1998-1999 Kazuho Okui and Takashi Murai. + * All rights reserved. Distributed under the terms of the MIT license. */ -#include -#include -#include + +#include "FindDlg.h" + #include -#include #include +#include #include -#include -#include -#include #include +#include -#include "TermWindow.h" -#include "FindDlg.h" -#include "TermApp.h" -#include "MenuUtil.h" -#include "PrefHandler.h" -// message define - const uint32 MSG_FIND_HIDE = 'Fhid'; -////////////////////////////////////////////////////////////////////////////// -// FindDlg -// Constructer -////////////////////////////////////////////////////////////////////////////// -FindDlg::FindDlg (BRect frame, TermWindow *win , BString &str, - bool findselection, bool matchword, bool matchcase, bool forwardsearch) - : BWindow(frame, "Find", - B_FLOATING_WINDOW, B_NOT_RESIZABLE|B_NOT_ZOOMABLE) + +FindDlg::FindDlg (BRect frame, BMessenger messenger , BString &str, + bool findSelection, bool matchWord, bool matchCase, bool forwardSearch) + : BWindow(frame, "Find", B_FLOATING_WINDOW, B_NOT_RESIZABLE|B_NOT_ZOOMABLE), + fFindDlgMessenger(messenger) { - fWindow = win; - SetTitle("Find"); + AddShortcut((ulong)'W', (ulong)B_COMMAND_KEY, new BMessage(MSG_FIND_HIDE)); - AddShortcut ((ulong)'W', (ulong)B_COMMAND_KEY, new BMessage (MSG_FIND_HIDE)); - //Build up view fFindView = new BView(Bounds(), "FindView", B_FOLLOW_ALL, B_WILL_DRAW); fFindView->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR)); @@ -75,12 +37,12 @@ //These labels are from the bottom up float buttonsTop = frame.Height() - 19 - lineHeight; - float matchwordBottom = buttonsTop - 4; - float matchwordTop = matchwordBottom - lineHeight - 8; - float matchcaseBottom = matchwordTop - 4; - float matchcaseTop = matchcaseBottom - lineHeight - 8; - float forwardsearchBottom = matchcaseTop - 4; - float forwardsearchTop = forwardsearchBottom - lineHeight - 8; + float matchWordBottom = buttonsTop - 4; + float matchWordTop = matchWordBottom - lineHeight - 8; + float matchCaseBottom = matchWordTop - 4; + float matchCaseTop = matchCaseBottom - lineHeight - 8; + float forwardSearchBottom = matchCaseTop - 4; + float forwardSearchTop = forwardSearchBottom - lineHeight - 8; //These things are calculated from the top float textRadioTop = 12; @@ -90,11 +52,11 @@ float selectionRadioBottom = selectionRadioTop + lineHeight + 8; //Divider - float dividerHeight = (selectionRadioBottom + forwardsearchTop) / 2; + float dividerHeight = (selectionRadioBottom + forwardSearchTop) / 2; //Button Coordinates - float searchbuttonLeft = (frame.Width() - fFindView->StringWidth("Find") - 60) / 2; - float searchbuttonRight = searchbuttonLeft + fFindView->StringWidth("Find") + 60; + float searchButtonLeft = (frame.Width() - fFindView->StringWidth("Find") - 60) / 2; + float searchButtonRight = searchButtonLeft + fFindView->StringWidth("Find") + 60; //Build the Views fTextRadio = new BRadioButton(BRect(14, textRadioTop, textRadioRight, textRadioBottom), @@ -105,7 +67,7 @@ "fFindLabel", "", "", NULL); fFindLabel->SetDivider(0); fFindView->AddChild(fFindLabel); - if (!findselection) + if (!findSelection) fFindLabel->SetText(str.String()); fFindLabel->MakeFocus(true); @@ -113,7 +75,7 @@ "fSelectionRadio", "Use Selection", NULL); fFindView->AddChild(fSelectionRadio); - if (findselection) + if (findSelection) fSelectionRadio->SetValue(B_CONTROL_ON); else fTextRadio->SetValue(B_CONTROL_ON); @@ -121,25 +83,25 @@ fSeparator = new BBox(BRect(6, dividerHeight, frame.Width() - 6, dividerHeight + 1)); fFindView->AddChild(fSeparator); - fForwardSearchBox = new BCheckBox(BRect(14, forwardsearchTop, frame.Width() - 14, forwardsearchBottom), + fForwardSearchBox = new BCheckBox(BRect(14, forwardSearchTop, frame.Width() - 14, forwardSearchBottom), "fForwardSearchBox", "Search Forward", NULL); fFindView->AddChild(fForwardSearchBox); - if (forwardsearch) + if (forwardSearch) fForwardSearchBox->SetValue(B_CONTROL_ON); - fMatchCaseBox = new BCheckBox(BRect(14, matchcaseTop, frame.Width() - 14, matchcaseBottom), + fMatchCaseBox = new BCheckBox(BRect(14, matchCaseTop, frame.Width() - 14, matchCaseBottom), "fMatchCaseBox", "Match Case", NULL); fFindView->AddChild(fMatchCaseBox); - if (matchcase) + if (matchCase) fMatchCaseBox->SetValue(B_CONTROL_ON); - fMatchWordBox = new BCheckBox(BRect(14, matchwordTop, frame.Width() - 14, matchwordBottom), + fMatchWordBox = new BCheckBox(BRect(14, matchWordTop, frame.Width() - 14, matchWordBottom), "fMatchWordBox", "Match Word", NULL); fFindView->AddChild(fMatchWordBox); - if (matchword) + if (matchWord) fMatchWordBox->SetValue(B_CONTROL_ON); - fFindButton = new BButton(BRect(searchbuttonLeft, buttonsTop, searchbuttonRight, frame.Height() - 14), + fFindButton = new BButton(BRect(searchButtonLeft, buttonsTop, searchButtonRight, frame.Height() - 14), "fFindButton", "Find", new BMessage(MSG_FIND)); fFindButton->MakeDefault(true); fFindView->AddChild(fFindButton); @@ -147,39 +109,45 @@ Show(); } -FindDlg::~FindDlg (void) + +FindDlg::~FindDlg() { - } + void -FindDlg::MessageReceived (BMessage *msg) +FindDlg::MessageReceived(BMessage *msg) { switch (msg->what) { case B_QUIT_REQUESTED: Quit(); break; + case MSG_FIND: - SendFindMessage(); + _SendFindMessage(); break; + case MSG_FIND_HIDE: Quit(); break; + default: BWindow::MessageReceived(msg); break; } } + void -FindDlg::Quit (void) +FindDlg::Quit() { - fWindow->PostMessage(MSG_FIND_CLOSED); - BWindow::Quit (); + fFindDlgMessenger.SendMessage(MSG_FIND_CLOSED); + BWindow::Quit(); } + void -FindDlg::SendFindMessage (void) +FindDlg::_SendFindMessage() { BMessage message(MSG_FIND); @@ -195,5 +163,5 @@ message.AddBool("matchcase", fMatchCaseBox->Value() == B_CONTROL_ON); message.AddBool("matchword", fMatchWordBox->Value() == B_CONTROL_ON); - fWindow->PostMessage(&message); + fFindDlgMessenger.SendMessage(&message); } Modified: haiku/trunk/src/apps/terminal/FindDlg.h =================================================================== --- haiku/trunk/src/apps/terminal/FindDlg.h 2007-03-04 19:53:35 UTC (rev 20325) +++ haiku/trunk/src/apps/terminal/FindDlg.h 2007-03-04 21:06:51 UTC (rev 20326) @@ -1,76 +1,47 @@ /* - * Copyright (c) 2003-4 Kian Duffy - * Parts Copyright (C) 1998,99 Kazuho Okui and Takashi Murai. - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files or portions - * thereof (the "Software"), to deal in the Software without restriction, - * including without limitation the rights to use, copy, modify, merge, - * publish, distribute, sublicense, and/or sell copies of the Software, - * and to permit persons to whom the Software is furnished to do so, subject - * to the following conditions: - * - * * Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright notice - * in the binary, as well as this list of conditions and the following - * disclaimer in the documentation and/or other materials provided with - * the distribution. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - * + * Copyright 2007, Haiku, Inc. + * Copyright 2003-2004 Kian Duffy, myob at users.sourceforge.net + * Parts Copyright 1998-1999 Kazuho Okui and Takashi Murai. + * All rights reserved. Distributed under the terms of the MIT license. */ #ifndef FINDDLG_H_INCLUDED #define FINDDLG_H_INCLUDED + +#include #include -#include + const ulong MSG_FIND = 'msgf'; const ulong MSG_FIND_START = 'msac'; const ulong MSG_FIND_CLOSED = 'mfcl'; -class BRect; -class BBitmap; -class BMessage; -class TermWindow; -class BTextControl; -class BRadioButton; -class BCheckBox; -class FindDlg : public BWindow -{ -public: - FindDlg (BRect frame, TermWindow *win, BString &str, - bool findselection, bool matchword, bool matchcase, bool forwardsearch); - ~FindDlg (); +class FindDlg : public BWindow { + public: + FindDlg (BRect frame, BMessenger messenger, BString &str, + bool findSelection, bool matchWord, bool matchCase, bool forwardSearch); + virtual ~FindDlg(); -private: - virtual void Quit (void); - void MessageReceived (BMessage *msg); + virtual void Quit(); + virtual void MessageReceived(BMessage *msg); - void SendFindMessage (void); + private: + void _SendFindMessage(); - BView *fFindView; - BTextControl *fFindLabel; - BRadioButton *fTextRadio; - BRadioButton *fSelectionRadio; - BBox *fSeparator; - BCheckBox *fForwardSearchBox; - BCheckBox *fMatchCaseBox; - BCheckBox *fMatchWordBox; - BButton *fFindButton; + private: + BView *fFindView; + BTextControl *fFindLabel; + BRadioButton *fTextRadio; + BRadioButton *fSelectionRadio; + BBox *fSeparator; + BCheckBox *fForwardSearchBox; + BCheckBox *fMatchCaseBox; + BCheckBox *fMatchWordBox; + BButton *fFindButton; - BString *fFindString; - TermWindow *fWindow; + BString *fFindString; + BMessenger fFindDlgMessenger; }; - -#endif /* FINDDLG_H_INCLUDED */ +#endif // FINDDLG_H_INCLUDED Modified: haiku/trunk/src/apps/terminal/TermWindow.cpp =================================================================== --- haiku/trunk/src/apps/terminal/TermWindow.cpp 2007-03-04 19:53:35 UTC (rev 20325) +++ haiku/trunk/src/apps/terminal/TermWindow.cpp 2007-03-04 21:06:51 UTC (rev 20326) @@ -603,14 +603,19 @@ void -TermWindow::Quit(void) +TermWindow::Quit() { delete fTermParse; delete fCodeConv; - if (fPrefWindow) fPrefWindow->PostMessage (B_QUIT_REQUESTED); - if (fFindPanel) fFindPanel->PostMessage(B_QUIT_REQUESTED); + if (fPrefWindow) + fPrefWindow->PostMessage(B_QUIT_REQUESTED); + + if (fFindPanel && fFindPanel->Lock()) { + fFindPanel->Quit(); + fFindPanel = NULL; + } - be_app->PostMessage (B_QUIT_REQUESTED, be_app); + be_app->PostMessage(B_QUIT_REQUESTED, be_app); BWindow::Quit (); } From bonefish at mail.berlios.de Sun Mar 4 22:48:56 2007 From: bonefish at mail.berlios.de (bonefish at BerliOS) Date: Sun, 4 Mar 2007 22:48:56 +0100 Subject: [Haiku-commits] r20327 - haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on Message-ID: <200703042148.l24LmuCI028803@sheep.berlios.de> Author: bonefish Date: 2007-03-04 22:48:55 +0100 (Sun, 04 Mar 2007) New Revision: 20327 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20327&view=rev Removed: haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/kernel-cpp.cpp haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/kernel-cpp.h Log: Not needed anymore. Deleted: haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/kernel-cpp.cpp Deleted: haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/kernel-cpp.h From korli at users.berlios.de Sun Mar 4 23:40:45 2007 From: korli at users.berlios.de (=?ISO-8859-1?Q?J=E9r=F4me_Duval?=) Date: Sun, 4 Mar 2007 23:40:45 +0100 Subject: [Haiku-commits] r20138 - haiku/trunk/build/jam In-Reply-To: <20070216013502.16443.4@cs.tu-berlin.de> References: <200702160001.l1G01Wqw006217@sheep.berlios.de> <20070216013502.16443.4@cs.tu-berlin.de> Message-ID: 2007/2/16, Ingo Weinhold : > > On 2007-02-16 at 01:01:32 [+0100], korli at BerliOS > wrote: > > Author: korli > > Date: 2007-02-16 01:01:31 +0100 (Fri, 16 Feb 2007) > > New Revision: 20138 > > ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20138&view=rev > > > > Modified: > > haiku/trunk/build/jam/FileRules > > Log: > > fix the build on non english locale systems (to have svn info output > > Revision instead of R?\195?\169vision) > > Wow, localizing the command line is really one of the greatest achievements Another workaround would have been to use "svnversion" which simply outputs the revision alone. Though I didn't check if this '"svnversion" exists for BeOS as well. Bye, J?r?me From bonefish at cs.tu-berlin.de Mon Mar 5 00:02:51 2007 From: bonefish at cs.tu-berlin.de (Ingo Weinhold) Date: Mon, 05 Mar 2007 00:02:51 +0100 Subject: [Haiku-commits] r20138 - haiku/trunk/build/jam In-Reply-To: References: <200702160001.l1G01Wqw006217@sheep.berlios.de> <20070216013502.16443.4@cs.tu-berlin.de> Message-ID: <20070305000251.4690.3@cs.tu-berlin.de> On 2007-03-04 at 23:40:45 [+0100], J?r?me Duval wrote: > 2007/2/16, Ingo Weinhold : > > > > On 2007-02-16 at 01:01:32 [+0100], korli at BerliOS > > > > wrote: > > > Author: korli > > > Date: 2007-02-16 01:01:31 +0100 (Fri, 16 Feb 2007) > > > New Revision: 20138 > > > ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20138&view=rev > > > > > > Modified: > > > haiku/trunk/build/jam/FileRules > > > Log: > > > fix the build on non english locale systems (to have svn info output > > > Revision instead of R?\195?\169vision) > > > > Wow, localizing the command line is really one of the greatest > > achievements > > Another workaround would have been to use "svnversion" which simply > outputs the revision alone. Though I didn't check if this > '"svnversion" exists for BeOS as well. It does, but svnversion recursively examines the working directory tree (it prints the range of revision actually found, plus prefix "M" for "modified" and "S" for "switched"). This might be acceptable on Linux, but it takes ages on BeOS. CU, Ingo From bonefish at mail.berlios.de Mon Mar 5 00:11:03 2007 From: bonefish at mail.berlios.de (bonefish at BerliOS) Date: Mon, 5 Mar 2007 00:11:03 +0100 Subject: [Haiku-commits] r20328 - haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on Message-ID: <200703042311.l24NB3QF008297@sheep.berlios.de> Author: bonefish Date: 2007-03-05 00:11:02 +0100 (Mon, 05 Mar 2007) New Revision: 20328 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20328&view=rev Added: haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/FileSystemInitializer.cpp haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/FileSystemInitializer.h Modified: haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/FileSystem.cpp haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/FileSystem.h haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/Jamfile haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/KernelDebug.cpp haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/UserlandFS.cpp haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/UserlandFS.h Log: Added a level of indirection in the FileSystem management (FileSystemInitializer). This will allow for subclassing FileSystem later. Modified: haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/FileSystem.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/FileSystem.cpp 2007-03-04 21:48:55 UTC (rev 20327) +++ haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/FileSystem.cpp 2007-03-04 23:11:02 UTC (rev 20328) @@ -8,7 +8,6 @@ #include "KernelRequestHandler.h" #include "PortReleaser.h" #include "RequestAllocator.h" -#include "RequestPort.h" #include "Requests.h" #include "Settings.h" #include "SingleReplyRequestHandler.h" @@ -25,34 +24,32 @@ }; // constructor -FileSystem::FileSystem(const char* name, RequestPort* initPort, status_t* error) - : LazyInitializable(), - Referencable(), - fVolumes(), +FileSystem::FileSystem() + : fVolumes(), fVolumeLock(), - fName(name), - fInitPort(initPort), + fName(), fNotificationPort(NULL), fNotificationThread(-1), fPortPool(), fSelectSyncs(NULL), fSettings(NULL), fUserlandServerTeam(-1), + fInitialized(false), fTerminating(false) { - if (error) - *error = (fName.GetLength() == 0 ? B_NO_MEMORY : B_OK); } // destructor FileSystem::~FileSystem() { fTerminating = true; + // wait for the notification thread to terminate if (fNotificationThread >= 0) { int32 result; wait_for_thread(fNotificationThread, &result); } + // delete our data structures if (fSelectSyncs) { for (SelectSyncMap::Iterator it = fSelectSyncs->GetIterator(); @@ -65,6 +62,96 @@ delete fSettings; } +// Init +status_t +FileSystem::Init(const char* name, Port::Info* infos, int32 count) +{ + PRINT(("FileSystem::Init(\"%s\", %p, %ld)\n", name, infos, infoCount)); + + // check parameters + if (!name || !infos || count < 2) + RETURN_ERROR(B_BAD_VALUE); + + // set the name + if (!fName.SetTo(name)) + return B_NO_MEMORY; + + // create the select sync entry map + fSelectSyncs = new(nothrow) SelectSyncMap; + if (!fSelectSyncs) + return B_NO_MEMORY; + + // create the request ports + // the notification port + fNotificationPort = new(nothrow) RequestPort(infos); + if (!fNotificationPort) + RETURN_ERROR(B_NO_MEMORY); + status_t error = fNotificationPort->InitCheck(); + if (error != B_OK) + return error; + + // the other request ports + for (int32 i = 1; i < count; i++) { + RequestPort* port = new(nothrow) RequestPort(infos + i); + if (!port) + RETURN_ERROR(B_NO_MEMORY); + error = port->InitCheck(); + if (error == B_OK) + error = fPortPool.AddPort(port); + if (error != B_OK) { + delete port; + RETURN_ERROR(error); + } + } + + // get the userland team + port_info portInfo; + error = get_port_info(infos[0].owner_port, &portInfo); + if (error != B_OK) + RETURN_ERROR(error); + fUserlandServerTeam = portInfo.team; + + // print some info about the userland team + D( + PRINT((" userland team is: %ld\n", fUserlandServerTeam)); + int32 cookie = 0; + thread_info threadInfo; + while (get_next_thread_info(fUserlandServerTeam, &cookie, &threadInfo) + == B_OK) { + PRINT((" userland thread: %ld: `%s'\n", threadInfo.thread, + threadInfo.name)); + } + ); + + // load the settings + fSettings = new(nothrow) Settings; + if (fSettings) { + status_t settingsError = fSettings->SetTo(fName.GetString()); + if (settingsError != B_OK) { + PRINT(("Failed to load settings: %s\n", strerror(settingsError))); + delete fSettings; + fSettings = NULL; + } else + fSettings->Dump(); + } else + ERROR(("Failed to allocate settings.\n")); + + // spawn the notification thread + #if USER + fNotificationThread = spawn_thread(_NotificationThreadEntry, + "UFS notification thread", B_NORMAL_PRIORITY, this); + #else + fNotificationThread = spawn_kernel_thread(_NotificationThreadEntry, + "UFS notification thread", B_NORMAL_PRIORITY, this); + #endif + if (fNotificationThread < 0) + RETURN_ERROR(fNotificationThread); + resume_thread(fNotificationThread); + + fInitialized = (error == B_OK); + RETURN_ERROR(error); +} + // GetName const char* FileSystem::GetName() const @@ -85,9 +172,7 @@ const char* parameters, Volume** _volume) { // check initialization and parameters - if (InitCheck() != B_OK) - return InitCheck(); - if (!_volume) + if (!fInitialized || !_volume) return B_BAD_VALUE; // create volume @@ -232,107 +317,6 @@ return (info.team == fUserlandServerTeam); } -// FirstTimeInit -status_t -FileSystem::FirstTimeInit() -{ - if (fName.GetLength() == 0) - RETURN_ERROR(B_NO_MEMORY); - PRINT(("FileSystem::FirstTimeInit(): %s\n", fName.GetString())); - // create the select sync entry map - fSelectSyncs = new(nothrow) SelectSyncMap; - if (!fSelectSyncs) - return B_NO_MEMORY; - // prepare the request - RequestAllocator allocator(fInitPort->GetPort()); - FSConnectRequest* request; - status_t error = AllocateRequest(allocator, &request); - if (error != B_OK) - RETURN_ERROR(error); - error = allocator.AllocateString(request->fsName, fName.GetString()); - if (error != B_OK) - RETURN_ERROR(error); - // send the request - SingleReplyRequestHandler handler(FS_CONNECT_REPLY); - FSConnectReply* reply; - error = fInitPort->SendRequest(&allocator, &handler, (Request**)&reply); - if (error != B_OK) - RETURN_ERROR(error); - RequestReleaser requestReleaser(fInitPort, reply); - // process the reply - if (reply->error != B_OK) - RETURN_ERROR(reply->error); - // get the port infos - int32 count = reply->portInfoCount; - if (count < 2) - RETURN_ERROR(B_BAD_DATA); - if (reply->portInfos.GetSize() != count * (int32)sizeof(Port::Info)) - RETURN_ERROR(B_BAD_DATA); - Port::Info* infos = (Port::Info*)reply->portInfos.GetData(); - // create the request ports - // the notification port - fNotificationPort = new(nothrow) RequestPort(infos); - if (!fNotificationPort) - RETURN_ERROR(B_NO_MEMORY); - error = fNotificationPort->InitCheck(); - if (error != B_OK) - return error; - // the other request ports - for (int32 i = 1; i < count; i++) { - RequestPort* port = new(nothrow) RequestPort(infos + i); - if (!port) - RETURN_ERROR(B_NO_MEMORY); - error = port->InitCheck(); - if (error == B_OK) - error = fPortPool.AddPort(port); - if (error != B_OK) { - delete port; - RETURN_ERROR(error); - } - } - // get the userland team - port_info portInfo; - error = get_port_info(infos[0].owner_port, &portInfo); - if (error != B_OK) - RETURN_ERROR(error); - fUserlandServerTeam = portInfo.team; - // print some info about the userland team - D( - PRINT((" userland team is: %ld\n", fUserlandServerTeam)); - int32 cookie = 0; - thread_info threadInfo; - while (get_next_thread_info(fUserlandServerTeam, &cookie, &threadInfo) - == B_OK) { - PRINT((" userland thread: %ld: `%s'\n", threadInfo.thread, - threadInfo.name)); - } - ); - // load the settings - fSettings = new(nothrow) Settings; - if (fSettings) { - status_t settingsError = fSettings->SetTo(fName.GetString()); - if (settingsError != B_OK) { - PRINT(("Failed to load settings: %s\n", strerror(settingsError))); - delete fSettings; - fSettings = NULL; - } else - fSettings->Dump(); - } else - ERROR(("Failed to allocate settings.\n")); - // spawn the notification thread - #if USER - fNotificationThread = spawn_thread(_NotificationThreadEntry, - "UFS notification thread", B_NORMAL_PRIORITY, this); - #else - fNotificationThread = spawn_kernel_thread(_NotificationThreadEntry, - "UFS notification thread", B_NORMAL_PRIORITY, this); - #endif - if (fNotificationThread < 0) - RETURN_ERROR(fNotificationThread); - resume_thread(fNotificationThread); - RETURN_ERROR(error); -} - // _NotificationThreadEntry int32 FileSystem::_NotificationThreadEntry(void* data) Modified: haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/FileSystem.h =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/FileSystem.h 2007-03-04 21:48:55 UTC (rev 20327) +++ haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/FileSystem.h 2007-03-04 23:11:02 UTC (rev 20328) @@ -8,29 +8,24 @@ #include "LazyInitializable.h" #include "Locker.h" #include "Referencable.h" +#include "RequestPort.h" #include "RequestPortPool.h" #include "String.h" #include "Vector.h" -namespace UserlandFSUtil { -class RequestPort; - -} - -using UserlandFSUtil::RequestPort; - struct IOCtlInfo; class Settings; class Volume; -class FileSystem : public LazyInitializable, public Referencable { +class FileSystem { public: - FileSystem(const char* name, - RequestPort* initPort, - status_t* error); + FileSystem(); ~FileSystem(); + status_t Init(const char* name, Port::Info* infos, + int32 infoCount); + const char* GetName() const; RequestPortPool* GetPortPool(); @@ -52,9 +47,6 @@ bool IsUserlandServerThread() const; -protected: - virtual status_t FirstTimeInit(); - private: static int32 _NotificationThreadEntry(void* data); int32 _NotificationThread(); @@ -67,13 +59,13 @@ Vector fVolumes; Locker fVolumeLock; String fName; - RequestPort* fInitPort; RequestPort* fNotificationPort; thread_id fNotificationThread; RequestPortPool fPortPool; SelectSyncMap* fSelectSyncs; Settings* fSettings; team_id fUserlandServerTeam; + bool fInitialized; volatile bool fTerminating; }; Added: haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/FileSystemInitializer.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/FileSystemInitializer.cpp 2007-03-04 21:48:55 UTC (rev 20327) +++ haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/FileSystemInitializer.cpp 2007-03-04 23:11:02 UTC (rev 20328) @@ -0,0 +1,76 @@ +// FileSystemInitializer.cpp + +#include "FileSystemInitializer.h" + +#include + +#include "FileSystem.h" +#include "RequestAllocator.h" +#include "RequestPort.h" +#include "Requests.h" +#include "SingleReplyRequestHandler.h" + +using std::nothrow; + +// constructor +FileSystemInitializer::FileSystemInitializer(const char* name, + RequestPort* initPort) + : fName(name), + fInitPort(initPort), + fFileSystem(NULL) +{ + // Note: We don't copy the name. It's only needed in FirstTimeInit() and + // the UserlandFS makes sure it is valid until then. +} + +// destructor +FileSystemInitializer::~FileSystemInitializer() +{ + delete fFileSystem; +} + +// FirstTimeInit +status_t +FileSystemInitializer::FirstTimeInit() +{ + // prepare the request + RequestAllocator allocator(fInitPort->GetPort()); + FSConnectRequest* request; + status_t error = AllocateRequest(allocator, &request); + if (error != B_OK) + RETURN_ERROR(error); + error = allocator.AllocateString(request->fsName, fName); + if (error != B_OK) + RETURN_ERROR(error); + + // send the request + SingleReplyRequestHandler handler(FS_CONNECT_REPLY); + FSConnectReply* reply; + error = fInitPort->SendRequest(&allocator, &handler, (Request**)&reply); + if (error != B_OK) + RETURN_ERROR(error); + RequestReleaser requestReleaser(fInitPort, reply); + + // process the reply + if (reply->error != B_OK) + RETURN_ERROR(reply->error); + + // get the port infos + int32 count = reply->portInfoCount; + if (count < 2) + RETURN_ERROR(B_BAD_DATA); + if (reply->portInfos.GetSize() != count * (int32)sizeof(Port::Info)) + RETURN_ERROR(B_BAD_DATA); + Port::Info* infos = (Port::Info*)reply->portInfos.GetData(); + + // create and init the FileSystem + fFileSystem = new(nothrow) FileSystem(); + if (!fFileSystem) + return B_NO_MEMORY; + + error = fFileSystem->Init(fName, infos, count); + if (error != B_OK) + return B_ERROR; + + return B_OK; +} Added: haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/FileSystemInitializer.h =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/FileSystemInitializer.h 2007-03-04 21:48:55 UTC (rev 20327) +++ haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/FileSystemInitializer.h 2007-03-04 23:11:02 UTC (rev 20328) @@ -0,0 +1,37 @@ +// FileSystemInitializer.h + +#ifndef USERLAND_FS_FILE_SYSTEM_INITIALIZER_H +#define USERLAND_FS_FILE_SYSTEM_INITIALIZER_H + +#include "LazyInitializable.h" +#include "Referencable.h" + + +namespace UserlandFSUtil { + +class RequestPort; + +} + +using UserlandFSUtil::RequestPort; + +class FileSystem; + +class FileSystemInitializer : public LazyInitializable, public Referencable { +public: + FileSystemInitializer(const char* name, + RequestPort* initPort); + ~FileSystemInitializer(); + + inline FileSystem* GetFileSystem() { return fFileSystem; } + +protected: + virtual status_t FirstTimeInit(); + +private: + const char* fName; // valid only until FirstTimeInit() + RequestPort* fInitPort; + FileSystem* fFileSystem; +}; + +#endif // USERLAND_FS_FILE_SYSTEM_INITIALIZER_H Modified: haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/Jamfile =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/Jamfile 2007-03-04 21:48:55 UTC (rev 20327) +++ haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/Jamfile 2007-03-04 23:11:02 UTC (rev 20328) @@ -32,6 +32,7 @@ userlandfs_ioctl.cpp FileSystem.cpp + FileSystemInitializer.cpp kernel_interface.cpp KernelDebug.cpp KernelRequestHandler.cpp Modified: haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/KernelDebug.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/KernelDebug.cpp 2007-03-04 21:48:55 UTC (rev 20327) +++ haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/KernelDebug.cpp 2007-03-04 23:11:02 UTC (rev 20328) @@ -1,10 +1,12 @@ // KernelDebug.cpp +#include "KernelDebug.h" + #include #include "Debug.h" #include "FileSystem.h" -#include "KernelDebug.h" +#include "FileSystemInitializer.h" #include "RequestPort.h" #include "RequestPortPool.h" #include "UserlandFS.h" @@ -16,19 +18,23 @@ int KernelDebug::DebugUFS(int argc, char** argv) { - typedef HashMap KDebugFSMap; + typedef HashMap KDebugFSMap; UserlandFS* userlandFS = UserlandFS::GetUserlandFS(); KDebugFSMap& fileSystems = userlandFS->fFileSystems->GetUnsynchronizedMap(); + for (KDebugFSMap::Iterator it = fileSystems.GetIterator(); it.HasNext();) { KDebugFSMap::Entry entry = it.Next(); - FileSystem* fs = entry.value; - kprintf("file system %p: %s\n", fs, fs->GetName()); - kprintf(" port pool %p\n", fs->GetPortPool()); - int32 volumeCount = fs->fVolumes.Count(); - for (int32 i = 0; i < volumeCount; i++) { - Volume* volume = fs->fVolumes.ElementAt(i); - kprintf(" volume %p: %ld\n", volume, volume->GetID()); + FileSystemInitializer* fsInitializer = entry.value; + FileSystem* fs = fsInitializer->GetFileSystem(); + kprintf("file system %p: %s\n", fs, (fs ? fs->GetName() : NULL)); + if (fs) { + kprintf(" port pool %p\n", fs->GetPortPool()); + int32 volumeCount = fs->fVolumes.Count(); + for (int32 i = 0; i < volumeCount; i++) { + Volume* volume = fs->fVolumes.ElementAt(i); + kprintf(" volume %p: %ld\n", volume, volume->GetID()); + } } } return 0; Modified: haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/UserlandFS.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/UserlandFS.cpp 2007-03-04 21:48:55 UTC (rev 20327) +++ haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/UserlandFS.cpp 2007-03-04 23:11:02 UTC (rev 20328) @@ -1,15 +1,17 @@ // UserlandFS.cpp +#include "UserlandFS.h" + #include #include "Compatibility.h" #include "Debug.h" #include "DispatcherDefs.h" #include "FileSystem.h" +#include "FileSystemInitializer.h" #include "KernelDebug.h" #include "RequestPort.h" #include "Requests.h" -#include "UserlandFS.h" UserlandFS* UserlandFS::sUserlandFS = NULL; @@ -90,34 +92,34 @@ return B_BAD_VALUE; // check, if we do already know this file system, and create it, if not - FileSystem* fileSystem; + FileSystemInitializer* fileSystemInitializer; { FileSystemLocker _(fFileSystems); - fileSystem = fFileSystems->Get(name); - if (fileSystem) { - fileSystem->AddReference(); + fileSystemInitializer = fFileSystems->Get(name); + if (fileSystemInitializer) { + fileSystemInitializer->AddReference(); } else { - status_t error; - fileSystem = new(nothrow) FileSystem(name, fPort, &error); - if (!fileSystem) + fileSystemInitializer = new(nothrow) FileSystemInitializer(name, + fPort); + if (!fileSystemInitializer) return B_NO_MEMORY; - if (error == B_OK) - error = fFileSystems->Put(name, fileSystem); + + status_t error = fFileSystems->Put(name, fileSystemInitializer); if (error != B_OK) { - delete fileSystem; + delete fileSystemInitializer; return error; } } } // prepare the file system - status_t error = fileSystem->Access(); + status_t error = fileSystemInitializer->Access(); if (error != B_OK) { - UnregisterFileSystem(fileSystem); + _UnregisterFileSystem(name); return error; } - *_fileSystem = fileSystem; + *_fileSystem = fileSystemInitializer->GetFileSystem(); return error; } @@ -128,22 +130,7 @@ if (!fileSystem) return B_BAD_VALUE; - // find the FS and decrement its reference counter - bool deleteFS = false; - { - FileSystemLocker _(fFileSystems); - fileSystem = fFileSystems->Get(fileSystem->GetName()); - if (!fileSystem) - return B_BAD_VALUE; - deleteFS = fileSystem->RemoveReference(); - if (deleteFS) - fFileSystems->Remove(fileSystem->GetName()); - } - - // delete the FS, if the last reference has been removed - if (deleteFS) - delete fileSystem; - return B_OK; + return _UnregisterFileSystem(fileSystem->GetName()); } // CountFileSystems @@ -205,3 +192,29 @@ RETURN_ERROR(error); } +// _UnregisterFileSystem +status_t +UserlandFS::_UnregisterFileSystem(const char* name) +{ + if (!name) + return B_BAD_VALUE; + + // find the FS and decrement its reference counter + FileSystemInitializer* fileSystemInitializer = NULL; + bool deleteFS = false; + { + FileSystemLocker _(fFileSystems); + fileSystemInitializer = fFileSystems->Get(name); + if (!fileSystemInitializer) + return B_BAD_VALUE; + + deleteFS = fileSystemInitializer->RemoveReference(); + if (deleteFS) + fFileSystems->Remove(name); + } + + // delete the FS, if the last reference has been removed + if (deleteFS) + delete fileSystemInitializer; + return B_OK; +} Modified: haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/UserlandFS.h =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/UserlandFS.h 2007-03-04 21:48:55 UTC (rev 20327) +++ haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/UserlandFS.h 2007-03-04 23:11:02 UTC (rev 20328) @@ -18,6 +18,7 @@ using UserlandFSUtil::RequestPort; class FileSystem; +class FileSystemInitializer; class UserlandFS { private: @@ -36,13 +37,16 @@ int32 CountFileSystems() const; private: + friend class KernelDebug; + typedef SynchronizedHashMap + FileSystemMap; + typedef AutoLocker FileSystemLocker; + +private: status_t _Init(); + status_t _UnregisterFileSystem(const char* name); private: - friend class KernelDebug; - typedef SynchronizedHashMap FileSystemMap; - typedef AutoLocker FileSystemLocker; - static UserlandFS* sUserlandFS; RequestPort* fPort; From bonefish at mail.berlios.de Mon Mar 5 01:46:59 2007 From: bonefish at mail.berlios.de (bonefish at BerliOS) Date: Mon, 5 Mar 2007 01:46:59 +0100 Subject: [Haiku-commits] r20329 - in haiku/trunk: headers/os/drivers headers/private/kernel src/add-ons/kernel/file_systems/bfs src/add-ons/kernel/file_systems/dos src/add-ons/kernel/file_systems/googlefs src/add-ons/kernel/file_systems/iso9660 src/add-ons/kernel/file_systems/nfs src/add-ons/kernel/file_systems/ntfs src/add-ons/kernel/file_systems/userlandfs/kernel_add_on src/system/kernel/fs src/tests/add-ons/kernel/file_systems/bfs/bfs_shell Message-ID: <200703050046.l250kxMJ028453@sheep.berlios.de> Author: bonefish Date: 2007-03-05 01:46:57 +0100 (Mon, 05 Mar 2007) New Revision: 20329 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20329&view=rev Removed: haiku/trunk/src/system/kernel/fs/message.c Modified: haiku/trunk/headers/os/drivers/fs_interface.h haiku/trunk/headers/private/kernel/syscalls.h haiku/trunk/src/add-ons/kernel/file_systems/bfs/kernel_interface.cpp haiku/trunk/src/add-ons/kernel/file_systems/dos/dosfs.c haiku/trunk/src/add-ons/kernel/file_systems/googlefs/googlefs.c haiku/trunk/src/add-ons/kernel/file_systems/iso9660/kernel_interface.cpp haiku/trunk/src/add-ons/kernel/file_systems/nfs/nfs_add_on.c haiku/trunk/src/add-ons/kernel/file_systems/ntfs/kernel_interface.c haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/kernel_interface.cpp haiku/trunk/src/system/kernel/fs/Jamfile haiku/trunk/src/system/kernel/fs/devfs.cpp haiku/trunk/src/system/kernel/fs/node_monitor.cpp haiku/trunk/src/system/kernel/fs/pipefs.cpp haiku/trunk/src/system/kernel/fs/rootfs.c haiku/trunk/src/system/kernel/fs/vfs.cpp haiku/trunk/src/tests/add-ons/kernel/file_systems/bfs/bfs_shell/Jamfile Log: * Removed write_link from the FS module interface. Adjusted all FS add-ons accordingly and removed the syscall. * Removed send_notification(). * Reimplemented notify_listener(). It used the unimplemented send_notification(). Now it has a chance to work. Note that notify_listener() is obsolete. I would already have removed it, if there weren't lots of FS implementations still using it (Hint!). Modified: haiku/trunk/headers/os/drivers/fs_interface.h =================================================================== --- haiku/trunk/headers/os/drivers/fs_interface.h 2007-03-04 23:11:02 UTC (rev 20328) +++ haiku/trunk/headers/os/drivers/fs_interface.h 2007-03-05 00:46:57 UTC (rev 20329) @@ -115,7 +115,6 @@ status_t (*read_link)(fs_volume fs, fs_vnode link, char *buffer, size_t *_bufferSize); - status_t (*write_link)(fs_volume fs, fs_vnode link, char *toPath); status_t (*create_symlink)(fs_volume fs, fs_vnode dir, const char *name, const char *path, int mode); @@ -269,11 +268,9 @@ extern status_t get_vnode_removed(mount_id mountID, vnode_id vnodeID, bool* removed); +// Deprecated! Will disappear soon! extern status_t notify_listener(int op, mount_id device, vnode_id parentNode, vnode_id toParentNode, vnode_id node, const char *name); -extern status_t send_notification(port_id port, long token, ulong what, long op, - mount_id device, mount_id toDevice, vnode_id parentNode, - vnode_id toParentNode, vnode_id node, const char *name); extern status_t notify_entry_created(mount_id device, vnode_id directory, const char *name, vnode_id node); Modified: haiku/trunk/headers/private/kernel/syscalls.h =================================================================== --- haiku/trunk/headers/private/kernel/syscalls.h 2007-03-04 23:11:02 UTC (rev 20328) +++ haiku/trunk/headers/private/kernel/syscalls.h 2007-03-05 00:46:57 UTC (rev 20329) @@ -149,7 +149,6 @@ extern status_t _kern_remove_dir(int fd, const char *path); extern status_t _kern_read_link(int fd, const char *path, char *buffer, size_t *_bufferSize); -extern status_t _kern_write_link(const char *path, const char *toPath); extern status_t _kern_create_symlink(int fd, const char *path, const char *toPath, int mode); extern status_t _kern_create_link(const char *path, const char *toPath); Modified: haiku/trunk/src/add-ons/kernel/file_systems/bfs/kernel_interface.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/bfs/kernel_interface.cpp 2007-03-04 23:11:02 UTC (rev 20328) +++ haiku/trunk/src/add-ons/kernel/file_systems/bfs/kernel_interface.cpp 2007-03-05 00:46:57 UTC (rev 20329) @@ -2098,7 +2098,6 @@ &bfs_fsync, &bfs_read_link, - NULL, // write link &bfs_create_symlink, &bfs_link, Modified: haiku/trunk/src/add-ons/kernel/file_systems/dos/dosfs.c =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/dos/dosfs.c 2007-03-04 23:11:02 UTC (rev 20328) +++ haiku/trunk/src/add-ons/kernel/file_systems/dos/dosfs.c 2007-03-05 00:46:57 UTC (rev 20329) @@ -1226,7 +1226,6 @@ &dosfs_fsync, &dosfs_readlink, - NULL, // write link NULL, //&fs_create_symlink, NULL, //&fs_link, Modified: haiku/trunk/src/add-ons/kernel/file_systems/googlefs/googlefs.c =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/googlefs/googlefs.c 2007-03-04 23:11:02 UTC (rev 20328) +++ haiku/trunk/src/add-ons/kernel/file_systems/googlefs/googlefs.c 2007-03-05 00:46:57 UTC (rev 20329) @@ -1654,7 +1654,6 @@ NULL, // &googlefs_fsync NULL, // &googlefs_read_link, - NULL, // write link NULL, // &googlefs_create_symlink, NULL, // &googlefs_link, Modified: haiku/trunk/src/add-ons/kernel/file_systems/iso9660/kernel_interface.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/iso9660/kernel_interface.cpp 2007-03-04 23:11:02 UTC (rev 20328) +++ haiku/trunk/src/add-ons/kernel/file_systems/iso9660/kernel_interface.cpp 2007-03-05 00:46:57 UTC (rev 20329) @@ -1006,7 +1006,6 @@ NULL, // &fs_fsync &fs_read_link, - NULL, // write link NULL, // &fs_create_symlink, NULL, // &fs_link, Modified: haiku/trunk/src/add-ons/kernel/file_systems/nfs/nfs_add_on.c =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/nfs/nfs_add_on.c 2007-03-04 23:11:02 UTC (rev 20328) +++ haiku/trunk/src/add-ons/kernel/file_systems/nfs/nfs_add_on.c 2007-03-05 00:46:57 UTC (rev 20329) @@ -2460,7 +2460,6 @@ NULL, // &fs_fsync &fs_readlink, - NULL, // &fs_write link, &fs_symlink, NULL, // &fs_link, Modified: haiku/trunk/src/add-ons/kernel/file_systems/ntfs/kernel_interface.c =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/ntfs/kernel_interface.c 2007-03-04 23:11:02 UTC (rev 20328) +++ haiku/trunk/src/add-ons/kernel/file_systems/ntfs/kernel_interface.c 2007-03-05 00:46:57 UTC (rev 20329) @@ -138,9 +138,7 @@ NULL, NULL, NULL, - NULL, #else - NULL, // write link &fs_create_symlink, NULL, // &fs_link, &fs_unlink, Modified: haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/kernel_interface.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/kernel_interface.cpp 2007-03-04 23:11:02 UTC (rev 20328) +++ haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/kernel_interface.cpp 2007-03-05 00:46:57 UTC (rev 20329) @@ -1036,7 +1036,6 @@ &userlandfs_fsync, &userlandfs_read_symlink, - NULL, // write link &userlandfs_create_symlink, &userlandfs_link, Modified: haiku/trunk/src/system/kernel/fs/Jamfile =================================================================== --- haiku/trunk/src/system/kernel/fs/Jamfile 2007-03-04 23:11:02 UTC (rev 20328) +++ haiku/trunk/src/system/kernel/fs/Jamfile 2007-03-05 00:46:57 UTC (rev 20329) @@ -13,7 +13,6 @@ vfs.cpp vfs_boot.cpp vfs_select.cpp - message.c node_monitor.cpp IOScheduler.cpp KPath.cpp Modified: haiku/trunk/src/system/kernel/fs/devfs.cpp =================================================================== --- haiku/trunk/src/system/kernel/fs/devfs.cpp 2007-03-04 23:11:02 UTC (rev 20328) +++ haiku/trunk/src/system/kernel/fs/devfs.cpp 2007-03-05 00:46:57 UTC (rev 20329) @@ -1890,7 +1890,6 @@ &devfs_fsync, &devfs_read_link, - NULL, // write_link NULL, // symlink NULL, // link NULL, // unlink Deleted: haiku/trunk/src/system/kernel/fs/message.c Modified: haiku/trunk/src/system/kernel/fs/node_monitor.cpp =================================================================== --- haiku/trunk/src/system/kernel/fs/node_monitor.cpp 2007-03-04 23:11:02 UTC (rev 20328) +++ haiku/trunk/src/system/kernel/fs/node_monitor.cpp 2007-03-05 00:46:57 UTC (rev 20329) @@ -687,78 +687,37 @@ notify_listener(int op, mount_id device, vnode_id parentNode, vnode_id toParentNode, vnode_id node, const char *name) { - monitor_listener *listener; - node_monitor *monitor; - TRACE(("notify_listener(op = %d, device = %ld, node = %Ld, parent = %Ld, toParent = %Ld" ", name = \"%s\"\n", op, device, node, parentNode, toParentNode, name)); - mutex_lock(&gMonitorMutex); + switch (op) { + case B_ENTRY_CREATED: + return notify_entry_created(device, parentNode, name, node); - // check the main "node" + case B_ENTRY_REMOVED: + return notify_entry_removed(device, parentNode, name, node); - if ((op == B_ENTRY_MOVED - || op == B_ENTRY_REMOVED - || op == B_STAT_CHANGED - || op == B_ATTR_CHANGED) - && (monitor = get_monitor_for(device, node)) != NULL) { - // iterate over all listeners for this monitor, and see - // if we have to send anything - listener = NULL; - while ((listener = (monitor_listener*)list_get_next_item( - &monitor->listeners, listener)) != NULL) { - // do we have a reason to notify this listener? - if (((listener->flags & B_WATCH_NAME) != 0 - && (op == B_ENTRY_MOVED || op == B_ENTRY_REMOVED)) - || ((listener->flags & B_WATCH_STAT) != 0 - && op == B_STAT_CHANGED) - || ((listener->flags & B_WATCH_ATTR) != 0 - && op == B_ATTR_CHANGED)) { - // then do it! - send_notification(listener->port, listener->token, B_NODE_MONITOR, - op, device, 0, parentNode, toParentNode, node, name); - } - } - } + case B_ENTRY_MOVED: + // no fromName -- use an empty string + return notify_entry_moved(device, parentNode, "", toParentNode, + name, node); - // check its parent directory - - if ((op == B_ENTRY_MOVED - || op == B_ENTRY_REMOVED - || op == B_ENTRY_CREATED) - && (monitor = get_monitor_for(device, parentNode)) != NULL) { - // iterate over all listeners for this monitor, and see - // if we have to send anything - listener = NULL; - while ((listener = (monitor_listener*)list_get_next_item( - &monitor->listeners, listener)) != NULL) { - // do we have a reason to notify this listener? - if ((listener->flags & B_WATCH_DIRECTORY) != 0) { - send_notification(listener->port, listener->token, B_NODE_MONITOR, - op, device, 0, parentNode, toParentNode, node, name); - } + case B_STAT_CHANGED: + { + // no statFields -- consider all stat fields changed + uint32 statFields = B_STAT_MODE | B_STAT_UID | B_STAT_GID + | B_STAT_SIZE | B_STAT_ACCESS_TIME | B_STAT_MODIFICATION_TIME + | B_STAT_CREATION_TIME | B_STAT_CHANGE_TIME; + return notify_stat_changed(device, node, statFields); } - } - // check its new target parent directory + case B_ATTR_CHANGED: + // no cause -- use B_ATTR_CHANGED + return notify_attribute_changed(device, node, name, B_ATTR_CHANGED); - if (op == B_ENTRY_MOVED - && (monitor = get_monitor_for(device, toParentNode)) != NULL) { - // iterate over all listeners for this monitor, and see - // if we have to send anything - listener = NULL; - while ((listener = (monitor_listener*)list_get_next_item( - &monitor->listeners, listener)) != NULL) { - // do we have a reason to notify this listener? - if ((listener->flags & B_WATCH_DIRECTORY) != 0) { - send_notification(listener->port, listener->token, B_NODE_MONITOR, - B_ENTRY_MOVED, device, 0, parentNode, toParentNode, node, name); - } - } + default: + return B_BAD_VALUE; } - - mutex_unlock(&gMonitorMutex); - return B_OK; } Modified: haiku/trunk/src/system/kernel/fs/pipefs.cpp =================================================================== --- haiku/trunk/src/system/kernel/fs/pipefs.cpp 2007-03-04 23:11:02 UTC (rev 20328) +++ haiku/trunk/src/system/kernel/fs/pipefs.cpp 2007-03-05 00:46:57 UTC (rev 20329) @@ -1724,7 +1724,6 @@ &pipefs_fsync, NULL, // fs_read_link() - NULL, // fs_write_link() NULL, // fs_symlink() NULL, // fs_link() &pipefs_unlink, Modified: haiku/trunk/src/system/kernel/fs/rootfs.c =================================================================== --- haiku/trunk/src/system/kernel/fs/rootfs.c 2007-03-04 23:11:02 UTC (rev 20328) +++ haiku/trunk/src/system/kernel/fs/rootfs.c 2007-03-05 00:46:57 UTC (rev 20329) @@ -1066,7 +1066,6 @@ &rootfs_fsync, &rootfs_read_link, - NULL, // fs_write_link() &rootfs_symlink, NULL, // fs_link() &rootfs_unlink, Modified: haiku/trunk/src/system/kernel/fs/vfs.cpp =================================================================== --- haiku/trunk/src/system/kernel/fs/vfs.cpp 2007-03-04 23:11:02 UTC (rev 20328) +++ haiku/trunk/src/system/kernel/fs/vfs.cpp 2007-03-05 00:46:57 UTC (rev 20329) @@ -4356,27 +4356,6 @@ static status_t -common_write_link(char *path, char *toPath, bool kernel) -{ - struct vnode *vnode; - status_t status; - - status = path_to_vnode(path, false, &vnode, NULL, kernel); - if (status < B_OK) - return status; - - if (FS_CALL(vnode, write_link) != NULL) - status = FS_CALL(vnode, write_link)(vnode->mount->cookie, vnode->private_node, toPath); - else - status = EOPNOTSUPP; - - put_vnode(vnode); - - return status; -} - - -static status_t common_create_symlink(int fd, char *path, const char *toPath, int mode, bool kernel) { @@ -6210,24 +6189,6 @@ } -status_t -_kern_write_link(const char *path, const char *toPath) -{ - KPath pathBuffer(path, false, B_PATH_NAME_LENGTH + 1); - KPath toPathBuffer(toPath, false, B_PATH_NAME_LENGTH + 1); - if (pathBuffer.InitCheck() != B_OK || toPathBuffer.InitCheck() != B_OK) - return B_NO_MEMORY; - - char *toBuffer = toPathBuffer.LockBuffer(); - - status_t status = check_path(toBuffer); - if (status < B_OK) - return status; - - return common_write_link(pathBuffer.LockBuffer(), toBuffer, true); -} - - /** \brief Creates a symlink specified by a FD + path pair. * * \a path must always be specified (it contains the name of the new symlink @@ -7072,31 +7033,6 @@ status_t -_user_write_link(const char *userPath, const char *userToPath) -{ - KPath pathBuffer(B_PATH_NAME_LENGTH + 1); - KPath toPathBuffer(B_PATH_NAME_LENGTH + 1); - if (pathBuffer.InitCheck() != B_OK || toPathBuffer.InitCheck() != B_OK) - return B_NO_MEMORY; - - char *path = pathBuffer.LockBuffer(); - char *toPath = toPathBuffer.LockBuffer(); - - if (!IS_USER_ADDRESS(userPath) - || !IS_USER_ADDRESS(userToPath) - || user_strlcpy(path, userPath, B_PATH_NAME_LENGTH) < B_OK - || user_strlcpy(toPath, userToPath, B_PATH_NAME_LENGTH) < B_OK) - return B_BAD_ADDRESS; - - status_t status = check_path(toPath); - if (status < B_OK) - return status; - - return common_write_link(path, toPath, false); -} - - -status_t _user_create_symlink(int fd, const char *userPath, const char *userToPath, int mode) { Modified: haiku/trunk/src/tests/add-ons/kernel/file_systems/bfs/bfs_shell/Jamfile =================================================================== --- haiku/trunk/src/tests/add-ons/kernel/file_systems/bfs/bfs_shell/Jamfile 2007-03-04 23:11:02 UTC (rev 20328) +++ haiku/trunk/src/tests/add-ons/kernel/file_systems/bfs/bfs_shell/Jamfile 2007-03-05 00:46:57 UTC (rev 20329) @@ -54,6 +54,7 @@ fstat=build_platform_fstat read_pos=build_platform_read_pos ioctl=build_platform_ioctl + "send_notification\\(...\\)=" ; } From bonefish at mail.berlios.de Mon Mar 5 04:53:01 2007 From: bonefish at mail.berlios.de (bonefish at BerliOS) Date: Mon, 5 Mar 2007 04:53:01 +0100 Subject: [Haiku-commits] r20330 - in haiku/trunk: headers/os/drivers src/system/kernel/fs Message-ID: <200703050353.l253r1To011674@sheep.berlios.de> Author: bonefish Date: 2007-03-05 04:52:57 +0100 (Mon, 05 Mar 2007) New Revision: 20330 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20330&view=rev Modified: haiku/trunk/headers/os/drivers/fs_interface.h haiku/trunk/src/system/kernel/fs/vfs.cpp Log: Renamed the FS interface hook read_link() to read_symlink(). Modified: haiku/trunk/headers/os/drivers/fs_interface.h =================================================================== --- haiku/trunk/headers/os/drivers/fs_interface.h 2007-03-05 00:46:57 UTC (rev 20329) +++ haiku/trunk/headers/os/drivers/fs_interface.h 2007-03-05 03:52:57 UTC (rev 20330) @@ -113,7 +113,7 @@ uint8 event, selectsync *sync); status_t (*fsync)(fs_volume fs, fs_vnode vnode); - status_t (*read_link)(fs_volume fs, fs_vnode link, char *buffer, + status_t (*read_symlink)(fs_volume fs, fs_vnode link, char *buffer, size_t *_bufferSize); status_t (*create_symlink)(fs_volume fs, fs_vnode dir, const char *name, const char *path, int mode); Modified: haiku/trunk/src/system/kernel/fs/vfs.cpp =================================================================== --- haiku/trunk/src/system/kernel/fs/vfs.cpp 2007-03-05 00:46:57 UTC (rev 20329) +++ haiku/trunk/src/system/kernel/fs/vfs.cpp 2007-03-05 03:52:57 UTC (rev 20330) @@ -1642,8 +1642,13 @@ goto resolve_link_error; } - status = FS_CALL(nextVnode, read_link)(nextVnode->mount->cookie, - nextVnode->private_node, buffer, &bufferSize); + if (FS_CALL(nextVnode, read_symlink) != NULL) { + status = FS_CALL(nextVnode, read_symlink)( + nextVnode->mount->cookie, nextVnode->private_node, buffer, + &bufferSize); + } else + status = B_BAD_VALUE; + if (status < B_OK) { free(buffer); @@ -4344,8 +4349,8 @@ if (status < B_OK) return status; - if (FS_CALL(vnode, read_link) != NULL) { - status = FS_CALL(vnode, read_link)(vnode->mount->cookie, + if (FS_CALL(vnode, read_symlink) != NULL) { + status = FS_CALL(vnode, read_symlink)(vnode->mount->cookie, vnode->private_node, buffer, _bufferSize); } else status = B_BAD_VALUE; From bonefish at mail.berlios.de Mon Mar 5 06:16:10 2007 From: bonefish at mail.berlios.de (bonefish at BerliOS) Date: Mon, 5 Mar 2007 06:16:10 +0100 Subject: [Haiku-commits] r20331 - in haiku/trunk: headers/private/userlandfs/private src/add-ons/kernel/file_systems/userlandfs/kernel_add_on src/add-ons/kernel/file_systems/userlandfs/server Message-ID: <200703050516.l255GAMR018924@sheep.berlios.de> Author: bonefish Date: 2007-03-05 06:16:08 +0100 (Mon, 05 Mar 2007) New Revision: 20331 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20331&view=rev Added: haiku/trunk/headers/private/userlandfs/private/FSCapabilities.h Modified: haiku/trunk/headers/private/userlandfs/private/Requests.h haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/FileSystem.cpp haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/FileSystem.h haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/FileSystemInitializer.cpp haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/Volume.cpp haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/BeOSKernelFileSystem.cpp haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/BeOSKernelFileSystem.h haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/BeOSKernelVolume.cpp haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/FSInfo.h haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/FileSystem.h haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/UserlandFSDispatcher.cpp haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/UserlandFSServer.cpp Log: We analyze a client FS's capabilities -- i.e. which hooks it provides or can be emulated -- and pass this info to the kernel add-on. Thus we can avoid passing requests to the userland that can't be serviced anyway. Added: haiku/trunk/headers/private/userlandfs/private/FSCapabilities.h =================================================================== --- haiku/trunk/headers/private/userlandfs/private/FSCapabilities.h 2007-03-05 03:52:57 UTC (rev 20330) +++ haiku/trunk/headers/private/userlandfs/private/FSCapabilities.h 2007-03-05 05:16:08 UTC (rev 20331) @@ -0,0 +1,191 @@ +// FSCapabilities.h + +#ifndef USERLAND_FS_FS_CAPABILITIES_H +#define USERLAND_FS_FS_CAPABILITIES_H + +#include +#include + +#include "Debug.h" + +enum client_fs_type { + CLIENT_FS_BEOS_KERNEL = 0, + CLIENT_FS_HAIKU_KERNEL, +}; + +enum { + // FS operations + FS_CAPABILITY_MOUNT = 0, + FS_CAPABILITY_UNMOUNT, + + FS_CAPABILITY_READ_FS_INFO, + FS_CAPABILITY_WRITE_FS_INFO, + FS_CAPABILITY_SYNC, + + // vnode operations + FS_CAPABILITY_LOOKUP, + FS_CAPABILITY_GET_VNODE_NAME, + + FS_CAPABILITY_GET_VNODE, + FS_CAPABILITY_PUT_VNODE, + FS_CAPABILITY_REMOVE_VNODE, + + // VM file access + FS_CAPABILITY_CAN_PAGE, + FS_CAPABILITY_READ_PAGES, + FS_CAPABILITY_WRITE_PAGES, + + // cache file access + FS_CAPABILITY_GET_FILE_MAP, + + // common operations + FS_CAPABILITY_IOCTL, + FS_CAPABILITY_SET_FLAGS, + FS_CAPABILITY_SELECT, + FS_CAPABILITY_DESELECT, + FS_CAPABILITY_FSYNC, + + FS_CAPABILITY_READ_SYMLINK, + FS_CAPABILITY_CREATE_SYMLINK, + + FS_CAPABILITY_LINK, + FS_CAPABILITY_UNLINK, + FS_CAPABILITY_RENAME, + + FS_CAPABILITY_ACCESS, + FS_CAPABILITY_READ_STAT, + FS_CAPABILITY_WRITE_STAT, + + // file operations + FS_CAPABILITY_CREATE, + FS_CAPABILITY_OPEN, + FS_CAPABILITY_CLOSE, + FS_CAPABILITY_FREE_COOKIE, + FS_CAPABILITY_READ, + FS_CAPABILITY_WRITE, + + // directory operations + FS_CAPABILITY_CREATE_DIR, + FS_CAPABILITY_REMOVE_DIR, + FS_CAPABILITY_OPEN_DIR, + FS_CAPABILITY_CLOSE_DIR, + FS_CAPABILITY_FREE_DIR_COOKIE, + FS_CAPABILITY_READ_DIR, + FS_CAPABILITY_REWIND_DIR, + + // attribute directory operations + FS_CAPABILITY_OPEN_ATTR_DIR, + FS_CAPABILITY_CLOSE_ATTR_DIR, + FS_CAPABILITY_FREE_ATTR_DIR_COOKIE, + FS_CAPABILITY_READ_ATTR_DIR, + FS_CAPABILITY_REWIND_ATTR_DIR, + + // attribute operations + FS_CAPABILITY_CREATE_ATTR, + FS_CAPABILITY_OPEN_ATTR, + FS_CAPABILITY_CLOSE_ATTR, + FS_CAPABILITY_FREE_ATTR_COOKIE, + FS_CAPABILITY_READ_ATTR, + FS_CAPABILITY_WRITE_ATTR, + + FS_CAPABILITY_READ_ATTR_STAT, + FS_CAPABILITY_WRITE_ATTR_STAT, + FS_CAPABILITY_RENAME_ATTR, + FS_CAPABILITY_REMOVE_ATTR, + + // index directory & index operations + FS_CAPABILITY_OPEN_INDEX_DIR, + FS_CAPABILITY_CLOSE_INDEX_DIR, + FS_CAPABILITY_FREE_INDEX_DIR_COOKIE, + FS_CAPABILITY_READ_INDEX_DIR, + FS_CAPABILITY_REWIND_INDEX_DIR, + + FS_CAPABILITY_CREATE_INDEX, + FS_CAPABILITY_REMOVE_INDEX, + FS_CAPABILITY_READ_INDEX_STAT, + + // query operations + FS_CAPABILITY_OPEN_QUERY, + FS_CAPABILITY_CLOSE_QUERY, + FS_CAPABILITY_FREE_QUERY_COOKIE, + FS_CAPABILITY_READ_QUERY, + FS_CAPABILITY_REWIND_QUERY, + + FS_CAPABILITY_COUNT, +}; + + +namespace UserlandFSUtil { + +struct FSCapabilities { + client_fs_type clientFSType; + uint8 capabilities[(FS_CAPABILITY_COUNT + 7) / 8]; + + inline void ClearAll(); + + inline void Set(uint32 capability, bool set = true); + inline void Clear(uint32 capability); + inline bool Get(uint32 capability) const; + + inline void Dump() const; +}; + +// ClearAll +inline void +FSCapabilities::ClearAll() +{ + memset(capabilities, 0, sizeof(capabilities)); +} + +// Set +inline void +FSCapabilities::Set(uint32 capability, bool set) +{ + if (capability >= FS_CAPABILITY_COUNT) + return; + + uint8 flag = uint8(1 << (capability % 8)); + if (set) + capabilities[capability / 8] |= flag; + else + capabilities[capability / 8] &= ~flag; +} + +// Clear +inline void +FSCapabilities::Clear(uint32 capability) +{ + Set(capability, false); +} + +// Get +inline bool +FSCapabilities::Get(uint32 capability) const +{ + if (capability >= FS_CAPABILITY_COUNT) + return false; + + uint8 flag = uint8(1 << (capability % 8)); + return (capabilities[capability / 8] & flag); +} + +// Dump +inline void +FSCapabilities::Dump() const +{ + D( + char buffer[128]; + int byteCount = sizeof(capabilities); + for (int i = 0; i < byteCount; i++) + sprintf(buffer + 2 * i, "%02x", (int)capabilities[i]); + + PRINT(("FSCapabilities[%d, %s]\n", clientFSType, buffer)); + ) +} + + +} // namespace UserlandFSUtil + +using UserlandFSUtil::FSCapabilities; + +#endif // USERLAND_FS_FS_CAPABILITIES_H Modified: haiku/trunk/headers/private/userlandfs/private/Requests.h =================================================================== --- haiku/trunk/headers/private/userlandfs/private/Requests.h 2007-03-05 03:52:57 UTC (rev 20330) +++ haiku/trunk/headers/private/userlandfs/private/Requests.h 2007-03-05 05:16:08 UTC (rev 20331) @@ -9,6 +9,7 @@ #include #include "Compatibility.h" +#include "FSCapabilities.h" #include "Request.h" @@ -304,8 +305,9 @@ FSConnectReply() : ReplyRequest(FS_CONNECT_REPLY) {} status_t GetAddressInfos(AddressInfo* infos, int32* count); - Address portInfos; - int32 portInfoCount; + Address portInfos; + int32 portInfoCount; + FSCapabilities capabilities; }; Modified: haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/FileSystem.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/FileSystem.cpp 2007-03-05 03:52:57 UTC (rev 20330) +++ haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/FileSystem.cpp 2007-03-05 05:16:08 UTC (rev 20331) @@ -64,9 +64,11 @@ // Init status_t -FileSystem::Init(const char* name, Port::Info* infos, int32 count) +FileSystem::Init(const char* name, Port::Info* infos, int32 count, + const FSCapabilities& capabilities) { - PRINT(("FileSystem::Init(\"%s\", %p, %ld)\n", name, infos, infoCount)); + PRINT(("FileSystem::Init(\"%s\", %p, %ld)\n", name, infos, count)); + capabilities.Dump(); // check parameters if (!name || !infos || count < 2) @@ -76,6 +78,8 @@ if (!fName.SetTo(name)) return B_NO_MEMORY; + fCapabilities = capabilities; + // create the select sync entry map fSelectSyncs = new(nothrow) SelectSyncMap; if (!fSelectSyncs) @@ -159,6 +163,13 @@ return fName.GetString(); } +// GetCapabilities +const FSCapabilities& +FileSystem::GetCapabilities() const +{ + return fCapabilities; +} + // GetPortPool RequestPortPool* FileSystem::GetPortPool() Modified: haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/FileSystem.h =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/FileSystem.h 2007-03-05 03:52:57 UTC (rev 20330) +++ haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/FileSystem.h 2007-03-05 05:16:08 UTC (rev 20331) @@ -5,6 +5,7 @@ #include +#include "FSCapabilities.h" #include "LazyInitializable.h" #include "Locker.h" #include "Referencable.h" @@ -24,10 +25,14 @@ ~FileSystem(); status_t Init(const char* name, Port::Info* infos, - int32 infoCount); + int32 infoCount, + const FSCapabilities& capabilities); const char* GetName() const; + const FSCapabilities& GetCapabilities() const; + inline bool HasCapability(uint32 capability) const; + RequestPortPool* GetPortPool(); status_t Mount(mount_id id, const char* device, @@ -59,6 +64,7 @@ Vector fVolumes; Locker fVolumeLock; String fName; + FSCapabilities fCapabilities; RequestPort* fNotificationPort; thread_id fNotificationThread; RequestPortPool fPortPool; @@ -69,4 +75,12 @@ volatile bool fTerminating; }; + +// HasCapability +inline bool +FileSystem::HasCapability(uint32 capability) const +{ + return fCapabilities.Get(capability); +} + #endif // USERLAND_FS_FILE_SYSTEM_H Modified: haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/FileSystemInitializer.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/FileSystemInitializer.cpp 2007-03-05 03:52:57 UTC (rev 20330) +++ haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/FileSystemInitializer.cpp 2007-03-05 05:16:08 UTC (rev 20331) @@ -68,7 +68,7 @@ if (!fFileSystem) return B_NO_MEMORY; - error = fFileSystem->Init(fName, infos, count); + error = fFileSystem->Init(fName, infos, count, reply->capabilities); if (error != B_OK) return B_ERROR; Modified: haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/Volume.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/Volume.cpp 2007-03-05 03:52:57 UTC (rev 20330) +++ haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/kernel_add_on/Volume.cpp 2007-03-05 05:16:08 UTC (rev 20331) @@ -280,6 +280,10 @@ status_t Volume::Sync() { + // check capability + if (!fFileSystem->HasCapability(FS_CAPABILITY_SYNC)) + return B_BAD_VALUE; + // get a free port RequestPort* port = fFileSystem->GetPortPool()->AcquirePort(); if (!port) @@ -337,6 +341,10 @@ status_t Volume::WriteFSInfo(const struct fs_info *info, uint32 mask) { + // check capability + if (!fFileSystem->HasCapability(FS_CAPABILITY_WRITE_FS_INFO)) + return B_BAD_VALUE; + // get a free port RequestPort* port = fFileSystem->GetPortPool()->AcquirePort(); if (!port) @@ -574,6 +582,10 @@ } } + // check capability + if (!fFileSystem->HasCapability(FS_CAPABILITY_IOCTL)) + return B_BAD_VALUE; + // get a free port RequestPort* port = fFileSystem->GetPortPool()->AcquirePort(); if (!port) @@ -630,6 +642,10 @@ status_t Volume::SetFlags(fs_vnode node, fs_cookie cookie, int flags) { + // check capability + if (!fFileSystem->HasCapability(FS_CAPABILITY_SET_FLAGS)) + return B_BAD_VALUE; + // get a free port RequestPort* port = fFileSystem->GetPortPool()->AcquirePort(); if (!port) @@ -667,6 +683,12 @@ Volume::Select(fs_vnode node, fs_cookie cookie, uint8 event, uint32 ref, selectsync* sync) { + // check capability + if (!fFileSystem->HasCapability(FS_CAPABILITY_SELECT)) { + notify_select_event(sync, ref, event); + return B_OK; + } + // get a free port RequestPort* port = fFileSystem->GetPortPool()->AcquirePort(); if (!port) @@ -714,6 +736,10 @@ status_t Volume::Deselect(fs_vnode node, fs_cookie cookie, uint8 event, selectsync* sync) { + // check capability + if (!fFileSystem->HasCapability(FS_CAPABILITY_DESELECT)) + return B_OK; + struct SyncRemover { SyncRemover(FileSystem* fs, selectsync* sync) : fs(fs), sync(sync) {} @@ -760,6 +786,10 @@ status_t Volume::FSync(fs_vnode node) { + // check capability + if (!fFileSystem->HasCapability(FS_CAPABILITY_FSYNC)) + return B_BAD_VALUE; + // get a free port RequestPort* port = fFileSystem->GetPortPool()->AcquirePort(); if (!port) @@ -796,6 +826,11 @@ size_t* bytesRead) { *bytesRead = 0; + + // check capability + if (!fFileSystem->HasCapability(FS_CAPABILITY_READ_SYMLINK)) + return B_BAD_VALUE; + // get a free port RequestPort* port = fFileSystem->GetPortPool()->AcquirePort(); if (!port) @@ -841,6 +876,10 @@ Volume::CreateSymlink(fs_vnode dir, const char* name, const char* target, int mode) { + // check capability + if (!fFileSystem->HasCapability(FS_CAPABILITY_CREATE_SYMLINK)) + return B_BAD_VALUE; + // get a free port RequestPort* port = fFileSystem->GetPortPool()->AcquirePort(); if (!port) @@ -881,6 +920,10 @@ status_t Volume::Link(fs_vnode dir, const char* name, fs_vnode node) { + // check capability + if (!fFileSystem->HasCapability(FS_CAPABILITY_LINK)) + return B_BAD_VALUE; + // get a free port RequestPort* port = fFileSystem->GetPortPool()->AcquirePort(); if (!port) @@ -919,6 +962,10 @@ status_t Volume::Unlink(fs_vnode dir, const char* name) { + // check capability + if (!fFileSystem->HasCapability(FS_CAPABILITY_UNLINK)) + return B_BAD_VALUE; + // get a free port RequestPort* port = fFileSystem->GetPortPool()->AcquirePort(); if (!port) @@ -957,6 +1004,10 @@ Volume::Rename(fs_vnode oldDir, const char* oldName, fs_vnode newDir, const char* newName) { + // check capability + if (!fFileSystem->HasCapability(FS_CAPABILITY_RENAME)) + return B_BAD_VALUE; + // get a free port RequestPort* port = fFileSystem->GetPortPool()->AcquirePort(); if (!port) @@ -997,6 +1048,10 @@ status_t Volume::Access(fs_vnode node, int mode) { + // check capability + if (!fFileSystem->HasCapability(FS_CAPABILITY_ACCESS)) + return B_OK; + // get a free port RequestPort* port = fFileSystem->GetPortPool()->AcquirePort(); if (!port) @@ -1062,6 +1117,10 @@ status_t Volume::WriteStat(fs_vnode node, const struct stat* st, uint32 mask) { + // check capability + if (!fFileSystem->HasCapability(FS_CAPABILITY_WRITE_STAT)) + return B_BAD_VALUE; + // get a free port RequestPort* port = fFileSystem->GetPortPool()->AcquirePort(); if (!port) @@ -1102,6 +1161,10 @@ Volume::Create(fs_vnode dir, const char* name, int openMode, int mode, void** cookie, vnode_id* vnid) { + // check capability + if (!fFileSystem->HasCapability(FS_CAPABILITY_CREATE)) + return B_BAD_VALUE; + // get a free port RequestPort* port = fFileSystem->GetPortPool()->AcquirePort(); if (!port) @@ -1148,6 +1211,10 @@ status_t Volume::Open(fs_vnode node, int openMode, fs_cookie* cookie) { + // check capability + if (!fFileSystem->HasCapability(FS_CAPABILITY_OPEN)) + return B_BAD_VALUE; + // get a free port RequestPort* port = fFileSystem->GetPortPool()->AcquirePort(); if (!port) @@ -1223,6 +1290,10 @@ { *bytesRead = 0; + // check capability + if (!fFileSystem->HasCapability(FS_CAPABILITY_READ)) + return B_BAD_VALUE; + // get a free port RequestPort* port = fFileSystem->GetPortPool()->AcquirePort(); if (!port) @@ -1272,6 +1343,10 @@ { *bytesWritten = 0; + // check capability + if (!fFileSystem->HasCapability(FS_CAPABILITY_WRITE)) + return B_BAD_VALUE; + // get a free port RequestPort* port = fFileSystem->GetPortPool()->AcquirePort(); if (!port) @@ -1315,6 +1390,10 @@ status_t Volume::CreateDir(fs_vnode dir, const char* name, int mode, vnode_id *newDir) { + // check capability + if (!fFileSystem->HasCapability(FS_CAPABILITY_CREATE_DIR)) + return B_BAD_VALUE; + // get a free port RequestPort* port = fFileSystem->GetPortPool()->AcquirePort(); if (!port) @@ -1354,6 +1433,10 @@ status_t Volume::RemoveDir(fs_vnode dir, const char* name) { + // check capability + if (!fFileSystem->HasCapability(FS_CAPABILITY_REMOVE_DIR)) + return B_BAD_VALUE; + // get a free port RequestPort* port = fFileSystem->GetPortPool()->AcquirePort(); if (!port) @@ -1391,6 +1474,10 @@ status_t Volume::OpenDir(fs_vnode node, fs_cookie* cookie) { + // check capability + if (!fFileSystem->HasCapability(FS_CAPABILITY_OPEN_DIR)) + return B_BAD_VALUE; + // get a free port RequestPort* port = fFileSystem->GetPortPool()->AcquirePort(); if (!port) @@ -1466,6 +1553,10 @@ { *countRead = 0; + // check capability + if (!fFileSystem->HasCapability(FS_CAPABILITY_READ_DIR)) + return B_BAD_VALUE; + // get a free port RequestPort* port = fFileSystem->GetPortPool()->AcquirePort(); if (!port) @@ -1521,6 +1612,10 @@ status_t Volume::RewindDir(fs_vnode node, fs_vnode cookie) { + // check capability + if (!fFileSystem->HasCapability(FS_CAPABILITY_REWIND_DIR)) + return B_BAD_VALUE; + // get a free port RequestPort* port = fFileSystem->GetPortPool()->AcquirePort(); if (!port) @@ -1560,6 +1655,10 @@ status_t Volume::OpenAttrDir(fs_vnode node, fs_cookie *cookie) { + // check capability + if (!fFileSystem->HasCapability(FS_CAPABILITY_OPEN_ATTR_DIR)) + return B_BAD_VALUE; + // get a free port RequestPort* port = fFileSystem->GetPortPool()->AcquirePort(); if (!port) @@ -1635,6 +1734,10 @@ Volume::ReadAttrDir(fs_vnode node, fs_cookie cookie, void* buffer, size_t bufferSize, uint32 count, uint32* countRead) { + // check capability + if (!fFileSystem->HasCapability(FS_CAPABILITY_READ_ATTR_DIR)) + return B_BAD_VALUE; + *countRead = 0; // get a free port RequestPort* port = fFileSystem->GetPortPool()->AcquirePort(); @@ -1689,6 +1792,10 @@ status_t Volume::RewindAttrDir(fs_vnode node, fs_cookie cookie) { + // check capability + if (!fFileSystem->HasCapability(FS_CAPABILITY_REWIND_ATTR_DIR)) + return B_BAD_VALUE; + // get a free port RequestPort* port = fFileSystem->GetPortPool()->AcquirePort(); if (!port) @@ -1728,6 +1835,10 @@ Volume::CreateAttr(fs_vnode node, const char* name, uint32 type, int openMode, fs_cookie* cookie) { + // check capability + if (!fFileSystem->HasCapability(FS_CAPABILITY_CREATE_ATTR)) + return B_BAD_VALUE; + // get a free port RequestPort* port = fFileSystem->GetPortPool()->AcquirePort(); if (!port) @@ -1771,6 +1882,10 @@ Volume::OpenAttr(fs_vnode node, const char* name, int openMode, fs_cookie* cookie) { + // check capability + if (!fFileSystem->HasCapability(FS_CAPABILITY_OPEN_ATTR)) + return B_BAD_VALUE; + // get a free port RequestPort* port = fFileSystem->GetPortPool()->AcquirePort(); if (!port) @@ -1851,6 +1966,10 @@ { *bytesRead = 0; + // check capability + if (!fFileSystem->HasCapability(FS_CAPABILITY_READ_ATTR)) + return B_BAD_VALUE; + // get a free port RequestPort* port = fFileSystem->GetPortPool()->AcquirePort(); if (!port) @@ -1900,6 +2019,10 @@ { *bytesWritten = 0; + // check capability + if (!fFileSystem->HasCapability(FS_CAPABILITY_WRITE_ATTR)) + return B_BAD_VALUE; + // get a free port RequestPort* port = fFileSystem->GetPortPool()->AcquirePort(); if (!port) @@ -1940,6 +2063,10 @@ status_t Volume::ReadAttrStat(fs_vnode node, fs_cookie cookie, struct stat *st) { + // check capability + if (!fFileSystem->HasCapability(FS_CAPABILITY_READ_ATTR_STAT)) + return B_BAD_VALUE; + // get a free port RequestPort* port = fFileSystem->GetPortPool()->AcquirePort(); if (!port) @@ -1977,6 +2104,10 @@ Volume::RenameAttr(fs_vnode oldNode, const char* oldName, fs_vnode newNode, const char* newName) { + // check capability + if (!fFileSystem->HasCapability(FS_CAPABILITY_RENAME_ATTR)) + return B_BAD_VALUE; + // get a free port RequestPort* port = fFileSystem->GetPortPool()->AcquirePort(); if (!port) @@ -2017,6 +2148,10 @@ status_t Volume::RemoveAttr(fs_vnode node, const char* name) { + // check capability + if (!fFileSystem->HasCapability(FS_CAPABILITY_REMOVE_ATTR)) + return B_BAD_VALUE; + // get a free port RequestPort* port = fFileSystem->GetPortPool()->AcquirePort(); if (!port) @@ -2058,6 +2193,10 @@ status_t Volume::OpenIndexDir(fs_cookie *cookie) { + // check capability + if (!fFileSystem->HasCapability(FS_CAPABILITY_OPEN_INDEX_DIR)) + return B_BAD_VALUE; + // get a free port RequestPort* port = fFileSystem->GetPortPool()->AcquirePort(); if (!port) @@ -2134,6 +2273,10 @@ { *countRead = 0; + // check capability + if (!fFileSystem->HasCapability(FS_CAPABILITY_READ_INDEX_DIR)) + return B_BAD_VALUE; + // get a free port RequestPort* port = fFileSystem->GetPortPool()->AcquirePort(); if (!port) @@ -2186,6 +2329,10 @@ status_t Volume::RewindIndexDir(fs_cookie cookie) { + // check capability + if (!fFileSystem->HasCapability(FS_CAPABILITY_REWIND_INDEX_DIR)) + return B_BAD_VALUE; + // get a free port RequestPort* port = fFileSystem->GetPortPool()->AcquirePort(); if (!port) @@ -2220,6 +2367,10 @@ status_t Volume::CreateIndex(const char* name, uint32 type, uint32 flags) { + // check capability + if (!fFileSystem->HasCapability(FS_CAPABILITY_CREATE_INDEX)) + return B_BAD_VALUE; + // get a free port RequestPort* port = fFileSystem->GetPortPool()->AcquirePort(); if (!port) @@ -2258,6 +2409,10 @@ status_t Volume::RemoveIndex(const char* name) { + // check capability + if (!fFileSystem->HasCapability(FS_CAPABILITY_REMOVE_INDEX)) + return B_BAD_VALUE; + // get a free port RequestPort* port = fFileSystem->GetPortPool()->AcquirePort(); if (!port) @@ -2294,6 +2449,10 @@ status_t Volume::ReadIndexStat(const char* name, struct stat *st) { + // check capability + if (!fFileSystem->HasCapability(FS_CAPABILITY_READ_INDEX_STAT)) + return B_BAD_VALUE; + // get a free port RequestPort* port = fFileSystem->GetPortPool()->AcquirePort(); if (!port) @@ -2336,6 +2495,10 @@ Volume::OpenQuery(const char* queryString, uint32 flags, port_id targetPort, uint32 token, fs_cookie *cookie) { + // check capability + if (!fFileSystem->HasCapability(FS_CAPABILITY_OPEN_QUERY)) + return B_BAD_VALUE; + // get a free port RequestPort* port = fFileSystem->GetPortPool()->AcquirePort(); if (!port) @@ -2417,6 +2580,10 @@ { *countRead = 0; + // check capability + if (!fFileSystem->HasCapability(FS_CAPABILITY_READ_QUERY)) + return B_BAD_VALUE; + // get a free port RequestPort* port = fFileSystem->GetPortPool()->AcquirePort(); if (!port) @@ -2560,6 +2727,10 @@ status_t Volume::_ReadFSInfo(fs_info* info) { + // check capability + if (!fFileSystem->HasCapability(FS_CAPABILITY_READ_FS_INFO)) + return B_BAD_VALUE; + // get a free port RequestPort* port = fFileSystem->GetPortPool()->AcquirePort(); if (!port) @@ -2669,6 +2840,10 @@ status_t Volume::_ReadStat(fs_vnode node, struct stat* st) { + // check capability + if (!fFileSystem->HasCapability(FS_CAPABILITY_READ_STAT)) + return B_BAD_VALUE; + // get a free port RequestPort* port = fFileSystem->GetPortPool()->AcquirePort(); if (!port) @@ -2704,6 +2879,10 @@ status_t Volume::_Close(fs_vnode node, fs_cookie cookie) { + // check capability + if (!fFileSystem->HasCapability(FS_CAPABILITY_CLOSE)) + return B_OK; + // get a free port RequestPort* port = fFileSystem->GetPortPool()->AcquirePort(); if (!port) @@ -2739,6 +2918,10 @@ status_t Volume::_FreeCookie(fs_vnode node, fs_cookie cookie) { + // check capability + if (!fFileSystem->HasCapability(FS_CAPABILITY_FREE_COOKIE)) + return B_OK; + // get a free port RequestPort* port = fFileSystem->GetPortPool()->AcquirePort(); if (!port) @@ -2774,6 +2957,10 @@ status_t Volume::_CloseDir(fs_vnode node, fs_vnode cookie) { + // check capability + if (!fFileSystem->HasCapability(FS_CAPABILITY_CLOSE_DIR)) + return B_OK; + // get a free port RequestPort* port = fFileSystem->GetPortPool()->AcquirePort(); if (!port) @@ -2809,6 +2996,10 @@ status_t Volume::_FreeDirCookie(fs_vnode node, fs_vnode cookie) { + // check capability + if (!fFileSystem->HasCapability(FS_CAPABILITY_FREE_DIR_COOKIE)) + return B_OK; + // get a free port RequestPort* port = fFileSystem->GetPortPool()->AcquirePort(); if (!port) @@ -2844,6 +3035,10 @@ status_t Volume::_CloseAttrDir(fs_vnode node, fs_cookie cookie) { + // check capability + if (!fFileSystem->HasCapability(FS_CAPABILITY_CLOSE_ATTR_DIR)) + return B_OK; + // get a free port RequestPort* port = fFileSystem->GetPortPool()->AcquirePort(); if (!port) @@ -2879,6 +3074,10 @@ status_t Volume::_FreeAttrDirCookie(fs_vnode node, fs_cookie cookie) { + // check capability + if (!fFileSystem->HasCapability(FS_CAPABILITY_FREE_ATTR_DIR_COOKIE)) + return B_OK; + // get a free port RequestPort* port = fFileSystem->GetPortPool()->AcquirePort(); if (!port) @@ -2914,6 +3113,10 @@ status_t Volume::_CloseAttr(fs_vnode node, fs_cookie cookie) { + // check capability + if (!fFileSystem->HasCapability(FS_CAPABILITY_CLOSE_ATTR)) + return B_OK; + // get a free port RequestPort* port = fFileSystem->GetPortPool()->AcquirePort(); if (!port) @@ -2949,6 +3152,10 @@ status_t Volume::_FreeAttrCookie(fs_vnode node, fs_cookie cookie) { + // check capability + if (!fFileSystem->HasCapability(FS_CAPABILITY_FREE_ATTR_COOKIE)) + return B_OK; + // get a free port RequestPort* port = fFileSystem->GetPortPool()->AcquirePort(); if (!port) @@ -2984,6 +3191,10 @@ status_t Volume::_CloseIndexDir(fs_cookie cookie) { + // check capability + if (!fFileSystem->HasCapability(FS_CAPABILITY_CLOSE_INDEX_DIR)) + return B_OK; + // get a free port RequestPort* port = fFileSystem->GetPortPool()->AcquirePort(); if (!port) @@ -3018,6 +3229,10 @@ status_t Volume::_FreeIndexDirCookie(fs_cookie cookie) { + // check capability + if (!fFileSystem->HasCapability(FS_CAPABILITY_FREE_INDEX_DIR_COOKIE)) + return B_OK; + // get a free port RequestPort* port = fFileSystem->GetPortPool()->AcquirePort(); if (!port) @@ -3052,6 +3267,10 @@ status_t Volume::_CloseQuery(fs_cookie cookie) { + // check capability + if (!fFileSystem->HasCapability(FS_CAPABILITY_CLOSE_QUERY)) + return B_OK; + // get a free port RequestPort* port = fFileSystem->GetPortPool()->AcquirePort(); if (!port) @@ -3086,6 +3305,10 @@ status_t Volume::_FreeQueryCookie(fs_cookie cookie) { + // check capability + if (!fFileSystem->HasCapability(FS_CAPABILITY_FREE_QUERY_COOKIE)) + return B_OK; + // get a free port RequestPort* port = fFileSystem->GetPortPool()->AcquirePort(); if (!port) Modified: haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/BeOSKernelFileSystem.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/BeOSKernelFileSystem.cpp 2007-03-05 03:52:57 UTC (rev 20330) +++ haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/BeOSKernelFileSystem.cpp 2007-03-05 05:16:08 UTC (rev 20331) @@ -4,6 +4,7 @@ #include +#include "beos_fs_interface.h" #include "BeOSKernelVolume.h" using std::nothrow; @@ -13,6 +14,7 @@ : FileSystem(), fFSOps(fsOps) { + _InitCapabilities(fsOps); } // destructor @@ -45,3 +47,114 @@ return B_OK; } +// _InitCapabilities +void +BeOSKernelFileSystem::_InitCapabilities(beos_vnode_ops* fsOps) +{ + fCapabilities.ClearAll(); + + // FS interface type + fCapabilities.clientFSType = CLIENT_FS_BEOS_KERNEL; + + // FS operations + fCapabilities.Set(FS_CAPABILITY_MOUNT, fsOps->mount); + fCapabilities.Set(FS_CAPABILITY_UNMOUNT, fsOps->unmount); + + fCapabilities.Set(FS_CAPABILITY_READ_FS_INFO, fsOps->rfsstat); + fCapabilities.Set(FS_CAPABILITY_WRITE_FS_INFO, fsOps->wfsstat); + fCapabilities.Set(FS_CAPABILITY_SYNC, fsOps->sync); + + // vnode operations + fCapabilities.Set(FS_CAPABILITY_LOOKUP, fsOps->walk); + // missing: FS_CAPABILITY_GET_VNODE_NAME, + + fCapabilities.Set(FS_CAPABILITY_GET_VNODE, fsOps->read_vnode); + fCapabilities.Set(FS_CAPABILITY_PUT_VNODE, fsOps->write_vnode); + fCapabilities.Set(FS_CAPABILITY_REMOVE_VNODE, fsOps->remove_vnode); + + // VM file access + // missing: FS_CAPABILITY_CAN_PAGE, + // missing: FS_CAPABILITY_READ_PAGES, + // missing: FS_CAPABILITY_WRITE_PAGES, + + // cache file access + // missing: FS_CAPABILITY_GET_FILE_MAP, + + // common operations + fCapabilities.Set(FS_CAPABILITY_IOCTL, fsOps->ioctl); [... truncated: 356 lines follow ...] From threedeyes at mail.berlios.de Mon Mar 5 08:01:25 2007 From: threedeyes at mail.berlios.de (threedeyes at BerliOS) Date: Mon, 5 Mar 2007 08:01:25 +0100 Subject: [Haiku-commits] r20332 - in haiku/trunk/src/add-ons/kernel/file_systems/ntfs: . settings Message-ID: <200703050701.l2571PLA008387@sheep.berlios.de> Author: threedeyes Date: 2007-03-05 08:01:21 +0100 (Mon, 05 Mar 2007) New Revision: 20332 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20332&view=rev Added: haiku/trunk/src/add-ons/kernel/file_systems/ntfs/settings/ haiku/trunk/src/add-ons/kernel/file_systems/ntfs/settings/ntfs Modified: haiku/trunk/src/add-ons/kernel/file_systems/ntfs/attributes.c haiku/trunk/src/add-ons/kernel/file_systems/ntfs/fs_func.c haiku/trunk/src/add-ons/kernel/file_systems/ntfs/fs_func.h haiku/trunk/src/add-ons/kernel/file_systems/ntfs/kernel_interface.c haiku/trunk/src/add-ons/kernel/file_systems/ntfs/ntfs.h haiku/trunk/src/add-ons/kernel/file_systems/ntfs/ntfsdir.c haiku/trunk/src/add-ons/kernel/file_systems/ntfs/ntfsdir.h Log: Fixed bug in fs_readdir function. Removed read-only assembling mode. Added settings file for addon tweaking: hide_sys_files, read_only, no_atime. Modified: haiku/trunk/src/add-ons/kernel/file_systems/ntfs/attributes.c =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/ntfs/attributes.c 2007-03-05 05:16:08 UTC (rev 20331) +++ haiku/trunk/src/add-ons/kernel/file_systems/ntfs/attributes.c 2007-03-05 07:01:21 UTC (rev 20332) @@ -382,10 +382,8 @@ #ifdef __HAIKU_ if (_cookie != &kBeOSTypeCookie) { result = ENOSYS; - goto exit; } #endif -exit: ERRPRINT("fs_write_attrib - EXIT, result is %s\n", strerror(result)); Modified: haiku/trunk/src/add-ons/kernel/file_systems/ntfs/fs_func.c =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/ntfs/fs_func.c 2007-03-05 05:16:08 UTC (rev 20331) +++ haiku/trunk/src/add-ons/kernel/file_systems/ntfs/fs_func.c 2007-03-05 07:01:21 UTC (rev 20332) @@ -33,6 +33,7 @@ #include #include #include +#include #include "ntfs.h" #include "attributes.h" @@ -113,6 +114,8 @@ nspace *ns; vnode *newNode = NULL; char lockname[32]; + void *handle; + unsigned long mnt_flags = 0; status_t result = B_NO_ERROR; ERRPRINT("fs_mount - ENTER\n"); @@ -122,11 +125,15 @@ result = ENOMEM; goto exit; } + *ns = (nspace) { .state = NF_FreeClustersOutdate | NF_FreeMFTOutdate, .show_sys_files = false, + .ro = false }; + + ns->flags = flags; strcpy(ns->devicePath,device); @@ -141,8 +148,21 @@ ERRPRINT("fs_mount - error creating lock (%s)\n", strerror(result)); goto exit; } + + handle = load_driver_settings("ntfs"); + ns->show_sys_files = ! (strcasecmp(get_driver_parameter(handle, "hide_sys_files", "true", "true"), "true") == 0); + ns->ro = strcasecmp(get_driver_parameter(handle, "read_only", "false", "false"), "false") != 0; + ns->noatime = strcasecmp(get_driver_parameter(handle, "no_atime", "true", "true"), "true") == 0; + unload_driver_settings(handle); + + if (ns->ro || ns->flags & B_MOUNT_READ_ONLY) { + mnt_flags |= MS_RDONLY; + ns->flags |= B_MOUNT_READ_ONLY; + } + if (ns->noatime) + mnt_flags |= MS_NOATIME; - ns->ntvol=utils_mount_volume(device,0,true); + ns->ntvol=utils_mount_volume(device,mnt_flags,true); if(ns->ntvol!=NULL) result = B_NO_ERROR; else @@ -254,7 +274,6 @@ return B_NO_ERROR; } -#ifndef _READ_ONLY_ #ifdef __HAIKU__ status_t fs_wfsstat(void *_vol, const struct fs_info * fss, uint32 mask) @@ -266,6 +285,11 @@ nspace* ns = (nspace*)_vol; status_t result = B_NO_ERROR; + if (ns->flags & B_FS_IS_READONLY) { + ERRPRINT("ntfs is read-only\n"); + return EROFS; + } + LOCK_VOL(ns); #ifdef __HAIKU__ @@ -274,7 +298,7 @@ if (mask & WFSSTAT_NAME) { #endif result = ntfs_change_label( ns->ntvol, (char*)fss->volume_name ); - goto exit; + goto exit; } exit: @@ -283,7 +307,6 @@ return result; } -#endif #ifdef __HAIKU__ status_t @@ -487,7 +510,6 @@ return result; } -#ifndef _READ_ONLY_ #ifdef __HAIKU__ status_t fs_remove_vnode( void *_ns, void *_node, bool reenter ) @@ -515,7 +537,6 @@ return result; } -#endif #ifdef __HAIKU__ status_t @@ -598,8 +619,13 @@ free(intx_file); } ntfs_attr_close(na); - stbuf->st_mode |= 0666; + stbuf->st_mode |= 0666; } + + if (ns->flags & B_FS_IS_READONLY) { + stbuf->st_mode &= ~(S_IWUSR | S_IWGRP | S_IWOTH); + } + stbuf->st_uid = 0; stbuf->st_gid = 0; stbuf->st_atime = ni->last_access_time; @@ -619,7 +645,6 @@ } -#ifndef _READ_ONLY_ #ifdef __HAIKU__ status_t fs_wstat(void *_vol, void *_node, const struct stat *st, uint32 mask) @@ -702,9 +727,8 @@ return result; } -#endif -#ifndef _READ_ONLY_ + #ifdef __HAIKU__ status_t fs_sync(void *_ns) @@ -719,19 +743,14 @@ ERRPRINT("fs_sync - ENTER\n"); -#ifndef __HAIKU__ - flush_device(DEV_FD(ns->ntvol->dev), 0); -#endif - ERRPRINT("fs_sync - EXIT\n"); UNLOCK_VOL(ns); return B_NO_ERROR; } -#endif -#ifndef _READ_ONLY_ + #ifdef __HAIKU__ status_t fs_fsync(void *_ns, void *_node) @@ -773,7 +792,6 @@ return result; } -#endif #ifdef __HAIKU__ status_t @@ -840,7 +858,6 @@ } -#ifndef _READ_ONLY_ #ifdef __HAIKU__ status_t fs_create(void *_ns, void *_dir, const char *name, int omode, int perms, void **_cookie, vnode_id *_vnid) @@ -859,9 +876,14 @@ ntfschar *uname = NULL; status_t result = B_NO_ERROR; int uname_len; + + if (ns->flags & B_FS_IS_READONLY) { + ERRPRINT("ntfs is read-only\n"); + return EROFS; + } LOCK_VOL(ns); - + ERRPRINT("fs_create - ENTER: name=%s\n",name); if(_ns==NULL || _dir==NULL) { @@ -964,7 +986,6 @@ return result; } -#endif #ifdef __HAIKU__ status_t @@ -1048,7 +1069,6 @@ } -#ifndef _READ_ONLY_ #ifdef __HAIKU__ status_t fs_write( void *_ns, void *_node, void *_cookie, off_t offset, const void *buf, size_t *len ) @@ -1066,6 +1086,11 @@ size_t size=*len; status_t result = B_NO_ERROR; + if (ns->flags & B_FS_IS_READONLY) { + ERRPRINT("ntfs is read-only\n"); + return EROFS; + } + LOCK_VOL(ns); ERRPRINT("fs_write - ENTER, offset=%d, len=%d\n",(int)offset, (int)(*len)); @@ -1145,8 +1170,8 @@ return result; } -#endif + #ifdef __HAIKU__ status_t fs_close(void *ns, void *node, void *cookie) @@ -1292,7 +1317,6 @@ return result; } -#ifndef _READ_ONLY_ #ifdef __HAIKU__ status_t fs_create_symlink(void *_ns, void *_dir, const char *name, const char *target, int mode) @@ -1383,9 +1407,8 @@ return result; } -#endif -#ifndef _READ_ONLY_ + #ifdef __HAIKU__ status_t fs_mkdir(void *_ns, void *_node, const char *name, int perms, vnode_id *_vnid) @@ -1402,6 +1425,11 @@ ntfs_inode *ni = NULL; ntfs_inode *bi = NULL; status_t result = B_NO_ERROR; + + if (ns->flags & B_FS_IS_READONLY) { + ERRPRINT("ntfs is read-only\n"); + return EROFS; + } LOCK_VOL(ns); @@ -1484,9 +1512,7 @@ return result; } -#endif -#ifndef _READ_ONLY_ #ifdef __HAIKU__ status_t fs_rename(void *_ns, void *_odir, const char *oldname, void *_ndir, const char *newname) @@ -1515,6 +1541,10 @@ status_t result = B_NO_ERROR; + if (ns->flags & B_FS_IS_READONLY) { + ERRPRINT("ntfs is read-only\n"); + return EROFS; + } LOCK_VOL(ns); @@ -1683,9 +1713,7 @@ return result; } -#endif -#ifndef _READ_ONLY_ status_t do_unlink(nspace *vol, vnode *dir, const char *name, bool isdir) { @@ -1772,9 +1800,8 @@ return result; } -#endif -#ifndef _READ_ONLY_ + #ifdef __HAIKU__ status_t fs_rmdir(void *_ns, void *_node, const char *name) @@ -1787,6 +1814,11 @@ vnode *dir = (vnode*)_node; status_t result = B_NO_ERROR; + if (ns->flags & B_FS_IS_READONLY) { + ERRPRINT("ntfs is read-only\n"); + return EROFS; + } + LOCK_VOL(ns); ERRPRINT("fs_rmdir - ENTER: name %s\n", name==NULL?"NULL":name); @@ -1818,9 +1850,8 @@ return result; } -#endif -#ifndef _READ_ONLY_ + #ifdef __HAIKU__ status_t fs_unlink(void *_ns, void *_node, const char *name) @@ -1833,6 +1864,11 @@ vnode *dir = (vnode*)_node; status_t result = B_NO_ERROR; + if (ns->flags & B_FS_IS_READONLY) { + ERRPRINT("ntfs is read-only\n"); + return EROFS; + } + LOCK_VOL(ns); ERRPRINT("fs_unlink - ENTER: name %s\n", name==NULL?"NULL":name); @@ -1864,5 +1900,4 @@ return result; } -#endif Modified: haiku/trunk/src/add-ons/kernel/file_systems/ntfs/fs_func.h =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/ntfs/fs_func.h 2007-03-05 05:16:08 UTC (rev 20331) +++ haiku/trunk/src/add-ons/kernel/file_systems/ntfs/fs_func.h 2007-03-05 07:01:21 UTC (rev 20332) @@ -116,8 +116,6 @@ #endif //__HAIKU__ -#ifndef _READ_ONLY_ -status_t do_unlink(nspace *vol, vnode *dir, const char *name, bool isdir); -#endif +status_t do_unlink(nspace *vol, vnode *dir, const char *name, bool isdir); #endif Modified: haiku/trunk/src/add-ons/kernel/file_systems/ntfs/kernel_interface.c =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/ntfs/kernel_interface.c 2007-03-05 05:16:08 UTC (rev 20331) +++ haiku/trunk/src/add-ons/kernel/file_systems/ntfs/kernel_interface.c 2007-03-05 07:01:21 UTC (rev 20332) @@ -95,11 +95,7 @@ &fs_mount, &fs_unmount, &fs_rfsstat, -#ifdef _READ_ONLY_ - NULL, -#else &fs_wfsstat, -#endif NULL, /* vnode operations */ @@ -107,11 +103,7 @@ &fs_get_vnode_name, &fs_read_vnode, &fs_write_vnode, -#ifdef _READ_ONLY_ - NULL, -#else &fs_remove_vnode, -#endif /* VM file access */ NULL, // &fs_can_page @@ -125,58 +117,29 @@ NULL, // &fs_select NULL, // &fs_deselect -#ifdef _READ_ONLY_ - NULL, -#else &fs_fsync, -#endif - &fs_readlink, - -#ifdef _READ_ONLY_ - NULL, - NULL, - NULL, - NULL, -#else + &fs_readlink, &fs_create_symlink, NULL, // &fs_link, &fs_unlink, &fs_rename, -#endif &fs_access, &fs_rstat, -#ifdef _READ_ONLY_ - NULL, -#else &fs_wstat, -#endif /* file operations */ -#ifdef _READ_ONLY_ - NULL, -#else &fs_create, -#endif &fs_open, &fs_close, &fs_free_cookie, &fs_read, -#ifdef _READ_ONLY_ - NULL, -#else &fs_write, -#endif /* directory operations */ -#ifdef _READ_ONLY_ - NULL, - NULL, -#else &fs_mkdir, &fs_rmdir, -#endif &fs_opendir, &fs_closedir, &fs_free_dircookie, Modified: haiku/trunk/src/add-ons/kernel/file_systems/ntfs/ntfs.h =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/ntfs/ntfs.h 2007-03-05 05:16:08 UTC (rev 20331) +++ haiku/trunk/src/add-ons/kernel/file_systems/ntfs/ntfs.h 2007-03-05 07:01:21 UTC (rev 20332) @@ -119,18 +119,21 @@ int free_cluster_count; char volumeLabel[MAX_PATH]; - int state; - s64 free_clusters; - long free_mft; - BOOL ro; - BOOL show_sys_files; - BOOL silent; - BOOL force; - BOOL debug; - BOOL noatime; - BOOL no_detach; + ulong flags; + + int state; + s64 free_clusters; + long free_mft; + BOOL ro; + BOOL show_sys_files; + BOOL silent; + BOOL force; + BOOL debug; + BOOL noatime; + BOOL no_detach; - lock vlock; + + lock vlock; } nspace; Modified: haiku/trunk/src/add-ons/kernel/file_systems/ntfs/ntfsdir.c =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/ntfs/ntfsdir.c 2007-03-05 05:16:08 UTC (rev 20331) +++ haiku/trunk/src/add-ons/kernel/file_systems/ntfs/ntfsdir.c 2007-03-05 07:01:21 UTC (rev 20332) @@ -1,6 +1,6 @@ /* ntfsdir.c - directory functions * - * Copyright (c) 2006-2007 Troeglazov Gerasim (3dEyes**) + * Copyright (c) 2006 Troeglazov Gerasim (3dEyes**) * * This program/include file is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as published @@ -38,51 +38,11 @@ #include "ntfsdir.h" //callback function for readdir() -static -int _ntfs_dirent_dot_filler(void *_dirent, const ntfschar *name, +static int _ntfs_dirent_filler(void *_dirent, const ntfschar *name, const int name_len, const int name_type, const s64 pos, - const MFT_REF mref, const unsigned dt_type) -{ - char *filename = NULL; - dircookie *cookie = (dircookie*)_dirent; - - if (name_type == FILE_NAME_DOS) - return 0; - - if (ntfs_ucstombs(name, name_len, &filename, 0) < 0) { - ERRPRINT("Skipping unrepresentable filename\n"); - return 0; - } - - if(strcmp(filename,".")==0 || strcmp(filename,"..")==0) { - if (MREF(mref) == FILE_root || MREF(mref) >= FILE_first_user || false) { - struct direntry *ent = (direntry*)ntfs_calloc(sizeof(direntry)); - ent->name = (char*)ntfs_calloc(strlen(filename)+1); - strcpy(ent->name,filename); - ent->dev=cookie->dev; - ent->ino=MREF(mref); - ent->next = NULL; + const MFT_REF mref, const unsigned dt_type); - if(cookie->root==NULL) { - cookie->root = ent; - cookie->walk = ent; - } - - if(cookie->last != NULL) - cookie->last->next = ent; - - cookie->last = ent; - } else { - free(filename); - return -1; - } - } - free(filename); - return 0; -} - -static -int _ntfs_dirent_filler(void *_dirent, const ntfschar *name, +static int _ntfs_dirent_filler(void *_dirent, const ntfschar *name, const int name_len, const int name_type, const s64 pos, const MFT_REF mref, const unsigned dt_type) { @@ -91,38 +51,24 @@ if (name_type == FILE_NAME_DOS) return 0; - - if (ntfs_ucstombs(name, name_len, &filename, 0) < 0) { - ERRPRINT("Skipping unrepresentable filename\n"); - return 0; - } - - if(strcmp(filename,".")==0 || strcmp(filename,"..")==0) - return 0; - - if (MREF(mref) == FILE_root || MREF(mref) >= FILE_first_user || false) { - struct direntry *ent = (direntry*)ntfs_calloc(sizeof(direntry)); - ent->name = (char*)ntfs_calloc(strlen(filename)+1); - strcpy(ent->name,filename); - ent->dev=cookie->dev; - ent->ino=MREF(mref); - ent->next = NULL; - - if(cookie->root==NULL) { - cookie->root = ent; - cookie->walk = ent; - } - - if(cookie->last != NULL) - cookie->last->next = ent; - - cookie->last = ent; + + if (MREF(mref) == FILE_root || MREF(mref) >= FILE_first_user || cookie->show_sys_files) { + if(cookie->readed==1) { + cookie->pos=pos; + cookie->readed = 0; + return -1; + } else { + if (ntfs_ucstombs(name, name_len, &filename, 0) < 0) + return -1; + strcpy(cookie->name,filename); + cookie->ino=MREF(mref); + cookie->readed = 1; + return 0; + } } - free(filename); return 0; } - #ifdef __HAIKU__ status_t fs_free_dircookie( void *_ns, void *node, void *cookie ) @@ -155,14 +101,14 @@ { nspace *ns = (nspace*)_ns; vnode *node = (vnode*)_node; + dircookie *cookie = (dircookie*)ntfs_calloc( sizeof(dircookie) ); int result = B_NO_ERROR; ntfs_inode *ni=NULL; - dircookie *cookie = (dircookie*)ntfs_calloc( sizeof(dircookie) ); - + LOCK_VOL(ns); ERRPRINT("fs_opendir - ENTER\n"); - + ni = ntfs_inode_open(ns->ntvol, node->vnid); if(ni==NULL) { result = ENOENT; @@ -173,28 +119,25 @@ result = EMFILE; goto exit; } - + if ( cookie != NULL ) { - cookie->dev = ns->id; - cookie->pos = 0; - //cookie->walk_dir = ni; - cookie->vnid = node->vnid; - cookie->root = NULL; - cookie->last = NULL; - cookie->walk = NULL; + cookie->pos = 0; + cookie->ino = 0; + cookie->readed = 0; + cookie->name[0] = 0; + cookie->show_sys_files = ns->show_sys_files; *_cookie = (void*)cookie; - } else { - result = ENOMEM; } -exit: - + else + result = ENOMEM; +exit: if(ni) - ntfs_inode_close(ni); + ntfs_inode_close(ni); ERRPRINT("fs_opendir - EXIT\n"); - + UNLOCK_VOL(ns); - + return result; } @@ -206,32 +149,12 @@ fs_closedir( void *_ns, void *node, void *_cookie ) #endif { - nspace *ns = (nspace*)_ns; - dircookie *cookie = (dircookie*)_cookie; - struct direntry *entry,*entrynext; + nspace *ns = (nspace*)_ns; LOCK_VOL(ns); ERRPRINT("fs_closedir - ENTER\n"); - - entry=cookie->root; - if(entry) { - for(;;) { - entrynext = entry->next; - - if(entry->name) - free(entry->name); - - if(entry) - free(entry); - - entry = entrynext; - - if(!entry) - break; - } - } - + ERRPRINT("fs_closedir - EXIT\n"); UNLOCK_VOL(ns); @@ -247,68 +170,51 @@ fs_readdir(void *_ns, void *_node, void *_cookie, long *num, struct dirent *buf, size_t bufsize) #endif { - int result = B_NO_ERROR; nspace *ns = (nspace*)_ns; vnode *node = (vnode*)_node; dircookie *cookie = (dircookie*)_cookie; - ntfs_inode *ni=NULL; uint32 nameLength = bufsize - sizeof(buf) + 1, realLen; - u64 pos=0; + int result = B_NO_ERROR; + ntfs_inode *ni=NULL; LOCK_VOL(ns); - ERRPRINT("fs_readdir - ENTER:\n"); + ERRPRINT("fs_readdir - ENTER\n"); if (!ns || !node || !cookie || !num || bufsize < sizeof(buf)) { - result = -1; - goto quit; + result = EINVAL; + goto exit; } - - if(cookie->pos==0) { - ni = ntfs_inode_open(ns->ntvol, node->vnid); - if(ni==NULL) { - result = ENOENT; - goto quit; - } - ntfs_readdir(ni, &pos, cookie, (ntfs_filldir_t)_ntfs_dirent_dot_filler); - cookie->pos+=2; - } else { - if(cookie->pos==2) { - ni = ntfs_inode_open(ns->ntvol, node->vnid); - if(ni==NULL) { - result = ENOENT; - goto quit; - } - ntfs_readdir(ni, &pos, cookie, (ntfs_filldir_t)_ntfs_dirent_filler); - cookie->pos++; - } - } - - if(cookie->root==NULL || cookie->last==NULL) { - result = -1; - goto quit; + if(cookie->readed == 1) { + result = ENOENT; + goto exit; } - if(cookie->walk==NULL) { - result = ENOENT; - goto quit; - } - + ni = ntfs_inode_open(ns->ntvol, node->vnid); + if(ni==NULL) { + result = ENOENT; + goto exit; + } - realLen = ( strlen(cookie->walk->name)>=nameLength?(nameLength):(strlen(cookie->walk->name)) )+1; - buf->d_dev = cookie->walk->dev; - buf->d_ino = cookie->walk->ino; - memcpy(buf->d_name,cookie->walk->name, realLen); - buf->d_reclen = sizeof(buf) + realLen - 1; + result = ntfs_readdir(ni, &cookie->pos, cookie, (ntfs_filldir_t)_ntfs_dirent_filler); + if(result==0) { + realLen = nameLength>255?255:nameLength; + buf->d_dev = ns->id; + buf->d_ino = cookie->ino; + memcpy(buf->d_name,cookie->name, realLen+1); + buf->d_reclen = sizeof(buf) + realLen - 1; + result = B_NO_ERROR; + } + else + result = ENOENT; - cookie->walk = cookie->walk->next; + ERRPRINT("fs_readdir - FILE: [%s]\n",buf->d_name); +exit: + if(ni) + ntfs_inode_close(ni); - ERRPRINT("fs_readdir - FILE: %s\n",buf->d_name); - -quit: - if ( result == B_NO_ERROR ) *num = 1; else @@ -316,11 +222,8 @@ if ( result == ENOENT ) result = B_NO_ERROR; - - if(ni) - ntfs_inode_close(ni); - ERRPRINT("fs_readdir - EXIT, result is %s\n", strerror(result)); + ERRPRINT("fs_readdir - EXIT result (%s)\n", strerror(result)); UNLOCK_VOL(ns); @@ -336,15 +239,17 @@ #endif { nspace *ns = (nspace*)_ns; - int result = EINVAL; dircookie *cookie = (dircookie*)_cookie; - + int result = EINVAL; + LOCK_VOL(ns); ERRPRINT("fs_rewinddir - ENTER\n"); if ( cookie != NULL ) { - cookie->pos = 0; - cookie->walk = cookie->root; + cookie->pos = 0; + cookie->ino = 0; + cookie->readed = 0; + cookie->name[0] = 0; result = B_NO_ERROR; } ERRPRINT("fs_rewinddir - EXIT, result is %s\n", strerror(result)); Modified: haiku/trunk/src/add-ons/kernel/file_systems/ntfs/ntfsdir.h =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/ntfs/ntfsdir.h 2007-03-05 05:16:08 UTC (rev 20331) +++ haiku/trunk/src/add-ons/kernel/file_systems/ntfs/ntfsdir.h 2007-03-05 07:01:21 UTC (rev 20332) @@ -22,25 +22,15 @@ #define _NTFSDIR_H -typedef struct direntry -{ - char *name; - dev_t dev; - ino_t ino; - struct direntry *next; -} direntry; - typedef struct dircookie { - dev_t dev; - vnode_id vnid; - struct direntry * root; - struct direntry * last; - struct direntry * walk; u64 pos; + int readed; + ino_t ino; + BOOL show_sys_files; + char name[MAX_PATH]; } dircookie; - #ifdef __HAIKU__ status_t fs_free_dircookie( void *_ns, void *node, void *cookie ); Added: haiku/trunk/src/add-ons/kernel/file_systems/ntfs/settings/ntfs =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/ntfs/settings/ntfs 2007-03-05 05:16:08 UTC (rev 20331) +++ haiku/trunk/src/add-ons/kernel/file_systems/ntfs/settings/ntfs 2007-03-05 07:01:21 UTC (rev 20332) @@ -0,0 +1,8 @@ +# Sample settings file for the ntfs plugin +# +# This file should be moved to the directory +# /boot/home/config/settings/kernel/drivers/ +# +hide_sys_files true +read_only false +no_atime true From stefano.ceccherini at gmail.com Mon Mar 5 08:14:10 2007 From: stefano.ceccherini at gmail.com (Stefano Ceccherini) Date: Mon, 5 Mar 2007 08:14:10 +0100 Subject: [Haiku-commits] r20292 - in haiku/trunk: headers/os/interface headers/private/interface src/kits/interface src/servers/app In-Reply-To: <27558602.1172849186037.JavaMail.ngmail@webmail14> References: <200703012317.l21NHh3k006324@sheep.berlios.de> <894b9700703012326n4e807560q2565907e13dc5388@mail.gmail.com> <894b9700703012331t62e57999q340690d179129286@mail.gmail.com> <894b9700703020025k4b1be976p32966129bb1aad9b@mail.gmail.com> <27558602.1172849186037.JavaMail.ngmail@webmail14> Message-ID: <894b9700703042314n23c82bc7x27540d5368cc8a01@mail.gmail.com> 2007/3/2, Marcus Overhagen : > I thought that "old style" format compatiblity had been droppped, thats > why I changed a small part of this format implementation. However, You mean with commit 20228 ? With that commit I removed support for < R3 picture format, actually. Maybe I should've worded the log a bit better. We are (were ?) still compatible with R5 picture format. > I couldn't find the part which is responsible to write it except the > PictureDataWriter, but that one only implements a small part. Maybe it's missing some bits, but it does not implement only a small part. > > And also, the print drivers expect a certain format, so we shouldn't change > > it. > I greped the whole "src" and "header" directories recursively > before doing the change, but I didn't find any further reference > to the BPicture opcodes. > > I also can't find where this is used by printers, can you give me a pointer? See Philippe's reply for this. > Where does the data come from, do you have some example flattened > data for me? I used Marc Fleracker's documentation as a base for the implementation. Marc worked a lot on the BPicture format, and wrote the document you can find in the tree. I don't have any data at hand, but should be really easy to produce a flattened BPicture in R5 and try to read it from haiku. > > I had a look at the rest of your changes and they look good, but at > > least the last change in PictureDataWriter.cpp (20292) should be > > reverted. > I'm willing to revert whatever is necessary to remain compatible. That one should be the only necessary change. From jackburton at mail.berlios.de Mon Mar 5 13:48:37 2007 From: jackburton at mail.berlios.de (jackburton at BerliOS) Date: Mon, 5 Mar 2007 13:48:37 +0100 Subject: [Haiku-commits] r20333 - haiku/trunk/src/apps/terminal Message-ID: <200703051248.l25Cmb7H019694@sheep.berlios.de> Author: jackburton Date: 2007-03-05 13:48:36 +0100 (Mon, 05 Mar 2007) New Revision: 20333 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20333&view=rev Removed: haiku/trunk/src/apps/terminal/TermPrint.cpp Modified: haiku/trunk/src/apps/terminal/TermApp.cpp haiku/trunk/src/apps/terminal/TermParse.cpp haiku/trunk/src/apps/terminal/TermParse.h haiku/trunk/src/apps/terminal/TermView.cpp haiku/trunk/src/apps/terminal/TermView.h haiku/trunk/src/apps/terminal/TermWindow.cpp haiku/trunk/src/apps/terminal/Terminal.cpp Log: Got rid of the global gPfd variable. Big time cleanup, made TermParse a bit more robust with error checks and likes. Removed unused TermPrint.cpp file. I hope I didn't get on your way, Vasilis :) Modified: haiku/trunk/src/apps/terminal/TermApp.cpp =================================================================== --- haiku/trunk/src/apps/terminal/TermApp.cpp 2007-03-05 07:01:21 UTC (rev 20332) +++ haiku/trunk/src/apps/terminal/TermApp.cpp 2007-03-05 12:48:36 UTC (rev 20333) @@ -373,11 +373,11 @@ if (cols < MIN_COLS) gTermPref->setInt32(PREF_COLS, cols = MIN_COLS); - gPfd = spawn_shell(rows, cols, command, encoding); - if (gPfd < 0) - return gPfd; + int pfd = spawn_shell(rows, cols, command, encoding); + if (pfd < 0) + return pfd; - fTermWindow = new TermWindow(frame, fWindowTitle.String(), gPfd); + fTermWindow = new TermWindow(frame, fWindowTitle.String(), pfd); fTermWindow->Show(); return B_OK; Modified: haiku/trunk/src/apps/terminal/TermParse.cpp =================================================================== --- haiku/trunk/src/apps/terminal/TermParse.cpp 2007-03-05 07:01:21 UTC (rev 20332) +++ haiku/trunk/src/apps/terminal/TermParse.cpp 2007-03-05 12:48:36 UTC (rev 20333) @@ -4,255 +4,263 @@ * Parts Copyright (C) 1998,99 Kazuho Okui and Takashi Murai. * Distributed under the terms of the MIT license. */ - - #include #include #include #include #include -#include -#include +#include +#include #include #include - #include "TermParse.h" #include "TermView.h" #include "VTparse.h" #include "TermConst.h" #include "CodeConv.h" -extern int gPfd; // defined Muterminal.cpp +////////////////////////////////////////////////////////////////////////////// +// EscParse ... Escape sequence parse and character encoding. +// +////////////////////////////////////////////////////////////////////////////// + +extern int utf8_groundtable[]; /* UTF8 Ground table */ +extern int cs96_groundtable[]; /* CS96 Ground table */ +extern int iso8859_groundtable[]; /* ISO8859 & EUC Ground table */ +extern int sjis_groundtable[]; /* Shift-JIS Ground table */ + +extern int esctable[]; /* ESC */ +extern int csitable[]; /* ESC [ */ +extern int dectable[]; /* ESC [ ? */ +extern int scrtable[]; /* ESC # */ +extern int igntable[]; /* ignore table */ +extern int iestable[]; /* ignore ESC table */ +extern int eigtable[]; /* ESC ignore table */ +extern int mbcstable[]; /* ESC $ */ + + +// MuTerminal coding system (global varriable) +int gNowCoding = M_UTF8; + +#define DEFAULT -1 +#define NPARAM 10 // Max parameters + +/* + * Constructor and Destructor. + */ +TermParse::TermParse(int fd, TermWindow *inWinObj, TermView *inViewObj, CodeConv *inConvObj) + : + fFd(fd), + fViewObj(inViewObj), + fWinObj(inWinObj), + fConvObj(inConvObj), + fParseThread(-1), + fParseSem(-1), + fReaderThread(-1), + fReaderSem(-1), + fReaderLocker(-1), + fCursorUpdate(NULL), + fParser_p(0), + fLockFlag(0), + fQuitting(false) +{ +} + + +TermParse::~TermParse() +{ + fQuitting = true; + + delete_sem(fReaderSem); + delete_sem(fReaderLocker); + + status_t dummy; + wait_for_thread(fParseThread, &dummy); + wait_for_thread(fReaderThread, &dummy); +} + + +status_t +TermParse::StartThreads() +{ + status_t status = InitPtyReader(); + + if (status < B_OK) + return status; + + status = InitTermParse(); + if (status < B_OK) { + //AbortPtyReader(); + return status; + } + + return B_OK; +} + + ///////////////////////////////////////////////////////////////////////////// // PtyReader ... Get character from pty device. // ///////////////////////////////////////////////////////////////////////////// int32 -TermParse::PtyReader(void *data) +TermParse::PtyReader() { - int nread; - uint read_p = 0; - - TermParse *theObj = (TermParse *) data; - - uchar buf [READ_BUF_SIZE]; - - while (theObj->fQuitting) { - /* - * If Pty Buffer nearly full, snooze this thread, and continue. - */ - if ((read_p - theObj->fParser_p) > READ_BUF_SIZE - 16) { - theObj->fLockFlag = READ_BUF_SIZE / 2; - acquire_sem (theObj->fReaderLocker); - } + uint read_p = 0; + while (!fQuitting) { + // If Pty Buffer nearly full, snooze this thread, and continue. + if ((read_p - fParser_p) > READ_BUF_SIZE - 16) { + fLockFlag = READ_BUF_SIZE / 2; + status_t status; + do { + status = acquire_sem(fReaderLocker); + } while (status == B_INTERRUPTED); + if (status < B_OK) + return status; + } - /* - * Read PTY. - */ - nread = read (gPfd, buf, - READ_BUF_SIZE - (read_p - theObj->fParser_p)); - if (nread <= 0) { - be_app->PostMessage(B_QUIT_REQUESTED); - exit_thread (B_ERROR); - - } - + // Read PTY + uchar buf[READ_BUF_SIZE]; + int nread = read(fFd, buf, READ_BUF_SIZE - (read_p - fParser_p)); + if (nread <= 0) { + be_app->PostMessage(B_QUIT_REQUESTED); + exit_thread(B_ERROR); + } + int left = READ_BUF_SIZE - (read_p % READ_BUF_SIZE); + int mod = read_p % READ_BUF_SIZE; + // Copy read string to PtyBuffer. + + if (nread >= left) { + memcpy(fReadBuf + mod, buf, left); + memcpy(fReadBuf, buf + left, nread - left); + } else + memcpy(fReadBuf + mod, buf, nread); - int left = READ_BUF_SIZE - (read_p % READ_BUF_SIZE); - int mod = read_p % READ_BUF_SIZE; + read_p += nread; - /* - * Copy read string to PtyBuffer. - */ - if (nread >= left) { - memcpy (theObj->fReadBuf + mod, buf, left); - memcpy (theObj->fReadBuf, buf + left, nread - left); - } - else { - memcpy (theObj->fReadBuf + mod, buf, nread); - } - read_p += nread; - - /* - * Release semaphore. Number of semaphore counter is nread. - */ - release_sem_etc (theObj->fReaderSem, nread, 0); + // Release semaphore. Number of semaphore counter is nread. + release_sem_etc(fReaderSem, nread, 0); + } - } - theObj->fReaderThread = -1; - exit_thread (B_OK); - return B_OK; + fReaderThread = -1; + exit_thread(B_OK); + return B_OK; } + + /////////////////////////////////////////////////////////////////////////// // GetReaderBuf ... Get char pty reader buffer. // /////////////////////////////////////////////////////////////////////////// - -uchar -TermParse::GetReaderBuf (void) +status_t +TermParse::GetReaderBuf(uchar &c) { - int c; + status_t status; + do { + status = acquire_sem_etc(fReaderSem, 1, B_TIMEOUT, 10000); + } while (status == B_INTERRUPTED); - switch (acquire_sem_etc (fReaderSem, 1, B_TIMEOUT, (bigtime_t)10000.0)) { - case B_NO_ERROR: - break; - case B_TIMED_OUT: - default: - fViewObj->ScrollAtCursor(); - fViewObj->UpdateLine(); + if (status == B_TIMED_OUT) { + fViewObj->ScrollAtCursor(); + fViewObj->UpdateLine(); - // Reset cursor blinking time and turn on cursor blinking. - fCursorUpdate->SetInterval (1000000); - fViewObj->SetCurDraw (CURON); + // Reset cursor blinking time and turn on cursor blinking. + fCursorUpdate->SetInterval (1000000); + fViewObj->SetCurDraw (CURON); - // wait new input from pty. - acquire_sem (fReaderSem); - break; - } + // wait new input from pty. + do { + status = acquire_sem(fReaderSem); + } while (status == B_INTERRUPTED); + if (status < B_OK) + return status; + } else if (status == B_OK) { + // Do nothing + } else + return status; - c = fReadBuf[fParser_p % READ_BUF_SIZE]; - fParser_p++; - /* - * If PtyReader thread locked, decliment counter and unlock thread. - */ - if (fLockFlag != 0) { - fLockFlag--; - if (fLockFlag == 0) { - release_sem (fReaderLocker); - } - } + c = fReadBuf[fParser_p % READ_BUF_SIZE]; + fParser_p++; + // If PtyReader thread locked, decrement counter and unlock thread. + if (fLockFlag != 0) { + if (--fLockFlag == 0) + release_sem(fReaderLocker); + } + + fViewObj->SetCurDraw(CUROFF); - fViewObj->SetCurDraw (CUROFF); - - return c; + return B_OK; } + /////////////////////////////////////////////////////////////////////////// // InitTermParse ... Initialize and spawn EscParse thread. // /////////////////////////////////////////////////////////////////////////// status_t -TermParse::InitTermParse (TermView *inViewObj, CodeConv *inConvObj) +TermParse::InitTermParse() { + if (fParseThread >= 0) + return B_ERROR; // we might want to return B_OK instead ? - fViewObj = inViewObj; - fConvObj = inConvObj; + fCursorUpdate = new BMessageRunner(BMessenger(fViewObj), + new BMessage(MSGRUN_CURSOR), 1000000); + + fParseThread = spawn_thread(_escparse_thread, "EscParse", B_DISPLAY_PRIORITY, this); + + return resume_thread(fParseThread); +} - fCursorUpdate = new BMessageRunner (BMessenger (fViewObj), - new BMessage (MSGRUN_CURSOR), - 1000000); - - if (fParseThread < 0) - fParseThread = - spawn_thread (EscParse, "EscParse", B_DISPLAY_PRIORITY, this); - else - return B_BAD_THREAD_ID; - - return (resume_thread ( fParseThread)); -} /////////////////////////////////////////////////////////////////////////// // InitPtyReader ... Initialize and spawn PtyReader thread. // /////////////////////////////////////////////////////////////////////////// thread_id -TermParse::InitPtyReader (TermWindow *inWinObj) +TermParse::InitPtyReader() { + if (fReaderThread >= 0) + return B_ERROR; // same as above - fWinObj = inWinObj; - - if (fReaderThread < 0) - fReaderThread = - spawn_thread (PtyReader, "PtyReader", B_NORMAL_PRIORITY, this); - else - return B_BAD_THREAD_ID; + fReaderSem = create_sem(0, "pty_reader_sem"); + if (fReaderSem < 0) + return fReaderSem; - fReaderSem = create_sem (0, "pty_reader_sem"); - fReaderLocker = create_sem (0, "pty_locker_sem"); + fReaderLocker = create_sem(0, "pty_locker_sem"); + if (fReaderLocker < 0) { + delete_sem(fReaderSem); + return fReaderLocker; + } + + fReaderThread = spawn_thread(_ptyreader_thread, "PtyReader", B_NORMAL_PRIORITY, this); + if (fReaderThread < 0) { + delete_sem(fReaderSem); + delete_sem(fReaderLocker); + return fReaderThread; + } - resume_thread (fReaderThread); - - return (fReaderThread); + return resume_thread(fReaderThread); } -/* - * Constructer and Destructer. - */ -TermParse::TermParse (void) -{ - - fParseThread = -1; - fReaderThread = -1; - fLockFlag = 0; - fParser_p = 0; - fQuitting = 1; - -} - -TermParse::~TermParse (void) -{ - //status_t sts; - - fQuitting = 0; - kill_thread(fParseThread); - - kill_thread(fReaderThread); - delete_sem (fReaderSem); - delete_sem (fReaderLocker); - -} - -////////////////////////////////////////////////////////////////////////////// -// EscParse ... Escape sequence parse and character encoding. -// -////////////////////////////////////////////////////////////////////////////// - -extern int utf8_groundtable[]; /* UTF8 Ground table */ -extern int cs96_groundtable[]; /* CS96 Ground table */ -extern int iso8859_groundtable[]; /* ISO8859 & EUC Ground table */ -extern int sjis_groundtable[]; /* Shift-JIS Ground table */ - -extern int esctable[]; /* ESC */ -extern int csitable[]; /* ESC [ */ -extern int dectable[]; /* ESC [ ? */ -extern int scrtable[]; /* ESC # */ -extern int igntable[]; /* ignore table */ -extern int iestable[]; /* ignore ESC table */ -extern int eigtable[]; /* ESC ignore table */ -extern int mbcstable[]; /* ESC $ */ - - -/* MuTerminal coding system (global varriable) */ -int gNowCoding = M_UTF8; - -#define DEFAULT -1 -#define NPARAM 10 // Max parameters - - int32 -TermParse::EscParse(void *data) +TermParse::EscParse() { int tmp; int top, bot; int cs96; uchar curess = 0; - TermParse *theObj = (TermParse *)data; + TermView *viewObj = fViewObj; + CodeConv *convObj = fConvObj; - TermView *viewObj = theObj->fViewObj; - CodeConv *convObj = theObj->fConvObj; - uchar cbuf[4], dstbuf[4]; uchar *ptr; - int *parsestate, *groundtable; int now_coding = -1; - uchar c; ushort attr = BACKCOLOR; int param[NPARAM]; @@ -262,11 +270,13 @@ int width; /* default coding system is UTF8 */ - groundtable = utf8_groundtable; - parsestate = groundtable; + int *groundtable = utf8_groundtable; + int *parsestate = groundtable; - while (theObj->fQuitting) { - c = theObj->GetReaderBuf(); + while (!fQuitting) { + uchar c; + if (GetReaderBuf(c) < B_OK) + break; if (now_coding != gNowCoding) { /* @@ -326,7 +336,7 @@ case CASE_SS3: /* JIS X 0212 */ *ptr++ = curess; *ptr++ = c; - *ptr++ = theObj->GetReaderBuf (); + GetReaderBuf(*ptr++); *ptr = 0; width = 2; curess = 0; @@ -334,7 +344,7 @@ default: /* JIS X 0208 */ *ptr++ = c; - *ptr++ = theObj->GetReaderBuf (); + GetReaderBuf(*ptr++); *ptr = 0; width = 2; break; @@ -356,7 +366,8 @@ case CASE_PRINT_CS96: cbuf[0] = c | 0x80; - cbuf[1] = theObj->GetReaderBuf() | 0x80; + GetReaderBuf(cbuf[1]); + cbuf[1] |= 0x80; cbuf[2] = 0; width = 2; convObj->ConvertToInternal((char*)cbuf, 2, (char*)dstbuf, M_EUC_JP); @@ -381,7 +392,7 @@ case CASE_SJIS_INSTRING: cbuf[0] = (uchar)c; - cbuf[1] = theObj->GetReaderBuf(); + GetReaderBuf(cbuf[1]); cbuf[2] = '\0'; convObj->ConvertToInternal((char*)cbuf, 2, (char*)dstbuf, now_coding); width = 2; @@ -390,7 +401,7 @@ case CASE_UTF8_2BYTE: cbuf[0] = (uchar)c; - c = theObj->GetReaderBuf(); + GetReaderBuf(c); if (groundtable[c] != CASE_UTF8_INSTRING) break; cbuf[1] = (uchar)c; @@ -401,12 +412,12 @@ case CASE_UTF8_3BYTE: cbuf[0] = c; - c = theObj->GetReaderBuf(); + GetReaderBuf(c); if (groundtable[c] != CASE_UTF8_INSTRING) break; cbuf[1] = c; - c = theObj->GetReaderBuf(); + GetReaderBuf(c); if (groundtable[c] != CASE_UTF8_INSTRING) break; cbuf[2] = c; @@ -427,11 +438,13 @@ break; case CASE_SCS_STATE: + { cs96 = 0; - theObj->GetReaderBuf (); + uchar dummy; + GetReaderBuf(dummy); parsestate = groundtable; break; - + } case CASE_GROUND_STATE: /* exit ignore mode */ parsestate = groundtable; @@ -781,15 +794,18 @@ /* Operating System Command: ESC ] */ char string[512]; uint32 len = 0; - char mode_char = theObj->GetReaderBuf(); + uchar mode_char; + GetReaderBuf(mode_char); if (mode_char != '0' && mode_char != '1' && mode_char != '2') { parsestate = groundtable; break; } - char current_char = theObj->GetReaderBuf(); - while ((current_char = theObj->GetReaderBuf()) != 0x7) { + uchar current_char; + GetReaderBuf(current_char); + while (GetReaderBuf(current_char) == B_OK + && current_char != 0x7) { if (!isprint(current_char & 0x7f) || len+2 >= sizeof(string)) break; @@ -800,7 +816,7 @@ switch (mode_char) { case '0': case '2': - theObj->fWinObj->SetTitle(string); + fWinObj->SetTitle(string); break; case '1': break; @@ -847,8 +863,23 @@ break; } } - theObj->fParseThread = -1; + fParseThread = -1; exit_thread(B_OK); return B_OK; } + +/* static */ +int32 +TermParse::_ptyreader_thread(void *data) +{ + return reinterpret_cast(data)->PtyReader(); +} + + +/* static */ +int32 +TermParse::_escparse_thread(void *data) +{ + return reinterpret_cast(data)->EscParse(); +} Modified: haiku/trunk/src/apps/terminal/TermParse.h =================================================================== --- haiku/trunk/src/apps/terminal/TermParse.h 2007-03-05 07:01:21 UTC (rev 20332) +++ haiku/trunk/src/apps/terminal/TermParse.h 2007-03-05 12:48:36 UTC (rev 20333) @@ -31,8 +31,9 @@ #ifndef TERMPARSE_H #define TERMPARSE_H -#include +#include #include + #include "TermConst.h" class TermView; @@ -42,56 +43,52 @@ //PtyReader buffer size. #define READ_BUF_SIZE 2048 -class TermParse : public BHandler -{ +class TermParse : public BHandler { public: - TermParse (void); - ~TermParse (void); + TermParse(int fd, TermWindow *inWinObj, TermView *inViewObj, CodeConv *inConvObj); + ~TermParse(); - // Initialize TermParse and PtyReader thread. - status_t InitTermParse (TermView *inViewObj, CodeConv *inConvObj); - thread_id InitPtyReader (TermWindow *inWinObj); - - // Delete TermParse and PtyReader thread. - status_t AbortTermParse (void); - status_t AbortPtyReader (void); + status_t StartThreads(); - private: - // - // Hook Functions. - // + // Initialize TermParse and PtyReader thread. + status_t InitTermParse(); + status_t InitPtyReader(); + // Delete TermParse and PtyReader thread. + status_t AbortTermParse(); + status_t AbortPtyReader(); - // Escape Sequance parse thread. - static int32 EscParse (void *); + int32 EscParse(); + int32 PtyReader(); - // Pty device reader thread. - static int32 PtyReader (void *); + static int32 _ptyreader_thread(void *); + static int32 _escparse_thread(void *); - // Reading ReadBuf at one Char. - uchar GetReaderBuf (void); + // Reading ReadBuf at one Char. + status_t GetReaderBuf(uchar &c); - TermView *fViewObj; - TermWindow *fWinObj; - CodeConv *fConvObj; + int fFd; + + TermView *fViewObj; + TermWindow *fWinObj; + CodeConv *fConvObj; - thread_id fParseThread; - sem_id fParseSem; + thread_id fParseThread; + sem_id fParseSem; - thread_id fReaderThread; - sem_id fReaderSem; - sem_id fReaderLocker; + thread_id fReaderThread; + sem_id fReaderSem; + sem_id fReaderLocker; - BMessageRunner *fCursorUpdate; + BMessageRunner *fCursorUpdate; - uint fParser_p; /* EscParse reading buffer pointer */ - int fLockFlag; /* PtyReader lock flag */ + uint fParser_p; /* EscParse reading buffer pointer */ + int fLockFlag; /* PtyReader lock flag */ - bool fQuitting; + bool fQuitting; - uchar fReadBuf[READ_BUF_SIZE]; /* Reading buffer */ - + uchar fReadBuf[READ_BUF_SIZE]; /* Reading buffer */ }; #endif // TERMPARSE_H Deleted: haiku/trunk/src/apps/terminal/TermPrint.cpp Modified: haiku/trunk/src/apps/terminal/TermView.cpp =================================================================== --- haiku/trunk/src/apps/terminal/TermView.cpp 2007-03-05 07:01:21 UTC (rev 20332) +++ haiku/trunk/src/apps/terminal/TermView.cpp 2007-03-05 12:48:36 UTC (rev 20333) @@ -63,8 +63,9 @@ }; -TermView::TermView(BRect frame, CodeConv *inCodeConv) +TermView::TermView(BRect frame, CodeConv *inCodeConv, int fd) : BView(frame, "termview", B_FOLLOW_NONE, B_WILL_DRAW | B_FRAME_EVENTS), + fTerminalFd(fd), fFontWidth(0), fFontHeight(0), fFontAscent(0), @@ -1119,7 +1120,7 @@ struct winsize ws; ws.ws_row = fTermRows; ws.ws_col = fTermColumns; - ioctl(gPfd, TIOCSWINSZ, &ws); + ioctl(fTerminalFd, TIOCSWINSZ, &ws); kill(-sh_pid, SIGWINCH); fFrameResized = 0; @@ -1139,11 +1140,11 @@ switch (n) { case 5: len = sprintf(sbuf,"\033[0n") ; - write(gPfd, sbuf, len); + write(fTerminalFd, sbuf, len); break ; case 6: len = sprintf(sbuf,"\033[%d;%dR", fTermRows, fTermColumns) ; - write(gPfd, sbuf, len); + write(fTerminalFd, sbuf, len); break ; default: return; @@ -1316,7 +1317,7 @@ // If bytes[0] equal intr charactor, // send signal to shell process group. - tcgetattr(gPfd, &tio); + tcgetattr(fTerminalFd, &tio); if (*bytes == tio.c_cc[VINTR]) { if (tio.c_lflag & ISIG) kill(-sh_pid, SIGINT); @@ -1330,24 +1331,24 @@ case B_RETURN: c = 0x0d; if (key == RETURN_KEY || key == ENTER_KEY) { - write(gPfd, &c, 1); + write(fTerminalFd, &c, 1); return; } else { - write(gPfd, bytes, numBytes); + write(fTerminalFd, bytes, numBytes); return; } break; case B_LEFT_ARROW: if (key == LEFT_ARROW_KEY) { - write(gPfd, LEFT_ARROW_KEY_CODE, sizeof(LEFT_ARROW_KEY_CODE)-1); + write(fTerminalFd, LEFT_ARROW_KEY_CODE, sizeof(LEFT_ARROW_KEY_CODE)-1); return; } break; case B_RIGHT_ARROW: if (key == RIGHT_ARROW_KEY) { - write(gPfd, RIGHT_ARROW_KEY_CODE, sizeof(RIGHT_ARROW_KEY_CODE)-1); + write(fTerminalFd, RIGHT_ARROW_KEY_CODE, sizeof(RIGHT_ARROW_KEY_CODE)-1); return; } break; @@ -1362,7 +1363,7 @@ } if (key == UP_ARROW_KEY) { - write(gPfd, UP_ARROW_KEY_CODE, sizeof(UP_ARROW_KEY_CODE)-1); + write(fTerminalFd, UP_ARROW_KEY_CODE, sizeof(UP_ARROW_KEY_CODE)-1); return; } break; @@ -1375,21 +1376,21 @@ } if (key == DOWN_ARROW_KEY) { - write(gPfd, DOWN_ARROW_KEY_CODE, sizeof(DOWN_ARROW_KEY_CODE)-1); + write(fTerminalFd, DOWN_ARROW_KEY_CODE, sizeof(DOWN_ARROW_KEY_CODE)-1); return; } break; case B_INSERT: if (key == INSERT_KEY) { - write(gPfd, INSERT_KEY_CODE, sizeof(INSERT_KEY_CODE)-1); + write(fTerminalFd, INSERT_KEY_CODE, sizeof(INSERT_KEY_CODE)-1); return; } break; case B_HOME: if (key == HOME_KEY) { - write(gPfd, HOME_KEY_CODE, sizeof(HOME_KEY_CODE)-1); + write(fTerminalFd, HOME_KEY_CODE, sizeof(HOME_KEY_CODE)-1); return; } break; @@ -1404,7 +1405,7 @@ } if (key == PAGE_UP_KEY) { - write(gPfd, PAGE_UP_KEY_CODE, sizeof(PAGE_UP_KEY_CODE)-1); + write(fTerminalFd, PAGE_UP_KEY_CODE, sizeof(PAGE_UP_KEY_CODE)-1); return; } break; @@ -1417,14 +1418,14 @@ } if (key == PAGE_DOWN_KEY) { - write(gPfd, PAGE_DOWN_KEY_CODE, sizeof(PAGE_DOWN_KEY_CODE)-1); + write(fTerminalFd, PAGE_DOWN_KEY_CODE, sizeof(PAGE_DOWN_KEY_CODE)-1); return; } break; case B_END: if (key == END_KEY) { - write(gPfd, END_KEY_CODE, sizeof(END_KEY_CODE)-1); + write(fTerminalFd, END_KEY_CODE, sizeof(END_KEY_CODE)-1); return; } break; @@ -1432,7 +1433,7 @@ case B_FUNCTION_KEY: for (c = 0; c < 12; c++) { if (key == function_keycode_table[c]) { - write(gPfd, function_key_char_table[c], 5); + write(fTerminalFd, function_key_char_table[c], 5); return; } } @@ -1447,12 +1448,12 @@ if (gNowCoding != M_UTF8) { int cnum = fCodeConv->ConvertFromInternal(bytes, numBytes, (char *)dstbuf, gNowCoding); - write(gPfd, dstbuf, cnum); + write(fTerminalFd, dstbuf, cnum); return; } } - write(gPfd, bytes, numBytes); + write(fTerminalFd, bytes, numBytes); } @@ -1534,7 +1535,7 @@ case MENU_CLEAR_ALL: DoClearAll(); - write(gPfd, ctrl_l, 1); + write(fTerminalFd, ctrl_l, 1); break; case MSGRUN_CURSOR: @@ -1726,10 +1727,10 @@ uchar *destBuffer = (uchar *)malloc(numBytes * 3); numBytes = fCodeConv->ConvertFromInternal((char*)text, numBytes, (char*)destBuffer, gNowCoding); - write(gPfd, destBuffer, numBytes); + write(fTerminalFd, destBuffer, numBytes); free(destBuffer); } else { - write(gPfd, text, numBytes); + write(fTerminalFd, text, numBytes); } } Modified: haiku/trunk/src/apps/terminal/TermView.h =================================================================== --- haiku/trunk/src/apps/terminal/TermView.h 2007-03-05 07:01:21 UTC (rev 20332) +++ haiku/trunk/src/apps/terminal/TermView.h 2007-03-05 12:48:36 UTC (rev 20333) @@ -99,7 +99,7 @@ // // Constructor, Destructor, and Initializer. // - TermView (BRect frame, CodeConv *inCodeConv); + TermView (BRect frame, CodeConv *inCodeConv, int fd); ~TermView (); // @@ -272,6 +272,7 @@ * DATA Member. */ + int fTerminalFd; // // Font and Width. // Modified: haiku/trunk/src/apps/terminal/TermWindow.cpp =================================================================== --- haiku/trunk/src/apps/terminal/TermWindow.cpp 2007-03-05 07:01:21 UTC (rev 20332) +++ haiku/trunk/src/apps/terminal/TermWindow.cpp 2007-03-05 12:48:36 UTC (rev 20333) @@ -58,9 +58,9 @@ void SetCoding(int); -TermWindow::TermWindow(BRect frame, const char* title, int gPfd) +TermWindow::TermWindow(BRect frame, const char* title, int fd) : BWindow(frame, title, B_DOCUMENT_WINDOW, B_CURRENT_WORKSPACE), - fPfd(gPfd) + fPfd(fd) { InitWindow(); @@ -115,7 +115,7 @@ textframe.top = fMenubar->Bounds().bottom + 1.0; fCodeConv = new CodeConv(); - fTermView = new TermView(Bounds(), fCodeConv); + fTermView = new TermView(Bounds(), fCodeConv, fPfd); /* * MuTerm has two views. BaseView is window base view. @@ -132,7 +132,6 @@ gTermPref->getInt32(PREF_COLS), 1); int width, height; - fTermView->GetFontSize(&width, &height); SetSizeLimits(MIN_COLS * width, MAX_COLS * width, MIN_COLS * height, MAX_COLS * height); @@ -170,11 +169,10 @@ fEditmenu->SetTargetForItems(fTermView); // Initialize TermParse - gNowCoding = longname2op(gTermPref->getString(PREF_TEXT_ENCODING)); - fTermParse = new TermParse(); - fTermParse->InitPtyReader(this); - fTermParse->InitTermParse(fTermView, fCodeConv); + fTermParse = new TermParse(fPfd, this, fTermView, fCodeConv); + if (fTermParse->StartThreads() < B_OK) + return; // Set Coding. Modified: haiku/trunk/src/apps/terminal/Terminal.cpp =================================================================== --- haiku/trunk/src/apps/terminal/Terminal.cpp 2007-03-05 07:01:21 UTC (rev 20332) +++ haiku/trunk/src/apps/terminal/Terminal.cpp 2007-03-05 12:48:36 UTC (rev 20333) @@ -33,8 +33,6 @@ #include "TermApp.h" #include "PrefHandler.h" -/* global varriables */ -int gPfd; /* pesudo tty fd */ PrefHandler *gTermPref; /* Preference temporary */ From jackburton at mail.berlios.de Mon Mar 5 14:14:12 2007 From: jackburton at mail.berlios.de (jackburton at BerliOS) Date: Mon, 5 Mar 2007 14:14:12 +0100 Subject: [Haiku-commits] r20334 - haiku/trunk/src/apps/terminal Message-ID: <200703051314.l25DEC2w022999@sheep.berlios.de> Author: jackburton Date: 2007-03-05 14:14:12 +0100 (Mon, 05 Mar 2007) New Revision: 20334 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20334&view=rev Modified: haiku/trunk/src/apps/terminal/TermParse.cpp Log: temporary reverted to using kill_thread because of a deadlock on quit Modified: haiku/trunk/src/apps/terminal/TermParse.cpp =================================================================== --- haiku/trunk/src/apps/terminal/TermParse.cpp 2007-03-05 12:48:36 UTC (rev 20333) +++ haiku/trunk/src/apps/terminal/TermParse.cpp 2007-03-05 13:14:12 UTC (rev 20334) @@ -78,8 +78,11 @@ delete_sem(fReaderLocker); status_t dummy; - wait_for_thread(fParseThread, &dummy); - wait_for_thread(fReaderThread, &dummy); + kill_thread(fParseThread); + kill_thread(fReaderThread); + //wait_for_thread(fReaderThread, &dummy); + //wait_for_thread(fParseThread, &dummy); + // } From jackburton at mail.berlios.de Mon Mar 5 15:59:37 2007 From: jackburton at mail.berlios.de (jackburton at BerliOS) Date: Mon, 5 Mar 2007 15:59:37 +0100 Subject: [Haiku-commits] r20335 - haiku/trunk/src/apps/terminal Message-ID: <200703051459.l25ExbeW009384@sheep.berlios.de> Author: jackburton Date: 2007-03-05 15:59:37 +0100 (Mon, 05 Mar 2007) New Revision: 20335 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20335&view=rev Modified: haiku/trunk/src/apps/terminal/TermApp.cpp haiku/trunk/src/apps/terminal/TermParse.cpp haiku/trunk/src/apps/terminal/TermWindow.cpp Log: Re-enabled wait_for_thread() (in place of kill_thread()) inside TermParse's destructor. PtyReader() was hanging on read(), since the fd was never closed. Now we do that in ~TermWindow() (for now, we might want to move some stuff around). Moved there the cleanup code too (from TermWindow::Quit()). Use B_QUIT_ON_WINDOW_CLOSE flag instead of sending a message to be_app in Quit(). Modified: haiku/trunk/src/apps/terminal/TermApp.cpp =================================================================== --- haiku/trunk/src/apps/terminal/TermApp.cpp 2007-03-05 13:14:12 UTC (rev 20334) +++ haiku/trunk/src/apps/terminal/TermApp.cpp 2007-03-05 14:59:37 UTC (rev 20335) @@ -148,10 +148,10 @@ "\tupdated by Kian Duffy and others\n\n" "\tCopyright " B_UTF8_COPYRIGHT "2003-2005, Haiku.\n", "Ok"); BTextView *view = alert->TextView(); - BFont font; - + view->SetStylable(true); + BFont font; view->GetFont(&font); font.SetSize(18); font.SetFace(B_BOLD_FACE); Modified: haiku/trunk/src/apps/terminal/TermParse.cpp =================================================================== --- haiku/trunk/src/apps/terminal/TermParse.cpp 2007-03-05 13:14:12 UTC (rev 20334) +++ haiku/trunk/src/apps/terminal/TermParse.cpp 2007-03-05 14:59:37 UTC (rev 20335) @@ -78,11 +78,8 @@ delete_sem(fReaderLocker); status_t dummy; - kill_thread(fParseThread); - kill_thread(fReaderThread); - //wait_for_thread(fReaderThread, &dummy); - //wait_for_thread(fParseThread, &dummy); - // + wait_for_thread(fReaderThread, &dummy); + wait_for_thread(fParseThread, &dummy); } Modified: haiku/trunk/src/apps/terminal/TermWindow.cpp =================================================================== --- haiku/trunk/src/apps/terminal/TermWindow.cpp 2007-03-05 13:14:12 UTC (rev 20334) +++ haiku/trunk/src/apps/terminal/TermWindow.cpp 2007-03-05 14:59:37 UTC (rev 20335) @@ -59,7 +59,7 @@ TermWindow::TermWindow(BRect frame, const char* title, int fd) - : BWindow(frame, title, B_DOCUMENT_WINDOW, B_CURRENT_WORKSPACE), + : BWindow(frame, title, B_DOCUMENT_WINDOW, B_CURRENT_WORKSPACE|B_QUIT_ON_WINDOW_CLOSE), fPfd(fd) { InitWindow(); @@ -72,6 +72,17 @@ TermWindow::~TermWindow() { + close(fPfd); + delete fTermParse; + delete fCodeConv; + if (fPrefWindow) + fPrefWindow->PostMessage(B_QUIT_REQUESTED); + + if (fFindPanel && fFindPanel->Lock()) { + fFindPanel->Quit(); + fFindPanel = NULL; + } + delete fWindowUpdate; } @@ -603,27 +614,17 @@ void TermWindow::Quit() { - delete fTermParse; - delete fCodeConv; - if (fPrefWindow) - fPrefWindow->PostMessage(B_QUIT_REQUESTED); - - if (fFindPanel && fFindPanel->Lock()) { - fFindPanel->Quit(); - fFindPanel = NULL; - } - - be_app->PostMessage(B_QUIT_REQUESTED, be_app); - BWindow::Quit (); + BWindow::Quit(); } bool TermWindow::QuitRequested(void) { - - return true; + return BWindow::QuitRequested(); } + + //////////////////////////////////////////////////////////////////////////// // int GetTimeZone (void) // Get Machine Timezone. From kaoutsis at sch.gr Mon Mar 5 16:26:51 2007 From: kaoutsis at sch.gr (Kaoutsis) Date: Mon, 05 Mar 2007 17:26:51 +0200 EET Subject: [Haiku-commits] r20333 - haiku/trunk/src/apps/terminal In-Reply-To: <200703051248.l25Cmb7H019694@sheep.berlios.de> Message-ID: <733251841-BeMail@> jackburton at BerliOS> Author: jackburton > Date: 2007-03-05 13:48:36 +0100 (Mon, 05 Mar 2007) > New Revision: 20333 > ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20333&view=rev > > Removed: > haiku/trunk/src/apps/terminal/TermPrint.cpp > Modified: > haiku/trunk/src/apps/terminal/TermApp.cpp > haiku/trunk/src/apps/terminal/TermParse.cpp > haiku/trunk/src/apps/terminal/TermParse.h > haiku/trunk/src/apps/terminal/TermView.cpp > haiku/trunk/src/apps/terminal/TermView.h > haiku/trunk/src/apps/terminal/TermWindow.cpp > haiku/trunk/src/apps/terminal/Terminal.cpp > Log: > Got rid of the global gPfd variable. Very nice! It's my turn to say thanks. > Big time cleanup, made TermParse a > bit more robust with error checks and likes. Removed unused > TermPrint.cpp file. I hope I didn't get on your > way, Vasilis :) Not at all, the journey is going on. Bye, Vasilis Kaoutsis From axeld at mail.berlios.de Mon Mar 5 18:06:28 2007 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Mon, 5 Mar 2007 18:06:28 +0100 Subject: [Haiku-commits] r20336 - in haiku/trunk: headers/private/graphics/radeon src/add-ons/kernel/drivers/graphics/radeon Message-ID: <200703051706.l25H6S90020158@sheep.berlios.de> Author: axeld Date: 2007-03-05 18:06:27 +0100 (Mon, 05 Mar 2007) New Revision: 20336 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20336&view=rev Modified: haiku/trunk/headers/private/graphics/radeon/version.h haiku/trunk/src/add-ons/kernel/drivers/graphics/radeon/agp.c haiku/trunk/src/add-ons/kernel/drivers/graphics/radeon/driver.c haiku/trunk/src/add-ons/kernel/drivers/graphics/radeon/global_data.c haiku/trunk/src/add-ons/kernel/drivers/graphics/radeon/init.c haiku/trunk/src/add-ons/kernel/drivers/graphics/radeon/mem_controller.c haiku/trunk/src/add-ons/kernel/drivers/graphics/radeon/radeon_driver.h Log: Patch by Euan Kirkhope: * Use AGP Bus manager module * Fixed wrong framebuffer address computation; this should fix bug #1079. Modified: haiku/trunk/headers/private/graphics/radeon/version.h =================================================================== --- haiku/trunk/headers/private/graphics/radeon/version.h 2007-03-05 14:59:37 UTC (rev 20335) +++ haiku/trunk/headers/private/graphics/radeon/version.h 2007-03-05 17:06:27 UTC (rev 20336) @@ -8,4 +8,4 @@ */ // current version -#define RADEON_DRIVER_VERSION "Version: 5.1.5.0" +#define RADEON_DRIVER_VERSION "Version: 5.1.6.0" Modified: haiku/trunk/src/add-ons/kernel/drivers/graphics/radeon/agp.c =================================================================== --- haiku/trunk/src/add-ons/kernel/drivers/graphics/radeon/agp.c 2007-03-05 14:59:37 UTC (rev 20335) +++ haiku/trunk/src/add-ons/kernel/drivers/graphics/radeon/agp.c 2007-03-05 17:06:27 UTC (rev 20336) @@ -7,223 +7,184 @@ AGP fix. Some motherboard BIOSes enable FastWrite even though the graphics card doesn't support it. Here, we'll fix that (hopefully it is generic enough). + + updated to use AGP_BUS mananager */ #include "radeon_driver.h" +static void agp_list_info(agp_info ai); +static void agp_list_active(uint32 cmd); -// missing PCI definitions -#define PCI_status_cap_list 0x10 /* Support Capability List */ +// fix invalid AGP settings +void Radeon_Set_AGP( device_info *di, bool enable_agp ) +{ + uint8 agp_index = 0; + agp_info nth_agp_info; + bool found = false; + uint32 agp_cmd; -#define PCI_header_type_normal 0 -#define PCI_header_type_bridge 1 -#define PCI_header_type_cardbus 2 + /* abort if no agp busmanager found */ + if (!agp_bus) + { + SHOW_INFO0(1, "Busmanager not installed.\nWarning Card May hang if AGP Fastwrites are Enabled." ); + return; + } -#define PCI_capability_list 0x34 /* Offset of first capability list entry */ -#define PCI_cb_capability_list 0x14 + /* contact driver and get a pointer to the registers and shared data */ + /* get nth AGP device info */ + while((*agp_bus->get_nth_agp_info)(agp_index, &nth_agp_info) == B_NO_ERROR) { + + /* see if we are this one */ + if ((nth_agp_info.device_id == di->pcii.device_id) && + (nth_agp_info.vendor_id == di->pcii.vendor_id) && + (nth_agp_info.bus == di->pcii.bus) && + (nth_agp_info.device == di->pcii.device) && + (nth_agp_info.function == di->pcii.function)) + { + SHOW_INFO0(1, "Found AGP capable device" ); + found = true; -#define PCI_cap_list_id 0 /* Capability ID */ -#define PCI_cap_id_pm 0x01 /* Power Management */ -#define PCI_cap_id_agp 0x02 /* Accelerated Graphics Port */ -#define PCI_cap_id_vpd 0x03 /* Vital Product Data */ -#define PCI_cap_id_slotid 0x04 /* Slot Identification */ -#define PCI_cap_id_msi 0x05 /* Message Signalled Interrupts */ -#define PCI_cap_id_chswp 0x06 /* CompactPCI HotSwap */ -#define PCI_cap_list_next 1 /* Next capability in the list */ -#define PCI_cap_flags 2 /* Capability defined flags (16 bits) */ -#define PCI_cap_sizeof 4 + /* remember our info */ + di->agpi = nth_agp_info; + + /* log capabilities */ + agp_list_info(nth_agp_info); + break; -#define PCI_agp_status 4 /* Status register */ -#define PCI_agp_status_rq_mask 0xff000000 /* Maximum number of requests - 1 */ -#define PCI_agp_status_rq_shift 24 -#define PCI_agp_status_sba 0x0200 /* Sideband addressing supported */ -#define PCI_agp_status_64bit 0x0020 /* 64-bit addressing supported */ -#define PCI_agp_status_fw 0x0010 /* FW transfers supported */ -#define PCI_agp_status_rate4 0x0004 /* 4x transfer rate supported */ -#define PCI_agp_status_rate2 0x0002 /* 2x transfer rate supported */ -#define PCI_agp_status_rate1 0x0001 /* 1x transfer rate supported */ + } -#define PCI_agp_command 8 /* Control register */ -#define PCI_agp_command_rq_mask 0xff000000 /* Master: Maximum number of requests */ -#define PCI_agp_command_rq_shift 24 -#define PCI_agp_command_sba 0x0200 /* Sideband addressing enabled */ -#define PCI_agp_command_agp 0x0100 /* Allow processing of AGP transactions */ -#define PCI_agp_command_64bit 0x0020 /* Allow processing of 64-bit addresses */ -#define PCI_agp_command_fw 0x0010 /* Force FW transfers */ -#define PCI_agp_command_rate4 0x0004 /* Use 4x rate */ -#define PCI_agp_command_rate2 0x0002 /* Use 2x rate */ -#define PCI_agp_command_rate1 0x0001 /* Use 1x rate */ + agp_index++; + } + if (!found) { + if (agp_index != 0) { + SHOW_INFO0(1, "End of AGP capable devices list."); + } else { + SHOW_INFO0(1, "No AGP capable devices found."); + } + return; + } + if (di->settings.force_pci | !enable_agp) { -// helper macros for easier PCI access -#define get_pci(o, s) (*pci_bus->read_pci_config)(pcii->bus, pcii->device, pcii->function, (o), (s)) -#define set_pci(o, s, v) (*pci_bus->write_pci_config)(pcii->bus, pcii->device, pcii->function, (o), (s), (v)) + SHOW_INFO0(1, "Disabling AGP mode..."); + /* we want zero agp features enabled */ + agp_cmd = 0; -// show AGP capabilities -static void show_agp_status( uint32 status ) -{ - SHOW_FLOW( 3, "Status (%08lx): Max Queue Depth=%ld %s%s%s%s%s%s", status, - (status & PCI_agp_status_rq_mask) >> PCI_agp_status_rq_shift, - (status & PCI_agp_status_sba) != 0 ? "Sideband addressing " : "", - (status & PCI_agp_status_64bit) != 0 ? "64-bit " : "", - (status & PCI_agp_status_fw) != 0 ? "FastWrite " : "", - (status & PCI_agp_status_rate4) != 0 ? "4x " : "", - (status & PCI_agp_status_rate2) != 0 ? "2x " : "", - (status & PCI_agp_status_rate1) != 0 ? "1x " : "" ); -} + /* write the stuff */ + (*agp_bus->enable_agp)(&agp_cmd); + } else { + /* activate AGP mode */ + SHOW_INFO0(1, "Activating AGP mode..."); + agp_cmd = 0xfffffff7; + /* set agp 3 speed bit is agp is v3 */ + if (nth_agp_info.interface.agp_stat & AGP_rate_rev) agp_cmd |= AGP_rate_rev; -// show AGP settings -static void show_agp_command( uint32 command ) -{ - SHOW_FLOW( 3, "Command (%08lx): Queue Depth=%ld %s%s%s%s%s%s%s", command, - (command & PCI_agp_command_rq_mask) >> PCI_agp_command_rq_shift, - (command & PCI_agp_command_sba) != 0 ? "Sideband addressing " : "", - (command & PCI_agp_command_agp) != 0 ? "AGP-Enabled " : "AGP-Disabled ", - (command & PCI_agp_command_64bit) != 0 ? "64-bit " : "", - (command & PCI_agp_command_fw) != 0 ? "FastWrite " : "", - (command & PCI_agp_command_rate4) != 0 ? "4x " : "", - (command & PCI_agp_command_rate2) != 0 ? "2x " : "", - (command & PCI_agp_command_rate1) != 0 ? "1x " : "" ); -} + /* we want to perma disable fastwrites as they're evil, evil i say */ + agp_cmd &= ~AGP_FW; + /* write the stuff */ + (*agp_bus->enable_agp)(&agp_cmd); + } -// find PCI capability -int find_capability( pci_info *pcii, uint8 capability ) -{ - int try_count; - uint16 status; - uint8 pos; + /* list mode now activated, + * make sure we have the correct speed scheme for logging */ + agp_list_active(nth_agp_info.interface.agp_cmd | + (nth_agp_info.interface.agp_stat & AGP_rate_rev)); - // check whether PCI capabilities are supported at all - status = get_pci( PCI_status, 2 ); - - if( (status & PCI_status_cap_list) == 0 ) - return B_NAME_NOT_FOUND; - - SHOW_FLOW0( 3, "Device supports capabilities" ); - - // get offset of first capability in list - switch( pcii->header_type & PCI_header_type_mask ) { - case PCI_header_type_normal: - case PCI_header_type_bridge: - pos = get_pci( PCI_capability_list, 1 ); - break; - case PCI_header_type_cardbus: - pos = get_pci( PCI_cb_capability_list, 1 ); - break; - default: - SHOW_FLOW( 3, "Unknown type (%x)", pcii->header_type & PCI_header_type_mask ); - return B_ERROR; - } - - // search for whished capability in linked list - for( try_count = 48; try_count > 0 && pos >= 0x40; --try_count ) { - uint8 id; - - pos &= ~3; - - id = get_pci( pos + PCI_cap_list_id, 1 ); - if( id == 0xff ) - return B_NAME_NOT_FOUND; - - if( id == capability ) { - SHOW_FLOW( 3, "Found capability %d", capability ); - return pos; - } - - SHOW_FLOW( 3, "Ignored capability %d", id ); - - pos = get_pci( pos + PCI_cap_list_next, 1 ); - } - - return B_NAME_NOT_FOUND; } - -// fix invalid AGP settings -void Radeon_Fix_AGP(void) +static void agp_list_info(agp_info ai) { - long pci_index; - pci_info pci_data, *pcii; - - // start with all features enabled, queue depth bits must be 0 - uint32 common_caps = - PCI_agp_status_sba | PCI_agp_status_64bit | PCI_agp_status_fw | - PCI_agp_status_rate4 | PCI_agp_status_rate2 | PCI_agp_status_rate1; - uint32 read_queue_depth = PCI_agp_status_rq_mask; - - SHOW_FLOW0( 4, "Composing common feature list" ); - - // only required to make get_pci/set_pci working - pcii = &pci_data; + /* + list device + */ + if (ai.class_base == PCI_display) { + SHOW_INFO(4, "Device is a graphics card, subclass ID is $%02x", ai.class_sub); + } else { + SHOW_INFO(4, "Device is a hostbridge, subclass ID is $%02x", ai.class_sub); + } - // find common feature set - for( pci_index = 0; - (*pci_bus->get_nth_pci_info)(pci_index, &pci_data) == B_NO_ERROR; - ++pci_index ) - { - int offset; + SHOW_INFO(4, "Vendor ID $%04x", ai.vendor_id); + SHOW_INFO(4, "Device ID $%04x", ai.device_id); + SHOW_INFO(4, "Bus %d, device %d, function %d", ai.bus, ai.device, ai.function); - /*SHOW_FLOW( 3, "Checking bus %d, device %d, function %d (vendor_id=%04x, device_id=%04x):", - pcii->bus, pcii->device, pcii->function, - pcii->vendor_id, pcii->device_id );*/ - - offset = find_capability( pcii, PCI_cap_id_agp ); - - if( offset > 0 ) { - uint32 agp_status, agp_command; - - agp_status = get_pci( offset + PCI_agp_status, 4 ); - agp_command = get_pci( offset + PCI_agp_command, 4 ); - - SHOW_FLOW( 3, "bus %d, device %d, function %d (vendor_id=%04x, device_id=%04x):", - pcii->bus, pcii->device, pcii->function, - pcii->vendor_id, pcii->device_id ); - show_agp_status( agp_status ); - show_agp_command( agp_command ); - - common_caps &= agp_status; - read_queue_depth = min( read_queue_depth, agp_status & PCI_agp_status_rq_mask ); - } + /* + list capabilities + */ + SHOW_INFO(4, "This device supports AGP specification %ld.%ld;", + ((ai.interface.agp_cap_id & AGP_rev_major) >> AGP_rev_major_shift), + ((ai.interface.agp_cap_id & AGP_rev_minor) >> AGP_rev_minor_shift)); + + /* the AGP devices determine AGP speed scheme version used on power-up/reset */ + if (!(ai.interface.agp_stat & AGP_rate_rev)) + { + /* AGP 2.0 scheme applies */ + if (ai.interface.agp_stat & AGP_2_1x) + SHOW_INFO0(4, "AGP 2.0 1x mode is available"); + if (ai.interface.agp_stat & AGP_2_2x) + SHOW_INFO0(4, "AGP 2.0 2x mode is available"); + if (ai.interface.agp_stat & AGP_2_4x) + SHOW_INFO0(41, "AGP 2.0 4x mode is available"); } + else + { + /* AGP 3.0 scheme applies */ + if (ai.interface.agp_stat & AGP_3_4x) + SHOW_INFO0(4, "AGP 3.0 4x mode is available"); + if (ai.interface.agp_stat & AGP_3_8x) + SHOW_INFO0(4, "AGP 3.0 8x mode is available"); + } - // explicitely enable AGP - it's not part of status register - common_caps |= PCI_agp_command_agp; - - // choose fastest transmission speed and disable lower ones - if( (common_caps & PCI_agp_status_rate4) != 0 ) - common_caps &= ~(PCI_agp_status_rate2 | PCI_agp_status_rate1); - else if( (common_caps & PCI_agp_status_rate2) != 0 ) - common_caps &= ~PCI_agp_status_rate1; - else if( (common_caps & PCI_agp_status_rate1) == 0 ) - // no speed found - disable AGP - common_caps &= ~PCI_agp_command_agp; + if (ai.interface.agp_stat & AGP_FW) SHOW_INFO0(4, "Fastwrite transfers are supported"); + if (ai.interface.agp_stat & AGP_SBA) SHOW_INFO0(4, "Sideband adressing is supported"); - common_caps |= read_queue_depth; + SHOW_INFO(1, "%ld queued AGP requests can be handled.", + ((ai.interface.agp_stat & AGP_RQ) >> AGP_RQ_shift) + 1); - SHOW_FLOW0( 3, "Combined:" ); - show_agp_command( common_caps ); + /* + list current settings, + make sure we have the correct speed scheme for logging + */ + agp_list_active(ai.interface.agp_cmd | (ai.interface.agp_stat & AGP_rate_rev)); +} - // choose features that all devices support - for( pci_index = 0; - (*pci_bus->get_nth_pci_info)(pci_index, &pci_data) == B_NO_ERROR; - ++pci_index ) - { - int offset; - - offset = find_capability( pcii, PCI_cap_id_agp ); - - if( offset > 0 ) { - SHOW_FLOW( 3, "Modifying bus %d, device %d, function %d (vendor_id=%04x, device_id=%04x):", - pcii->bus, pcii->device, pcii->function, - pcii->vendor_id, pcii->device_id ); - - set_pci( offset + PCI_agp_command, 4, common_caps ); - } +static void agp_list_active(uint32 cmd) +{ + SHOW_INFO0(4, "listing settings now in use:"); + if (!(cmd & AGP_rate_rev)) { + /* AGP 2.0 scheme applies */ + if (cmd & AGP_2_1x) + SHOW_INFO0(2,"AGP 2.0 1x mode is set"); + if (cmd & AGP_2_2x) + SHOW_INFO0(2,"AGP 2.0 2x mode is set"); + if (cmd & AGP_2_4x) + SHOW_INFO0(2,"AGP 2.0 4x mode is set"); + } else { + /* AGP 3.0 scheme applies */ + if (cmd & AGP_3_4x) + SHOW_INFO0(2,"AGP 3.0 4x mode is set"); + if (cmd & AGP_3_8x) + SHOW_INFO0(2,"AGP 3.0 8x mode is set"); } + + if (cmd & AGP_FW) { + SHOW_INFO0(2, "Fastwrite transfers are enabled"); + } else { + SHOW_INFO0(2, "Fastwrite transfers are disabled"); + } + if (cmd & AGP_SBA) SHOW_INFO0(4, "Sideband adressing is enabled"); + + SHOW_INFO(4, "Max. AGP queued request depth is set to %ld", + (((cmd & AGP_RQ) >> AGP_RQ_shift) + 1)); + + if (cmd & AGP_enable) + SHOW_INFO0(2, "The AGP interface is enabled."); + else + SHOW_INFO0(2, "The AGP interface is disabled."); } Modified: haiku/trunk/src/add-ons/kernel/drivers/graphics/radeon/driver.c =================================================================== --- haiku/trunk/src/add-ons/kernel/drivers/graphics/radeon/driver.c 2007-03-05 14:59:37 UTC (rev 20335) +++ haiku/trunk/src/add-ons/kernel/drivers/graphics/radeon/driver.c 2007-03-05 17:06:27 UTC (rev 20336) @@ -148,6 +148,9 @@ if( get_module(B_PCI_MODULE_NAME, (module_info **)&pci_bus) != B_OK ) return B_ERROR; + /* get a handle for the agp bus if it exists */ + get_module(B_AGP_MODULE_NAME, (module_info **)&agp_bus); + /* driver private data */ devices = (radeon_devices *)calloc( 1, sizeof( radeon_devices )); if( devices == NULL ) { @@ -173,6 +176,8 @@ devices = NULL; put_module( B_PCI_MODULE_NAME ); + /* put the agp module away if it's there */ + if (agp_bus) put_module(B_AGP_MODULE_NAME); } Modified: haiku/trunk/src/add-ons/kernel/drivers/graphics/radeon/global_data.c =================================================================== --- haiku/trunk/src/add-ons/kernel/drivers/graphics/radeon/global_data.c 2007-03-05 14:59:37 UTC (rev 20335) +++ haiku/trunk/src/add-ons/kernel/drivers/graphics/radeon/global_data.c 2007-03-05 17:06:27 UTC (rev 20336) @@ -16,3 +16,4 @@ radeon_devices *devices; pci_module_info *pci_bus; +agp_module_info *agp_bus; Modified: haiku/trunk/src/add-ons/kernel/drivers/graphics/radeon/init.c =================================================================== --- haiku/trunk/src/add-ons/kernel/drivers/graphics/radeon/init.c 2007-03-05 14:59:37 UTC (rev 20335) +++ haiku/trunk/src/add-ons/kernel/drivers/graphics/radeon/init.c 2007-03-05 17:06:27 UTC (rev 20336) @@ -374,8 +374,7 @@ di->memmgr[mt_AGP] = NULL; // fix AGP settings for IGP chipset - if( di->asic == rt_rs100 || di->asic == rt_rs200 || di->asic == rt_rs300) - Radeon_Fix_AGP(); + Radeon_Set_AGP( di, !di->settings.force_pci ); // disable AGP if ( di->acc_dma ) { Modified: haiku/trunk/src/add-ons/kernel/drivers/graphics/radeon/mem_controller.c =================================================================== --- haiku/trunk/src/add-ons/kernel/drivers/graphics/radeon/mem_controller.c 2007-03-05 14:59:37 UTC (rev 20335) +++ haiku/trunk/src/add-ons/kernel/drivers/graphics/radeon/mem_controller.c 2007-03-05 17:06:27 UTC (rev 20336) @@ -39,7 +39,6 @@ static void Radeon_SetupMCAddresses_Direct( device_info *di ) { shared_info *si = di->si; - uint32 mc_fb_location; uint32 aper0 = INREG( di->regs, RADEON_CONFIG_APER_0_BASE ); // bug in asics mean memory must be aligned to memory size... @@ -47,13 +46,9 @@ aper0 &= ~( di->local_mem_size - 1 ); } - mc_fb_location = ( aper0 >> 16 ) || - (aper0 + di->local_mem_size - 1 ) & 0xffff0000; - - // set address range of video memory; // use the same addresses the CPU sees - si->memory[mt_local].virtual_addr_start = mc_fb_location; + si->memory[mt_local].virtual_addr_start = aper0; si->memory[mt_local].virtual_size = di->local_mem_size; // PCI GART has no corresponding CPU address space, so we must find an unused Modified: haiku/trunk/src/add-ons/kernel/drivers/graphics/radeon/radeon_driver.h =================================================================== --- haiku/trunk/src/add-ons/kernel/drivers/graphics/radeon/radeon_driver.h 2007-03-05 14:59:37 UTC (rev 20335) +++ haiku/trunk/src/add-ons/kernel/drivers/graphics/radeon/radeon_driver.h 2007-03-05 17:06:27 UTC (rev 20336) @@ -158,6 +158,7 @@ radeon_settings settings; // overrides read from radeon.settings pci_info pcii; + agp_info agpi; char name[MAX_RADEON_DEVICE_NAME_LENGTH]; char video_name[MAX_RADEON_DEVICE_NAME_LENGTH]; } device_info; @@ -174,6 +175,7 @@ extern pci_module_info *pci_bus; +extern agp_module_info *agp_bus; extern radeon_devices *devices; @@ -206,7 +208,7 @@ // agp.c -void Radeon_Fix_AGP(void); +void Radeon_Set_AGP( device_info *di, bool enable_agp ); // mem_controller.c From axeld at mail.berlios.de Mon Mar 5 19:22:40 2007 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Mon, 5 Mar 2007 19:22:40 +0100 Subject: [Haiku-commits] r20337 - haiku/trunk/src/tests/add-ons/kernel/file_systems/bfs/r5 Message-ID: <200703051822.l25IMefd003411@sheep.berlios.de> Author: axeld Date: 2007-03-05 19:22:40 +0100 (Mon, 05 Mar 2007) New Revision: 20337 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20337&view=rev Modified: haiku/trunk/src/tests/add-ons/kernel/file_systems/bfs/r5/Query.cpp haiku/trunk/src/tests/add-ons/kernel/file_systems/bfs/r5/fsproto.h Log: Build fix for r20329 - the R5 version of BFS did not include a send_notification() prototype (and still doesn't include notify_listener(), which should be fixed at some point, too). Modified: haiku/trunk/src/tests/add-ons/kernel/file_systems/bfs/r5/Query.cpp =================================================================== --- haiku/trunk/src/tests/add-ons/kernel/file_systems/bfs/r5/Query.cpp 2007-03-05 17:06:27 UTC (rev 20336) +++ haiku/trunk/src/tests/add-ons/kernel/file_systems/bfs/r5/Query.cpp 2007-03-05 18:22:40 UTC (rev 20337) @@ -1,12 +1,12 @@ /* Query - query parsing and evaluation -** -** Copyright 2001-2004, Axel D?rfler, axeld at pinc-software.de -** The pattern matching is roughly based on code originally written -** by J. Kercheval, and on code written by Kenneth Almquist, though -** it shares no code. -** -** This file may be used under the terms of the OpenBeOS License. -*/ + * + * The pattern matching is roughly based on code originally written + * by J. Kercheval, and on code written by Kenneth Almquist, though + * it shares no code. + * + * Copyright 2001-2007, Axel D?rfler, axeld at pinc-software.de. + * This file may be used under the terms of the MIT License. + */ #include "Query.h" @@ -18,6 +18,8 @@ #include "BPlusTree.h" #include "Index.h" +#include "fsproto.h" + #include #include #include Modified: haiku/trunk/src/tests/add-ons/kernel/file_systems/bfs/r5/fsproto.h =================================================================== --- haiku/trunk/src/tests/add-ons/kernel/file_systems/bfs/r5/fsproto.h 2007-03-05 17:06:27 UTC (rev 20336) +++ haiku/trunk/src/tests/add-ons/kernel/file_systems/bfs/r5/fsproto.h 2007-03-05 18:22:40 UTC (rev 20337) @@ -234,6 +234,11 @@ extern _IMPEXP_KERNEL void notify_select_event(selectsync *sync, uint32 ref); extern _IMPEXP_KERNEL status_t is_vnode_removed(nspace_id nsid, vnode_id vnid); +extern _IMPEXP_KERNEL status_t send_notification(port_id port, long token, + ulong what, long op, nspace_id device, nspace_id toDevice, + vnode_id parentNode, vnode_id toParentNode, vnode_id node, + const char *name); + // The missing prototypes can be found in the fs_interface.h file. // That part of the VFS is still compatible with BeOS :) From bonefish at cs.tu-berlin.de Mon Mar 5 19:50:29 2007 From: bonefish at cs.tu-berlin.de (Ingo Weinhold) Date: Mon, 05 Mar 2007 19:50:29 +0100 Subject: [Haiku-commits] r20337 - haiku/trunk/src/tests/add-ons/kernel/file_systems/bfs/r5 In-Reply-To: <200703051822.l25IMefd003411@sheep.berlios.de> References: <200703051822.l25IMefd003411@sheep.berlios.de> Message-ID: <20070305195029.11776.4@cs.tu-berlin.de> On 2007-03-05 at 19:22:40 [+0100], axeld at BerliOS wrote: > Author: axeld > Date: 2007-03-05 19:22:40 +0100 (Mon, 05 Mar 2007) > New Revision: 20337 > ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20337&view=rev > > Modified: > haiku/trunk/src/tests/add-ons/kernel/file_systems/bfs/r5/Query.cpp > haiku/trunk/src/tests/add-ons/kernel/file_systems/bfs/r5/fsproto.h > Log: > Build fix for r20329 - the R5 version of BFS did not include a > send_notification() prototype (and still doesn't include notify_listener(), > which should be fixed at some point, too). The main problem is Volume.h including which is definitely incorrect (not sure, why the pre-processor finds it at all). It should include the local "fsproto.h" instead which, as you say, should define notify_listener(), too. CU, Ingo From axeld at pinc-software.de Mon Mar 5 21:11:48 2007 From: axeld at pinc-software.de (Axel =?iso-8859-15?q?D=F6rfler?=) Date: Mon, 05 Mar 2007 21:11:48 +0100 CET Subject: [Haiku-commits] r20337 - haiku/trunk/src/tests/add-ons/kernel/file_systems/bfs/r5 In-Reply-To: <20070305195029.11776.4@cs.tu-berlin.de> Message-ID: <29790914725-BeMail@zon> Ingo Weinhold wrote: > > Log: > > Build fix for r20329 - the R5 version of BFS did not include a > > send_notification() prototype (and still doesn't include > > notify_listener(), > > which should be fixed at some point, too). > The main problem is Volume.h including which is > definitely > incorrect (not sure, why the pre-processor finds it at all). It > should > include the local "fsproto.h" instead which, as you say, should > define > notify_listener(), too. Indeed, I was too lazy to figure that out (ie. I didn't have much time) :-) Bye, Axel. From axeld at mail.berlios.de Mon Mar 5 22:16:21 2007 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Mon, 5 Mar 2007 22:16:21 +0100 Subject: [Haiku-commits] r20338 - in haiku/trunk: headers/private/graphics/radeon src/add-ons/media/media-add-ons/radeon Message-ID: <200703052116.l25LGLSG014966@sheep.berlios.de> Author: axeld Date: 2007-03-05 22:16:15 +0100 (Mon, 05 Mar 2007) New Revision: 20338 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20338&view=rev Added: haiku/trunk/src/add-ons/media/media-add-ons/radeon/Theater100.cpp haiku/trunk/src/add-ons/media/media-add-ons/radeon/Theater100.h haiku/trunk/src/add-ons/media/media-add-ons/radeon/Theater200.cpp haiku/trunk/src/add-ons/media/media-add-ons/radeon/Theater200.h Modified: haiku/trunk/headers/private/graphics/radeon/radeon_interface.h haiku/trunk/src/add-ons/media/media-add-ons/radeon/I2CPort.cpp haiku/trunk/src/add-ons/media/media-add-ons/radeon/I2CPort.h haiku/trunk/src/add-ons/media/media-add-ons/radeon/Jamfile haiku/trunk/src/add-ons/media/media-add-ons/radeon/Radeon.cpp haiku/trunk/src/add-ons/media/media-add-ons/radeon/Radeon.h haiku/trunk/src/add-ons/media/media-add-ons/radeon/RadeonAddOn.cpp haiku/trunk/src/add-ons/media/media-add-ons/radeon/RadeonProducer.cpp haiku/trunk/src/add-ons/media/media-add-ons/radeon/RadeonProducer.h haiku/trunk/src/add-ons/media/media-add-ons/radeon/Theater.cpp haiku/trunk/src/add-ons/media/media-add-ons/radeon/Theater.h haiku/trunk/src/add-ons/media/media-add-ons/radeon/TheatreReg.h haiku/trunk/src/add-ons/media/media-add-ons/radeon/VIPPort.h haiku/trunk/src/add-ons/media/media-add-ons/radeon/VideoIn.cpp haiku/trunk/src/add-ons/media/media-add-ons/radeon/VideoIn.h haiku/trunk/src/add-ons/media/media-add-ons/radeon/yuv_converter.h Log: Patch by Euan Kirkhope: * Initial support for Rage Theatre 200. Modified: haiku/trunk/headers/private/graphics/radeon/radeon_interface.h =================================================================== --- haiku/trunk/headers/private/graphics/radeon/radeon_interface.h 2007-03-05 18:22:40 UTC (rev 20337) +++ haiku/trunk/headers/private/graphics/radeon/radeon_interface.h 2007-03-05 21:16:15 UTC (rev 20338) @@ -20,6 +20,7 @@ #include "ddc.h" // magic code for ioctls +// changed from TKRA to TKR1 for RADEON_WAITFORFIFO ioctl // changed from TKRA to TKR2 for VIP FIFO ioctls #define RADEON_PRIVATE_DATA_MAGIC 'TKR2' Modified: haiku/trunk/src/add-ons/media/media-add-ons/radeon/I2CPort.cpp =================================================================== --- haiku/trunk/src/add-ons/media/media-add-ons/radeon/I2CPort.cpp 2007-03-05 18:22:40 UTC (rev 20337) +++ haiku/trunk/src/add-ons/media/media-add-ons/radeon/I2CPort.cpp 2007-03-05 21:16:15 UTC (rev 20338) @@ -15,15 +15,25 @@ : fRadeon(radeon), fNfactor(0), fMfactor(0), - fTimeLimit(0) + fTimeLimit(0), + si(NULL) { + PRINT(("CI2CPort::CI2CPort()\n")); if( fRadeon.InitCheck() == B_OK ) { int refFreq, refDiv, minFreq, maxFreq, xclock; + double n; + fRadeon.GetPLLParameters(refFreq, refDiv, minFreq, maxFreq, xclock); - - double n = (xclock * 10000.0) / (4.0 * rate); + si = fRadeon.GetSharedInfo(); + + if ( si->asic == rt_rv200 ) { + n = (xclock * 40000.0) / (1.0 * rate); + } else { + n = (xclock * 10000.0) / (4.0 * rate); + } + for (fNfactor = 1; fNfactor < 255; fNfactor++) { if (fNfactor * (fNfactor - 1) > n) break; @@ -62,7 +72,17 @@ status_t CI2CPort::InitCheck() const { - return fRadeon.InitCheck(); + if (fRadeon.InitCheck() != B_OK) + return B_ERROR; + + if ( si == NULL ) + return B_ERROR; + + if ( si->has_no_i2c ) { + PRINT(("This Chips I2C is BLACKLISTED!")); + return B_ERROR; + } + return B_OK; } CRadeon & CI2CPort::Radeon() const @@ -132,16 +152,22 @@ C_RADEON_I2C_HALT | C_RADEON_I2C_SOFT_RST); // write address - fRadeon.SetRegister(C_RADEON_I2C_DATA, address & 0xfffffffe); + fRadeon.SetRegister(C_RADEON_I2C_DATA, address & ~(1)); // write data for (int offset = 0; offset < length; offset++) fRadeon.SetRegister(C_RADEON_I2C_DATA, buffer[offset]); // - fRadeon.SetRegister(C_RADEON_I2C_CNTL_1, - (fTimeLimit << 24) | length | - C_RADEON_I2C_EN | C_RADEON_I2C_SEL | 0x100); + if (si->asic >= rt_r200) { + fRadeon.SetRegister(C_RADEON_I2C_CNTL_1, + (fTimeLimit << 24) | length | + C_RADEON_I2C_EN | C_RADEON_I2C_SEL | 0x010); + } else { + fRadeon.SetRegister(C_RADEON_I2C_CNTL_1, + (fTimeLimit << 24) | length | + C_RADEON_I2C_EN | C_RADEON_I2C_SEL | 0x100); + } fRadeon.SetRegister(C_RADEON_I2C_CNTL_0, (fNfactor << 24) | (fMfactor << 16) | @@ -171,9 +197,15 @@ fRadeon.SetRegister(C_RADEON_I2C_DATA, address | 0x00000001); - fRadeon.SetRegister(C_RADEON_I2C_CNTL_1, - (fTimeLimit << 24) | C_RADEON_I2C_EN | //C_RADEON_I2C_SEL | - length | 0x100); + if (si->asic >= rt_r200) { + fRadeon.SetRegister(C_RADEON_I2C_CNTL_1, + (fTimeLimit << 24) | C_RADEON_I2C_EN | C_RADEON_I2C_SEL | + length | 0x010); + } else { + fRadeon.SetRegister(C_RADEON_I2C_CNTL_1, + (fTimeLimit << 24) | C_RADEON_I2C_EN | C_RADEON_I2C_SEL | + length | 0x100); + } fRadeon.SetRegister(C_RADEON_I2C_CNTL_0, (fNfactor << 24) | (fMfactor << 16) | C_RADEON_I2C_GO | @@ -222,7 +254,7 @@ C_RADEON_I2C_DONE | C_RADEON_I2C_NACK | C_RADEON_I2C_HALT, 0); // issue abort call - fRadeon.SetRegister(C_RADEON_I2C_CNTL_0, + fRadeon.SetRegister(C_RADEON_I2C_CNTL_0_PLUS1, C_RADEON_I2C_ABORT | C_RADEON_I2C_GO, C_RADEON_I2C_ABORT | C_RADEON_I2C_GO); // wait GO bit to go low Modified: haiku/trunk/src/add-ons/media/media-add-ons/radeon/I2CPort.h =================================================================== --- haiku/trunk/src/add-ons/media/media-add-ons/radeon/I2CPort.h 2007-03-05 18:22:40 UTC (rev 20337) +++ haiku/trunk/src/add-ons/media/media-add-ons/radeon/I2CPort.h 2007-03-05 21:16:15 UTC (rev 20338) @@ -57,6 +57,7 @@ int fNfactor; int fMfactor; int fTimeLimit; + shared_info* si; }; Modified: haiku/trunk/src/add-ons/media/media-add-ons/radeon/Jamfile =================================================================== --- haiku/trunk/src/add-ons/media/media-add-ons/radeon/Jamfile 2007-03-05 18:22:40 UTC (rev 20337) +++ haiku/trunk/src/add-ons/media/media-add-ons/radeon/Jamfile 2007-03-05 21:16:15 UTC (rev 20338) @@ -16,6 +16,8 @@ Tuner.cpp VIPPort.cpp VideoIn.cpp + Theater100.cpp + Theater200.cpp ; LinkAgainst radeon.media_addon : be media ; Modified: haiku/trunk/src/add-ons/media/media-add-ons/radeon/Radeon.cpp =================================================================== --- haiku/trunk/src/add-ons/media/media-add-ons/radeon/Radeon.cpp 2007-03-05 18:22:40 UTC (rev 20337) +++ haiku/trunk/src/add-ons/media/media-add-ons/radeon/Radeon.cpp 2007-03-05 21:16:15 UTC (rev 20338) @@ -14,6 +14,7 @@ #include //#include "Driver.h" #include "Radeon.h" +#include "OS.h" static const char * const C_RADEON_REGISTER_AREA_NAME = "RadeonRegisters"; static const char * const C_RADEON_MEMORY_AREA_NAME = "RadeonMemory"; @@ -119,7 +120,8 @@ fRegisterArea(0), fROMArea(0), fVirtualCardArea(0), - fSharedInfoArea(0) + fSharedInfoArea(0), + caps_video_in(0) { PRINT(("CRadeon::CRadeon()\n")); @@ -227,6 +229,7 @@ vr.magic = RADEON_PRIVATE_DATA_MAGIC; vr.channel = device; vr.address = address; + vr.lock = true; res = ioctl( fHandle, RADEON_VIPREAD, &vr, sizeof( vr )); @@ -244,10 +247,53 @@ vw.channel = device; vw.address = address; vw.data = value; + vw.lock = true; ioctl( fHandle, RADEON_VIPWRITE, &vw, sizeof( vw )); } + +int CRadeon::VIPReadFifo(int device, uint32 address, uint32 count, uint8 *buffer) +{ + radeon_vip_fifo_read vr; + status_t res; + + vr.magic = RADEON_PRIVATE_DATA_MAGIC; + vr.channel = device; + vr.address = address; + vr.count = count; + vr.data = buffer; + vr.lock = true; + + res = ioctl( fHandle, RADEON_VIPFIFOREAD, &vr, sizeof( vr )); + if( res == B_OK ) + return TRUE; + else + return FALSE; + +} + +int CRadeon::VIPWriteFifo(int device, uint32 address, uint32 count, uint8 *buffer) +{ + radeon_vip_fifo_write vw; + status_t res; + + vw.magic = RADEON_PRIVATE_DATA_MAGIC; + vw.channel = device; + vw.address = address; + vw.count = count; + vw.data = buffer; + vw.lock = true; + + res = ioctl( fHandle, RADEON_VIPFIFOWRITE, &vw, sizeof( vw )); + + if( res == B_OK ) + return TRUE; + else + return FALSE; +} + + int CRadeon::FindVIPDevice( uint32 device_id ) { radeon_find_vip_device fvd; @@ -264,6 +310,11 @@ return -1; } +shared_info* CRadeon::GetSharedInfo() +{ + return fSharedInfo; +} + void CRadeon::GetPLLParameters(int & refFreq, int & refDiv, int & minFreq, int & maxFreq, int & xclock) { refFreq = fSharedInfo->pll.ref_freq; @@ -280,12 +331,77 @@ int & compositePort, int & svideoPort) { - unsigned char *fVideoBIOS = fROM + fROM[0x48] + (fROM[0x49] << 8); - unsigned char * fMMTable = fROM + fVideoBIOS[0x38] + (fVideoBIOS[0x39] << 8); + unsigned char * fMMTable = NULL; + + PRINT(("CRadeon::GetMMParameters()\n")); + + if (fSharedInfo->is_atombios) { + uint16 hdr = fROM[0x48] + (fROM[0x49] << 8); + uint16 PCIR = hdr + fROM[hdr] + (fROM[hdr + 1] << 8); + uint16 hdr2 = fROM[PCIR - 4] + (fROM[PCIR - 3] << 8); + uint16 hmMedia = fROM[hdr2 + 8] + (fROM[hdr2 + 9] << 8); + if(fROM[hmMedia ] == 0x14 + && fROM[hmMedia + 1] == 0x00 + && fROM[hmMedia + 2] == 0x01 + && fROM[hmMedia + 3] == 0x01 + && fROM[hmMedia + 4] == '$' + && fROM[hmMedia + 5] == 'M' + && fROM[hmMedia + 6] == 'M' + && fROM[hmMedia + 7] == 'T') { + fMMTable = &fROM[hmMedia + 8]; + PRINT(("ATOMBIOS MM Table Signiture found\n")); + } else { + PRINT(("ATOMBIOS MM Table Not Found\n")); + return; + } + } else { + unsigned char *fVideoBIOS = fROM + fROM[0x48] + (fROM[0x49] << 8); + fMMTable = fROM + fVideoBIOS[0x38] + (fVideoBIOS[0x39] << 8) - 2; + + if (fMMTable[0] != 0x0c) + { + PRINT(("MM_TABLE invalid size\n")); + return; + } + else + { + PRINT(("MM Table Found (non ATOM) \n")); + PRINT(("Revision %02x\n", fMMTable[0])); + PRINT(("Size %02x\n", fMMTable[2])); + fMMTable += 2; + } + } + + + // check table: + PRINT(( "MM_TABLE:\n")); + const char* names[] = { + "Tuner Type %02x\n", + "Audio Chip %02x\n", + "Product ID %02x\n", + "Tuner misc %02x\n", + "I2C Config %02x\n", + "Vid Decoder %02x\n", + "..Host config %02x\n", + "input 0 %02x\n", + "input 1 %02x\n", + "input 2 %02x\n", + "input 3 %02x\n", + "input 4 %02x\n", + 0 + }; + + int i = 0; + while(names[i]) { + PRINT((names[i], fMMTable[i])); + i++; + } + switch (fMMTable[0] & 0x1f) { case 0x00: tuner = C_RADEON_NO_TUNER; + PRINT(("CRadeon::GetMMParameters() No Tuner\n")); break; case 0x01: tuner = C_RADEON_FI1236_MK1_NTSC; @@ -328,12 +444,14 @@ break; default: tuner = C_RADEON_NO_TUNER; + PRINT(("CRadeon::GetMMParameters() No Tuner\n")); break; } switch (fMMTable[5] & 0x0f) { case 0x00: video = C_RADEON_NO_VIDEO; + PRINT(("CRadeon::GetMMParameters() No Video\n")); break; case 0x01: video = C_RADEON_BT819; @@ -352,9 +470,11 @@ break; case 0x06: video = C_RADEON_RAGE_THEATER; + PRINT(("CRadeon::GetMMParameters() Rage Theater\n")); break; default: video = C_RADEON_NO_VIDEO; + PRINT(("CRadeon::GetMMParameters() No Video\n")); break; } @@ -364,6 +484,7 @@ case 0x20: case 0x30: clock = C_RADEON_NO_VIDEO_CLOCK; + PRINT(("CRadeon::GetMMParameters() Video No Clock\n")); break; case 0x40: clock = C_RADEON_VIDEO_CLOCK_28_63636_MHZ; @@ -379,24 +500,29 @@ break; default: clock = C_RADEON_NO_VIDEO_CLOCK; + PRINT(("CRadeon::GetMMParameters() Video No Clock\n")); break; } - for (int port = 0; port < 4; port++) { + for (int port = 0; port < 5; port++) { switch (fMMTable[7 + port] & 0x03) { case 0x00: // Unused or Invalid + PRINT(("CRadeon::GetMMParameters() Invalid Port\n")); break; case 0x01: // Tuner Input + PRINT(("CRadeon::GetMMParameters() Tuner Port\n")); tunerPort = 0; break; case 0x02: // Front/Rear Composite Input + PRINT(("CRadeon::GetMMParameters() Composite Port\n")); compositePort = (fMMTable[7 + port] & 0x04 ? 2 : 1); break; case 0x03: // Front/Rear SVideo Input + PRINT(("CRadeon::GetMMParameters() SVideo Port\n")); svideoPort = (fMMTable[7 + port] & 0x04 ? 6 : 5); break; } Modified: haiku/trunk/src/add-ons/media/media-add-ons/radeon/Radeon.h =================================================================== --- haiku/trunk/src/add-ons/media/media-add-ons/radeon/Radeon.h 2007-03-05 18:22:40 UTC (rev 20337) +++ haiku/trunk/src/add-ons/media/media-add-ons/radeon/Radeon.h 2007-03-05 21:16:15 UTC (rev 20338) @@ -46,7 +46,6 @@ C_RADEON_RAGE_THEATER = 6 }; - enum radeon_register { C_RADEON_VIDEOMUX_CNTL = 0x0190, C_RADEON_VIPH_INT_SEL = BITS(0:0), @@ -56,6 +55,7 @@ // I2C C_RADEON_I2C_CNTL_0 = 0x0090, + C_RADEON_I2C_CNTL_0_PLUS1 = 0x0091, C_RADEON_I2C_DONE = BITS(0:0), C_RADEON_I2C_NACK = BITS(1:1), C_RADEON_I2C_HALT = BITS(2:2), @@ -352,6 +352,10 @@ void SetVIPRegister(int device, int address, int value); + int VIPReadFifo(int device, uint32 address, uint32 count, uint8 *buffer); + + int VIPWriteFifo(int device, uint32 address, uint32 count, uint8 *buffer); + int FindVIPDevice( uint32 device_id ); public: @@ -383,6 +387,7 @@ status_t CloneArea(const char * name, area_id src_area, area_id *cloned_area, void ** map); + shared_info* GetSharedInfo(); private: int fHandle; unsigned int * fRegister; @@ -394,6 +399,8 @@ area_id fROMArea; area_id fVirtualCardArea; area_id fSharedInfoArea; + + uint32 caps_video_in; }; template Modified: haiku/trunk/src/add-ons/media/media-add-ons/radeon/RadeonAddOn.cpp =================================================================== --- haiku/trunk/src/add-ons/media/media-add-ons/radeon/RadeonAddOn.cpp 2007-03-05 18:22:40 UTC (rev 20337) +++ haiku/trunk/src/add-ons/media/media-add-ons/radeon/RadeonAddOn.cpp 2007-03-05 21:16:15 UTC (rev 20338) @@ -412,9 +412,8 @@ // if there is a Rage Theatre, then there should be Video-In if( vip_port.InitCheck() == B_OK && - vip_port.FindVIPDevice( - (C_THEATER_VIP_VENDOR_ID << 0) | - (C_THEATER_VIP_DEVICE_ID << 16)) >= 0 ) + ((vip_port.FindVIPDevice( C_THEATER100_VIP_DEVICE_ID ) >= 0) + || (vip_port.FindVIPDevice( C_THEATER200_VIP_DEVICE_ID ) >= 0))) { fDevices.AddItem( new CRadeonPlug( this, path, cur_id++ )); } Modified: haiku/trunk/src/add-ons/media/media-add-ons/radeon/RadeonProducer.cpp =================================================================== --- haiku/trunk/src/add-ons/media/media-add-ons/radeon/RadeonProducer.cpp 2007-03-05 18:22:40 UTC (rev 20337) +++ haiku/trunk/src/add-ons/media/media-add-ons/radeon/RadeonProducer.cpp 2007-03-05 21:16:15 UTC (rev 20338) @@ -28,6 +28,7 @@ #include #include "RadeonAddOn.h" +#include "VideoIn.h" #define DPRINT(args) { PRINT(("\x1b[0;30;35m")); PRINT(args); PRINT(("\x1b[0;30;47m")); } @@ -50,6 +51,8 @@ // functions to convert to scattered Be-code to the compact video-in-code video_in_standard BeToVideoInStandard( int32 be_standard ) { + + DPRINT(("BeToVideoInStandard %d \n", be_standard)); switch( be_standard ) { case 1: return C_VIDEO_IN_NTSC; case 2: return C_VIDEO_IN_NTSC_JAPAN; @@ -66,14 +69,19 @@ int32 VideoInStandardToBe( video_in_standard standard ) { - int32 be_standard[] = { - 1, 2, 101, 4, 3, 5, 102, 103, 6 - }; - - if( (uint)standard < sizeof( be_standard ) / sizeof( be_standard[0] ) ) - return be_standard[(int)standard]; - else - return 1; + DPRINT(("VideoInStandardToBe %d \n", standard)); + switch( standard ) { + case C_VIDEO_IN_NTSC: return 1; + case C_VIDEO_IN_NTSC_JAPAN: return 2; + case C_VIDEO_IN_PAL_BDGHI: return 3; + case C_VIDEO_IN_PAL_M: return 4; + case C_VIDEO_IN_PAL_N: return 5; + case C_VIDEO_IN_SECAM: return 6; + case C_VIDEO_IN_NTSC_443: return 101; + case C_VIDEO_IN_PAL_60: return 102; + case C_VIDEO_IN_PAL_NC: return 103; + default: return 1; + } } status_t CRadeonProducer::FindInt32( @@ -130,7 +138,7 @@ fInitStatus = B_OK; fSource = ((fVideoIn.Capabilities() & C_VIDEO_IN_HAS_TUNER) != 0 ? C_VIDEO_IN_TUNER : C_VIDEO_IN_COMPOSITE); - fStandard = 1; + fStandard = C_VIDEO_IN_NTSC; fMode = C_VIDEO_IN_WEAVE; fFormat = B_RGB32; fResolution = 4; @@ -174,6 +182,7 @@ // standard is stored as internal code (which has no "holes" in its numbering); // time to convert it + // if this value comes from our setup web is it not already linear? fStandard = VideoInStandardToBe( (video_in_standard)standard ); // if there is no tuner, force composite input @@ -266,12 +275,12 @@ P_AUDIO_SOURCE, B_MEDIA_RAW_VIDEO, "Audio Input:", "Audio Input:"); if ((fVideoIn.Capabilities() & C_VIDEO_IN_HAS_TUNER) != 0) source2->AddItem(C_VIDEO_IN_TUNER, "Tuner"); - if ((fVideoIn.Capabilities() & C_VIDEO_IN_HAS_COMPOSITE) != 0) +/* if ((fVideoIn.Capabilities() & C_VIDEO_IN_HAS_COMPOSITE) != 0) source2->AddItem(C_VIDEO_IN_COMPOSITE, "Composite"); if ((fVideoIn.Capabilities() & C_VIDEO_IN_HAS_SVIDEO) != 0) source2->AddItem(C_VIDEO_IN_SVIDEO, "SVideo"); +*/ - // Controls.Brightness/Contrast/Saturation/Hue controls2->MakeContinuousParameter(P_BRIGHTNESS, B_MEDIA_RAW_VIDEO,"Brightness", "BRIGHTNESS", "", -100, 100, 1); controls2->MakeContinuousParameter(P_CONTRAST, B_MEDIA_RAW_VIDEO, "Contrast", "CONTRAST", "", 0, 100, 1); @@ -877,11 +886,13 @@ // our format converters do up to 8 pixels at a time (grey8); // to be absolutely sure we don't get trouble there, refuse // any width that is not a multiple of 8 + if( (format->u.raw_video.display.line_width & 7) != 0 ) { DPRINT(( "Request image width is not multiple of 8 (%d)\n", format->u.raw_video.display.line_width )); return B_MEDIA_BAD_FORMAT; } + } else { switch (fResolution) { case 0: @@ -1081,8 +1092,7 @@ return res; setFormatFlags( format ); - - return B_OK; + return res; } @@ -1118,7 +1128,7 @@ First, the application defines a format with many wildcards in it; this format is passed to us, so we can restrict it if necessary; we should leave as many wildcards as possible, because in the next - step the consumer is asked, and he will not be happy if he has to choise left . + step the consumer is asked, and he will not be happy if he has no choice left . */ status_t CRadeonProducer::FormatProposal(const media_source &output, media_format *format) @@ -1373,7 +1383,7 @@ fOutput.destination == media_destination::null ) return; - fVideoIn.SetChannel(fTuner, C_VIDEO_IN_NTSC); + fVideoIn.SetChannel(fTuner, C_VIDEO_IN_NTSC); // was hardcoded to NTSC fVideoIn.SetBrightness(fBrightness); fVideoIn.SetContrast(fContrast); fVideoIn.SetSaturation(fSaturation); @@ -1696,11 +1706,20 @@ return; fSource = *((const uint32 *) value); fSourceLastChange = when; + + // if there is no tuner, force composite input + // (eXposer sets source manually to tuner, even if there is none) + // if there is no tuner, it isn't in the list and can't be picked! + //if( (fVideoIn.Capabilities() & C_VIDEO_IN_HAS_TUNER) == 0 ) + // fSource = C_VIDEO_IN_COMPOSITE; + break; case P_STANDARD: { if (*((const int32 *) value) == fStandard) return; - fStandard = *((const uint32 *) value); + + fStandard = BeToVideoInStandard( *((const int32 *) value) ); + fStandardLastChange = when; media_format new_format = fOutput.format; @@ -1756,7 +1775,7 @@ return; fTuner = *((const uint32 *) value); fTunerLastChange = when; - fVideoIn.SetChannel(fTuner, C_VIDEO_IN_NTSC); + fVideoIn.SetChannel(fTuner, C_VIDEO_IN_NTSC); // was hardcoded to NTSC break; case P_BRIGHTNESS: if (*((const float *) value) == fBrightness) Modified: haiku/trunk/src/add-ons/media/media-add-ons/radeon/RadeonProducer.h =================================================================== --- haiku/trunk/src/add-ons/media/media-add-ons/radeon/RadeonProducer.h 2007-03-05 18:22:40 UTC (rev 20337) +++ haiku/trunk/src/add-ons/media/media-add-ons/radeon/RadeonProducer.h 2007-03-05 21:16:15 UTC (rev 20338) @@ -28,192 +28,191 @@ public virtual BControllable { public: - CRadeonProducer( - CRadeonAddOn *addon, const char *name, const char *device_name, - int32 internal_id, BMessage *config ); -virtual ~CRadeonProducer(); + CRadeonProducer(CRadeonAddOn *addon, const char *name, const char *device_name, + int32 internal_id, BMessage *config ); + virtual ~CRadeonProducer(); -void setupWeb(); -virtual status_t InitCheck() const { return fInitStatus; } + void setupWeb(); + virtual status_t InitCheck() const { return fInitStatus; } /* BMediaNode */ public: -virtual port_id ControlPort() const; -virtual BMediaAddOn *AddOn(int32 * internal_id) const; -virtual status_t HandleMessage(int32 message, const void *data, - size_t size); + virtual port_id ControlPort() const; + virtual BMediaAddOn *AddOn(int32 * internal_id) const; + virtual status_t HandleMessage(int32 message, const void *data, + size_t size); protected: -virtual void Preroll(); -virtual void SetTimeSource(BTimeSource * time_source); -virtual status_t RequestCompleted(const media_request_info & info); + virtual void Preroll(); + virtual void SetTimeSource(BTimeSource * time_source); + virtual status_t RequestCompleted(const media_request_info & info); /* BMediaEventLooper */ protected: -virtual void NodeRegistered(); -virtual void Start(bigtime_t performance_time); -virtual void Stop(bigtime_t performance_time, bool immediate); -virtual void Seek(bigtime_t media_time, bigtime_t performance_time); -virtual void TimeWarp(bigtime_t at_real_time, - bigtime_t to_performance_time); -virtual status_t AddTimer(bigtime_t at_performance_time, int32 cookie); -virtual void SetRunMode(run_mode mode); -virtual void HandleEvent(const media_timed_event *event, - bigtime_t lateness, bool realTimeEvent = false); -virtual void CleanUpEvent(const media_timed_event *event); -virtual bigtime_t OfflineTime(); -virtual void ControlLoop(); -virtual status_t DeleteHook(BMediaNode * node); + virtual void NodeRegistered(); + virtual void Start(bigtime_t performance_time); + virtual void Stop(bigtime_t performance_time, bool immediate); + virtual void Seek(bigtime_t media_time, bigtime_t performance_time); + virtual void TimeWarp(bigtime_t at_real_time, + bigtime_t to_performance_time); + virtual status_t AddTimer(bigtime_t at_performance_time, int32 cookie); + virtual void SetRunMode(run_mode mode); + virtual void HandleEvent(const media_timed_event *event, + bigtime_t lateness, bool realTimeEvent = false); + virtual void CleanUpEvent(const media_timed_event *event); + virtual bigtime_t OfflineTime(); + virtual void ControlLoop(); + virtual status_t DeleteHook(BMediaNode * node); /* BBufferProducer */ protected: -virtual status_t FormatSuggestionRequested(media_type type, int32 quality, - media_format * format); -virtual status_t FormatProposal(const media_source &output, - media_format *format); -virtual status_t FormatChangeRequested(const media_source &source, - const media_destination &destination, - media_format *io_format, int32 *_deprecated_); -virtual status_t GetNextOutput(int32 * cookie, media_output * out_output); -virtual status_t DisposeOutputCookie(int32 cookie); -virtual status_t SetBufferGroup(const media_source &for_source, - BBufferGroup * group); -virtual status_t VideoClippingChanged(const media_source &for_source, - int16 num_shorts, int16 *clip_data, - const media_video_display_info &display, - int32 * _deprecated_); -virtual status_t GetLatency(bigtime_t * out_latency); -virtual status_t PrepareToConnect(const media_source &what, - const media_destination &where, - media_format *format, - media_source *out_source, char *out_name); -virtual void Connect(status_t error, const media_source &source, - const media_destination &destination, - const media_format & format, char *io_name); -virtual void Disconnect(const media_source & what, - const media_destination & where); -virtual void LateNoticeReceived(const media_source & what, - bigtime_t how_much, bigtime_t performance_time); -virtual void EnableOutput(const media_source & what, bool enabled, - int32 * _deprecated_); -virtual status_t SetPlayRate(int32 numer,int32 denom); -virtual void AdditionalBufferRequested(const media_source & source, - media_buffer_id prev_buffer, bigtime_t prev_time, - const media_seek_tag * prev_tag); -virtual void LatencyChanged(const media_source & source, - const media_destination & destination, - bigtime_t new_latency, uint32 flags); + virtual status_t FormatSuggestionRequested(media_type type, int32 quality, + media_format * format); + virtual status_t FormatProposal(const media_source &output, + media_format *format); + virtual status_t FormatChangeRequested(const media_source &source, + const media_destination &destination, + media_format *io_format, int32 *_deprecated_); + virtual status_t GetNextOutput(int32 * cookie, media_output * out_output); + virtual status_t DisposeOutputCookie(int32 cookie); + virtual status_t SetBufferGroup(const media_source &for_source, + BBufferGroup * group); + virtual status_t VideoClippingChanged(const media_source &for_source, + int16 num_shorts, int16 *clip_data, + const media_video_display_info &display, + int32 * _deprecated_); + virtual status_t GetLatency(bigtime_t * out_latency); + virtual status_t PrepareToConnect(const media_source &what, + const media_destination &where, + media_format *format, + media_source *out_source, char *out_name); + virtual void Connect(status_t error, const media_source &source, + const media_destination &destination, + const media_format & format, char *io_name); + virtual void Disconnect(const media_source & what, + const media_destination & where); + virtual void LateNoticeReceived(const media_source & what, + bigtime_t how_much, bigtime_t performance_time); + virtual void EnableOutput(const media_source & what, bool enabled, + int32 * _deprecated_); + virtual status_t SetPlayRate(int32 numer,int32 denom); + virtual void AdditionalBufferRequested(const media_source & source, + media_buffer_id prev_buffer, bigtime_t prev_time, + const media_seek_tag * prev_tag); + virtual void LatencyChanged(const media_source & source, + const media_destination & destination, + bigtime_t new_latency, uint32 flags); /* BControllable */ protected: -virtual status_t GetParameterValue(int32 id, bigtime_t *last_change, - void *value, size_t *size); -virtual void SetParameterValue(int32 id, bigtime_t when, - const void *value, size_t size); -virtual status_t StartControlPanel(BMessenger *out_messenger); + virtual status_t GetParameterValue(int32 id, bigtime_t *last_change, + void *value, size_t *size); + virtual void SetParameterValue(int32 id, bigtime_t when, + const void *value, size_t size); + virtual status_t StartControlPanel(BMessenger *out_messenger); public: - enum { - C_GET_CONFIGURATION = BTimedEventQueue::B_USER_EVENT, - C_GET_CONFIGURATION_REPLY - }; - - struct configuration_msg { - port_id reply_port; - }; - - struct configuration_msg_reply { - status_t res; - size_t config_size; - char config; - }; + enum { + C_GET_CONFIGURATION = BTimedEventQueue::B_USER_EVENT, + C_GET_CONFIGURATION_REPLY + }; + + struct configuration_msg { + port_id reply_port; + }; + + struct configuration_msg_reply { + status_t res; + size_t config_size; + char config; + }; /* state */ private: - void HandleStart(bigtime_t performance_time); - void HandleStop(); - void HandleTimeWarp(bigtime_t performance_time); - void HandleSeek(bigtime_t performance_time); - void HandleHardware(); - - // home-brewed extension - status_t GetConfiguration( BMessage *out ); - - CVideoIn fVideoIn; - - status_t fInitStatus; + void HandleStart(bigtime_t performance_time); + void HandleStop(); + void HandleTimeWarp(bigtime_t performance_time); + void HandleSeek(bigtime_t performance_time); + void HandleHardware(); + + // home-brewed extension + status_t GetConfiguration( BMessage *out ); + + CVideoIn fVideoIn; + + status_t fInitStatus; - int32 fInternalID; - CRadeonAddOn *fAddOn; + int32 fInternalID; + CRadeonAddOn *fAddOn; - BBufferGroup *fBufferGroup; - //BBufferGroup *fUsedBufferGroup; + BBufferGroup *fBufferGroup; + //BBufferGroup *fUsedBufferGroup; -static int32 _frame_generator_(void *data); - int32 FrameGenerator(); + static int32 _frame_generator_(void *data); + int32 FrameGenerator(); - /* The remaining variables should be declared volatile, but they - * are not here to improve the legibility of the sample code. */ - //uint32 fFrame; - uint32 fFieldSequenceBase; - //bigtime_t fPerformanceTimeBase; - bigtime_t fProcessingLatency; - media_output fOutput; - //media_raw_video_format fConnectedFormat; - //bool fConnected; - bool fEnabled; + /* The remaining variables should be declared volatile, but they + * are not here to improve the legibility of the sample code. */ + //uint32 fFrame; + uint32 fFieldSequenceBase; + //bigtime_t fPerformanceTimeBase; + bigtime_t fProcessingLatency; + media_output fOutput; + //media_raw_video_format fConnectedFormat; + //bool fConnected; + bool fEnabled; - // use fixed names as they are used in settings file - enum EOptions { - P_SOURCE = 'VSRC', - P_AUDIO_SOURCE = 'ASRC', - P_AUDIO_FORMAT = 'AFMT', - P_VOLUME = 'VOL ', - P_STANDARD = 'TVST', - P_MODE = 'CMOD', - P_FORMAT = 'VFMT', - P_RESOLUTION = 'RES ', - P_TUNER = 'TUNR', - P_BRIGHTNESS = 'BRGT', - P_CONTRAST = 'CONT', - P_SATURATION = 'SATU', - P_HUE = 'HUE ', - P_SHARPNESS = 'SHRP' - }; + // use fixed names as they are used in settings file + enum EOptions { + P_SOURCE = 'VSRC', + P_AUDIO_SOURCE = 'ASRC', + P_AUDIO_FORMAT = 'AFMT', + P_VOLUME = 'VOL ', + P_STANDARD = 'TVST', + P_MODE = 'CMOD', + P_FORMAT = 'VFMT', + P_RESOLUTION = 'RES ', + P_TUNER = 'TUNR', + P_BRIGHTNESS = 'BRGT', + P_CONTRAST = 'CONT', + P_SATURATION = 'SATU', + P_HUE = 'HUE ', + P_SHARPNESS = 'SHRP' + }; + + enum { C_RESOLUTION_MAX = 6 }; + enum { C_CHANNEL_MAX = 125 }; + + int32 fSource; + int32 fStandard; + int32 fMode; + int32 fCurMode; // mode, overwritten by application + int32 fFormat; + int32 fResolution; + int32 fTuner; + int32 fBrightness; + int32 fContrast; + int32 fSaturation; + int32 fHue; + int32 fSharpness; + bigtime_t fSourceLastChange; + bigtime_t fStandardLastChange; + bigtime_t fModeLastChange; + bigtime_t fFormatLastChange; + bigtime_t fResolutionLastChange; + bigtime_t fTunerLastChange; + bigtime_t fBrightnessLastChange; + bigtime_t fContrastLastChange; + bigtime_t fSaturationLastChange; + bigtime_t fHueLastChange; + bigtime_t fSharpnessLastChange; + + status_t AddInt32( + BMessage *msg, EOptions option, int32 value ); - enum { C_RESOLUTION_MAX = 6 }; - enum { C_CHANNEL_MAX = 125 }; - - int32 fSource; - int32 fStandard; - int32 fMode; - int32 fCurMode; // mode, overwritten by application - int32 fFormat; - int32 fResolution; - int32 fTuner; - int32 fBrightness; - int32 fContrast; - int32 fSaturation; - int32 fHue; - int32 fSharpness; - bigtime_t fSourceLastChange; - bigtime_t fStandardLastChange; - bigtime_t fModeLastChange; - bigtime_t fFormatLastChange; - bigtime_t fResolutionLastChange; - bigtime_t fTunerLastChange; - bigtime_t fBrightnessLastChange; - bigtime_t fContrastLastChange; - bigtime_t fSaturationLastChange; - bigtime_t fHueLastChange; - bigtime_t fSharpnessLastChange; + status_t FindInt32( + BMessage *config, EOptions option, int32 min_value, int32 max_value, + int32 default_value, int32 *value ); - status_t AddInt32( - BMessage *msg, EOptions option, int32 value ); - - status_t FindInt32( - BMessage *config, EOptions option, int32 min_value, int32 max_value, - int32 default_value, int32 *value ); - // format negotiation helpers status_t verifySetMode( media_format *format ); int32 extractCaptureMode( const media_format *format ); Modified: haiku/trunk/src/add-ons/media/media-add-ons/radeon/Theater.cpp =================================================================== --- haiku/trunk/src/add-ons/media/media-add-ons/radeon/Theater.cpp 2007-03-05 18:22:40 UTC (rev 20337) +++ haiku/trunk/src/add-ons/media/media-add-ons/radeon/Theater.cpp 2007-03-05 21:16:15 UTC (rev 20338) @@ -10,13 +10,13 @@ #include #include "Theater.h" +#include "VideoIn.h" #include "TheatreReg.h" #include "lendian_bitfield.h" - -CTheater::CTheater(CRadeon & radeon) +CTheater::CTheater(CRadeon & radeon, int device) : fPort(radeon), - fDevice(0), + fDevice(device), fClock(C_RADEON_NO_VIDEO_CLOCK), fTunerPort(0), fCompositePort(0), @@ -29,1301 +29,22 @@ fHue(0), fDeinterlace(true) { - PRINT(("CTheater::CTheater()\n")); - - if( fPort.InitCheck() == B_OK ) { - radeon_video_tuner tuner; - radeon_video_decoder video; - [... truncated: 4645 lines follow ...] From bonefish at mail.berlios.de Tue Mar 6 02:22:49 2007 From: bonefish at mail.berlios.de (bonefish at BerliOS) Date: Tue, 6 Mar 2007 02:22:49 +0100 Subject: [Haiku-commits] r20339 - haiku/trunk/headers/os/drivers Message-ID: <200703060122.l261Mn98012767@sheep.berlios.de> Author: bonefish Date: 2007-03-06 02:22:47 +0100 (Tue, 06 Mar 2007) New Revision: 20339 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20339&view=rev Modified: haiku/trunk/headers/os/drivers/fs_interface.h Log: One unremove_vnode() prototype shall suffice. Modified: haiku/trunk/headers/os/drivers/fs_interface.h =================================================================== --- haiku/trunk/headers/os/drivers/fs_interface.h 2007-03-05 21:16:15 UTC (rev 20338) +++ haiku/trunk/headers/os/drivers/fs_interface.h 2007-03-06 01:22:47 UTC (rev 20339) @@ -264,7 +264,6 @@ extern status_t put_vnode(mount_id mountID, vnode_id vnodeID); extern status_t remove_vnode(mount_id mountID, vnode_id vnodeID); extern status_t unremove_vnode(mount_id mountID, vnode_id vnodeID); -extern status_t unremove_vnode(mount_id mountID, vnode_id vnodeID); extern status_t get_vnode_removed(mount_id mountID, vnode_id vnodeID, bool* removed); From bonefish at mail.berlios.de Tue Mar 6 03:39:36 2007 From: bonefish at mail.berlios.de (bonefish at BerliOS) Date: Tue, 6 Mar 2007 03:39:36 +0100 Subject: [Haiku-commits] r20340 - haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server Message-ID: <200703060239.l262daE0017178@sheep.berlios.de> Author: bonefish Date: 2007-03-06 03:39:34 +0100 (Tue, 06 Mar 2007) New Revision: 20340 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20340&view=rev Added: haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/HaikuKernelFileSystem.cpp haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/HaikuKernelFileSystem.h haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/HaikuKernelVolume.cpp haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/HaikuKernelVolume.h haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/haiku_kernel_emu.cpp Modified: haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/BeOSKernelFileSystem.cpp haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/BeOSKernelFileSystem.h haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/Jamfile haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/UserlandFSServer.cpp haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/UserlandFSServer.h haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/beos_kernel_emu.cpp haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/kernel_emu.cpp haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/kernel_emu.h Log: * Added support for interfacing with Haiku style FS modules (yet untested). * Added library with the relevant part of the Haiku kernel interface. The cache interface is missing, though. Modified: haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/BeOSKernelFileSystem.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/BeOSKernelFileSystem.cpp 2007-03-06 01:22:47 UTC (rev 20339) +++ haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/BeOSKernelFileSystem.cpp 2007-03-06 02:39:34 UTC (rev 20340) @@ -14,7 +14,7 @@ : FileSystem(), fFSOps(fsOps) { - _InitCapabilities(fsOps); + _InitCapabilities(); } // destructor @@ -49,7 +49,7 @@ // _InitCapabilities void -BeOSKernelFileSystem::_InitCapabilities(beos_vnode_ops* fsOps) +BeOSKernelFileSystem::_InitCapabilities() { fCapabilities.ClearAll(); @@ -57,20 +57,20 @@ fCapabilities.clientFSType = CLIENT_FS_BEOS_KERNEL; // FS operations - fCapabilities.Set(FS_CAPABILITY_MOUNT, fsOps->mount); - fCapabilities.Set(FS_CAPABILITY_UNMOUNT, fsOps->unmount); + fCapabilities.Set(FS_CAPABILITY_MOUNT, fFSOps->mount); + fCapabilities.Set(FS_CAPABILITY_UNMOUNT, fFSOps->unmount); - fCapabilities.Set(FS_CAPABILITY_READ_FS_INFO, fsOps->rfsstat); - fCapabilities.Set(FS_CAPABILITY_WRITE_FS_INFO, fsOps->wfsstat); - fCapabilities.Set(FS_CAPABILITY_SYNC, fsOps->sync); + fCapabilities.Set(FS_CAPABILITY_READ_FS_INFO, fFSOps->rfsstat); + fCapabilities.Set(FS_CAPABILITY_WRITE_FS_INFO, fFSOps->wfsstat); + fCapabilities.Set(FS_CAPABILITY_SYNC, fFSOps->sync); // vnode operations - fCapabilities.Set(FS_CAPABILITY_LOOKUP, fsOps->walk); + fCapabilities.Set(FS_CAPABILITY_LOOKUP, fFSOps->walk); // missing: FS_CAPABILITY_GET_VNODE_NAME, - fCapabilities.Set(FS_CAPABILITY_GET_VNODE, fsOps->read_vnode); - fCapabilities.Set(FS_CAPABILITY_PUT_VNODE, fsOps->write_vnode); - fCapabilities.Set(FS_CAPABILITY_REMOVE_VNODE, fsOps->remove_vnode); + fCapabilities.Set(FS_CAPABILITY_GET_VNODE, fFSOps->read_vnode); + fCapabilities.Set(FS_CAPABILITY_PUT_VNODE, fFSOps->write_vnode); + fCapabilities.Set(FS_CAPABILITY_REMOVE_VNODE, fFSOps->remove_vnode); // VM file access // missing: FS_CAPABILITY_CAN_PAGE, @@ -81,80 +81,81 @@ // missing: FS_CAPABILITY_GET_FILE_MAP, // common operations - fCapabilities.Set(FS_CAPABILITY_IOCTL, fsOps->ioctl); - fCapabilities.Set(FS_CAPABILITY_SET_FLAGS, fsOps->setflags); - fCapabilities.Set(FS_CAPABILITY_SELECT, fsOps->select); - fCapabilities.Set(FS_CAPABILITY_DESELECT, fsOps->deselect); - fCapabilities.Set(FS_CAPABILITY_FSYNC, fsOps->fsync); + fCapabilities.Set(FS_CAPABILITY_IOCTL, fFSOps->ioctl); + fCapabilities.Set(FS_CAPABILITY_SET_FLAGS, fFSOps->setflags); + fCapabilities.Set(FS_CAPABILITY_SELECT, fFSOps->select); + fCapabilities.Set(FS_CAPABILITY_DESELECT, fFSOps->deselect); + fCapabilities.Set(FS_CAPABILITY_FSYNC, fFSOps->fsync); - fCapabilities.Set(FS_CAPABILITY_READ_SYMLINK, fsOps->readlink); - fCapabilities.Set(FS_CAPABILITY_CREATE_SYMLINK, fsOps->symlink); + fCapabilities.Set(FS_CAPABILITY_READ_SYMLINK, fFSOps->readlink); + fCapabilities.Set(FS_CAPABILITY_CREATE_SYMLINK, fFSOps->symlink); - fCapabilities.Set(FS_CAPABILITY_LINK, fsOps->link); - fCapabilities.Set(FS_CAPABILITY_UNLINK, fsOps->unlink); - fCapabilities.Set(FS_CAPABILITY_RENAME, fsOps->rename); + fCapabilities.Set(FS_CAPABILITY_LINK, fFSOps->link); + fCapabilities.Set(FS_CAPABILITY_UNLINK, fFSOps->unlink); + fCapabilities.Set(FS_CAPABILITY_RENAME, fFSOps->rename); - fCapabilities.Set(FS_CAPABILITY_ACCESS, fsOps->access); - fCapabilities.Set(FS_CAPABILITY_READ_STAT, fsOps->rstat); - fCapabilities.Set(FS_CAPABILITY_WRITE_STAT, fsOps->wstat); + fCapabilities.Set(FS_CAPABILITY_ACCESS, fFSOps->access); + fCapabilities.Set(FS_CAPABILITY_READ_STAT, fFSOps->rstat); + fCapabilities.Set(FS_CAPABILITY_WRITE_STAT, fFSOps->wstat); // file operations - fCapabilities.Set(FS_CAPABILITY_CREATE, fsOps->create); - fCapabilities.Set(FS_CAPABILITY_OPEN, fsOps->open); - fCapabilities.Set(FS_CAPABILITY_CLOSE, fsOps->close); - fCapabilities.Set(FS_CAPABILITY_FREE_COOKIE, fsOps->free_cookie); - fCapabilities.Set(FS_CAPABILITY_READ, fsOps->read); - fCapabilities.Set(FS_CAPABILITY_WRITE, fsOps->write); + fCapabilities.Set(FS_CAPABILITY_CREATE, fFSOps->create); + fCapabilities.Set(FS_CAPABILITY_OPEN, fFSOps->open); + fCapabilities.Set(FS_CAPABILITY_CLOSE, fFSOps->close); + fCapabilities.Set(FS_CAPABILITY_FREE_COOKIE, fFSOps->free_cookie); + fCapabilities.Set(FS_CAPABILITY_READ, fFSOps->read); + fCapabilities.Set(FS_CAPABILITY_WRITE, fFSOps->write); // directory operations - fCapabilities.Set(FS_CAPABILITY_CREATE_DIR, fsOps->mkdir); - fCapabilities.Set(FS_CAPABILITY_REMOVE_DIR, fsOps->rmdir); - fCapabilities.Set(FS_CAPABILITY_OPEN_DIR, fsOps->opendir); - fCapabilities.Set(FS_CAPABILITY_CLOSE_DIR, fsOps->closedir); - fCapabilities.Set(FS_CAPABILITY_FREE_DIR_COOKIE, fsOps->free_dircookie); - fCapabilities.Set(FS_CAPABILITY_READ_DIR, fsOps->readdir); - fCapabilities.Set(FS_CAPABILITY_REWIND_DIR, fsOps->rewinddir); + fCapabilities.Set(FS_CAPABILITY_CREATE_DIR, fFSOps->mkdir); + fCapabilities.Set(FS_CAPABILITY_REMOVE_DIR, fFSOps->rmdir); + fCapabilities.Set(FS_CAPABILITY_OPEN_DIR, fFSOps->opendir); + fCapabilities.Set(FS_CAPABILITY_CLOSE_DIR, fFSOps->closedir); + fCapabilities.Set(FS_CAPABILITY_FREE_DIR_COOKIE, fFSOps->free_dircookie); + fCapabilities.Set(FS_CAPABILITY_READ_DIR, fFSOps->readdir); + fCapabilities.Set(FS_CAPABILITY_REWIND_DIR, fFSOps->rewinddir); // attribute directory operations - fCapabilities.Set(FS_CAPABILITY_OPEN_ATTR_DIR, fsOps->open_attrdir); - fCapabilities.Set(FS_CAPABILITY_CLOSE_ATTR_DIR, fsOps->close_attrdir); + fCapabilities.Set(FS_CAPABILITY_OPEN_ATTR_DIR, fFSOps->open_attrdir); + fCapabilities.Set(FS_CAPABILITY_CLOSE_ATTR_DIR, fFSOps->close_attrdir); fCapabilities.Set(FS_CAPABILITY_FREE_ATTR_DIR_COOKIE, - fsOps->free_attrdircookie); - fCapabilities.Set(FS_CAPABILITY_READ_ATTR_DIR, fsOps->read_attrdir); - fCapabilities.Set(FS_CAPABILITY_REWIND_ATTR_DIR, fsOps->rewind_attrdir); + fFSOps->free_attrdircookie); + fCapabilities.Set(FS_CAPABILITY_READ_ATTR_DIR, fFSOps->read_attrdir); + fCapabilities.Set(FS_CAPABILITY_REWIND_ATTR_DIR, fFSOps->rewind_attrdir); // attribute operations // we emulate open_attr() and free_attr_dir_cookie() if either read_attr() // or write_attr() is present - bool hasAttributes = (fsOps->read_attr || fsOps->write_attr); + bool hasAttributes = (fFSOps->read_attr || fFSOps->write_attr); fCapabilities.Set(FS_CAPABILITY_CREATE_ATTR, hasAttributes); fCapabilities.Set(FS_CAPABILITY_OPEN_ATTR, hasAttributes); fCapabilities.Set(FS_CAPABILITY_CLOSE_ATTR, false); fCapabilities.Set(FS_CAPABILITY_FREE_ATTR_COOKIE, hasAttributes); - fCapabilities.Set(FS_CAPABILITY_READ_ATTR, fsOps->read_attr); - fCapabilities.Set(FS_CAPABILITY_WRITE_ATTR, fsOps->write_attr); + fCapabilities.Set(FS_CAPABILITY_READ_ATTR, fFSOps->read_attr); + fCapabilities.Set(FS_CAPABILITY_WRITE_ATTR, fFSOps->write_attr); - fCapabilities.Set(FS_CAPABILITY_READ_ATTR_STAT, fsOps->stat_attr); + fCapabilities.Set(FS_CAPABILITY_READ_ATTR_STAT, fFSOps->stat_attr); // missing: FS_CAPABILITY_WRITE_ATTR_STAT - fCapabilities.Set(FS_CAPABILITY_RENAME_ATTR, fsOps->rename_attr); - fCapabilities.Set(FS_CAPABILITY_REMOVE_ATTR, fsOps->remove_attr); + fCapabilities.Set(FS_CAPABILITY_RENAME_ATTR, fFSOps->rename_attr); + fCapabilities.Set(FS_CAPABILITY_REMOVE_ATTR, fFSOps->remove_attr); // index directory & index operations - fCapabilities.Set(FS_CAPABILITY_OPEN_INDEX_DIR, fsOps->open_indexdir); - fCapabilities.Set(FS_CAPABILITY_CLOSE_INDEX_DIR, fsOps->close_indexdir); + fCapabilities.Set(FS_CAPABILITY_OPEN_INDEX_DIR, fFSOps->open_indexdir); + fCapabilities.Set(FS_CAPABILITY_CLOSE_INDEX_DIR, fFSOps->close_indexdir); fCapabilities.Set(FS_CAPABILITY_FREE_INDEX_DIR_COOKIE, - fsOps->free_indexdircookie); - fCapabilities.Set(FS_CAPABILITY_READ_INDEX_DIR, fsOps->read_indexdir); - fCapabilities.Set(FS_CAPABILITY_REWIND_INDEX_DIR, fsOps->rewind_indexdir); + fFSOps->free_indexdircookie); + fCapabilities.Set(FS_CAPABILITY_READ_INDEX_DIR, fFSOps->read_indexdir); + fCapabilities.Set(FS_CAPABILITY_REWIND_INDEX_DIR, fFSOps->rewind_indexdir); - fCapabilities.Set(FS_CAPABILITY_CREATE_INDEX, fsOps->create_index); - fCapabilities.Set(FS_CAPABILITY_REMOVE_INDEX, fsOps->remove_index); - fCapabilities.Set(FS_CAPABILITY_READ_INDEX_STAT, fsOps->stat_index); + fCapabilities.Set(FS_CAPABILITY_CREATE_INDEX, fFSOps->create_index); + fCapabilities.Set(FS_CAPABILITY_REMOVE_INDEX, fFSOps->remove_index); + fCapabilities.Set(FS_CAPABILITY_READ_INDEX_STAT, fFSOps->stat_index); // query operations - fCapabilities.Set(FS_CAPABILITY_OPEN_QUERY, fsOps->open_query); - fCapabilities.Set(FS_CAPABILITY_CLOSE_QUERY, fsOps->close_query); - fCapabilities.Set(FS_CAPABILITY_FREE_QUERY_COOKIE, fsOps->free_querycookie); - fCapabilities.Set(FS_CAPABILITY_READ_QUERY, fsOps->read_query); + fCapabilities.Set(FS_CAPABILITY_OPEN_QUERY, fFSOps->open_query); + fCapabilities.Set(FS_CAPABILITY_CLOSE_QUERY, fFSOps->close_query); + fCapabilities.Set(FS_CAPABILITY_FREE_QUERY_COOKIE, + fFSOps->free_querycookie); + fCapabilities.Set(FS_CAPABILITY_READ_QUERY, fFSOps->read_query); // missing: FS_CAPABILITY_REWIND_QUERY, } Modified: haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/BeOSKernelFileSystem.h =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/BeOSKernelFileSystem.h 2007-03-06 01:22:47 UTC (rev 20339) +++ haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/BeOSKernelFileSystem.h 2007-03-06 02:39:34 UTC (rev 20340) @@ -18,7 +18,7 @@ virtual status_t DeleteVolume(Volume* volume); private: - void _InitCapabilities(beos_vnode_ops* fsOps); + void _InitCapabilities(); private: beos_vnode_ops* fFSOps; Copied: haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/HaikuKernelFileSystem.cpp (from rev 20331, haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/BeOSKernelFileSystem.cpp) =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/BeOSKernelFileSystem.cpp 2007-03-05 05:16:08 UTC (rev 20331) +++ haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/HaikuKernelFileSystem.cpp 2007-03-06 02:39:34 UTC (rev 20340) @@ -0,0 +1,159 @@ +// HaikuKernelFileSystem.cpp + +#include "HaikuKernelFileSystem.h" + +#include + +#include + +#include "HaikuKernelVolume.h" + +using std::nothrow; + +// constructor +HaikuKernelFileSystem::HaikuKernelFileSystem(file_system_module_info* fsModule) + : FileSystem(), + fFSModule(fsModule) +{ + _InitCapabilities(); +} + +// destructor +HaikuKernelFileSystem::~HaikuKernelFileSystem() +{ +} + +// CreateVolume +status_t +HaikuKernelFileSystem::CreateVolume(Volume** volume, mount_id id) +{ + // check initialization and parameters + if (!fFSModule || !volume) + return B_BAD_VALUE; + + // create the volume + *volume = new(nothrow) HaikuKernelVolume(this, id, fFSModule); + if (!*volume) + return B_NO_MEMORY; + return B_OK; +} + +// DeleteVolume +status_t +HaikuKernelFileSystem::DeleteVolume(Volume* volume) +{ + if (!volume || !dynamic_cast(volume)) + return B_BAD_VALUE; + delete volume; + return B_OK; +} + +// _InitCapabilities +void +HaikuKernelFileSystem::_InitCapabilities() +{ + fCapabilities.ClearAll(); + + // FS interface type + fCapabilities.clientFSType = CLIENT_FS_HAIKU_KERNEL; + + // FS operations + fCapabilities.Set(FS_CAPABILITY_MOUNT, fFSModule->mount); + fCapabilities.Set(FS_CAPABILITY_UNMOUNT, fFSModule->unmount); + + fCapabilities.Set(FS_CAPABILITY_READ_FS_INFO, fFSModule->read_fs_info); + fCapabilities.Set(FS_CAPABILITY_WRITE_FS_INFO, fFSModule->write_fs_info); + fCapabilities.Set(FS_CAPABILITY_SYNC, fFSModule->sync); + + // vnode operations + fCapabilities.Set(FS_CAPABILITY_LOOKUP, fFSModule->lookup); + fCapabilities.Set(FS_CAPABILITY_GET_VNODE_NAME, fFSModule->get_vnode_name); + + fCapabilities.Set(FS_CAPABILITY_GET_VNODE, fFSModule->get_vnode); + fCapabilities.Set(FS_CAPABILITY_PUT_VNODE, fFSModule->put_vnode); + fCapabilities.Set(FS_CAPABILITY_REMOVE_VNODE, fFSModule->remove_vnode); + + // VM file access + fCapabilities.Set(FS_CAPABILITY_CAN_PAGE, fFSModule->can_page); + fCapabilities.Set(FS_CAPABILITY_READ_PAGES, fFSModule->read_pages); + fCapabilities.Set(FS_CAPABILITY_WRITE_PAGES, fFSModule->write_pages); + + // cache file access + fCapabilities.Set(FS_CAPABILITY_GET_FILE_MAP, fFSModule->get_file_map); + + // common operations + fCapabilities.Set(FS_CAPABILITY_IOCTL, fFSModule->ioctl); + fCapabilities.Set(FS_CAPABILITY_SET_FLAGS, fFSModule->set_flags); + fCapabilities.Set(FS_CAPABILITY_SELECT, fFSModule->select); + fCapabilities.Set(FS_CAPABILITY_DESELECT, fFSModule->deselect); + fCapabilities.Set(FS_CAPABILITY_FSYNC, fFSModule->fsync); + + fCapabilities.Set(FS_CAPABILITY_READ_SYMLINK, fFSModule->read_symlink); + fCapabilities.Set(FS_CAPABILITY_CREATE_SYMLINK, fFSModule->create_symlink); + + fCapabilities.Set(FS_CAPABILITY_LINK, fFSModule->link); + fCapabilities.Set(FS_CAPABILITY_UNLINK, fFSModule->unlink); + fCapabilities.Set(FS_CAPABILITY_RENAME, fFSModule->rename); + + fCapabilities.Set(FS_CAPABILITY_ACCESS, fFSModule->access); + fCapabilities.Set(FS_CAPABILITY_READ_STAT, fFSModule->read_stat); + fCapabilities.Set(FS_CAPABILITY_WRITE_STAT, fFSModule->write_stat); + + // file operations + fCapabilities.Set(FS_CAPABILITY_CREATE, fFSModule->create); + fCapabilities.Set(FS_CAPABILITY_OPEN, fFSModule->open); + fCapabilities.Set(FS_CAPABILITY_CLOSE, fFSModule->close); + fCapabilities.Set(FS_CAPABILITY_FREE_COOKIE, fFSModule->free_cookie); + fCapabilities.Set(FS_CAPABILITY_READ, fFSModule->read); + fCapabilities.Set(FS_CAPABILITY_WRITE, fFSModule->write); + + // directory operations + fCapabilities.Set(FS_CAPABILITY_CREATE_DIR, fFSModule->create_dir); + fCapabilities.Set(FS_CAPABILITY_REMOVE_DIR, fFSModule->remove_dir); + fCapabilities.Set(FS_CAPABILITY_OPEN_DIR, fFSModule->open_dir); + fCapabilities.Set(FS_CAPABILITY_CLOSE_DIR, fFSModule->close_dir); + fCapabilities.Set(FS_CAPABILITY_FREE_DIR_COOKIE, fFSModule->free_dir_cookie); + fCapabilities.Set(FS_CAPABILITY_READ_DIR, fFSModule->read_dir); + fCapabilities.Set(FS_CAPABILITY_REWIND_DIR, fFSModule->rewind_dir); + + // attribute directory operations + fCapabilities.Set(FS_CAPABILITY_OPEN_ATTR_DIR, fFSModule->open_attr_dir); + fCapabilities.Set(FS_CAPABILITY_CLOSE_ATTR_DIR, fFSModule->close_attr_dir); + fCapabilities.Set(FS_CAPABILITY_FREE_ATTR_DIR_COOKIE, + fFSModule->free_attr_dir_cookie); + fCapabilities.Set(FS_CAPABILITY_READ_ATTR_DIR, fFSModule->read_attr_dir); + fCapabilities.Set(FS_CAPABILITY_REWIND_ATTR_DIR, fFSModule->rewind_attr_dir); + + // attribute operations + fCapabilities.Set(FS_CAPABILITY_CREATE_ATTR, fFSModule->create_attr); + fCapabilities.Set(FS_CAPABILITY_OPEN_ATTR, fFSModule->open_attr); + fCapabilities.Set(FS_CAPABILITY_CLOSE_ATTR, fFSModule->close_attr); + fCapabilities.Set(FS_CAPABILITY_FREE_ATTR_COOKIE, + fFSModule->free_attr_cookie); + fCapabilities.Set(FS_CAPABILITY_READ_ATTR, fFSModule->read_attr); + fCapabilities.Set(FS_CAPABILITY_WRITE_ATTR, fFSModule->write_attr); + + fCapabilities.Set(FS_CAPABILITY_READ_ATTR_STAT, fFSModule->read_attr_stat); + fCapabilities.Set(FS_CAPABILITY_READ_ATTR_STAT, fFSModule->write_attr_stat); + fCapabilities.Set(FS_CAPABILITY_RENAME_ATTR, fFSModule->rename_attr); + fCapabilities.Set(FS_CAPABILITY_REMOVE_ATTR, fFSModule->remove_attr); + + // index directory & index operations + fCapabilities.Set(FS_CAPABILITY_OPEN_INDEX_DIR, fFSModule->open_index_dir); + fCapabilities.Set(FS_CAPABILITY_CLOSE_INDEX_DIR, fFSModule->close_index_dir); + fCapabilities.Set(FS_CAPABILITY_FREE_INDEX_DIR_COOKIE, + fFSModule->free_index_dir_cookie); + fCapabilities.Set(FS_CAPABILITY_READ_INDEX_DIR, fFSModule->read_index_dir); + fCapabilities.Set(FS_CAPABILITY_REWIND_INDEX_DIR, fFSModule->rewind_index_dir); + + fCapabilities.Set(FS_CAPABILITY_CREATE_INDEX, fFSModule->create_index); + fCapabilities.Set(FS_CAPABILITY_REMOVE_INDEX, fFSModule->remove_index); + fCapabilities.Set(FS_CAPABILITY_READ_INDEX_STAT, fFSModule->read_index_stat); + + // query operations + fCapabilities.Set(FS_CAPABILITY_OPEN_QUERY, fFSModule->open_query); + fCapabilities.Set(FS_CAPABILITY_CLOSE_QUERY, fFSModule->close_query); + fCapabilities.Set(FS_CAPABILITY_FREE_QUERY_COOKIE, fFSModule->free_query_cookie); + fCapabilities.Set(FS_CAPABILITY_READ_QUERY, fFSModule->read_query); + fCapabilities.Set(FS_CAPABILITY_REWIND_QUERY, fFSModule->rewind_query); +} Copied: haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/HaikuKernelFileSystem.h (from rev 20331, haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/BeOSKernelFileSystem.h) =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/BeOSKernelFileSystem.h 2007-03-05 05:16:08 UTC (rev 20331) +++ haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/HaikuKernelFileSystem.h 2007-03-06 02:39:34 UTC (rev 20340) @@ -0,0 +1,32 @@ +// HaikuKernelFileSystem.h + +#ifndef USERLAND_FS_HAIKU_KERNEL_FILE_SYSTEM_H +#define USERLAND_FS_HAIKU_KERNEL_FILE_SYSTEM_H + +#include "FileSystem.h" + +struct file_system_module_info; + +namespace UserlandFS { + +class HaikuKernelFileSystem : public FileSystem { +public: + HaikuKernelFileSystem( + file_system_module_info* fsModule); + virtual ~HaikuKernelFileSystem(); + + virtual status_t CreateVolume(Volume** volume, mount_id id); + virtual status_t DeleteVolume(Volume* volume); + +private: + void _InitCapabilities(); + +private: + file_system_module_info* fFSModule; +}; + +} // namespace UserlandFS + +using UserlandFS::HaikuKernelFileSystem; + +#endif // USERLAND_FS_HAIKU_KERNEL_FILE_SYSTEM_H Copied: haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/HaikuKernelVolume.cpp (from rev 20331, haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/BeOSKernelVolume.cpp) =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/BeOSKernelVolume.cpp 2007-03-05 05:16:08 UTC (rev 20331) +++ haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/HaikuKernelVolume.cpp 2007-03-06 02:39:34 UTC (rev 20340) @@ -0,0 +1,675 @@ +// HaikuKernelVolume.cpp + +#include "HaikuKernelVolume.h" + +#include + +#include +#include + +#include "Debug.h" +#include "kernel_emu.h" + + +// constructor +HaikuKernelVolume::HaikuKernelVolume(FileSystem* fileSystem, mount_id id, + file_system_module_info* fsModule) + : Volume(fileSystem, id), + fFSModule(fsModule), + fVolumeCookie(NULL) +{ +} + +// destructor +HaikuKernelVolume::~HaikuKernelVolume() +{ +} + +// #pragma mark - +// #pragma mark ----- FS ----- + +// Mount +status_t +HaikuKernelVolume::Mount(const char* device, uint32 flags, + const char* parameters, vnode_id* rootID) +{ + if (!fFSModule->mount) + return B_BAD_VALUE; + return fFSModule->mount(GetID(), device, flags, parameters, &fVolumeCookie, + rootID); +} + +// Unmount +status_t +HaikuKernelVolume::Unmount() +{ + if (!fFSModule->unmount) + return B_BAD_VALUE; + return fFSModule->unmount(fVolumeCookie); +} + +// Sync +status_t +HaikuKernelVolume::Sync() +{ + if (!fFSModule->sync) + return B_BAD_VALUE; + return fFSModule->sync(fVolumeCookie); +} + +// ReadFSInfo +status_t +HaikuKernelVolume::ReadFSInfo(fs_info* info) +{ + if (!fFSModule->read_fs_info) + return B_BAD_VALUE; + return fFSModule->read_fs_info(fVolumeCookie, info); +} + +// WriteFSInfo +status_t +HaikuKernelVolume::WriteFSInfo(const struct fs_info* info, uint32 mask) +{ + if (!fFSModule->write_fs_info) + return B_BAD_VALUE; + return fFSModule->write_fs_info(fVolumeCookie, info, mask); +} + + +// #pragma mark - vnodes + + +// Lookup +status_t +HaikuKernelVolume::Lookup(fs_vnode dir, const char* entryName, vnode_id* vnid, + int* type) +{ + if (!fFSModule->lookup) + return B_BAD_VALUE; + return fFSModule->lookup(fVolumeCookie, dir, entryName, vnid, type); +} + +// ReadVNode +status_t +HaikuKernelVolume::ReadVNode(vnode_id vnid, bool reenter, fs_vnode* node) +{ + if (!fFSModule->get_vnode) + return B_BAD_VALUE; + return fFSModule->get_vnode(fVolumeCookie, vnid, node, reenter); +} + +// WriteVNode +status_t +HaikuKernelVolume::WriteVNode(fs_vnode node, bool reenter) +{ + if (!fFSModule->put_vnode) + return B_BAD_VALUE; + return fFSModule->put_vnode(fVolumeCookie, node, reenter); +} + +// RemoveVNode +status_t +HaikuKernelVolume::RemoveVNode(fs_vnode node, bool reenter) +{ + if (!fFSModule->remove_vnode) + return B_BAD_VALUE; + return fFSModule->remove_vnode(fVolumeCookie, node, reenter); +} + + +// #pragma mark - nodes + + +// IOCtl +status_t +HaikuKernelVolume::IOCtl(fs_vnode node, fs_cookie cookie, uint32 command, + void* buffer, size_t size) +{ + if (!fFSModule->ioctl) + return B_BAD_VALUE; + return fFSModule->ioctl(fVolumeCookie, node, cookie, command, buffer, + size); +} + +// SetFlags +status_t +HaikuKernelVolume::SetFlags(fs_vnode node, fs_cookie cookie, int flags) +{ + if (!fFSModule->set_flags) + return B_BAD_VALUE; + return fFSModule->set_flags(fVolumeCookie, node, cookie, flags); +} + +// Select +status_t +HaikuKernelVolume::Select(fs_vnode node, fs_cookie cookie, uint8 event, + uint32 ref, selectsync* sync) +{ + if (!fFSModule->select) { + UserlandFS::KernelEmu::notify_select_event(sync, ref, event, false); + return B_OK; + } + return fFSModule->select(fVolumeCookie, node, cookie, event, ref, sync); +} + +// Deselect +status_t +HaikuKernelVolume::Deselect(fs_vnode node, fs_cookie cookie, uint8 event, + selectsync* sync) +{ + if (!fFSModule->select || !fFSModule->deselect) + return B_OK; + return fFSModule->deselect(fVolumeCookie, node, cookie, event, sync); +} + +// FSync +status_t +HaikuKernelVolume::FSync(fs_vnode node) +{ + if (!fFSModule->fsync) + return B_BAD_VALUE; + return fFSModule->fsync(fVolumeCookie, node); +} + +// ReadSymlink +status_t +HaikuKernelVolume::ReadSymlink(fs_vnode node, char* buffer, size_t bufferSize, + size_t* bytesRead) +{ + if (!fFSModule->read_symlink) + return B_BAD_VALUE; + + *bytesRead = bufferSize; + + return fFSModule->read_symlink(fVolumeCookie, node, buffer, bytesRead); +} + +// CreateSymlink +status_t +HaikuKernelVolume::CreateSymlink(fs_vnode dir, const char* name, + const char* target, int mode) +{ + if (!fFSModule->create_symlink) + return B_BAD_VALUE; + return fFSModule->create_symlink(fVolumeCookie, dir, name, target, mode); +} + +// Link +status_t +HaikuKernelVolume::Link(fs_vnode dir, const char* name, fs_vnode node) +{ + if (!fFSModule->link) + return B_BAD_VALUE; + return fFSModule->link(fVolumeCookie, dir, name, node); +} + +// Unlink +status_t +HaikuKernelVolume::Unlink(fs_vnode dir, const char* name) +{ + if (!fFSModule->unlink) + return B_BAD_VALUE; + return fFSModule->unlink(fVolumeCookie, dir, name); +} + +// Rename +status_t +HaikuKernelVolume::Rename(fs_vnode oldDir, const char* oldName, fs_vnode newDir, + const char* newName) +{ + if (!fFSModule->rename) + return B_BAD_VALUE; + return fFSModule->rename(fVolumeCookie, oldDir, oldName, newDir, newName); +} + +// Access +status_t +HaikuKernelVolume::Access(fs_vnode node, int mode) +{ + if (!fFSModule->access) + return B_OK; + return fFSModule->access(fVolumeCookie, node, mode); +} + +// ReadStat +status_t +HaikuKernelVolume::ReadStat(fs_vnode node, struct stat* st) +{ + if (!fFSModule->read_stat) + return B_BAD_VALUE; + return fFSModule->read_stat(fVolumeCookie, node, st); +} + +// WriteStat +status_t +HaikuKernelVolume::WriteStat(fs_vnode node, const struct stat *st, uint32 mask) +{ + if (!fFSModule->write_stat) + return B_BAD_VALUE; + return fFSModule->write_stat(fVolumeCookie, node, st, mask); +} + + +// #pragma mark - files + + +// Create +status_t +HaikuKernelVolume::Create(fs_vnode dir, const char* name, int openMode, int mode, + fs_cookie* cookie, vnode_id* vnid) +{ + if (!fFSModule->create) + return B_BAD_VALUE; + return fFSModule->create(fVolumeCookie, dir, name, openMode, mode, cookie, + vnid); +} + +// Open +status_t +HaikuKernelVolume::Open(fs_vnode node, int openMode, fs_cookie* cookie) +{ + if (!fFSModule->open) + return B_BAD_VALUE; + return fFSModule->open(fVolumeCookie, node, openMode, cookie); +} + +// Close +status_t +HaikuKernelVolume::Close(fs_vnode node, fs_cookie cookie) +{ + if (!fFSModule->close) + return B_OK; + return fFSModule->close(fVolumeCookie, node, cookie); +} + +// FreeCookie +status_t +HaikuKernelVolume::FreeCookie(fs_vnode node, fs_cookie cookie) +{ + if (!fFSModule->free_cookie) + return B_OK; + return fFSModule->free_cookie(fVolumeCookie, node, cookie); +} + +// Read +status_t +HaikuKernelVolume::Read(fs_vnode node, fs_cookie cookie, off_t pos, void* buffer, + size_t bufferSize, size_t* bytesRead) +{ + if (!fFSModule->read) + return B_BAD_VALUE; + + *bytesRead = bufferSize; + + return fFSModule->read(fVolumeCookie, node, cookie, pos, buffer, bytesRead); +} + +// Write +status_t +HaikuKernelVolume::Write(fs_vnode node, fs_cookie cookie, off_t pos, + const void* buffer, size_t bufferSize, size_t* bytesWritten) +{ + if (!fFSModule->write) + return B_BAD_VALUE; + + *bytesWritten = bufferSize; + + return fFSModule->write(fVolumeCookie, node, cookie, pos, buffer, + bytesWritten); +} + + +// #pragma mark - directories + + +// CreateDir +status_t +HaikuKernelVolume::CreateDir(fs_vnode dir, const char* name, int mode, + vnode_id *newDir) +{ + if (!fFSModule->create_dir) + return B_BAD_VALUE; + return fFSModule->create_dir(fVolumeCookie, dir, name, mode, newDir); +} + +// RemoveDir +status_t +HaikuKernelVolume::RemoveDir(fs_vnode dir, const char* name) +{ + if (!fFSModule->remove_dir) + return B_BAD_VALUE; + return fFSModule->remove_dir(fVolumeCookie, dir, name); +} + +// OpenDir +status_t +HaikuKernelVolume::OpenDir(fs_vnode node, fs_cookie* cookie) +{ + if (!fFSModule->open_dir) + return B_BAD_VALUE; + return fFSModule->open_dir(fVolumeCookie, node, cookie); +} + +// CloseDir +status_t +HaikuKernelVolume::CloseDir(fs_vnode node, fs_vnode cookie) +{ + if (!fFSModule->close_dir) + return B_OK; + return fFSModule->close_dir(fVolumeCookie, node, cookie); +} + +// FreeDirCookie +status_t +HaikuKernelVolume::FreeDirCookie(fs_vnode node, fs_vnode cookie) +{ + if (!fFSModule->free_dir_cookie) + return B_OK; + return fFSModule->free_dir_cookie(fVolumeCookie, node, cookie); +} + +// ReadDir +status_t +HaikuKernelVolume::ReadDir(fs_vnode node, fs_vnode cookie, void* buffer, + size_t bufferSize, uint32 count, uint32* countRead) +{ + if (!fFSModule->read_dir) + return B_BAD_VALUE; + + *countRead = count; + + return fFSModule->read_dir(fVolumeCookie, node, cookie, + (struct dirent*)buffer, bufferSize, countRead); +} + +// RewindDir +status_t +HaikuKernelVolume::RewindDir(fs_vnode node, fs_vnode cookie) +{ + if (!fFSModule->rewind_dir) + return B_BAD_VALUE; + return fFSModule->rewind_dir(fVolumeCookie, node, cookie); +} + + +// #pragma mark - attribute directories + + +// OpenAttrDir +status_t +HaikuKernelVolume::OpenAttrDir(fs_vnode node, fs_cookie *cookie) +{ + if (!fFSModule->open_attr_dir) + return B_BAD_VALUE; + return fFSModule->open_attr_dir(fVolumeCookie, node, cookie); +} + +// CloseAttrDir +status_t +HaikuKernelVolume::CloseAttrDir(fs_vnode node, fs_cookie cookie) +{ + if (!fFSModule->close_attr_dir) + return B_OK; + return fFSModule->close_attr_dir(fVolumeCookie, node, cookie); +} + +// FreeAttrDirCookie +status_t +HaikuKernelVolume::FreeAttrDirCookie(fs_vnode node, fs_cookie cookie) +{ + if (!fFSModule->free_attr_dir_cookie) + return B_OK; + return fFSModule->free_attr_dir_cookie(fVolumeCookie, node, cookie); +} + +// ReadAttrDir +status_t +HaikuKernelVolume::ReadAttrDir(fs_vnode node, fs_cookie cookie, void* buffer, + size_t bufferSize, uint32 count, uint32* countRead) +{ + if (!fFSModule->read_attr_dir) + return B_BAD_VALUE; + + *countRead = count; + + return fFSModule->read_attr_dir(fVolumeCookie, node, cookie, + (struct dirent*)buffer, bufferSize, countRead); +} + +// RewindAttrDir +status_t +HaikuKernelVolume::RewindAttrDir(fs_vnode node, fs_cookie cookie) +{ + if (!fFSModule->rewind_attr_dir) + return B_BAD_VALUE; + return fFSModule->rewind_attr_dir(fVolumeCookie, node, cookie); +} + + +// #pragma mark - attributes + + +// CreateAttr +status_t +HaikuKernelVolume::CreateAttr(fs_vnode node, const char* name, uint32 type, + int openMode, fs_cookie* cookie) +{ + if (!fFSModule->create_attr) + return B_BAD_VALUE; + return fFSModule->create_attr(fVolumeCookie, node, name, type, openMode, + cookie); +} + +// OpenAttr +status_t +HaikuKernelVolume::OpenAttr(fs_vnode node, const char* name, int openMode, + fs_cookie* cookie) +{ + if (!fFSModule->open_attr) + return B_BAD_VALUE; + return fFSModule->open_attr(fVolumeCookie, node, name, openMode, cookie); +} + +// CloseAttr +status_t +HaikuKernelVolume::CloseAttr(fs_vnode node, fs_cookie cookie) +{ + if (!fFSModule->close_attr) + return B_OK; + return fFSModule->close_attr(fVolumeCookie, node, cookie); +} + +// FreeAttrCookie +status_t +HaikuKernelVolume::FreeAttrCookie(fs_vnode node, fs_cookie cookie) +{ + if (!fFSModule->free_attr_cookie) + return B_OK; + return fFSModule->free_attr_cookie(fVolumeCookie, node, cookie); +} + +// ReadAttr +status_t +HaikuKernelVolume::ReadAttr(fs_vnode node, fs_cookie cookie, off_t pos, + void* buffer, size_t bufferSize, size_t* bytesRead) +{ + if (!fFSModule->read_attr) + return B_BAD_VALUE; + + *bytesRead = bufferSize; + + return fFSModule->read_attr(fVolumeCookie, node, cookie, pos, buffer, + bytesRead); +} + +// WriteAttr +status_t +HaikuKernelVolume::WriteAttr(fs_vnode node, fs_cookie cookie, off_t pos, + const void* buffer, size_t bufferSize, size_t* bytesWritten) +{ + if (!fFSModule->write_attr) + return B_BAD_VALUE; + + *bytesWritten = bufferSize; + + return fFSModule->write_attr(fVolumeCookie, node, cookie, pos, buffer, + bytesWritten); +} + +// ReadAttrStat +status_t +HaikuKernelVolume::ReadAttrStat(fs_vnode node, fs_cookie cookie, + struct stat *st) +{ + if (!fFSModule->read_attr_stat) + return B_BAD_VALUE; + return fFSModule->read_attr_stat(fVolumeCookie, node, cookie, st); +} + +// RenameAttr +status_t +HaikuKernelVolume::RenameAttr(fs_vnode oldNode, const char* oldName, + fs_vnode newNode, const char* newName) +{ + if (!fFSModule->rename_attr) + return B_BAD_VALUE; + return fFSModule->rename_attr(fVolumeCookie, oldNode, oldName, newNode, + newName); +} + +// RemoveAttr +status_t +HaikuKernelVolume::RemoveAttr(fs_vnode node, const char* name) +{ + if (!fFSModule->remove_attr) + return B_BAD_VALUE; + return fFSModule->remove_attr(fVolumeCookie, node, name); +} + + +// #pragma mark - indices + + +// OpenIndexDir +status_t +HaikuKernelVolume::OpenIndexDir(fs_cookie *cookie) +{ + if (!fFSModule->open_index_dir) + return B_BAD_VALUE; + return fFSModule->open_index_dir(fVolumeCookie, cookie); +} + +// CloseIndexDir +status_t +HaikuKernelVolume::CloseIndexDir(fs_cookie cookie) +{ + if (!fFSModule->close_index_dir) + return B_OK; + return fFSModule->close_index_dir(fVolumeCookie, cookie); +} + +// FreeIndexDirCookie +status_t +HaikuKernelVolume::FreeIndexDirCookie(fs_cookie cookie) +{ + if (!fFSModule->free_index_dir_cookie) + return B_OK; + return fFSModule->free_index_dir_cookie(fVolumeCookie, cookie); +} + +// ReadIndexDir +status_t +HaikuKernelVolume::ReadIndexDir(fs_cookie cookie, void* buffer, + size_t bufferSize, uint32 count, uint32* countRead) +{ + if (!fFSModule->read_index_dir) + return B_BAD_VALUE; + + *countRead = count; + + return fFSModule->read_index_dir(fVolumeCookie, cookie, + (struct dirent*)buffer, bufferSize, countRead); +} + +// RewindIndexDir [... truncated: 736 lines follow ...] From bonefish at mail.berlios.de Tue Mar 6 08:52:25 2007 From: bonefish at mail.berlios.de (bonefish at BerliOS) Date: Tue, 6 Mar 2007 08:52:25 +0100 Subject: [Haiku-commits] r20341 - haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server Message-ID: <200703060752.l267qPXd007751@sheep.berlios.de> Author: bonefish Date: 2007-03-06 08:52:24 +0100 (Tue, 06 Mar 2007) New Revision: 20341 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20341&view=rev Modified: haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/HaikuKernelFileSystem.cpp haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/HaikuKernelFileSystem.h haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/UserlandFSServer.cpp Log: Added missing module initialization/uninitialization. Modified: haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/HaikuKernelFileSystem.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/HaikuKernelFileSystem.cpp 2007-03-06 02:39:34 UTC (rev 20340) +++ haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/HaikuKernelFileSystem.cpp 2007-03-06 07:52:24 UTC (rev 20341) @@ -21,8 +21,21 @@ // destructor HaikuKernelFileSystem::~HaikuKernelFileSystem() { + // call the kernel module uninitialization + if (fFSModule->info.std_ops) + fFSModule->info.std_ops(B_MODULE_UNINIT); } +// Init +status_t +HaikuKernelFileSystem::Init() +{ + // call the kernel module initialization + if (!fFSModule->info.std_ops) + return B_OK; + return fFSModule->info.std_ops(B_MODULE_INIT); +} + // CreateVolume status_t HaikuKernelFileSystem::CreateVolume(Volume** volume, mount_id id) Modified: haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/HaikuKernelFileSystem.h =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/HaikuKernelFileSystem.h 2007-03-06 02:39:34 UTC (rev 20340) +++ haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/HaikuKernelFileSystem.h 2007-03-06 07:52:24 UTC (rev 20341) @@ -15,6 +15,8 @@ file_system_module_info* fsModule); virtual ~HaikuKernelFileSystem(); + status_t Init(); + virtual status_t CreateVolume(Volume** volume, mount_id id); virtual status_t DeleteVolume(Volume* volume); Modified: haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/UserlandFSServer.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/UserlandFSServer.cpp 2007-03-06 02:39:34 UTC (rev 20340) +++ haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/UserlandFSServer.cpp 2007-03-06 07:52:24 UTC (rev 20341) @@ -273,8 +273,15 @@ = new(nothrow) HaikuKernelFileSystem(module); if (!fileSystem) RETURN_ERROR(B_NO_MEMORY); + ObjectDeleter fsDeleter(fileSystem); + // init the FS + error = fileSystem->Init(); + if (error != B_OK) + return error; + // everything went fine + fsDeleter.Detach(); *_fileSystem = fileSystem; return B_OK; } From stefano.ceccherini at gmail.com Tue Mar 6 12:00:37 2007 From: stefano.ceccherini at gmail.com (Stefano Ceccherini) Date: Tue, 6 Mar 2007 12:00:37 +0100 Subject: [Haiku-commits] r20292 - in haiku/trunk: headers/os/interface headers/private/interface src/kits/interface src/servers/app In-Reply-To: <894b9700703042314n23c82bc7x27540d5368cc8a01@mail.gmail.com> References: <200703012317.l21NHh3k006324@sheep.berlios.de> <894b9700703012326n4e807560q2565907e13dc5388@mail.gmail.com> <894b9700703012331t62e57999q340690d179129286@mail.gmail.com> <894b9700703020025k4b1be976p32966129bb1aad9b@mail.gmail.com> <27558602.1172849186037.JavaMail.ngmail@webmail14> <894b9700703042314n23c82bc7x27540d5368cc8a01@mail.gmail.com> Message-ID: <894b9700703060300u55c1c545w285eac0ebae96f72@mail.gmail.com> 2007/3/5, Stefano Ceccherini : > > > I had a look at the rest of your changes and they look good, but at > > > least the last change in PictureDataWriter.cpp (20292) should be > > > reverted. > > I'm willing to revert whatever is necessary to remain compatible. > > That one should be the only necessary change. Marcus, your changes broke also another thing. BPicture state synching isn't working anymore, in fact, bug 520 is there again. The problem is change 20292 to PicturePlayer.cpp, where you removed these checks: // If we didn't read enough bytes, skip them. This is not a error // since the instructions can change over time. // Don't do that for state change ops, they don't have a fixed size if (op != B_PIC_ENTER_STATE_CHANGE && op != B_PIC_ENTER_FONT_STATE && fData.Position() - pos < size) fData.Seek(size - (fData.Position() - pos), SEEK_CUR); B_PIC_ENTER_STATE_CHANGE and B_PIC_EXIT_FONT_CHANGE are ops which are placed before a block of other ops, so if you skip the whole block, the instructions inbetween aren't executed. To test, download HotEdit from bebits. http://www.bebits.com/app/1445 Shall you do the necessary changes, or will I do them ? From kaoutsis at sch.gr Tue Mar 6 13:53:57 2007 From: kaoutsis at sch.gr (Kaoutsis) Date: Tue, 06 Mar 2007 14:53:57 +0200 EET Subject: [Haiku-commits] r20335 - haiku/trunk/src/apps/terminal In-Reply-To: <200703051459.l25ExbeW009384@sheep.berlios.de> Message-ID: <535705553-BeMail@> jackburton at BerliOS> Author: jackburton > Date: 2007-03-05 15:59:37 +0100 (Mon, 05 Mar 2007) > New Revision: 20335 > ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20335&view=rev > > Modified: > haiku/trunk/src/apps/terminal/TermApp.cpp > haiku/trunk/src/apps/terminal/TermParse.cpp > haiku/trunk/src/apps/terminal/TermWindow.cpp > Log: > Re-enabled wait_for_thread() (in place of kill_thread()) inside > TermParse's destructor. PtyReader() was hanging on read(), since the > fd was never closed. Now we do that in ~TermWindow() (for now, we > might > want to move some stuff around). Moved there the cleanup code too > (from > TermWindow::Quit()). Use B_QUIT_ON_WINDOW_CLOSE flag instead of > sending > a message to be_app in Quit(). > Stefano, i don't know, if this issue is known to you, but know terminal, don't quit properly. Bye, Vasilis From stefano.ceccherini at gmail.com Tue Mar 6 13:57:33 2007 From: stefano.ceccherini at gmail.com (Stefano Ceccherini) Date: Tue, 6 Mar 2007 13:57:33 +0100 Subject: [Haiku-commits] r20335 - haiku/trunk/src/apps/terminal In-Reply-To: <-5410242327090347482@unknownmsgid> References: <200703051459.l25ExbeW009384@sheep.berlios.de> <-5410242327090347482@unknownmsgid> Message-ID: <894b9700703060457j74d491d8kc49e0b9f8b7d8e62@mail.gmail.com> 2007/3/6, Kaoutsis : > Stefano, i don't know, if this issue is known to you, > but know terminal, don't quit properly. > Bye, > Vasilis Yeah I noticed, but I already applied a fix in rev. 20334/20335. Thanks for noticing, though :) From kaoutsis at sch.gr Wed Mar 7 00:40:39 2007 From: kaoutsis at sch.gr (Kaoutsis) Date: Wed, 07 Mar 2007 01:40:39 +0200 EET Subject: [Haiku-commits] r20335 - haiku/trunk/src/apps/terminal In-Reply-To: <894b9700703060457j74d491d8kc49e0b9f8b7d8e62@mail.gmail.com> Message-ID: <890642326-BeMail@> Stefano Ceccherini> 2007/3/6, Kaoutsis : > > > Stefano, i don't know, if this issue is known to you, > > but now terminal, don't quit properly. > > Bye, > > Vasilis > > Yeah I noticed, but I already applied a fix in rev. 20334/20335. > Thanks for noticing, though :) i forgot to mention that the problem occurred when building Terminal for r5, with r20335. Bye, Vasilis From bonefish at mail.berlios.de Wed Mar 7 07:08:49 2007 From: bonefish at mail.berlios.de (bonefish at BerliOS) Date: Wed, 7 Mar 2007 07:08:49 +0100 Subject: [Haiku-commits] r20342 - haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server Message-ID: <200703070608.l2768nsD015824@sheep.berlios.de> Author: bonefish Date: 2007-03-07 07:08:48 +0100 (Wed, 07 Mar 2007) New Revision: 20342 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20342&view=rev Modified: haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/HaikuKernelFileSystem.cpp Log: The read_attr_stat()/write_attr_stat() capabilities were not correctly set. Modified: haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/HaikuKernelFileSystem.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/HaikuKernelFileSystem.cpp 2007-03-06 07:52:24 UTC (rev 20341) +++ haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/HaikuKernelFileSystem.cpp 2007-03-07 06:08:48 UTC (rev 20342) @@ -147,7 +147,8 @@ fCapabilities.Set(FS_CAPABILITY_WRITE_ATTR, fFSModule->write_attr); fCapabilities.Set(FS_CAPABILITY_READ_ATTR_STAT, fFSModule->read_attr_stat); - fCapabilities.Set(FS_CAPABILITY_READ_ATTR_STAT, fFSModule->write_attr_stat); + fCapabilities.Set(FS_CAPABILITY_WRITE_ATTR_STAT, + fFSModule->write_attr_stat); fCapabilities.Set(FS_CAPABILITY_RENAME_ATTR, fFSModule->rename_attr); fCapabilities.Set(FS_CAPABILITY_REMOVE_ATTR, fFSModule->remove_attr); From bonefish at mail.berlios.de Wed Mar 7 07:10:28 2007 From: bonefish at mail.berlios.de (bonefish at BerliOS) Date: Wed, 7 Mar 2007 07:10:28 +0100 Subject: [Haiku-commits] r20343 - haiku/trunk/src/tests/add-ons/kernel/file_systems/userlandfs/r5/src/test/ramfs Message-ID: <200703070610.l276AStw016654@sheep.berlios.de> Author: bonefish Date: 2007-03-07 07:10:27 +0100 (Wed, 07 Mar 2007) New Revision: 20343 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20343&view=rev Modified: haiku/trunk/src/tests/add-ons/kernel/file_systems/userlandfs/r5/src/test/ramfs/kernel_interface.cpp Log: Incorrectly set uid instead of gid. Modified: haiku/trunk/src/tests/add-ons/kernel/file_systems/userlandfs/r5/src/test/ramfs/kernel_interface.cpp =================================================================== --- haiku/trunk/src/tests/add-ons/kernel/file_systems/userlandfs/r5/src/test/ramfs/kernel_interface.cpp 2007-03-07 06:08:48 UTC (rev 20342) +++ haiku/trunk/src/tests/add-ons/kernel/file_systems/userlandfs/r5/src/test/ramfs/kernel_interface.cpp 2007-03-07 06:10:27 UTC (rev 20343) @@ -559,7 +559,7 @@ node->SetUID(st->st_uid); // GID if (mask & WSTAT_GID) - node->SetUID(st->st_gid); + node->SetGID(st->st_gid); // mtime if (mask & WSTAT_MTIME) node->SetMTime(st->st_mtime); From bonefish at mail.berlios.de Wed Mar 7 07:12:58 2007 From: bonefish at mail.berlios.de (bonefish at BerliOS) Date: Wed, 7 Mar 2007 07:12:58 +0100 Subject: [Haiku-commits] r20344 - haiku/trunk/src/tests/add-ons/kernel/file_systems/userlandfs/r5/src/test/ramfs Message-ID: <200703070612.l276Cwfp020478@sheep.berlios.de> Author: bonefish Date: 2007-03-07 07:12:57 +0100 (Wed, 07 Mar 2007) New Revision: 20344 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20344&view=rev Modified: haiku/trunk/src/tests/add-ons/kernel/file_systems/userlandfs/r5/src/test/ramfs/Directory.cpp Log: Ugh! Tested the value of the symlink() symbol instead of the symLink parameter. Spotted by gcc4. :-) Modified: haiku/trunk/src/tests/add-ons/kernel/file_systems/userlandfs/r5/src/test/ramfs/Directory.cpp =================================================================== --- haiku/trunk/src/tests/add-ons/kernel/file_systems/userlandfs/r5/src/test/ramfs/Directory.cpp 2007-03-07 06:10:27 UTC (rev 20343) +++ haiku/trunk/src/tests/add-ons/kernel/file_systems/userlandfs/r5/src/test/ramfs/Directory.cpp 2007-03-07 06:12:57 UTC (rev 20344) @@ -108,7 +108,7 @@ status_t Directory::CreateSymLink(const char *name, const char *path, SymLink **symLink) { - status_t error = (name && symlink ? B_OK : B_BAD_VALUE); + status_t error = (name && symLink ? B_OK : B_BAD_VALUE); if (error == B_OK) { // create symlink if (SymLink *node = new(nothrow) SymLink(GetVolume())) { From bonefish at mail.berlios.de Wed Mar 7 07:22:19 2007 From: bonefish at mail.berlios.de (bonefish at BerliOS) Date: Wed, 7 Mar 2007 07:22:19 +0100 Subject: [Haiku-commits] r20345 - haiku/trunk/src/add-ons/kernel/file_systems Message-ID: <200703070622.l276MJFl003893@sheep.berlios.de> Author: bonefish Date: 2007-03-07 07:22:18 +0100 (Wed, 07 Mar 2007) New Revision: 20345 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20345&view=rev Added: haiku/trunk/src/add-ons/kernel/file_systems/ramfs/ Log: Mmh, apparently I have to check the copied directory itself in first. Copied: haiku/trunk/src/add-ons/kernel/file_systems/ramfs (from rev 20309, haiku/trunk/src/tests/add-ons/kernel/file_systems/userlandfs/r5/src/test/ramfs) From bonefish at mail.berlios.de Wed Mar 7 07:40:27 2007 From: bonefish at mail.berlios.de (bonefish at BerliOS) Date: Wed, 7 Mar 2007 07:40:27 +0100 Subject: [Haiku-commits] r20346 - haiku/trunk/src/add-ons/kernel/file_systems/ramfs Message-ID: <200703070640.l276eR1v004613@sheep.berlios.de> Author: bonefish Date: 2007-03-07 07:40:25 +0100 (Wed, 07 Mar 2007) New Revision: 20346 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20346&view=rev Modified: haiku/trunk/src/add-ons/kernel/file_systems/ramfs/AVLTree.h haiku/trunk/src/add-ons/kernel/file_systems/ramfs/AreaUtils.cpp haiku/trunk/src/add-ons/kernel/file_systems/ramfs/Attribute.cpp haiku/trunk/src/add-ons/kernel/file_systems/ramfs/Attribute.h haiku/trunk/src/add-ons/kernel/file_systems/ramfs/BlockAllocatorMisc.h haiku/trunk/src/add-ons/kernel/file_systems/ramfs/Directory.cpp haiku/trunk/src/add-ons/kernel/file_systems/ramfs/Entry.cpp haiku/trunk/src/add-ons/kernel/file_systems/ramfs/Entry.h haiku/trunk/src/add-ons/kernel/file_systems/ramfs/File.cpp haiku/trunk/src/add-ons/kernel/file_systems/ramfs/List.h haiku/trunk/src/add-ons/kernel/file_systems/ramfs/Locking.h haiku/trunk/src/add-ons/kernel/file_systems/ramfs/Node.cpp haiku/trunk/src/add-ons/kernel/file_systems/ramfs/Node.h haiku/trunk/src/add-ons/kernel/file_systems/ramfs/NodeChildTable.h haiku/trunk/src/add-ons/kernel/file_systems/ramfs/Query.cpp haiku/trunk/src/add-ons/kernel/file_systems/ramfs/SymLink.cpp haiku/trunk/src/add-ons/kernel/file_systems/ramfs/TwoKeyAVLTree.h haiku/trunk/src/add-ons/kernel/file_systems/ramfs/Volume.cpp haiku/trunk/src/add-ons/kernel/file_systems/ramfs/Volume.h haiku/trunk/src/add-ons/kernel/file_systems/ramfs/kernel_interface.cpp Log: *sigh* svn really messed it up. I supposed one should make sure to run update on the directory to be copied before doing it, even if it is up to date. Anyway: Ported RamFS to Haiku's FS interface. Change set apparently merged with older changes. Modified: haiku/trunk/src/add-ons/kernel/file_systems/ramfs/AVLTree.h =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/ramfs/AVLTree.h 2007-03-07 06:22:18 UTC (rev 20345) +++ haiku/trunk/src/add-ons/kernel/file_systems/ramfs/AVLTree.h 2007-03-07 06:40:25 UTC (rev 20346) @@ -30,10 +30,14 @@ #include +#include + #include #include "Misc.h" +using std::nothrow; + // maximal height of a tree static const int kMaxAVLTreeHeight = 32; Modified: haiku/trunk/src/add-ons/kernel/file_systems/ramfs/AreaUtils.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/ramfs/AreaUtils.cpp 2007-03-07 06:22:18 UTC (rev 20345) +++ haiku/trunk/src/add-ons/kernel/file_systems/ramfs/AreaUtils.cpp 2007-03-07 06:40:25 UTC (rev 20346) @@ -25,11 +25,11 @@ // dealings in this Software without prior written authorization of the // copyright holder. -#include #include #include "AreaUtils.h" #include "Debug.h" +#include "Misc.h" #ifndef USE_STANDARD_FUNCTIONS #define USE_STANDARD_FUNCTIONS 0 Modified: haiku/trunk/src/add-ons/kernel/file_systems/ramfs/Attribute.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/ramfs/Attribute.cpp 2007-03-07 06:22:18 UTC (rev 20345) +++ haiku/trunk/src/add-ons/kernel/file_systems/ramfs/Attribute.cpp 2007-03-07 06:40:25 UTC (rev 20346) @@ -47,6 +47,21 @@ } } +// SetSize +status_t +Attribute::SetSize(off_t newSize) +{ + status_t error = B_OK; + off_t oldSize = DataContainer::GetSize(); + if (newSize != oldSize) { + if (fNode) + fNode->MarkModified(B_STAT_MODIFICATION_TIME); + + error = DataContainer::Resize(newSize); + } + return error; +} + // WriteAt status_t Attribute::WriteAt(off_t offset, const void *buffer, size_t size, @@ -74,7 +89,7 @@ // node has been changed if (fNode && size > 0) - fNode->MarkModified(); + fNode->MarkModified(B_STAT_MODIFICATION_TIME); return error; } Modified: haiku/trunk/src/add-ons/kernel/file_systems/ramfs/Attribute.h =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/ramfs/Attribute.h 2007-03-07 06:22:18 UTC (rev 20345) +++ haiku/trunk/src/add-ons/kernel/file_systems/ramfs/Attribute.h 2007-03-07 06:40:25 UTC (rev 20346) @@ -28,6 +28,9 @@ void SetType(uint32 type); uint32 GetType() const { return fType; } + status_t SetSize(off_t newSize); + off_t GetSize() const { return DataContainer::GetSize(); } + virtual status_t WriteAt(off_t offset, const void *buffer, size_t size, size_t *bytesWritten); Modified: haiku/trunk/src/add-ons/kernel/file_systems/ramfs/BlockAllocatorMisc.h =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/ramfs/BlockAllocatorMisc.h 2007-03-07 06:22:18 UTC (rev 20345) +++ haiku/trunk/src/add-ons/kernel/file_systems/ramfs/BlockAllocatorMisc.h 2007-03-07 06:40:25 UTC (rev 20346) @@ -33,4 +33,4 @@ { return (size ? bucket_containing_size(size - 1) + 1 : 0); } -#endif BLOCK_ALLOCATOR_MISC_H +#endif // BLOCK_ALLOCATOR_MISC_H Modified: haiku/trunk/src/add-ons/kernel/file_systems/ramfs/Directory.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/ramfs/Directory.cpp 2007-03-07 06:22:18 UTC (rev 20345) +++ haiku/trunk/src/add-ons/kernel/file_systems/ramfs/Directory.cpp 2007-03-07 06:40:25 UTC (rev 20346) @@ -108,7 +108,7 @@ status_t Directory::CreateSymLink(const char *name, const char *path, SymLink **symLink) { - status_t error = (name && symlink ? B_OK : B_BAD_VALUE); + status_t error = (name && symLink ? B_OK : B_BAD_VALUE); if (error == B_OK) { // create symlink if (SymLink *node = new(nothrow) SymLink(GetVolume())) { @@ -136,7 +136,7 @@ entry->SetParent(this); error = GetVolume()->EntryAdded(GetID(), entry); if (error == B_OK) { - MarkModified(); + MarkModified(B_STAT_MODIFICATION_TIME); } else { fEntries.Remove(entry); entry->SetParent(NULL); @@ -213,7 +213,7 @@ if (error == B_OK) { fEntries.Remove(entry); entry->SetParent(NULL); - MarkModified(); + MarkModified(B_STAT_MODIFICATION_TIME); } } } Modified: haiku/trunk/src/add-ons/kernel/file_systems/ramfs/Entry.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/ramfs/Entry.cpp 2007-03-07 06:22:18 UTC (rev 20345) +++ haiku/trunk/src/add-ons/kernel/file_systems/ramfs/Entry.cpp 2007-03-07 06:40:25 UTC (rev 20346) @@ -68,10 +68,7 @@ { status_t error = (newName ? B_OK : B_BAD_VALUE); if (error == B_OK) { - if (fName.SetTo(newName)) { -// if (fNode) -// fNode->MarkModified(); - } else + if (!fName.SetTo(newName)) SET_ERROR(error, B_NO_MEMORY); } return error; Modified: haiku/trunk/src/add-ons/kernel/file_systems/ramfs/Entry.h =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/ramfs/Entry.h 2007-03-07 06:22:18 UTC (rev 20345) +++ haiku/trunk/src/add-ons/kernel/file_systems/ramfs/Entry.h 2007-03-07 06:40:25 UTC (rev 20346) @@ -3,10 +3,10 @@ #ifndef ENTRY_H #define ENTRY_H +#include #include #include "DLList.h" -#include "fsproto.h" #include "String.h" class AllocationInfo; Modified: haiku/trunk/src/add-ons/kernel/file_systems/ramfs/File.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/ramfs/File.cpp 2007-03-07 06:22:18 UTC (rev 20345) +++ haiku/trunk/src/add-ons/kernel/file_systems/ramfs/File.cpp 2007-03-07 06:40:25 UTC (rev 20346) @@ -34,9 +34,12 @@ off_t oldSize = DataContainer::GetSize(); status_t error = DataContainer::WriteAt(offset, buffer, size, bytesWritten); - MarkModified(); + MarkModified(B_STAT_MODIFICATION_TIME); + // update the size index, if our size has changed if (oldSize != DataContainer::GetSize()) { + MarkModified(B_STAT_SIZE); + if (SizeIndex *index = GetVolume()->GetSizeIndex()) index->Changed(this, oldSize); } @@ -51,7 +54,7 @@ off_t oldSize = DataContainer::GetSize(); if (newSize != oldSize) { error = DataContainer::Resize(newSize); - MarkModified(); + MarkModified(B_STAT_SIZE); // update the size index if (SizeIndex *index = GetVolume()->GetSizeIndex()) index->Changed(this, oldSize); Modified: haiku/trunk/src/add-ons/kernel/file_systems/ramfs/List.h =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/ramfs/List.h 2007-03-07 06:22:18 UTC (rev 20345) +++ haiku/trunk/src/add-ons/kernel/file_systems/ramfs/List.h 2007-03-07 06:40:25 UTC (rev 20346) @@ -101,7 +101,7 @@ // sDefaultItem template -List::item_t +typename List::item_t List::sDefaultItem( DEFAULT_ITEM_SUPPLIER::GetItem()); @@ -129,7 +129,7 @@ // GetDefaultItem template inline -const List::item_t & +const typename List::item_t & List::GetDefaultItem() const { return sDefaultItem; @@ -138,7 +138,7 @@ // GetDefaultItem template inline -List::item_t & +typename List::item_t & List::GetDefaultItem() { return sDefaultItem; @@ -310,7 +310,7 @@ // ItemAt template -const List::item_t & +const typename List::item_t & List::ItemAt(int32 index) const { if (index >= 0 && index < fItemCount) @@ -320,7 +320,7 @@ // ItemAt template -List::item_t & +typename List::item_t & List::ItemAt(int32 index) { if (index >= 0 && index < fItemCount) @@ -330,7 +330,7 @@ // Items template -const List::item_t * +const typename List::item_t * List::Items() const { return fItems; Modified: haiku/trunk/src/add-ons/kernel/file_systems/ramfs/Locking.h =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/ramfs/Locking.h 2007-03-07 06:22:18 UTC (rev 20345) +++ haiku/trunk/src/add-ons/kernel/file_systems/ramfs/Locking.h 2007-03-07 06:40:25 UTC (rev 20346) @@ -11,4 +11,4 @@ typedef AutoLocker > VolumeReadLocker; typedef AutoLocker > VolumeWriteLocker; -#endif LOCKING_H +#endif // LOCKING_H Modified: haiku/trunk/src/add-ons/kernel/file_systems/ramfs/Node.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/ramfs/Node.cpp 2007-03-07 06:22:18 UTC (rev 20345) +++ haiku/trunk/src/add-ons/kernel/file_systems/ramfs/Node.cpp 2007-03-07 06:40:25 UTC (rev 20346) @@ -37,7 +37,7 @@ fMTime(0), fCTime(0), fCrTime(0), - fModified(false), + fModified(0), fIsKnownToVFS(false), // attribute management fAttributes(), @@ -85,7 +85,7 @@ Node::AddReference() { if (++fRefCount == 1) { - status_t error = GetVolume()->NewVNode(this); + status_t error = GetVolume()->PublishVNode(this); if (error != B_OK) { fRefCount--; return error; @@ -217,7 +217,7 @@ if (error == B_OK) { fAttributes.Insert(attribute); attribute->SetNode(this); - MarkModified(); + MarkModified(B_STAT_MODIFICATION_TIME); } } return error; @@ -258,7 +258,7 @@ if (error == B_OK) { fAttributes.Remove(attribute); attribute->SetNode(NULL); - MarkModified(); + MarkModified(B_STAT_MODIFICATION_TIME); } } } Modified: haiku/trunk/src/add-ons/kernel/file_systems/ramfs/Node.h =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/ramfs/Node.h 2007-03-07 06:22:18 UTC (rev 20345) +++ haiku/trunk/src/add-ons/kernel/file_systems/ramfs/Node.h 2007-03-07 06:40:25 UTC (rev 20346) @@ -3,11 +3,11 @@ #ifndef NODE_H #define NODE_H -#include +#include +#include #include "Attribute.h" #include "Entry.h" -#include "fsproto.h" #include "String.h" class AllocationInfo; @@ -61,10 +61,10 @@ { fMode = fMode & ~S_IUMSK | mode & S_IUMSK; } inline mode_t GetMode() const { return fMode; } - inline void SetUID(uid_t uid) { fUID = uid; } + inline void SetUID(uid_t uid) { fUID = uid; MarkModified(B_STAT_UID); } inline uid_t GetUID() const { return fUID; } - inline void SetGID(uid_t gid) { fGID = gid; } + inline void SetGID(uid_t gid) { fGID = gid; MarkModified(B_STAT_GID); } inline uid_t GetGID() const { return fGID; } inline void SetATime(time_t aTime) { fATime = aTime; } @@ -79,9 +79,8 @@ inline void SetCrTime(time_t crTime) { fCrTime = crTime; } inline time_t GetCrTime() const { return fCrTime; } - inline void MarkModified() { fModified = true; } - inline void MarkUnmodified(); - inline void SetModified(bool modified) { fModified = modified; } + inline void MarkModified(uint32 flags) { fModified |= flags; } + inline uint32 MarkUnmodified(); inline bool IsModified() const { return fModified; } status_t CheckPermissions(int mode) const; @@ -118,7 +117,7 @@ time_t fMTime; time_t fCTime; time_t fCrTime; - bool fModified; + uint32 fModified; bool fIsKnownToVFS; // attribute management @@ -131,14 +130,16 @@ // MarkUnmodified inline -void +uint32 Node::MarkUnmodified() { - if (fModified) { + uint32 modified = fModified; + if (modified) { fCTime = time(NULL); SetMTime(fCTime); - fModified = false; + fModified = 0; } + return modified; } // open_mode_to_access Modified: haiku/trunk/src/add-ons/kernel/file_systems/ramfs/NodeChildTable.h =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/ramfs/NodeChildTable.h 2007-03-07 06:22:18 UTC (rev 20345) +++ haiku/trunk/src/add-ons/kernel/file_systems/ramfs/NodeChildTable.h 2007-03-07 06:40:25 UTC (rev 20346) @@ -224,7 +224,7 @@ // _FindElement template -NodeChildTable::Element * +typename NodeChildTable::Element * NodeChildTable::_FindElement(vnode_id id, const char *name) const { Modified: haiku/trunk/src/add-ons/kernel/file_systems/ramfs/Query.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/ramfs/Query.cpp 2007-03-07 06:22:18 UTC (rev 20345) +++ haiku/trunk/src/add-ons/kernel/file_systems/ramfs/Query.cpp 2007-03-07 06:40:25 UTC (rev 20346) @@ -1449,13 +1449,13 @@ { skipWhitespace(expr); - bool not = false; + bool nott = false; // note: not is a C++ keyword if (**expr == '!') { skipWhitespace(expr, 1); if (**expr != '(') return NULL; - not = true; + nott = true; } if (**expr == ')') { @@ -1475,7 +1475,7 @@ // If the term is negated, we just complement the tree, to get // rid of the not, a.k.a. DeMorgan's Law. - if (not) + if (nott) term->Complement(); skipWhitespace(expr, 1); @@ -1686,6 +1686,22 @@ } +static void +send_entry_notification(port_id port, int32 token, Volume* volume, Entry* entry, + bool created) +{ + if (created) { + notify_query_entry_created(port, token, volume->GetID(), + entry->GetParent()->GetID(), entry->GetName(), + entry->GetNode()->GetID()); + } else { + notify_query_entry_removed(port, token, volume->GetID(), + entry->GetParent()->GetID(), entry->GetName(), + entry->GetNode()->GetID()); + } +} + + void Query::LiveUpdate(Entry *entry, Node* node, const char *attribute, int32 type, const uint8 *oldKey, size_t oldLength, const uint8 *newKey, @@ -1717,7 +1733,7 @@ type, newKey, newLength); PRINT((" oldStatus: 0x%lx, newStatus: 0x%lx\n", oldStatus, newStatus)); - int32 op; + bool created; if (oldStatus == MATCH_OK && newStatus == MATCH_OK) { // only send out a notification if the name was changed if (oldKey == NULL || strcmp(attribute,"name")) @@ -1726,33 +1742,29 @@ if (entry) { // entry should actually always be given, when the changed // attribute is the entry name -PRINT(("send_notification(): old: B_ENTRY_REMOVED\n")); - send_notification(fPort, fToken, B_QUERY_UPDATE, B_ENTRY_REMOVED, - fVolume->GetID(), 0, entry->GetParent()->GetID(), 0, - entry->GetNode()->GetID(), (const char *)oldKey); +PRINT(("notification: old: removed\n")); + notify_query_entry_removed(fPort, fToken, fVolume->GetID(), + entry->GetParent()->GetID(), (const char *)oldKey, + entry->GetNode()->GetID()); } - op = B_ENTRY_CREATED; + created = true; } else if (oldStatus != MATCH_OK && newStatus != MATCH_OK) { // nothing has changed return; } else if (oldStatus == MATCH_OK && newStatus != MATCH_OK) - op = B_ENTRY_REMOVED; + created = false; else - op = B_ENTRY_CREATED; + created = true; // We send a notification for the given entry, if any, or otherwise for // all entries referring to the node; if (entry) { -PRINT(("send_notification(): new: %s\n", (op == B_ENTRY_REMOVED ? "B_ENTRY_REMOVED" : "B_ENTRY_CREATED"))); - send_notification(fPort, fToken, B_QUERY_UPDATE, op, fVolume->GetID(), - 0, entry->GetParent()->GetID(), 0, entry->GetNode()->GetID(), - entry->GetName()); +PRINT(("notification: new: %s\n", (created ? "created" : "removed"))); + send_entry_notification(fPort, fToken, fVolume, entry, created); } else { entry = node->GetFirstReferrer(); while (entry) { - send_notification(fPort, fToken, B_QUERY_UPDATE, op, - fVolume->GetID(), 0, entry->GetParent()->GetID(), 0, - entry->GetNode()->GetID(), entry->GetName()); + send_entry_notification(fPort, fToken, fVolume, entry, created); entry = node->GetNextReferrer(entry); } } Modified: haiku/trunk/src/add-ons/kernel/file_systems/ramfs/SymLink.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/ramfs/SymLink.cpp 2007-03-07 06:22:18 UTC (rev 20345) +++ haiku/trunk/src/add-ons/kernel/file_systems/ramfs/SymLink.cpp 2007-03-07 06:40:25 UTC (rev 20346) @@ -28,7 +28,7 @@ int32 oldSize = GetLinkedPathLength(); if (error == B_OK && newSize < oldSize) { fLinkedPath.Truncate(newSize); - MarkModified(); + MarkModified(B_STAT_SIZE); // update the size index if (SizeIndex *index = GetVolume()->GetSizeIndex()) index->Changed(this, oldSize); @@ -50,9 +50,11 @@ int32 oldLen = GetLinkedPathLength(); int32 len = strnlen(path, PATH_MAX - 1); if (fLinkedPath.SetTo(path, len)) { - MarkModified(); + MarkModified(B_STAT_MODIFICATION_TIME); // update the size index, if necessary if (len != oldLen) { + MarkModified(B_STAT_SIZE); + if (SizeIndex *index = GetVolume()->GetSizeIndex()) index->Changed(this, oldLen); } Modified: haiku/trunk/src/add-ons/kernel/file_systems/ramfs/TwoKeyAVLTree.h =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/ramfs/TwoKeyAVLTree.h 2007-03-07 06:22:18 UTC (rev 20345) +++ haiku/trunk/src/add-ons/kernel/file_systems/ramfs/TwoKeyAVLTree.h 2007-03-07 06:40:25 UTC (rev 20346) @@ -141,6 +141,8 @@ GetKey; typedef AVLTree BaseClass; +public: + typedef typename BaseClass::Iterator Iterator; public: TwoKeyAVLTree(); @@ -210,7 +212,7 @@ TWO_KEY_AVL_TREE_CLASS_NAME::FindFirst(const PrimaryKey &key, Iterator *iterator) { - Node *node = fRoot; + Node *node = BaseClass::fRoot; while (node) { int cmp = fPrimaryKeyCompare(key, fGetPrimaryKey(fGetValue(node))); if (cmp == 0) { @@ -237,7 +239,7 @@ TWO_KEY_AVL_TREE_CLASS_NAME::FindLast(const PrimaryKey &key, Iterator *iterator) { - Node *node = fRoot; + Node *node = BaseClass::fRoot; while (node) { int cmp = fPrimaryKeyCompare(key, fGetPrimaryKey(fGetValue(node))); if (cmp == 0) { Modified: haiku/trunk/src/add-ons/kernel/file_systems/ramfs/Volume.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/ramfs/Volume.cpp 2007-03-07 06:22:18 UTC (rev 20345) +++ haiku/trunk/src/add-ons/kernel/file_systems/ramfs/Volume.cpp 2007-03-07 06:40:25 UTC (rev 20346) @@ -164,7 +164,7 @@ // Mount status_t -Volume::Mount(nspace_id id) +Volume::Mount(mount_id id) { Unmount(); @@ -354,6 +354,19 @@ return error; } +// PublishVNode +status_t +Volume::PublishVNode(Node *node) +{ + status_t error = NodeAdded(node); + if (error == B_OK) { + error = publish_vnode(GetID(), node->GetID(), node); + if (error != B_OK) + NodeRemoved(node); + } + return error; +} + // GetVNode status_t Volume::GetVNode(vnode_id id, Node **node) Modified: haiku/trunk/src/add-ons/kernel/file_systems/ramfs/Volume.h =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/ramfs/Volume.h 2007-03-07 06:22:18 UTC (rev 20345) +++ haiku/trunk/src/add-ons/kernel/file_systems/ramfs/Volume.h 2007-03-07 06:40:25 UTC (rev 20346) @@ -22,7 +22,7 @@ #ifndef VOLUME_H #define VOLUME_H -#include +#include #include #include "DLList.h" @@ -93,10 +93,10 @@ Volume(); ~Volume(); - status_t Mount(nspace_id nsid); + status_t Mount(mount_id nsid); status_t Unmount(); - nspace_id GetID() const { return fID; } + mount_id GetID() const { return fID; } off_t GetBlockSize() const; off_t CountBlocks() const; @@ -108,6 +108,7 @@ Directory *GetRootDirectory() const { return fRootDirectory; } status_t NewVNode(Node *node); + status_t PublishVNode(Node *node); status_t GetVNode(vnode_id id, Node **node); status_t GetVNode(Node *node); status_t PutVNode(vnode_id id); @@ -175,7 +176,7 @@ private: typedef DLList QueryList; - nspace_id fID; + mount_id fID; vnode_id fNextNodeID; NodeTable *fNodeTable; DirectoryEntryTable *fDirectoryEntryTable; Modified: haiku/trunk/src/add-ons/kernel/file_systems/ramfs/kernel_interface.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/ramfs/kernel_interface.cpp 2007-03-07 06:22:18 UTC (rev 20345) +++ haiku/trunk/src/add-ons/kernel/file_systems/ramfs/kernel_interface.cpp 2007-03-07 06:40:25 UTC (rev 20346) @@ -32,14 +32,14 @@ #include #include +#include +#include #include +#include #include +#include #include -//#include "lock.h" -//#include "cache.h" -#include "fsproto.h" - #include "AllocationInfo.h" #include "AttributeIndex.h" #include "AttributeIterator.h" @@ -59,183 +59,7 @@ #include "SymLink.h" #include "Volume.h" -// BFS returns the length of the entry name in dirent::d_reclen. This is -// not correct, since this field should be set to the length of the complete -// dirent. If set to != 0, KEEP_WRONG_DIRENT_RECLEN emulates the buggy -// bahavior. -#ifndef KEEP_WRONG_DIRENT_RECLEN -#define KEEP_WRONG_DIRENT_RECLEN 0 -#endif -extern "C" { - -static int ramfs_mount(nspace_id nsid, const char *device, ulong flags, - void *parameters, size_t len, void **data, - vnode_id *rootID); -static int ramfs_unmount(void *ns); -static int ramfs_initialize(const char *deviceName, void *parameters, - size_t len); -static int ramfs_sync(void *_ns); - -static int ramfs_read_vnode(void *ns, vnode_id vnid, char reenter, - void **node); -static int ramfs_write_vnode(void *ns, void *_node, char reenter); -static int ramfs_remove_vnode(void *ns, void *_node, char reenter); -static int ramfs_walk(void *ns, void *_dir, const char *entryName, - char **resolvedPath, vnode_id *vnid); -static int ramfs_access(void *ns, void *_node, int mode); - -static int ramfs_ioctl(void *ns, void *_node, void *_cookie, int cmd, - void *buffer, size_t bufferSize); -static int ramfs_setflags(void *ns, void *_node, void *_cookie, int flags); -static int ramfs_fsync(void *ns, void *_node); -static int ramfs_read_stat(void *ns, void *_node, struct stat *st); -static int ramfs_write_stat(void *ns, void *_node, struct stat *st, long mask); -static int ramfs_create(void *ns, void *dir, const char *name, int openMode, - int mode, vnode_id *vnid, void **cookie); -static int ramfs_open(void *ns, void *_node, int openMode, void **cookie); -static int ramfs_close(void *ns, void *node, void *cookie); -static int ramfs_free_cookie(void *ns, void *node, void *cookie); -static int ramfs_read(void *ns, void *_node, void *cookie, off_t pos, - void *buffer, size_t *bufferSize); -static int ramfs_write(void *ns, void *_node, void *cookie, off_t pos, - const void *buffer, size_t *bufferSize); - -static int ramfs_rename(void *ns, void *_oldDir, const char *oldName, - void *_newDir, const char *newName); -static int ramfs_link(void *ns, void *_dir, const char *name, void *node); -static int ramfs_unlink(void *ns, void *_dir, const char *name); -static int ramfs_rmdir(void *ns, void *_dir, const char *name); -static int ramfs_mkdir(void *ns, void *_dir, const char *name, int mode); -static int ramfs_open_dir(void *ns, void *_node, void **cookie); -static int ramfs_read_dir(void *ns, void *_node, void *cookie, long *count, - struct dirent *buffer, size_t bufferSize); -static int ramfs_rewind_dir(void *ns, void *_node, void *cookie); -static int ramfs_close_dir(void *ns, void *_node, void *cookie); -static int ramfs_free_dir_cookie(void *ns, void *_node, void *cookie); - -static int ramfs_read_fs_stat(void *ns, struct fs_info *info); -static int ramfs_write_fs_stat(void *ns, struct fs_info *info, long mask); - -static int ramfs_symlink(void *ns, void *_dir, const char *name, - const char *path); -static int ramfs_read_link(void *ns, void *_node, char *buffer, - size_t *bufferSize); -// attributes -static int ramfs_open_attrdir(void *ns, void *_node, void **_cookie); -static int ramfs_close_attrdir(void *ns, void *_node, void *_cookie); -static int ramfs_free_attrdir_cookie(void *ns, void *_node, void *_cookie); -static int ramfs_rewind_attrdir(void *ns, void *_node, void *_cookie); -static int ramfs_read_attrdir(void *ns, void *_node, void *_cookie, - long *count, struct dirent *buffer, - size_t bufferSize); -static int ramfs_read_attr(void *ns, void *_node, const char *name, int type, - void *buffer, size_t *bufferSize, off_t pos); -static int ramfs_write_attr(void *ns, void *_node, const char *name, int type, - const void *buffer, size_t *bufferSize, off_t pos); -static int ramfs_remove_attr(void *ns, void *_node, const char *name); -static int ramfs_rename_attr(void *ns, void *_node, const char *oldName, - const char *newName); -static int ramfs_stat_attr(void *ns, void *_node, const char *name, - struct attr_info *attrInfo); -// indices -static int ramfs_open_indexdir(void *ns, void **_cookie); -static int ramfs_close_indexdir(void *ns, void *_cookie); -static int ramfs_free_indexdir_cookie(void *ns, void *_node, void *_cookie); -static int ramfs_rewind_indexdir(void *_ns, void *_cookie); -static int ramfs_read_indexdir(void *ns, void *_cookie, long *count, - struct dirent *buffer, size_t bufferSize); -static int ramfs_create_index(void *ns, const char *name, int type, int flags); -static int ramfs_remove_index(void *ns, const char *name); -static int ramfs_rename_index(void *ns, const char *oldname, - const char *newname); -static int ramfs_stat_index(void *ns, const char *name, - struct index_info *indexInfo); -// queries -int ramfs_open_query(void *ns, const char *queryString, ulong flags, - port_id port, long token, void **cookie); -int ramfs_close_query(void *ns, void *cookie); -int ramfs_free_query_cookie(void *ns, void *node, void *cookie); -int ramfs_read_query(void *ns, void *cookie, long *count, - struct dirent *buffer, size_t bufferSize); - -} // extern "C" - -/* vnode_ops struct. Fill this in to tell the kernel how to call - functions in your driver. -*/ - -vnode_ops fs_entry = { - &ramfs_read_vnode, // read_vnode - &ramfs_write_vnode, // write_vnode - &ramfs_remove_vnode, // remove_vnode - NULL, // secure_vnode (not needed) - &ramfs_walk, // walk - &ramfs_access, // access - &ramfs_create, // create - &ramfs_mkdir, // mkdir - &ramfs_symlink, // symlink - &ramfs_link, // link - &ramfs_rename, // rename - &ramfs_unlink, // unlink - &ramfs_rmdir, // rmdir - &ramfs_read_link, // readlink - &ramfs_open_dir, // opendir - &ramfs_close_dir, // closedir - &ramfs_free_dir_cookie, // free_dircookie - &ramfs_rewind_dir, // rewinddir - &ramfs_read_dir, // readdir - &ramfs_open, // open file - &ramfs_close, // close file - &ramfs_free_cookie, // free cookie - &ramfs_read, // read file - &ramfs_write, // write file - NULL, // readv - NULL, // writev - &ramfs_ioctl, // ioctl - &ramfs_setflags, // setflags file - &ramfs_read_stat, // read stat - &ramfs_write_stat, // write stat - &ramfs_fsync, // fsync - &ramfs_initialize, // initialize - &ramfs_mount, // mount - &ramfs_unmount, // unmount - &ramfs_sync, // sync - &ramfs_read_fs_stat, // read fs stat - &ramfs_write_fs_stat, // write fs stat - NULL, // select - NULL, // deselect - - &ramfs_open_indexdir, // open index dir - &ramfs_close_indexdir, // close index dir - &ramfs_free_indexdir_cookie, // free index dir cookie - &ramfs_rewind_indexdir, // rewind index dir - &ramfs_read_indexdir, // read index dir - &ramfs_create_index, // create index - &ramfs_remove_index, // remove index - &ramfs_rename_index, // rename index - &ramfs_stat_index, // stat index - - &ramfs_open_attrdir, // open attr dir - &ramfs_close_attrdir, // close attr dir - &ramfs_free_attrdir_cookie, // free attr dir cookie - &ramfs_rewind_attrdir, // rewind attr dir - &ramfs_read_attrdir, // read attr dir - &ramfs_write_attr, // write attr - &ramfs_read_attr, // read attr - &ramfs_remove_attr, // remove attr - &ramfs_rename_attr, // rename attr - &ramfs_stat_attr, // stat attr - - &ramfs_open_query, // open query - &ramfs_close_query, // close query - &ramfs_free_query_cookie, // free query cookie - &ramfs_read_query, // read query -}; - -int32 api_version = B_CUR_FS_API_VERSION; - -static char *kFSName = "ramfs"; static const size_t kOptimalIOSize = 65536; static const bigtime_t kNotificationInterval = 1000000LL; @@ -244,9 +68,8 @@ notify_if_stat_changed(Volume *volume, Node *node) { if (volume && node && node->IsModified()) { - node->MarkUnmodified(); - notify_listener(B_STAT_CHANGED, volume->GetID(), 0, 0, node->GetID(), - NULL); + uint32 statFields = node->MarkUnmodified(); + notify_stat_changed(volume->GetID(), node->GetID(), statFields); } } @@ -255,13 +78,10 @@ // ramfs_mount -static -int -ramfs_mount(nspace_id nsid, const char */*device*/, ulong flags, - void */*parameters*/, size_t /*len*/, void **data, - vnode_id *rootID) +static status_t +ramfs_mount(mount_id nsid, const char* /*device*/, uint32 flags, + const char* /*args*/, fs_volume* _volume, vnode_id* rootID) { - init_debugging(); FUNCTION_START(); // parameters are ignored for now status_t error = B_OK; @@ -280,49 +100,71 @@ // set the results if (error == B_OK) { *rootID = volume->GetRootDirectory()->GetID(); - *data = volume; + *_volume = volume; } // cleanup on failure if (error != B_OK && volume) delete volume; -if (error == B_OK) { -ramfs_create_index(volume, "myIndex", B_STRING_TYPE, 0); -} - RETURN_ERROR(error); } // ramfs_unmount -static -int -ramfs_unmount(void *ns) +static status_t +ramfs_unmount(fs_volume fs) { FUNCTION_START(); - Volume *volume = (Volume*)ns; + Volume *volume = (Volume*)fs; status_t error = volume->Unmount(); if (error == B_OK) delete volume; if (error != B_OK) REPORT_ERROR(error); - exit_debugging(); return error; } -// ramfs_initialize -static -int -ramfs_initialize(const char */*deviceName*/, void */*parameters*/, - size_t /*len*/) +// ramfs_read_fs_info +static status_t +ramfs_read_fs_info(fs_volume fs, struct fs_info *info) { FUNCTION_START(); - return B_ERROR; + Volume *volume = (Volume*)fs; + status_t error = B_OK; + if (VolumeReadLocker locker = volume) { + info->flags = B_FS_IS_PERSISTENT | B_FS_HAS_ATTR | B_FS_HAS_MIME + | B_FS_HAS_QUERY; + info->block_size = volume->GetBlockSize(); + info->io_size = kOptimalIOSize; + info->total_blocks = volume->CountBlocks(); + info->free_blocks = volume->CountFreeBlocks(); + info->device_name[0] = '\0'; + strncpy(info->volume_name, volume->GetName(), sizeof(info->volume_name)); + strcpy(info->fsh_name, "ramfs"); + } else + SET_ERROR(error, B_ERROR); + return B_OK; } + +// ramfs_write_fs_info +static status_t +ramfs_write_fs_info(fs_volume fs, const struct fs_info *info, uint32 mask) + +{ + FUNCTION_START(); + Volume *volume = (Volume*)fs; + status_t error = B_OK; + if (VolumeWriteLocker locker = volume) { + if (mask & FS_WRITE_FSINFO_NAME) + error = volume->SetName(info->volume_name); + } else + SET_ERROR(error, B_ERROR); + RETURN_ERROR(error); +} + // ramfs_sync -static -int -ramfs_sync(void */*_ns*/) +static status_t +ramfs_sync(fs_volume /*fs*/) { FUNCTION_START(); return B_OK; @@ -332,14 +174,60 @@ // #pragma mark - VNodes +// ramfs_lookup +static status_t +ramfs_lookup(fs_volume fs, fs_vnode _dir, const char *entryName, vnode_id *vnid, + int *type) +{ +// FUNCTION_START(); + Volume *volume = (Volume*)fs; + Directory *dir = dynamic_cast((Node*)_dir); +FUNCTION(("dir: (%llu), entry: `%s'\n", (dir ? dir->GetID() : -1), entryName)); + + // check for non-directories + if (!dir) + RETURN_ERROR(B_NOT_A_DIRECTORY); + + status_t error = B_OK; + if (VolumeReadLocker locker = volume) { + Node *node = NULL; + + // special entries: "." and ".." + if (!strcmp(entryName, ".")) { + *vnid = dir->GetID(); + if (volume->GetVNode(*vnid, &node) != B_OK) + error = B_BAD_VALUE; + } else if (!strcmp(entryName, "..")) { + Directory *parent = dir->GetParent(); + if (parent && volume->GetVNode(parent->GetID(), &node) == B_OK) + *vnid = node->GetID(); + else + error = B_BAD_VALUE; + + // ordinary entries + } else { + // find the entry + error = dir->FindAndGetNode(entryName, &node); [... truncated: 2206 lines follow ...] From bonefish at mail.berlios.de Wed Mar 7 07:46:12 2007 From: bonefish at mail.berlios.de (bonefish at BerliOS) Date: Wed, 7 Mar 2007 07:46:12 +0100 Subject: [Haiku-commits] r20347 - in haiku/trunk/src/tests/add-ons/kernel/file_systems/userlandfs/ramfs: . beos_interface Message-ID: <200703070646.l276kCGG004884@sheep.berlios.de> Author: bonefish Date: 2007-03-07 07:46:12 +0100 (Wed, 07 Mar 2007) New Revision: 20347 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20347&view=rev Added: haiku/trunk/src/tests/add-ons/kernel/file_systems/userlandfs/ramfs/beos_interface/ haiku/trunk/src/tests/add-ons/kernel/file_systems/userlandfs/ramfs/beos_interface/Jamfile Modified: haiku/trunk/src/tests/add-ons/kernel/file_systems/userlandfs/ramfs/Jamfile Log: Reorganized so that both the BeOS and Haiku FS interface of RamFS can be built for UserlandFS. The latter appears to be working fine. Modified: haiku/trunk/src/tests/add-ons/kernel/file_systems/userlandfs/ramfs/Jamfile =================================================================== --- haiku/trunk/src/tests/add-ons/kernel/file_systems/userlandfs/ramfs/Jamfile 2007-03-07 06:40:25 UTC (rev 20346) +++ haiku/trunk/src/tests/add-ons/kernel/file_systems/userlandfs/ramfs/Jamfile 2007-03-07 06:46:12 UTC (rev 20347) @@ -3,20 +3,10 @@ local userlandFSTop = [ FDirName $(HAIKU_TOP) src add-ons kernel file_systems userlandfs ] ; local userlandFSIncludes = [ PrivateHeaders userlandfs ] ; -local ramFSTop = [ FDirName $(HAIKU_TOP) src tests add-ons kernel - file_systems userlandfs r5 src test ramfs ] ; +local ramFSTop = [ FDirName $(HAIKU_TOP) src add-ons kernel file_systems ramfs ] ; DEFINES += USER=1 ; -# avoid inclusion of -DEFINES += _DRIVERS_SELECT_H ; - -SubDirC++Flags -include - [ FDirName $(userlandFSIncludes) shared Compatibility.h ] ; - -SubDirSysHdrs [ FDirName $(userlandFSIncludes) ] ; -SubDirSysHdrs [ FDirName $(userlandFSIncludes) legacy ] ; -SubDirHdrs [ FDirName $(userlandFSIncludes) legacy ] ; SubDirHdrs [ FDirName $(userlandFSIncludes) shared ] ; SEARCH_SOURCE += $(ramFSTop) ; @@ -56,6 +46,10 @@ SizeIndex.cpp SymLink.cpp Volume.cpp + : false # is executable - : libuserlandfs_beos_kernel.so + : libuserlandfs_haiku_kernel.so ; + +SubInclude HAIKU_TOP src tests add-ons kernel file_systems userlandfs ramfs + beos_interface ; Copied: haiku/trunk/src/tests/add-ons/kernel/file_systems/userlandfs/ramfs/beos_interface/Jamfile (from rev 20309, haiku/trunk/src/tests/add-ons/kernel/file_systems/userlandfs/ramfs/Jamfile) =================================================================== --- haiku/trunk/src/tests/add-ons/kernel/file_systems/userlandfs/ramfs/Jamfile 2007-03-03 06:59:35 UTC (rev 20309) +++ haiku/trunk/src/tests/add-ons/kernel/file_systems/userlandfs/ramfs/beos_interface/Jamfile 2007-03-07 06:46:12 UTC (rev 20347) @@ -0,0 +1,62 @@ +SubDir HAIKU_TOP src tests add-ons kernel file_systems userlandfs ramfs + beos_interface ; + +local userlandFSTop = [ FDirName $(HAIKU_TOP) src add-ons kernel + file_systems userlandfs ] ; +local userlandFSIncludes = [ PrivateHeaders userlandfs ] ; +local ramFSTop = [ FDirName $(HAIKU_TOP) src tests add-ons kernel + file_systems userlandfs r5 src test ramfs ] ; + +DEFINES += USER=1 ; + +# avoid inclusion of +DEFINES += _DRIVERS_SELECT_H ; + +SubDirC++Flags -include + [ FDirName $(userlandFSIncludes) shared Compatibility.h ] ; + +SubDirSysHdrs [ FDirName $(userlandFSIncludes) ] ; +SubDirSysHdrs [ FDirName $(userlandFSIncludes) legacy ] ; +SubDirHdrs [ FDirName $(userlandFSIncludes) legacy ] ; +SubDirHdrs [ FDirName $(userlandFSIncludes) shared ] ; + +SEARCH_SOURCE += $(ramFSTop) ; +SEARCH_SOURCE += [ FDirName $(userlandFSTop) shared ] ; + +Addon ramfs + : # relpath - obsolete + : Debug.cpp + Locker.cpp + String.cpp + + AllocationInfo.cpp + AreaUtils.cpp + Attribute.cpp + AttributeIndex.cpp + AttributeIndexImpl.cpp + AttributeIterator.cpp + BlockAllocator.cpp + BlockAllocatorArea.cpp + BlockAllocatorAreaBucket.cpp + BlockReferenceManager.cpp + DataContainer.cpp + Directory.cpp + Entry.cpp + EntryIterator.cpp + EntryListener.cpp + File.cpp + Index.cpp + IndexDirectory.cpp + kernel_interface.cpp + LastModifiedIndex.cpp + NameIndex.cpp + Node.cpp + NodeListener.cpp + NodeTable.cpp + Query.cpp + SizeIndex.cpp + SymLink.cpp + Volume.cpp + : false # is executable + : libuserlandfs_beos_kernel.so +; From bonefish at mail.berlios.de Wed Mar 7 08:18:51 2007 From: bonefish at mail.berlios.de (bonefish at BerliOS) Date: Wed, 7 Mar 2007 08:18:51 +0100 Subject: [Haiku-commits] r20348 - haiku/trunk/src/system/kernel/lib Message-ID: <200703070718.l277IpWo006620@sheep.berlios.de> Author: bonefish Date: 2007-03-07 08:18:51 +0100 (Wed, 07 Mar 2007) New Revision: 20348 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20348&view=rev Modified: haiku/trunk/src/system/kernel/lib/Jamfile Log: Added strtod() and localeconv() to the kernel. Modified: haiku/trunk/src/system/kernel/lib/Jamfile =================================================================== --- haiku/trunk/src/system/kernel/lib/Jamfile 2007-03-07 06:46:12 UTC (rev 20347) +++ haiku/trunk/src/system/kernel/lib/Jamfile 2007-03-07 07:18:51 UTC (rev 20348) @@ -33,6 +33,7 @@ utime.c # locale ctype.c + localeconv.c # stdio (this subdir) kernel_vsprintf.c # stdlib @@ -43,6 +44,7 @@ qsort.c rand.c random.c + strtod.c strtol.c strtoll.c strtoul.c From bonefish at mail.berlios.de Wed Mar 7 08:19:28 2007 From: bonefish at mail.berlios.de (bonefish at BerliOS) Date: Wed, 7 Mar 2007 08:19:28 +0100 Subject: [Haiku-commits] r20349 - haiku/trunk/src/add-ons/kernel/file_systems/bfs Message-ID: <200703070719.l277JSUd006687@sheep.berlios.de> Author: bonefish Date: 2007-03-07 08:19:27 +0100 (Wed, 07 Mar 2007) New Revision: 20349 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20349&view=rev Modified: haiku/trunk/src/add-ons/kernel/file_systems/bfs/kernel_interface.cpp Log: Removed dummy strtod(). Modified: haiku/trunk/src/add-ons/kernel/file_systems/bfs/kernel_interface.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/bfs/kernel_interface.cpp 2007-03-07 07:18:51 UTC (rev 20348) +++ haiku/trunk/src/add-ons/kernel/file_systems/bfs/kernel_interface.cpp 2007-03-07 07:19:27 UTC (rev 20349) @@ -68,16 +68,6 @@ } -// ToDo: Temporary hack to get it working - - -double -strtod(const char */*start*/, char **/*end*/) -{ - return 0; -} - - // #pragma mark - Scanning From bonefish at mail.berlios.de Wed Mar 7 09:02:33 2007 From: bonefish at mail.berlios.de (bonefish at BerliOS) Date: Wed, 7 Mar 2007 09:02:33 +0100 Subject: [Haiku-commits] r20350 - in haiku/trunk/src/tests/add-ons/kernel/file_systems/bfs: bfs_shell r5 Message-ID: <200703070802.l2782XpP009222@sheep.berlios.de> Author: bonefish Date: 2007-03-07 09:02:32 +0100 (Wed, 07 Mar 2007) New Revision: 20350 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20350&view=rev Modified: haiku/trunk/src/tests/add-ons/kernel/file_systems/bfs/bfs_shell/Jamfile haiku/trunk/src/tests/add-ons/kernel/file_systems/bfs/r5/Query.cpp haiku/trunk/src/tests/add-ons/kernel/file_systems/bfs/r5/fsproto.h Log: r20337 broke the bfs_shell build (at least on Linux). Scary hack to fix it which shouldn't break the R5 build again. Modified: haiku/trunk/src/tests/add-ons/kernel/file_systems/bfs/bfs_shell/Jamfile =================================================================== --- haiku/trunk/src/tests/add-ons/kernel/file_systems/bfs/bfs_shell/Jamfile 2007-03-07 07:19:27 UTC (rev 20349) +++ haiku/trunk/src/tests/add-ons/kernel/file_systems/bfs/bfs_shell/Jamfile 2007-03-07 08:02:32 UTC (rev 20350) @@ -54,7 +54,7 @@ fstat=build_platform_fstat read_pos=build_platform_read_pos ioctl=build_platform_ioctl - "send_notification\\(...\\)=" + MEAN_BFS_SHELL_SELECT_HACK=1 ; } Modified: haiku/trunk/src/tests/add-ons/kernel/file_systems/bfs/r5/Query.cpp =================================================================== --- haiku/trunk/src/tests/add-ons/kernel/file_systems/bfs/r5/Query.cpp 2007-03-07 07:19:27 UTC (rev 20349) +++ haiku/trunk/src/tests/add-ons/kernel/file_systems/bfs/r5/Query.cpp 2007-03-07 08:02:32 UTC (rev 20350) @@ -9,6 +9,8 @@ */ +#include "fsproto.h" // include first for hacky reasons + #include "Query.h" #include "bfs.h" #include "Debug.h" @@ -18,8 +20,6 @@ #include "BPlusTree.h" #include "Index.h" -#include "fsproto.h" - #include #include #include Modified: haiku/trunk/src/tests/add-ons/kernel/file_systems/bfs/r5/fsproto.h =================================================================== --- haiku/trunk/src/tests/add-ons/kernel/file_systems/bfs/r5/fsproto.h 2007-03-07 07:19:27 UTC (rev 20349) +++ haiku/trunk/src/tests/add-ons/kernel/file_systems/bfs/r5/fsproto.h 2007-03-07 08:02:32 UTC (rev 20350) @@ -6,6 +6,16 @@ #ifndef _FSPROTO_H #define _FSPROTO_H +// TODO: FIXME! XXX! DANGER! BIOHAZARD! +// OMG, we're defining COMPILE_FOR_R5 so that defines the +// obsolete notify_select_event() prototype. BTW, this happens only on +// non-BeOS-compatible host platforms. Outright scary! +#ifdef MEAN_BFS_SHELL_SELECT_HACK +# define COMPILE_FOR_R5 +# include +# undef COMPILE_FOR_R5 +#endif + #include #include #include From bonefish at mail.berlios.de Wed Mar 7 09:09:27 2007 From: bonefish at mail.berlios.de (bonefish at BerliOS) Date: Wed, 7 Mar 2007 09:09:27 +0100 Subject: [Haiku-commits] r20351 - in haiku/trunk/src/add-ons/kernel/file_systems: . ramfs Message-ID: <200703070809.l2789R04009548@sheep.berlios.de> Author: bonefish Date: 2007-03-07 09:09:27 +0100 (Wed, 07 Mar 2007) New Revision: 20351 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20351&view=rev Modified: haiku/trunk/src/add-ons/kernel/file_systems/Jamfile haiku/trunk/src/add-ons/kernel/file_systems/ramfs/Block.h haiku/trunk/src/add-ons/kernel/file_systems/ramfs/Index.cpp haiku/trunk/src/add-ons/kernel/file_systems/ramfs/Jamfile Log: Build RamFS for the Haiku kernel. Seems to work fine. Also fixed some warnings. Modified: haiku/trunk/src/add-ons/kernel/file_systems/Jamfile =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/Jamfile 2007-03-07 08:02:32 UTC (rev 20350) +++ haiku/trunk/src/add-ons/kernel/file_systems/Jamfile 2007-03-07 08:09:27 UTC (rev 20351) @@ -5,6 +5,7 @@ SubInclude HAIKU_TOP src add-ons kernel file_systems googlefs ; SubInclude HAIKU_TOP src add-ons kernel file_systems iso9660 ; SubInclude HAIKU_TOP src add-ons kernel file_systems nfs ; +SubInclude HAIKU_TOP src add-ons kernel file_systems ramfs ; SubInclude HAIKU_TOP src add-ons kernel file_systems udf ; SubInclude HAIKU_TOP src add-ons kernel file_systems userlandfs ; Modified: haiku/trunk/src/add-ons/kernel/file_systems/ramfs/Block.h =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/ramfs/Block.h 2007-03-07 08:02:32 UTC (rev 20350) +++ haiku/trunk/src/add-ons/kernel/file_systems/ramfs/Block.h 2007-03-07 08:09:27 UTC (rev 20351) @@ -55,7 +55,7 @@ SIZE_MASK = 0x7fffffff, }; -private: +protected: BlockHeader(); ~BlockHeader(); @@ -73,7 +73,7 @@ bool hasNext, BlockReference *reference = NULL); -private: +protected: Block(); ~Block(); }; @@ -94,7 +94,7 @@ // Block *previous, size_t size, bool hasNext, TFreeBlock *previousFree, // TFreeBlock *nextFree); -private: +protected: TFreeBlock(); ~TFreeBlock(); Modified: haiku/trunk/src/add-ons/kernel/file_systems/ramfs/Index.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/ramfs/Index.cpp 2007-03-07 08:02:32 UTC (rev 20350) +++ haiku/trunk/src/add-ons/kernel/file_systems/ramfs/Index.cpp 2007-03-07 08:09:27 UTC (rev 20351) @@ -71,12 +71,14 @@ void Index::Dump() { - PRINT(("Index: `%s', type: %lx\n", GetName(), GetType())); - for (IndexEntryIterator it(this); it.GetCurrent(); it.GetNext()) { - Entry *entry = it.GetCurrent(); - PRINT((" entry: `%s', dir: %Ld\n", entry->GetName(), - entry->GetParent()->GetID())); - } + D( + PRINT(("Index: `%s', type: %lx\n", GetName(), GetType())); + for (IndexEntryIterator it(this); it.GetCurrent(); it.GetNext()) { + Entry *entry = it.GetCurrent(); + PRINT((" entry: `%s', dir: %Ld\n", entry->GetName(), + entry->GetParent()->GetID())); + } + ) } Modified: haiku/trunk/src/add-ons/kernel/file_systems/ramfs/Jamfile =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/ramfs/Jamfile 2007-03-07 08:02:32 UTC (rev 20350) +++ haiku/trunk/src/add-ons/kernel/file_systems/ramfs/Jamfile 2007-03-07 08:09:27 UTC (rev 20351) @@ -1,30 +1,14 @@ -SubDir HAIKU_TOP src tests add-ons kernel file_systems userlandfs r5 src test - ramfs ; +SubDir HAIKU_TOP src add-ons kernel file_systems ramfs ; -SetSubDirSupportedPlatforms r5 bone dano ; +local userlandFSTop = [ FDirName $(HAIKU_TOP) src add-ons kernel + file_systems userlandfs ] ; +local userlandFSIncludes = [ PrivateHeaders userlandfs ] ; -local userlandFSTop = [ FDirName $(HAIKU_TOP) src tests add-ons kernel - file_systems userlandfs r5 ] ; -local userlandFSIncludes = [ FDirName $(userlandFSTop) headers ] ; - -DEFINES += USER=1 ; - -SubDirC++Flags -include - [ FDirName $(userlandFSIncludes) shared Compatibility.h ] ; - -SubDirSysHdrs [ FDirName $(userlandFSIncludes) public ] ; SubDirHdrs [ FDirName $(userlandFSIncludes) shared ] ; -if $(OSPLAT) = X86 { -# SubDirC++Flags -include [ FDirName $(UFS_TOP) src kernel_add_on -# kernel-cpp.h ] ; - SubDirC++Flags -include [ FDirName $(SUBDIR) cpp.h ] ; -} +SEARCH_SOURCE += [ FDirName $(userlandFSTop) shared ] ; -SEARCH_SOURCE += [ FDirName $(userlandFSTop) src shared ] ; - -Addon ramfs - : # relpath - obsolete +KernelAddon ramfs : Debug.cpp Locker.cpp String.cpp @@ -57,6 +41,6 @@ SizeIndex.cpp SymLink.cpp Volume.cpp - : false # is executable - : UserlandFSServer + + : $(TARGET_GCC_LIBGCC) $(HAIKU_LIBSUPC++) ; From axeld at pinc-software.de Wed Mar 7 09:35:01 2007 From: axeld at pinc-software.de (Axel =?iso-8859-15?q?D=F6rfler?=) Date: Wed, 07 Mar 2007 09:35:01 +0100 CET Subject: [Haiku-commits] =?iso-8859-15?q?r20350_-_in_haiku/trunk/src/tests?= =?iso-8859-15?q?/add-ons/kernel/file=5Fsystems/bfs=3A__bfs=5Fshell_r5?= In-Reply-To: <200703070802.l2782XpP009222@sheep.berlios.de> Message-ID: <4312571023-BeMail@zon> bonefish at BerliOS wrote: > +// TODO: FIXME! XXX! DANGER! BIOHAZARD! > +// OMG, we're defining COMPILE_FOR_R5 so that > defines > the > +// obsolete notify_select_event() prototype. BTW, this happens only > on > +// non-BeOS-compatible host platforms. Outright scary! > +#ifdef MEAN_BFS_SHELL_SELECT_HACK > +# define COMPILE_FOR_R5 > +# include > +# undef COMPILE_FOR_R5 > +#endif Why do we need the Haiku version in the build headers, anyway? Maybe we should rework the bfs_shell to use Haiku's kernel interface as well? (because that would be a good reason to keep it) Bye, Axel. From bonefish at cs.tu-berlin.de Wed Mar 7 11:53:45 2007 From: bonefish at cs.tu-berlin.de (Ingo Weinhold) Date: Wed, 07 Mar 2007 11:53:45 +0100 Subject: [Haiku-commits] r20350 - in haiku/trunk/src/tests/add-ons/kernel/file_systems/bfs: bfs_shell r5 In-Reply-To: <4312571023-BeMail@zon> References: <4312571023-BeMail@zon> Message-ID: <20070307115345.41845.5@cs.tu-berlin.de> On 2007-03-07 at 09:35:01 [+0100], Axel D?rfler wrote: > bonefish at BerliOS wrote: > > +// TODO: FIXME! XXX! DANGER! BIOHAZARD! > > +// OMG, we're defining COMPILE_FOR_R5 so that > > defines > the > > +// obsolete notify_select_event() prototype. BTW, this happens only > > on > > +// non-BeOS-compatible host platforms. Outright scary! > > +#ifdef MEAN_BFS_SHELL_SELECT_HACK > > +# define COMPILE_FOR_R5 > > +# include > > +# undef COMPILE_FOR_R5 > > +#endif > > Why do we need the Haiku version in the build headers, anyway? I suppose it's still unchanged due to the undecidedness whether the environment the build system creates for building the build tools shall provide Haiku or BeOS compatibility. The initial idea was BeOS compatibility, so that there's the same basis on BeOS compatible and non-compatible platforms. But in fact it's much easier for us to provide Haiku compatibility, since the stuff's already all there and we're basically backwards compatible anyway, at least with respect to the userland API. Which is exactly what doesn't help in this case, because the conflicts arise from the kernel API incompatibilities. The obvious solution would be to copy the BFS code (BeOS FS interface) and adjust it to use the fs_shell definitions (my_off_t, my_dirent, wrapper functions, etc.) instead of those of the host platform. This would save us all the trouble with this hybrid host/haiku build environment. And the BFS sources for the BeOS FS interface version could be cleaned up again (or even removed, if no longer needed). > Maybe we should rework the bfs_shell to use Haiku's kernel interface as > well? (because that would be a good reason to keep it) Indeed a nice option. I've yet to look into your thesis, so ATM I don't have any clue how much work providing the file and block caches would be. Everything else shouldn't pose much of a problem I'd say. CU, Ingo From stefano.ceccherini at gmail.com Wed Mar 7 12:01:43 2007 From: stefano.ceccherini at gmail.com (Stefano Ceccherini) Date: Wed, 7 Mar 2007 12:01:43 +0100 Subject: [Haiku-commits] r20335 - haiku/trunk/src/apps/terminal In-Reply-To: <-8098182633991694004@unknownmsgid> References: <894b9700703060457j74d491d8kc49e0b9f8b7d8e62@mail.gmail.com> <-8098182633991694004@unknownmsgid> Message-ID: <894b9700703070301j590f82a9y73f460299f5ff970@mail.gmail.com> 2007/3/7, Kaoutsis : > i forgot to mention that the problem occurred when building Terminal > for r5, > with r20335. Oh that's interesting.. I'll see if I can try it, although I don't have a working r5 environment. Thanks for the info. See ya From kaoutsis at sch.gr Wed Mar 7 13:53:12 2007 From: kaoutsis at sch.gr (Kaoutsis) Date: Wed, 07 Mar 2007 14:53:12 +0200 EET Subject: [Haiku-commits] r20335 - haiku/trunk/src/apps/terminal In-Reply-To: <200703051459.l25ExbeW009384@sheep.berlios.de> Message-ID: <959879797-BeMail@> jackburton at BerliOS> Author: jackburton > Date: 2007-03-05 15:59:37 +0100 (Mon, 05 Mar 2007) > New Revision: 20335 > ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20335&view=rev > > Modified: > haiku/trunk/src/apps/terminal/TermApp.cpp > haiku/trunk/src/apps/terminal/TermParse.cpp > haiku/trunk/src/apps/terminal/TermWindow.cpp > Log: > Re-enabled wait_for_thread() (in place of kill_thread()) inside > TermParse's destructor. PtyReader() was hanging on read(), since the > fd was never closed. Now we do that in ~TermWindow() (for now, we > might > want to move some stuff around). Moved there the cleanup code too > (from > TermWindow::Quit()). Use B_QUIT_ON_WINDOW_CLOSE flag instead of > sending > a message to be_app in Quit(). > > [...] > > Modified: haiku/trunk/src/apps/terminal/TermWindow.cpp > =================================================================== > --- haiku/trunk/src/apps/terminal/TermWindow.cpp 2007-03-05 13:14:12 > UTC (rev 20334) > +++ haiku/trunk/src/apps/terminal/TermWindow.cpp 2007-03-05 14:59:37 > UTC (rev 20335) > @@ -59,7 +59,7 @@ > [...] > > @@ -603,27 +614,17 @@ > void > TermWindow::Quit() > { > - delete fTermParse; > - delete fCodeConv; > - if (fPrefWindow) > - fPrefWindow->PostMessage(B_QUIT_REQUESTED); > - > - if (fFindPanel && fFindPanel->Lock()) { > - fFindPanel->Quit(); > - fFindPanel = NULL; > - } > - > - be_app->PostMessage(B_QUIT_REQUESTED, be_app); ^-----------------------------------------------^ > - BWindow::Quit (); > + BWindow::Quit(); > } > [...] Without be_app->PostMessage(B_QUIT_REQUESTED, be_app); the Terminal app only closes its main window, the app however never gets a B_QUIT_REQUESTED message. I think that the problem should also occurred in Haiku!!! (i think, but i am not 100% sure:-)) bye, Vasilis From revol at free.fr Wed Mar 7 14:55:36 2007 From: revol at free.fr (=?windows-1252?q?Fran=E7ois?= Revol) Date: Wed, 07 Mar 2007 14:55:36 +0100 CET Subject: [Haiku-commits] r20335 - haiku/trunk/src/apps/terminal In-Reply-To: <959879797-BeMail@> Message-ID: <493445946-BeMail@laptop> > Without be_app->PostMessage(B_QUIT_REQUESTED, be_app); > the Terminal app only closes its main window, the app > however never gets a B_QUIT_REQUESTED message. > I think that the problem should also occurred in Haiku!!! > (i think, but i am not 100% sure:-)) Indeed I noticed a weird behaviour recently, try doing ALT-Q with the settings window open :) Fran?ois. From bonefish at mail.berlios.de Wed Mar 7 17:01:20 2007 From: bonefish at mail.berlios.de (bonefish at BerliOS) Date: Wed, 7 Mar 2007 17:01:20 +0100 Subject: [Haiku-commits] r20352 - haiku/trunk/build/jam Message-ID: <200703071601.l27G1Km6030038@sheep.berlios.de> Author: bonefish Date: 2007-03-07 17:01:19 +0100 (Wed, 07 Mar 2007) New Revision: 20352 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20352&view=rev Modified: haiku/trunk/build/jam/HeadersRules haiku/trunk/build/jam/MiscRules haiku/trunk/build/jam/OverriddenJamRules Log: * Moved the DeferredSubInclude rules into MiscRules. * Added new rule HaikuSubInclude for more comfortable subdirectory inclusion. Modified: haiku/trunk/build/jam/HeadersRules =================================================================== --- haiku/trunk/build/jam/HeadersRules 2007-03-07 08:09:27 UTC (rev 20351) +++ haiku/trunk/build/jam/HeadersRules 2007-03-07 16:01:19 UTC (rev 20352) @@ -397,44 +397,5 @@ return $(headers) ; } -rule DeferredSubInclude params -{ - # DeferredSubInclude ; - # - # Takes the same parameter as SubInclude. The the subdirectory referred to - # by will be included when ExecuteDeferredSubIncludes is - # invoked, i.e. at the end of the root Jamfile. - - HAIKU_DEFERRED_SUB_INCLUDES += "/" $(params) ; -} - -rule ExecuteDeferredSubIncludes -{ - # ExecuteDeferredSubIncludes ; - # - # Performs the deferred SubIncludes scheduled by DeferredSubInclude. - - local tokensList = $(HAIKU_DEFERRED_SUB_INCLUDES) ; - while $(tokensList) { - # chop off leading "/" - tokensList = $(tokensList[2-]) ; - - # get the tokens for the next include - local tokens ; - while $(tokensList) && $(tokensList[1]) != "/" { - tokens += $(tokensList[1]) ; - tokensList = $(tokensList[2-]) ; - } - - # perform the include - if $(tokens) { - SubInclude $(tokens) ; - } - } -} - -# The variable used to collect the deferred SubIncludes. -HAIKU_DEFERRED_SUB_INCLUDES = ; - # SUBDIRSYSHDRS shall be reset automatically for each subdir SUBDIRRESET += SYSHDRS ; Modified: haiku/trunk/build/jam/MiscRules =================================================================== --- haiku/trunk/build/jam/MiscRules 2007-03-07 08:09:27 UTC (rev 20351) +++ haiku/trunk/build/jam/MiscRules 2007-03-07 16:01:19 UTC (rev 20352) @@ -76,3 +76,54 @@ } } +rule DeferredSubInclude params +{ + # DeferredSubInclude ; + # + # Takes the same parameter as SubInclude. The the subdirectory referred to + # by will be included when ExecuteDeferredSubIncludes is + # invoked, i.e. at the end of the root Jamfile. + + HAIKU_DEFERRED_SUB_INCLUDES += "/" $(params) ; +} + +rule ExecuteDeferredSubIncludes +{ + # ExecuteDeferredSubIncludes ; + # + # Performs the deferred SubIncludes scheduled by DeferredSubInclude. + + local tokensList = $(HAIKU_DEFERRED_SUB_INCLUDES) ; + while $(tokensList) { + # chop off leading "/" + tokensList = $(tokensList[2-]) ; + + # get the tokens for the next include + local tokens ; + while $(tokensList) && $(tokensList[1]) != "/" { + tokens += $(tokensList[1]) ; + tokensList = $(tokensList[2-]) ; + } + + # perform the include + if $(tokens) { + SubInclude $(tokens) ; + } + } +} + +rule HaikuSubInclude tokens +{ + # HaikuSubInclude ; + # + # Current subdir relative SubInclude. + # - subdir tokens specifying the subdirectory to be include + # (relative to the current subdir) + + if $(tokens) { + SubInclude HAIKU_TOP $(SUBDIR_TOKENS) $(tokens) ; + } +} + +# The variable used to collect the deferred SubIncludes. +HAIKU_DEFERRED_SUB_INCLUDES = ; Modified: haiku/trunk/build/jam/OverriddenJamRules =================================================================== --- haiku/trunk/build/jam/OverriddenJamRules 2007-03-07 08:09:27 UTC (rev 20351) +++ haiku/trunk/build/jam/OverriddenJamRules 2007-03-07 16:01:19 UTC (rev 20352) @@ -657,7 +657,13 @@ config = $(HAIKU_INHERITED_SUBDIR_CONFIG) ; } + # store SUBDIR_TOKENS + local oldSubDirTokens = $(SUBDIR_TOKENS) ; + on $(config) { include [ FDirName $($(1[1])) $(1[2-) $(JAMFILE) ] ; } + + # restore SUBDIR_TOKENS + SUBDIR_TOKENS = $(oldSubDirTokens) ; } From bonefish at mail.berlios.de Wed Mar 7 17:02:17 2007 From: bonefish at mail.berlios.de (bonefish at BerliOS) Date: Wed, 7 Mar 2007 17:02:17 +0100 Subject: [Haiku-commits] r20353 - haiku/trunk/src/add-ons/kernel/file_systems/userlandfs Message-ID: <200703071602.l27G2HVR030102@sheep.berlios.de> Author: bonefish Date: 2007-03-07 17:02:16 +0100 (Wed, 07 Mar 2007) New Revision: 20353 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20353&view=rev Modified: haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/Jamfile Log: HaikuSubInclude in action. Modified: haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/Jamfile =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/Jamfile 2007-03-07 16:01:19 UTC (rev 20352) +++ haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/Jamfile 2007-03-07 16:02:16 UTC (rev 20353) @@ -1,4 +1,4 @@ SubDir HAIKU_TOP src add-ons kernel file_systems userlandfs ; -SubInclude HAIKU_TOP src add-ons kernel file_systems userlandfs kernel_add_on ; -SubInclude HAIKU_TOP src add-ons kernel file_systems userlandfs server ; +HaikuSubInclude kernel_add_on ; +HaikuSubInclude server ; From stefano.ceccherini at gmail.com Wed Mar 7 20:43:38 2007 From: stefano.ceccherini at gmail.com (Stefano Ceccherini) Date: Wed, 7 Mar 2007 20:43:38 +0100 Subject: [Haiku-commits] r20335 - haiku/trunk/src/apps/terminal In-Reply-To: <7413337055892816042@unknownmsgid> References: <200703051459.l25ExbeW009384@sheep.berlios.de> <7413337055892816042@unknownmsgid> Message-ID: <894b9700703071143l4825e989reac937c3ff94292c@mail.gmail.com> 2007/3/7, Kaoutsis : > Without be_app->PostMessage(B_QUIT_REQUESTED, be_app); > the Terminal app only closes its main window, the app > however never gets a B_QUIT_REQUESTED message. > I think that the problem should also occurred in Haiku!!! > (i think, but i am not 100% sure:-)) Since I added B_QUIT_ON_WINDOW_CLOSE, be_app should get the B_QUIT_REQUESTED message anyway. Maybe R5 doesn't implement that flag ? From darkwyrm at mail.berlios.de Wed Mar 7 22:48:20 2007 From: darkwyrm at mail.berlios.de (darkwyrm at BerliOS) Date: Wed, 7 Mar 2007 22:48:20 +0100 Subject: [Haiku-commits] r20354 - haiku/trunk/src/preferences/appearance Message-ID: <200703072148.l27LmK59000519@sheep.berlios.de> Author: darkwyrm Date: 2007-03-07 22:48:20 +0100 (Wed, 07 Mar 2007) New Revision: 20354 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20354&view=rev Modified: haiku/trunk/src/preferences/appearance/APRView.cpp Log: Hopefully this fixes bug #1084. Untested because of bug #1035 Modified: haiku/trunk/src/preferences/appearance/APRView.cpp =================================================================== --- haiku/trunk/src/preferences/appearance/APRView.cpp 2007-03-07 16:02:16 UTC (rev 20353) +++ haiku/trunk/src/preferences/appearance/APRView.cpp 2007-03-07 21:48:20 UTC (rev 20354) @@ -51,12 +51,15 @@ BRect rect(Bounds().InsetByCopy(10,10)); #ifdef HAIKU_TARGET_PLATFORM_HAIKU + fDecorMenu = new BMenu("Window Style"); int32 decorCount = BPrivate::count_decorators(); if (decorCount > 1) { for (int32 i = 0; i < decorCount; i++) { BString name; BPrivate::get_decorator_name(i, name); + if (name.CountChars() < 1) + continue; fDecorMenu->AddItem(new BMenuItem(name.String(), new BMessage(DECORATOR_CHANGED))); } @@ -71,7 +74,16 @@ rect = Bounds().InsetByCopy(10,10); rect.OffsetTo(10, field->Frame().bottom + 10); } - fDecorMenu->ItemAt(BPrivate::get_decorator())->SetMarked(true); + BMenuItem *marked = fDecorMenu->ItemAt(BPrivate::get_decorator()); + if (marked) + marked->SetMarked(true); + else + { + marked = fDecorMenu->FindItem("Default"); + if (marked) + marked->SetMarked(true); + } + #endif // Set up list of color fAttributes @@ -166,7 +178,8 @@ fPicker->SetValue(fCurrentSet.StringToColor(fAttrString.String())); - fDecorMenu->SetTargetForItems(BMessenger(this)); + if (fDecorMenu) + fDecorMenu->SetTargetForItems(BMessenger(this)); Window()->ResizeTo(MAX(fPicker->Frame().right,fPicker->Frame().right) + 10, fDefaults->Frame().bottom + 10); From stefano.ceccherini at gmail.com Thu Mar 8 09:02:30 2007 From: stefano.ceccherini at gmail.com (Stefano Ceccherini) Date: Thu, 8 Mar 2007 09:02:30 +0100 Subject: [Haiku-commits] r20335 - haiku/trunk/src/apps/terminal In-Reply-To: <493445946-BeMail@laptop> References: <493445946-BeMail@laptop> Message-ID: <894b9700703080002k34ec913cl1e233a65777163ca@mail.gmail.com> 2007/3/7, Fran?ois Revol : > Indeed I noticed a weird behaviour recently, try doing ALT-Q with the > settings window open :) What happens and what should happen ? From revol at free.fr Thu Mar 8 11:06:58 2007 From: revol at free.fr (=?windows-1252?q?Fran=E7ois?= Revol) Date: Thu, 08 Mar 2007 11:06:58 +0100 CET Subject: [Haiku-commits] r20335 - haiku/trunk/src/apps/terminal In-Reply-To: <894b9700703080002k34ec913cl1e233a65777163ca@mail.gmail.com> Message-ID: <321393520-BeMail@laptop> > 2007/3/7, Fran?ois Revol : > > > Indeed I noticed a weird behaviour recently, try doing ALT-Q with > > the > > settings window open :) > > What happens and what should happen ? It was closing only one window... but maybe it's fixed now, didn't try. Fran?ois. From stefano.ceccherini at gmail.com Thu Mar 8 11:07:53 2007 From: stefano.ceccherini at gmail.com (Stefano Ceccherini) Date: Thu, 8 Mar 2007 11:07:53 +0100 Subject: [Haiku-commits] r20335 - haiku/trunk/src/apps/terminal In-Reply-To: <321393520-BeMail@laptop> References: <894b9700703080002k34ec913cl1e233a65777163ca@mail.gmail.com> <321393520-BeMail@laptop> Message-ID: <894b9700703080207q50525834w2d985972fdef29e7@mail.gmail.com> 2007/3/8, Fran?ois Revol : > > What happens and what should happen ? > > It was closing only one window... but maybe it's fixed now, didn't try. > > Fran?ois. Ah yes it only closes the settings window, if that window is the active one. If the active window is the "main" one, it closes the app. Do you know since which revision is it happening ? From revol at free.fr Thu Mar 8 11:59:24 2007 From: revol at free.fr (=?windows-1252?q?Fran=E7ois?= Revol) Date: Thu, 08 Mar 2007 11:59:24 +0100 CET Subject: [Haiku-commits] r20335 - haiku/trunk/src/apps/terminal In-Reply-To: <894b9700703080207q50525834w2d985972fdef29e7@mail.gmail.com> Message-ID: <668490423-BeMail@laptop> > 2007/3/8, Fran?ois Revol : > > > > What happens and what should happen ? > > > > It was closing only one window... but maybe it's fixed now, didn't > > try. > > > > Fran?ois. > > Ah yes it only closes the settings window, if that window is the > active one. > If the active window is the "main" one, it closes the app. Do you > know > since which revision is it happening ? Not really, I saw that last week or so. Fran?ois. From stefano.ceccherini at gmail.com Thu Mar 8 12:26:56 2007 From: stefano.ceccherini at gmail.com (Stefano Ceccherini) Date: Thu, 8 Mar 2007 12:26:56 +0100 Subject: [Haiku-commits] r20335 - haiku/trunk/src/apps/terminal In-Reply-To: <668490423-BeMail@laptop> References: <894b9700703080207q50525834w2d985972fdef29e7@mail.gmail.com> <668490423-BeMail@laptop> Message-ID: <894b9700703080326u2c067938i7516920f49dcd90b@mail.gmail.com> 2007/3/8, Fran?ois Revol : > > 2007/3/8, Fran?ois Revol : > > > > > > What happens and what should happen ? > > > > > > It was closing only one window... but maybe it's fixed now, didn't > > > try. > > > > > > Fran?ois. > > > > Ah yes it only closes the settings window, if that window is the > > active one. > > If the active window is the "main" one, it closes the app. Do you > > know > > since which revision is it happening ? > > Not really, I saw that last week or so. > > Fran?ois. Oh well, looking at the code in PrefDlg.cpp, it's clear why this is happening... AddShortcut((ulong)'Q', (ulong)B_COMMAND_KEY, new BMessage(B_QUIT_REQUESTED)); From axeld at pinc-software.de Thu Mar 8 12:34:51 2007 From: axeld at pinc-software.de (Axel =?iso-8859-15?q?D=F6rfler?=) Date: Thu, 08 Mar 2007 12:34:51 +0100 CET Subject: [Haiku-commits] r20335 - haiku/trunk/src/apps/terminal In-Reply-To: <894b9700703080326u2c067938i7516920f49dcd90b@mail.gmail.com> Message-ID: <9169239168-BeMail@zon> "Stefano Ceccherini" wrote: > Oh well, looking at the code in PrefDlg.cpp, it's clear why this is > happening... > > AddShortcut((ulong)'Q', (ulong)B_COMMAND_KEY, new > BMessage(B_QUIT_REQUESTED)); Does it happen in BeOS as well? If not, maybe Command-Q can't be overwritten unless you remove it before. Bye, Axel. From axeld at mail.berlios.de Thu Mar 8 14:10:10 2007 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Thu, 8 Mar 2007 14:10:10 +0100 Subject: [Haiku-commits] r20355 - haiku/trunk/src/apps/abouthaiku Message-ID: <200703081310.l28DAADp027481@sheep.berlios.de> Author: axeld Date: 2007-03-08 14:10:09 +0100 (Thu, 08 Mar 2007) New Revision: 20355 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20355&view=rev Modified: haiku/trunk/src/apps/abouthaiku/AboutHaiku.cpp Log: Added Euan Kirkhope to the list of contributors. Modified: haiku/trunk/src/apps/abouthaiku/AboutHaiku.cpp =================================================================== --- haiku/trunk/src/apps/abouthaiku/AboutHaiku.cpp 2007-03-07 21:48:20 UTC (rev 20354) +++ haiku/trunk/src/apps/abouthaiku/AboutHaiku.cpp 2007-03-08 13:10:09 UTC (rev 20355) @@ -387,6 +387,7 @@ "Erik Jaesler\n" "Carwyn Jones\n" "Vasilis Kaoutsis\n" + "Euan Kirkhope\n" "Marcin Konicki\n" "Kurtis Kopf\n" "Elad Lahav\n" From kaoutsis at sch.gr Thu Mar 8 14:46:25 2007 From: kaoutsis at sch.gr (Kaoutsis) Date: Thu, 08 Mar 2007 15:46:25 +0200 EET Subject: [Haiku-commits] r20335 - haiku/trunk/src/apps/terminal In-Reply-To: <894b9700703071143l4825e989reac937c3ff94292c@mail.gmail.com> Message-ID: <846596352-BeMail@> Stefano Ceccherini> 2007/3/7, Kaoutsis : > > > Without be_app->PostMessage(B_QUIT_REQUESTED, be_app); > > the Terminal app only closes its main window, the app > > however never gets a B_QUIT_REQUESTED message. > > I think that the problem should also occurred in Haiku!!! > > (i think, but i am not 100% sure:-)) > > Since I added B_QUIT_ON_WINDOW_CLOSE, be_app should get the > B_QUIT_REQUESTED message anyway. Maybe R5 doesn't implement that flag > ? taken from bebook, Window.html: [...] B_QUIT_ON_WINDOW_CLOSE Currently has no effect. Bye, Vasilis From axeld at pinc-software.de Thu Mar 8 14:56:45 2007 From: axeld at pinc-software.de (Axel =?iso-8859-15?q?D=F6rfler?=) Date: Thu, 08 Mar 2007 14:56:45 +0100 CET Subject: [Haiku-commits] r20335 - haiku/trunk/src/apps/terminal In-Reply-To: <846596352-BeMail@> Message-ID: <17683635617-BeMail@zon> "Kaoutsis" wrote: > > Since I added B_QUIT_ON_WINDOW_CLOSE, be_app should get the > > B_QUIT_REQUESTED message anyway. Maybe R5 doesn't implement that > > > flag > > ? > taken from bebook, > Window.html: > [...] > B_QUIT_ON_WINDOW_CLOSE Currently has no effect. IIRC it worked fine on R5 when I tried (a couple of years ago), I guess the BeBook is just not up to date. But YMMV, of course :-) Bye, Axel. From axeld at mail.berlios.de Thu Mar 8 15:35:27 2007 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Thu, 8 Mar 2007 15:35:27 +0100 Subject: [Haiku-commits] r20356 - in haiku/trunk: headers/private/kernel src/system/kernel/vm Message-ID: <200703081435.l28EZRNV001359@sheep.berlios.de> Author: axeld Date: 2007-03-08 15:35:26 +0100 (Thu, 08 Mar 2007) New Revision: 20356 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20356&view=rev Modified: haiku/trunk/headers/private/kernel/vm.h haiku/trunk/headers/private/kernel/vm_types.h haiku/trunk/src/system/kernel/vm/vm.cpp haiku/trunk/src/system/kernel/vm/vm_page.c Log: * All mapped pages that are not wired (ie. locked) now have a vm_page_mapping object that points to both, the page and the area the page is in. This will allow a page scanner to steal unused pages when necessary. * The locking is currently done with a spinlock which we might want to have another look at one day. * dump_page() and dump_area_struct() now dump the page mappings as well. Modified: haiku/trunk/headers/private/kernel/vm.h =================================================================== --- haiku/trunk/headers/private/kernel/vm.h 2007-03-08 13:10:09 UTC (rev 20355) +++ haiku/trunk/headers/private/kernel/vm.h 2007-03-08 14:35:26 UTC (rev 20356) @@ -62,6 +62,7 @@ vm_area *vm_area_lookup(vm_address_space *addressSpace, addr_t address); status_t vm_set_area_memory_type(area_id id, addr_t physicalBase, uint32 type); status_t vm_get_page_mapping(team_id team, addr_t vaddr, addr_t *paddr); +void vm_remove_all_page_mappings(vm_page *page); status_t vm_unmap_pages(vm_area *area, addr_t base, size_t length); status_t vm_map_page(vm_area *area, vm_page *page, addr_t address, uint32 protection); Modified: haiku/trunk/headers/private/kernel/vm_types.h =================================================================== --- haiku/trunk/headers/private/kernel/vm_types.h 2007-03-08 13:10:09 UTC (rev 20355) +++ haiku/trunk/headers/private/kernel/vm_types.h 2007-03-08 14:35:26 UTC (rev 20356) @@ -61,8 +61,8 @@ typedef class DoublyLinkedQueue vm_page_mappings; typedef class DoublyLinkedQueue vm_area_mappings; #else // !__cplusplus -typedef void *vm_page_mappings; -typedef void *vm_area_mappings; +typedef struct vm_page_mapping *vm_page_mappings; +typedef struct vm_page_mapping *vm_area_mappings; #endif // vm page Modified: haiku/trunk/src/system/kernel/vm/vm.cpp =================================================================== --- haiku/trunk/src/system/kernel/vm/vm.cpp 2007-03-08 13:10:09 UTC (rev 20355) +++ haiku/trunk/src/system/kernel/vm/vm.cpp 2007-03-08 14:35:26 UTC (rev 20356) @@ -64,6 +64,7 @@ static area_id sNextAreaID; static hash_table *sAreaHash; static sem_id sAreaHashLock; +static spinlock sMappingLock; static off_t sAvailableMemory; static benaphore sAvailableMemoryLock; @@ -170,6 +171,7 @@ area->address_space_next = NULL; area->cache_next = area->cache_prev = NULL; area->hash_next = NULL; + new (&area->mappings) vm_area_mappings; return area; } @@ -1834,6 +1836,40 @@ } +void +vm_remove_all_page_mappings(vm_page *page) +{ + cpu_status state = disable_interrupts(); + acquire_spinlock(&sMappingLock); + + vm_page_mappings queue; + queue.MoveFrom(&page->mappings); + + vm_page_mappings::Iterator iterator = queue.GetIterator(); + vm_page_mapping *mapping; + while ((mapping = iterator.Next()) != NULL) { + vm_area *area = mapping->area; + vm_translation_map *map = &area->address_space->translation_map; + + map->ops->lock(map); + addr_t base = area->base + (page->cache_offset << PAGE_SHIFT); + map->ops->unmap(map, base, base + (B_PAGE_SIZE - 1)); + map->ops->unlock(map); + + area->mappings.Remove(mapping); + } + + release_spinlock(&sMappingLock); + restore_interrupts(state); + + // free now unused mappings + + while ((mapping = queue.RemoveHead()) != NULL) { + free(mapping); + } +} + + status_t vm_unmap_pages(vm_area *area, addr_t base, size_t size) { @@ -1864,6 +1900,37 @@ } map->ops->unmap(map, base, base + (size - 1)); + + if (area->wiring == B_NO_LOCK) { + vm_area_mappings queue; + uint32 count = 0; + + cpu_status state = disable_interrupts(); + acquire_spinlock(&sMappingLock); + + vm_page_mapping *mapping; + while ((mapping = area->mappings.RemoveHead()) != NULL) { + mapping->page->mappings.Remove(mapping); + queue.Add(mapping); + + // temporary unlock to handle interrupts and let others play as well + if ((++count % 256) == 0) { + release_spinlock(&sMappingLock); + restore_interrupts(state); + + state = disable_interrupts(); + acquire_spinlock(&sMappingLock); + } + } + + release_spinlock(&sMappingLock); + restore_interrupts(state); + + while ((mapping = queue.RemoveHead()) != NULL) { + free(mapping); + } + } + map->ops->unlock(map); return B_OK; } @@ -1873,17 +1940,38 @@ vm_map_page(vm_area *area, vm_page *page, addr_t address, uint32 protection) { vm_translation_map *map = &area->address_space->translation_map; + vm_page_mapping *mapping = NULL; + if (area->wiring == B_NO_LOCK) { + mapping = (vm_page_mapping *)malloc(sizeof(vm_page_mapping)); + if (mapping == NULL) + return B_NO_MEMORY; + + mapping->page = page; + mapping->area = area; + } + map->ops->lock(map); map->ops->map(map, address, page->physical_page_number * B_PAGE_SIZE, protection); - map->ops->unlock(map); if (area->wiring != B_NO_LOCK) { page->wired_count++; // TODO: needs to be atomic on all platforms! + } else { + // insert mapping into lists + cpu_status state = disable_interrupts(); + acquire_spinlock(&sMappingLock); + + page->mappings.Add(mapping); + area->mappings.Add(mapping); + + release_spinlock(&sMappingLock); + restore_interrupts(state); } + map->ops->unlock(map); + vm_page_set_state(page, PAGE_STATE_ACTIVE); return B_OK; } @@ -2211,7 +2299,7 @@ static void -_dump_area(vm_area *area) +dump_area_struct(vm_area *area, bool mappings) { kprintf("AREA: %p\n", area); kprintf("name:\t\t'%s'\n", area->name); @@ -2228,39 +2316,62 @@ kprintf("cache_offset:\t0x%Lx\n", area->cache_offset); kprintf("cache_next:\t%p\n", area->cache_next); kprintf("cache_prev:\t%p\n", area->cache_prev); + + vm_area_mappings::Iterator iterator = area->mappings.GetIterator(); + if (mappings) { + kprintf("page mappings:\n"); + while (iterator.HasNext()) { + vm_page_mapping *mapping = iterator.Next(); + kprintf(" %p", mapping->page); + } + kprintf("\n"); + } else { + uint32 count = 0; + while (iterator.Next() != NULL) { + count++; + } + kprintf("page mappings:\t%lu\n", count); + } } static int dump_area(int argc, char **argv) { + bool mappings = false; bool found = false; + int32 index = 1; vm_area *area; addr_t num; if (argc < 2) { - kprintf("usage: area \n"); + kprintf("usage: area [-m] \n"); return 0; } - num = strtoul(argv[1], NULL, 0); + if (!strcmp(argv[1], "-m")) { + mappings = true; + index++; + } + num = strtoul(argv[index], NULL, 0); + // walk through the area list, looking for the arguments as a name struct hash_iterator iter; hash_open(sAreaHash, &iter); while ((area = (vm_area *)hash_next(sAreaHash, &iter)) != NULL) { - if ((area->name != NULL && !strcmp(argv[1], area->name)) + if ((area->name != NULL && !strcmp(argv[index], area->name)) || num != 0 && ((addr_t)area->id == num || area->base <= num && area->base + area->size > num)) { - _dump_area(area); + dump_area_struct(area, mappings); found = true; } } if (!found) - kprintf("could not find area %s (%ld)\n", argv[1], num); + kprintf("could not find area %s (%ld)\n", argv[index], num); return 0; } Modified: haiku/trunk/src/system/kernel/vm/vm_page.c =================================================================== --- haiku/trunk/src/system/kernel/vm/vm_page.c 2007-03-08 13:10:09 UTC (rev 20355) +++ haiku/trunk/src/system/kernel/vm/vm_page.c 2007-03-08 14:35:26 UTC (rev 20356) @@ -136,6 +136,7 @@ static int dump_page(int argc, char **argv) { + struct vm_page_mapping *mapping; struct vm_page *page; addr_t address; bool physical = false; @@ -187,7 +188,14 @@ kprintf("state: %d\n", page->state); kprintf("wired_count: %u\n", page->wired_count); kprintf("usage_count: %u\n", page->usage_count); + kprintf("area mappings:\n"); + mapping = page->mappings; + while (mapping != NULL) { + kprintf(" %p\n", mapping->area); + mapping = mapping->page_link.next; + } + return 0; } From marcusoverhagen at mail.berlios.de Thu Mar 8 18:40:43 2007 From: marcusoverhagen at mail.berlios.de (marcusoverhagen at BerliOS) Date: Thu, 8 Mar 2007 18:40:43 +0100 Subject: [Haiku-commits] r20357 - haiku/trunk/src/add-ons/kernel/bus_managers/ps2 Message-ID: <200703081740.l28Hehtj004880@sheep.berlios.de> Author: marcusoverhagen Date: 2007-03-08 18:40:40 +0100 (Thu, 08 Mar 2007) New Revision: 20357 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20357&view=rev Modified: haiku/trunk/src/add-ons/kernel/bus_managers/ps2/ps2_common.c haiku/trunk/src/add-ons/kernel/bus_managers/ps2/ps2_common.h haiku/trunk/src/add-ons/kernel/bus_managers/ps2/ps2_dev.c haiku/trunk/src/add-ons/kernel/bus_managers/ps2/ps2_dev.h haiku/trunk/src/add-ons/kernel/bus_managers/ps2/ps2_keyboard.c haiku/trunk/src/add-ons/kernel/bus_managers/ps2/ps2_mouse.c haiku/trunk/src/add-ons/kernel/bus_managers/ps2/ps2_service.c haiku/trunk/src/add-ons/kernel/bus_managers/ps2/ps2_service.h Log: cleanup & disabled most debug output Modified: haiku/trunk/src/add-ons/kernel/bus_managers/ps2/ps2_common.c =================================================================== --- haiku/trunk/src/add-ons/kernel/bus_managers/ps2/ps2_common.c 2007-03-08 14:35:26 UTC (rev 20356) +++ haiku/trunk/src/add-ons/kernel/bus_managers/ps2/ps2_common.c 2007-03-08 17:40:40 UTC (rev 20357) @@ -1,5 +1,5 @@ /* - * Copyright 2004-2006 Haiku, Inc. + * Copyright 2004-2007 Haiku, Inc. * Distributed under the terms of the Haiku License. * * Authors (in chronological order): @@ -8,7 +8,7 @@ * Marcus Overhagen */ -/*! PS/2 hid device driver */ +/*! PS/2 bus manager */ #include @@ -41,7 +41,7 @@ void ps2_write_ctrl(uint8 ctrl) { - TRACE(("ps2_write_ctrl 0x%02x\n", ctrl)); + TRACE("ps2_write_ctrl 0x%02x\n", ctrl); gIsa->write_io_8(PS2_PORT_CTRL, ctrl); } @@ -50,7 +50,7 @@ void ps2_write_data(uint8 data) { - TRACE(("ps2_write_data 0x%02x\n", data)); + TRACE("ps2_write_data 0x%02x\n", data); gIsa->write_io_8(PS2_PORT_DATA, data); } @@ -99,7 +99,7 @@ if (!(ctrl & PS2_STATUS_OUTPUT_BUFFER_FULL)) break; data = ps2_read_data(); - dprintf("ps2: ps2_flush: ctrl 0x%02x, data 0x%02x (%s)\n", ctrl, data, (ctrl & PS2_STATUS_AUX_DATA) ? "aux" : "keyb"); + TRACE("ps2: ps2_flush: ctrl 0x%02x, data 0x%02x (%s)\n", ctrl, data, (ctrl & PS2_STATUS_AUX_DATA) ? "aux" : "keyb"); snooze(100); } @@ -115,7 +115,7 @@ uint8 cmdbyte; res = ps2_command(PS2_CTRL_READ_CMD, NULL, 0, &cmdbyte, 1); - dprintf("ps2: get command byte: res 0x%08lx, cmdbyte 0x%02x\n", res, cmdbyte); + TRACE("ps2: get command byte: res 0x%08lx, cmdbyte 0x%02x\n", res, cmdbyte); if (res != B_OK) cmdbyte = 0x47; @@ -123,7 +123,7 @@ cmdbyte &= ~(PS2_BITS_KEYBOARD_DISABLED | PS2_BITS_MOUSE_DISABLED); res = ps2_command(PS2_CTRL_WRITE_CMD, &cmdbyte, 1, NULL, 0); - dprintf("ps2: set command byte: res 0x%08lx, cmdbyte 0x%02x\n", res, cmdbyte); + TRACE("ps2: set command byte: res 0x%08lx, cmdbyte 0x%02x\n", res, cmdbyte); return res; } @@ -165,27 +165,27 @@ // MS Virtual PC, it's 0xa6. Since current active multiplexing // specification version is 1.1 (0x11), we validate the data. if (in > 0x9f) { - dprintf("ps2: active multiplexing v%d.%d detected, but ignored!\n", (in >> 4), in & 0xf); + TRACE("ps2: active multiplexing v%d.%d detected, but ignored!\n", (in >> 4), in & 0xf); goto no_support; } - dprintf("ps2: active multiplexing v%d.%d enabled\n", (in >> 4), in & 0xf); + INFO("ps2: active multiplexing v%d.%d enabled\n", (in >> 4), in & 0xf); *enabled = true; return B_OK; no_support: - dprintf("ps2: active multiplexing not supported\n"); + TRACE("ps2: active multiplexing not supported\n"); *enabled = false; return B_OK; fail: - dprintf("ps2: testing for active multiplexing failed\n"); + TRACE("ps2: testing for active multiplexing failed\n"); *enabled = false; // this should revert the controller into legacy mode, // just in case it has switched to multiplexed mode res = ps2_command(PS2_CTRL_SELF_TEST, NULL, 0, &out, 1); if (res != B_OK || out != 0x55) { - dprintf("ps2: controller self test failed, status 0x%08lx, data 0x%02x\n", res, out); + INFO("ps2: controller self test failed, status 0x%08lx, data 0x%02x\n", res, out); return B_ERROR; } return B_OK; @@ -201,9 +201,9 @@ acquire_sem(gControllerSem); atomic_add(&sIgnoreInterrupts, 1); - dprintf("ps2: ps2_command cmd 0x%02x, out %d, in %d\n", cmd, out_count, in_count); + TRACE("ps2: ps2_command cmd 0x%02x, out %d, in %d\n", cmd, out_count, in_count); for (i = 0; i < out_count; i++) - dprintf("ps2: ps2_command out 0x%02x\n", out[i]); + TRACE("ps2: ps2_command out 0x%02x\n", out[i]); res = ps2_wait_write(); if (res == B_OK) @@ -214,7 +214,7 @@ if (res == B_OK) ps2_write_data(out[i]); else - dprintf("ps2: ps2_command out byte %d failed\n", i); + TRACE("ps2: ps2_command out byte %d failed\n", i); } for (i = 0; res == B_OK && i < in_count; i++) { @@ -222,12 +222,12 @@ if (res == B_OK) in[i] = ps2_read_data(); else - dprintf("ps2: ps2_command in byte %d failed\n", i); + TRACE("ps2: ps2_command in byte %d failed\n", i); } for (i = 0; i < in_count; i++) - dprintf("ps2: ps2_command in 0x%02x\n", in[i]); - dprintf("ps2: ps2_command result 0x%08lx\n", res); + TRACE("ps2: ps2_command in 0x%02x\n", in[i]); + TRACE("ps2: ps2_command result 0x%08lx\n", res); atomic_add(&sIgnoreInterrupts, -1); release_sem(gControllerSem); @@ -252,7 +252,7 @@ return B_UNHANDLED_INTERRUPT; if (atomic_get(&sIgnoreInterrupts)) { - TRACE(("ps2_interrupt: ignoring, ctrl 0x%02x (%s)\n", ctrl, (ctrl & PS2_STATUS_AUX_DATA) ? "aux" : "keyb")); + TRACE("ps2_interrupt: ignoring, ctrl 0x%02x (%s)\n", ctrl, (ctrl & PS2_STATUS_AUX_DATA) ? "aux" : "keyb"); return B_HANDLED_INTERRUPT; } @@ -263,15 +263,15 @@ if (gActiveMultiplexingEnabled) { idx = ctrl >> 6; error = (ctrl & 0x04) != 0; - TRACE(("ps2_interrupt: ctrl 0x%02x, data 0x%02x (mouse %d)\n", ctrl, data, idx)); + TRACE("ps2_interrupt: ctrl 0x%02x, data 0x%02x (mouse %d)\n", ctrl, data, idx); } else { idx = 0; error = (ctrl & 0xC0) != 0; - TRACE(("ps2_interrupt: ctrl 0x%02x, data 0x%02x (aux)\n", ctrl, data)); + TRACE("ps2_interrupt: ctrl 0x%02x, data 0x%02x (aux)\n", ctrl, data); } dev = &ps2_device[PS2_DEVICE_MOUSE + idx]; } else { - TRACE(("ps2_interrupt: ctrl 0x%02x, data 0x%02x (keyb)\n", ctrl, data)); + TRACE("ps2_interrupt: ctrl 0x%02x, data 0x%02x (keyb)\n", ctrl, data); dev = &ps2_device[PS2_DEVICE_KEYB]; error = (ctrl & 0xC0) != 0; @@ -297,7 +297,7 @@ { status_t status; - TRACE(("ps2: init\n")); + TRACE("ps2: init\n"); status = get_module(B_ISA_MODULE_NAME, (module_info **)&gIsa); if (status < B_OK) @@ -325,13 +325,13 @@ status = ps2_setup_command_byte(); if (status) { - dprintf("ps2: setting up command byte failed\n"); + INFO("ps2: setting up command byte failed\n"); goto err5; } status = ps2_setup_active_multiplexing(&gActiveMultiplexingEnabled); if (status) { - dprintf("ps2: setting up active multiplexing failed\n"); + INFO("ps2: setting up active multiplexing failed\n"); goto err5; } @@ -343,7 +343,7 @@ ps2_service_notify_device_added(&ps2_device[PS2_DEVICE_MOUSE + 3]); } - TRACE(("ps2_hid: init_driver done!\n")); + TRACE("ps2: init done!\n"); return B_OK; @@ -358,7 +358,7 @@ err1: delete_sem(gControllerSem); put_module(B_ISA_MODULE_NAME); - TRACE(("ps2_hid: init_driver failed!\n")); + TRACE("ps2: init failed!\n"); return B_ERROR; } @@ -366,7 +366,7 @@ void ps2_uninit(void) { - TRACE(("ps2: uninit\n")); + TRACE("ps2: uninit\n"); remove_io_interrupt_handler(INT_PS2_MOUSE, &ps2_interrupt, NULL); remove_io_interrupt_handler(INT_PS2_KEYBOARD, &ps2_interrupt, NULL); ps2_service_exit(); Modified: haiku/trunk/src/add-ons/kernel/bus_managers/ps2/ps2_common.h =================================================================== --- haiku/trunk/src/add-ons/kernel/bus_managers/ps2/ps2_common.h 2007-03-08 14:35:26 UTC (rev 20356) +++ haiku/trunk/src/add-ons/kernel/bus_managers/ps2/ps2_common.h 2007-03-08 17:40:40 UTC (rev 20357) @@ -1,8 +1,8 @@ /* - * Copyright 2004-2006 Haiku, Inc. + * Copyright 2004-2007 Haiku, Inc. * Distributed under the terms of the MIT License. * - * PS/2 hid device driver + * PS/2 bus manager * * Authors (in chronological order): * Elad Lahav (elad at eldarshany.com) @@ -23,13 +23,19 @@ #include "ps2_dev.h" -// debug defines -#ifdef DEBUG -# define TRACE(x) dprintf x +#if 1 +# define INFO(x...) dprintf(x) #else -# define TRACE(x) ; +# define INFO(x...) #endif +#if 0 +# define TRACE(x...) dprintf(x) +#else +# define TRACE(x...) +#endif + + // global variables extern isa_module_info *gIsa; Modified: haiku/trunk/src/add-ons/kernel/bus_managers/ps2/ps2_dev.c =================================================================== --- haiku/trunk/src/add-ons/kernel/bus_managers/ps2/ps2_dev.c 2007-03-08 14:35:26 UTC (rev 20356) +++ haiku/trunk/src/add-ons/kernel/bus_managers/ps2/ps2_dev.c 2007-03-08 17:40:40 UTC (rev 20357) @@ -1,8 +1,8 @@ /* - * Copyright 2005-2006 Haiku, Inc. + * Copyright 2005-2007 Haiku, Inc. * Distributed under the terms of the MIT License. * - * PS/2 hid device driver + * PS/2 bus manager * * Authors (in chronological order): * Marcus Overhagen (marcus at overhagen.de) @@ -61,7 +61,7 @@ ps2_dev_publish(ps2_dev *dev) { status_t status; - TRACE(("ps2_dev_publish %s\n", dev->name)); + TRACE("ps2_dev_publish %s\n", dev->name); if (dev->active) return; @@ -71,7 +71,7 @@ status = devfs_publish_device(dev->name, NULL, (atomic_get(&dev->flags) & PS2_FLAG_KEYB) ? &gKeyboardDeviceHooks : &gMouseDeviceHooks); - dprintf("ps2: devfs_publish_device %s, status = 0x%08lx\n", dev->name, status); + INFO("ps2: devfs_publish_device %s, status = 0x%08lx\n", dev->name, status); } @@ -79,7 +79,7 @@ ps2_dev_unpublish(ps2_dev *dev) { status_t status; - TRACE(("ps2_dev_unpublish %s\n", dev->name)); + TRACE("ps2_dev_unpublish %s\n", dev->name); if (!dev->active) return; @@ -91,7 +91,7 @@ if ((dev->flags & PS2_FLAG_ENABLED) && dev->disconnect) dev->disconnect(dev); - dprintf("ps2: devfs_unpublish_device %s, status = 0x%08lx\n", dev->name, status); + INFO("ps2: devfs_unpublish_device %s, status = 0x%08lx\n", dev->name, status); } @@ -112,7 +112,7 @@ atomic_or(&dev->flags, PS2_FLAG_NACK); } else if ((flags & PS2_FLAG_GETID) && (data == 0 || data == 3 || data == 4)) { // workaround for broken mice that don't ack the "get id" command - dprintf("ps2: ps2_dev_handle_int: mouse didn't ack the 'get id' command\n"); + TRACE("ps2: ps2_dev_handle_int: mouse didn't ack the 'get id' command\n"); atomic_or(&dev->flags, PS2_FLAG_ACK); if (dev->result_buf_cnt) { dev->result_buf[dev->result_buf_idx] = data; @@ -124,8 +124,8 @@ } } } else { -// dprintf("ps2: ps2_dev_handle_int unexpected data 0x%02x while waiting for ack\n", data); - dprintf("ps2: int1 %02x\n", data); +// TRACE("ps2: ps2_dev_handle_int unexpected data 0x%02x while waiting for ack\n", data); + TRACE("ps2: int1 %02x\n", data); goto pass_to_handler; } release_sem_etc(dev->result_sem, cnt, B_DO_NOT_RESCHEDULE); @@ -140,8 +140,8 @@ return B_INVOKE_SCHEDULER; } } else { -// dprintf("ps2: ps2_dev_handle_int unexpected data 0x%02x during command processing\n", data); - dprintf("ps2: int2 %02x\n", data); +// TRACE("ps2: ps2_dev_handle_int unexpected data 0x%02x during command processing\n", data); + TRACE("ps2: int2 %02x\n", data); goto pass_to_handler; } return B_HANDLED_INTERRUPT; @@ -151,14 +151,14 @@ if ((flags & PS2_FLAG_KEYB) == 0) { if (dev->history[0].error && data == 0xfd) { - dprintf("ps2: hot removal of %s\n", dev->name); + INFO("ps2: hot removal of %s\n", dev->name); ps2_service_notify_device_removed(dev); return B_INVOKE_SCHEDULER; } if (data == 0x00 && dev->history[1].data == 0xaa && (dev->history[0].time - dev->history[1].time) < 50000) { - dprintf("ps2: hot plugin of %s\n", dev->name); + INFO("ps2: hot plugin of %s\n", dev->name); if (dev->active) { - dprintf("ps2: device %s still active, removing...\n", dev->name); + TRACE("ps2: device %s still active, removing...\n", dev->name); ps2_service_notify_device_removed(dev); } ps2_service_notify_device_added(dev); @@ -167,9 +167,9 @@ } if (!dev->active) { - dprintf("ps2: %s not active, data 0x%02x dropped\n", dev->name, data); + TRACE("ps2: %s not active, data 0x%02x dropped\n", dev->name, data); if (data != 0x00 && data != 0xaa) { - dprintf("ps2: possibly a hot plugin of %s\n", dev->name); + INFO("ps2: possibly a hot plugin of %s\n", dev->name); ps2_service_notify_device_added(dev); return B_INVOKE_SCHEDULER; } @@ -177,7 +177,7 @@ } if ((flags & PS2_FLAG_ENABLED) == 0) { - dprintf("ps2: %s not enabled, data 0x%02x dropped\n", dev->name, data); + TRACE("ps2: %s not enabled, data 0x%02x dropped\n", dev->name, data); return B_HANDLED_INTERRUPT; } @@ -193,13 +193,13 @@ int32 sem_count; int i; - dprintf("ps2: ps2_dev_command cmd 0x%02x, out %d, in %d, dev %s\n", cmd, out_count, in_count, dev->name); + TRACE("ps2: ps2_dev_command cmd 0x%02x, out %d, in %d, dev %s\n", cmd, out_count, in_count, dev->name); for (i = 0; i < out_count; i++) - dprintf("ps2: ps2_dev_command out 0x%02x\n", out[i]); + TRACE("ps2: ps2_dev_command out 0x%02x\n", out[i]); res = get_sem_count(dev->result_sem, &sem_count); if (res == B_OK && sem_count != 0) { - dprintf("ps2: ps2_dev_command: sem_count %ld, fixing!\n", sem_count); + TRACE("ps2: ps2_dev_command: sem_count %ld, fixing!\n", sem_count); if (sem_count > 0) acquire_sem_etc(dev->result_sem, sem_count, 0, 0); else @@ -245,17 +245,17 @@ start = system_time(); res = acquire_sem_etc(dev->result_sem, 1, B_RELATIVE_TIMEOUT, 4000000); - dprintf("ps2: ps2_dev_command wait for ack res 0x%08lx, wait-time %Ld\n", res, system_time() - start); + TRACE("ps2: ps2_dev_command wait for ack res 0x%08lx, wait-time %Ld\n", res, system_time() - start); if (res != B_OK) break; if (atomic_get(&dev->flags) & PS2_FLAG_ACK) { - dprintf("ps2: ps2_dev_command got ACK\n"); + TRACE("ps2: ps2_dev_command got ACK\n"); } if (atomic_get(&dev->flags) & PS2_FLAG_NACK) { - dprintf("ps2: ps2_dev_command got NACK\n"); + TRACE("ps2: ps2_dev_command got NACK\n"); res = B_ERROR; break; } @@ -265,18 +265,18 @@ if (res == B_OK && in_count != 0) { start = system_time(); res = acquire_sem_etc(dev->result_sem, 1, B_RELATIVE_TIMEOUT, 4000000); - dprintf("ps2: ps2_dev_command wait for input res 0x%08lx, wait-time %Ld\n", res, system_time() - start); + TRACE("ps2: ps2_dev_command wait for input res 0x%08lx, wait-time %Ld\n", res, system_time() - start); if (dev->result_buf_cnt != 0) { - dprintf("ps2: ps2_dev_command error: %d input bytes not received\n", dev->result_buf_cnt); + TRACE("ps2: ps2_dev_command error: %d input bytes not received\n", dev->result_buf_cnt); dev->result_buf_cnt = 0; } for (i = 0; i < in_count; i++) - dprintf("ps2: ps2_dev_command in 0x%02x\n", in[i]); + TRACE("ps2: ps2_dev_command in 0x%02x\n", in[i]); } - dprintf("ps2: ps2_dev_command result 0x%08lx\n", res); + TRACE("ps2: ps2_dev_command result 0x%08lx\n", res); atomic_and(&dev->flags, ~PS2_FLAG_CMD); Modified: haiku/trunk/src/add-ons/kernel/bus_managers/ps2/ps2_dev.h =================================================================== --- haiku/trunk/src/add-ons/kernel/bus_managers/ps2/ps2_dev.h 2007-03-08 14:35:26 UTC (rev 20356) +++ haiku/trunk/src/add-ons/kernel/bus_managers/ps2/ps2_dev.h 2007-03-08 17:40:40 UTC (rev 20357) @@ -1,8 +1,8 @@ /* - * Copyright 2005 Haiku, Inc. + * Copyright 2005-2007 Haiku, Inc. * Distributed under the terms of the MIT License. * - * PS/2 hid device driver + * PS/2 bus manager * * Authors (in chronological order): * Marcus Overhagen (marcus at overhagen.de) Modified: haiku/trunk/src/add-ons/kernel/bus_managers/ps2/ps2_keyboard.c =================================================================== --- haiku/trunk/src/add-ons/kernel/bus_managers/ps2/ps2_keyboard.c 2007-03-08 14:35:26 UTC (rev 20356) +++ haiku/trunk/src/add-ons/kernel/bus_managers/ps2/ps2_keyboard.c 2007-03-08 17:40:40 UTC (rev 20357) @@ -1,5 +1,5 @@ /* - * Copyright 2004-2006 Haiku, Inc. + * Copyright 2004-2007 Haiku, Inc. * Distributed under the terms of the MIT License. * * Authors (in chronological order): @@ -43,7 +43,7 @@ { uint8 leds = 0; - TRACE(("ps2_hid: set keyboard LEDs\n")); + TRACE("ps2: set keyboard LEDs\n"); if (ledInfo->scroll_lock) leds |= LED_SCROLL; @@ -61,7 +61,7 @@ { uint8 value; - dprintf("ps2: set_typematic rate %ld, delay %Ld\n", rate, delay); + TRACE("ps2: set_typematic rate %ld, delay %Ld\n", rate, delay); // input server and keyboard preferences *seem* to use a range of 20-300 if (rate < 20) @@ -101,11 +101,11 @@ if (scancode == EXTENDED_KEY) { sIsExtended = true; - TRACE(("Extended key\n")); + TRACE("Extended key\n"); return B_HANDLED_INTERRUPT; } - TRACE(("scancode: %x\n", scancode)); + TRACE("scancode: %x\n", scancode); if (scancode & 0x80) { keyInfo.is_keydown = false; @@ -138,23 +138,23 @@ { status_t status; - TRACE(("read_keyboard_packet()\n")); + TRACE("ps2: read_keyboard_packet\n"); status = acquire_sem_etc(sKeyboardSem, 1, B_CAN_INTERRUPT, 0); if (status < B_OK) return status; if (!ps2_device[PS2_DEVICE_KEYB].active) { - dprintf("ps2: read_keyboard_packet, Error device no longer active\n"); + TRACE("ps2: read_keyboard_packet, Error device no longer active\n"); return B_ERROR; } if (packet_buffer_read(sKeyBuffer, (uint8 *)packet, sizeof(*packet)) == 0) { - TRACE(("read_keyboard_packet(): error reading packet: %s\n", strerror(status))); + TRACE("ps2: read_keyboard_packet, Error reading packet: %s\n", strerror(status)); return B_ERROR; } - TRACE(("scancode: %x, keydown: %s\n", packet->scancode, packet->is_keydown ? "true" : "false")); + TRACE("scancode: %x, keydown: %s\n", packet->scancode, packet->is_keydown ? "true" : "false"); return B_OK; } @@ -163,7 +163,7 @@ ps2_keyboard_disconnect(ps2_dev *dev) { // the keyboard might not be opened at this point - dprintf("ps2: ps2_keyboard_disconnect %s\n", dev->name); + INFO("ps2: ps2_keyboard_disconnect %s\n", dev->name); if (sKeyboardOpenMask) release_sem(sKeyboardSem); } @@ -180,13 +180,13 @@ // This test doesn't work relyable on some notebooks (it reports 0x03) // status = ps2_command(PS2_CTRL_KEYBOARD_TEST, NULL, 0, &data, 1); // if (status != B_OK || data != 0x00) { -// dprintf("ps2: keyboard test failed, status 0x%08lx, data 0x%02x\n", status, data); +// INFO("ps2: keyboard test failed, status 0x%08lx, data 0x%02x\n", status, data); // return B_ERROR; // } status = ps2_dev_command(&ps2_device[PS2_DEVICE_KEYB], PS2_CMD_RESET, NULL, 0, &data, 1); if (status != B_OK || data != 0xaa) { - dprintf("ps2: keyboard reset failed, status 0x%08lx, data 0x%02x\n", status, data); + INFO("ps2: keyboard reset failed, status 0x%08lx, data 0x%02x\n", status, data); return B_ERROR; } @@ -199,7 +199,7 @@ // On my notebook, the keyboard controller does NACK the echo command. // status = ps2_dev_command(&ps2_device[PS2_DEVICE_KEYB], PS2_CMD_ECHO, NULL, 0, &data, 1); // if (status != B_OK || data != 0xee) { -// dprintf("ps2: keyboard echo test failed, status 0x%08lx, data 0x%02x\n", status, data); +// INFO("ps2: keyboard echo test failed, status 0x%08lx, data 0x%02x\n", status, data); // return B_ERROR; // } @@ -215,14 +215,14 @@ { status_t status; - dprintf("ps2: keyboard_open %s\n", name); + TRACE("ps2: keyboard_open %s\n", name); if (atomic_or(&sKeyboardOpenMask, 1) != 0) return B_BUSY; status = probe_keyboard(); if (status != B_OK) { - dprintf("ps2: keyboard probing failed\n"); + INFO("ps2: keyboard probing failed\n"); ps2_service_notify_device_removed(&ps2_device[PS2_DEVICE_KEYB]); goto err1; } @@ -245,7 +245,7 @@ atomic_or(&ps2_device[PS2_DEVICE_KEYB].flags, PS2_FLAG_ENABLED); - dprintf("ps2: keyboard_open %s success\n", name); + TRACE("ps2: keyboard_open %s success\n", name); return B_OK; err2: @@ -253,7 +253,7 @@ err1: atomic_and(&sKeyboardOpenMask, 0); - dprintf("ps2: keyboard_open %s failed\n", name); + TRACE("ps2: keyboard_open %s failed\n", name); return status; } @@ -261,7 +261,7 @@ static status_t keyboard_close(void *cookie) { - TRACE(("keyboard_close()\n")); + TRACE("ps2: keyboard_close\n"); delete_packet_buffer(sKeyBuffer); delete_sem(sKeyboardSem); @@ -284,7 +284,7 @@ static status_t keyboard_read(void *cookie, off_t pos, void *buffer, size_t *_length) { - TRACE(("keyboard read()\n")); + TRACE("ps2: keyboard read\n"); *_length = 0; return B_NOT_ALLOWED; } @@ -293,7 +293,7 @@ static status_t keyboard_write(void *cookie, off_t pos, const void *buffer, size_t *_length) { - TRACE(("keyboard write()\n")); + TRACE("ps2: keyboard write\n"); *_length = 0; return B_NOT_ALLOWED; } @@ -302,13 +302,13 @@ static status_t keyboard_ioctl(void *cookie, uint32 op, void *buffer, size_t length) { - TRACE(("keyboard ioctl()\n")); + TRACE("ps2: keyboard ioctl\n"); switch (op) { case KB_READ: { at_kbd_io packet; status_t status; - TRACE(("KB_READ\n")); + TRACE("ps2: KB_READ\n"); if ((status = read_keyboard_packet(&packet)) < B_OK) return status; return user_memcpy(buffer, &packet, sizeof(packet)); @@ -317,7 +317,7 @@ case KB_SET_LEDS: { led_info info; - TRACE(("KB_SET_LEDS\n")); + TRACE("ps2: KB_SET_LEDS\n"); if (user_memcpy(&info, buffer, sizeof(led_info)) < B_OK) return B_BAD_ADDRESS; return set_leds(&info); @@ -340,7 +340,7 @@ int32 key_repeat_rate; if (user_memcpy(&key_repeat_rate, buffer, sizeof(key_repeat_rate)) < B_OK) return B_BAD_ADDRESS; - dprintf("ps2: KB_SET_KEY_REPEAT_RATE %ld\n", key_repeat_rate); + TRACE("ps2: KB_SET_KEY_REPEAT_RATE %ld\n", key_repeat_rate); if (set_typematic(key_repeat_rate, sKeyboardRepeatDelay) < B_OK) return B_ERROR; sKeyboardRepeatRate = key_repeat_rate; @@ -357,7 +357,7 @@ bigtime_t key_repeat_delay; if (user_memcpy(&key_repeat_delay, buffer, sizeof(key_repeat_delay)) < B_OK) return B_BAD_ADDRESS; - dprintf("ps2: KB_SET_KEY_REPEAT_DELAY %Ld\n", key_repeat_delay); + TRACE("ps2: KB_SET_KEY_REPEAT_DELAY %Ld\n", key_repeat_delay); if (set_typematic(sKeyboardRepeatRate, key_repeat_delay) < B_OK) return B_ERROR; sKeyboardRepeatDelay = key_repeat_delay; @@ -374,11 +374,11 @@ case KB_SET_CONTROL_ALT_DEL_TIMEOUT: case KB_CANCEL_CONTROL_ALT_DEL: case KB_DELAY_CONTROL_ALT_DEL: - TRACE(("ps2_hid: ioctl 0x%lx not implemented yet, returning B_OK\n", op)); + INFO("ps2: ioctl 0x%lx not implemented yet, returning B_OK\n", op); return B_OK; default: - TRACE(("ps2_hid: invalid ioctl 0x%lx\n", op)); + INFO("ps2: invalid ioctl 0x%lx\n", op); return EINVAL; } } Modified: haiku/trunk/src/add-ons/kernel/bus_managers/ps2/ps2_mouse.c =================================================================== --- haiku/trunk/src/add-ons/kernel/bus_managers/ps2/ps2_mouse.c 2007-03-08 14:35:26 UTC (rev 20356) +++ haiku/trunk/src/add-ons/kernel/bus_managers/ps2/ps2_mouse.c 2007-03-08 17:40:40 UTC (rev 20357) @@ -1,5 +1,5 @@ /* - * Copyright 2001-2006 Haiku, Inc. + * Copyright 2001-2007 Haiku, Inc. * Distributed under the terms of the MIT License. * * PS/2 mouse device driver @@ -46,13 +46,7 @@ * * Interrupts: * ~~~~~~~~~~ - * The PS/2 mouse device is connected to interrupt 12, which means that - * it uses the second interrupt controller (handles INT8 to INT15). In - * order for this interrupt to be enabled, both the 5th interrupt of - * the second controller AND the 3rd interrupt of the first controller - * (cascade mode) should be unmasked. - * This is all done inside install_io_interrupt_handler(), no need to - * worry about it anymore + * The PS/2 mouse device is connected to interrupt 12. * The controller uses 3 consecutive interrupts to inform the computer * that it has new data. On the first the data register holds the status * byte, on the second the X offset, and on the 3rd the Y offset. @@ -94,17 +88,17 @@ uint8 data[2]; status_t status; - TRACE(("ps2_reset_mouse()\n")); + TRACE("ps2_reset_mouse\n"); status = ps2_dev_command(cookie->dev, PS2_CMD_RESET, NULL, 0, data, 2); if (status == B_OK && data[0] != 0xAA && data[1] != 0x00) { - TRACE(("reset mouse failed, response was: 0x%02x 0x%02x\n", data[0], data[1])); + TRACE("reset mouse failed, response was: 0x%02x 0x%02x\n", data[0], data[1]); status = B_ERROR; } else if (status != B_OK) { - TRACE(("reset mouse failed\n")); + TRACE("reset mouse failed\n"); } else { - TRACE(("reset mouse success\n")); + TRACE("reset mouse success\n"); } return status; @@ -151,7 +145,7 @@ } } -// dprintf("packet: %02x %02x %02x %02x: xd %d, yd %d, 0x%x (%d), w-xd %d, w-yd %d\n", +// TRACE("packet: %02x %02x %02x %02x: xd %d, yd %d, 0x%x (%d), w-xd %d, w-yd %d\n", // packet[0], packet[1], packet[2], packet[3], // xDelta, yDelta, buttons, cookie->click_count, wheel_xdelta, wheel_ydelta); @@ -165,8 +159,8 @@ pos->wheel_ydelta = (int)wheel_ydelta; pos->wheel_xdelta = (int)wheel_xdelta; - TRACE(("xdelta: %d, ydelta: %d, buttons %x, clicks: %d, timestamp %Ld\n", - xDelta, yDelta, buttons, cookie->click_count, currentTime)); + TRACE("xdelta: %d, ydelta: %d, buttons %x, clicks: %d, timestamp %Ld\n", + xDelta, yDelta, buttons, cookie->click_count, currentTime); } } @@ -179,23 +173,23 @@ uint8 packet[PS2_MAX_PACKET_SIZE]; status_t status; - TRACE(("mouse_read_event()\n")); + TRACE("ps2: mouse_read_event\n"); status = acquire_sem_etc(cookie->mouse_sem, 1, B_CAN_INTERRUPT, 0); if (status < B_OK) return status; if (!cookie->dev->active) { - dprintf("ps2: mouse_read_event: Error device no longer active\n"); + TRACE("ps2: mouse_read_event: Error device no longer active\n"); return B_ERROR; } if (packet_buffer_read(cookie->mouse_buffer, packet, cookie->packet_size) != cookie->packet_size) { - TRACE(("error copying buffer\n")); + TRACE("ps2: error copying buffer\n"); return B_ERROR; } if (!(packet[0] & 8)) - panic("ps2_hid: got broken data from packet_buffer_read\n"); + panic("ps2: got broken data from packet_buffer_read\n"); ps2_packet_to_movement(cookie, packet, movement); return B_OK; @@ -206,7 +200,7 @@ ps2_mouse_disconnect(ps2_dev *dev) { // the mouse device might not be opened at this point - dprintf("ps2: ps2_mouse_disconnect %s\n", dev->name); + INFO("ps2: ps2_mouse_disconnect %s\n", dev->name); if (dev->flags & PS2_FLAG_OPEN) release_sem(((mouse_cookie *)dev->cookie)->mouse_sem); } @@ -225,7 +219,7 @@ const uint8 data = dev->history[0].data; if (cookie->packet_index == 0 && !(data & 8)) { - TRACE(("bad mouse data, trying resync\n")); + TRACE("bad mouse data, trying resync\n"); return B_HANDLED_INTERRUPT; } @@ -259,17 +253,20 @@ status_t status; uint8 deviceId = 0; - status = ps2_reset_mouse(cookie); + if (status != B_OK) { + INFO("ps2: probe_mouse reset failed\n"); + return B_ERROR; + } // get device id status = ps2_dev_command(cookie->dev, PS2_CMD_GET_DEVICE_ID, NULL, 0, &deviceId, 1); if (status != B_OK) { - TRACE(("probe_mouse(): get device id failed\n")); + INFO("ps2: probe_mouse get device id failed\n"); return B_ERROR; } - TRACE(("probe_mouse(): device id: %2x\n", deviceId)); + TRACE("ps2: probe_mouse device id: %2x\n", deviceId); // check for MS Intellimouse if (deviceId == 0) { @@ -279,17 +276,17 @@ status |= ps2_set_sample_rate(cookie, 80); status |= ps2_dev_command(cookie->dev, PS2_CMD_GET_DEVICE_ID, NULL, 0, &alternate_device_id, 1); if (status == 0) { - TRACE(("probe_mouse(): alternate device id: %2x\n", alternate_device_id)); + TRACE("ps2: probe_mouse alternate device id: %2x\n", alternate_device_id); deviceId = alternate_device_id; } } if (deviceId == PS2_DEV_ID_STANDARD) { - TRACE(("Standard PS/2 mouse found\n")); + INFO("ps2: probe_mouse Standard PS/2 mouse found\n"); if (probed_packet_size) *probed_packet_size = PS2_PACKET_STANDARD; } else if (deviceId == PS2_DEV_ID_INTELLIMOUSE) { - TRACE(("Extended PS/2 mouse found\n")); + INFO("ps2: probe_mouse Extended PS/2 mouse found\n"); if (probed_packet_size) *probed_packet_size = PS2_PACKET_INTELLIMOUSE; } else { @@ -313,7 +310,7 @@ status_t status; int i; - dprintf("ps2: mouse_open %s\n", name); + TRACE("ps2: mouse_open %s\n", name); for (dev = NULL, i = 0; i < PS2_DEVICE_COUNT; i++) { if (0 == strcmp(ps2_device[i].name, name)) { @@ -323,7 +320,7 @@ } if (dev == NULL) { - TRACE(("dev = NULL\n")); + TRACE("dev = NULL\n"); return B_ERROR; } @@ -344,14 +341,14 @@ status = probe_mouse(cookie, &cookie->packet_size); if (status != B_OK) { - TRACE(("probing mouse failed\n")); + INFO("ps2: probing mouse %s failed\n", name); ps2_service_notify_device_removed(dev); goto err1; } cookie->mouse_buffer = create_packet_buffer(MOUSE_HISTORY_SIZE * cookie->packet_size); if (cookie->mouse_buffer == NULL) { - TRACE(("can't allocate mouse actions buffer\n")); + TRACE("can't allocate mouse actions buffer\n"); goto err2; } @@ -359,19 +356,19 @@ // the interrupt handler and the read operation cookie->mouse_sem = create_sem(0, "ps2_mouse_sem"); if (cookie->mouse_sem < 0) { - TRACE(("failed creating PS/2 mouse semaphore!\n")); + TRACE("failed creating PS/2 mouse semaphore!\n"); goto err3; } status = ps2_dev_command(dev, PS2_CMD_ENABLE, NULL, 0, NULL, 0); if (status < B_OK) { - TRACE(("mouse_open(): cannot enable PS/2 mouse\n")); + INFO("ps2: cannot enable mouse %s\n", name); goto err4; } atomic_or(&dev->flags, PS2_FLAG_ENABLED); - dprintf("ps2: mouse_open %s success\n", name); + TRACE("ps2: mouse_open %s success\n", name); return B_OK; err4: @@ -383,7 +380,7 @@ err1: atomic_and(&dev->flags, ~PS2_FLAG_OPEN); - dprintf("ps2: mouse_open %s failed\n", name); + TRACE("ps2: mouse_open %s failed\n", name); return B_ERROR; } @@ -393,7 +390,7 @@ { mouse_cookie *cookie = _cookie; - dprintf("ps2: mouse_close %s\n", cookie->dev->name); + TRACE("ps2: mouse_close %s\n", cookie->dev->name); ps2_dev_command(cookie->dev, PS2_CMD_DISABLE, NULL, 0, NULL, 0); @@ -441,7 +438,7 @@ case MS_NUM_EVENTS: { int32 count; - TRACE(("MS_NUM_EVENTS\n")); + TRACE("MS_NUM_EVENTS\n"); get_sem_count(cookie->mouse_sem, &count); return count; } @@ -450,36 +447,36 @@ { mouse_movement movement; status_t status; - TRACE(("MS_READ\n")); + TRACE("MS_READ\n"); if ((status = mouse_read_event(cookie, &movement)) < B_OK) return status; -// dprintf("%s %d %d %d %d\n", cookie->dev->name, +// TRACE("%s %d %d %d %d\n", cookie->dev->name, // movement.xdelta, movement.ydelta, movement.buttons, movement.clicks); return user_memcpy(buffer, &movement, sizeof(movement)); } case MS_SET_TYPE: - TRACE(("MS_SET_TYPE not implemented\n")); + TRACE("MS_SET_TYPE not implemented\n"); return B_BAD_VALUE; case MS_SET_MAP: - TRACE(("MS_SET_MAP (set mouse mapping) not implemented\n")); + TRACE("MS_SET_MAP (set mouse mapping) not implemented\n"); return B_BAD_VALUE; case MS_GET_ACCEL: - TRACE(("MS_GET_ACCEL (get mouse acceleration) not implemented\n")); + TRACE("MS_GET_ACCEL (get mouse acceleration) not implemented\n"); return B_BAD_VALUE; case MS_SET_ACCEL: - TRACE(("MS_SET_ACCEL (set mouse acceleration) not implemented\n")); + TRACE("MS_SET_ACCEL (set mouse acceleration) not implemented\n"); return B_BAD_VALUE; case MS_SET_CLICKSPEED: - TRACE(("MS_SETCLICK (set click speed)\n")); + TRACE("MS_SETCLICK (set click speed)\n"); return user_memcpy(&cookie->click_speed, buffer, sizeof(bigtime_t)); default: - TRACE(("unknown opcode: %ld\n", op)); + TRACE("unknown opcode: %ld\n", op); return B_BAD_VALUE; } } Modified: haiku/trunk/src/add-ons/kernel/bus_managers/ps2/ps2_service.c =================================================================== --- haiku/trunk/src/add-ons/kernel/bus_managers/ps2/ps2_service.c 2007-03-08 14:35:26 UTC (rev 20356) +++ haiku/trunk/src/add-ons/kernel/bus_managers/ps2/ps2_service.c 2007-03-08 17:40:40 UTC (rev 20357) @@ -1,8 +1,8 @@ /* - * Copyright 2005 Haiku, Inc. + * Copyright 2005-2007 Haiku, Inc. * Distributed under the terms of the MIT License. * - * PS/2 hid device driver + * PS/2 bus manager * * Authors (in chronological order): * Marcus Overhagen (marcus at overhagen.de) @@ -33,7 +33,7 @@ { ps2_service_cmd cmd; - TRACE(("ps2_service_notify_device_added %s\n", dev->name)); + TRACE("ps2_service_notify_device_added %s\n", dev->name); cmd.id = PS2_SERVICE_NOTIFY_DEVICE_ADDED; cmd.dev = dev; @@ -41,7 +41,7 @@ packet_buffer_write(sServiceCmdBuffer, (const uint8 *)&cmd, sizeof(cmd)); release_sem_etc(sServiceSem, 1, B_DO_NOT_RESCHEDULE); - TRACE(("ps2_service_notify_device_added done\n")); + TRACE("ps2_service_notify_device_added done\n"); [... truncated: 108 lines follow ...] From bonefish at mail.berlios.de Thu Mar 8 20:28:06 2007 From: bonefish at mail.berlios.de (bonefish at BerliOS) Date: Thu, 8 Mar 2007 20:28:06 +0100 Subject: [Haiku-commits] r20358 - haiku/trunk Message-ID: <200703081928.l28JS6iK003840@sheep.berlios.de> Author: bonefish Date: 2007-03-08 20:28:06 +0100 (Thu, 08 Mar 2007) New Revision: 20358 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20358&view=rev Modified: haiku/trunk/ReadMe Log: Removed mentioning of non-BeOS platforms in the "Configuring on BeOS" section. Modified: haiku/trunk/ReadMe =================================================================== --- haiku/trunk/ReadMe 2007-03-08 17:40:40 UTC (rev 20357) +++ haiku/trunk/ReadMe 2007-03-08 19:28:06 UTC (rev 20358) @@ -31,9 +31,6 @@ * bone * dano (also for Zeta) -When building on Linux and other non-BeOS platforms "haiku" is the -only supported target platform, so you don't need the "--target" parameter. - The configure script generates a file named "BuildConfig" in the "build" directory. As long as configure is not modified (!), there is no need to call it again. That is for re-building you only need to invoke jam (see below). From mmu_man at mail.berlios.de Thu Mar 8 20:28:18 2007 From: mmu_man at mail.berlios.de (mmu_man at BerliOS) Date: Thu, 8 Mar 2007 20:28:18 +0100 Subject: [Haiku-commits] r20359 - haiku/trunk/src/add-ons/media/media-add-ons/legacy Message-ID: <200703081928.l28JSIr4003903@sheep.berlios.de> Author: mmu_man Date: 2007-03-08 20:28:17 +0100 (Thu, 08 Mar 2007) New Revision: 20359 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20359&view=rev Modified: haiku/trunk/src/add-ons/media/media-add-ons/legacy/Jamfile haiku/trunk/src/add-ons/media/media-add-ons/legacy/LegacyMediaAddOn.cpp haiku/trunk/src/add-ons/media/media-add-ons/legacy/LegacyMediaAddOn.h Log: implement a recursive scanning of /dev/audio/old/ to find devices. Untested yet. Modified: haiku/trunk/src/add-ons/media/media-add-ons/legacy/Jamfile =================================================================== --- haiku/trunk/src/add-ons/media/media-add-ons/legacy/Jamfile 2007-03-08 19:28:06 UTC (rev 20358) +++ haiku/trunk/src/add-ons/media/media-add-ons/legacy/Jamfile 2007-03-08 19:28:17 UTC (rev 20359) @@ -8,5 +8,5 @@ LegacyAudioProducer.cpp LegacyMediaAddOn.cpp : false - : media + : be media ; Modified: haiku/trunk/src/add-ons/media/media-add-ons/legacy/LegacyMediaAddOn.cpp =================================================================== --- haiku/trunk/src/add-ons/media/media-add-ons/legacy/LegacyMediaAddOn.cpp 2007-03-08 19:28:06 UTC (rev 20358) +++ haiku/trunk/src/add-ons/media/media-add-ons/legacy/LegacyMediaAddOn.cpp 2007-03-08 19:28:17 UTC (rev 20359) @@ -7,11 +7,17 @@ #include +#include +#include +#include +#include + #include "LegacyMediaAddOn.h" #include "LegacyAudioConsumer.h" #include "LegacyAudioProducer.h" +#define LEGACY_DEVICE_PATH_BASE "/dev/audio/old" LegacyMediaAddOn::LegacyMediaAddOn( image_id imid ) : BMediaAddOn( imid ) @@ -59,6 +65,42 @@ return NULL; } +status_t +LegacyMediaAddOn::RecursiveScanForDevices(const char *path) +{ + BDirectory d(path ? path : LEGACY_DEVICE_PATH_BASE); + if (d.InitCheck() < B_OK) + return d.InitCheck(); + BEntry ent; + while (d.GetNextEntry(&ent) == B_OK) { + struct stat st; + char name[B_FILE_NAME_LENGTH]; + ent.GetName(name); + if (d.GetStatFor(name, &st) < 0) + continue; + BPath p(&ent); + // we're only interested in folders... + if (S_ISDIR(st.st_mode)) { + RecursiveScanForDevices(p.Path()); + // discard error + continue; + } + // and (char) devices + if (!S_ISCHR(st.st_mode)) + continue; + + // we want relative path + BString s(p.Path()); + s.RemoveFirst(LEGACY_DEVICE_PATH_BASE"/"); + + // XXX: should check first for consumer or producer... + // XXX: use a struct/class + fConsumers.AddItem((void *)s.String()); + //XXX: only cons for now + //fProducers.AddItem(s.String()); + } + return B_OK; +} BMediaAddOn * make_media_addon( image_id imid ) Modified: haiku/trunk/src/add-ons/media/media-add-ons/legacy/LegacyMediaAddOn.h =================================================================== --- haiku/trunk/src/add-ons/media/media-add-ons/legacy/LegacyMediaAddOn.h 2007-03-08 19:28:06 UTC (rev 20358) +++ haiku/trunk/src/add-ons/media/media-add-ons/legacy/LegacyMediaAddOn.h 2007-03-08 19:28:17 UTC (rev 20359) @@ -2,6 +2,7 @@ #define _LEGACY_MEDIA_ADDON_H #include +#include #include "LegacyAudioConsumer.h" //#include "LegacyAudioProducer.h" @@ -29,14 +30,16 @@ virtual status_t AutoStart( int in_count, BMediaNode **out_node, int32 *out_internal_id, bool *out_has_more ) { return B_ERROR; } + status_t RecursiveScanForDevices(const char *path=NULL); + private: status_t fInitStatus; flavor_info fFlavorInfo; media_format fMediaFormat; - //BList *consumers; - //BList *producers; + BList fConsumers; + BList fProducers; LegacyAudioConsumer *consumer; }; From stefano.ceccherini at gmail.com Fri Mar 9 10:42:42 2007 From: stefano.ceccherini at gmail.com (Stefano Ceccherini) Date: Fri, 9 Mar 2007 10:42:42 +0100 Subject: [Haiku-commits] r20335 - haiku/trunk/src/apps/terminal In-Reply-To: <9169239168-BeMail@zon> References: <894b9700703080326u2c067938i7516920f49dcd90b@mail.gmail.com> <9169239168-BeMail@zon> Message-ID: <894b9700703090142n5fd501c8n1ce2050dfe166301@mail.gmail.com> 2007/3/8, Axel D?rfler : > "Stefano Ceccherini" wrote: > > Oh well, looking at the code in PrefDlg.cpp, it's clear why this is > > happening... > > > > AddShortcut((ulong)'Q', (ulong)B_COMMAND_KEY, new > > BMessage(B_QUIT_REQUESTED)); > > Does it happen in BeOS as well? If not, maybe Command-Q can't be > overwritten unless you remove it before. I don't know, Vasilis would know better, I think. In any way, I can't see why that window redefines it (and it also redefines ALT-W), so I think I'll remove both AddShortcut() calls altogether. From bonefish at mail.berlios.de Fri Mar 9 15:07:27 2007 From: bonefish at mail.berlios.de (bonefish at BerliOS) Date: Fri, 9 Mar 2007 15:07:27 +0100 Subject: [Haiku-commits] r20360 - haiku/trunk Message-ID: <200703091407.l29E7RTI014760@sheep.berlios.de> Author: bonefish Date: 2007-03-09 15:07:27 +0100 (Fri, 09 Mar 2007) New Revision: 20360 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20360&view=rev Modified: haiku/trunk/ReadMe.cross-compile Log: Added a list of tools directly or indirectly required to build Haiku. Modified: haiku/trunk/ReadMe.cross-compile =================================================================== --- haiku/trunk/ReadMe.cross-compile 2007-03-08 19:28:17 UTC (rev 20359) +++ haiku/trunk/ReadMe.cross-compile 2007-03-09 14:07:27 UTC (rev 20360) @@ -12,9 +12,20 @@ svn checkout svn://svn.berlios.de/haiku/buildtools/trunk buildtools You should now have a 'buildtools' folder that contains folders named -'binutils' and 'gcc' among others. +'binutils', 'gcc', and 'jam' among others. +Several other tools are required to build these build tools or are used by +Haiku's build system itself: + * gcc and the binutils (as, ld, etc., required by gcc) + * make (GNU make) + * bison + * flex and lex (usually a mini shell script invoking flex) + * makeinfo (part of texinfo, needed for building gcc 4 only) +Whether they are installed can be tested for instance by running them in the +shell with the "--version" parameter. + + Building Jam ============ From mmu_man at mail.berlios.de Fri Mar 9 16:43:42 2007 From: mmu_man at mail.berlios.de (mmu_man at BerliOS) Date: Fri, 9 Mar 2007 16:43:42 +0100 Subject: [Haiku-commits] r20361 - haiku/trunk/src/add-ons/media/media-add-ons/legacy Message-ID: <200703091543.l29Fhg6x021990@sheep.berlios.de> Author: mmu_man Date: 2007-03-09 16:43:41 +0100 (Fri, 09 Mar 2007) New Revision: 20361 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20361&view=rev Modified: haiku/trunk/src/add-ons/media/media-add-ons/legacy/LegacyMediaAddOn.cpp haiku/trunk/src/add-ons/media/media-add-ons/legacy/LegacyMediaAddOn.h Log: It should now list and instanciate devices correctly... but doesn't work yet :-( Modified: haiku/trunk/src/add-ons/media/media-add-ons/legacy/LegacyMediaAddOn.cpp =================================================================== --- haiku/trunk/src/add-ons/media/media-add-ons/legacy/LegacyMediaAddOn.cpp 2007-03-09 14:07:27 UTC (rev 20360) +++ haiku/trunk/src/add-ons/media/media-add-ons/legacy/LegacyMediaAddOn.cpp 2007-03-09 15:43:41 UTC (rev 20361) @@ -7,11 +7,13 @@ #include +#include #include #include #include #include + #include "LegacyMediaAddOn.h" #include "LegacyAudioConsumer.h" @@ -21,20 +23,38 @@ LegacyMediaAddOn::LegacyMediaAddOn( image_id imid ) : BMediaAddOn( imid ) + , fInternalIds( 0 ) + , fListsLock( "LegacyMediaAddOn:ListLock" ) { fInitStatus = B_NO_INIT; - consumer = new LegacyAudioConsumer( this, "ymf744/1", 0 ); + fMediaFormat.type = B_MEDIA_RAW_AUDIO; + fMediaFormat.u.raw_audio = media_raw_audio_format::wildcard; + + fInitStatus = RecursiveScanForDevices(); + //consumer = new LegacyAudioConsumer( this, "ymf744/1", 0 ); //producer = new LegacyAudioProducer( "maestro2/1" ); - fInitStatus = B_OK; } LegacyMediaAddOn::~LegacyMediaAddOn() { - delete consumer; + //delete consumer; //delete producer; + LegacyDevice *dev; + while ((dev = (LegacyDevice *)fConsumers.RemoveItem((int32)0))) { + delete dev->consumer; + //delete dev->producer; + delete dev; + } + while ((dev = (LegacyDevice *)fProducers.RemoveItem((int32)0))) { + //delete dev->consumer; + //delete dev->producer; + delete dev; + } + + } @@ -48,13 +68,35 @@ int32 LegacyMediaAddOn::CountFlavors() { - return 0; + int32 count; + BAutolock al(fListsLock); + + count = fConsumers.CountItems() + fProducers.CountItems(); + return count; } status_t LegacyMediaAddOn::GetFlavorAt( int32 n, const flavor_info **out_info ) { + BAutolock al(fListsLock); + LegacyDevice *dev; + if (n < 0) + return EINVAL; + for (n = fConsumers.CountItems() - 1; n >= 0; n--) { + dev = (LegacyDevice *)fConsumers.ItemAt(n); + if (dev->flavor.internal_id != n) + continue; + *out_info = &dev->flavor; + return B_OK; + } + for (n = fProducers.CountItems() - 1; n >= 0; n--) { + dev = (LegacyDevice *)fProducers.ItemAt(n); + if (dev->flavor.internal_id != n) + continue; + *out_info = &dev->flavor; + return B_OK; + } return B_ERROR; } @@ -62,6 +104,37 @@ BMediaNode * LegacyMediaAddOn::InstantiateNodeFor( const flavor_info *info, BMessage *config, status_t *out_error ) { + BAutolock al(fListsLock); + LegacyDevice *dev; + int32 n; + int32 consumerCount = fConsumers.CountItems(); + for (n = consumerCount - 1; n >= 0; n--) { + dev = (LegacyDevice *)fConsumers.ItemAt(n); + //if (info != &dev->flavor) // XXX memcmp? + if (info->internal_id != dev->flavor.internal_id) + continue; + if (dev->inuse) // EBUSY! + return NULL; + dev->consumer = new LegacyAudioConsumer( this, dev->name.String(), n ); + if (!dev->consumer) + return NULL; + dev->inuse = true; + return dev->consumer; + } +/* + for (n = fProducers.CountItems() - 1; n >= 0; n--) { + dev = (LegacyDevice *)fProducers.ItemAt(n); + if (info != &dev->flavor) // XXX memcmp? + continue; + if (dev->inuse) // EBUSY! + return NULL; + dev->producer = new LegacyAudioProducer( this, dev->name.String(), consumerCount + n ); + if (!dev->producer) + return NULL; + dev->inuse = true; + return dev->producer; + } +*/ return NULL; } @@ -94,14 +167,56 @@ s.RemoveFirst(LEGACY_DEVICE_PATH_BASE"/"); // XXX: should check first for consumer or producer... - // XXX: use a struct/class - fConsumers.AddItem((void *)s.String()); + LegacyDevice *dev = new LegacyDevice; + dev->name = s.String(); + dev->flavor.name = (char *)/*WTF*/dev->name.String(); + dev->flavor.info = (char *)dev->name.String(); + dev->flavor.kinds = B_BUFFER_CONSUMER | /*B_CONTROLLABLE |*/ B_PHYSICAL_OUTPUT; + dev->flavor.flavor_flags = 0; //B_FLAVOR_IS_GLOBAL; + dev->flavor.internal_id = fInternalIds++; + dev->flavor.possible_count = 1; + dev->flavor.in_format_count = 1; + dev->flavor.in_format_flags = 0; + dev->flavor.in_formats = &fMediaFormat; + dev->flavor.out_format_count = 0; + dev->flavor.out_format_flags = 0; + dev->flavor.out_formats = NULL; + dev->inuse = false; + dev->consumer = NULL; + //dev->producer = NULL; + fConsumers.AddItem((void *)dev); //XXX: only cons for now //fProducers.AddItem(s.String()); } return B_OK; } +#if 0 + +struct flavor_info { + char * name; + char * info; + uint64 kinds; /* node_kind */ + uint32 flavor_flags; + int32 internal_id; /* For BMediaAddOn internal use */ + int32 possible_count; /* 0 for "any number" */ + + int32 in_format_count; /* for BufferConsumer kinds */ + uint32 in_format_flags; /* set to 0 */ + const media_format * in_formats; + + int32 out_format_count; /* for BufferProducer kinds */ + uint32 out_format_flags; /* set to 0 */ + const media_format * out_formats; + + uint32 _reserved_[16]; + +private: + flavor_info & operator=(const flavor_info & other); +}; +#endif + + BMediaAddOn * make_media_addon( image_id imid ) { Modified: haiku/trunk/src/add-ons/media/media-add-ons/legacy/LegacyMediaAddOn.h =================================================================== --- haiku/trunk/src/add-ons/media/media-add-ons/legacy/LegacyMediaAddOn.h 2007-03-09 14:07:27 UTC (rev 20360) +++ haiku/trunk/src/add-ons/media/media-add-ons/legacy/LegacyMediaAddOn.h 2007-03-09 15:43:41 UTC (rev 20361) @@ -3,11 +3,23 @@ #include #include +#include +#include #include "LegacyAudioConsumer.h" //#include "LegacyAudioProducer.h" +class LegacyDevice { +public: + BString name; + flavor_info flavor; + bool inuse; + LegacyAudioConsumer *consumer; + //LegacyAudioProducer *producer; + +}; + class LegacyMediaAddOn : public BMediaAddOn { public: @@ -34,14 +46,16 @@ private: status_t fInitStatus; + int32 fInternalIds; flavor_info fFlavorInfo; media_format fMediaFormat; + BLocker fListsLock; BList fConsumers; BList fProducers; - LegacyAudioConsumer *consumer; + //OLD:LegacyAudioConsumer *consumer; }; From axeld at pinc-software.de Fri Mar 9 17:51:41 2007 From: axeld at pinc-software.de (Axel =?iso-8859-15?q?D=F6rfler?=) Date: Fri, 09 Mar 2007 17:51:41 +0100 CET Subject: [Haiku-commits] r20317 - haiku/trunk/headers/posix In-Reply-To: <200703040231.l242Viv6020174@sheep.berlios.de> Message-ID: <33997095804-BeMail@zon> bonefish at BerliOS wrote: > Log: > Added C++ guard. I don't know, why we define the protos > both > there and in . Any reason for not removing them in >? Or > maybe even nicer reverse the inclusion direction, i.e. remove the > duplicate protos in and include instead. According to the POSIX specs, wctype.h may include wchar.h, but not vice versa. Why the prototypes are declared in both headers is a mystery to me, too, though :-) Bye, Axel. From kaoutsis at sch.gr Fri Mar 9 20:36:06 2007 From: kaoutsis at sch.gr (Kaoutsis) Date: Fri, 09 Mar 2007 21:36:06 +0200 EET Subject: [Haiku-commits] r20335 - haiku/trunk/src/apps/terminal In-Reply-To: <894b9700703090142n5fd501c8n1ce2050dfe166301@mail.gmail.com> Message-ID: <3700004355-BeMail@> Stefano Ceccherini> 2007/3/8, Axel D?rfler : > > "Stefano Ceccherini" wrote: > > > Oh well, looking at the code in PrefDlg.cpp, it's clear why this > > > is > > > happening... > > > > > > AddShortcut((ulong)'Q', (ulong)B_COMMAND_KEY, new > > > BMessage(B_QUIT_REQUESTED)); > > > > Does it happen in BeOS as well? If not, maybe Command-Q can't be > > overwritten unless you remove it before. > > I don't know, Vasilis would know better, I think. Hm... Stefano keep the "knows better" questionable :-) Fran?ois made a very nice catch! taken from our bible, Window.html: [...] Every BWindow has five built-in shortcuts: Shortcut Message Handler Command+x B_CUT the focus view Command+c B_COPY the focus view Command+v B_PASTE the focus view Command+a B_SELECT_ALL the focus view Command+w (closable windows only) B_QUIT_REQUESTED the BWindow FOLLOWS THE INTERESTING PART: In addition, BWindows respond to Command+q by posting B_QUIT_REQUESTED to be_app. [...] > In any way, I can't see why that window redefines it (and it also > redefines ALT-W), so I think I'll remove both AddShortcut() calls > altogether. So i tried to remove both AddShortcut(): the behavior remains the same! i tried to override the behavior with a custom message, with no effect. So no matter what, alt + q posts B_QUIT_REQUESTED to be_app. We might want not to follow compatibility here. Bye, Vasilis From kaoutsis at sch.gr Fri Mar 9 20:36:21 2007 From: kaoutsis at sch.gr (Kaoutsis) Date: Fri, 09 Mar 2007 21:36:21 +0200 EET Subject: [Haiku-commits] r20335 - haiku/trunk/src/apps/terminal In-Reply-To: <894b9700703090142n5fd501c8n1ce2050dfe166301@mail.gmail.com> Message-ID: <3714086698-BeMail@> Stefano Ceccherini> 2007/3/8, Axel D?rfler : > > "Stefano Ceccherini" wrote: > > > Oh well, looking at the code in PrefDlg.cpp, it's clear why this > > > is > > > happening... > > > > > > AddShortcut((ulong)'Q', (ulong)B_COMMAND_KEY, new > > > BMessage(B_QUIT_REQUESTED)); > > > > Does it happen in BeOS as well? If not, maybe Command-Q can't be > > overwritten unless you remove it before. > > I don't know, Vasilis would know better, I think. Hm... Stefano keep the "knows better" questionable :-) Fran?ois made a very nice catch! taken from our bible, Window.html: [...] Every BWindow has five built-in shortcuts: Shortcut Message Handler Command+x B_CUT the focus view Command+c B_COPY the focus view Command+v B_PASTE the focus view Command+a B_SELECT_ALL the focus view Command+w (closable windows only) B_QUIT_REQUESTED the BWindow FOLLOWS THE INTERESTING PART: In addition, BWindows respond to Command+q by posting B_QUIT_REQUESTED to be_app. [...] > In any way, I can't see why that window redefines it (and it also > redefines ALT-W), so I think I'll remove both AddShortcut() calls > altogether. So i tried to remove both AddShortcut(): the behavior remains the same! i tried to override the behavior with a custom message, with no effect. So no matter what, alt + q posts B_QUIT_REQUESTED to be_app. We might want not to follow compatibility here. Bye, Vasilis From kaoutsis at sch.gr Fri Mar 9 20:36:48 2007 From: kaoutsis at sch.gr (Kaoutsis) Date: Fri, 09 Mar 2007 21:36:48 +0200 EET Subject: [Haiku-commits] r20335 - haiku/trunk/src/apps/terminal Message-ID: <3741659272-BeMail@> Stefano Ceccherini> 2007/3/8, Axel D?rfler : > > "Stefano Ceccherini" wrote: > > > Oh well, looking at the code in PrefDlg.cpp, it's clear why this > > > is > > > happening... > > > > > > AddShortcut((ulong)'Q', (ulong)B_COMMAND_KEY, new > > > BMessage(B_QUIT_REQUESTED)); > > > > Does it happen in BeOS as well? If not, maybe Command-Q can't be > > overwritten unless you remove it before. > > I don't know, Vasilis would know better, I think. Hm... Stefano keep the "knows better" questionable :-) Fran?ois made a very nice catch! taken from our bible, Window.html: [...] Every BWindow has five built-in shortcuts: Shortcut Message Handler Command+x B_CUT the focus view Command+c B_COPY the focus view Command+v B_PASTE the focus view Command+a B_SELECT_ALL the focus view Command+w (closable windows only) B_QUIT_REQUESTED the BWindow FOLLOWS THE INTERESTING PART: In addition, BWindows respond to Command+q by posting B_QUIT_REQUESTED to be_app. [...] > In any way, I can't see why that window redefines it (and it also > redefines ALT-W), so I think I'll remove both AddShortcut() calls > altogether. So i tried to remove both AddShortcut(): the behavior remains the same! i tried to override the behavior with a custom message, with no effect. So no matter what, alt + q posts B_QUIT_REQUESTED to be_app. We might want not to follow compatibility here. Bye, Vasilis From darkwyrm at earthlink.net Fri Mar 9 20:39:58 2007 From: darkwyrm at earthlink.net (DarkWyrm) Date: Fri, 09 Mar 2007 14:39:58 -0500 Subject: [Haiku-commits] r20335 - haiku/trunk/src/apps/terminal In-Reply-To: <3714086698-BeMail@> References: <3714086698-BeMail@> Message-ID: <45F1B80E.3070802@earthlink.net> Here's a possible reason for redefining Command+W: window feel. If a window has the Modal feel, regardless of which version, it disables this shortcut under R5. --DarkWyrm From bonefish at cs.tu-berlin.de Fri Mar 9 21:12:21 2007 From: bonefish at cs.tu-berlin.de (Ingo Weinhold) Date: Fri, 09 Mar 2007 21:12:21 +0100 Subject: [Haiku-commits] Bad Mails Message-ID: <20070309211221.14489.9@cs.tu-berlin.de> Hi Vasilis, I'm not receiving your mails, which means that my provider is bouncing them, likely because they are not standard conforming. This annoying causes me to get unsubscribed after every few mails you send. I would appreciate it very much if you could have a look into your mailer if some obvious reason presents itself. Thanks a lot. CU, Ingo From bonefish at mail.berlios.de Fri Mar 9 22:40:56 2007 From: bonefish at mail.berlios.de (bonefish at BerliOS) Date: Fri, 9 Mar 2007 22:40:56 +0100 Subject: [Haiku-commits] r20362 - haiku/trunk/src/system/kernel/vm Message-ID: <200703092140.l29LeuwL022632@sheep.berlios.de> Author: bonefish Date: 2007-03-09 22:40:56 +0100 (Fri, 09 Mar 2007) New Revision: 20362 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20362&view=rev Modified: haiku/trunk/src/system/kernel/vm/vm.cpp Log: Fixed incorrect loop conditions in [un]lock_memory(). If the given start address wasn't aligned and numBytes was a multiple of the page size, the last page was ignored. A subsequent get_memory_map() would return NULL as physical address for that page, if it hadn't been mapped before (that function looks generally suspicious, IMHO). E.g. reads from a device into an unaligned buffer that hadn't been touched before would hit that problem. Fixes bug #1075. Might also fix other reported problems (like #1056), since this bug could have cause all kinds of weird behavior and crashes. Modified: haiku/trunk/src/system/kernel/vm/vm.cpp =================================================================== --- haiku/trunk/src/system/kernel/vm/vm.cpp 2007-03-09 15:43:41 UTC (rev 20361) +++ haiku/trunk/src/system/kernel/vm/vm.cpp 2007-03-09 21:40:56 UTC (rev 20362) @@ -3702,8 +3702,9 @@ { vm_address_space *addressSpace = NULL; struct vm_translation_map *map; - addr_t base = (addr_t)address; - addr_t end = base + numBytes; + addr_t unalignedBase = (addr_t)address; + addr_t end = unalignedBase + numBytes; + addr_t base = ROUNDOWN(unalignedBase, B_PAGE_SIZE); bool isUser = IS_USER_ADDRESS(address); bool needsLocking = true; @@ -3756,7 +3757,7 @@ status = vm_soft_fault(base, (flags & B_READ_DEVICE) != 0, isUser); if (status != B_OK) { dprintf("lock_memory(address = %p, numBytes = %lu, flags = %lu) failed: %s\n", - address, numBytes, flags, strerror(status)); + unalignedBase, numBytes, flags, strerror(status)); goto out; } @@ -3787,8 +3788,9 @@ { vm_address_space *addressSpace = NULL; struct vm_translation_map *map; - addr_t base = (addr_t)address; - addr_t end = base + numBytes; + addr_t unalignedBase = (addr_t)address; + addr_t end = unalignedBase + numBytes; + addr_t base = ROUNDOWN(unalignedBase, B_PAGE_SIZE); bool needsLocking = true; if (IS_USER_ADDRESS(address)) From axeld at pinc-software.de Sat Mar 10 00:09:27 2007 From: axeld at pinc-software.de (Axel =?iso-8859-15?q?D=F6rfler?=) Date: Sat, 10 Mar 2007 00:09:27 +0100 CET Subject: [Haiku-commits] r20362 - haiku/trunk/src/system/kernel/vm In-Reply-To: <200703092140.l29LeuwL022632@sheep.berlios.de> Message-ID: <15498738732-BeMail@zon> bonefish at BerliOS wrote: > Log: > Fixed incorrect loop conditions in [un]lock_memory(). If the given > start address wasn't aligned and numBytes was a multiple of the page > size, the last page was ignored. A subsequent get_memory_map() would Oh, thanks for cleaning up behind me - that function is still quite new, and mostly untested (I just checked if the system would still run okay for me...). And I almost looked into #1075 today ;-) > return NULL as physical address for that page, if it hadn't been > mapped > before (that function looks generally suspicious, IMHO). E.g. reads > from a > device into an unaligned buffer that hadn't been touched before would > hit that problem. Fixes bug #1075. Might also fix other reported > problems (like #1056), since this bug could have cause all kinds of > weird > behavior and crashes. Returning B_BAD_ADDRESS might be another option for this case. It's not that calling get_memory_map() on unmapped memory would be a common case; it usually is a sign for a bug. Bye, Axel. From kaoutsis at sch.gr Sat Mar 10 00:48:48 2007 From: kaoutsis at sch.gr (Kaoutsis) Date: Sat, 10 Mar 2007 01:48:48 +0200 EET Subject: [Haiku-commits] Bad Mails In-Reply-To: <20070309211221.14489.9@cs.tu-berlin.de> Message-ID: <5160677154-BeMail@> Ingo Weinhold> Hi Vasilis, > > I'm not receiving your mails, which means that my provider is > bouncing > them, likely because they are not standard conforming. This annoying > causes > me to get unsubscribed after every few mails you send. I would > appreciate > it very much if you could have a look into your mailer if some > obvious > reason presents itself. Thanks a lot. > > CU, Ingo Hi Ingo, Sorry for the trouble. i try to send this mail directly to your mail address but a get it back: Undelivered Mail Returned to Sender : host mailhost.cs.tu- berlin.de[130.149.17.13] said: 550 Invalid Message-Id. See http://irb.cs.tu-berlin.de/dienste/smtp/errorreplies.html (in reply to end of DATA command) message delivery status: Reporting-MTA: dns; bueno.cs.tu-berlin.de X-Postfix-Queue-ID: C95141ABCC X-Postfix-Sender: rfc822; kaoutsis at sch.gr Arrival-Date: Sat, 10 Mar 2007 00:29:26 +0100 (MET) Final-Recipient: rfc822; bonefish at cs.tu-berlin.de Original-Recipient: rfc822;bonefish at cs.tu-berlin.de Action: failed Status: 5.0.0 Remote-MTA: dns; mailhost.cs.tu-berlin.de Diagnostic-Code: smtp; 550 Invalid Message-Id. See http://irb.cs.tu-berlin.de/dienste/smtp/errorreplies.html i already did the following: a)I have now completely, disable spam protection, which my provider, somehow forced me to accept. (this policy where automatically activated from 15 february until 15 minutes ago, which i manually disabled). b) a had made some changes to my local copy for bemail and i have now reverted. (i was fixing a bug, and i just found that i introduced another, the later causes an out mail from me to [Haiku-commits] to be send 3 times) For now, i can not think anything else. Bye, Vasilis ps: could you please tell me, from when did this problem occurred ? From bga at bug-br.org.br Sat Mar 10 01:24:53 2007 From: bga at bug-br.org.br (Bruno G. Albuquerque) Date: Fri, 09 Mar 2007 21:24:53 -0300 BRT Subject: [Haiku-commits] Bad Mails In-Reply-To: <5160677154-BeMail@> Message-ID: <6624570728-BeMail@guglielmo> According to that link: # 550 Invalid Message-Id This error reply is issued if the mail header an incoming mail contains an syntactically invalid message id header. Solution: * Fix your MTA's configuration and supply syntactically correct message-id header. See RFC822 for more information. Your Message-Id is set to: Message-Id: <5160677154-BeMail@> The @ at the end means you did not set a hostname and that's the problem. Do it and the problem will go away. -Bruno On Sat, 10 Mar 2007 01:48:48 +0200 EET, Kaoutsis said: > Ingo Weinhold> Hi Vasilis, > > > > I'm not receiving your mails, which means that my provider is > > bouncing > > them, likely because they are not standard conforming. This > > annoying > > causes > > me to get unsubscribed after every few mails you send. I would > > appreciate > > it very much if you could have a look into your mailer if some > > obvious > > reason presents itself. Thanks a lot. > > > > CU, Ingo > > Hi Ingo, > > Sorry for the trouble. > i try to send this mail directly to your mail address > but a get it back: Undelivered Mail Returned to Sender > > : host mailhost.cs.tu- > berlin.de[130.149.17.13] said: > 550 Invalid Message-Id. See > http://irb.cs.tu-berlin.de/dienste/smtp/errorreplies.html (in > reply > to end > of DATA command) > message delivery status: > Reporting-MTA: dns; bueno.cs.tu-berlin.de > X-Postfix-Queue-ID: C95141ABCC > X-Postfix-Sender: rfc822; kaoutsis at sch.gr > Arrival-Date: Sat, 10 Mar 2007 00:29:26 +0100 (MET) > > Final-Recipient: rfc822; bonefish at cs.tu-berlin.de > Original-Recipient: rfc822;bonefish at cs.tu-berlin.de > Action: failed > Status: 5.0.0 > Remote-MTA: dns; mailhost.cs.tu-berlin.de > Diagnostic-Code: smtp; 550 Invalid Message-Id. See > http://irb.cs.tu-berlin.de/dienste/smtp/errorreplies.html > > i already did the following: > > a)I have now completely, disable spam protection, > which my provider, somehow forced me to accept. > (this policy where automatically activated from 15 february until > 15 minutes ago, which i manually disabled). > > b) a had made some changes to my local copy for bemail > and i have now reverted. (i was fixing a bug, and > i just found that i introduced another, > the later causes an out mail from me to [Haiku-commits] to be send 3 > times) > For now, i can not think anything else. > > Bye, > Vasilis > > ps: could you please tell me, from when did this problem > occurred ? > > _______________________________________________ > Haiku-commits mailing list > Haiku-commits at lists.berlios.de > https://lists.berlios.de/mailman/listinfo/haiku-commits -- Fortune Cookie Says: "When are you BUTTHEADS gonna learn that you can't oppose Gestapo tactics *with* Gestapo tactics?" -- Reuben Flagg From leavengood at gmail.com Sat Mar 10 01:32:23 2007 From: leavengood at gmail.com (Ryan Leavengood) Date: Fri, 9 Mar 2007 19:32:23 -0500 Subject: [Haiku-commits] Bad Mails In-Reply-To: <6624570728-BeMail@guglielmo> References: <6624570728-BeMail@guglielmo> Message-ID: On 3/9/07, Bruno G. Albuquerque wrote: > > Your Message-Id is set to: > > Message-Id: <5160677154-BeMail@> > > The @ at the end means you did not set a hostname and that's the > problem. Do it and the problem will go away. Maybe BeMail should automatically add "localhost" or something similar if there is not configured hostname. If an advanced user like Vasilis didn't configure one, how many less advanced users might forget too? Ryan From bga at bug-br.org.br Sat Mar 10 01:39:39 2007 From: bga at bug-br.org.br (Bruno G. Albuquerque) Date: Fri, 09 Mar 2007 21:39:39 -0300 BRT Subject: [Haiku-commits] Bad Mails In-Reply-To: Message-ID: <7510657783-BeMail@guglielmo> On Fri, 9 Mar 2007 19:32:23 -0500, Ryan Leavengood said: > > Your Message-Id is set to: > > > > Message-Id: <5160677154-BeMail@> > > > > The @ at the end means you did not set a hostname and that's the > > problem. Do it and the problem will go away. > > Maybe BeMail should automatically add "localhost" or something > similar > if there is not configured hostname. If I remember correctly, it has code to do that but it is commented out for some reason. > If an advanced user like Vasilis didn't configure one, how many less > advanced users might forget too? All 3 of them. -Bruno -- Fortune Cookie Says: Injustice anywhere is a threat to justice everywhere. -- Martin Luther King, Jr. From leavengood at gmail.com Sat Mar 10 07:24:32 2007 From: leavengood at gmail.com (Ryan Leavengood) Date: Sat, 10 Mar 2007 01:24:32 -0500 Subject: [Haiku-commits] Bad Mails In-Reply-To: <7510657783-BeMail@guglielmo> References: <7510657783-BeMail@guglielmo> Message-ID: On 3/9/07, Bruno G. Albuquerque wrote: > > All 3 of them. Well you seem to be the main (only?) one this affected, so if you think it is a dumb fix to make, fine by me. But I'm not convinced that an attitude of "no naive user will ever use Haiku" when planning features and fixing bugs is wise. I thought we were trying not to be another Linux. If you meant something else by your comment above, please enlighten. Ryan From bga at bug-br.org.br Sat Mar 10 11:58:31 2007 From: bga at bug-br.org.br (Bruno G. Albuquerque) Date: Sat, 10 Mar 2007 07:58:31 -0300 BRT Subject: [Haiku-commits] Bad Mails In-Reply-To: Message-ID: <44643027344-BeMail@guglielmo> On Sat, 10 Mar 2007 01:24:32 -0500, Ryan Leavengood said: > > All 3 of them. > > Well you seem to be the main (only?) one this affected, so if you > think it is a dumb fix to make, fine by me. > > But I'm not convinced that an attitude of "no naive user will ever > use > Haiku" when planning features and fixing bugs is wise. I thought we > were trying not to be another Linux. > > If you meant something else by your comment above, please enlighten. Yes, I was trying to make a joke. I am not saying the fix should not be made. What I said is that the code to do that is there but it is commented out for some reason so the logical conclusion is that it probably introduce other problems. In case you do not know, I am one of the original MDR authors so I kinda earned the right to make fun of it. :) And, as you can see by looking at this email's headers, I also use it all the time. -Bruno -- Fortune Cookie Says: "Why be a man when you can be a success?" -- Bertold Brecht From axeld at mail.berlios.de Sat Mar 10 13:33:34 2007 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Sat, 10 Mar 2007 13:33:34 +0100 Subject: [Haiku-commits] r20363 - haiku/trunk/src/kits/mail Message-ID: <200703101233.l2ACXYgY003499@sheep.berlios.de> Author: axeld Date: 2007-03-10 13:33:33 +0100 (Sat, 10 Mar 2007) New Revision: 20363 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20363&view=rev Modified: haiku/trunk/src/kits/mail/MailMessage.cpp Log: The Message-Id field now gets a default hostname added in case there is none set in the system. Modified: haiku/trunk/src/kits/mail/MailMessage.cpp =================================================================== --- haiku/trunk/src/kits/mail/MailMessage.cpp 2007-03-09 21:40:56 UTC (rev 20362) +++ haiku/trunk/src/kits/mail/MailMessage.cpp 2007-03-10 12:33:33 UTC (rev 20363) @@ -1,9 +1,13 @@ -/* Message - the main general purpose mail message class -** -** Copyright 2001-2004 Dr. Zoidberg Enterprises. All rights reserved. -*/ +/* + * Copyright 2001-2004 Dr. Zoidberg Enterprises. All rights reserved. + * Copyright 2007, Haiku Inc. All Rights Reserved. + * + * Distributed under the terms of the MIT License. + */ +//! The main general purpose mail message class + #include #include #include @@ -685,7 +689,7 @@ if (_body == NULL) return B_MAIL_INVALID_MAIL; - //------Do real rendering + // Do real rendering if (From() == NULL) SendViaAccount(_chain_id); //-----Set the from string @@ -726,28 +730,30 @@ SetHeaderField("Date", date); } - /* add a message-id */ - BString message_id; - /* empirical evidence indicates message id must be enclosed in - ** angle brackets and there must be an "at" symbol in it - */ - message_id << "<"; - message_id << system_time(); - message_id << "-BeMail@"; + // add a message-id + // empirical evidence indicates message id must be enclosed in + // angle brackets and there must be an "at" symbol in it + BString messageID; + messageID << "<"; + messageID << system_time(); + messageID << "-BeMail@"; + char host[255]; - gethostname(host,255); - message_id << host; + if (gethostname(host, sizeof(host)) < 0 || !host[0]) + strcpy(host, "zoidberg"); - message_id << ">"; - - SetHeaderField("Message-Id", message_id.String()); + messageID << host; + messageID << ">"; + SetHeaderField("Message-Id", messageID.String()); + status_t err = BMailComponent::RenderToRFC822(file); if (err < B_OK) return err; - file->Seek(-2, SEEK_CUR); //-----Remove division between headers + file->Seek(-2, SEEK_CUR); + // Remove division between headers err = _body->RenderToRFC822(file); if (err < B_OK) @@ -759,7 +765,6 @@ // set to "Pending"). if (BFile *attributed = dynamic_cast (file)) { - BNodeInfo(attributed).SetType(B_MAIL_TYPE); attributed->WriteAttrString(B_MAIL_ATTR_RECIPIENTS,&recipients); @@ -800,7 +805,7 @@ status_t -BEmailMessage::RenderTo(BDirectory *dir,BEntry *msg) +BEmailMessage::RenderTo(BDirectory *dir, BEntry *msg) { time_t currentTime; char numericDateString [40]; From axeld at pinc-software.de Sat Mar 10 13:34:54 2007 From: axeld at pinc-software.de (Axel =?iso-8859-15?q?D=F6rfler?=) Date: Sat, 10 Mar 2007 13:34:54 +0100 CET Subject: [Haiku-commits] Bad Mails In-Reply-To: Message-ID: <8087804194-BeMail@zon> "Ryan Leavengood" wrote: > On 3/9/07, Bruno G. Albuquerque wrote: > > All 3 of them. > Well you seem to be the main (only?) one this affected, so if you > think it is a dumb fix to make, fine by me. > > But I'm not convinced that an attitude of "no naive user will ever > use > Haiku" when planning features and fixing bugs is wise. I thought we > were trying not to be another Linux. > > If you meant something else by your comment above, please enlighten. I guess he refers to the large user community ;-) Anyway, I've fixed it in r20363 - I thought we had added some code to handle this years ago, but apparently, it got lost at some point (probably when moving that part out of BeMail and into libmail.so). Bye, Axel. From zooey at hirschkaefer.de Sat Mar 10 13:54:51 2007 From: zooey at hirschkaefer.de (Oliver Tappe) Date: Sat, 10 Mar 2007 13:54:51 +0100 Subject: [Haiku-commits] Bad Mails In-Reply-To: <20070309211221.14489.9@cs.tu-berlin.de> References: <20070309211221.14489.9@cs.tu-berlin.de> Message-ID: <20070310135451.1108.1@bee.hirschkaefer.site> On 2007-03-09 at 21:12:21 [+0100], Ingo Weinhold wrote: > Hi Vasilis, > > I'm not receiving your mails, which means that my provider is bouncing > them, likely because they are not standard conforming. This annoying causes > me to get unsubscribed after every few mails you send. I would appreciate > it very much if you could have a look into your mailer if some obvious > reason presents itself. Thanks a lot. I suppose one possible reason for this might be the invalid 'Message-ID:'-header BMail produces if the host doesn't have a name set. The last mail sent from Vasilis contained such an ID: Message-ID: <3741659272-BeMail@> Hope that helps. cheers, Oliver From kaoutsis at sch.gr Sat Mar 10 14:24:34 2007 From: kaoutsis at sch.gr (Kaoutsis) Date: Sat, 10 Mar 2007 15:24:34 +0200 EET Subject: [Haiku-commits] Bad Mails In-Reply-To: <7510657783-BeMail@guglielmo> Message-ID: <4355342724-BeMail@> Hi to all, I am sure that we will find the solution. Bruno G. Albuquerque> On Fri, 9 Mar 2007 19:32:23 -0500, Ryan Leavengood said: > > > > Your Message-Id is set to: > > > > > > Message-Id: <5160677154-BeMail@> > > > > > > The @ at the end means you did not set a hostname and that's the > > > problem. Do it and the problem will go away. Could you please give the how? > > Maybe BeMail should automatically add "localhost" or something > > similar > > if there is not configured hostname. and these may help: $ cat /etc/hosts 127.0.0.1 box localhost $ cat /etc/hostname box $ uname -a BeOS trantor 5.0 1000009 BePC unknown $ hostname -a /bin/hostname: cannot set hostname; this system lacks the functionality $ > If I remember correctly, it has code to do that but it is commented > out > for some reason. > > > If an advanced user like Vasilis didn't configure one, how many > > less > > advanced users might forget too? From kaoutsis at sch.gr Sat Mar 10 14:57:09 2007 From: kaoutsis at sch.gr (Kaoutsis) Date: Sat, 10 Mar 2007 15:57:09 +0200 EET Subject: [Haiku-commits] r20363 - haiku/trunk/src/kits/mail In-Reply-To: <200703101233.l2ACXYgY003499@sheep.berlios.de> Message-ID: <6310341381-BeMail@zoidberg> axeld at BerliOS> Author: axeld > Date: 2007-03-10 13:33:33 +0100 (Sat, 10 Mar 2007) > New Revision: 20363 > ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20363&view=rev > > Modified: > haiku/trunk/src/kits/mail/MailMessage.cpp > Log: > The Message-Id field now gets a default hostname added in case there > is none set in the system. > > > Modified: haiku/trunk/src/kits/mail/MailMessage.cpp Thank you, Axel. Bye, Vasilis From bonefish at cs.tu-berlin.de Sat Mar 10 19:04:20 2007 From: bonefish at cs.tu-berlin.de (Ingo Weinhold) Date: Sat, 10 Mar 2007 19:04:20 +0100 Subject: [Haiku-commits] r20363 - haiku/trunk/src/kits/mail In-Reply-To: <6310341381-BeMail@zoidberg> References: <6310341381-BeMail@zoidberg> Message-ID: <20070310190420.1313.3@cs.tu-berlin.de> On 2007-03-10 at 14:57:09 [+0100], Kaoutsis wrote: > axeld at BerliOS> Author: axeld > > Date: 2007-03-10 13:33:33 +0100 (Sat, 10 Mar 2007) > > New Revision: 20363 > > ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20363&view=rev > > > > Modified: > > haiku/trunk/src/kits/mail/MailMessage.cpp > > Log: > > The Message-Id field now gets a default hostname added in case there > > is none set in the system. > > > > > > Modified: haiku/trunk/src/kits/mail/MailMessage.cpp > Thank you, Axel. > > Bye, > Vasilis Yeahhh, I can read you at last! :-) Thanks! CU, Ingo From bonefish at cs.tu-berlin.de Sat Mar 10 19:20:13 2007 From: bonefish at cs.tu-berlin.de (Ingo Weinhold) Date: Sat, 10 Mar 2007 19:20:13 +0100 Subject: [Haiku-commits] r20362 - haiku/trunk/src/system/kernel/vm In-Reply-To: <15498738732-BeMail@zon> References: <15498738732-BeMail@zon> Message-ID: <20070310192013.1345.4@cs.tu-berlin.de> On 2007-03-10 at 00:09:27 [+0100], Axel D?rfler wrote: > bonefish at BerliOS wrote: > > Log: > > Fixed incorrect loop conditions in [un]lock_memory(). If the given > > start address wasn't aligned and numBytes was a multiple of the page > > size, the last page was ignored. A subsequent get_memory_map() would > > Oh, thanks for cleaning up behind me - that function is still quite > new, and mostly untested (I just checked if the system would still run > okay for me...). > And I almost looked into #1075 today ;-) Damn, I should have waited. :-P Well, I couldn't. This was unfortunately a show-stopper for me. > > return NULL as physical address for that page, if it hadn't been > > mapped > > before (that function looks generally suspicious, IMHO). E.g. reads > > from a > > device into an unaligned buffer that hadn't been touched before would > > hit that problem. Fixes bug #1075. Might also fix other reported > > problems (like #1056), since this bug could have cause all kinds of > > weird > > behavior and crashes. > > Returning B_BAD_ADDRESS might be another option for this case. It's not > that calling get_memory_map() on unmapped memory would be a common > case; it usually is a sign for a bug. How about panic() then? Since BeOS's implementation is documented to always return B_OK I can't imagine any useful other context anyway. And it would have saved me several hours of debugging time in this case at least. CU, Ingo From axeld at pinc-software.de Sat Mar 10 20:10:41 2007 From: axeld at pinc-software.de (Axel =?iso-8859-15?q?D=F6rfler?=) Date: Sat, 10 Mar 2007 20:10:41 +0100 CET Subject: [Haiku-commits] r20362 - haiku/trunk/src/system/kernel/vm In-Reply-To: <20070310192013.1345.4@cs.tu-berlin.de> Message-ID: <31834537104-BeMail@zon> Ingo Weinhold wrote: > > Oh, thanks for cleaning up behind me - that function is still quite > > new, and mostly untested (I just checked if the system would still > > run > > okay for me...). > > And I almost looked into #1075 today ;-) > Damn, I should have waited. :-P > Well, I couldn't. This was unfortunately a show-stopper for me. Everybody wins ;-P > > Returning B_BAD_ADDRESS might be another option for this case. It's > > not > > that calling get_memory_map() on unmapped memory would be a common > > case; it usually is a sign for a bug. > How about panic() then? Since BeOS's implementation is documented to > always > return B_OK I can't imagine any useful other context anyway. And it > would > have saved me several hours of debugging time in this case at least. We're already deviating from that rule in our current implementation, and, as you said, I don't see any advantage of having a return code that is always B_OK :-) Whoever decided to document that behaviour should be shot, anyway ;-) I would be in favour of the less drastic B_BAD_ADDRESS. Although we could just do it like this for now: if ((flags & PAGE_PRESENT) == 0) { panic("trying to get address from unmapped memory!"); return B_BAD_ADDRESS; } So you can still continue from there :) Bye, Axel. From revol at free.fr Sat Mar 10 22:06:32 2007 From: revol at free.fr (=?windows-1252?q?Fran=E7ois?= Revol) Date: Sat, 10 Mar 2007 22:06:32 +0100 CET Subject: [Haiku-commits] Bad Mails In-Reply-To: <4355342724-BeMail@> Message-ID: <1277838535-BeMail@laptop> > > > Maybe BeMail should automatically add "localhost" or something > > > similar > > > if there is not configured hostname. > > and these may help: > $ cat /etc/hosts > 127.0.0.1 box localhost > $ cat /etc/hostname > box > $ uname -a > BeOS trantor 5.0 1000009 BePC unknown > $ hostname -a > /bin/hostname: cannot set hostname; this system lacks the > functionality > $ net_server had a custom call in libnet.so to do that IIRC... or maybe just config/settings/network. Fran?ois. (live from the Numerica DTV ART PARTY #01 !) From bonefish at cs.tu-berlin.de Sat Mar 10 22:33:10 2007 From: bonefish at cs.tu-berlin.de (Ingo Weinhold) Date: Sat, 10 Mar 2007 22:33:10 +0100 Subject: [Haiku-commits] r20362 - haiku/trunk/src/system/kernel/vm In-Reply-To: <31834537104-BeMail@zon> References: <31834537104-BeMail@zon> Message-ID: <20070310223310.3574.5@cs.tu-berlin.de> On 2007-03-10 at 20:10:41 [+0100], Axel D?rfler wrote: > Ingo Weinhold wrote: [...] > > > Returning B_BAD_ADDRESS might be another option for this case. It's > > > not > > > that calling get_memory_map() on unmapped memory would be a common > > > case; it usually is a sign for a bug. > > How about panic() then? Since BeOS's implementation is documented to > > always > > return B_OK I can't imagine any useful other context anyway. And it > > would > > have saved me several hours of debugging time in this case at least. > > We're already deviating from that rule in our current implementation, > and, as you said, I don't see any advantage of having a return code > that is always B_OK :-) > > Whoever decided to document that behaviour should be shot, anyway ;-) I would spare the documenter, unless he's also the one who introduced the function in the first place. :-P > I would be in favour of the less drastic B_BAD_ADDRESS. Although we > could just do it like this for now: > > if ((flags & PAGE_PRESENT) == 0) { > panic("trying to get address from unmapped memory!"); > return B_BAD_ADDRESS; > } > > So you can still continue from there :) Yep, that's what I was thinking of. CU, Ingo From axeld at mail.berlios.de Sun Mar 11 14:27:43 2007 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Sun, 11 Mar 2007 14:27:43 +0100 Subject: [Haiku-commits] r20364 - in haiku/trunk: headers/private/kernel src/system/kernel/arch/x86 src/system/kernel/vm Message-ID: <200703111327.l2BDRhQm010113@sheep.berlios.de> Author: axeld Date: 2007-03-11 14:27:42 +0100 (Sun, 11 Mar 2007) New Revision: 20364 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20364&view=rev Modified: haiku/trunk/headers/private/kernel/vm_translation_map.h haiku/trunk/src/system/kernel/arch/x86/arch_vm_translation_map.c haiku/trunk/src/system/kernel/vm/vm.cpp haiku/trunk/src/system/kernel/vm/vm_page.c Log: get_memory_map() now panics (and fails) in case it was called on unmapped memory as suggested by Ingo; before it would just fill the physical pages with NULL pointers. Modified: haiku/trunk/headers/private/kernel/vm_translation_map.h =================================================================== --- haiku/trunk/headers/private/kernel/vm_translation_map.h 2007-03-10 12:33:33 UTC (rev 20363) +++ haiku/trunk/headers/private/kernel/vm_translation_map.h 2007-03-11 13:27:42 UTC (rev 20364) @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006, Haiku. All rights reserved. + * Copyright 2002-2007, Haiku. All rights reserved. * Distributed under the terms of the MIT License. * * Copyright 2001-2002, Travis Geiselbrecht. All rights reserved. @@ -30,15 +30,20 @@ void (*destroy)(vm_translation_map *map); status_t (*lock)(vm_translation_map *map); status_t (*unlock)(vm_translation_map *map); - status_t (*map)(vm_translation_map *map, addr_t va, addr_t pa, uint32 attributes); + status_t (*map)(vm_translation_map *map, addr_t va, addr_t pa, + uint32 attributes); status_t (*unmap)(vm_translation_map *map, addr_t start, addr_t end); - status_t (*query)(vm_translation_map *map, addr_t va, addr_t *_outPhysical, uint32 *_outFlags); - status_t (*query_interrupt)(vm_translation_map *map, addr_t va, addr_t *_outPhysical); + status_t (*query)(vm_translation_map *map, addr_t va, addr_t *_outPhysical, + uint32 *_outFlags); + status_t (*query_interrupt)(vm_translation_map *map, addr_t va, + addr_t *_outPhysical, uint32 *_outFlags); addr_t (*get_mapped_size)(vm_translation_map*); - status_t (*protect)(vm_translation_map *map, addr_t base, addr_t top, uint32 attributes); + status_t (*protect)(vm_translation_map *map, addr_t base, addr_t top, + uint32 attributes); status_t (*clear_flags)(vm_translation_map *map, addr_t va, uint32 flags); void (*flush)(vm_translation_map *map); - status_t (*get_physical_page)(addr_t physicalAddress, addr_t *_virtualAddress, uint32 flags); + status_t (*get_physical_page)(addr_t physicalAddress, + addr_t *_virtualAddress, uint32 flags); status_t (*put_physical_page)(addr_t virtualAddress); } vm_translation_map_ops; Modified: haiku/trunk/src/system/kernel/arch/x86/arch_vm_translation_map.c =================================================================== --- haiku/trunk/src/system/kernel/arch/x86/arch_vm_translation_map.c 2007-03-10 12:33:33 UTC (rev 20363) +++ haiku/trunk/src/system/kernel/arch/x86/arch_vm_translation_map.c 2007-03-11 13:27:42 UTC (rev 20364) @@ -443,7 +443,8 @@ static status_t -query_tmap_interrupt(vm_translation_map *map, addr_t va, addr_t *_physical) +query_tmap_interrupt(vm_translation_map *map, addr_t va, addr_t *_physical, + uint32 *_flags) { page_directory_entry *pd = map->arch_data->pgdir_virt; page_table_entry *pt; @@ -477,6 +478,11 @@ index = VADDR_TO_PTENT(va); *_physical = ADDR_REVERSE_SHIFT(pt[index].addr); + *_flags |= ((pt[index].rw ? B_KERNEL_WRITE_AREA : 0) | B_KERNEL_READ_AREA) + | (pt[index].dirty ? PAGE_MODIFIED : 0) + | (pt[index].accessed ? PAGE_ACCESSED : 0) + | (pt[index].present ? PAGE_PRESENT : 0); + return B_OK; } Modified: haiku/trunk/src/system/kernel/vm/vm.cpp =================================================================== --- haiku/trunk/src/system/kernel/vm/vm.cpp 2007-03-10 12:33:33 UTC (rev 20363) +++ haiku/trunk/src/system/kernel/vm/vm.cpp 2007-03-11 13:27:42 UTC (rev 20364) @@ -3875,17 +3875,21 @@ while (offset < numBytes) { addr_t bytes = min_c(numBytes - offset, B_PAGE_SIZE); + uint32 flags; if (interrupts) { - uint32 flags; status = map->ops->query(map, (addr_t)address + offset, &physicalAddress, &flags); } else { status = map->ops->query_interrupt(map, (addr_t)address + offset, - &physicalAddress); + &physicalAddress, &flags); } if (status < B_OK) break; + if ((flags & PAGE_PRESENT) == 0) { + panic("get_memory_map() called on unmapped memory!"); + return B_BAD_ADDRESS; + } if (index < 0 && pageOffset > 0) { physicalAddress += pageOffset; Modified: haiku/trunk/src/system/kernel/vm/vm_page.c =================================================================== --- haiku/trunk/src/system/kernel/vm/vm_page.c 2007-03-10 12:33:33 UTC (rev 20363) +++ haiku/trunk/src/system/kernel/vm/vm_page.c 2007-03-11 13:27:42 UTC (rev 20364) @@ -165,11 +165,13 @@ if (index == 2) { if (!physical) { vm_address_space *addressSpace = vm_kernel_address_space(); + uint32 flags; + if (thread_get_current_thread()->team->address_space != NULL) addressSpace = thread_get_current_thread()->team->address_space; addressSpace->translation_map.ops->query_interrupt( - &addressSpace->translation_map, address, &address); + &addressSpace->translation_map, address, &address, &flags); } page = vm_lookup_page(address / B_PAGE_SIZE); From bonefish at mail.berlios.de Sun Mar 11 14:51:18 2007 From: bonefish at mail.berlios.de (bonefish at BerliOS) Date: Sun, 11 Mar 2007 14:51:18 +0100 Subject: [Haiku-commits] r20365 - haiku/trunk/src/system/kernel/cache Message-ID: <200703111351.l2BDpIwK011401@sheep.berlios.de> Author: bonefish Date: 2007-03-11 14:51:18 +0100 (Sun, 11 Mar 2007) New Revision: 20365 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20365&view=rev Modified: haiku/trunk/src/system/kernel/cache/block_cache.cpp Log: get_cached_block(): Remove the newly allocated block from the hashtable in case of a read error (NewBlock() also adds the block, but FreeBlock() only frees it). Modified: haiku/trunk/src/system/kernel/cache/block_cache.cpp =================================================================== --- haiku/trunk/src/system/kernel/cache/block_cache.cpp 2007-03-11 13:27:42 UTC (rev 20364) +++ haiku/trunk/src/system/kernel/cache/block_cache.cpp 2007-03-11 13:51:18 UTC (rev 20365) @@ -505,6 +505,7 @@ int32 blockSize = cache->block_size; if (read_pos(cache->fd, blockNumber * blockSize, block->current_data, blockSize) < blockSize) { + hash_remove(cache->hash, block); cache->FreeBlock(block); FATAL(("could not read block %Ld\n", blockNumber)); return NULL; From bonefish at mail.berlios.de Sun Mar 11 14:56:46 2007 From: bonefish at mail.berlios.de (bonefish at BerliOS) Date: Sun, 11 Mar 2007 14:56:46 +0100 Subject: [Haiku-commits] r20366 - in haiku/trunk: headers/private/kernel/util src/kits/debug src/servers/app Message-ID: <200703111356.l2BDuk7X011517@sheep.berlios.de> Author: bonefish Date: 2007-03-11 14:56:45 +0100 (Sun, 11 Mar 2007) New Revision: 20366 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20366&view=rev Modified: haiku/trunk/headers/private/kernel/util/DoublyLinkedList.h haiku/trunk/src/kits/debug/SymbolLookup.cpp haiku/trunk/src/servers/app/ServerBitmap.cpp Log: Include in DoublyLinkedList.h only when compiling for the kernel. Added missing includes in userland code that uses the header. Modified: haiku/trunk/headers/private/kernel/util/DoublyLinkedList.h =================================================================== --- haiku/trunk/headers/private/kernel/util/DoublyLinkedList.h 2007-03-11 13:51:18 UTC (rev 20365) +++ haiku/trunk/headers/private/kernel/util/DoublyLinkedList.h 2007-03-11 13:56:45 UTC (rev 20366) @@ -7,9 +7,12 @@ #include -#include +#ifdef _KERNEL_MODE +# include +#endif + #ifdef __cplusplus // DoublyLinkedListLink Modified: haiku/trunk/src/kits/debug/SymbolLookup.cpp =================================================================== --- haiku/trunk/src/kits/debug/SymbolLookup.cpp 2007-03-11 13:51:18 UTC (rev 20365) +++ haiku/trunk/src/kits/debug/SymbolLookup.cpp 2007-03-11 13:56:45 UTC (rev 20366) @@ -3,10 +3,13 @@ * Distributed under the terms of the MIT License. */ +#include "SymbolLookup.h" + +#include + #include #include -#include "SymbolLookup.h" using std::nothrow; using namespace BPrivate; Modified: haiku/trunk/src/servers/app/ServerBitmap.cpp =================================================================== --- haiku/trunk/src/servers/app/ServerBitmap.cpp 2007-03-11 13:51:18 UTC (rev 20365) +++ haiku/trunk/src/servers/app/ServerBitmap.cpp 2007-03-11 13:56:45 UTC (rev 20366) @@ -16,6 +16,7 @@ #include #include +#include #include using std::nothrow; From axeld at pinc-software.de Sun Mar 11 16:03:26 2007 From: axeld at pinc-software.de (Axel =?iso-8859-15?q?D=F6rfler?=) Date: Sun, 11 Mar 2007 16:03:26 +0100 CET Subject: [Haiku-commits] r20365 - haiku/trunk/src/system/kernel/cache In-Reply-To: <200703111351.l2BDpIwK011401@sheep.berlios.de> Message-ID: <8889042903-BeMail@zon> bonefish at BerliOS wrote: > Log: > get_cached_block(): Remove the newly allocated block from the > hashtable in case of a read error (NewBlock() also adds the block, > but FreeBlock() only frees it). That's why having symmetrical API calls is a good idea - thanks! :-) I'll look into it if it's feasible to do so. Bye, Axel. From bonefish at mail.berlios.de Sun Mar 11 16:04:55 2007 From: bonefish at mail.berlios.de (bonefish at BerliOS) Date: Sun, 11 Mar 2007 16:04:55 +0100 Subject: [Haiku-commits] r20367 - haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server Message-ID: <200703111504.l2BF4tAv014772@sheep.berlios.de> Author: bonefish Date: 2007-03-11 16:04:53 +0100 (Sun, 11 Mar 2007) New Revision: 20367 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20367&view=rev Added: haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/haiku_block_cache.cpp haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/haiku_block_cache_priv.h haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/haiku_fs_cache.h haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/haiku_hash.cpp haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/haiku_hash.h haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/haiku_lock.cpp haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/haiku_lock.h Modified: haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/Jamfile haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/UserlandFSServer.cpp haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/haiku_kernel_emu.cpp haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/kernel_emu.cpp haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/kernel_emu.h Log: Added Haiku block cache interface to the UserlandFS server. Basically copied and adjusted the respective kernel code. Modified: haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/Jamfile =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/Jamfile 2007-03-11 13:56:45 UTC (rev 20366) +++ haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/Jamfile 2007-03-11 15:04:53 UTC (rev 20367) @@ -40,6 +40,9 @@ BeOSKernelVolume.cpp DispatcherFileSystem.cpp FileSystem.cpp + haiku_block_cache.cpp + haiku_hash.cpp + haiku_lock.cpp HaikuKernelFileSystem.cpp HaikuKernelVolume.cpp kernel_emu.cpp Modified: haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/UserlandFSServer.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/UserlandFSServer.cpp 2007-03-11 13:56:45 UTC (rev 20366) +++ haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/UserlandFSServer.cpp 2007-03-11 15:04:53 UTC (rev 20367) @@ -23,6 +23,7 @@ #include "DispatcherDefs.h" #include "FileSystem.h" #include "FSInfo.h" +#include "haiku_block_cache_priv.h" #include "HaikuKernelFileSystem.h" #include "RequestThread.h" #include "ServerDefs.h" @@ -275,6 +276,11 @@ RETURN_ERROR(B_NO_MEMORY); ObjectDeleter fsDeleter(fileSystem); + // init block cache + error = UserlandFS::HaikuKernelEmu::block_cache_init(); + if (error != B_OK) + RETURN_ERROR(error); + // init the FS error = fileSystem->Init(); if (error != B_OK) Copied: haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/haiku_block_cache.cpp (from rev 20363, haiku/trunk/src/system/kernel/cache/block_cache.cpp) =================================================================== --- haiku/trunk/src/system/kernel/cache/block_cache.cpp 2007-03-10 12:33:33 UTC (rev 20363) +++ haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/haiku_block_cache.cpp 2007-03-11 15:04:53 UTC (rev 20367) @@ -0,0 +1,1123 @@ +/* + * Copyright 2004-2006, Axel D?rfler, axeld at pinc-software.de. All rights reserved. + * Distributed under the terms of the MIT License. + */ + +#include "haiku_block_cache_priv.h" + +#include + +#include +#include +#include +#include + +#include "haiku_fs_cache.h" +#include "haiku_hash.h" +#include "kernel_emu.h" + +// ToDo: this is a naive but growing implementation to test the API: +// 1) block reading/writing is not at all optimized for speed, it will +// just read and write single blocks. +// 2) the locking could be improved; getting a block should not need to +// wait for blocks to be written +// 3) dirty blocks are only written back if asked for +// TODO: the retrieval/copy of the original data could be delayed until the +// new data must be written, ie. in low memory situations. + +//#define TRACE_BLOCK_CACHE +#ifdef TRACE_BLOCK_CACHE +# define TRACE(x) dprintf x +#else +# define TRACE(x) ; +#endif + +// This macro is used for fatal situations that are acceptable in a running +// system, like out of memory situations - should only panic for debugging. +#define FATAL(x) panic x + +using UserlandFS::KernelEmu::dprintf; +using UserlandFS::KernelEmu::dump_block; +using UserlandFS::KernelEmu::panic; + +namespace UserlandFS { +namespace HaikuKernelEmu { + +static const int32 kMaxBlockCount = 1024; + + +struct cache_transaction { + cache_transaction(); + + cache_transaction *next; + int32 id; + int32 num_blocks; + int32 sub_num_blocks; + cached_block *first_block; + block_list blocks; + transaction_notification_hook notification_hook; + void *notification_data; + bool open; + bool has_sub_transaction; +}; + +static status_t write_cached_block(block_cache *cache, cached_block *block, + bool deleteTransaction = true); + + +// #pragma mark - private transaction + + +cache_transaction::cache_transaction() +{ + num_blocks = 0; + sub_num_blocks = 0; + first_block = NULL; + notification_hook = NULL; + notification_data = NULL; + open = true; +} + + +static int +transaction_compare(void *_transaction, const void *_id) +{ + cache_transaction *transaction = (cache_transaction *)_transaction; + const int32 *id = (const int32 *)_id; + + return transaction->id - *id; +} + + +static uint32 +transaction_hash(void *_transaction, const void *_id, uint32 range) +{ + cache_transaction *transaction = (cache_transaction *)_transaction; + const int32 *id = (const int32 *)_id; + + if (transaction != NULL) + return transaction->id % range; + + return (uint32)*id % range; +} + + +static void +delete_transaction(block_cache *cache, cache_transaction *transaction) +{ + hash_remove(cache->transaction_hash, transaction); + if (cache->last_transaction == transaction) + cache->last_transaction = NULL; + + delete transaction; +} + + +static cache_transaction * +lookup_transaction(block_cache *cache, int32 id) +{ + return (cache_transaction *)hash_lookup(cache->transaction_hash, &id); +} + + +// #pragma mark - cached_block + + +/* static */ +int +cached_block::Compare(void *_cacheEntry, const void *_block) +{ + cached_block *cacheEntry = (cached_block *)_cacheEntry; + const off_t *block = (const off_t *)_block; + + return cacheEntry->block_number - *block; +} + + + +/* static */ +uint32 +cached_block::Hash(void *_cacheEntry, const void *_block, uint32 range) +{ + cached_block *cacheEntry = (cached_block *)_cacheEntry; + const off_t *block = (const off_t *)_block; + + if (cacheEntry != NULL) + return cacheEntry->block_number % range; + + return (uint64)*block % range; +} + + +// #pragma mark - block_cache + + +block_cache::block_cache(int _fd, off_t numBlocks, size_t blockSize, bool readOnly) + : + hash(NULL), + fd(_fd), + max_blocks(numBlocks), + block_size(blockSize), + next_transaction_id(1), + last_transaction(NULL), + transaction_hash(NULL), + read_only(readOnly) +{ + hash = hash_init(32, 0, &cached_block::Compare, &cached_block::Hash); + if (hash == NULL) + return; + + transaction_hash = hash_init(16, 0, &transaction_compare, + &UserlandFS::HaikuKernelEmu::transaction_hash); + if (transaction_hash == NULL) + return; + + if (benaphore_init(&lock, "block cache") < B_OK) + return; +} + + +block_cache::~block_cache() +{ + benaphore_destroy(&lock); + + hash_uninit(transaction_hash); + hash_uninit(hash); +} + + +status_t +block_cache::InitCheck() +{ + if (lock.sem < B_OK) + return lock.sem; + + if (hash == NULL || transaction_hash == NULL) + return B_NO_MEMORY; + + return B_OK; +} + + +void +block_cache::Free(void *address) +{ + if (address == NULL) + return; + + free(address); +} + + +void * +block_cache::Allocate() +{ + return malloc(block_size); +} + + +void +block_cache::FreeBlock(cached_block *block) +{ + Free(block->current_data); + block->current_data = NULL; + + if (block->original_data != NULL || block->parent_data != NULL) + panic("block_cache::FreeBlock(): %p, %p\n", block->original_data, block->parent_data); + +#ifdef DEBUG_CHANGED + Free(block->compare); +#endif + + delete block; +} + + +cached_block * +block_cache::NewBlock(off_t blockNumber) +{ + cached_block *block = new(nothrow) cached_block; + if (block == NULL) { + FATAL(("could not allocate block!\n")); + return NULL; + } + + // if we hit the limit of blocks to cache? try to free one or more + if (allocated_block_count >= kMaxBlockCount) { + RemoveUnusedBlocks(LONG_MAX, + allocated_block_count - kMaxBlockCount + 1); + } + + block->current_data = Allocate(); + if (!block->current_data) { + FATAL(("could not allocate block data!\n")); + delete block; + return NULL; + } + + block->block_number = blockNumber; + block->ref_count = 0; + block->accessed = 0; + block->transaction_next = NULL; + block->transaction = block->previous_transaction = NULL; + block->original_data = NULL; + block->parent_data = NULL; + block->is_dirty = false; + block->unused = false; +#ifdef DEBUG_CHANGED + block->compare = NULL; +#endif + + hash_insert(hash, block); + allocated_block_count++; + + return block; +} + + +void +block_cache::RemoveUnusedBlocks(int32 maxAccessed, int32 count) +{ + TRACE(("block_cache: remove up to %ld unused blocks\n", count)); + + cached_block *next = NULL; + for (cached_block *block = unused_blocks.First(); block != NULL; block = next) { + next = block->next; + + if (maxAccessed < block->accessed) + continue; + + TRACE((" remove block %Ld, accessed %ld times\n", + block->block_number, block->accessed)); + + // this can only happen if no transactions are used + if (block->is_dirty) + write_cached_block(this, block, false); + + // remove block from lists + unused_blocks.Remove(block); + hash_remove(hash, block); + + FreeBlock(block); + + if (--count <= 0) + break; + } +} + + +// #pragma mark - + + +static void +put_cached_block(block_cache *cache, cached_block *block) +{ +#ifdef DEBUG_CHANGED + if (!block->is_dirty && block->compare != NULL && memcmp(block->current_data, block->compare, cache->block_size)) { + dprintf("new block:\n"); + dump_block((const char *)block->current_data, 256, " "); + dprintf("unchanged block:\n"); + dump_block((const char *)block->compare, 256, " "); + write_cached_block(cache, block); + panic("block_cache: supposed to be clean block was changed!\n"); + + cache->Free(block->compare); + block->compare = NULL; + } +#endif + + if (--block->ref_count == 0 + && block->transaction == NULL + && block->previous_transaction == NULL) { + // put this block in the list of unused blocks + block->unused = true; + cache->unused_blocks.Add(block); + } + + if (cache->allocated_block_count > kMaxBlockCount) { + cache->RemoveUnusedBlocks(LONG_MAX, + cache->allocated_block_count - kMaxBlockCount); + } +} + + +static void +put_cached_block(block_cache *cache, off_t blockNumber) +{ + if (blockNumber < 0 || blockNumber >= cache->max_blocks) + panic("put_cached_block: invalid block number %lld (max %lld)", blockNumber, cache->max_blocks - 1); + + cached_block *block = (cached_block *)hash_lookup(cache->hash, &blockNumber); + if (block != NULL) + put_cached_block(cache, block); +} + + +static cached_block * +get_cached_block(block_cache *cache, off_t blockNumber, bool *allocated, bool readBlock = true) +{ + if (blockNumber < 0 || blockNumber >= cache->max_blocks) + panic("get_cached_block: invalid block number %lld (max %lld)", blockNumber, cache->max_blocks - 1); + + cached_block *block = (cached_block *)hash_lookup(cache->hash, &blockNumber); + *allocated = false; + + if (block == NULL) { + // read block into cache + block = cache->NewBlock(blockNumber); + if (block == NULL) + return NULL; + + *allocated = true; + } else { +/* + if (block->ref_count == 0 && block->current_data != NULL) { + // see if the old block can be resurrected + block->current_data = cache->allocator->Acquire(block->current_data); + } + + if (block->current_data == NULL) { + // there is no block yet, but we need one + block->current_data = cache->allocator->Get(); + if (block->current_data == NULL) + return NULL; + + *allocated = true; + } +*/ + } + + if (*allocated && readBlock) { + int32 blockSize = cache->block_size; + + if (read_pos(cache->fd, blockNumber * blockSize, block->current_data, blockSize) < blockSize) { + hash_remove(cache->hash, block); + cache->FreeBlock(block); + FATAL(("could not read block %Ld\n", blockNumber)); + return NULL; + } + } + + if (block->unused) { + //TRACE(("remove block %Ld from unused\n", blockNumber)); + block->unused = false; + cache->unused_blocks.Remove(block); + } + + block->ref_count++; + block->accessed++; + + return block; +} + + +/** Returns the writable block data for the requested blockNumber. + * If \a cleared is true, the block is not read from disk; an empty block + * is returned. + * This is the only method to insert a block into a transaction. It makes + * sure that the previous block contents are preserved in that case. + */ + +static void * +get_writable_cached_block(block_cache *cache, off_t blockNumber, off_t base, off_t length, + int32 transactionID, bool cleared) +{ + TRACE(("get_writable_cached_block(blockNumber = %Ld, transaction = %ld)\n", blockNumber, transactionID)); + + if (blockNumber < 0 || blockNumber >= cache->max_blocks) + panic("get_writable_cached_block: invalid block number %lld (max %lld)", blockNumber, cache->max_blocks - 1); + + bool allocated; + cached_block *block = get_cached_block(cache, blockNumber, &allocated, !cleared); + if (block == NULL) + return NULL; + + // if there is no transaction support, we just return the current block + if (transactionID == -1) { + if (cleared) + memset(block->current_data, 0, cache->block_size); + + block->is_dirty = true; + // mark the block as dirty + + return block->current_data; + } + + if (block->transaction != NULL && block->transaction->id != transactionID) { + // ToDo: we have to wait here until the other transaction is done. + // Maybe we should even panic, since we can't prevent any deadlocks. + panic("get_writable_cached_block(): asked to get busy writable block (transaction %ld)\n", block->transaction->id); + put_cached_block(cache, block); + return NULL; + } + if (block->transaction == NULL && transactionID != -1) { + // get new transaction + cache_transaction *transaction = lookup_transaction(cache, transactionID); + if (transaction == NULL) { + panic("get_writable_cached_block(): invalid transaction %ld!\n", transactionID); + put_cached_block(cache, block); + return NULL; + } + if (!transaction->open) { + panic("get_writable_cached_block(): transaction already done!\n"); + put_cached_block(cache, block); + return NULL; + } + + block->transaction = transaction; + + // attach the block to the transaction block list + block->transaction_next = transaction->first_block; + transaction->first_block = block; + transaction->num_blocks++; + } + + if (!(allocated && cleared) && block->original_data == NULL) { + // we already have data, so we need to preserve it + block->original_data = cache->Allocate(); + if (block->original_data == NULL) { + FATAL(("could not allocate original_data\n")); + put_cached_block(cache, block); + return NULL; + } + + memcpy(block->original_data, block->current_data, cache->block_size); + } + if (block->parent_data == block->current_data) { + // remember any previous contents for the parent transaction + block->parent_data = cache->Allocate(); + if (block->parent_data == NULL) { + // ToDo: maybe we should just continue the current transaction in this case... + FATAL(("could not allocate parent\n")); + put_cached_block(cache, block); + return NULL; + } + + memcpy(block->parent_data, block->current_data, cache->block_size); + block->transaction->sub_num_blocks++; + } + + if (cleared) + memset(block->current_data, 0, cache->block_size); + + block->is_dirty = true; + + return block->current_data; +} + + +static status_t +write_cached_block(block_cache *cache, cached_block *block, bool deleteTransaction) +{ + cache_transaction *previous = block->previous_transaction; + int32 blockSize = cache->block_size; + + void *data = previous && block->original_data ? block->original_data : block->current_data; + // we first need to write back changes from previous transactions + + TRACE(("write_cached_block(block %Ld)\n", block->block_number)); + + ssize_t written = write_pos(cache->fd, block->block_number * blockSize, data, blockSize); + + if (written < blockSize) { + FATAL(("could not write back block %Ld (%s)\n", block->block_number, strerror(errno))); + return B_IO_ERROR; + } + + if (data == block->current_data) + block->is_dirty = false; + + if (previous != NULL) { + previous->blocks.Remove(block); + block->previous_transaction = NULL; + + // Has the previous transation been finished with that write? + if (--previous->num_blocks == 0) { + TRACE(("cache transaction %ld finished!\n", previous->id)); + + if (previous->notification_hook != NULL) + previous->notification_hook(previous->id, previous->notification_data); + + if (deleteTransaction) + delete_transaction(cache, previous); + } + } + + return B_OK; +} + + +status_t +block_cache_init() +{ + return B_OK; +} + + +// #pragma mark - public transaction API + + +int32 +cache_start_transaction(void *_cache) +{ + block_cache *cache = (block_cache *)_cache; + BenaphoreLocker locker(&cache->lock); + + if (cache->last_transaction && cache->last_transaction->open) + panic("last transaction (%ld) still open!\n", cache->last_transaction->id); + + cache_transaction *transaction = new(nothrow) cache_transaction; + if (transaction == NULL) + return B_NO_MEMORY; + + transaction->id = atomic_add(&cache->next_transaction_id, 1); + cache->last_transaction = transaction; + + TRACE(("cache_start_transaction(): id %ld started\n", transaction->id)); + + hash_insert(cache->transaction_hash, transaction); + + return transaction->id; +} + + +status_t +cache_sync_transaction(void *_cache, int32 id) +{ + block_cache *cache = (block_cache *)_cache; + BenaphoreLocker locker(&cache->lock); + status_t status = B_ENTRY_NOT_FOUND; + + hash_iterator iterator; + hash_open(cache->transaction_hash, &iterator); + + cache_transaction *transaction; + while ((transaction = (cache_transaction *)hash_next(cache->transaction_hash, &iterator)) != NULL) { + // ToDo: fix hash interface to make this easier + + if (transaction->id <= id && !transaction->open) { + while (transaction->num_blocks > 0) { + status = write_cached_block(cache, transaction->blocks.Head(), false); + if (status != B_OK) + return status; + } + delete_transaction(cache, transaction); + hash_rewind(cache->transaction_hash, &iterator); + } + } + + hash_close(cache->transaction_hash, &iterator, false); + return B_OK; +} + + +status_t +cache_end_transaction(void *_cache, int32 id, transaction_notification_hook hook, void *data) +{ + block_cache *cache = (block_cache *)_cache; + BenaphoreLocker locker(&cache->lock); + + TRACE(("cache_end_transaction(id = %ld)\n", id)); + + cache_transaction *transaction = lookup_transaction(cache, id); + if (transaction == NULL) { + panic("cache_end_transaction(): invalid transaction ID\n"); + return B_BAD_VALUE; + } + + transaction->notification_hook = hook; + transaction->notification_data = data; + + // iterate through all blocks and free the unchanged original contents + + cached_block *block = transaction->first_block, *next; + for (; block != NULL; block = next) { + next = block->transaction_next; + + if (block->previous_transaction != NULL) { + // need to write back pending changes + write_cached_block(cache, block); + } + + if (block->original_data != NULL) { + cache->Free(block->original_data); + block->original_data = NULL; + } + if (transaction->has_sub_transaction) { + if (block->parent_data != block->current_data) + cache->Free(block->parent_data); + block->parent_data = NULL; + } + + // move the block to the previous transaction list + transaction->blocks.Add(block); + + block->previous_transaction = transaction; + block->transaction_next = NULL; + block->transaction = NULL; + } + + transaction->open = false; + + return B_OK; +} + + +status_t +cache_abort_transaction(void *_cache, int32 id) +{ + block_cache *cache = (block_cache *)_cache; + BenaphoreLocker locker(&cache->lock); + + TRACE(("cache_abort_transaction(id = %ld)\n", id)); + + cache_transaction *transaction = lookup_transaction(cache, id); + if (transaction == NULL) { + panic("cache_abort_transaction(): invalid transaction ID\n"); + return B_BAD_VALUE; + } + + // iterate through all blocks and restore their original contents + + cached_block *block = transaction->first_block, *next; + for (; block != NULL; block = next) { + next = block->transaction_next; + + if (block->original_data != NULL) { + TRACE(("cache_abort_transaction(id = %ld): restored contents of block %Ld\n", + transaction->id, block->block_number)); + memcpy(block->current_data, block->original_data, cache->block_size); + cache->Free(block->original_data); + block->original_data = NULL; + } + if (transaction->has_sub_transaction) { + if (block->parent_data != block->current_data) + cache->Free(block->parent_data); + block->parent_data = NULL; + } + + block->transaction_next = NULL; + block->transaction = NULL; + } + + delete_transaction(cache, transaction); + return B_OK; +} + + +/** Acknowledges the current parent transaction, and starts a new transaction + * from its sub transaction. + * The new transaction also gets a new transaction ID. + */ + +int32 +cache_detach_sub_transaction(void *_cache, int32 id, + transaction_notification_hook hook, void *data) +{ + block_cache *cache = (block_cache *)_cache; + BenaphoreLocker locker(&cache->lock); + + TRACE(("cache_detach_sub_transaction(id = %ld)\n", id)); + + cache_transaction *transaction = lookup_transaction(cache, id); + if (transaction == NULL) { + panic("cache_detach_sub_transaction(): invalid transaction ID\n"); + return B_BAD_VALUE; + } + if (!transaction->has_sub_transaction) + return B_BAD_VALUE; + + // create a new transaction for the sub transaction + cache_transaction *newTransaction = new(nothrow) cache_transaction; + if (transaction == NULL) + return B_NO_MEMORY; + + newTransaction->id = atomic_add(&cache->next_transaction_id, 1); + + transaction->notification_hook = hook; + transaction->notification_data = data; + + // iterate through all blocks and free the unchanged original contents + + cached_block *block = transaction->first_block, *next, *last = NULL; + for (; block != NULL; block = next) { + next = block->transaction_next; + + if (block->previous_transaction != NULL) { + // need to write back pending changes + write_cached_block(cache, block); + } + + if (block->original_data != NULL && block->parent_data != NULL + && block->parent_data != block->current_data) { + // free the original data if the parent data of the transaction + // will be made current - but keep them otherwise + cache->Free(block->original_data); + block->original_data = NULL; + } + if (block->parent_data != NULL && block->parent_data != block->current_data) { + // we need to move this block over to the new transaction + block->original_data = block->parent_data; + if (last == NULL) + newTransaction->first_block = block; + else + last->transaction_next = block; + + last = block; + } + block->parent_data = NULL; + + // move the block to the previous transaction list + transaction->blocks.Add(block); + + block->previous_transaction = transaction; + block->transaction_next = NULL; + block->transaction = newTransaction; + } + + transaction->open = false; + + hash_insert(cache->transaction_hash, newTransaction); + cache->last_transaction = newTransaction; + + return B_OK; +} + + +status_t +cache_abort_sub_transaction(void *_cache, int32 id) +{ + block_cache *cache = (block_cache *)_cache; + BenaphoreLocker locker(&cache->lock); + + TRACE(("cache_abort_sub_transaction(id = %ld)\n", id)); + + cache_transaction *transaction = lookup_transaction(cache, id); + if (transaction == NULL) { + panic("cache_abort_sub_transaction(): invalid transaction ID\n"); + return B_BAD_VALUE; + } + if (!transaction->has_sub_transaction) + return B_BAD_VALUE; + + // revert all changes back to the version of the parent + + cached_block *block = transaction->first_block, *next; + for (; block != NULL; block = next) { + next = block->transaction_next; + + if (block->parent_data == NULL) { + if (block->original_data != NULL) { + // the parent transaction didn't change the block, but the sub + // transaction did - we need to revert from the original data + memcpy(block->current_data, block->original_data, cache->block_size); + } + } else if (block->parent_data != block->current_data) { + // the block has been changed and must be restored + TRACE(("cache_abort_sub_transaction(id = %ld): restored contents of block %Ld\n", + transaction->id, block->block_number)); + memcpy(block->current_data, block->parent_data, cache->block_size); + cache->Free(block->parent_data); + } + + block->parent_data = NULL; + } + + // all subsequent changes will go into the main transaction + transaction->has_sub_transaction = false; + return B_OK; +} + + +status_t +cache_start_sub_transaction(void *_cache, int32 id) +{ + block_cache *cache = (block_cache *)_cache; + BenaphoreLocker locker(&cache->lock); + + TRACE(("cache_start_sub_transaction(id = %ld)\n", id)); + + cache_transaction *transaction = lookup_transaction(cache, id); + if (transaction == NULL) { + panic("cache_start_sub_transaction(): invalid transaction ID %ld\n", id); + return B_BAD_VALUE; + } + + // move all changed blocks up to the parent + + cached_block *block = transaction->first_block, *next; + for (; block != NULL; block = next) { + next = block->transaction_next; + + if (transaction->has_sub_transaction + && block->parent_data != NULL + && block->parent_data != block->current_data) { + // there already is an older sub transaction - we acknowledge + // its changes and move its blocks up to the parent + cache->Free(block->parent_data); + } + + // we "allocate" the parent data lazily, that means, we don't copy + // the data (and allocate memory for it) until we need to + block->parent_data = block->current_data; + } + + // all subsequent changes will go into the sub transaction + transaction->has_sub_transaction = true; + transaction->sub_num_blocks = 0; + + return B_OK; +} + + +status_t +cache_next_block_in_transaction(void *_cache, int32 id, uint32 *_cookie, off_t *_blockNumber, + void **_data, void **_unchangedData) +{ + cached_block *block = (cached_block *)*_cookie; + block_cache *cache = (block_cache *)_cache; + + BenaphoreLocker locker(&cache->lock); + + cache_transaction *transaction = lookup_transaction(cache, id); + if (transaction == NULL) + return B_BAD_VALUE; + + if (block == NULL) + block = transaction->first_block; + else + block = block->transaction_next; + + if (block == NULL) + return B_ENTRY_NOT_FOUND; + + if (_blockNumber) + *_blockNumber = block->block_number; + if (_data) + *_data = block->current_data; + if (_unchangedData) + *_unchangedData = block->original_data; + + *_cookie = (uint32)block; + return B_OK; +} + + +int32 +cache_blocks_in_transaction(void *_cache, int32 id) +{ + block_cache *cache = (block_cache *)_cache; + BenaphoreLocker locker(&cache->lock); + + cache_transaction *transaction = lookup_transaction(cache, id); + if (transaction == NULL) + return B_BAD_VALUE; + + return transaction->num_blocks; +} + + +int32 +cache_blocks_in_sub_transaction(void *_cache, int32 id) +{ + block_cache *cache = (block_cache *)_cache; + BenaphoreLocker locker(&cache->lock); + + cache_transaction *transaction = lookup_transaction(cache, id); + if (transaction == NULL) + return B_BAD_VALUE; + + return transaction->sub_num_blocks; +} + + +// #pragma mark - public block cache API +// public interface + + +void +block_cache_delete(void *_cache, bool allowWrites) +{ + block_cache *cache = (block_cache *)_cache; + + if (allowWrites) + block_cache_sync(cache); + + BenaphoreLocker locker(&cache->lock); + + // free all blocks + + uint32 cookie = 0; + cached_block *block; + while ((block = (cached_block *)hash_remove_first(cache->hash, &cookie)) != NULL) { + cache->FreeBlock(block); + } + [... truncated: 1403 lines follow ...] From axeld at mail.berlios.de Sun Mar 11 22:18:50 2007 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Sun, 11 Mar 2007 22:18:50 +0100 Subject: [Haiku-commits] r20368 - in haiku/trunk: headers/private/kernel/util src/system/kernel/util Message-ID: <200703112118.l2BLIoPx017148@sheep.berlios.de> Author: axeld Date: 2007-03-11 22:18:49 +0100 (Sun, 11 Mar 2007) New Revision: 20368 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20368&view=rev Modified: haiku/trunk/headers/private/kernel/util/khash.h haiku/trunk/src/system/kernel/util/khash.c Log: Implemented hash_remove_current() which removes the current iterator position from the hash - not yet tested. Modified: haiku/trunk/headers/private/kernel/util/khash.h =================================================================== --- haiku/trunk/headers/private/kernel/util/khash.h 2007-03-11 15:04:53 UTC (rev 20367) +++ haiku/trunk/headers/private/kernel/util/khash.h 2007-03-11 21:18:49 UTC (rev 20368) @@ -1,10 +1,17 @@ -/* -** Copyright 2001-2002, Travis Geiselbrecht. All rights reserved. -** Distributed under the terms of the NewOS License. -*/ -#ifndef _KERNEL_KHASH_H -#define _KERNEL_KHASH_H +/* + * Copyright 2002-2007, Haiku Inc. All rights reserved. + * Distributed under the terms of the MIT License. + * + * Copyright 2001-2002, Travis Geiselbrecht. All rights reserved. + * Distributed under the terms of the NewOS License. + */ +#ifndef _KERNEL_UTIL_KHASH_H +#define _KERNEL_UTIL_KHASH_H + +#include + + // can be allocated on the stack typedef struct hash_iterator { void *current; @@ -23,6 +30,7 @@ int hash_uninit(struct hash_table *table); status_t hash_insert(struct hash_table *table, void *_element); status_t hash_remove(struct hash_table *table, void *_element); +void hash_remove_current(struct hash_table *table, struct hash_iterator *iterator); void *hash_remove_first(struct hash_table *table, uint32 *_cookie); void *hash_find(struct hash_table *table, void *e); void *hash_lookup(struct hash_table *table, const void *key); @@ -31,17 +39,15 @@ void *hash_next(struct hash_table *table, struct hash_iterator *i); void hash_rewind(struct hash_table *table, struct hash_iterator *i); -/* function ptrs must look like this: +/* function pointers must look like this: * * uint32 hash_func(void *e, const void *key, uint32 range); * hash function should calculate hash on either e or key, - * depending on which one is not NULL + * depending on which one is not NULL - they also need + * to make sure the returned value is within range. * int compare_func(void *e, const void *key); * compare function should compare the element with * the key, returning 0 if equal, other if not - * NOTE: compare func can be null, in which case the hash - * code will compare the key pointer with the target - * ToDo: check this! */ uint32 hash_hash_string(const char *str); @@ -50,4 +56,4 @@ } #endif -#endif /* _KERNEL_KHASH_H */ +#endif /* _KERNEL_UTIL_KHASH_H */ Modified: haiku/trunk/src/system/kernel/util/khash.c =================================================================== --- haiku/trunk/src/system/kernel/util/khash.c 2007-03-11 15:04:53 UTC (rev 20367) +++ haiku/trunk/src/system/kernel/util/khash.c 2007-03-11 21:18:49 UTC (rev 20368) @@ -1,16 +1,21 @@ -/* Generic hash table -** -** Copyright 2001, Travis Geiselbrecht. All rights reserved. -** Distributed under the terms of the NewOS License. -*/ +/* + * Copyright 2002-2007, Haiku Inc. All rights reserved. + * Distributed under the terms of the MIT License. + * + * Copyright 2001, Travis Geiselbrecht. All rights reserved. + * Distributed under the terms of the NewOS License. + */ +//! Generic hash table + + #include -#include #include -#include -#include #include +#include +#include + #define TRACE_HASH 0 #if TRACE_HASH # define TRACE(x) dprintf x @@ -18,9 +23,9 @@ # define TRACE(x) ; #endif -// ToDo: the hashtable is not expanded when necessary (no load factor, no nothing) -// Could try to use pools instead of malloc() for the elements - might be -// faster than the current approach. +// TODO: the hashtable is not expanded when necessary (no load factor, nothing) +// resizing should be optional, though, in case the hash is used at times +// that forbid resizing. struct hash_table { struct hash_element **table; @@ -123,7 +128,8 @@ uint32 hash = table->hash_func(_element, NULL, table->table_size); void *element, *lastElement = NULL; - for (element = table->table[hash]; element != NULL; lastElement = element, element = NEXT(table, element)) { + for (element = table->table[hash]; element != NULL; + lastElement = element, element = NEXT(table, element)) { if (element == _element) { if (lastElement != NULL) { // connect the previous entry with the next one @@ -140,6 +146,40 @@ } +void +hash_remove_current(struct hash_table *table, struct hash_iterator *iterator) +{ + uint32 index = iterator->bucket; + void *element; + + if (iterator->current == NULL) + panic("hash_remove_current() called too early."); + + for (element = table->table[index]; index < table->table_size; index++) { + void *lastElement = NULL; + + while (element != NULL) { + if (element == iterator->current) { + iterator->current = lastElement; + + if (lastElement != NULL) { + // connect the previous entry with the next one + PUT_IN_NEXT(table, lastElement, NEXT(table, element)); + } else { + table->table[index] = (struct hash_element *)NEXT(table, + element); + } + + table->num_elements--; + return; + } + + element = NEXT(table, element); + } + } +} + + void * hash_remove_first(struct hash_table *table, uint32 *_cookie) { From axeld at mail.berlios.de Sun Mar 11 22:19:20 2007 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Sun, 11 Mar 2007 22:19:20 +0100 Subject: [Haiku-commits] r20369 - haiku/trunk/src/system/kernel/vm Message-ID: <200703112119.l2BLJKSQ017186@sheep.berlios.de> Author: axeld Date: 2007-03-11 22:19:20 +0100 (Sun, 11 Mar 2007) New Revision: 20369 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20369&view=rev Modified: haiku/trunk/src/system/kernel/vm/vm.cpp Log: Fixed warning. Modified: haiku/trunk/src/system/kernel/vm/vm.cpp =================================================================== --- haiku/trunk/src/system/kernel/vm/vm.cpp 2007-03-11 21:18:49 UTC (rev 20368) +++ haiku/trunk/src/system/kernel/vm/vm.cpp 2007-03-11 21:19:20 UTC (rev 20369) @@ -3757,7 +3757,7 @@ status = vm_soft_fault(base, (flags & B_READ_DEVICE) != 0, isUser); if (status != B_OK) { dprintf("lock_memory(address = %p, numBytes = %lu, flags = %lu) failed: %s\n", - unalignedBase, numBytes, flags, strerror(status)); + (void *)unalignedBase, numBytes, flags, strerror(status)); goto out; } From bonefish at mail.berlios.de Sun Mar 11 22:20:23 2007 From: bonefish at mail.berlios.de (bonefish at BerliOS) Date: Sun, 11 Mar 2007 22:20:23 +0100 Subject: [Haiku-commits] r20370 - haiku/trunk/headers/private/userlandfs/shared Message-ID: <200703112120.l2BLKNSN017310@sheep.berlios.de> Author: bonefish Date: 2007-03-11 22:20:23 +0100 (Sun, 11 Mar 2007) New Revision: 20370 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20370&view=rev Modified: haiku/trunk/headers/private/userlandfs/shared/Debug.h Log: More distinctive header guard. Modified: haiku/trunk/headers/private/userlandfs/shared/Debug.h =================================================================== --- haiku/trunk/headers/private/userlandfs/shared/Debug.h 2007-03-11 21:19:20 UTC (rev 20369) +++ haiku/trunk/headers/private/userlandfs/shared/Debug.h 2007-03-11 21:20:23 UTC (rev 20370) @@ -1,5 +1,5 @@ -#ifndef DEBUG_H -#define DEBUG_H +#ifndef USERLAND_FS_DEBUG_H +#define USERLAND_FS_DEBUG_H /* Debug - debug stuff ** ** Initial version by Axel D?rfler, axeld at pinc-software.de @@ -137,4 +137,4 @@ #define TOUCH(var) (void)var #endif -#endif /* DEBUG_H */ +#endif /* USERLAND_FS_DEBUG_H */ From bonefish at mail.berlios.de Sun Mar 11 22:21:15 2007 From: bonefish at mail.berlios.de (bonefish at BerliOS) Date: Sun, 11 Mar 2007 22:21:15 +0100 Subject: [Haiku-commits] r20371 - haiku/trunk/src/add-ons/kernel/file_systems/ramfs Message-ID: <200703112121.l2BLLFSr017408@sheep.berlios.de> Author: bonefish Date: 2007-03-11 22:21:15 +0100 (Sun, 11 Mar 2007) New Revision: 20371 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20371&view=rev Modified: haiku/trunk/src/add-ons/kernel/file_systems/ramfs/kernel_interface.cpp Log: Copy'n'paste leftovers. Modified: haiku/trunk/src/add-ons/kernel/file_systems/ramfs/kernel_interface.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/ramfs/kernel_interface.cpp 2007-03-11 21:20:23 UTC (rev 20370) +++ haiku/trunk/src/add-ons/kernel/file_systems/ramfs/kernel_interface.cpp 2007-03-11 21:21:15 UTC (rev 20371) @@ -2048,12 +2048,12 @@ case B_MODULE_INIT: { init_debugging(); - PRINT(("userlandfs_std_ops(): B_MODULE_INIT\n")); + PRINT(("ramfs_std_ops(): B_MODULE_INIT\n")); return B_OK; } case B_MODULE_UNINIT: - PRINT(("userlandfs_std_ops(): B_MODULE_UNINIT\n")); + PRINT(("ramfs_std_ops(): B_MODULE_UNINIT\n")); exit_debugging(); return B_OK; @@ -2069,7 +2069,7 @@ ramfs_std_ops, }, - "Userland File System", + "RAM File System", // scanning NULL, // identify_partition() From bonefish at mail.berlios.de Sun Mar 11 22:22:36 2007 From: bonefish at mail.berlios.de (bonefish at BerliOS) Date: Sun, 11 Mar 2007 22:22:36 +0100 Subject: [Haiku-commits] r20372 - in haiku/trunk/src/add-ons/kernel/file_systems: . reiserfs Message-ID: <200703112122.l2BLMaN4017492@sheep.berlios.de> Author: bonefish Date: 2007-03-11 22:22:34 +0100 (Sun, 11 Mar 2007) New Revision: 20372 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20372&view=rev Added: haiku/trunk/src/add-ons/kernel/file_systems/reiserfs/ Removed: haiku/trunk/src/add-ons/kernel/file_systems/reiserfs/Debug.cpp haiku/trunk/src/add-ons/kernel/file_systems/reiserfs/Debug.h haiku/trunk/src/add-ons/kernel/file_systems/reiserfs/Locker.cpp haiku/trunk/src/add-ons/kernel/file_systems/reiserfs/Locker.h haiku/trunk/src/add-ons/kernel/file_systems/reiserfs/String.cpp haiku/trunk/src/add-ons/kernel/file_systems/reiserfs/String.h haiku/trunk/src/add-ons/kernel/file_systems/reiserfs/makefile Modified: haiku/trunk/src/add-ons/kernel/file_systems/Jamfile haiku/trunk/src/add-ons/kernel/file_systems/reiserfs/Block.cpp haiku/trunk/src/add-ons/kernel/file_systems/reiserfs/Block.h haiku/trunk/src/add-ons/kernel/file_systems/reiserfs/BlockCache.cpp haiku/trunk/src/add-ons/kernel/file_systems/reiserfs/BlockCache.h haiku/trunk/src/add-ons/kernel/file_systems/reiserfs/Jamfile haiku/trunk/src/add-ons/kernel/file_systems/reiserfs/Settings.cpp haiku/trunk/src/add-ons/kernel/file_systems/reiserfs/Settings.h haiku/trunk/src/add-ons/kernel/file_systems/reiserfs/VNode.h haiku/trunk/src/add-ons/kernel/file_systems/reiserfs/Volume.cpp haiku/trunk/src/add-ons/kernel/file_systems/reiserfs/Volume.h haiku/trunk/src/add-ons/kernel/file_systems/reiserfs/kernel_interface.cpp Log: Ported the ReiserFS code to the Haiku FS interface. Removed the built-in block cache. Modified: haiku/trunk/src/add-ons/kernel/file_systems/Jamfile =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/Jamfile 2007-03-11 21:21:15 UTC (rev 20371) +++ haiku/trunk/src/add-ons/kernel/file_systems/Jamfile 2007-03-11 21:22:34 UTC (rev 20372) @@ -10,3 +10,4 @@ SubInclude HAIKU_TOP src add-ons kernel file_systems userlandfs ; SubIncludeGPL HAIKU_TOP src add-ons kernel file_systems ntfs ; +SubIncludeGPL HAIKU_TOP src add-ons kernel file_systems reiserfs ; Copied: haiku/trunk/src/add-ons/kernel/file_systems/reiserfs (from rev 20367, haiku/trunk/src/tests/add-ons/kernel/file_systems/userlandfs/r5/src/test/reiserfs) Modified: haiku/trunk/src/add-ons/kernel/file_systems/reiserfs/Block.cpp =================================================================== --- haiku/trunk/src/tests/add-ons/kernel/file_systems/userlandfs/r5/src/test/reiserfs/Block.cpp 2007-03-11 15:04:53 UTC (rev 20367) +++ haiku/trunk/src/add-ons/kernel/file_systems/reiserfs/Block.cpp 2007-03-11 21:22:34 UTC (rev 20372) @@ -19,11 +19,13 @@ // You can alternatively use *this file* under the terms of the the MIT // license included in this package. +#include "Block.h" + #include -#include "Block.h" +//#include + #include "BlockCache.h" -#include "cache.h" #include "Item.h" #include "Key.h" @@ -42,8 +44,7 @@ fNumber(0), fData(NULL), fFlags(KIND_UNKNOWN), - fRefCount(0), - fAge(-1) + fRefCount(0) { } @@ -184,9 +185,7 @@ fCache = cache; fNumber = number; if (error == B_OK) { -// fData = get_block(fCache->GetDevice(), fNumber, -// fCache->GetBlockSize()); -fData = fCache->_GetBlock(fNumber); + fData = fCache->_GetBlock(fNumber); if (!fData) error = B_BAD_VALUE; } @@ -198,15 +197,13 @@ Block::_Unset() { if (fCache && fData) -// release_block(fCache->GetDevice(), fNumber); -fCache->_ReleaseBlock(fNumber, fData); + fCache->_ReleaseBlock(fNumber, fData); fData = NULL; fCache = NULL; fNumber = 0; fData = NULL; fFlags = KIND_UNKNOWN; fRefCount = 0; - fAge = -1; } // _Get Modified: haiku/trunk/src/add-ons/kernel/file_systems/reiserfs/Block.h =================================================================== --- haiku/trunk/src/tests/add-ons/kernel/file_systems/userlandfs/r5/src/test/reiserfs/Block.h 2007-03-11 15:04:53 UTC (rev 20367) +++ haiku/trunk/src/add-ons/kernel/file_systems/reiserfs/Block.h 2007-03-11 21:22:34 UTC (rev 20372) @@ -82,8 +82,6 @@ int32 _GetRefCount() const { return fRefCount; } void _Get(); bool _Put(); - void _SetAge(int64 age) { fAge = age; } - int64 _GetAge() { return fAge; } private: friend class BlockCache; @@ -94,7 +92,6 @@ void *fData; uint32 fFlags; int32 fRefCount; - int64 fAge; }; // Node Modified: haiku/trunk/src/add-ons/kernel/file_systems/reiserfs/BlockCache.cpp =================================================================== --- haiku/trunk/src/tests/add-ons/kernel/file_systems/userlandfs/r5/src/test/reiserfs/BlockCache.cpp 2007-03-11 15:04:53 UTC (rev 20367) +++ haiku/trunk/src/add-ons/kernel/file_systems/reiserfs/BlockCache.cpp 2007-03-11 21:22:34 UTC (rev 20372) @@ -19,6 +19,8 @@ // You can alternatively use *this file* under the terms of the the MIT // license included in this package. +#include "BlockCache.h" + #include #include @@ -28,9 +30,9 @@ #include #include -#include "BlockCache.h" +#include + #include "Block.h" -#include "cache.h" #include "Debug.h" #include "reiserfs.h" @@ -40,15 +42,6 @@ \class BlockCache \brief Implements a cache for disk blocks. - The BlockCache can work in two different modes. The first one uses the - system device block cache and the object is object doesn't do much more - than two maintain a list of Blocks currently being in use. The second - mode does a bit more. It implements a cache with a simple strategy - dropping least-recently-used items. - - The second mode is useful for userland tests and, due to a bug in the - BeOS when dealing with 4096 bytes sized blocks, also for the real thing. - The central methods are GetBlock() and PutBlock(). The former one requests a certain block and the latter tells the cache, that the caller is done with the block. When a block is unused it is either kept in @@ -63,9 +56,6 @@ fBlockCount(0), fLock(), fBlocks(), - fBlockAge(0), - fNoDeviceCache(true), - fCacheCapacity(0), fReads(0), fBlockGets(0), fBlockReleases(0) @@ -81,41 +71,33 @@ INFORM(("WARNING: block not put: %p (ref count: %ld)\n", block, block->_GetRefCount())); } - PRINT(("statistics: block %p: age: %Ld\n", block, block->_GetAge())); delete block; } PRINT(("statistics: %Ld block reads\n", fReads)); PRINT(("statistics: %Ld block gets\n", fBlockGets)); PRINT(("statistics: %Ld block releases\n", fBlockReleases)); - if (!fNoDeviceCache) - remove_cached_device_blocks(fDevice, NO_WRITES); + if (fCacheHandle) + block_cache_delete(fCacheHandle, false); fLock.Unlock(); } // Init status_t -BlockCache::Init(int device, uint64 blockCount, uint32 blockSize, - bool disableDeviceCache, uint32 cacheCapacity) +BlockCache::Init(int device, uint64 blockCount, uint32 blockSize) { - status_t error = (device >= 0 && blockSize > 0 ? B_OK : B_BAD_VALUE); - if (error == B_OK) { - fDevice = device; - fBlockSize = blockSize; - fBlockCount = blockCount; - fCacheCapacity = cacheCapacity / fBlockSize; - fNoDeviceCache = true; - // init device cache - if (error == B_OK && !disableDeviceCache) { - if (init_cache_for_device(fDevice, blockCount) == B_OK) { - fNoDeviceCache = false; - fCacheCapacity = 0; // release blocks, when unused - } else { - INFORM(("WARNING: init_cache_for_device() failed, use " - "built-in caching\n")); - } - } - } - RETURN_ERROR(error); + if (device < 0 || blockSize <= 0) + return B_BAD_VALUE; + + fDevice = device; + fBlockSize = blockSize; + fBlockCount = blockCount; + + // init block cache + fCacheHandle = block_cache_create(fDevice, blockCount, blockSize, true); + if (!fCacheHandle) + return B_ERROR; + + return B_OK; } // GetBlock @@ -138,24 +120,28 @@ status_t BlockCache::GetBlock(uint64 number, Block **result) { - status_t error = (result && number < fBlockCount ? B_OK : B_BAD_VALUE); + + if (!result || number >= fBlockCount) + return B_BAD_VALUE; + fLock.Lock(); + // find the block in the cache - Block *block = NULL; - if (error == B_OK) { - block = _FindBlock(number); - if (!block) { - // not found, read it from disk - error = _ReadBlock(number, &block); - if (error == B_OK) - fBlocks.AddItem(block); - } + status_t error = B_OK; + Block *block = _FindBlock(number); + if (!block) { + // not found, read it from disk + error = _ReadBlock(number, &block); + if (error == B_OK) + fBlocks.AddItem(block); } + // increase the block's reference counter if (error == B_OK) { block->_Get(); *result = block; } + fLock.Unlock(); return error; } @@ -166,14 +152,9 @@ { fLock.Lock(); if (block && fBlocks.HasItem(block)) { - if (block->_Put() && block->_GetAge() < fBlockAge) { - block->_SetAge(fBlockAge); - fBlockAge++; - // free the block, if the cache is over full - if (_GetCacheSize() > (int32)fCacheCapacity) { - fBlocks.RemoveItem(block); - delete block; - } + if (block->_Put()) { + fBlocks.RemoveItem(block); + delete block; } } fLock.Unlock(); @@ -195,11 +176,14 @@ BlockCache::_ReadBlock(uint64 number, Block **result) { fReads++; // statistics + // get a free block and read the block data - Block *block = NULL; - status_t error = _GetFreeBlock(&block); - if (error == B_OK) - error = block->_SetTo(this, number); + Block *block = new(nothrow) Block; + if (!block) + return B_NO_MEMORY; + + status_t error = block->_SetTo(this, number); + // set the result / cleanup on error if (error == B_OK) *result = block; @@ -208,68 +192,12 @@ return error; } -// _GetFreeBlock -status_t -BlockCache::_GetFreeBlock(Block **result) -{ - status_t error = B_OK; - Block *unusedBlock = NULL; - // Search for an unused block, but only, if there's no device cache, since - // there are no unused blocks otherwise. - if (fNoDeviceCache && _GetCacheSize() >= (int32)fCacheCapacity) { - // cache is full, try to reuse a block - int64 age = fBlockAge; - for (int32 i = 0; Block *block = fBlocks.ItemAt(i); i++) { - if (block->_GetRefCount() == 0 && block->_GetAge() < age) { - unusedBlock = block; - age = block->_GetAge(); - } - } - if (unusedBlock) - fBlocks.RemoveItem(unusedBlock); - else { - INFORM(("WARNING: Cache is full and all blocks are in use: " - "size: %ld\n", _GetCacheSize())); - } - } - if (!unusedBlock) { - // allocate a block - unusedBlock = new(nothrow) Block; - if (!unusedBlock) - error = B_NO_MEMORY; - } - if (error == B_OK) - *result = unusedBlock; - return error; -} - -// _GetCacheSize -int32 -BlockCache::_GetCacheSize() -{ - return fBlocks.CountItems(); -} - // _GetBlock void * BlockCache::_GetBlock(off_t number) const { fBlockGets++; // statistics - void *data = NULL; - if (fNoDeviceCache) { - data = malloc(fBlockSize); - if (data) { - if (read_pos(fDevice, number * fBlockSize, data, fBlockSize) - != (ssize_t)fBlockSize) { - free(data); - data = NULL; - PRINT(("reading block %Ld failed: %s\n", - number, strerror(errno))); - } - } - } else - data = get_block(fDevice, number, fBlockSize); - return data; + return const_cast(block_cache_get(fCacheHandle, number)); } // _ReleaseBlock @@ -277,14 +205,6 @@ BlockCache::_ReleaseBlock(off_t number, void *data) const { fBlockReleases++; // statistics - if (fNoDeviceCache) - free(data); - else { - status_t error = release_block(fDevice, number); - if (error != B_OK) { - FATAL(("release_block(%d, %Ld) failed: %s\n", fDevice, number, - strerror(error))); - } - } + block_cache_put(fCacheHandle, number); } Modified: haiku/trunk/src/add-ons/kernel/file_systems/reiserfs/BlockCache.h =================================================================== --- haiku/trunk/src/tests/add-ons/kernel/file_systems/userlandfs/r5/src/test/reiserfs/BlockCache.h 2007-03-11 15:04:53 UTC (rev 20367) +++ haiku/trunk/src/add-ons/kernel/file_systems/reiserfs/BlockCache.h 2007-03-11 21:22:34 UTC (rev 20372) @@ -35,8 +35,7 @@ BlockCache(); ~BlockCache(); - status_t Init(int device, uint64 blockCount, uint32 blockSize, - bool disableDeviceCache, size_t cacheCapacity); + status_t Init(int device, uint64 blockCount, uint32 blockSize); int GetDevice() const { return fDevice; } uint32 GetBlockSize() const { return fBlockSize; } @@ -49,23 +48,19 @@ private: Block *_FindBlock(uint64 number); status_t _ReadBlock(uint64 number, Block **block); - status_t _GetFreeBlock(Block **block); - int32 _GetCacheSize(); -friend class Block; -void *_GetBlock(off_t number) const; -void _ReleaseBlock(off_t number, void *data) const; + friend class Block; + void *_GetBlock(off_t number) const; + void _ReleaseBlock(off_t number, void *data) const; private: int fDevice; uint32 fBlockSize; uint64 fBlockCount; - BLocker fLock; + Locker fLock; List fBlocks; - int64 fBlockAge; - bool fNoDeviceCache; - uint32 fCacheCapacity; + void* fCacheHandle; // statistics int64 fReads; mutable int64 fBlockGets; Deleted: haiku/trunk/src/add-ons/kernel/file_systems/reiserfs/Debug.cpp Deleted: haiku/trunk/src/add-ons/kernel/file_systems/reiserfs/Debug.h Modified: haiku/trunk/src/add-ons/kernel/file_systems/reiserfs/Jamfile =================================================================== --- haiku/trunk/src/tests/add-ons/kernel/file_systems/userlandfs/r5/src/test/reiserfs/Jamfile 2007-03-11 15:04:53 UTC (rev 20367) +++ haiku/trunk/src/add-ons/kernel/file_systems/reiserfs/Jamfile 2007-03-11 21:22:34 UTC (rev 20372) @@ -1,37 +1,30 @@ -SubDir HAIKU_TOP src tests add-ons kernel file_systems userlandfs r5 src test - reiserfs ; +SubDir HAIKU_TOP src add-ons kernel file_systems reiserfs ; -SetSubDirSupportedPlatforms r5 bone dano ; +local userlandFSTop = [ FDirName $(HAIKU_TOP) src add-ons kernel file_systems + userlandfs ] ; +local userlandFSIncludes = [ PrivateHeaders userlandfs ] ; -local userlandFSTop = [ FDirName $(HAIKU_TOP) src tests add-ons kernel - file_systems userlandfs r5 ] ; -local userlandFSIncludes = [ FDirName $(userlandFSTop) headers ] ; +SubDirHdrs [ FDirName $(userlandFSIncludes) shared ] ; -DEFINES += USER=1 ; +SEARCH_SOURCE += [ FDirName $(userlandFSTop) shared ] ; -SubDirHdrs [ FDirName $(userlandFSIncludes) public ] ; -SubDirSysHdrs [ FDirName $(userlandFSIncludes) public ] ; - -Addon reiserfs - : # relpath - obsolete +KernelAddon reiserfs : + Debug.cpp + Locker.cpp + String.cpp + Block.cpp BlockCache.cpp - cpp.cpp hashes.cpp Item.cpp Iterators.cpp kernel_interface.cpp - Locker.cpp + Settings.cpp + SuperBlock.cpp Tree.cpp VNode.cpp Volume.cpp - Debug.cpp - Settings.cpp - String.cpp - SuperBlock.cpp - - : false # is executable - : UserlandFSServer + : $(TARGET_GCC_LIBGCC) $(HAIKU_LIBSUPC++) ; Deleted: haiku/trunk/src/add-ons/kernel/file_systems/reiserfs/Locker.cpp Deleted: haiku/trunk/src/add-ons/kernel/file_systems/reiserfs/Locker.h Modified: haiku/trunk/src/add-ons/kernel/file_systems/reiserfs/Settings.cpp =================================================================== --- haiku/trunk/src/tests/add-ons/kernel/file_systems/userlandfs/r5/src/test/reiserfs/Settings.cpp 2007-03-11 15:04:53 UTC (rev 20367) +++ haiku/trunk/src/add-ons/kernel/file_systems/reiserfs/Settings.cpp 2007-03-11 21:22:34 UTC (rev 20372) @@ -36,18 +36,12 @@ // defaults static const char *kDefaultDefaultVolumeName = "ReiserFS untitled"; static const bool kDefaultHideEsoteric = true; -static const bool kDefaultCacheDisabled = false; -static const size_t kDefaultCacheSize = 128; // in KB -static const size_t kMinCacheSize = 0; -static const size_t kMaxCacheSize = 1024 * 1024; // 1 GB // constructor Settings::Settings() : fDefaultVolumeName(), fVolumeName(), fHideEsoteric(kDefaultHideEsoteric), - fCacheDisabled(kDefaultCacheDisabled), - fCacheSize(kDefaultCacheSize), fHiddenEntries(5) { } @@ -103,8 +97,6 @@ fDefaultVolumeName.Unset(); fVolumeName.Unset(); fHideEsoteric = kDefaultHideEsoteric; - fCacheDisabled = kDefaultCacheDisabled; - fCacheSize = kDefaultCacheSize; fHiddenEntries.MakeEmpty(); } @@ -133,20 +125,6 @@ return fHideEsoteric; } -// GetCacheDisabled -bool -Settings::GetCacheDisabled() const -{ - return fCacheDisabled; -} - -// GetCacheSizeInKB -size_t -Settings::GetCacheSizeInKB() const -{ - return fCacheSize; -} - // HiddenEntryAt const char * Settings::HiddenEntryAt(int32 index) const @@ -165,9 +143,6 @@ PRINT((" default volume name: `%s'\n", GetDefaultVolumeName())); PRINT((" volume name: `%s'\n", GetVolumeName())); PRINT((" hide esoteric entries: %d\n", GetHideEsoteric())); - PRINT((" cache disabled: %d\n", GetCacheDisabled())); - PRINT((" cache size: %lu (%lu KB)\n", GetCacheSize(), - GetCacheSizeInKB())); PRINT((" %ld hidden entries:\n", fHiddenEntries.CountItems())); for (int32 i = 0; const char *entry = HiddenEntryAt(i); i++) PRINT((" `%s'\n", entry)); @@ -188,14 +163,6 @@ kDefaultHideEsoteric, kDefaultHideEsoteric); PRINT((" hide_esoteric_entries is: %d\n", fHideEsoteric)); - fCacheDisabled = !_GetParameterValue(settings, "device_cache", - !kDefaultCacheDisabled, - !kDefaultCacheDisabled); -PRINT((" device_cache is: %d\n", !fCacheDisabled)); - fCacheSize = _GetParameterValue(settings, "builtin_cache_size", - (int64)kDefaultCacheSize, - (int64)kDefaultCacheSize); -PRINT((" builtin_cache_size is: %lu\n", fCacheSize)); // get the per volume settings if (volume) { PRINT((" getting volume parameters:\n")); @@ -205,12 +172,6 @@ fHideEsoteric = _GetParameterValue(volume, "hide_esoteric_entries", fHideEsoteric, fHideEsoteric); PRINT((" hide_esoteric_entries is: %d\n", fHideEsoteric)); - fCacheDisabled = !_GetParameterValue(volume, "device_cache", - !fCacheDisabled, !fCacheDisabled); -PRINT((" device_cache is: %d\n", !fCacheDisabled)); - fCacheSize = _GetParameterValue(volume, "builtin_cache_size", - (int64)fCacheSize, (int64)fCacheSize); -PRINT((" builtin_cache_size is: %lu\n", fCacheSize)); int32 cookie = 0; while (const driver_parameter *parameter = _FindNextParameter(volume, "hide_entries", cookie)) { @@ -225,10 +186,6 @@ PRINT((" checking volume names...'\n")); _CheckVolumeName(fDefaultVolumeName); _CheckVolumeName(fVolumeName); - if (fCacheSize < kMinCacheSize) - fCacheSize = kMinCacheSize; - if (fCacheSize > kMaxCacheSize) - fCacheSize = kMaxCacheSize; PRINT((" checking hidden entry names...'\n")); for (int32 i = fHiddenEntries.CountItems(); i >= 0; i--) { String &entry = fHiddenEntries.ItemAt(i); Modified: haiku/trunk/src/add-ons/kernel/file_systems/reiserfs/Settings.h =================================================================== --- haiku/trunk/src/tests/add-ons/kernel/file_systems/userlandfs/r5/src/test/reiserfs/Settings.h 2007-03-11 15:04:53 UTC (rev 20367) +++ haiku/trunk/src/add-ons/kernel/file_systems/reiserfs/Settings.h 2007-03-11 21:22:34 UTC (rev 20372) @@ -39,9 +39,6 @@ const char *GetDefaultVolumeName() const; const char *GetVolumeName() const; bool GetHideEsoteric() const; - bool GetCacheDisabled() const; - size_t GetCacheSize() const { return GetCacheSizeInKB() * 1024; } - size_t GetCacheSizeInKB() const; const char *HiddenEntryAt(int32 index) const; void Dump(); @@ -77,8 +74,6 @@ String fDefaultVolumeName; String fVolumeName; bool fHideEsoteric; - bool fCacheDisabled; - size_t fCacheSize; // in KB List fHiddenEntries; }; Deleted: haiku/trunk/src/add-ons/kernel/file_systems/reiserfs/String.cpp Deleted: haiku/trunk/src/add-ons/kernel/file_systems/reiserfs/String.h Modified: haiku/trunk/src/add-ons/kernel/file_systems/reiserfs/VNode.h =================================================================== --- haiku/trunk/src/tests/add-ons/kernel/file_systems/userlandfs/r5/src/test/reiserfs/VNode.h 2007-03-11 15:04:53 UTC (rev 20367) +++ haiku/trunk/src/add-ons/kernel/file_systems/reiserfs/VNode.h 2007-03-11 21:22:34 UTC (rev 20372) @@ -22,7 +22,8 @@ #ifndef V_NODE_H #define V_NODE_H -#include "fsproto.h" +#include + #include "StatItem.h" class VNode { Modified: haiku/trunk/src/add-ons/kernel/file_systems/reiserfs/Volume.cpp =================================================================== --- haiku/trunk/src/tests/add-ons/kernel/file_systems/userlandfs/r5/src/test/reiserfs/Volume.cpp 2007-03-11 15:04:53 UTC (rev 20367) +++ haiku/trunk/src/add-ons/kernel/file_systems/reiserfs/Volume.cpp 2007-03-11 21:22:34 UTC (rev 20372) @@ -84,7 +84,7 @@ // Mount status_t -Volume::Mount(nspace_id id, const char *path) +Volume::Mount(mount_id id, const char *path) { Unmount(); status_t error = (path ? B_OK : B_BAD_VALUE); @@ -117,11 +117,9 @@ // create and init block cache if (error == B_OK) { fBlockCache = new(nothrow) BlockCache; - if (fBlockCache) { - error = fBlockCache->Init(fDevice, CountBlocks(), GetBlockSize(), - fSettings->GetCacheDisabled(), - fSettings->GetCacheSize()); - } else + if (fBlockCache) + error = fBlockCache->Init(fDevice, CountBlocks(), GetBlockSize()); + else error = B_NO_MEMORY; } // create the tree @@ -151,7 +149,7 @@ REISERFS_ROOT_OBJECTID, fRootVNode); REPORT_ERROR(error); if (error == B_OK) - error = new_vnode(fID, fRootVNode->GetID(), fRootVNode); + error = publish_vnode(fID, fRootVNode->GetID(), fRootVNode); REPORT_ERROR(error); } else error = B_NO_MEMORY; Modified: haiku/trunk/src/add-ons/kernel/file_systems/reiserfs/Volume.h =================================================================== --- haiku/trunk/src/tests/add-ons/kernel/file_systems/userlandfs/r5/src/test/reiserfs/Volume.h 2007-03-11 15:04:53 UTC (rev 20367) +++ haiku/trunk/src/add-ons/kernel/file_systems/reiserfs/Volume.h 2007-03-11 21:22:34 UTC (rev 20372) @@ -22,9 +22,9 @@ #ifndef VOLUME_H #define VOLUME_H +#include #include -#include "fsproto.h" #include "hashes.h" #include "List.h" @@ -41,10 +41,10 @@ Volume(); ~Volume(); - status_t Mount(nspace_id nsid, const char *path); + status_t Mount(mount_id nsid, const char *path); status_t Unmount(); - nspace_id GetID() const { return fID; } + mount_id GetID() const { return fID; } off_t GetBlockSize() const; off_t CountBlocks() const; @@ -89,7 +89,7 @@ void _InitNegativeEntries(); private: - nspace_id fID; + mount_id fID; int fDevice; BlockCache *fBlockCache; Tree *fTree; Modified: haiku/trunk/src/add-ons/kernel/file_systems/reiserfs/kernel_interface.cpp =================================================================== --- haiku/trunk/src/tests/add-ons/kernel/file_systems/userlandfs/r5/src/test/reiserfs/kernel_interface.cpp 2007-03-11 15:04:53 UTC (rev 20367) +++ haiku/trunk/src/add-ons/kernel/file_systems/reiserfs/kernel_interface.cpp 2007-03-11 21:22:34 UTC (rev 20372) @@ -19,11 +19,12 @@ // You can alternatively use *this file* under the terms of the the MIT // license included in this package. +#include + #include #include #include #include -#include #include #include #include @@ -31,9 +32,9 @@ #include #include -//#include "lock.h" -//#include "cache.h" -#include "fsproto.h" +#include +#include +#include #include "DirItem.h" #include "Iterators.h" @@ -42,142 +43,39 @@ #include "VNode.h" #include "Volume.h" -extern "C" { -static int reiserfs_mount(nspace_id nsid, const char *device, ulong flags, - void *parameters, size_t len, void **data, - vnode_id *rootID); -static int reiserfs_unmount(void *ns); +static const size_t kOptimalIOSize = 65536; -static int reiserfs_read_vnode(void *ns, vnode_id vnid, char reenter, - void **node); -static int reiserfs_write_vnode(void *ns, void *_node, char reenter); -static int reiserfs_walk(void *ns, void *_dir, const char *entryName, - char **resolvedPath, vnode_id *vnid); -static int reiserfs_read_stat(void *ns, void *_node, struct stat *st); -static int reiserfs_open(void *ns, void *_node, int openMode, void **cookie); -static int reiserfs_close(void *ns, void *node, void *cookie); -static int reiserfs_free_cookie(void *ns, void *node, void *cookie); -static int reiserfs_read(void *ns, void *_node, void *cookie, off_t pos, - void *buffer, size_t *bufferSize); +inline static bool is_user_in_group(gid_t gid); -static int reiserfs_access(void *ns, void *_node, int mode); -static int reiserfs_open_dir(void *ns, void *_node, void **cookie); -static int reiserfs_read_dir(void *ns, void *_node, void *cookie, - long *count, struct dirent *buffer, - size_t bufferSize); -static int reiserfs_rewind_dir(void *ns, void *_node, void *cookie); -static int reiserfs_close_dir(void *ns, void *_node, void *cookie); -static int reiserfs_free_dir_cookie(void *ns, void *_node, void *cookie); +// #pragma mark - FS -static int reiserfs_read_fs_stat(void *ns, struct fs_info *info); -static int reiserfs_read_link(void *ns, void *_node, char *buffer, - size_t *bufferSize); - -} // extern "C" - -/* vnode_ops struct. Fill this in to tell the kernel how to call - functions in your driver. -*/ - -vnode_ops fs_entry = { - &reiserfs_read_vnode, // read_vnode - &reiserfs_write_vnode, // write_vnode - NULL, // remove_vnode - NULL, // secure_vnode (not needed) - &reiserfs_walk, // walk - &reiserfs_access, // access - NULL, // create - NULL, // mkdir - NULL, // symlink - NULL, // link - NULL, // rename - NULL, // unlink - NULL, // rmdir - &reiserfs_read_link, // readlink - &reiserfs_open_dir, // opendir - &reiserfs_close_dir, // closedir - &reiserfs_free_dir_cookie, // free_dircookie - &reiserfs_rewind_dir, // rewinddir - &reiserfs_read_dir, // readdir - &reiserfs_open, // open file - &reiserfs_close, // close file - &reiserfs_free_cookie, // free cookie - &reiserfs_read, // read file - NULL, // write file - NULL, // readv - NULL, // writev - NULL, // ioctl - NULL, // setflags file - &reiserfs_read_stat, // read stat - NULL, // write stat - NULL, // fsync - NULL, // initialize - &reiserfs_mount, // mount - &reiserfs_unmount, // unmount - NULL, // sync - &reiserfs_read_fs_stat, // read fs stat - NULL, // write fs stat - NULL, // select - NULL, // deselect - - NULL, // open index dir - NULL, // close index dir - NULL, // free index dir cookie - NULL, // rewind index dir - NULL, // read index dir - NULL, // create index - NULL, // remove index - NULL, // rename index - NULL, // stat index - - NULL, // open attr dir - NULL, // close attr dir - NULL, // free attr dir cookie - NULL, // rewind attr dir - NULL, // read attr dir - NULL, // write attr - NULL, // read attr - NULL, // remove attr - NULL, // rename attr - NULL, // stat attr - - NULL, // open query - NULL, // close query - NULL, // free query cookie - NULL, // read query -}; - -int32 api_version = B_CUR_FS_API_VERSION; - -static char *kFSName = "reiserfs"; -static const size_t kOptimalIOSize = 65536; - // reiserfs_mount -static -int -reiserfs_mount(nspace_id nsid, const char *device, ulong flags, - void *parameters, size_t len, void **data, vnode_id *rootID) +static status_t +reiserfs_mount(mount_id nsid, const char *device, uint32 flags, + const char *parameters, fs_volume *data, vnode_id *rootID) { - TOUCH(flags); TOUCH(parameters); TOUCH(len); - init_debugging(); + TOUCH(flags); TOUCH(parameters); FUNCTION_START(); // parameters are ignored for now status_t error = B_OK; + // allocate and init the volume Volume *volume = new(nothrow) Volume; if (!volume) error = B_NO_MEMORY; if (error == B_OK) error = volume->Mount(nsid, device); + // set the results if (error == B_OK) { *rootID = volume->GetRootVNode()->GetID(); *data = volume; } + // cleanup on failure if (error != B_OK && volume) delete volume; @@ -185,79 +83,55 @@ } // reiserfs_unmount -static -int -reiserfs_unmount(void *ns) +static status_t +reiserfs_unmount(fs_volume fs) { FUNCTION_START(); - Volume *volume = (Volume*)ns; + Volume *volume = (Volume*)fs; status_t error = volume->Unmount(); if (error == B_OK) delete volume; RETURN_ERROR(error); - exit_debugging(); } -// reiserfs_read_vnode -static -int -reiserfs_read_vnode(void *ns, vnode_id vnid, char reenter, void **node) +// reiserfs_read_fs_info +static status_t +reiserfs_read_fs_info(fs_volume fs, struct fs_info *info) { - TOUCH(reenter); -// FUNCTION_START(); - FUNCTION(("(%Ld: %lu, %ld)\n", vnid, VNode::GetDirIDFor(vnid), - VNode::GetObjectIDFor(vnid))); - Volume *volume = (Volume*)ns; - status_t error = B_OK; - VNode *foundNode = new(nothrow) VNode; - if (foundNode) { - error = volume->FindVNode(vnid, foundNode); - if (error == B_OK) - *node = foundNode; - else - delete foundNode;; - } else - error = B_NO_MEMORY; - RETURN_ERROR(error); + FUNCTION_START(); + Volume *volume = (Volume*)fs; + info->flags = B_FS_IS_PERSISTENT | B_FS_IS_READONLY; + info->block_size = volume->GetBlockSize(); + info->io_size = kOptimalIOSize; + info->total_blocks = volume->CountBlocks(); + info->free_blocks = volume->CountFreeBlocks(); + strncpy(info->device_name, volume->GetDeviceName(), + sizeof(info->device_name)); + strncpy(info->volume_name, volume->GetName(), sizeof(info->volume_name)); + return B_OK; } -// reiserfs_write_vnode -static -int -reiserfs_write_vnode(void *ns, void *_node, char reenter) -{ - TOUCH(reenter); -// DANGER: If dbg_printf() is used, this thread will enter another FS and -// even perform a write operation. The is dangerous here, since this hook -// may be called out of the other FSs, since, for instance a put_vnode() -// called from another FS may cause the VFS layer to free vnodes and thus -// invoke this hook. -// FUNCTION_START(); - Volume *volume = (Volume*)ns; - VNode *node = (VNode*)_node; - status_t error = B_OK; - if (node != volume->GetRootVNode()) - delete node; -// RETURN_ERROR(error); - return error; -} -// reiserfs_walk -static -int -reiserfs_walk(void *ns, void *_dir, const char *entryName, char **resolvedPath, - vnode_id *vnid) +// #pragma mark - VNodes + + +// reiserfs_lookup +static status_t +reiserfs_lookup(fs_volume fs, fs_vnode _dir, const char *entryName, + vnode_id *vnid, int *type) { // FUNCTION_START(); - Volume *volume = (Volume*)ns; + Volume *volume = (Volume*)fs; VNode *dir = (VNode*)_dir; FUNCTION(("dir: (%Ld: %lu, %lu), entry: `%s'\n", dir->GetID(), dir->GetDirID(), dir->GetObjectID(), entryName)); status_t error = B_OK; VNode *entryNode = NULL; + // check for non-directories if (!dir->IsDir()) { error = B_ENTRY_NOT_FOUND; + // special entries: "." and ".." } else if (!strcmp(entryName, ".")) { *vnid = dir->GetID(); @@ -267,11 +141,13 @@ *vnid = dir->GetParentID(); if (volume->GetVNode(*vnid, &entryNode) != B_OK) error = B_BAD_VALUE; + // ordinary entries } else { // find the entry VNode foundNode; error = volume->FindDirEntry(dir, entryName, &foundNode, true); + // hide non-file/dir/symlink entries, if the user desires that, and // those entries explicitly set to hidden [... truncated: 593 lines follow ...] From bonefish at mail.berlios.de Sun Mar 11 22:23:41 2007 From: bonefish at mail.berlios.de (bonefish at BerliOS) Date: Sun, 11 Mar 2007 22:23:41 +0100 Subject: [Haiku-commits] r20373 - in haiku/trunk/src/tests/add-ons/kernel/file_systems/userlandfs/reiserfs: . beos_interface Message-ID: <200703112123.l2BLNfhH017550@sheep.berlios.de> Author: bonefish Date: 2007-03-11 22:23:40 +0100 (Sun, 11 Mar 2007) New Revision: 20373 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20373&view=rev Added: haiku/trunk/src/tests/add-ons/kernel/file_systems/userlandfs/reiserfs/beos_interface/ haiku/trunk/src/tests/add-ons/kernel/file_systems/userlandfs/reiserfs/beos_interface/Jamfile Modified: haiku/trunk/src/tests/add-ons/kernel/file_systems/userlandfs/reiserfs/Jamfile Log: We can build the ReiserFS add-on with Haiku interface for the userland, too. Modified: haiku/trunk/src/tests/add-ons/kernel/file_systems/userlandfs/reiserfs/Jamfile =================================================================== --- haiku/trunk/src/tests/add-ons/kernel/file_systems/userlandfs/reiserfs/Jamfile 2007-03-11 21:22:34 UTC (rev 20372) +++ haiku/trunk/src/tests/add-ons/kernel/file_systems/userlandfs/reiserfs/Jamfile 2007-03-11 21:23:40 UTC (rev 20373) @@ -1,38 +1,39 @@ SubDir HAIKU_TOP src tests add-ons kernel file_systems userlandfs reiserfs ; +local userlandFSTop = [ FDirName $(HAIKU_TOP) src add-ons kernel file_systems + userlandfs ] ; local userlandFSIncludes = [ PrivateHeaders userlandfs ] ; -local reiserFSTop = [ FDirName $(HAIKU_TOP) src tests add-ons kernel - file_systems userlandfs r5 src test reiserfs ] ; +local reiserFSTop = [ FDirName $(HAIKU_TOP) src add-ons kernel file_systems + reiserfs ] ; DEFINES += USER=1 ; -SubDirSysHdrs [ FDirName $(userlandFSIncludes) ] ; -SubDirSysHdrs [ FDirName $(userlandFSIncludes) legacy ] ; +SubDirHdrs [ FDirName $(userlandFSIncludes) shared ] ; -# avoid inclusion of -DEFINES += _DRIVERS_SELECT_H ; - SEARCH_SOURCE += $(reiserFSTop) ; +SEARCH_SOURCE += [ FDirName $(userlandFSTop) shared ] ; Addon reiserfs : # relpath - obsolete : + Debug.cpp + Locker.cpp + String.cpp + Block.cpp BlockCache.cpp hashes.cpp Item.cpp Iterators.cpp kernel_interface.cpp - Locker.cpp + Settings.cpp + SuperBlock.cpp Tree.cpp VNode.cpp Volume.cpp - Debug.cpp - Settings.cpp - String.cpp - SuperBlock.cpp - : false # is executable - : libuserlandfs_beos_kernel.so + : libuserlandfs_haiku_kernel.so ; + +HaikuSubInclude beos_interface ; Copied: haiku/trunk/src/tests/add-ons/kernel/file_systems/userlandfs/reiserfs/beos_interface/Jamfile (from rev 20367, haiku/trunk/src/tests/add-ons/kernel/file_systems/userlandfs/reiserfs/Jamfile) =================================================================== --- haiku/trunk/src/tests/add-ons/kernel/file_systems/userlandfs/reiserfs/Jamfile 2007-03-11 15:04:53 UTC (rev 20367) +++ haiku/trunk/src/tests/add-ons/kernel/file_systems/userlandfs/reiserfs/beos_interface/Jamfile 2007-03-11 21:23:40 UTC (rev 20373) @@ -0,0 +1,39 @@ +SubDir HAIKU_TOP src tests add-ons kernel file_systems userlandfs reiserfs + beos_interface ; + +local userlandFSIncludes = [ PrivateHeaders userlandfs ] ; +local reiserFSTop = [ FDirName $(HAIKU_TOP) src tests add-ons kernel + file_systems userlandfs r5 src test reiserfs ] ; + +DEFINES += USER=1 ; + +SubDirSysHdrs [ FDirName $(userlandFSIncludes) ] ; +SubDirSysHdrs [ FDirName $(userlandFSIncludes) legacy ] ; + +# avoid inclusion of +DEFINES += _DRIVERS_SELECT_H ; + +SEARCH_SOURCE += $(reiserFSTop) ; + +Addon reiserfs + : # relpath - obsolete + : + Block.cpp + BlockCache.cpp + hashes.cpp + Item.cpp + Iterators.cpp + kernel_interface.cpp + Locker.cpp + Tree.cpp + VNode.cpp + Volume.cpp + + Debug.cpp + Settings.cpp + String.cpp + SuperBlock.cpp + + : false # is executable + : libuserlandfs_beos_kernel.so +; From axeld at mail.berlios.de Mon Mar 12 00:17:29 2007 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Mon, 12 Mar 2007 00:17:29 +0100 Subject: [Haiku-commits] r20374 - haiku/trunk/src/system/kernel/cache Message-ID: <200703112317.l2BNHT25023030@sheep.berlios.de> Author: axeld Date: 2007-03-12 00:17:28 +0100 (Mon, 12 Mar 2007) New Revision: 20374 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20374&view=rev Modified: haiku/trunk/src/system/kernel/cache/block_cache.cpp Log: Cleanup: * NewBlock()/FreeBlock() are now symmetrical in that the former no longer inserts the block into the hash table. * delete_transaction() also no longer removes the transaction from the hash table. * cache_transaction_sync() now uses the new hash_remove_current() function. * minor other cleanup (like line breaks). Modified: haiku/trunk/src/system/kernel/cache/block_cache.cpp =================================================================== --- haiku/trunk/src/system/kernel/cache/block_cache.cpp 2007-03-11 21:23:40 UTC (rev 20373) +++ haiku/trunk/src/system/kernel/cache/block_cache.cpp 2007-03-11 23:17:28 UTC (rev 20374) @@ -1,5 +1,5 @@ /* - * Copyright 2004-2006, Axel D?rfler, axeld at pinc-software.de. All rights reserved. + * Copyright 2004-2007, Axel D?rfler, axeld at pinc-software.de. All rights reserved. * Distributed under the terms of the MIT License. */ @@ -102,7 +102,6 @@ static void delete_transaction(block_cache *cache, cache_transaction *transaction) { - hash_remove(cache->transaction_hash, transaction); if (cache->last_transaction == transaction) cache->last_transaction = NULL; @@ -149,7 +148,8 @@ // #pragma mark - block_cache -block_cache::block_cache(int _fd, off_t numBlocks, size_t blockSize, bool readOnly) +block_cache::block_cache(int _fd, off_t numBlocks, size_t blockSize, + bool readOnly) : hash(NULL), fd(_fd), @@ -165,7 +165,8 @@ if (hash == NULL) return; - transaction_hash = hash_init(16, 0, &transaction_compare, &::transaction_hash); + transaction_hash = hash_init(16, 0, &transaction_compare, + &::transaction_hash); if (transaction_hash == NULL) return; @@ -281,8 +282,10 @@ ASSERT(range != NULL); range->Free(this, block); - if (block->original_data != NULL || block->parent_data != NULL) - panic("block_cache::FreeBlock(): %p, %p\n", block->original_data, block->parent_data); + if (block->original_data != NULL || block->parent_data != NULL) { + panic("block_cache::FreeBlock(): %p, %p\n", block->original_data, + block->parent_data); + } #ifdef DEBUG_CHANGED Free(block->compare); @@ -295,6 +298,7 @@ } +/*! Allocates a new block for \a blockNumber, ready for use */ cached_block * block_cache::NewBlock(off_t blockNumber) { @@ -326,8 +330,6 @@ block->compare = NULL; #endif - hash_insert(hash, block); - return block; } @@ -338,7 +340,8 @@ TRACE(("block_cache: remove up to %ld unused blocks\n", count)); cached_block *next = NULL; - for (cached_block *block = unused_blocks.First(); block != NULL; block = next) { + for (cached_block *block = unused_blocks.First(); block != NULL; + block = next) { next = block->next; if (maxAccessed < block->accessed) @@ -404,14 +407,15 @@ } -// #pragma mark - +// #pragma mark - private block functions static void put_cached_block(block_cache *cache, cached_block *block) { #ifdef DEBUG_CHANGED - if (!block->is_dirty && block->compare != NULL && memcmp(block->current_data, block->compare, cache->block_size)) { + if (!block->is_dirty && block->compare != NULL + && memcmp(block->current_data, block->compare, cache->block_size)) { dprintf("new block:\n"); dump_block((const char *)block->current_data, 256, " "); dprintf("unchanged block:\n"); @@ -458,23 +462,40 @@ static void put_cached_block(block_cache *cache, off_t blockNumber) { - if (blockNumber < 0 || blockNumber >= cache->max_blocks) - panic("put_cached_block: invalid block number %lld (max %lld)", blockNumber, cache->max_blocks - 1); - + if (blockNumber < 0 || blockNumber >= cache->max_blocks) { + panic("put_cached_block: invalid block number %lld (max %lld)", + blockNumber, cache->max_blocks - 1); + } + cached_block *block = (cached_block *)hash_lookup(cache->hash, &blockNumber); if (block != NULL) put_cached_block(cache, block); } +/*! + Retrieves the block \a blockNumber from the hash table, if it's already + there, or reads it from the disk. + + \param _allocated tells you wether or not a new block has been allocated + to satisfy your request. + \param readBlock if \c false, the block will not be read in case it was + not already in the cache. The block you retrieve may contain random + data. +*/ static cached_block * -get_cached_block(block_cache *cache, off_t blockNumber, bool *allocated, bool readBlock = true) +get_cached_block(block_cache *cache, off_t blockNumber, bool *_allocated, + bool readBlock = true) { - if (blockNumber < 0 || blockNumber >= cache->max_blocks) - panic("get_cached_block: invalid block number %lld (max %lld)", blockNumber, cache->max_blocks - 1); + if (blockNumber < 0 || blockNumber >= cache->max_blocks) { + panic("get_cached_block: invalid block number %lld (max %lld)", + blockNumber, cache->max_blocks - 1); + return NULL; + } - cached_block *block = (cached_block *)hash_lookup(cache->hash, &blockNumber); - *allocated = false; + cached_block *block = (cached_block *)hash_lookup(cache->hash, + &blockNumber); + *_allocated = false; if (block == NULL) { // read block into cache @@ -482,8 +503,10 @@ if (block == NULL) return NULL; - *allocated = true; + hash_insert(cache->hash, block); + *_allocated = true; } else { + // TODO: currently, the data is always mapped in /* if (block->ref_count == 0 && block->current_data != NULL) { // see if the old block can be resurrected @@ -496,15 +519,16 @@ if (block->current_data == NULL) return NULL; - *allocated = true; + *_allocated = true; } */ } - if (*allocated && readBlock) { + if (*_allocated && readBlock) { int32 blockSize = cache->block_size; - if (read_pos(cache->fd, blockNumber * blockSize, block->current_data, blockSize) < blockSize) { + if (read_pos(cache->fd, blockNumber * blockSize, block->current_data, + blockSize) < blockSize) { hash_remove(cache->hash, block); cache->FreeBlock(block); FATAL(("could not read block %Ld\n", blockNumber)); @@ -525,24 +549,29 @@ } -/** Returns the writable block data for the requested blockNumber. - * If \a cleared is true, the block is not read from disk; an empty block - * is returned. - * This is the only method to insert a block into a transaction. It makes - * sure that the previous block contents are preserved in that case. - */ +/*! + Returns the writable block data for the requested blockNumber. + If \a cleared is true, the block is not read from disk; an empty block + is returned. + This is the only method to insert a block into a transaction. It makes + sure that the previous block contents are preserved in that case. +*/ static void * -get_writable_cached_block(block_cache *cache, off_t blockNumber, off_t base, off_t length, - int32 transactionID, bool cleared) +get_writable_cached_block(block_cache *cache, off_t blockNumber, off_t base, + off_t length, int32 transactionID, bool cleared) { - TRACE(("get_writable_cached_block(blockNumber = %Ld, transaction = %ld)\n", blockNumber, transactionID)); + TRACE(("get_writable_cached_block(blockNumber = %Ld, transaction = %ld)\n", + blockNumber, transactionID)); - if (blockNumber < 0 || blockNumber >= cache->max_blocks) - panic("get_writable_cached_block: invalid block number %lld (max %lld)", blockNumber, cache->max_blocks - 1); + if (blockNumber < 0 || blockNumber >= cache->max_blocks) { + panic("get_writable_cached_block: invalid block number %lld (max %lld)", + blockNumber, cache->max_blocks - 1); + } bool allocated; - cached_block *block = get_cached_block(cache, blockNumber, &allocated, !cleared); + cached_block *block = get_cached_block(cache, blockNumber, &allocated, + !cleared); if (block == NULL) return NULL; @@ -568,7 +597,8 @@ // get new transaction cache_transaction *transaction = lookup_transaction(cache, transactionID); if (transaction == NULL) { - panic("get_writable_cached_block(): invalid transaction %ld!\n", transactionID); + panic("get_writable_cached_block(): invalid transaction %ld!\n", + transactionID); put_cached_block(cache, block); return NULL; } @@ -601,7 +631,7 @@ // remember any previous contents for the parent transaction block->parent_data = cache->Allocate(); if (block->parent_data == NULL) { - // ToDo: maybe we should just continue the current transaction in this case... + // TODO: maybe we should just continue the current transaction in this case... FATAL(("could not allocate parent\n")); put_cached_block(cache, block); return NULL; @@ -621,20 +651,24 @@ static status_t -write_cached_block(block_cache *cache, cached_block *block, bool deleteTransaction) +write_cached_block(block_cache *cache, cached_block *block, + bool deleteTransaction) { cache_transaction *previous = block->previous_transaction; int32 blockSize = cache->block_size; - void *data = previous && block->original_data ? block->original_data : block->current_data; + void *data = previous && block->original_data + ? block->original_data : block->current_data; // we first need to write back changes from previous transactions TRACE(("write_cached_block(block %Ld)\n", block->block_number)); - ssize_t written = write_pos(cache->fd, block->block_number * blockSize, data, blockSize); + ssize_t written = write_pos(cache->fd, block->block_number * blockSize, + data, blockSize); if (written < blockSize) { - FATAL(("could not write back block %Ld (%s)\n", block->block_number, strerror(errno))); + FATAL(("could not write back block %Ld (%s)\n", block->block_number, + strerror(errno))); return B_IO_ERROR; } @@ -649,11 +683,15 @@ if (--previous->num_blocks == 0) { TRACE(("cache transaction %ld finished!\n", previous->id)); - if (previous->notification_hook != NULL) - previous->notification_hook(previous->id, previous->notification_data); + if (previous->notification_hook != NULL) { + previous->notification_hook(previous->id, + previous->notification_data); + } - if (deleteTransaction) + if (deleteTransaction) { + hash_remove(cache->transaction_hash, previous); delete_transaction(cache, previous); + } } } @@ -677,8 +715,10 @@ block_cache *cache = (block_cache *)_cache; BenaphoreLocker locker(&cache->lock); - if (cache->last_transaction && cache->last_transaction->open) - panic("last transaction (%ld) still open!\n", cache->last_transaction->id); + if (cache->last_transaction && cache->last_transaction->open) { + panic("last transaction (%ld) still open!\n", + cache->last_transaction->id); + } cache_transaction *transaction = new(nothrow) cache_transaction; if (transaction == NULL) @@ -706,17 +746,21 @@ hash_open(cache->transaction_hash, &iterator); cache_transaction *transaction; - while ((transaction = (cache_transaction *)hash_next(cache->transaction_hash, &iterator)) != NULL) { - // ToDo: fix hash interface to make this easier + while ((transaction = (cache_transaction *)hash_next( + cache->transaction_hash, &iterator)) != NULL) { + // close all earlier transactions which haven't been closed yet if (transaction->id <= id && !transaction->open) { + // write back all of their remaining dirty blocks while (transaction->num_blocks > 0) { - status = write_cached_block(cache, transaction->blocks.Head(), false); + status = write_cached_block(cache, transaction->blocks.Head(), + false); if (status != B_OK) return status; } + + hash_remove_current(cache->transaction_hash, &iterator); delete_transaction(cache, transaction); - hash_rewind(cache->transaction_hash, &iterator); } } @@ -726,7 +770,8 @@ extern "C" status_t -cache_end_transaction(void *_cache, int32 id, transaction_notification_hook hook, void *data) +cache_end_transaction(void *_cache, int32 id, + transaction_notification_hook hook, void *data) { block_cache *cache = (block_cache *)_cache; BenaphoreLocker locker(&cache->lock); @@ -814,16 +859,17 @@ block->transaction = NULL; } + hash_remove(cache->transaction_hash, transaction); delete_transaction(cache, transaction); return B_OK; } -/** Acknowledges the current parent transaction, and starts a new transaction - * from its sub transaction. - * The new transaction also gets a new transaction ID. - */ - +/*! + Acknowledges the current parent transaction, and starts a new transaction + from its sub transaction. + The new transaction also gets a new transaction ID. +*/ extern "C" int32 cache_detach_sub_transaction(void *_cache, int32 id, transaction_notification_hook hook, void *data) @@ -869,7 +915,8 @@ cache->Free(block->original_data); block->original_data = NULL; } - if (block->parent_data != NULL && block->parent_data != block->current_data) { + if (block->parent_data != NULL + && block->parent_data != block->current_data) { // we need to move this block over to the new transaction block->original_data = block->parent_data; if (last == NULL) @@ -924,7 +971,8 @@ if (block->original_data != NULL) { // the parent transaction didn't change the block, but the sub // transaction did - we need to revert from the original data - memcpy(block->current_data, block->original_data, cache->block_size); + memcpy(block->current_data, block->original_data, + cache->block_size); } } else if (block->parent_data != block->current_data) { // the block has been changed and must be restored @@ -985,8 +1033,8 @@ extern "C" status_t -cache_next_block_in_transaction(void *_cache, int32 id, uint32 *_cookie, off_t *_blockNumber, - void **_data, void **_unchangedData) +cache_next_block_in_transaction(void *_cache, int32 id, uint32 *_cookie, + off_t *_blockNumber, void **_data, void **_unchangedData) { cached_block *block = (cached_block *)*_cookie; block_cache *cache = (block_cache *)_cache; @@ -1063,7 +1111,8 @@ uint32 cookie = 0; cached_block *block; - while ((block = (cached_block *)hash_remove_first(cache->hash, &cookie)) != NULL) { + while ((block = (cached_block *)hash_remove_first(cache->hash, + &cookie)) != NULL) { cache->FreeBlock(block); } @@ -1071,7 +1120,8 @@ cookie = 0; cache_transaction *transaction; - while ((transaction = (cache_transaction *)hash_remove_first(cache->transaction_hash, &cookie)) != NULL) { + while ((transaction = (cache_transaction *)hash_remove_first( + cache->transaction_hash, &cookie)) != NULL) { delete transaction; } @@ -1082,7 +1132,8 @@ extern "C" void * block_cache_create(int fd, off_t numBlocks, size_t blockSize, bool readOnly) { - block_cache *cache = new(nothrow) block_cache(fd, numBlocks, blockSize, readOnly); + block_cache *cache = new(nothrow) block_cache(fd, numBlocks, blockSize, + readOnly); if (cache == NULL) return NULL; @@ -1212,12 +1263,20 @@ } +/*! + Changes the internal status of a writable block to \a dirty. This can be + helpful in case you realize you don't need to change that block anymore + for whatever reason. + + Note, you must only use this function on blocks that were acquired + writable! +*/ extern "C" status_t -block_cache_set_dirty(void *_cache, off_t blockNumber, bool isDirty, int32 transaction) +block_cache_set_dirty(void *_cache, off_t blockNumber, bool dirty, + int32 transaction) { - // not yet implemented - // Note, you must only use this function on blocks that were acquired writable! - if (isDirty) + // TODO: not yet implemented + if (dirty) panic("block_cache_set_dirty(): not yet implemented that way!\n"); return B_OK; From bonefish at mail.berlios.de Mon Mar 12 09:32:47 2007 From: bonefish at mail.berlios.de (bonefish at BerliOS) Date: Mon, 12 Mar 2007 09:32:47 +0100 Subject: [Haiku-commits] r20375 - haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server Message-ID: <200703120832.l2C8Wls3012652@sheep.berlios.de> Author: bonefish Date: 2007-03-12 09:32:47 +0100 (Mon, 12 Mar 2007) New Revision: 20375 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20375&view=rev Modified: haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/haiku_block_cache.cpp haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/haiku_hash.cpp haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/haiku_hash.h Log: Incorporated hash and block cache changes of r20368 and r20374. Modified: haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/haiku_block_cache.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/haiku_block_cache.cpp 2007-03-11 23:17:28 UTC (rev 20374) +++ haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/haiku_block_cache.cpp 2007-03-12 08:32:47 UTC (rev 20375) @@ -105,7 +105,6 @@ static void delete_transaction(block_cache *cache, cache_transaction *transaction) { - hash_remove(cache->transaction_hash, transaction); if (cache->last_transaction == transaction) cache->last_transaction = NULL; @@ -152,7 +151,8 @@ // #pragma mark - block_cache -block_cache::block_cache(int _fd, off_t numBlocks, size_t blockSize, bool readOnly) +block_cache::block_cache(int _fd, off_t numBlocks, size_t blockSize, + bool readOnly) : hash(NULL), fd(_fd), @@ -222,8 +222,10 @@ Free(block->current_data); block->current_data = NULL; - if (block->original_data != NULL || block->parent_data != NULL) - panic("block_cache::FreeBlock(): %p, %p\n", block->original_data, block->parent_data); + if (block->original_data != NULL || block->parent_data != NULL) { + panic("block_cache::FreeBlock(): %p, %p\n", block->original_data, + block->parent_data); + } #ifdef DEBUG_CHANGED Free(block->compare); @@ -233,6 +235,7 @@ } +/*! Allocates a new block for \a blockNumber, ready for use */ cached_block * block_cache::NewBlock(off_t blockNumber) { @@ -268,7 +271,6 @@ block->compare = NULL; #endif - hash_insert(hash, block); allocated_block_count++; return block; @@ -281,7 +283,8 @@ TRACE(("block_cache: remove up to %ld unused blocks\n", count)); cached_block *next = NULL; - for (cached_block *block = unused_blocks.First(); block != NULL; block = next) { + for (cached_block *block = unused_blocks.First(); block != NULL; + block = next) { next = block->next; if (maxAccessed < block->accessed) @@ -306,14 +309,15 @@ } -// #pragma mark - +// #pragma mark - private block functions static void put_cached_block(block_cache *cache, cached_block *block) { #ifdef DEBUG_CHANGED - if (!block->is_dirty && block->compare != NULL && memcmp(block->current_data, block->compare, cache->block_size)) { + if (!block->is_dirty && block->compare != NULL + && memcmp(block->current_data, block->compare, cache->block_size)) { dprintf("new block:\n"); dump_block((const char *)block->current_data, 256, " "); dprintf("unchanged block:\n"); @@ -344,8 +348,10 @@ static void put_cached_block(block_cache *cache, off_t blockNumber) { - if (blockNumber < 0 || blockNumber >= cache->max_blocks) - panic("put_cached_block: invalid block number %lld (max %lld)", blockNumber, cache->max_blocks - 1); + if (blockNumber < 0 || blockNumber >= cache->max_blocks) { + panic("put_cached_block: invalid block number %lld (max %lld)", + blockNumber, cache->max_blocks - 1); + } cached_block *block = (cached_block *)hash_lookup(cache->hash, &blockNumber); if (block != NULL) @@ -353,14 +359,29 @@ } +/*! + Retrieves the block \a blockNumber from the hash table, if it's already + there, or reads it from the disk. + + \param _allocated tells you wether or not a new block has been allocated + to satisfy your request. + \param readBlock if \c false, the block will not be read in case it was + not already in the cache. The block you retrieve may contain random + data. +*/ static cached_block * -get_cached_block(block_cache *cache, off_t blockNumber, bool *allocated, bool readBlock = true) +get_cached_block(block_cache *cache, off_t blockNumber, bool *_allocated, + bool readBlock = true) { - if (blockNumber < 0 || blockNumber >= cache->max_blocks) - panic("get_cached_block: invalid block number %lld (max %lld)", blockNumber, cache->max_blocks - 1); + if (blockNumber < 0 || blockNumber >= cache->max_blocks) { + panic("get_cached_block: invalid block number %lld (max %lld)", + blockNumber, cache->max_blocks - 1); + return NULL; + } - cached_block *block = (cached_block *)hash_lookup(cache->hash, &blockNumber); - *allocated = false; + cached_block *block = (cached_block *)hash_lookup(cache->hash, + &blockNumber); + *_allocated = false; if (block == NULL) { // read block into cache @@ -368,8 +389,10 @@ if (block == NULL) return NULL; - *allocated = true; + hash_insert(cache->hash, block); + *_allocated = true; } else { + // TODO: currently, the data is always mapped in /* if (block->ref_count == 0 && block->current_data != NULL) { // see if the old block can be resurrected @@ -382,15 +405,16 @@ if (block->current_data == NULL) return NULL; - *allocated = true; + *_allocated = true; } */ } - if (*allocated && readBlock) { + if (*_allocated && readBlock) { int32 blockSize = cache->block_size; - if (read_pos(cache->fd, blockNumber * blockSize, block->current_data, blockSize) < blockSize) { + if (read_pos(cache->fd, blockNumber * blockSize, block->current_data, + blockSize) < blockSize) { hash_remove(cache->hash, block); cache->FreeBlock(block); FATAL(("could not read block %Ld\n", blockNumber)); @@ -411,24 +435,29 @@ } -/** Returns the writable block data for the requested blockNumber. - * If \a cleared is true, the block is not read from disk; an empty block - * is returned. - * This is the only method to insert a block into a transaction. It makes - * sure that the previous block contents are preserved in that case. - */ +/*! + Returns the writable block data for the requested blockNumber. + If \a cleared is true, the block is not read from disk; an empty block + is returned. + This is the only method to insert a block into a transaction. It makes + sure that the previous block contents are preserved in that case. +*/ static void * -get_writable_cached_block(block_cache *cache, off_t blockNumber, off_t base, off_t length, - int32 transactionID, bool cleared) +get_writable_cached_block(block_cache *cache, off_t blockNumber, off_t base, + off_t length, int32 transactionID, bool cleared) { - TRACE(("get_writable_cached_block(blockNumber = %Ld, transaction = %ld)\n", blockNumber, transactionID)); + TRACE(("get_writable_cached_block(blockNumber = %Ld, transaction = %ld)\n", + blockNumber, transactionID)); - if (blockNumber < 0 || blockNumber >= cache->max_blocks) - panic("get_writable_cached_block: invalid block number %lld (max %lld)", blockNumber, cache->max_blocks - 1); + if (blockNumber < 0 || blockNumber >= cache->max_blocks) { + panic("get_writable_cached_block: invalid block number %lld (max %lld)", + blockNumber, cache->max_blocks - 1); + } bool allocated; - cached_block *block = get_cached_block(cache, blockNumber, &allocated, !cleared); + cached_block *block = get_cached_block(cache, blockNumber, &allocated, + !cleared); if (block == NULL) return NULL; @@ -454,7 +483,8 @@ // get new transaction cache_transaction *transaction = lookup_transaction(cache, transactionID); if (transaction == NULL) { - panic("get_writable_cached_block(): invalid transaction %ld!\n", transactionID); + panic("get_writable_cached_block(): invalid transaction %ld!\n", + transactionID); put_cached_block(cache, block); return NULL; } @@ -487,7 +517,7 @@ // remember any previous contents for the parent transaction block->parent_data = cache->Allocate(); if (block->parent_data == NULL) { - // ToDo: maybe we should just continue the current transaction in this case... + // TODO: maybe we should just continue the current transaction in this case... FATAL(("could not allocate parent\n")); put_cached_block(cache, block); return NULL; @@ -507,20 +537,24 @@ static status_t -write_cached_block(block_cache *cache, cached_block *block, bool deleteTransaction) +write_cached_block(block_cache *cache, cached_block *block, + bool deleteTransaction) { cache_transaction *previous = block->previous_transaction; int32 blockSize = cache->block_size; - void *data = previous && block->original_data ? block->original_data : block->current_data; + void *data = previous && block->original_data + ? block->original_data : block->current_data; // we first need to write back changes from previous transactions TRACE(("write_cached_block(block %Ld)\n", block->block_number)); - ssize_t written = write_pos(cache->fd, block->block_number * blockSize, data, blockSize); + ssize_t written = write_pos(cache->fd, block->block_number * blockSize, + data, blockSize); if (written < blockSize) { - FATAL(("could not write back block %Ld (%s)\n", block->block_number, strerror(errno))); + FATAL(("could not write back block %Ld (%s)\n", block->block_number, + strerror(errno))); return B_IO_ERROR; } @@ -535,11 +569,15 @@ if (--previous->num_blocks == 0) { TRACE(("cache transaction %ld finished!\n", previous->id)); - if (previous->notification_hook != NULL) - previous->notification_hook(previous->id, previous->notification_data); + if (previous->notification_hook != NULL) { + previous->notification_hook(previous->id, + previous->notification_data); + } - if (deleteTransaction) + if (deleteTransaction) { + hash_remove(cache->transaction_hash, previous); delete_transaction(cache, previous); + } } } @@ -563,8 +601,10 @@ block_cache *cache = (block_cache *)_cache; BenaphoreLocker locker(&cache->lock); - if (cache->last_transaction && cache->last_transaction->open) - panic("last transaction (%ld) still open!\n", cache->last_transaction->id); + if (cache->last_transaction && cache->last_transaction->open) { + panic("last transaction (%ld) still open!\n", + cache->last_transaction->id); + } cache_transaction *transaction = new(nothrow) cache_transaction; if (transaction == NULL) @@ -592,17 +632,21 @@ hash_open(cache->transaction_hash, &iterator); cache_transaction *transaction; - while ((transaction = (cache_transaction *)hash_next(cache->transaction_hash, &iterator)) != NULL) { - // ToDo: fix hash interface to make this easier + while ((transaction = (cache_transaction *)hash_next( + cache->transaction_hash, &iterator)) != NULL) { + // close all earlier transactions which haven't been closed yet if (transaction->id <= id && !transaction->open) { + // write back all of their remaining dirty blocks while (transaction->num_blocks > 0) { - status = write_cached_block(cache, transaction->blocks.Head(), false); + status = write_cached_block(cache, transaction->blocks.Head(), + false); if (status != B_OK) return status; } + + hash_remove_current(cache->transaction_hash, &iterator); delete_transaction(cache, transaction); - hash_rewind(cache->transaction_hash, &iterator); } } @@ -612,7 +656,8 @@ status_t -cache_end_transaction(void *_cache, int32 id, transaction_notification_hook hook, void *data) +cache_end_transaction(void *_cache, int32 id, + transaction_notification_hook hook, void *data) { block_cache *cache = (block_cache *)_cache; BenaphoreLocker locker(&cache->lock); @@ -700,16 +745,17 @@ block->transaction = NULL; } + hash_remove(cache->transaction_hash, transaction); delete_transaction(cache, transaction); return B_OK; } -/** Acknowledges the current parent transaction, and starts a new transaction - * from its sub transaction. - * The new transaction also gets a new transaction ID. - */ - +/*! + Acknowledges the current parent transaction, and starts a new transaction + from its sub transaction. + The new transaction also gets a new transaction ID. +*/ int32 cache_detach_sub_transaction(void *_cache, int32 id, transaction_notification_hook hook, void *data) @@ -755,7 +801,8 @@ cache->Free(block->original_data); block->original_data = NULL; } - if (block->parent_data != NULL && block->parent_data != block->current_data) { + if (block->parent_data != NULL + && block->parent_data != block->current_data) { // we need to move this block over to the new transaction block->original_data = block->parent_data; if (last == NULL) @@ -810,7 +857,8 @@ if (block->original_data != NULL) { // the parent transaction didn't change the block, but the sub // transaction did - we need to revert from the original data - memcpy(block->current_data, block->original_data, cache->block_size); + memcpy(block->current_data, block->original_data, + cache->block_size); } } else if (block->parent_data != block->current_data) { // the block has been changed and must be restored @@ -871,8 +919,8 @@ status_t -cache_next_block_in_transaction(void *_cache, int32 id, uint32 *_cookie, off_t *_blockNumber, - void **_data, void **_unchangedData) +cache_next_block_in_transaction(void *_cache, int32 id, uint32 *_cookie, + off_t *_blockNumber, void **_data, void **_unchangedData) { cached_block *block = (cached_block *)*_cookie; block_cache *cache = (block_cache *)_cache; @@ -949,7 +997,8 @@ uint32 cookie = 0; cached_block *block; - while ((block = (cached_block *)hash_remove_first(cache->hash, &cookie)) != NULL) { + while ((block = (cached_block *)hash_remove_first(cache->hash, + &cookie)) != NULL) { cache->FreeBlock(block); } @@ -957,7 +1006,8 @@ cookie = 0; cache_transaction *transaction; - while ((transaction = (cache_transaction *)hash_remove_first(cache->transaction_hash, &cookie)) != NULL) { + while ((transaction = (cache_transaction *)hash_remove_first( + cache->transaction_hash, &cookie)) != NULL) { delete transaction; } @@ -968,7 +1018,8 @@ void * block_cache_create(int fd, off_t numBlocks, size_t blockSize, bool readOnly) { - block_cache *cache = new(nothrow) block_cache(fd, numBlocks, blockSize, readOnly); + block_cache *cache = new(nothrow) block_cache(fd, numBlocks, blockSize, + readOnly); if (cache == NULL) return NULL; @@ -1098,12 +1149,20 @@ } +/*! + Changes the internal status of a writable block to \a dirty. This can be + helpful in case you realize you don't need to change that block anymore + for whatever reason. + + Note, you must only use this function on blocks that were acquired + writable! +*/ status_t -block_cache_set_dirty(void *_cache, off_t blockNumber, bool isDirty, int32 transaction) +block_cache_set_dirty(void *_cache, off_t blockNumber, bool dirty, + int32 transaction) { - // not yet implemented - // Note, you must only use this function on blocks that were acquired writable! - if (isDirty) + // TODO: not yet implemented + if (dirty) panic("block_cache_set_dirty(): not yet implemented that way!\n"); return B_OK; Modified: haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/haiku_hash.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/haiku_hash.cpp 2007-03-11 23:17:28 UTC (rev 20374) +++ haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/haiku_hash.cpp 2007-03-12 08:32:47 UTC (rev 20375) @@ -11,8 +11,9 @@ #include #include -#include +#include "kernel_emu.h" + #undef TRACE #define TRACE_HASH 0 #if TRACE_HASH @@ -21,13 +22,16 @@ # define TRACE(x) ; #endif +using UserlandFS::KernelEmu::dprintf; +using UserlandFS::KernelEmu::panic; + namespace UserlandFS { namespace HaikuKernelEmu { -// ToDo: the hashtable is not expanded when necessary (no load factor, no nothing) -// Could try to use pools instead of malloc() for the elements - might be -// faster than the current approach. +// TODO: the hashtable is not expanded when necessary (no load factor, nothing) +// resizing should be optional, though, in case the hash is used at times +// that forbid resizing. struct hash_table { struct hash_element **table; @@ -130,7 +134,8 @@ uint32 hash = table->hash_func(_element, NULL, table->table_size); void *element, *lastElement = NULL; - for (element = table->table[hash]; element != NULL; lastElement = element, element = NEXT(table, element)) { + for (element = table->table[hash]; element != NULL; + lastElement = element, element = NEXT(table, element)) { if (element == _element) { if (lastElement != NULL) { // connect the previous entry with the next one @@ -147,6 +152,40 @@ } +void +hash_remove_current(struct hash_table *table, struct hash_iterator *iterator) +{ + uint32 index = iterator->bucket; + void *element; + + if (iterator->current == NULL) + panic("hash_remove_current() called too early."); + + for (element = table->table[index]; index < table->table_size; index++) { + void *lastElement = NULL; + + while (element != NULL) { + if (element == iterator->current) { + iterator->current = lastElement; + + if (lastElement != NULL) { + // connect the previous entry with the next one + PUT_IN_NEXT(table, lastElement, NEXT(table, element)); + } else { + table->table[index] = (struct hash_element *)NEXT(table, + element); + } + + table->num_elements--; + return; + } + + element = NEXT(table, element); + } + } +} + + void * hash_remove_first(struct hash_table *table, uint32 *_cookie) { Modified: haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/haiku_hash.h =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/haiku_hash.h 2007-03-11 23:17:28 UTC (rev 20374) +++ haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/haiku_hash.h 2007-03-12 08:32:47 UTC (rev 20375) @@ -24,6 +24,7 @@ int hash_uninit(struct hash_table *table); status_t hash_insert(struct hash_table *table, void *_element); status_t hash_remove(struct hash_table *table, void *_element); +void hash_remove_current(struct hash_table *table, struct hash_iterator *iterator); void *hash_remove_first(struct hash_table *table, uint32 *_cookie); void *hash_find(struct hash_table *table, void *e); void *hash_lookup(struct hash_table *table, const void *key); @@ -32,17 +33,15 @@ void *hash_next(struct hash_table *table, struct hash_iterator *i); void hash_rewind(struct hash_table *table, struct hash_iterator *i); -/* function ptrs must look like this: +/* function pointers must look like this: * * uint32 hash_func(void *e, const void *key, uint32 range); * hash function should calculate hash on either e or key, - * depending on which one is not NULL + * depending on which one is not NULL - they also need + * to make sure the returned value is within range. * int compare_func(void *e, const void *key); * compare function should compare the element with * the key, returning 0 if equal, other if not - * NOTE: compare func can be null, in which case the hash - * code will compare the key pointer with the target - * ToDo: check this! */ uint32 hash_hash_string(const char *str); From threedeyes at mail.berlios.de Mon Mar 12 09:43:34 2007 From: threedeyes at mail.berlios.de (threedeyes at BerliOS) Date: Mon, 12 Mar 2007 09:43:34 +0100 Subject: [Haiku-commits] r20376 - haiku/trunk/src/add-ons/kernel/file_systems/ntfs Message-ID: <200703120843.l2C8hYJ9013187@sheep.berlios.de> Author: threedeyes Date: 2007-03-12 09:43:34 +0100 (Mon, 12 Mar 2007) New Revision: 20376 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20376&view=rev Modified: haiku/trunk/src/add-ons/kernel/file_systems/ntfs/fs_func.c Log: Added getting label of ntfs volume in fs_identify_partiton function. Modified: haiku/trunk/src/add-ons/kernel/file_systems/ntfs/fs_func.c =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/ntfs/fs_func.c 2007-03-12 08:32:47 UTC (rev 20375) +++ haiku/trunk/src/add-ons/kernel/file_systems/ntfs/fs_func.c 2007-03-12 08:43:34 UTC (rev 20376) @@ -45,6 +45,7 @@ typedef struct identify_cookie { NTFS_BOOT_SECTOR boot; + char label[256]; } identify_cookie; float @@ -52,16 +53,15 @@ { NTFS_BOOT_SECTOR boot; identify_cookie *cookie; + ntfs_volume *ntVolume; uint8 *buf=(uint8*)&boot; + char devpath[256]; // read in the boot sector ERRPRINT("fs_identify_partition: read in the boot sector\n"); if (read_pos(fd, 0, (void*)&boot, 512) != 512) { return -1; } - - // only check boot signature on hard disks to account for broken mtools - // behavior // check boot signature if (((buf[0x1fe] != 0x55) || (buf[0x1ff] != 0xaa)) && (buf[0x15] == 0xf8)) @@ -71,6 +71,14 @@ if (memcmp(buf+3, "NTFS ", 8)!=0) return -1; + //get path for device + if(!ioctl(fd,B_GET_PATH_FOR_DEVICE,devpath)) + return -1; + //try mount + ntVolume = utils_mount_volume(devpath,MS_RDONLY|MS_NOATIME,true); + if(!ntVolume) + return -1; + //allocate identify_cookie cookie = (identify_cookie *)malloc(sizeof(identify_cookie)); if (!cookie) @@ -78,6 +86,14 @@ memcpy(&(cookie->boot),&boot,512); + strcpy(cookie->label,"NTFS Volume"); + + if(ntVolume->vol_name) + if(strlen(ntVolume->vol_name)>0) + strcpy(cookie->label,ntVolume->vol_name); + + ntfs_device_umount( ntVolume, true ); + *_cookie = cookie; return 0.8f; @@ -91,7 +107,7 @@ partition->flags |= B_PARTITION_FILE_SYSTEM; partition->content_size = sle64_to_cpu(cookie->boot.number_of_sectors) * le16_to_cpu(cookie->boot.bpb.bytes_per_sector); partition->block_size = le16_to_cpu(cookie->boot.bpb.bytes_per_sector); - partition->content_name = strdup("NTFS Volume"); + partition->content_name = strdup(cookie->label); return B_OK; } From stefano.ceccherini at gmail.com Mon Mar 12 12:08:24 2007 From: stefano.ceccherini at gmail.com (Stefano Ceccherini) Date: Mon, 12 Mar 2007 12:08:24 +0100 Subject: [Haiku-commits] r20335 - haiku/trunk/src/apps/terminal In-Reply-To: <45F1B80E.3070802@earthlink.net> References: <45F1B80E.3070802@earthlink.net> Message-ID: <894b9700703120408w43857db2lc9b65b062841b332@mail.gmail.com> 2007/3/9, DarkWyrm : > Here's a possible reason for redefining Command+W: window feel. If a > window has the Modal feel, regardless of which version, it disables this > shortcut under R5. And what happens under haiku ? From darkwyrm at earthlink.net Mon Mar 12 12:54:42 2007 From: darkwyrm at earthlink.net (DarkWyrm) Date: Mon, 12 Mar 2007 07:54:42 -0400 EDT Subject: [Haiku-commits] r20335 - haiku/trunk/src/apps/terminal In-Reply-To: <894b9700703120408w43857db2lc9b65b062841b332@mail.gmail.com> Message-ID: <921213954-BeMail@sapphire> > 2007/3/9, DarkWyrm : > > Here's a possible reason for redefining Command+W: window feel. If > > a > > window has the Modal feel, regardless of which version, it disables > > this > > shortcut under R5. > > And what happens under haiku ? Don't know. Never tested it that way -- I figured that Be did it that way on purpose for whatever reason. I take it this would more likely be a bug? --DW From axeld at pinc-software.de Mon Mar 12 13:02:11 2007 From: axeld at pinc-software.de (Axel =?iso-8859-15?q?D=F6rfler?=) Date: Mon, 12 Mar 2007 13:02:11 +0100 CET Subject: [Haiku-commits] r20335 - haiku/trunk/src/apps/terminal In-Reply-To: <921213954-BeMail@sapphire> Message-ID: <14521207163-BeMail@zon> "DarkWyrm" wrote: > > And what happens under haiku ? > Don't know. Never tested it that way -- I figured that Be did it that > way on purpose for whatever reason. I take it this would more likely > be > a bug? For your convenience, src/kits/interface/Window.cpp, line 2370: if ((fFlags & B_NOT_CLOSABLE) == 0 && !IsModal()) { // Modal windows default to non-closable, but you can add the shortcut manually, // if a different behaviour is wanted AddShortcut('W', B_COMMAND_KEY, new BMessage(B_QUIT_REQUESTED)); } IOW Haiku does the same thing. Bye, Axel. From bonefish at mail.berlios.de Mon Mar 12 13:23:46 2007 From: bonefish at mail.berlios.de (bonefish at BerliOS) Date: Mon, 12 Mar 2007 13:23:46 +0100 Subject: [Haiku-commits] r20377 - haiku/trunk/src/system/kernel/cache Message-ID: <200703121223.l2CCNkep012310@sheep.berlios.de> Author: bonefish Date: 2007-03-12 13:23:45 +0100 (Mon, 12 Mar 2007) New Revision: 20377 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20377&view=rev Modified: haiku/trunk/src/system/kernel/cache/file_cache.cpp Log: Reordered somewhat unhealthy looking if-construct (first "currentPage->state == ..." then "currentPage != NULL"). Modified: haiku/trunk/src/system/kernel/cache/file_cache.cpp =================================================================== --- haiku/trunk/src/system/kernel/cache/file_cache.cpp 2007-03-12 08:43:34 UTC (rev 20376) +++ haiku/trunk/src/system/kernel/cache/file_cache.cpp 2007-03-12 12:23:45 UTC (rev 20377) @@ -902,7 +902,11 @@ // check if the dummy page is still in place restart_dummy_lookup: vm_page *currentPage = vm_cache_lookup_page(cache, offset); - if (currentPage->state == PAGE_STATE_BUSY) { + if (currentPage == NULL) { + // there is no page in place anymore, we'll put ours + // into it + vm_cache_insert_page(cache, page, offset); + } else if (currentPage->state == PAGE_STATE_BUSY) { if (currentPage->type == PAGE_TYPE_DUMMY) { // we let the other party add our page currentPage->queue_next = page; @@ -913,7 +917,7 @@ mutex_lock(&cache->lock); goto restart_dummy_lookup; } - } else if (currentPage != NULL) { + } else { // we need to copy our new page into the old one addr_t destinationAddress; vm_get_physical_page(page->physical_page_number * B_PAGE_SIZE, @@ -927,9 +931,6 @@ vm_put_physical_page(virtualAddress); vm_page_set_state(page, PAGE_STATE_FREE); - } else { - // there is no page in place anymore, we'll put ours into it - vm_cache_insert_page(cache, page, offset); } } From axeld at pinc-software.de Mon Mar 12 14:45:20 2007 From: axeld at pinc-software.de (Axel =?iso-8859-15?q?D=F6rfler?=) Date: Mon, 12 Mar 2007 14:45:20 +0100 CET Subject: [Haiku-commits] r20377 - haiku/trunk/src/system/kernel/cache In-Reply-To: <200703121223.l2CCNkep012310@sheep.berlios.de> Message-ID: <20710274177-BeMail@zon> bonefish at BerliOS wrote: > Log: > Reordered somewhat unhealthy looking if-construct (first > "currentPage->state == ..." then "currentPage != NULL"). Oops, thanks! :-) Bye, Axel. From mmu_man at mail.berlios.de Mon Mar 12 15:46:46 2007 From: mmu_man at mail.berlios.de (mmu_man at BerliOS) Date: Mon, 12 Mar 2007 15:46:46 +0100 Subject: [Haiku-commits] r20378 - haiku/trunk/src/bin Message-ID: <200703121446.l2CEkkRH028892@sheep.berlios.de> Author: mmu_man Date: 2007-03-12 15:46:45 +0100 (Mon, 12 Mar 2007) New Revision: 20378 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20378&view=rev Modified: haiku/trunk/src/bin/urlwrapper.cpp haiku/trunk/src/bin/urlwrapper.rdef Log: Support for a query: url type :) (still needs unencoding of quotes) Modified: haiku/trunk/src/bin/urlwrapper.cpp =================================================================== --- haiku/trunk/src/bin/urlwrapper.cpp 2007-03-12 12:23:45 UTC (rev 20377) +++ haiku/trunk/src/bin/urlwrapper.cpp 2007-03-12 14:46:45 UTC (rev 20378) @@ -11,6 +11,7 @@ #include #define HANDLE_FILE +#define HANDLE_QUERY //#define HANDLE_MID_CID // http://www.rfc-editor.org/rfc/rfc2392.txt query MAIL:cid #define HANDLE_SH #define HANDLE_BESHARE @@ -334,6 +335,41 @@ } #endif +#ifdef HANDLE_QUERY + // XXX:TODO + if (u.proto == "query") { + // mktemp ? + BString qname("/tmp/query-url-temp-"); + qname << getpid() << "-" << system_time(); + BFile query(qname.String(), O_CREAT|O_EXCL); + // XXX: should check for failure + + BString s; + int32 v; + + // TODO: + // UnurlString(full); + // TODO: handle options (list of attrs in the column, ...) + + v = 'qybF'; // QuerY By Formula XXX: any #define for that ? + query.WriteAttr("_trk/qryinitmode", B_INT32_TYPE, 0LL, &v, sizeof(v)); + s = "TextControl"; + query.WriteAttr("_trk/focusedView", B_STRING_TYPE, 0LL, s.String(), s.Length()+1); + s = u.full; + query.WriteAttr("_trk/qryinitstr", B_STRING_TYPE, 0LL, s.String(), s.Length()+1); + query.WriteAttr("_trk/qrystr", B_STRING_TYPE, 0LL, s.String(), s.Length()+1); + s = "application/x-vnd.Be-query"; + query.WriteAttr("BEOS:TYPE", 'MIMS', 0LL, s.String(), s.Length()+1); + + + BEntry e(qname.String()); + entry_ref er; + if (e.GetRef(&er) >= B_OK) + be_roster->Launch(&er); + return; + } +#endif + #ifdef HANDLE_SH if (u.proto == "sh") { BString cmd(u.Full()); @@ -402,7 +438,7 @@ #ifdef HANDLE_AUDIO // TODO #endif - + // vnc: ? // irc: ? // @@ -415,7 +451,8 @@ // // itps: pcast: podcast: s//http/ + parse xml to get url to mp3 stream... // audio: s//http:/ + default MediaPlayer -- see http://forums.winamp.com/showthread.php?threadid=233130 - // + // + // gps: ? I should submit an RFC for that one :) } Modified: haiku/trunk/src/bin/urlwrapper.rdef =================================================================== --- haiku/trunk/src/bin/urlwrapper.rdef 2007-03-12 12:23:45 UTC (rev 20377) +++ haiku/trunk/src/bin/urlwrapper.rdef 2007-03-12 14:46:45 UTC (rev 20378) @@ -10,9 +10,11 @@ "types" = "application/x-vnd.Be.URL.finger", "types" = "application/x-vnd.Be.URL.sh", "types" = "application/x-vnd.Be.URL.file", + "types" = "application/x-vnd.Be.URL.query", "types" = "application/x-vnd.Be.URL.beshare", "types" = "application/x-vnd.Be.URL.mms", "types" = "application/x-vnd.Be.URL.rtp", - "types" = "application/x-vnd.Be.URL.rtsp" + "types" = "application/x-vnd.Be.URL.rtsp", + "types" = "application/x-vnd.Be.URL.audio" }; From jackburton at mail.berlios.de Mon Mar 12 21:52:22 2007 From: jackburton at mail.berlios.de (jackburton at BerliOS) Date: Mon, 12 Mar 2007 21:52:22 +0100 Subject: [Haiku-commits] r20379 - haiku/trunk/src/preferences/fonts Message-ID: <200703122052.l2CKqMic001622@sheep.berlios.de> Author: jackburton Date: 2007-03-12 21:52:21 +0100 (Mon, 12 Mar 2007) New Revision: 20379 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20379&view=rev Modified: haiku/trunk/src/preferences/fonts/FontSelectionView.cpp haiku/trunk/src/preferences/fonts/FontSelectionView.h haiku/trunk/src/preferences/fonts/FontView.cpp haiku/trunk/src/preferences/fonts/FontView.h haiku/trunk/src/preferences/fonts/MainWindow.cpp Log: Fixed font sensitiveness issues in the Fonts preflet. Patch by Lucasz Zemczak. Modified: haiku/trunk/src/preferences/fonts/FontSelectionView.cpp =================================================================== --- haiku/trunk/src/preferences/fonts/FontSelectionView.cpp 2007-03-12 14:46:45 UTC (rev 20378) +++ haiku/trunk/src/preferences/fonts/FontSelectionView.cpp 2007-03-12 20:52:21 UTC (rev 20379) @@ -88,10 +88,10 @@ AddChild(fFontsMenuField); // size menu - rect.right = rect.left + StringWidth("99") + 40; + rect.right = rect.left + StringWidth("Size: 99") + 30.0f; fSizesMenuField = new BMenuField(rect, "sizes", "Size:", fSizesMenu, true, - B_FOLLOW_RIGHT | B_FOLLOW_TOP); - fSizesMenuField->SetDivider(StringWidth(fSizesMenuField->Label()) + 5.0); + B_FOLLOW_TOP); + fSizesMenuField->SetDivider(StringWidth(fSizesMenuField->Label()) + 5.0f); fSizesMenuField->SetAlignment(B_ALIGN_RIGHT); fSizesMenuField->ResizeToPreferred(); rect = Bounds(); @@ -166,6 +166,20 @@ void +FontSelectionView::RelayoutIfNeeded() +{ + float width, height; + GetPreferredSize(&width, &height); + + if (width > Bounds().Width()) { + fSizesMenuField->MoveTo(fMaxFontNameWidth + fDivider + 40.0f, + fFontsMenuField->Bounds().top); + ResizeTo(width, height); + } +} + + +void FontSelectionView::AttachedToWindow() { if (Parent() != NULL) Modified: haiku/trunk/src/preferences/fonts/FontSelectionView.h =================================================================== --- haiku/trunk/src/preferences/fonts/FontSelectionView.h 2007-03-12 14:46:45 UTC (rev 20378) +++ haiku/trunk/src/preferences/fonts/FontSelectionView.h 2007-03-12 20:52:21 UTC (rev 20379) @@ -30,6 +30,7 @@ virtual void MessageReceived(BMessage *msg); void SetDivider(float divider); + void RelayoutIfNeeded(); void SetDefaults(); void Revert(); Modified: haiku/trunk/src/preferences/fonts/FontView.cpp =================================================================== --- haiku/trunk/src/preferences/fonts/FontView.cpp 2007-03-12 14:46:45 UTC (rev 20378) +++ haiku/trunk/src/preferences/fonts/FontView.cpp 2007-03-12 20:52:21 UTC (rev 20379) @@ -85,6 +85,15 @@ } +void +FontView::RelayoutIfNeeded() +{ + fPlainView->RelayoutIfNeeded(); + fBoldView->RelayoutIfNeeded(); + fFixedView->RelayoutIfNeeded(); +} + + bool FontView::IsRevertable() { Modified: haiku/trunk/src/preferences/fonts/FontView.h =================================================================== --- haiku/trunk/src/preferences/fonts/FontView.h 2007-03-12 14:46:45 UTC (rev 20378) +++ haiku/trunk/src/preferences/fonts/FontView.h 2007-03-12 20:52:21 UTC (rev 20379) @@ -23,6 +23,7 @@ void SetDefaults(); void Revert(); void UpdateFonts(); + void RelayoutIfNeeded(); bool IsRevertable(); Modified: haiku/trunk/src/preferences/fonts/MainWindow.cpp =================================================================== --- haiku/trunk/src/preferences/fonts/MainWindow.cpp 2007-03-12 14:46:45 UTC (rev 20378) +++ haiku/trunk/src/preferences/fonts/MainWindow.cpp 2007-03-12 20:52:21 UTC (rev 20379) @@ -61,6 +61,8 @@ tabView->AddTab(fFontsView); + fFontsView->UpdateFonts(); + fFontsView->RelayoutIfNeeded(); float width, height; fFontsView->GetPreferredSize(&width, &height); From korli at mail.berlios.de Tue Mar 13 01:32:49 2007 From: korli at mail.berlios.de (korli at BerliOS) Date: Tue, 13 Mar 2007 01:32:49 +0100 Subject: [Haiku-commits] r20380 - haiku/trunk/src/system/kernel/arch/x86 Message-ID: <200703130032.l2D0WnSa024884@sheep.berlios.de> Author: korli Date: 2007-03-13 01:32:48 +0100 (Tue, 13 Mar 2007) New Revision: 20380 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20380&view=rev Modified: haiku/trunk/src/system/kernel/arch/x86/arch_cpu.c Log: added checks to trick the gcc4 compiler. this way the label is kept. Modified: haiku/trunk/src/system/kernel/arch/x86/arch_cpu.c =================================================================== --- haiku/trunk/src/system/kernel/arch/x86/arch_cpu.c 2007-03-12 20:52:21 UTC (rev 20379) +++ haiku/trunk/src/system/kernel/arch/x86/arch_cpu.c 2007-03-13 00:32:48 UTC (rev 20380) @@ -587,6 +587,10 @@ char *tmp = (char *)to; char *s = (char *)from; + // this check is to trick the gcc4 compiler and have it keep the error label + if (to == NULL) + goto error; + *faultHandler = (addr_t)&&error; while (size--) @@ -606,6 +610,10 @@ { int fromLength = 0; + // this check is to trick the gcc4 compiler and have it keep the error label + if (to == NULL) + goto error; + *faultHandler = (addr_t)&&error; if (size > 0) { @@ -635,6 +643,10 @@ { char *xs = (char *)s; + // this check is to trick the gcc4 compiler and have it keep the error label + if (s == NULL) + goto error; + *faultHandler = (addr_t)&&error; while (count--) From bonefish at cs.tu-berlin.de Tue Mar 13 11:25:36 2007 From: bonefish at cs.tu-berlin.de (Ingo Weinhold) Date: Tue, 13 Mar 2007 11:25:36 +0100 Subject: [Haiku-commits] r20380 - haiku/trunk/src/system/kernel/arch/x86 In-Reply-To: <200703130032.l2D0WnSa024884@sheep.berlios.de> References: <200703130032.l2D0WnSa024884@sheep.berlios.de> Message-ID: <20070313112536.2741.2@cs.tu-berlin.de> On 2007-03-13 at 01:32:49 [+0100], korli at BerliOS wrote: > Author: korli > Date: 2007-03-13 01:32:48 +0100 (Tue, 13 Mar 2007) > New Revision: 20380 > ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20380&view=rev > > Modified: > haiku/trunk/src/system/kernel/arch/x86/arch_cpu.c > Log: > added checks to trick the gcc4 compiler. this way the label is kept. Was that indeed the problem? > Modified: haiku/trunk/src/system/kernel/arch/x86/arch_cpu.c > =================================================================== > --- haiku/trunk/src/system/kernel/arch/x86/arch_cpu.c 2007-03-12 > 20:52:21 UTC (rev 20379) > +++ haiku/trunk/src/system/kernel/arch/x86/arch_cpu.c 2007-03-13 > 00:32:48 UTC (rev 20380) > @@ -587,6 +587,10 @@ > char *tmp = (char *)to; > char *s = (char *)from; > > + // this check is to trick the gcc4 compiler and have it keep the error > label > + if (to == NULL) > + goto error; > + > *faultHandler = (addr_t)&&error; For PPC I've used a more generic, and IMHO nicer solution: if (ppc_set_fault_handler(faultHandler, (addr_t)&&error)) goto error; With the (not inlineable) function being implemented like this: bool ppc_set_fault_handler(addr_t *handlerLocation, addr_t handler) { *handlerLocation = handler; return false; } It could be moved to the architecture independent part. CU, Ingo From jackburton at mail.berlios.de Tue Mar 13 12:14:48 2007 From: jackburton at mail.berlios.de (jackburton at BerliOS) Date: Tue, 13 Mar 2007 12:14:48 +0100 Subject: [Haiku-commits] r20381 - in haiku/trunk: headers/private/interface src/kits/interface Message-ID: <200703131114.l2DBEmcn016264@sheep.berlios.de> Author: jackburton Date: 2007-03-13 12:14:47 +0100 (Tue, 13 Mar 2007) New Revision: 20381 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20381&view=rev Modified: haiku/trunk/headers/private/interface/PictureDataWriter.h haiku/trunk/src/kits/interface/PictureDataWriter.cpp Log: Added support for font settings in PictureDataWriter. Not used yet Modified: haiku/trunk/headers/private/interface/PictureDataWriter.h =================================================================== --- haiku/trunk/headers/private/interface/PictureDataWriter.h 2007-03-13 00:32:48 UTC (rev 20380) +++ haiku/trunk/headers/private/interface/PictureDataWriter.h 2007-03-13 11:14:47 UTC (rev 20381) @@ -46,6 +46,16 @@ const int32 &bytesPerRow, const int32 &colorSpace, const int32 &flags, const void *data, const int32 &length); + status_t WriteSetFontFamily(const font_family &family); + status_t WriteSetFontStyle(const font_style &style); + status_t WriteSetFontSpacing(const int32 &spacing); + status_t WriteSetFontSize(const float &size); + status_t WriteSetFontRotation(const float &rotation); + status_t WriteSetFontEncoding(const int32 &encoding); + status_t WriteSetFontFlags(const int32 &flags); + status_t WriteSetFontShear(const int32 &shear); + status_t WriteSetFontFace(const int32 &face); + status_t WritePushState(); status_t WritePopState(); Modified: haiku/trunk/src/kits/interface/PictureDataWriter.cpp =================================================================== --- haiku/trunk/src/kits/interface/PictureDataWriter.cpp 2007-03-13 00:32:48 UTC (rev 20380) +++ haiku/trunk/src/kits/interface/PictureDataWriter.cpp 2007-03-13 11:14:47 UTC (rev 20381) @@ -221,6 +221,96 @@ status_t +PictureDataWriter::WriteSetFontFamily(const font_family &family) +{ + /*BeginOp(B_PIC_SET_FONT_FAMILY); + Write( + EndOp();*/ + return B_OK; +} + + +status_t +PictureDataWriter::WriteSetFontStyle(const font_style &style) +{ + /*BeginOp(B_PIC_SET_FONT_STYLE); + Write( + EndOp();*/ + return B_OK; +} + + +status_t +PictureDataWriter::WriteSetFontSpacing(const int32 &spacing) +{ + BeginOp(B_PIC_SET_FONT_SPACING); + Write(spacing); + EndOp(); + return B_OK; +} + + +status_t +PictureDataWriter::WriteSetFontSize(const float &size) +{ + BeginOp(B_PIC_SET_FONT_SIZE); + Write(size); + EndOp(); + return B_OK; +} + + +status_t +PictureDataWriter::WriteSetFontRotation(const float &rotation) +{ + BeginOp(B_PIC_SET_FONT_ROTATE); + Write(rotation); + EndOp(); + return B_OK; +} + + +status_t +PictureDataWriter::WriteSetFontEncoding(const int32 &encoding) +{ + BeginOp(B_PIC_SET_FONT_ENCODING); + Write(encoding); + EndOp(); + return B_OK; +} + + +status_t +PictureDataWriter::WriteSetFontFlags(const int32 &flags) +{ + BeginOp(B_PIC_SET_FONT_FLAGS); + Write(flags); + EndOp(); + return B_OK; +} + + +status_t +PictureDataWriter::WriteSetFontShear(const int32 &shear) +{ + BeginOp(B_PIC_SET_FONT_SHEAR); + Write(shear); + EndOp(); + return B_OK; +} + + +status_t +PictureDataWriter::WriteSetFontFace(const int32 &face) +{ + BeginOp(B_PIC_SET_FONT_FACE); + Write(face); + EndOp(); + return B_OK; +} + + +status_t PictureDataWriter::WritePushState() { BeginOp(B_PIC_PUSH_STATE); @@ -229,7 +319,6 @@ } - status_t PictureDataWriter::WritePopState() { From korli at users.berlios.de Tue Mar 13 12:30:38 2007 From: korli at users.berlios.de (=?ISO-8859-1?Q?J=E9r=F4me_Duval?=) Date: Tue, 13 Mar 2007 12:30:38 +0100 Subject: [Haiku-commits] r20380 - haiku/trunk/src/system/kernel/arch/x86 In-Reply-To: <20070313112536.2741.2@cs.tu-berlin.de> References: <200703130032.l2D0WnSa024884@sheep.berlios.de> <20070313112536.2741.2@cs.tu-berlin.de> Message-ID: 2007/3/13, Ingo Weinhold : > > > On 2007-03-13 at 01:32:49 [+0100], korli at BerliOS > > wrote: > > Author: korli > > Date: 2007-03-13 01:32:48 +0100 (Tue, 13 Mar 2007) > > New Revision: 20380 > > ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20380&view=rev > > > > Modified: > > haiku/trunk/src/system/kernel/arch/x86/arch_cpu.c > > Log: > > added checks to trick the gcc4 compiler. this way the label is kept. > > Was that indeed the problem? Yes. Instead of looping, the debugger popup now comes up to show the problem with Tracker when quitting. > Modified: haiku/trunk/src/system/kernel/arch/x86/arch_cpu.c > > =================================================================== > > --- haiku/trunk/src/system/kernel/arch/x86/arch_cpu.c 2007-03-12 > > 20:52:21 UTC (rev 20379) > > +++ haiku/trunk/src/system/kernel/arch/x86/arch_cpu.c 2007-03-13 > > 00:32:48 UTC (rev 20380) > > @@ -587,6 +587,10 @@ > > char *tmp = (char *)to; > > char *s = (char *)from; > > > > + // this check is to trick the gcc4 compiler and have it keep the > error > > label > > + if (to == NULL) > > + goto error; > > + > > *faultHandler = (addr_t)&&error; > > For PPC I've used a more generic, and IMHO nicer solution: > > if (ppc_set_fault_handler(faultHandler, (addr_t)&&error)) > goto error; Personally, I don't think it's nicer. Here you're adding a function call for the purpose of tricking the branch tree of the compiler. Adding a goto instruction with a simple test which we know can't be true, but not the compiler, is the interesting part. I would even prefer a workaround which doesn't generate code at all, but it seems not possible AFAIK. Bye, J?r?me -------------- next part -------------- An HTML attachment was scrubbed... URL: From bonefish at cs.tu-berlin.de Tue Mar 13 13:37:14 2007 From: bonefish at cs.tu-berlin.de (Ingo Weinhold) Date: Tue, 13 Mar 2007 13:37:14 +0100 Subject: [Haiku-commits] r20380 - haiku/trunk/src/system/kernel/arch/x86 In-Reply-To: References: <200703130032.l2D0WnSa024884@sheep.berlios.de> <20070313112536.2741.2@cs.tu-berlin.de> Message-ID: <20070313133714.4215.5@cs.tu-berlin.de> On 2007-03-13 at 12:30:38 [+0100], J?r?me Duval wrote: > 2007/3/13, Ingo Weinhold : > > On 2007-03-13 at 01:32:49 [+0100], korli at BerliOS > > > > wrote: > > > Author: korli > > > Date: 2007-03-13 01:32:48 +0100 (Tue, 13 Mar 2007) > > > New Revision: 20380 > > > ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20380&view=rev > > > > > > Modified: > > > haiku/trunk/src/system/kernel/arch/x86/arch_cpu.c > > > Log: > > > added checks to trick the gcc4 compiler. this way the label is kept. > > > > Was that indeed the problem? > > Yes. Instead of looping, the debugger popup now comes up to show the problem > with Tracker when quitting. Nice. > > Modified: haiku/trunk/src/system/kernel/arch/x86/arch_cpu.c > > > =================================================================== > > > --- haiku/trunk/src/system/kernel/arch/x86/arch_cpu.c 2007-03-12 > > > 20:52:21 UTC (rev 20379) > > > +++ haiku/trunk/src/system/kernel/arch/x86/arch_cpu.c 2007-03-13 > > > 00:32:48 UTC (rev 20380) > > > @@ -587,6 +587,10 @@ > > > char *tmp = (char *)to; > > > char *s = (char *)from; > > > > > > + // this check is to trick the gcc4 compiler and have it keep the > > error > > > label > > > + if (to == NULL) > > > + goto error; > > > + > > > *faultHandler = (addr_t)&&error; > > > > For PPC I've used a more generic, and IMHO nicer solution: > > > > if (ppc_set_fault_handler(faultHandler, (addr_t)&&error)) > > goto error; > > > Personally, I don't think it's nicer. Here you're adding a function call for > the purpose of tricking the branch tree of the compiler. Adding a goto > instruction with a simple test which we know can't be true, but not the > compiler, is the interesting part. I would even prefer a workaround which > doesn't generate code at all, but it seems not possible AFAIK. I find the function solution nicer, since it is more generic -- you don't have to use a different condition for each instance -- and more robust -- it won't break when the context changes (e.g. if someone adds a "if ( == NULL) return B_BAD_VALUE;" at the beginning of the function, the compiler might choose to use the additional knowledge). If you find an additional function call too expensive just for the work-around, introducing something like a kFalseButTheCompilerDoesntKnowIt constant for the check might be an alternative (I just didn't think of this when introducing the PPC work-around). Though, generally I wouldn't care that much about a few additional bytes of code and CPU cycle to process them. If we choose C for this kind of stuff we can't be that serious about the performance. I suppose there will be processor-specific assembler versions of those functions once we start optimizing things a little, anyway. CU, Ingo From axeld at pinc-software.de Tue Mar 13 14:57:19 2007 From: axeld at pinc-software.de (Axel =?iso-8859-15?q?D=F6rfler?=) Date: Tue, 13 Mar 2007 14:57:19 +0100 CET Subject: [Haiku-commits] r20380 - haiku/trunk/src/system/kernel/arch/x86 In-Reply-To: Message-ID: <11304979058-BeMail@zon> "J?r?me Duval" wrote: > > For PPC I've used a more generic, and IMHO nicer solution: > > > > if (ppc_set_fault_handler(faultHandler, (addr_t)&&error)) > > goto error; > Personally, I don't think it's nicer. Here you're adding a function > call for > the purpose of tricking the branch tree of the compiler. Adding a > goto > instruction with a simple test which we know can't be true, but not > the > compiler, is the interesting part. I would even prefer a workaround > which > doesn't generate code at all, but it seems not possible AFAIK. Maybe there is some GCC attribute we can use as a work-around? We could also fall back to use assembly instead. Bye, Axel. From axeld at pinc-software.de Tue Mar 13 15:55:26 2007 From: axeld at pinc-software.de (Axel =?iso-8859-15?q?D=F6rfler?=) Date: Tue, 13 Mar 2007 15:55:26 +0100 CET Subject: [Haiku-commits] r20335 - haiku/trunk/src/apps/terminal In-Reply-To: <3714086698-BeMail@> Message-ID: <14791769223-BeMail@zon> "Kaoutsis" wrote: > > In any way, I can't see why that window redefines it (and it also > > redefines ALT-W), so I think I'll remove both AddShortcut() calls > > altogether. > So i tried to remove both AddShortcut(): the behavior remains the > same! Sure, because that's the default behaviour; Command-W closes the window, Command-Q the application. > i tried to override the behavior with a custom message, with no > effect. So no matter what, alt + q posts B_QUIT_REQUESTED to be_app. > We might want not to follow compatibility here. You cannot override it under R5, that's correct (it will work with Haiku, though). However, you can easily replace it by removing the original shortcut first on BeOS, and that will work on Haiku as well. Bye, Axel. From axeld at mail.berlios.de Tue Mar 13 17:53:20 2007 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Tue, 13 Mar 2007 17:53:20 +0100 Subject: [Haiku-commits] r20382 - haiku/trunk/src/servers/app Message-ID: <200703131653.l2DGrKWX029321@sheep.berlios.de> Author: axeld Date: 2007-03-13 17:53:19 +0100 (Tue, 13 Mar 2007) New Revision: 20382 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20382&view=rev Modified: haiku/trunk/src/servers/app/Workspace.cpp haiku/trunk/src/servers/app/Workspace.h haiku/trunk/src/servers/app/WorkspacesLayer.cpp Log: * Added a new Workspace::GetPreviousWindow() method to allow traversing the window list in the other direction. * Since WorkspacesLayer now cuts out the current window from the clipping region, the window order was upside down; it now uses the new Workspace::GetPreviousWindow(). This fixes bug #1105. * WorkspacesLayer::MouseDown() now also uses GetPreviousWindow() which prevents it from needing to scan the whole window list for the top window at every click. Modified: haiku/trunk/src/servers/app/Workspace.cpp =================================================================== --- haiku/trunk/src/servers/app/Workspace.cpp 2007-03-13 11:14:47 UTC (rev 20381) +++ haiku/trunk/src/servers/app/Workspace.cpp 2007-03-13 16:53:19 UTC (rev 20382) @@ -1,5 +1,5 @@ /* - * Copyright 2005-2006, Haiku. + * Copyright 2005-2007, Haiku. * Distributed under the terms of the MIT License. * * Authors: @@ -138,6 +138,28 @@ } +status_t +Workspace::GetPreviousWindow(WindowLayer*& _window, BPoint& _leftTop) +{ + if (fCurrent == NULL) + fCurrent = fWorkspace.Windows().LastWindow(); + else + fCurrent = fCurrent->PreviousWindow(fWorkspace.Index()); + + if (fCurrent == NULL) + return B_ENTRY_NOT_FOUND; + + _window = fCurrent; + + if (fCurrentWorkspace) + _leftTop = fCurrent->Frame().LeftTop(); + else + _leftTop = fCurrent->Anchor(fWorkspace.Index()).position; + + return B_OK; +} + + void Workspace::RewindWindows() { Modified: haiku/trunk/src/servers/app/Workspace.h =================================================================== --- haiku/trunk/src/servers/app/Workspace.h 2007-03-13 11:14:47 UTC (rev 20381) +++ haiku/trunk/src/servers/app/Workspace.h 2007-03-13 16:53:19 UTC (rev 20382) @@ -1,5 +1,5 @@ /* - * Copyright 2005, Haiku. + * Copyright 2005-2007, Haiku. * Distributed under the terms of the MIT License. * * Authors: @@ -28,6 +28,7 @@ { return fCurrentWorkspace; } status_t GetNextWindow(WindowLayer*& _window, BPoint& _leftTop); + status_t GetPreviousWindow(WindowLayer*& _window, BPoint& _leftTop); void RewindWindows(); class Private; Modified: haiku/trunk/src/servers/app/WorkspacesLayer.cpp =================================================================== --- haiku/trunk/src/servers/app/WorkspacesLayer.cpp 2007-03-13 11:14:47 UTC (rev 20381) +++ haiku/trunk/src/servers/app/WorkspacesLayer.cpp 2007-03-13 16:53:19 UTC (rev 20382) @@ -262,16 +262,16 @@ backgroundRegion.IntersectWith(&workspaceRegion); drawingEngine->ConstrainClippingRegion(&backgroundRegion); + // We draw from top down and cut the window out of the clipping region + // which reduces the flickering WindowLayer* window; BPoint leftTop; - while (workspace.GetNextWindow(window, leftTop) == B_OK) { + while (workspace.GetPreviousWindow(window, leftTop) == B_OK) { _DrawWindow(drawingEngine, rect, screenFrame, window, leftTop, backgroundRegion, active); } // draw background - - //drawingEngine->ConstrainClippingRegion(&backgroundRegion); drawingEngine->FillRect(rect, color); drawingEngine->ConstrainClippingRegion(&redraw); @@ -376,15 +376,14 @@ WindowLayer* window; BRect windowFrame; BPoint leftTop; - while (workspace.GetNextWindow(window, leftTop) == B_OK) { + while (workspace.GetPreviousWindow(window, leftTop) == B_OK) { BRect frame = _WindowFrame(workspaceFrame, screenFrame, window->Frame(), leftTop); if (frame.Contains(where) && window->Feel() != kDesktopWindowFeel && window->Feel() != kWindowScreenFeel) { - // We can't exit the loop here, as we traverse the window - // list in the wrong direction... fSelectedWindow = window; windowFrame = frame; + break; } } From axeld at pinc-software.de Tue Mar 13 18:46:30 2007 From: axeld at pinc-software.de (Axel =?iso-8859-15?q?D=F6rfler?=) Date: Tue, 13 Mar 2007 18:46:30 +0100 CET Subject: [Haiku-commits] r20043 - haiku/trunk/src/system/boot/platform/pxe_ia32 In-Reply-To: <20070221224934.27959.1@bee.hirschkaefer.site> Message-ID: <25055403862-BeMail@zon> Oliver Tappe wrote: > If I find the time, I'll work on that some more, but honestly, I am > really > fed up with these old tools. In my opinion, we should switch to gcc-4 > soon, > never mind binary compatibility... It's understandable that you're fed up - you've already shown more patience with those tools than anybody else :-) In fact it's only because of you that we can still pursue our target of being binary compatible with BeOS - thank you for that! ;-) Bye, Axel. From geist at foobox.com Tue Mar 13 20:53:27 2007 From: geist at foobox.com (Travis Geiselbrecht) Date: Tue, 13 Mar 2007 12:53:27 -0700 Subject: [Haiku-commits] r20380 - haiku/trunk/src/system/kernel/arch/x86 In-Reply-To: <11304979058-BeMail@zon> References: <11304979058-BeMail@zon> Message-ID: On Mar 13, 2007, at 6:57 AM, Axel D?rfler wrote: > "J?r?me Duval" wrote: >>> For PPC I've used a more generic, and IMHO nicer solution: >>> >>> if (ppc_set_fault_handler(faultHandler, (addr_t)&&error)) >>> goto error; >> Personally, I don't think it's nicer. Here you're adding a function >> call for >> the purpose of tricking the branch tree of the compiler. Adding a >> goto >> instruction with a simple test which we know can't be true, but not >> the >> compiler, is the interesting part. I would even prefer a workaround >> which >> doesn't generate code at all, but it seems not possible AFAIK. > > Maybe there is some GCC attribute we can use as a work-around? We > could > also fall back to use assembly instead. > Yeah, by far the best solution would be to write assembly versions of those routines anyway. The bytewise copies in C are pretty atrociously slow. Travis From axeld at pinc-software.de Tue Mar 13 21:12:28 2007 From: axeld at pinc-software.de (Axel =?iso-8859-15?q?D=F6rfler?=) Date: Tue, 13 Mar 2007 21:12:28 +0100 CET Subject: [Haiku-commits] r20380 - haiku/trunk/src/system/kernel/arch/x86 In-Reply-To: Message-ID: <33813570205-BeMail@zon> Travis Geiselbrecht wrote: > On Mar 13, 2007, at 6:57 AM, Axel D?rfler wrote: > > Maybe there is some GCC attribute we can use as a work-around? We > > could also fall back to use assembly instead. > Yeah, by far the best solution would be to write assembly versions of > those routines anyway. The bytewise copies in C are pretty > atrociously slow. With processor specific optimizations, please :-) Indeed, the current implementation should just be a placeholder for an optimized version later. However, if we wanted to patch the kernel at runtime (for best performance), there is such mechanism yet. Bye, Axel. From axeld at pinc-software.de Tue Mar 13 21:44:07 2007 From: axeld at pinc-software.de (Axel =?iso-8859-15?q?D=F6rfler?=) Date: Tue, 13 Mar 2007 21:44:07 +0100 CET Subject: [Haiku-commits] r20130 - haiku/trunk/src/apps/abouthaiku In-Reply-To: <278834636-BeMail@laptop> Message-ID: <35712568861-BeMail@zon> "Fran?ois Revol" wrote: > > * Fixed a warning - even though I'm not sure we really need this > > percentage stuff at all. > Dunno, maybe a BStatusBar like in R5 ? We could do that, but I don't think we need that either; the amount of free space should really be enough info IMO. Bye, Axel. From korli at mail.berlios.de Wed Mar 14 00:10:20 2007 From: korli at mail.berlios.de (korli at BerliOS) Date: Wed, 14 Mar 2007 00:10:20 +0100 Subject: [Haiku-commits] r20383 - in haiku/trunk: headers/build src/add-ons/media/plugins/mp3_decoder/mpglib Message-ID: <200703132310.l2DNAKfV026319@sheep.berlios.de> Author: korli Date: 2007-03-14 00:10:19 +0100 (Wed, 14 Mar 2007) New Revision: 20383 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20383&view=rev Modified: haiku/trunk/headers/build/HaikuBuildCompatibility.h haiku/trunk/src/add-ons/media/plugins/mp3_decoder/mpglib/Jamfile Log: added some Haiku media definitions made mpglib beos compatible Modified: haiku/trunk/headers/build/HaikuBuildCompatibility.h =================================================================== --- haiku/trunk/headers/build/HaikuBuildCompatibility.h 2007-03-13 16:53:19 UTC (rev 20382) +++ haiku/trunk/headers/build/HaikuBuildCompatibility.h 2007-03-13 23:10:19 UTC (rev 20383) @@ -78,5 +78,14 @@ #define INT64_MAX LONGLONG_MAX #endif +#define B_MPEG_2_AUDIO_LAYER_1 (enum mpeg_id)0x201 +#define B_MPEG_2_AUDIO_LAYER_2 (enum mpeg_id)0x202 +#define B_MPEG_2_AUDIO_LAYER_3 (enum mpeg_id)0x203 +#define B_MPEG_2_VIDEO (enum mpeg_id)0x211 +#define B_MPEG_2_5_AUDIO_LAYER_1 (enum mpeg_id)0x301 +#define B_MPEG_2_5_AUDIO_LAYER_2 (enum mpeg_id)0x302 +#define B_MPEG_2_5_AUDIO_LAYER_3 (enum mpeg_id)0x303 + + #endif // HAIKU_BUILD_COMPATIBILITY_H Modified: haiku/trunk/src/add-ons/media/plugins/mp3_decoder/mpglib/Jamfile =================================================================== --- haiku/trunk/src/add-ons/media/plugins/mp3_decoder/mpglib/Jamfile 2007-03-13 16:53:19 UTC (rev 20382) +++ haiku/trunk/src/add-ons/media/plugins/mp3_decoder/mpglib/Jamfile 2007-03-13 23:10:19 UTC (rev 20383) @@ -1,5 +1,7 @@ SubDir HAIKU_TOP src add-ons media plugins mp3_decoder mpglib ; +SetSubDirSupportedPlatformsBeOSCompatible ; + StaticLibrary libmpglib.a : common.c dct64_i386.c From revol at free.fr Wed Mar 14 10:10:47 2007 From: revol at free.fr (=?windows-1252?q?Fran=E7ois?= Revol) Date: Wed, 14 Mar 2007 10:10:47 +0100 CET Subject: [Haiku-commits] r20130 - haiku/trunk/src/apps/abouthaiku In-Reply-To: <35712568861-BeMail@zon> Message-ID: <1687843062-BeMail@laptop> > "Fran?ois Revol" wrote: > > > * Fixed a warning - even though I'm not sure we really need this > > > percentage stuff at all. > > Dunno, maybe a BStatusBar like in R5 ? > > We could do that, but I don't think we need that either; the amount > of > free space should really be enough info IMO. I was only comparing to the R5 about, but yeah it's not really useful. Besides it would end up in the middle unlike R5's which was at the bottom, so it'd look odd. Fran?ois. From axeld at mail.berlios.de Wed Mar 14 16:47:12 2007 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Wed, 14 Mar 2007 16:47:12 +0100 Subject: [Haiku-commits] r20384 - haiku/trunk/src/system/kernel/arch/ppc Message-ID: <200703141547.l2EFlCbT028840@sheep.berlios.de> Author: axeld Date: 2007-03-14 16:47:11 +0100 (Wed, 14 Mar 2007) New Revision: 20384 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20384&view=rev Modified: haiku/trunk/src/system/kernel/arch/ppc/arch_vm_translation_map.cpp Log: Fixed PPC build (still using the older compiler, though). Modified: haiku/trunk/src/system/kernel/arch/ppc/arch_vm_translation_map.cpp =================================================================== --- haiku/trunk/src/system/kernel/arch/ppc/arch_vm_translation_map.cpp 2007-03-13 23:10:19 UTC (rev 20383) +++ haiku/trunk/src/system/kernel/arch/ppc/arch_vm_translation_map.cpp 2007-03-14 15:47:11 UTC (rev 20384) @@ -338,23 +338,6 @@ static status_t -query_tmap_interrupt(vm_translation_map *map, addr_t va, addr_t *_outPhysical) -{ - page_table_entry *entry; - - // default the flags to not present - *_outPhysical = 0; - - entry = lookup_page_table_entry(map, va); - if (entry == NULL) - return B_ERROR; - - *_outPhysical = entry->physical_page_number * B_PAGE_SIZE; - return B_OK; -} - - -static status_t query_tmap(vm_translation_map *map, addr_t va, addr_t *_outPhysical, uint32 *_outFlags) { page_table_entry *entry; @@ -474,7 +457,7 @@ map_tmap, unmap_tmap, query_tmap, - query_tmap_interrupt, + query_tmap, get_mapped_size_tmap, protect_tmap, clear_flags_tmap, From korli at mail.berlios.de Wed Mar 14 19:53:33 2007 From: korli at mail.berlios.de (korli at BerliOS) Date: Wed, 14 Mar 2007 19:53:33 +0100 Subject: [Haiku-commits] r20385 - haiku/trunk/src/kits/interface Message-ID: <200703141853.l2EIrXvW020285@sheep.berlios.de> Author: korli Date: 2007-03-14 19:53:31 +0100 (Wed, 14 Mar 2007) New Revision: 20385 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20385&view=rev Modified: haiku/trunk/src/kits/interface/Menu.cpp Log: only chooses alpha characters for menu triggers Modified: haiku/trunk/src/kits/interface/Menu.cpp =================================================================== --- haiku/trunk/src/kits/interface/Menu.cpp 2007-03-14 15:47:11 UTC (rev 20384) +++ haiku/trunk/src/kits/interface/Menu.cpp 2007-03-14 18:53:31 UTC (rev 20385) @@ -8,6 +8,7 @@ */ #include +#include #include #include @@ -2089,7 +2090,8 @@ char trigger; // TODO: Oh great, reinterpret_cast all around while ((trigger = title[0]) != '\0') { - if (!chars->HasItem(reinterpret_cast((uint32)trigger))) { + if (isalpha(trigger) + && !chars->HasItem(reinterpret_cast((uint32)trigger))) { chars->AddItem(reinterpret_cast((uint32)trigger)); return title; } From bonefish at mail.berlios.de Wed Mar 14 21:36:42 2007 From: bonefish at mail.berlios.de (bonefish at BerliOS) Date: Wed, 14 Mar 2007 21:36:42 +0100 Subject: [Haiku-commits] r20386 - in haiku/trunk: build/jam headers/os/interface headers/os/kernel headers/os/support headers/posix Message-ID: <200703142036.l2EKag8m026750@sheep.berlios.de> Author: bonefish Date: 2007-03-14 21:36:42 +0100 (Wed, 14 Mar 2007) New Revision: 20386 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20386&view=rev Modified: haiku/trunk/build/jam/HelperRules haiku/trunk/headers/os/interface/InterfaceDefs.h haiku/trunk/headers/os/kernel/OS.h haiku/trunk/headers/os/support/Errors.h haiku/trunk/headers/posix/ctype.h haiku/trunk/headers/posix/stdio_pre.h Log: Use -I instead of -isystem for system header directories when building with gcc 4. Fixed resulting build errors (gcc is more lenient for headers in -isystem directories). Modified: haiku/trunk/build/jam/HelperRules =================================================================== --- haiku/trunk/build/jam/HelperRules 2007-03-14 18:53:31 UTC (rev 20385) +++ haiku/trunk/build/jam/HelperRules 2007-03-14 20:36:42 UTC (rev 20386) @@ -242,7 +242,7 @@ } else { $(prefix)_INCLUDES_SEPARATOR = ; $(prefix)_LOCAL_INCLUDES_OPTION = "-iquote " ; - $(prefix)_SYSTEM_INCLUDES_OPTION = "-idirafter " ; + $(prefix)_SYSTEM_INCLUDES_OPTION = "-I " ; } } Modified: haiku/trunk/headers/os/interface/InterfaceDefs.h =================================================================== --- haiku/trunk/headers/os/interface/InterfaceDefs.h 2007-03-14 18:53:31 UTC (rev 20385) +++ haiku/trunk/headers/os/interface/InterfaceDefs.h 2007-03-14 20:36:42 UTC (rev 20386) @@ -184,7 +184,7 @@ B_ALIGN_HORIZONTAL_CENTER = B_ALIGN_CENTER, B_ALIGN_HORIZONTAL_UNSET = -1L, - B_ALIGN_USE_FULL_WIDTH = -2L, + B_ALIGN_USE_FULL_WIDTH = -2L }; enum vertical_alignment { @@ -196,7 +196,7 @@ B_ALIGN_VERTICAL_UNSET = -1L, B_ALIGN_NO_VERTICAL = B_ALIGN_VERTICAL_UNSET, - B_ALIGN_USE_FULL_HEIGHT = -2L, + B_ALIGN_USE_FULL_HEIGHT = -2L }; /*----------------------------------------------------------------*/ @@ -347,7 +347,7 @@ B_WINDOW_TAB_COLOR = 3, B_WINDOW_TEXT_COLOR = 22, B_WINDOW_INACTIVE_TAB_COLOR = 23, - B_WINDOW_INACTIVE_TEXT_COLOR = 24, + B_WINDOW_INACTIVE_TEXT_COLOR = 24 }; _IMPEXP_BE rgb_color ui_color(color_which which); Modified: haiku/trunk/headers/os/kernel/OS.h =================================================================== --- haiku/trunk/headers/os/kernel/OS.h 2007-03-14 18:53:31 UTC (rev 20385) +++ haiku/trunk/headers/os/kernel/OS.h 2007-03-14 20:36:42 UTC (rev 20386) @@ -27,7 +27,7 @@ enum { B_TIMEOUT = 8, /* relative timeout */ B_RELATIVE_TIMEOUT = 8, /* fails after a relative timeout with B_WOULD_BLOCK */ - B_ABSOLUTE_TIMEOUT = 16, /* fails after an absolute timeout with B_WOULD BLOCK */ + B_ABSOLUTE_TIMEOUT = 16 /* fails after an absolute timeout with B_WOULD BLOCK */ }; /*-------------------------------------------------------------*/ @@ -161,7 +161,7 @@ B_DO_NOT_RESCHEDULE = 0x02, // thread is not rescheduled B_RELEASE_ALL = 0x08, // all waiting threads will be woken up, // count will be zeroed - B_RELEASE_IF_WAITING_ONLY = 0x10, // release count only if there are any + B_RELEASE_IF_WAITING_ONLY = 0x10 // release count only if there are any // threads waiting }; @@ -233,7 +233,7 @@ enum { /* compatible to sys/resource.h RUSAGE_SELF and RUSAGE_CHILDREN */ B_TEAM_USAGE_SELF = 0, - B_TEAM_USAGE_CHILDREN = -1, + B_TEAM_USAGE_CHILDREN = -1 }; /* system private, use macros instead */ @@ -536,7 +536,7 @@ B_CPU_M68K, B_CPU_ARM, B_CPU_SH, - B_CPU_SPARC, + B_CPU_SPARC } cpu_type; #define B_CPU_x86_VENDOR_MASK 0xff00 Modified: haiku/trunk/headers/os/support/Errors.h =================================================================== --- haiku/trunk/headers/os/support/Errors.h 2007-03-14 18:53:31 UTC (rev 20385) +++ haiku/trunk/headers/os/support/Errors.h 2007-03-14 20:36:42 UTC (rev 20386) @@ -72,7 +72,7 @@ B_MISSING_LIBRARY, B_MISSING_SYMBOL, - B_DEBUGGER_ALREADY_INSTALLED = B_OS_ERROR_BASE + 0x400, + B_DEBUGGER_ALREADY_INSTALLED = B_OS_ERROR_BASE + 0x400 }; /* Application Kit Errors */ @@ -276,7 +276,7 @@ B_DEV_FIFO_UNDERRUN, B_DEV_PENDING, B_DEV_MULTIPLE_ERRORS, - B_DEV_TOO_LATE, + B_DEV_TOO_LATE }; #endif /* _ERRORS_H */ Modified: haiku/trunk/headers/posix/ctype.h =================================================================== --- haiku/trunk/headers/posix/ctype.h 2007-03-14 18:53:31 UTC (rev 20385) +++ haiku/trunk/headers/posix/ctype.h 2007-03-14 20:36:42 UTC (rev 20386) @@ -37,7 +37,7 @@ _ISxdigit = 0x1000, /* hexadecimal digit */ _ISspace = 0x2000, /* white space */ _ISprint = 0x4000, /* printing */ - _ISgraph = 0x8000, /* graphical */ + _ISgraph = 0x8000 /* graphical */ }; /* Characteristics */ Modified: haiku/trunk/headers/posix/stdio_pre.h =================================================================== --- haiku/trunk/headers/posix/stdio_pre.h 2007-03-14 18:53:31 UTC (rev 20385) +++ haiku/trunk/headers/posix/stdio_pre.h 2007-03-14 20:36:42 UTC (rev 20386) @@ -12,7 +12,7 @@ typedef struct _IO_FILE FILE; -#define __PRINTFLIKE(format, varargs) __attribute__ ((__format__ (__printf__, format, varargs))); +#define __PRINTFLIKE(format, varargs) __attribute__ ((__format__ (__printf__, format, varargs))) #define __SCANFLIKE(format, varargs) __attribute__((__format__ (__scanf__, format, varargs))) #endif /* _STDIO_PRE_H_ */ From bonefish at mail.berlios.de Wed Mar 14 21:37:07 2007 From: bonefish at mail.berlios.de (bonefish at BerliOS) Date: Wed, 14 Mar 2007 21:37:07 +0100 Subject: [Haiku-commits] r20387 - haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server Message-ID: <200703142037.l2EKb7iU026803@sheep.berlios.de> Author: bonefish Date: 2007-03-14 21:37:07 +0100 (Wed, 14 Mar 2007) New Revision: 20387 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20387&view=rev Modified: haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/haiku_block_cache.cpp Log: gcc 4 fix. Modified: haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/haiku_block_cache.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/haiku_block_cache.cpp 2007-03-14 20:36:42 UTC (rev 20386) +++ haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/haiku_block_cache.cpp 2007-03-14 20:37:07 UTC (rev 20387) @@ -32,6 +32,8 @@ # define TRACE(x) ; #endif +using std::nothrow; + // This macro is used for fatal situations that are acceptable in a running // system, like out of memory situations - should only panic for debugging. #define FATAL(x) panic x From axeld at pinc-software.de Wed Mar 14 23:05:27 2007 From: axeld at pinc-software.de (Axel =?iso-8859-15?q?D=F6rfler?=) Date: Wed, 14 Mar 2007 23:05:27 +0100 CET Subject: [Haiku-commits] =?iso-8859-15?q?r20386_-_in_haiku/trunk=3A_build/?= =?iso-8859-15?q?jam_headers/os/interface_headers/os/kernel_headers/os/sup?= =?iso-8859-15?q?port_headers/posix?= In-Reply-To: <200703142036.l2EKag8m026750@sheep.berlios.de> Message-ID: <52386485290-BeMail@zon> bonefish at BerliOS wrote: > - B_ALIGN_USE_FULL_WIDTH = -2L, > + B_ALIGN_USE_FULL_WIDTH = -2L > }; Damn, this is an error now? I do that all the time to make it more easily extensible, and keep the changes where they should happen :-/ Bye, Axel. From bonefish at cs.tu-berlin.de Thu Mar 15 00:37:28 2007 From: bonefish at cs.tu-berlin.de (Ingo Weinhold) Date: Thu, 15 Mar 2007 00:37:28 +0100 Subject: [Haiku-commits] r20386 - in haiku/trunk: build/jam headers/os/interface headers/os/kernel headers/os/support headers/posix In-Reply-To: <52386485290-BeMail@zon> References: <52386485290-BeMail@zon> Message-ID: <20070315003728.86205.16@cs.tu-berlin.de> On 2007-03-14 at 23:05:27 [+0100], Axel D?rfler wrote: > bonefish at BerliOS wrote: > > - B_ALIGN_USE_FULL_WIDTH = -2L, > > + B_ALIGN_USE_FULL_WIDTH = -2L > > }; > > Damn, this is an error now? Apparently. I looked it up in the C++ specification and according to the grammar this isn't a correct declaration. Probably never has been, but the compiler was obviously lenient enough to let it pass. > I do that all the time to make it more > easily extensible, and keep the changes where they should happen :-/ Yep, so did I. CU, Ingo From korli at mail.berlios.de Sat Mar 17 19:25:28 2007 From: korli at mail.berlios.de (korli at BerliOS) Date: Sat, 17 Mar 2007 19:25:28 +0100 Subject: [Haiku-commits] r20388 - haiku/trunk/src/kits/interface Message-ID: <200703171825.l2HIPSe7021642@sheep.berlios.de> Author: korli Date: 2007-03-17 19:25:27 +0100 (Sat, 17 Mar 2007) New Revision: 20388 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20388&view=rev Modified: haiku/trunk/src/kits/interface/ChannelControl.cpp haiku/trunk/src/kits/interface/ChannelSlider.cpp Log: don't send a message on mouse down and mouve moved correctly set "be:channel_changed" correctly set "be:current_channel" with SetCurrentChannel() correctly set "be:value" Modified: haiku/trunk/src/kits/interface/ChannelControl.cpp =================================================================== --- haiku/trunk/src/kits/interface/ChannelControl.cpp 2007-03-14 20:37:07 UTC (rev 20387) +++ haiku/trunk/src/kits/interface/ChannelControl.cpp 2007-03-17 18:25:27 UTC (rev 20388) @@ -263,14 +263,12 @@ invokeMessage.AddInt32("be:current_channel", fCurrentChannel); - if (channelCount == -1) + if (channelCount < 0) channelCount = fChannelCount - fromChannel; - for (int32 i = fromChannel; i < fromChannel + channelCount; i++) { - invokeMessage.AddInt32("be:channel_value", fChannelValues[i]); - // TODO: Fix this: just send "be:channel_changed" = true - // for channels which have changed their values. - invokeMessage.AddBool("be:channel_changed", true); + for (int32 i = 0; i < channelCount; i++) { + invokeMessage.AddInt32("be:channel_value", fChannelValues[fromChannel + i]); + invokeMessage.AddBool("be:channel_changed", inMask ? inMask[i] : true); } return BControl::Invoke(&invokeMessage); @@ -417,7 +415,8 @@ delete[] fChannelValues; fChannelValues = newValues; - + BControl::SetValue(fChannelValues[fCurrentChannel]); + return B_OK; } Modified: haiku/trunk/src/kits/interface/ChannelSlider.cpp =================================================================== --- haiku/trunk/src/kits/interface/ChannelSlider.cpp 2007-03-14 20:37:07 UTC (rev 20387) +++ haiku/trunk/src/kits/interface/ChannelSlider.cpp 2007-03-17 18:25:27 UTC (rev 20388) @@ -272,6 +272,7 @@ // Click was on a slider. if (frame.Contains(where)) { fCurrentChannel = channel; + SetCurrentChannel(channel); break; } } @@ -626,18 +627,15 @@ BChannelSlider::FinishChange() { if (fInitialValues != NULL) { - if (fAllChannels) { - // TODO: Iterate through the list of channels, and invoke only - // for changed values ? - - InvokeChannel(); - - } else { - if (ValueList()[fCurrentChannel] != fInitialValues[fCurrentChannel]) { - SetValueFor(fCurrentChannel, ValueList()[fCurrentChannel]); - Invoke(); - } + bool *inMask = NULL; + int32 numChannels = CountChannels(); + if (!fAllChannels) { + inMask = new bool[CountChannels()]; + for (int i=0; i Author: axeld Date: 2007-03-18 14:44:26 +0100 (Sun, 18 Mar 2007) New Revision: 20389 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20389&view=rev Added: haiku/trunk/src/apps/mail/ Removed: haiku/trunk/src/apps/bemail/ Modified: haiku/trunk/build/jam/HaikuImage haiku/trunk/src/apps/Jamfile haiku/trunk/src/apps/mail/BeMail.rdef haiku/trunk/src/apps/mail/Content.cpp haiku/trunk/src/apps/mail/Jamfile haiku/trunk/src/apps/mail/Mail.cpp haiku/trunk/src/apps/mail/Prefs.cpp Log: * Renamed BeMail to Mail. * The settings are still saved in "config/settings/BeMail Settings", though. Modified: haiku/trunk/build/jam/HaikuImage =================================================================== --- haiku/trunk/build/jam/HaikuImage 2007-03-17 18:25:27 UTC (rev 20388) +++ haiku/trunk/build/jam/HaikuImage 2007-03-18 13:44:26 UTC (rev 20389) @@ -38,7 +38,7 @@ BEOS_APPS = Terminal Expander People ShowImage Pulse ProcessController SoundRecorder Magnify DiskProbe AboutHaiku StyledEdit Installer Workspaces $(X86_ONLY)Cortex $(X86_ONLY)CortexAddOnHost MediaPlayer DeskCalc MidiPlayer - Icon-O-Matic BeMail CDPlayer + Icon-O-Matic Mail CDPlayer ; BEOS_PREFERENCES = Appearance Backgrounds DataTranslations E-mail FileTypes Fonts Media Menu Mouse Keyboard Keymap Printers Screen ScreenSaver Sounds Time VirtualMemory Modified: haiku/trunk/src/apps/Jamfile =================================================================== --- haiku/trunk/src/apps/Jamfile 2007-03-17 18:25:27 UTC (rev 20388) +++ haiku/trunk/src/apps/Jamfile 2007-03-18 13:44:26 UTC (rev 20389) @@ -1,7 +1,6 @@ SubDir HAIKU_TOP src apps ; SubInclude HAIKU_TOP src apps abouthaiku ; -SubInclude HAIKU_TOP src apps bemail ; SubInclude HAIKU_TOP src apps cdplayer ; SubInclude HAIKU_TOP src apps clock ; SubInclude HAIKU_TOP src apps codycam ; @@ -15,6 +14,7 @@ SubInclude HAIKU_TOP src apps icon-o-matic ; SubInclude HAIKU_TOP src apps installer ; SubInclude HAIKU_TOP src apps magnify ; +SubInclude HAIKU_TOP src apps mail ; SubInclude HAIKU_TOP src apps mediaplayer ; SubInclude HAIKU_TOP src apps midiplayer ; SubInclude HAIKU_TOP src apps people ; Copied: haiku/trunk/src/apps/mail (from rev 20381, haiku/trunk/src/apps/bemail) Modified: haiku/trunk/src/apps/mail/BeMail.rdef =================================================================== --- haiku/trunk/src/apps/bemail/BeMail.rdef 2007-03-13 11:14:47 UTC (rev 20381) +++ haiku/trunk/src/apps/mail/BeMail.rdef 2007-03-18 13:44:26 UTC (rev 20389) @@ -18,8 +18,8 @@ variety = B_APPV_FINAL, internal = 3, - short_info = "BeMail", - long_info = "BeMail ?2005-2007 Haiku, Inc." + short_info = "Mail", + long_info = "Mail ?2005-2007 Haiku, Inc." }; resource large_icon { Modified: haiku/trunk/src/apps/mail/Content.cpp =================================================================== --- haiku/trunk/src/apps/bemail/Content.cpp 2007-03-13 11:14:47 UTC (rev 20381) +++ haiku/trunk/src/apps/mail/Content.cpp 2007-03-18 13:44:26 UTC (rev 20389) @@ -1833,7 +1833,7 @@ case TYPE_MAILTO: if (be_roster->Launch(B_MAIL_TYPE, 1, &enclosure->name) < B_OK) { - char *argv[] = {"BeMail", enclosure->name}; + char *argv[] = {"Mail", enclosure->name}; be_app->ArgvReceived(2, argv); } break; Modified: haiku/trunk/src/apps/mail/Jamfile =================================================================== --- haiku/trunk/src/apps/bemail/Jamfile 2007-03-13 11:14:47 UTC (rev 20381) +++ haiku/trunk/src/apps/mail/Jamfile 2007-03-18 13:44:26 UTC (rev 20389) @@ -1,4 +1,4 @@ -SubDir HAIKU_TOP src apps bemail ; +SubDir HAIKU_TOP src apps mail ; SetSubDirSupportedPlatformsBeOSCompatible ; @@ -10,8 +10,8 @@ UsePrivateHeaders textencoding ; UsePrivateHeaders shared ; -AddResources BeMail : BeMail.rdef pictures.rdef ; -Application BeMail : +AddResources Mail : BeMail.rdef pictures.rdef ; +Application Mail : AutoTextControl.cpp BmapButton.cpp ButtonBar.cpp @@ -30,8 +30,8 @@ Words.cpp KUndoBuffer.cpp ; -LinkAgainst BeMail : be tracker $(TARGET_LIBSTDC++) libmail.so libtextencoding.so ; +LinkAgainst Mail : be tracker $(TARGET_LIBSTDC++) libmail.so libtextencoding.so ; Package haiku-maildaemon-cvs : - BeMail : + Mail : boot beos apps ; Modified: haiku/trunk/src/apps/mail/Mail.cpp =================================================================== --- haiku/trunk/src/apps/bemail/Mail.cpp 2007-03-13 11:14:47 UTC (rev 20381) +++ haiku/trunk/src/apps/mail/Mail.cpp 2007-03-18 13:44:26 UTC (rev 20389) @@ -292,7 +292,7 @@ TMailApp::AboutRequested() { (new BAlert("", - "BeMail\nBy Robert Polic\n\n" + "Mail\nBy Robert Polic\n\n" "Enhanced by Axel D?rfler and the Dr. Zoidberg crew\n\n" "Compiled on " __DATE__ " at " __TIME__ ".", "OK"))->Go(); @@ -312,7 +312,7 @@ // a "mailto:" with no name should open an empty window // so remember if we got a "mailto:" even if there isn't a name // that goes along with it (this allows deskbar replicant to open - // an empty message even when BeMail is already running) + // an empty message even when Mail is already running) bool gotmailto = false; for (int32 loop = 1; loop < argc; loop++) @@ -486,7 +486,7 @@ { // Do we need to update the state of the button bars? if (fPreviousShowButtonBar != sShowButtonBar) { - // Notify all BeMail windows + // Notify all Mail windows TMailWindow *window; for (int32 i = 0; (window=(TMailWindow *)fWindowList.ItemAt(i)) != NULL; i++) { window->Lock(); @@ -1204,7 +1204,7 @@ } } if (title == "") - title = "BeMail"; + title = "Mail"; TMailWindow *window = new TMailWindow(r, title.String(), ref, to, &fFont, resend, trackerMessenger); @@ -1378,7 +1378,7 @@ menu->AddSeparatorItem(); menu->AddItem(item = new BMenuItem( - MDR_DIALECT_CHOICE ("About BeMail", "A) BeMail????") B_UTF8_ELLIPSIS, + MDR_DIALECT_CHOICE ("About", "A) Mail????") B_UTF8_ELLIPSIS, new BMessage(B_ABOUT_REQUESTED))); item->SetTarget(be_app); @@ -1428,7 +1428,7 @@ } menu->AddSeparatorItem(); menu->AddItem(item = new BMenuItem( - MDR_DIALECT_CHOICE ("Preferences","P) BeMail???") B_UTF8_ELLIPSIS, + MDR_DIALECT_CHOICE ("Preferences","P) Mail???") B_UTF8_ELLIPSIS, new BMessage(M_PREFS),',')); item->SetTarget(be_app); menu_bar->AddItem(menu); @@ -2015,9 +2015,9 @@ // Update title bar if "subject" has changed if (!fIncoming && fieldMask & FIELD_SUBJECT) { - // If no subject, set to "BeMail" + // If no subject, set to "Mail" if (!fHeaderView->fSubject->TextView()->TextLength()) - SetTitle("BeMail"); + SetTitle("Mail"); else SetTitle(fHeaderView->fSubject->Text()); } @@ -3354,7 +3354,7 @@ char versionString[255]; sprintf(versionString, - "BeMail - Mail Daemon Replacement %ld.%ld.%ld %s", + "Mail - Mail Daemon Replacement %ld.%ld.%ld %s", versionInfo.major, versionInfo.middle, versionInfo.minor, varietyString); fMail->SetHeaderField("X-Mailer", versionString); } @@ -3672,10 +3672,9 @@ // // Figure out the title of this message and set the title bar // - BString title = "BeMail"; + BString title = "Mail"; - if (fIncoming) - { + if (fIncoming) { if (fMail->GetName(&title) == B_OK) title << ": \"" << fMail->Subject() << "\""; else Modified: haiku/trunk/src/apps/mail/Prefs.cpp =================================================================== --- haiku/trunk/src/apps/bemail/Prefs.cpp 2007-03-13 11:14:47 UTC (rev 20381) +++ haiku/trunk/src/apps/mail/Prefs.cpp 2007-03-18 13:44:26 UTC (rev 20389) @@ -114,7 +114,7 @@ bool *attachAttributes, bool *cquotes, uint32 *account, int32 *replyTo, char **preamble, char **sig, uint32 *encoding, bool *warnUnencodable, bool *spellCheckStartOn, uint8 *buttonBar) - : BWindow(rect, MDR_DIALECT_CHOICE ("BeMail Preferences","BeMail???"), B_TITLED_WINDOW, B_NOT_RESIZABLE | B_NOT_ZOOMABLE) + : BWindow(rect, MDR_DIALECT_CHOICE ("Mail Preferences","Mail???"), B_TITLED_WINDOW, B_NOT_RESIZABLE | B_NOT_ZOOMABLE) { BMenuField *menu; From axeld at mail.berlios.de Sun Mar 18 14:49:57 2007 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Sun, 18 Mar 2007 14:49:57 +0100 Subject: [Haiku-commits] r20390 - haiku/trunk/src/apps/mail Message-ID: <200703181349.l2IDnvxH022141@sheep.berlios.de> Author: axeld Date: 2007-03-18 14:49:56 +0100 (Sun, 18 Mar 2007) New Revision: 20390 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20390&view=rev Added: haiku/trunk/src/apps/mail/Mail.rdef Removed: haiku/trunk/src/apps/mail/BeMail.rdef Modified: haiku/trunk/src/apps/mail/Jamfile Log: Renamed BeMail.rdef to Mail.rdef (subversion doesn't allow to rename a directory and any of its contents in one commit). Deleted: haiku/trunk/src/apps/mail/BeMail.rdef Modified: haiku/trunk/src/apps/mail/Jamfile =================================================================== --- haiku/trunk/src/apps/mail/Jamfile 2007-03-18 13:44:26 UTC (rev 20389) +++ haiku/trunk/src/apps/mail/Jamfile 2007-03-18 13:49:56 UTC (rev 20390) @@ -10,7 +10,7 @@ UsePrivateHeaders textencoding ; UsePrivateHeaders shared ; -AddResources Mail : BeMail.rdef pictures.rdef ; +AddResources Mail : Mail.rdef pictures.rdef ; Application Mail : AutoTextControl.cpp BmapButton.cpp Copied: haiku/trunk/src/apps/mail/Mail.rdef (from rev 20389, haiku/trunk/src/apps/mail/BeMail.rdef) From korli at mail.berlios.de Mon Mar 19 00:32:29 2007 From: korli at mail.berlios.de (korli at BerliOS) Date: Mon, 19 Mar 2007 00:32:29 +0100 Subject: [Haiku-commits] r20391 - haiku/trunk/src/kits/interface Message-ID: <200703182332.l2INWTmB013196@sheep.berlios.de> Author: korli Date: 2007-03-19 00:32:27 +0100 (Mon, 19 Mar 2007) New Revision: 20391 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20391&view=rev Modified: haiku/trunk/src/kits/interface/ChannelControl.cpp haiku/trunk/src/kits/interface/ChannelSlider.cpp Log: applied minimums to values computations implemented SetLimitsFor() and GetLimitsFor() Modified: haiku/trunk/src/kits/interface/ChannelControl.cpp =================================================================== --- haiku/trunk/src/kits/interface/ChannelControl.cpp 2007-03-18 13:49:56 UTC (rev 20390) +++ haiku/trunk/src/kits/interface/ChannelControl.cpp 2007-03-18 23:32:27 UTC (rev 20391) @@ -439,7 +439,19 @@ BChannelControl::SetLimitsFor(int32 fromChannel, int32 channelCount, const int32 *minimum, const int32 *maximum) { - return B_ERROR; + if (fromChannel + channelCount > CountChannels()) + channelCount = CountChannels() - fromChannel; + for (int i=0; i maximum[i]) + return B_BAD_VALUE; + fChannelMin[fromChannel + i] = minimum[i]; + fChannelMax[fromChannel + i] = maximum[i]; + if (fChannelValues[fromChannel + i] < minimum[i]) + fChannelValues[fromChannel + i] = minimum[i]; + else if (fChannelValues[fromChannel + i] > maximum[i]) + fChannelValues[fromChannel + i] = maximum[i]; + } + return B_OK; } @@ -447,7 +459,19 @@ BChannelControl::GetLimitsFor(int32 fromChannel, int32 channelCount, int32 *minimum, int32 *maximum) const { - return B_ERROR; + if (minimum == NULL || maximum == NULL) + return B_BAD_VALUE; + + if (fChannelMin == NULL || fChannelMax == NULL) + return B_ERROR; + if (fromChannel + channelCount > CountChannels()) + channelCount = CountChannels() - fromChannel; + for (int i=0; i= 0 && channel < MaxChannelCount()) { float range = ThumbRangeFor(channel); int32 limitRange = MaxLimitList()[channel] - MinLimitList()[channel]; - delta = ValueList()[channel] * range / limitRange; + delta = (ValueList()[channel] - MinLimitList()[channel]) * range / limitRange; if (Vertical()) delta = range - delta; @@ -814,7 +814,7 @@ else floatValue = range + (point.x - fMinpoint); - int32 value = (int32)(floatValue / range * limitRange); + int32 value = (int32)(floatValue / range * limitRange) + MinLimitList()[fCurrentChannel]; if (fAllChannels) SetAllValue(value); else From nielx at mail.berlios.de Mon Mar 19 10:38:51 2007 From: nielx at mail.berlios.de (nielx at BerliOS) Date: Mon, 19 Mar 2007 10:38:51 +0100 Subject: [Haiku-commits] r20392 - in haiku/trunk/docs/user: . support Message-ID: <200703190938.l2J9cpEO004630@sheep.berlios.de> Author: nielx Date: 2007-03-19 10:38:47 +0100 (Mon, 19 Mar 2007) New Revision: 20392 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20392&view=rev Added: haiku/trunk/docs/user/apidoc.dox Modified: haiku/trunk/docs/user/Doxyfile haiku/trunk/docs/user/support/DataIO.dox haiku/trunk/docs/user/support/List.dox Log: Initial revision of the API documentation guidelines up for discussion. DataIO.dox and List.dox conform to these guidelines. Modified: haiku/trunk/docs/user/Doxyfile =================================================================== --- haiku/trunk/docs/user/Doxyfile 2007-03-18 23:32:27 UTC (rev 20391) +++ haiku/trunk/docs/user/Doxyfile 2007-03-19 09:38:47 UTC (rev 20392) @@ -1022,9 +1022,12 @@ # undefined via #undef or recursively expanded use the := operator # instead of the = operator. -# Beep.h requires __cplusplus to be defined. +# Beep.h and SupportDefs.h require __cplusplus to be defined. +# SupportDefs.h defines some things that are also defined in types.h. There's +# check whether or not types.h has already been included. There is no need +# to put these definitions in our docs. -PREDEFINED = __cplusplus +PREDEFINED = __cplusplus _SYS_TYPES_H # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then # this tag can be used to specify a list of macro names that should be expanded. Added: haiku/trunk/docs/user/apidoc.dox =================================================================== --- haiku/trunk/docs/user/apidoc.dox 2007-03-18 23:32:27 UTC (rev 20391) +++ haiku/trunk/docs/user/apidoc.dox 2007-03-19 09:38:47 UTC (rev 20392) @@ -0,0 +1,686 @@ +// +// Copyright 2007, Haiku Inc. All Rights Reserved. +// +// Distributed under the terms of the MIT License. +// +// +// Documentation by: +// Niels Sascha Reedijk +// + +/*! + \page apidoc Documenting the API + + This article explains how to document the API. It's intended audience are the + Haiku developers that want to document their own classes, and also the + members of the API Documentation team who want to brush up the documentation. + + This document is divided into three sections. \ref formalrequirements + describes the demands that are made from the markup and + spacing of the files. \ref commands describes the subset + of Doxygen commands the Haiku API documentation uses, and which commands + are used in which situation. \ref style describes the + writing style that is required. The demands are both on the required sections + in the documentation as well as on the wording of that documentation. + + If you are a developer and you want to prepare the first version of the + documentation for the API documentation team to go over, have a good look + at the formal requirements and the doxygen commands, and have a quick glance + at how to write member and class documentation, since you'll need to know + which information should definately be in the documentation. Aspiring members + or members of the API documentation team should read the third section + carefully, and should also check out some of the finished documentation to + get a good grip on the actual tone, style and contents of the documentation. + + \section formalrequirements Formal Requirements + + This section describes formal requirements, such as location and naming of + the files, the header blocks of files, what blocks of documentation look like + and how to put delimeters to separate different 'blocks' in your source file. + + \subsection formalrequirements_location Location of the Documentation Source + + Doxygen, the tool that we use to generate the marked up documentation with, + has an ingenious parser that is able to scan through both header and source + files and that makes it possible to document the API directly in the headers + or the source. However, the Haiku project decided not to put the + documentation in either location, and opt for the third option Doxygen gives: + to put the documentation in separate files. + + \note The reasons to not put the + documentation in the header files are twofold. First of all, it would + unnecesarily add much cruft to the headers that the compiler will have to + parse unneededly. File access and speed isn't BeOS and Haiku's best quality. + The second reason is that the system headers are included throughout the + tree. It's a waste of electricity to have everybody recompile the entire tree + if someone fixes a typo in the documentation. Likewise, the reason to not put + the documentation in the source is that it unnecesarily clutters up that + source. By not using direct documentation we lose some advantages, like the + fact that developers might be inclined to update the documentation quicker + if they change a method, but as you will see we'll have some methods in place + to prevent that to a certain extend. + + There are a few aspects to naming and location of files: + -# Most important, documentation files \b mirror header files. This not only + means that they get the same name, but also that the order of the methods, + variables, functions, etc. will have to be the same. + -# The root directory of the public API headers is at \c /trunk/headers/os. + In a similar vein, the root of the documentation files is at + \c /trunk/src/documentation/haiku_book. The subdirectory structure, or + the division of kits, will also be replicated. + -# The name of the files is the same as the base of the header files, with + the \c dox extension. So \c Something.h becomes \c Something.dox. Note + the case! + + \subsection formalrequirements_headerblock The Header Block + + Every documentation file will begin with the header block. It's basically a + copyright block, with a reference to the author and with the revision against + which the documentaton was written. + + \verbatim +// +// Copyright 2007, Haiku Inc. All Rights Reserved. +// +// Distributed under the terms of the MIT License. +// +// +// Documentation by: +// Niels Sascha Reedijk +// Corresponds to: +// /trunk/headers/os/support/String.h rev 19731 +// /trunk/src/kits/support/String.cpp rev 19731 +// + \endverbatim + + The example above has a few elements that you should take note of: + -# First of all, every line starts with a C++ single line style comment. + So it starts with two slashes: \c //. If there is text on a line, the + tokens are followed by \e one space. If the text is part of a category, + such as Documentation by, put two spaces after the delimeter. + -# We start with a copyright notice. The first line is empty, then the + copyright notice, then another empty line, and then the line on \e MIT, + followed by two empty lines. + -# Then there is a label Documentation by:, which is followed by + lines with names and email addresses between brackets. + -# The final part is underneath the label Corresponds to:. + Underneath there is a list of files and their svn revisions that the + current documentation is known to correspond with. + -# The header block ends with an empty C++ comment, and the next block that + follows underneath will start after an empty line. + + \subsection formalrequirements_blocks Blocks + + Blocks are the basic units of documentation for Doxygen. At first it will + feel like overkill to use blocks, but realize that Doxygen was initially + designed to operate on header and source files, and then the blocks of + documentation would be before the definition or declaration of the + methods, functions, etcetera. Doxygen is used to blocks and that's why we + need to reproduce them in our \c dox files. + + Blocks should adhere to the following standards: + -# All blocks open with \c /*! and close with \c * / + -# The documentation is in between these markers. + -# All the contents in between the markers is indended by two spaces. + -# The maximum width of contents between blocks is 80 columns. Try not + to cross this limit, because it will severely limit readability. + + Example: + \verbatim +/*! + \fn bool BList::AddItem(void *item) + \brief Append an item to the list. + + \param item The item to add. + \retval true The item was appended. + \retval false Item was not appended, since resizing the list failed. + \sa AddItem(void *item, int32 index) +* / + \endverbatim + + \note Doxygen also allows to use single line comments, starting with \c //!, + however, we won't use these \b except in case of group markers, which you + can read more about in the next section. + + \subsection formalrequirements_delimeters Delimeters + + Many of the header files in the Haiku API just document one class or one + group of functions. However, there might want to come a time that you come + across a more complex header and for the sake of clarity of your \c dox file + you want to mark the sections. Use the standard delimiter marker for this, + which consists of five slashes, a space, the title of the section, a space + and another five slashes. Like this: ///// Global Functions /////. + + \note This is only for the source files and for you as documenter. It will + not show up in the actual generated documentation! + + \section commands Doxygen Commands + + This section describes all the Doxygen commands that will be used in the + Haiku API documentation. As a rule, Doxygen commands start with a backslash + (\\) and are followed by whitespace (such as a space or a newline), with the + exception of group markers, which will be discussed later on. The commands + can be divided into several categories, which will be described in the + following subsections. + + \note This section does not discuss which commands you should actually use + in documentation. See the next section on \ref style + on that. This section merely explains the different groupings and + syntaxes of commands. + + Most commands accept an argument. Arguments can be either of these three + types: + - \ - The argument is a single word. + - (until the end of the line) - The argument runs until the end of the line. + - {paragraph} - The argument runs for an entire paragraph. A paragraph is + ended by an empty line, or if another command that defines a \ref + commands_sections sections is found. Note that if you use commands that + work on a paragraph and you split it over multiple lines (because of the + maximum line width of 80 characters or because it looks better), you will + have to indent subsequent lines that belong to the paragraph with two more + spaces, making the total of four. This is to visually distinguish + paragraphs for other documenters. + + \subsection commands_definitions Block Definitions + + Because our API documentation is not done in the source, nor in the headers, + Doxygen needs to be helped with figuring out what the documentation in the + different blocks actually are about. That's why the first line in a + documentation block would be one of the following commands: + + - \c \\class \ \n + Tells doxygen that the following section is going to be on + the class as specified by \a name. + - \c \\fn (function declaration) \n + This block is going to be about the function that corresponds to the given + declaration. Please note that the declaration is what you find in the source + file, so if class members are declared, the classname and the scope operator, + \c ::, are to be added as well. Modifiers such as \c const should be + included. + - \c \\var (variable declaration) \n + This block is going to be about the variable indicated by the declaration. + This means basically that data members of a class should have the classname + and the scope operator as well. + - \c \\typedef (typedef declaration) \n + This block is going to be about the typedef indicated by the declaration. + Copy the declaration exactly, including the leading \c typedef keyword. + - \c \\struct \ \n + Tells doxygen the section is going to be on the \c struct indicated by + \a name. + - \c \\def \ \n + This block is going to be about the \c \#define with the identifier \a name. + - \c \\page \n + This block represents a page. See the section on \ref commands_pages for + detailed information on pages. + + \subsection commands_sections Sections in Member Documentation + + If you have a look at the output that Doxygen generates, you can see that + there are recuring sections in the documentation. Documentation that belongs + to a certain section should be placed after a command that marks the start + of that section. All the commands take a paragraph as answer. A paragraph + ends with a whitespace, or with a command that marks a new section. Note that + this list only shows the syntax of the commands. For the semantics, have a + look at the next section on style. In member documentation you can use the + following: + + - \c \\brief {brief description} \n + This is the only \b obligatory section. Every member should have at least + a brief description. + - \c \\param \ {parameter description} \n + This section describes a parameter with the name \a parameter-name. The + parameter name must match the function declaration, since doxygen will + check if all the documented parameters exist. + - \c \\return {description of the return value} \n + This section describes the return value. This is a totally free form + paragraph, whereas \c \\retval has a more structured form. + - \c \\retval \ {description} \n + This section describes the return value indicated by \a value. + - \c \\see {references} \n + This section contains references to other parts of the documentation. + + There are also a number of things that can be used in pages and member + documentation. See the style section to find out which one to use when. + + - \c \\note {text} + - \c \\attention {text} + - \c \\warning {text} + - \c \\remarks {text} + + \subsection commands_markup Markup + + Sometimes you might certain text to have a special markup, to make words + stand out, but also if you want to have example code within the documentation + you'll need a special markup. Doxygen defines three types of commands. + There are commands that work on single words, commands that work on longer + phrases and commands that define blocks. Basically, the single letter + commands are commands that work on a the next word. If you need to mark + multiple words or sentences, use the HTML-style commands. Finally, for + blocks of code or blocks of text that need to be in "typewriter" font, use + the block commands. Have a look at the listing: + + - \c \\a \n + Use to refer to parameters or arguments in a running text, for example + when refering to parameters in method descriptions. + - Bold text + - For single words, use \c \\b. + - For multiple words, enclose between the \c \ and \c \<\\b\> tags. + - Typewriter font \n + This can be used to refer to constants, or anything that needs to be in + a monospace, or typewriter, font. There are a few options + - \c \\c for single words. + - \c \ and \c \<\\tt\> for multiple words or phrases + - The commands \c \\verbatim and \c \\endverbatim. Everything between these two + commands will be put in a distinct block that stands out from the rest of the + text. + - The commands \c \\code and \c \\endcode do the same, but Doxygen will parse the + contents and try to mark up the code to make it look just a bit nicer. + - Emphasis + - \c \\e for single words. + - \c \ and \c \<\\em\> for phrases. + + \subsection commands_pages Page Commands + + Pages are a very special element of the documentation. They are not + associated with any kind of module, such as files or classes, and therefore, + since they're not members, some of the structuring commands won't work. + Important to know is that a page is the complete length of the block, so + dividing it up in subsections by starting new blocks will not work. Instead, + doxygen provides some commands to structure text on a page. + + First of all, you define a new page by using the \c \\page command. This + command takes two arguments: a \c \ and (a title). The name + is the internal identifier that can be used in linking between pages (see + \ref commands_miscellaneous for \c \\ref). After you've defined the block + to be a page, you can start writing the contents. + + For more complicated pages, you might want to divide the page up in sections. + Use the \c \\section command to define a new section. It takes the same + arguments as \c \\page, namely the \c \ and the (title). If + you need a deeper hierarchy you may sue \c \\subsection and + \c \\subsubsection, again, both with the same syntax. If you need to + distinguish between sections in subsubsections, you are able to use + \c \\paragraph, which takes the same arguments. + + \note Before and after each of the commands above, you need to have an empty + line for readability. It is not necessary to indent sections and subsections + more than the normal two spaces, as long as you keep the section markers + clear. + + \warning If you are entering the realm of subsections and subsubsections, + think about the nature of your page. Either it needs to be split up into + multiple pages, or what you're writing is too complex and would be better + off as a big tutorial on the Haiku website. + + If you are creating multiple pages that are related, you will be able to + structure them in a tree by using the \c \\subpage command. This will rank + the different pages in a tree structure. It will put a link in the place of + the command, so you should place it at the top of the parent place and use + it as an index. + + \subsection commands_grouping Member Grouping Commands + + Doxygen makes it possible to group certain members together. It is used + in the BString class for example, where the members are grouped by what kind + of operation they perform, such as appending, finding, etc. Defining groups + is currently not as powerful as it could be, but if you use it inside classes, + you will be fine if you follow the instructions presented in this section. + + \note If you are looking on how to add classes to kits, see + \ref commands_miscellaneous and have a look at the \c \\ingroup command. + + Groups of members are preceeded by a block that describes what the group is + about. You are required to give each group of members at least a name. Have + a look at the example: + + \verbatim +/*! + \\name Appending Methods + + These methods append things to the object. +* / + +//! \@{ + +... names of the methods ... + +//! \@} + \endverbatim + + The block preceeding the block opening marker, //! \@{, contains a + \c \\name command and a paragraph that gives a description. The header block + can be as long or short as you want, but please don't make it too long. See + the \ref style section on how to effectively write group headers. The + members that you want to belong to the group are between the group opening + and closure markers. + + \note Group headers don't have a \c \\brief description. + + \subsection commands_miscellaneous Miscellaneous Commands + + There are some commands that don't fit into the categories above, but that + you will end up using every now and then. This section will describe those + commands. + + The first one is \c \\n. This commands sort of belongs to the category of + markup commands. It basically forces a newline. Because doxygen parses + paragraphs as continuous, it's not possible to mark up the text using returns + in the documentation. \c \\n forces a newline in the output. So in HTML it + will be translated into a \c \. + + Sometimes there are some parts of the API that you don't want to be visible. + Since Doxygen extracts all the public and protected members from a class, + and virtually every member from a file, you might want to force it to hide + certain things. If so, use the \c \\internal command. If you place this just + after the block marker, the command will be hidden from documentation. Any + further documentation or remarks you put inside the block will not be visible + in the final documentation. + + Images can be a valuable addition to documentation. To include ones you made, + use the \c \\image command. It has the following prototype: + \\image \ \. The format is currently fixed at + \c html. The file refers to the filename relative to the location of the + documentation file. Any images you want to add should be in the same location + as the dox file, so only the file name will suffice. + + Modules are defined in the main book, and you can add classes to them by + using the \c \\ingroup command. This commands adds the class to the module + and groups it on a separate page. At this moment, the group handling is till + to be worked out. For now, add the classes to the kit they belong in. In the + future this might change. + + Finally, it is a good idea to link between parts of the documentation. There + are two commands for that. The first one is \c \\ref, which enable you to refer + to pages, sections, etc. that you created yourself. The second one is \c \\link + which refers to members. The first one is takes one word as an argument, the + name of the section, and it inserts a link with the name of the title. \c \\link + is more complex. It should always be accompanied by \c \\endlink. The first + word between the two commands is the object that is referred to, and the + rest is the link text. + + \section style Writing Guidelines + + This final section will present guidelines for the actual writing of the + documentation. Both the structure of the documentation, which sections to + use when, and the style of the writing will be discussed. Before diverging + into the requirements for file and class descriptions, member descriptions and pages, + there are some general remarks that apply to all types of documentation. + + First of all, everything you write should be in proper English + sentences. Spelling, grammar, punctuation, make sure you adhere to the + standards. It also means the following: + - It means that every sentence should at least have a + subject and a verb (unless it's an imperative statement). + - Also use the proper terminology. Remember, you are dealing with C++ + here, which means you should use the right names. So use \b method instead + of function, and data member instead of variable (where appropriate). + - Avoid informalism. Avoid constructs like 'if you want to disconnect the + object', but rather use 'to disconnect the object'. Avoid familiarisms, or + jokes. + + \remarks It isn't the goal to create dry, legal-style documentation. Just + try to find a balance. Read through documentation that's already been + approved to get a hint of what you should be aiming at. + \remarks If you are having a problem with phrasing certain things, put it + down in such a way that it says everything it needs to. A proofreader might + be able to put it in better words. + + Throughout the documentation you might want to provide hints, warnings or + remarks that might interrupt the flow of the text, or that need to visually + stand out from the rest. Doxygen provides commands for paragraphs that + display remarks, warnings, notes and points of attention. You can use these + commands in case you meet one or more of the following requirements: + - The point is for a specific audience, such as beginners in + the Haiku API. Notes on what to read first, or mistakes that can be made + by beginners will not be for the entire audience, and such should be + separated. These kinds of notes should be at the end of blocks. + - The point needs to visually stand out. This is especially the case with + remarks, but could also apply for other types. + - The point is not completely relevant to the text and therefore should be + separated so that it doesn't interrupt the main flow. + + This listing shows which one to use when: + - \c \\attention + - Used when the developer is bound to make a mistake, when the API is + ambiguous. The difference to a warning is that warnings warn for things + that are the developer's fault, and attention blocks warn for things that + might go wrong because of the way the API is structured. + - Used to warn for abuse of the API that might be caused by the way the + internals of the system are structured. + - \c \\warning + - Used to warn developers for using the API in a certain way. Warnings + apply especially to new developers that aren't completely familiar with + the API and that might want to abuse it. For example, the thread safety + of BString requires a warning. + - \c \\note + - Used to place references to other documentation that might not be + directly related to the text. For example, BLooper will have a direct + reference to BHandler in the class description, but BMessenger will be + mentioned in a note because it does not directly influence the use of + the class. + - Can also be used for useful hints or notes that somehow need to stand + out from the rest of the text. + - Remarks interact with the text, notes add something unmentioned to it. + - \c \\remarks + - Remarks are small notes that would interrupt the flow of the text. For + example, if you in a text ignore a certain condition that is so extremely + rare and uncommon, you can put a remark at the end of the text to tell + that you have been lying. + - Remarks interact with the text, notes add something unmentioned to it. + + \subsection style_files File Descriptions + + The design of Doxygen makes it very file oriented, and this might come off as + inconvenient. At the moment, how to actually group the documentation is still + under debate, but it does not change the requirement that a header needs to + be documented before the members of that header can be documented. As such, + the first documentation block in your \c dox file will be the block that + describes the header. Examples: + + \verbatim +/*! + \file String.h + \brief Defines the BString class and global operators and functions for + handling strings. +* / + +/*! + \file SupportDefs.h + \brief Defines basic types and definitions for the Haiku API. +* / + \endverbatim + + The first statement defines what the block is about, namely the header file. + The second element is the \c \\brief remark on what it contains. The first + file defines the BString class and some global operators. You can see that + reflected in the description. SupportDefs.h does not define classes, but + rather a range of different functions and defines, so the text refers to + that. + + \remarks \\brief documentation for files is about what it \e implements, as + header files are passive (whereas members and functions are active). Thus, + use the third person form of the verb. + + \subsection style_classes Class Descriptions + + Classes are the basic building blocks in the Haiku API and as such will have + extensive documentation. This section will go over the actual class + description. This section will present a list of items you should think about + when writing the class description. This doesn't mean you'll have to put + every item in, it merely serves as a guiding principle that helps organise + your thoughts. Have a look at the list: + + -# The \c \\brief description is \b obligatory. This description describes + what it is. For example, BDataIO: "Abstract interface for objects that + provide read and write access to data." Note that this description is not + a full sentence, but it does end with a period. + -# One or more paragraphs that give a broad overview of what the class can + do. Describe things like what it works on, when you want to use it, what + advantage it might give over other directly related alternatives. Also + describe if a class is made to be derived from, and if so, how. Make + sure that a developer in the first few paragraphs can judge if what he + wants to do can be done with this class. + -# One or more paragraphs that show how this class ties in with the rest + of the kit or the API. What objects does it work with, how does it interact + with the servers, etcetera. + -# One or more paragraphs that give a concrete example or use case. Keep it + tidy and selfcontained. Remember, an example can tell more than a few + paragraphs of text. + -# End with a list of references to other classes, functions, pages, etc. + might be of interest for the reader. + + When documenting classes, don't be to exhaustive. Avoid becoming a tutorial + or a complete guide. This documentation is for reference only. If you want to + enlighten the reader on bigger subjects, consider writing a separate + documentation page that connects the different points you want to make. + + Also, you don't have to put in any groupings of members in class descriptions. + If you want to do that, physically divide the members up in groups. Look at + the \ref commands_grouping for the actual commands, and at \ref style_groups + for help on writing group headers. + + \subsection style_members Members and Functions + + Members and functions share the same basic doxygen syntax, and they can be + documented in a similar way. That's why this section deals with them together. + Documenting members is probably the main thing you'll do when writing the + actual documentation. There are some guidelines as to how, but the actual + implementation probably differs per class. Keep the following points in mind: + + -# To repeat a very important fact, the first line is a \c \\fn line. This + line needs to match the declaration, which is in the source file. This + means that for members, also the class name and the scope indicator (::) + should be present. Also note that this line doesn't have to adhere to + the 80 column width limit. + -# The first command is always the \c \\brief command. Give a short and + clear description. The description starts with a capital letter and ends + with a dot. Don't write the description saying what the method does, + like "Starts the timer", but rather as what it will do: "Start the timer." + -# If the brief description doesn't cover all the method or function does, + then you can add a few paragraphs that explain it in more depth. Don't be + to verbose, and use an example to illustrate points. Point out any + potential misunderstandings or problems you expect developers to have, but + don't repeat the class documentation too much. + -# You are obliged to then document all the parameters. Use the \c \\param + command for that. For the description, use a short phrase such as "The + offset (zero based) where to begin the move." Note the capital and the dot. + -# If the function is non-void, then you'll have to specify what it will + return. In case of fixed values, have a look at \c \\retval. You'll use + this one when the return type is a bool or a status_t. In case of something + else, use \c \\return. You can also combine these two. For example, a + method that returns a lenght (positive) or an error code (negative). + -# Use \c \\see if you have any references to other methods, classes or + global functions. At least document all the overloaded methods. Also add + methods that do the opposite of this method, or methods that are intimately + related. + + In case of overloaded members, you'll need to make a decision. If you need + to copy too much information, you might resort to put in one paragraph with + the text "This is an overloaded member function, and differs from \ only + by the type of parameter it takes." That will keep the copying down and will + point developers right to the place where they can get more documentation. + + Again, like class descriptions, you'll have to find a good middle-ground + between too much information, and too little. Again, write for the broadest + audience possible, and resort to notes and warnings for specialised + audiences. + + \subsection style_variables Enumerations, Variables and Defines + + This section helps you document (member) variables and defines that define + constant, as well as enumerations and their values. If you need to document + a \c \#define macro that takes arguments, have a look at \ref style_members . + + The \c \\brief description of all these types follow a similar structure. + They are a short phrase that mentions what the variable contains. Example: + + \verbatim +/*! + \var char* BString::fPrivateData + \brief BString's storage for data. + + This member is deprecated and might even go \c private in future releases. + + If you are planning to derive from this object and you want to manipulate the raw + string data, please have a look at LockBuffer() and UnlockBuffer(). +* / + \endverbatim + + The variables you are going to encounter are either \c public or + \c protected member variables, or global variables that have a certain + significance. In the case of member variables, you'll need to document what + they mean and how the developer should manipulate it. If the class is one + that is meant to be derived from, make sure that in the + description of the variable you mention how it interacts with the others, and + how the developer should make sure that the internal coherence of the data + and code members of the inherited class is maintained. + + Global variables will mostly be constants. If so, document what they stand + for and what they might be used for, as well as which classes and functions + depend on that constant. If the variable is meant to be changed by the + developer, explain what values are valid and which functions and classes + depend on this variable. + + Defines are usually used as message constants. Give a short description of + what the message constant stands for, and where it might be send from and + where it might be received. + + Enumerations can either be anonymous or named. In case of the latter, you can + give a description of the enumeration in a documentation block that starts + with an \c \\enum command, followed by the name of the enumeration. If the + enumeration is within the scope of a class, prepend the classname and the + scope indicator. In case of an anonymous enum, you can only document the + individual members (which you should do for the named enumerations as well), + which can be done within code blocks that start with the \c \\var command. + Doxygen will know that it's an enumeration value, don't worry about mixups. + If the enumeration value is within a class, prepend the classname and scope + indicator. Give a short description of the value, which methods react to it, + where it might be used, etcetera. Don't go as far as to copy information too + much. For example, if you use an enumeration in only one class and you + document the possible values there, then don't do that again for the + enumeration documentation: rather just refer to it. That sort of documentation + belongs to the class description, not to the enumeration. + + \subsection style_groups Groups + + If you subdivide members of classes into groups, you have the ability to + apply some general information that will be listed above the listing of the + members in that group. See the section \ref commands_grouping on how to + define groups. This section is on what to put in the header block. + + First of all, it's probably a good idea to give your group a name. This name + will be printed as a title and will enhance the clarity of what the group + contains. If you put the \c \\name command as the first command of a + group, the rest of the words on that line will be used as title. You should + chose simple titles, no more than three words. + + It's possible to add one or two paragraphs of information. These paragraphs + should contain some quick notes on which of the members in that group to use + for what cause. See it as a quick subdivision which a developer could use + as a guide to see which method he actually wants to use. Don't go on + describing the methods in detail though, that's what the member documentation + is about. Have a look at the example: + + \verbatim +/*! + \name Comparison Methods + + There are two different comparison methods. First of all there + is the whole range of operators that return a boolean value, secondly + there are methods that return an integer value, both case sensitive + and case insensitive. + + There are also global comparison operators and global compare functions. + You might need these in case you have a sort routine that takes a generic + comparison function, such as BList::SortItems(). + See the String.h documentation file to see the specifics, though basically + there are the same as implemented in this class. +* / + \endverbatim + + Straight, to the point, gives no more information than necessary. Divides + the members up into two groups and refers to other functions the developer + might be looking for. The hard limit is two (short) paragraphs. Using more + will not improve clarity. + +*/ \ No newline at end of file Modified: haiku/trunk/docs/user/support/DataIO.dox =================================================================== --- haiku/trunk/docs/user/support/DataIO.dox 2007-03-18 23:32:27 UTC (rev 20391) +++ haiku/trunk/docs/user/support/DataIO.dox 2007-03-19 09:38:47 UTC (rev 20392) @@ -1,405 +1,426 @@ +// +// Copyright 2007, Haiku Inc. All Rights Reserved. +// +// Distributed under the terms of the MIT License. +// +// +// Documentation by: +// Niels Sascha Reedijk +// Stefano Ceccherini (burton666 at libero.it) +// Corresponds to: +// /trunk/headers/os/support/DataIO.h rev 17981 +// /trunk/src/kits/support/DataIO.cpp rev 17981 +// + /*! -\file DataIO.h -\brief Provides abstract BDataIO and BPositionIO and the derived BMallocIO and BMemoryIO classes. + \file DataIO.h + \brief Defines abstract BDataIO and BPositionIO and the derived BMallocIO and BMemoryIO classes. -Pure virtual BDataIO and BPositioIO classes provide -the protocol for Read()/Write()/Seek(). + Pure virtual BDataIO and BPositioIO classes provide + the protocol for Read()/Write()/Seek(). -BMallocIO and BMemoryIO classes implement the protocol, -as does BFile in the Storage Kit. + BMallocIO and BMemoryIO classes implement the protocol, + as does BFile in the Storage Kit. */ -//////////// BDataIO +///// BDataIO ///// /*! -\class BDataIO -\ingroup support -\ingroup libbe -\brief Abstract interface for objects that provides read and write access to data. + \class BDataIO + \ingroup support + \ingroup libbe + \brief Abstract interface for objects that provide read and write access to + data. -The interface provided by this class applies to objects or data that are -limited to reading and writing data. Classes derived from this class should -reimplement both the Read() and Write() method from this class. + The interface provided by this class applies to objects or data that are + limited to reading and writing data. Classes derived from this class should + reimplement both the Read() and Write() method from this class. -Candidates of types of data or objects that should be derived from this class -are probably broadcasting media streams (which don't support reading at a -certain point in the data) or network streams that output data continously. -Objects and data that support more advanced operations like seeking or -reading at writing at defined positions should derive their classes from -BPositionIO, which inherits this class. + Candidates of types of data or objects that should be derived from this class + are probably broadcasting media streams (which don't support reading at a + certain point in the data) or network streams that output data continously. + Objects and data that support more advanced operations like seeking or + reading at writing at defined positions should derive their classes from + BPositionIO, which inherits this class. */ /*! -\fn BDataIO::BDataIO() -\brief This constructor does nothing. + \fn BDataIO::BDataIO() + \brief This constructor does nothing. */ /*! -\fn BDataIO::~BDataIO() -\brief This destructor does nothing. + \fn BDataIO::~BDataIO() + \brief This destructor does nothing. */ /*! -\fn virtual ssize_t BDataIO::Read(void *buffer, size_t size) = 0 -\brief Pure virtual to read data. + \fn virtual ssize_t BDataIO::Read(void *buffer, size_t size) = 0 + \brief Pure virtual to read data. -Your implementation should copy data into \c buffer, with the maximum size -of \c size. -\return You should return the amount of bytes actually read, or an error code - in case of failure. + Your implementation should copy data into \c buffer, with the maximum size + of \c size. + \return You should return the amount of bytes actually read, or an error code + in case of failure. */ /*! -\fn virtual ssize_t BDataIO::Write(const void *buffer, size_t size) = 0 -\brief Pure virtual to write data. + \fn virtual ssize_t BDataIO::Write(const void *buffer, size_t size) = 0 + \brief Pure virtual to write data. -Your implementation should copy data from \c buffer, with the maximum size -of \c size. -\return You should return the amount of bytes actually written, or an error code - in case of failure. + Your implementation should copy data from \c buffer, with the maximum size + of \c size. + \return You should return the amount of bytes actually written, or an error + code in case of failure. */ //////////// BPositionIO /*! -\class BPositionIO -\ingroup support -\ingroup libbe -\brief Abstract interface that provides advanced read, write and seek access to data. + \class BPositionIO + \ingroup support + \ingroup libbe + \brief Abstract interface that provides advanced read, write and seek access + to data. -The interface of this object applies to objects or data that allows -position-aware reading and writing of data. Classes that derive from this -class should at least reimplement ReadAt(), WriteAt(), Seek(), Position(), -SetSize() and GetSize() methods. + The interface of this object applies to objects or data that allows + position-aware reading and writing of data. Classes that derive from this + class should at least reimplement ReadAt(), WriteAt(), Seek(), Position(), + SetSize() and GetSize() methods. -A good example of a form of data that can derive from this object, are files. -The BFile class derives from BPositionIO and provides this interface to files. -If your object or data only supports linear reading and writing, consider -deriving from the baseclass BDataIO. + A good example of a form of data that can derive from this object, are files. + The BFile class derives from BPositionIO and provides this interface to + files. If your object or data only supports linear reading and writing, + consider deriving from the baseclass BDataIO. -A final note, from BDataIO this class inherits Read() and Write(). The default -implementation is to read or write the data at the current position indicated -by Position(). Reimplement the methods if you require a different behaviour. + A final note, from BDataIO this class inherits Read() and Write(). The + default implementation is to read or write the data at the current position + indicated by Position(). Reimplement the methods if you require a different + behaviour. */ /*! -\fn BPositionIO::BPositionIO() -\brief This constructor does nothing. + \fn BPositionIO::BPositionIO() + \brief This constructor does nothing. */ /*! -\fn virtual BPositionIO::~BPositionIO() -\brief This destructor does nothing. + \fn virtual BPositionIO::~BPositionIO() + \brief This destructor does nothing. */ /*! -\fn virtual ssize_t BPositionIO::Read(void *buffer, size_t size) -\brief Read data from current position. + \fn virtual ssize_t BPositionIO::Read(void *buffer, size_t size) + \brief Read data from current position. -This method is derived from BDataIO. The default implementation reads data from -the current position of the cursor, pointed at by Position(). If you require -different behaviour, please look at BDataIO::Read() for what is expected of -this method. + This method is derived from BDataIO. The default implementation reads data + from the current position of the cursor, pointed at by Position(). If you + require different behaviour, please look at BDataIO::Read() for what is + expected of this method. */ /*! -\fn virtual ssize_t BPositionIO::Write(const void *buffer, size_t size) -\brief Write data to the current position. + \fn virtual ssize_t BPositionIO::Write(const void *buffer, size_t size) + \brief Write data to the current position. -This method is derived from BDataIO. The default implementation writes data to -the current position of the cursor, pointed at by Position(). If you require -different behaviour, please look at BDataIO::Write() for what is expected of -this method. + This method is derived from BDataIO. The default implementation writes data + to the current position of the cursor, pointed at by Position(). If you + require different behaviour, please look at BDataIO::Write() for what is + expected of this method. */ /*! -\fn virtual ssize_t BPositionIO::ReadAt(off_t position, void *buffer, size_t size) = 0 -\brief Pure virtual to read data from a certain position. + \fn virtual ssize_t BPositionIO::ReadAt(off_t position, void *buffer, size_t size) = 0 + \brief Pure virtual to read data from a certain position. -Your implementation should copy data from the position indicated by \c position -into the \c buffer with the maximum size of \c size. + Your implementation should copy data from the position indicated by + \a position into the \a buffer with the maximum size of \a size. -\return The amount of bytes actually read, or an error code. + \return The amount of bytes actually read, or an error code. */ /*! -\fn virtual ssize_t BPositionIO::WriteAt(off_t position, const void *buffer, size_t size) = 0 -\brief Pure virtual to write data to a certain position. + \fn virtual ssize_t BPositionIO::WriteAt(off_t position, const void *buffer, size_t size) = 0 + \brief Pure virtual to write data to a certain position. -Your implementation should copy data from \c buffer to the position indicated -by \c buffer with the maximum size of \c size. + Your implementation should copy data from \a buffer to the position indicated + by \a buffer with the maximum size of \a size. -\return The amount of bytes actually written, or an error code. + \return The amount of bytes actually written, or an error code. */ /*! -\fn virtual off_t BPositionIO::Seek(off_t position, uint32 seekMode) = 0 -\brief Pure virtual to move the cursor to a certain position. + \fn virtual off_t BPositionIO::Seek(off_t position, uint32 seekMode) = 0 + \brief Pure virtual to move the cursor to a certain position. -Your implementation should move the position of the cursor to the provided -point. What this actually means, depends on your object or data. + Your implementation should move the position of the cursor to the provided + point. What this actually means, depends on your object or data. -\param position An integer that defines a position. -\param seekMode You will get one of the following values: - - \c SEEK_SET Set the cursor to the position indicated by \c position. - - \c SEEK_END Set the cursor to the end of the buffer, and go - \c position beyond that. - - \c SEEK_CUR Set the cursor the the current position plus \c position. -\return The new position. + \param position An integer that defines a position. + \param seekMode You will get one of the following values: + - \c SEEK_SET Set the cursor to the position indicated by \c position. + - \c SEEK_END Set the cursor to the end of the buffer, and go + \c position beyond that. + - \c SEEK_CUR Set the cursor the the current position plus \c position. + \return The new position. */ /*! -\fn virtual off_t BPositionIO::Position() const = 0 -\brief Pure virtual to return the current position of the cursor. + \fn virtual off_t BPositionIO::Position() const = 0 + \brief Pure virtual to return the current position of the cursor. -\return -Your implementation should return the current position of the cursor. + \return Your implementation should return the current position of the cursor. */ /*! -\fn virtual status_t BPositionIO::SetSize(off_t size) -\brief Set the size of the object or data. + \fn virtual status_t BPositionIO::SetSize(off_t size) + \brief Set the size of the object or data. -The default implementation returns \c B_ERROR. If your object or data allows -the size to be changed, reimplement this method. + The default implementation returns \c B_ERROR. If your object or data allows + the size to be changed, reimplement this method. -\return Return \c B_OK if everything succeeded, else return the appropriate - error code. + \return Return \c B_OK if everything succeeded, else return the appropriate + error code. */ [... truncated: 950 lines follow ...] From bonefish at mail.berlios.de Mon Mar 19 19:25:57 2007 From: bonefish at mail.berlios.de (bonefish at BerliOS) Date: Mon, 19 Mar 2007 19:25:57 +0100 Subject: [Haiku-commits] r20393 - haiku/trunk/src/apps/terminal Message-ID: <200703191825.l2JIPvkb008617@sheep.berlios.de> Author: bonefish Date: 2007-03-19 19:25:56 +0100 (Mon, 19 Mar 2007) New Revision: 20393 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20393&view=rev Modified: haiku/trunk/src/apps/terminal/spawn.cpp Log: For some reason a Terminal started by Tracker or Deskbar does not have a valid stderr. Thus one of the FDs for the pipes created for the initial handshake with the fork()ed child process exec()ing the shell would have number 2 and would be closed when the child process set up the stdin/out/err environment for the shell, leading to the child and the parent being killed by a SIGPIPE when they tried to access the pipes. This change replaces the pipes mechanism by one using send/receive_data(), which is probably even faster. I also reduced the handshake_t::msg field to 128 bytes and replaced the sprintf()s writing to it by snprintf()s. Fixes bug #627. Although they looked related, bugs #113 and #928 still persist. Modified: haiku/trunk/src/apps/terminal/spawn.cpp =================================================================== --- haiku/trunk/src/apps/terminal/spawn.cpp 2007-03-19 09:38:47 UTC (rev 20392) +++ haiku/trunk/src/apps/terminal/spawn.cpp 2007-03-19 18:25:56 UTC (rev 20393) @@ -96,15 +96,11 @@ * execute SHELL program. */ -/* This pipe use handshake on exec. */ -int pc_pipe[2]; /* this pipe is used for parent to child transfer */ -int cp_pipe[2]; /* this pipe is used for child to parent transfer */ - /* handshake interface */ typedef struct { int status; /* status of child */ - char msg[256]; /* error message */ + char msg[128]; /* error message */ int row; /* terminal rows */ int col; /* Terminal columns */ } handshake_t; @@ -118,6 +114,22 @@ pid_t sh_pid; + +static status_t +send_handshake_message(thread_id target, const handshake_t& handshake) +{ + return send_data(target, 0, &handshake, sizeof(handshake_t)); +} + + +static void +receive_handshake_message(handshake_t& handshake) +{ + thread_id sender; + receive_data(&sender, &handshake, sizeof(handshake_t)); +} + + int spawn_shell(int row, int col, const char *command, const char *coding) { @@ -128,7 +140,7 @@ signal(SIGTTOU, SIG_IGN); /* - * Get a psuedo-tty. We do this by cycling through files in the + * Get a pseudo-tty. We do this by cycling through files in the * directory. The oparationg system will not allow us to open a master * which is already in use, so we simply go until the open succeeds. */ @@ -160,8 +172,8 @@ } if (master < 0) { - printf("didn't find any available pesudo ttys."); - return -1; + printf("didn't find any available pesudo ttys."); + return -1; } /* @@ -169,11 +181,7 @@ * on the pseudo terminal. */ - /* Create pipe that be use to handshake */ - if (pipe(pc_pipe) || pipe(cp_pipe)) { - printf ("Could not create handshake pipe."); - return -1; - } + thread_id terminalThread = find_thread(NULL); /* Fork a child process. */ if ((sh_pid = fork()) < 0) { @@ -189,15 +197,12 @@ * we cleared our original controlling terminal above. */ - // ToDo: why two of them in the first place? - close(cp_pipe[0]); - close(pc_pipe[1]); - /* Set process session leader */ if (setsid() < 0) { handshake.status = PTY_NG; - sprintf(handshake.msg, "could not set session leader."); - write(cp_pipe[1], (char *)&handshake, sizeof (handshake)); + snprintf(handshake.msg, sizeof(handshake.msg), + "could not set session leader."); + send_handshake_message(terminalThread, handshake); exit(1); } @@ -209,8 +214,9 @@ int slave = -1; if ((slave = open(tty_name, O_RDWR)) < 0) { handshake.status = PTY_NG; - sprintf(handshake.msg, "can't open tty (%s).", tty_name); - write(cp_pipe[1], (char *)&handshake, sizeof (handshake)); + snprintf(handshake.msg, sizeof(handshake.msg), + "can't open tty (%s).", tty_name); + send_handshake_message(terminalThread, handshake); exit(1); } @@ -295,8 +301,9 @@ */ if (tcsetattr (0, TCSANOW, &tio) == -1) { handshake.status = PTY_NG; - sprintf(handshake.msg, "failed set terminal interface (TERMIOS)."); - write(cp_pipe[1], (char *)&handshake, sizeof (handshake)); + snprintf(handshake.msg, sizeof(handshake.msg), + "failed set terminal interface (TERMIOS)."); + send_handshake_message(terminalThread, handshake); exit(1); } @@ -305,13 +312,14 @@ */ handshake.status = PTY_WS; - write(cp_pipe[1], (char *)&handshake, sizeof (handshake)); - read(pc_pipe[0], (char *)&handshake, sizeof (handshake)); + send_handshake_message(terminalThread, handshake); + receive_handshake_message(handshake); if (handshake.status != PTY_WS) { handshake.status = PTY_NG; - sprintf(handshake.msg, "missmatch handshake."); - write(cp_pipe[1], (char *)&handshake, sizeof (handshake)); + snprintf(handshake.msg, sizeof(handshake.msg), + "mismatch handshake."); + send_handshake_message(terminalThread, handshake); exit(1); } @@ -328,19 +336,16 @@ pid_t processGroup = getpid(); if (setpgid(processGroup, processGroup) < 0) { handshake.status = PTY_NG; - sprintf(handshake.msg, "can't set process group id."); - write(cp_pipe[1], (char *)&handshake, sizeof(handshake)); + snprintf(handshake.msg, sizeof(handshake.msg), + "can't set process group id."); + send_handshake_message(terminalThread, handshake); exit(1); } tcsetpgrp(0, processGroup); - /* mark the pipes as close on exec */ - fcntl(cp_pipe[1], F_SETFD, FD_CLOEXEC); - fcntl(pc_pipe[0], F_SETFD, FD_CLOEXEC); - /* pty open and set termios successful. */ handshake.status = PTY_OK; - write(cp_pipe[1], (char *)&handshake, sizeof (handshake)); + send_handshake_message(terminalThread, handshake); /* * setenv TERM and TTY. @@ -415,17 +420,13 @@ * that they can write and read the pseudo terminal. */ - /* close childs's side of the pipe */ - close(cp_pipe[1]); - close(pc_pipe[0]); - /* * close parent control tty. */ int done = 0; while (!done) { - read (cp_pipe[0], (char *)&handshake, sizeof (handshake)); + receive_handshake_message(handshake); switch (handshake.status) { case PTY_OK: @@ -441,7 +442,7 @@ handshake.row = row; handshake.col = col; handshake.status = PTY_WS; - write(pc_pipe[1], (char *)&handshake, sizeof (handshake)); + send_handshake_message(sh_pid, handshake); break; } } From korli at mail.berlios.de Mon Mar 19 20:07:33 2007 From: korli at mail.berlios.de (korli at BerliOS) Date: Mon, 19 Mar 2007 20:07:33 +0100 Subject: [Haiku-commits] r20394 - in haiku/trunk/src/add-ons/kernel/drivers/audio/echo: . generic generic/ASIC generic/DSP Message-ID: <200703191907.l2JJ7Xt3012130@sheep.berlios.de> Author: korli Date: 2007-03-19 20:06:47 +0100 (Mon, 19 Mar 2007) New Revision: 20394 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20394&view=rev Modified: haiku/trunk/src/add-ons/kernel/drivers/audio/echo/generic/ASIC/3G_ASIC.c haiku/trunk/src/add-ons/kernel/drivers/audio/echo/generic/C3g.cpp haiku/trunk/src/add-ons/kernel/drivers/audio/echo/generic/C3g.h haiku/trunk/src/add-ons/kernel/drivers/audio/echo/generic/C3gDco.cpp haiku/trunk/src/add-ons/kernel/drivers/audio/echo/generic/C3gDco.h haiku/trunk/src/add-ons/kernel/drivers/audio/echo/generic/CChannelMask.cpp haiku/trunk/src/add-ons/kernel/drivers/audio/echo/generic/CChannelMask.h haiku/trunk/src/add-ons/kernel/drivers/audio/echo/generic/CDaffyDuck.cpp haiku/trunk/src/add-ons/kernel/drivers/audio/echo/generic/CDarla.cpp haiku/trunk/src/add-ons/kernel/drivers/audio/echo/generic/CDarla.h haiku/trunk/src/add-ons/kernel/drivers/audio/echo/generic/CDarla24.cpp haiku/trunk/src/add-ons/kernel/drivers/audio/echo/generic/CDarla24.h haiku/trunk/src/add-ons/kernel/drivers/audio/echo/generic/CDspCommObject.cpp haiku/trunk/src/add-ons/kernel/drivers/audio/echo/generic/CDspCommObject.h haiku/trunk/src/add-ons/kernel/drivers/audio/echo/generic/CDspCommObjectVmixer.cpp haiku/trunk/src/add-ons/kernel/drivers/audio/echo/generic/CEchoGals.cpp haiku/trunk/src/add-ons/kernel/drivers/audio/echo/generic/CEchoGals.h haiku/trunk/src/add-ons/kernel/drivers/audio/echo/generic/CEchoGals_info.cpp haiku/trunk/src/add-ons/kernel/drivers/audio/echo/generic/CEchoGals_mixer.cpp haiku/trunk/src/add-ons/kernel/drivers/audio/echo/generic/CEchoGals_transport.cpp haiku/trunk/src/add-ons/kernel/drivers/audio/echo/generic/CGina.cpp haiku/trunk/src/add-ons/kernel/drivers/audio/echo/generic/CGina.h haiku/trunk/src/add-ons/kernel/drivers/audio/echo/generic/CGina24.cpp haiku/trunk/src/add-ons/kernel/drivers/audio/echo/generic/CGina24.h haiku/trunk/src/add-ons/kernel/drivers/audio/echo/generic/CIndigo.cpp haiku/trunk/src/add-ons/kernel/drivers/audio/echo/generic/CIndigo.h haiku/trunk/src/add-ons/kernel/drivers/audio/echo/generic/CIndigoIO.cpp haiku/trunk/src/add-ons/kernel/drivers/audio/echo/generic/CIndigoIO.h haiku/trunk/src/add-ons/kernel/drivers/audio/echo/generic/CLayla.cpp haiku/trunk/src/add-ons/kernel/drivers/audio/echo/generic/CLayla.h haiku/trunk/src/add-ons/kernel/drivers/audio/echo/generic/CLayla24.cpp haiku/trunk/src/add-ons/kernel/drivers/audio/echo/generic/CLayla24.h haiku/trunk/src/add-ons/kernel/drivers/audio/echo/generic/CMia.cpp haiku/trunk/src/add-ons/kernel/drivers/audio/echo/generic/CMia.h haiku/trunk/src/add-ons/kernel/drivers/audio/echo/generic/CMona.cpp haiku/trunk/src/add-ons/kernel/drivers/audio/echo/generic/CMona.h haiku/trunk/src/add-ons/kernel/drivers/audio/echo/generic/DSP/Darla24DSP.c haiku/trunk/src/add-ons/kernel/drivers/audio/echo/generic/DSP/Echo3gDSP.c haiku/trunk/src/add-ons/kernel/drivers/audio/echo/generic/DSP/Gina24DSP.c haiku/trunk/src/add-ons/kernel/drivers/audio/echo/generic/DSP/Gina24_361DSP.c haiku/trunk/src/add-ons/kernel/drivers/audio/echo/generic/DSP/IndigoDJDSP.c haiku/trunk/src/add-ons/kernel/drivers/audio/echo/generic/DSP/IndigoDSP.c haiku/trunk/src/add-ons/kernel/drivers/audio/echo/generic/DSP/IndigoIODSP.c haiku/trunk/src/add-ons/kernel/drivers/audio/echo/generic/DSP/Layla20DSP.c haiku/trunk/src/add-ons/kernel/drivers/audio/echo/generic/DSP/Layla24DSP.c haiku/trunk/src/add-ons/kernel/drivers/audio/echo/generic/DSP/MiaDSP.c haiku/trunk/src/add-ons/kernel/drivers/audio/echo/generic/DSP/Mona361DSP.c haiku/trunk/src/add-ons/kernel/drivers/audio/echo/generic/DSP/MonaDSP.c haiku/trunk/src/add-ons/kernel/drivers/audio/echo/generic/EchoGalsXface.h haiku/trunk/src/add-ons/kernel/drivers/audio/echo/generic/MixerXface.h haiku/trunk/src/add-ons/kernel/drivers/audio/echo/generic/OsSupportBeOS.cpp haiku/trunk/src/add-ons/kernel/drivers/audio/echo/generic/OsSupportBeOS.h haiku/trunk/src/add-ons/kernel/drivers/audio/echo/generic/family.h haiku/trunk/src/add-ons/kernel/drivers/audio/echo/multi.cpp Log: fixed some warnings in multi.cpp updated with Release B3 (I didn't test yet) : -Firmware to support new revision 5 Indigo io and Indigo dj hardware -Firmware to support new revision 4 Mia MIDI hardware -New FPGA & DSP code to correct problems with S/PDIF at 96 kHz on Gina3G (note new, longer timeout required in C3gDco.cpp) -Changes to support x64 Windows -Fix for 96 kHz on Mac OS X for Echo 3G -New QuerySampleRateRange method for all devices -Simplified channel mask classes -New ECHO_ASSERT macro to simplfy enabling and disabling asserts -Removed m_wBytesPerSample from CEchoGals; it wasn't being used and caused housekeeping problems for Adobe Audition recording in mono mode -Now using READ_REGISTER_ULONG and WRITE_REGISTER_ULONG macros to read and write DSP registers; these are automatically defined if the platform environment doesn't define them. Modified: haiku/trunk/src/add-ons/kernel/drivers/audio/echo/generic/ASIC/3G_ASIC.c =================================================================== --- haiku/trunk/src/add-ons/kernel/drivers/audio/echo/generic/ASIC/3G_ASIC.c 2007-03-19 18:25:56 UTC (rev 20393) +++ haiku/trunk/src/add-ons/kernel/drivers/audio/echo/generic/ASIC/3G_ASIC.c 2007-03-19 19:06:47 UTC (rev 20394) @@ -1,9 +1,7 @@ // 3g_asic (Converted by RBF2VxD) - - // ---------------------------------------------------------------------------- // -// Copyright Echo Digital Audio Corporation (c) 1998 - 2004 +// Copyright Echo Digital Audio Corporation (c) 1998 - 2007 // All rights reserved // www.echoaudio.com // @@ -31,7 +29,6 @@ // // *************************************************************************** - // The array is 78761 bytes. BYTE pb3g_asic[] = @@ -50,3505 +47,3505 @@ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x80,0x02,0x24,0x01,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x49,0x04, + 0x00,0x00,0x80,0x06,0x21,0x01,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x02,0x48,0x04, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x80,0x0e,0x21,0x01,0x00,0x00, + 0x00,0x00,0x80,0x82,0x20,0x09,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0xff,0x53,0x05, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x80,0xfc,0x4f,0x0d,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x04,0x41,0x0c, + 0x00,0x00,0x80,0xfc,0x4f,0x05,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x06,0x40,0x0c, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x80,0x0e,0x05,0x01,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0xfb,0x5a,0x01, + 0x00,0x00,0x80,0x86,0x01,0x01,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0xf9,0x5b,0x03, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0xf0,0x6a,0x05,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0xfb,0x5b,0x03, + 0x00,0x00,0x00,0x78,0x6e,0x05,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0xfb,0x5b,0x01, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0xfc,0x6b,0x05,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x00, + 0x00,0x00,0x00,0xf8,0x6e,0x05,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x60,0x03,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0xfb,0x49,0x00, - 0x0e,0x00,0x38,0x00,0xe0,0x04,0x80,0x13, - 0x00,0x46,0x00,0xd8,0x00,0x20,0x05,0x80, - 0x04,0x00,0x30,0x00,0xe4,0x01,0x60,0x03, - 0x00,0x1c,0x00,0x70,0x00,0xc0,0x01,0x40, - 0x07,0x80,0x1e,0xf0,0x26,0x01,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x03,0xa0,0x5f, - 0x00,0x3f,0x01,0xdc,0x06,0x30,0x0b,0xc0, - 0x2f,0x10,0x7f,0x01,0xec,0x04,0xb0,0x1b, - 0xc0,0x2f,0x00,0xbf,0x00,0x8c,0x07,0xf0, - 0x47,0xc0,0x0d,0x40,0xb7,0x50,0xfc,0x07, - 0x30,0x1b,0xc0,0x0f,0x80,0x0e,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x01,0x18,0x17, - 0x20,0xdd,0x00,0x44,0x01,0x10,0x11,0x40, - 0x67,0x20,0x57,0x00,0x74,0x03,0xd0,0x05, - 0x40,0x57,0x00,0xdf,0x80,0x6c,0x07,0xc0, - 0x45,0x40,0x30,0x05,0x51,0x30,0x44,0x13, - 0x14,0x1d,0x40,0x07,0x60,0x08,0x00,0x00, + 0x00,0x00,0x00,0x00,0x20,0x03,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0xf9,0x48,0x00, + 0x58,0x00,0x60,0x01,0x80,0x05,0x00,0x16, + 0x00,0x58,0x00,0x60,0x00,0x80,0x03,0xa0, + 0x1f,0x00,0x28,0x00,0xb8,0x01,0x60,0x02, + 0x80,0x19,0x00,0x2e,0x00,0x38,0x01,0xa0, + 0x04,0x00,0x12,0x78,0x22,0x01,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x03,0xa0,0x3f, + 0x04,0xf3,0x14,0xcc,0x07,0x30,0x1a,0xc0, + 0x7f,0x00,0xfb,0x21,0xfc,0x07,0xc0,0x07, + 0xc0,0x7f,0x00,0xed,0x00,0xec,0x07,0xd0, + 0x8b,0xc0,0x7c,0x00,0xf3,0x00,0xcc,0x02, + 0xb0,0x0f,0xc0,0x0f,0x00,0x0e,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x01,0x18,0xff, + 0x40,0xf1,0x03,0x45,0x07,0x14,0x1d,0xe0, + 0x77,0x20,0xd1,0x00,0x64,0x07,0xd0,0x15, + 0x40,0x74,0x00,0xd7,0x21,0x44,0x03,0xd0, + 0x41,0x50,0x24,0x20,0x11,0x00,0x55,0x01, + 0x30,0x4d,0x41,0x07,0x60,0x0c,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x10,0xa0,0x33, - 0x00,0x1d,0x20,0x54,0x02,0x50,0x0c,0x48, - 0x03,0x00,0xcd,0x00,0x34,0x00,0xd0,0x08, - 0x40,0x23,0x00,0x0d,0x00,0x04,0x03,0xc2, - 0x84,0x51,0x02,0x03,0x81,0x00,0x45,0xc2, - 0x12,0x04,0x40,0x43,0x80,0x06,0x00,0x00, + 0x80,0xc1,0x40,0x04,0x03,0x10,0x00,0x40, + 0x32,0x00,0xc9,0x20,0x34,0x03,0xd0,0x04, + 0x60,0x33,0x80,0xcd,0x00,0x24,0x83,0xd0, + 0x08,0x60,0x21,0x00,0x01,0x00,0x44,0x02, + 0x90,0x0c,0x40,0x43,0x00,0x04,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x03,0xa0,0x35, - 0x00,0xdd,0x00,0x46,0x81,0x54,0x3d,0x40, - 0x67,0x00,0xdd,0x00,0x74,0x03,0xd0,0x05, - 0x40,0x77,0x00,0xd5,0x01,0x40,0x43,0xd0, - 0x04,0x41,0x36,0x10,0x41,0x00,0x44,0x03, - 0x50,0x0d,0x00,0x1f,0x80,0x0e,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x02,0xa8,0x17, - 0x00,0x0f,0x00,0x1c,0x02,0x72,0x19,0xc2, - 0xf7,0x04,0x5e,0x00,0x7c,0x00,0xd0,0x09, - 0xc0,0x67,0x00,0x9c,0x01,0x40,0xa7,0xf1, - 0x25,0xc0,0x07,0x00,0x97,0x00,0x2c,0x03, - 0x22,0x2d,0x81,0x0b,0x22,0x0e,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x05,0x80,0x1d, - 0x00,0xff,0x00,0xfc,0x01,0xb0,0x09,0xc4, - 0x3f,0x00,0x77,0x00,0xfc,0x03,0xf2,0x07, - 0xc0,0x37,0x00,0xff,0x40,0xfc,0x03,0xf0, - 0x07,0xc0,0x39,0x28,0x7f,0x00,0xec,0x03, - 0xb0,0x0f,0xc0,0x07,0x00,0x06,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x03,0x08,0x75, - 0x00,0x1f,0x00,0x6c,0x02,0x30,0x2d,0xc1, - 0x34,0x00,0xdf,0x01,0x7c,0x00,0xf0,0x09, - 0xc0,0x27,0x00,0x9f,0x00,0x5c,0x1b,0x10, - 0x65,0xc8,0x07,0x20,0x93,0x84,0x58,0xa1, - 0xd0,0x85,0x08,0x0f,0x20,0x04,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x13,0xa0,0x74, - 0x10,0xdd,0x02,0x44,0x09,0x00,0x2d,0x40, - 0x34,0x00,0xdd,0x01,0x74,0x0b,0xd0,0x65, - 0x40,0x37,0x00,0xd1,0x00,0x74,0x8b,0x19, - 0x25,0x40,0x37,0x00,0x55,0x02,0x44,0x27, - 0xd0,0x2d,0x40,0x4f,0x00,0x02,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x03,0x20,0x12, - 0x00,0x0d,0x00,0x24,0x02,0x12,0xbc,0x50, - 0x32,0x80,0x4d,0x00,0x34,0x00,0xd1,0x18, - 0x40,0x33,0x00,0xd9,0x00,0x14,0x03,0x90, - 0x0c,0x40,0x03,0x00,0x81,0x00,0x15,0x0b, - 0xd8,0x58,0x40,0x0f,0x00,0x08,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x06,0x08,0x5a, - 0x00,0xfd,0x03,0xe5,0x2d,0x10,0x1e,0x40, - 0x7a,0x00,0x6d,0x01,0xb4,0x0f,0xd0,0x36, - 0x42,0x7b,0x00,0xe1,0x01,0xb4,0x07,0x91, - 0x1e,0x00,0x7b,0x00,0x44,0x01,0x86,0x27, - 0xd0,0x9e,0x40,0x1b,0x20,0x08,0x00,0x00, + 0x90,0xd1,0x00,0x44,0x03,0x12,0x1d,0x40, + 0x35,0x00,0xd1,0x00,0x74,0x83,0xd9,0x15, + 0x40,0x34,0x02,0xd5,0x00,0x44,0x43,0xd0, + 0x11,0x40,0x65,0x00,0x91,0x10,0x54,0x03, + 0x11,0x0d,0x40,0x0f,0x80,0x0e,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x02,0xa8,0x37, + 0x00,0xd3,0xc0,0x4c,0x4f,0x33,0x19,0x40, + 0x72,0x20,0xdb,0x20,0x7c,0x0b,0xe0,0x17, + 0xc3,0x77,0x00,0xdf,0x40,0x6c,0x03,0xd1, + 0x3d,0xd0,0x75,0x41,0x53,0x03,0xc4,0x13, + 0xb0,0x0d,0xc0,0x0b,0x22,0x0e,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x05,0x80,0x3d, + 0x00,0xdf,0x00,0xfc,0x0f,0xf0,0x0f,0xc0, + 0xff,0x00,0xff,0x09,0xec,0x27,0xf0,0x04, + 0xc4,0x7f,0x20,0xef,0x80,0xfc,0x17,0xf0, + 0x04,0xcc,0x3e,0x00,0x3f,0x08,0x7c,0x01, + 0x70,0x0f,0xc0,0x17,0x00,0x06,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x03,0x08,0x35, + 0x02,0xdf,0x04,0x5c,0x03,0xf1,0x09,0xc8, + 0xb4,0x10,0xdf,0x00,0x7c,0x0b,0xf0,0x4d, + 0xc8,0x37,0x12,0xdf,0x00,0x5c,0x0b,0x30, + 0x4d,0xd0,0xb4,0x22,0xbf,0x02,0x4d,0x03, + 0x30,0x0d,0xc2,0x0f,0x20,0x04,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x13,0xa0,0xf8, + 0x02,0xed,0x45,0x04,0x07,0x91,0xad,0x40, + 0x34,0x00,0xdd,0x20,0x74,0x2b,0xd0,0x05, + 0x48,0x34,0x00,0xfd,0x00,0x6c,0x03,0x10, + 0x05,0x02,0x34,0x00,0x9d,0x01,0x2d,0x47, + 0xb0,0x0f,0x40,0x4f,0x00,0x02,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x03,0x20,0xf2, + 0x00,0xcd,0x00,0x14,0x6b,0xd1,0x28,0x40, + 0x70,0x02,0xcd,0x00,0x34,0x27,0xd8,0x20, + 0x40,0xb1,0x04,0xcd,0x49,0x14,0x03,0x1c, + 0x04,0x62,0x76,0x20,0x1d,0x07,0x04,0x02, + 0x18,0x0c,0x40,0x0f,0x00,0x08,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x06,0x08,0x7a, + 0x00,0xec,0x09,0x84,0x07,0x90,0x1e,0x40, + 0x78,0x00,0xed,0x09,0xb4,0x07,0xd8,0x96, + 0x45,0x78,0x00,0xed,0x01,0xa4,0x07,0x58, + 0x12,0x58,0x7a,0x00,0x4d,0x19,0xa4,0x27, + 0x90,0x1e,0x40,0x1b,0x20,0x08,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x12,0x10,0x32, - 0x00,0x0f,0x00,0x2c,0x02,0x32,0x0c,0xc2, - 0x32,0x00,0xcf,0x00,0x3c,0x00,0xf0,0x08, - 0xc0,0x33,0x00,0xcb,0x00,0x1c,0x73,0x94, - 0x4c,0x08,0x03,0x22,0x83,0x80,0x1c,0x02, - 0xf2,0x0c,0xc0,0x0b,0x40,0x08,0x00,0x00, + 0x02,0xcf,0x00,0x1c,0x03,0xf0,0x04,0x40, + 0xb0,0x00,0xcf,0x08,0x3c,0x23,0xf0,0x04, + 0x40,0xb1,0x00,0xcd,0x00,0x5c,0x13,0x30, + 0x00,0x40,0x12,0x01,0xcf,0x08,0x0c,0x02, + 0x30,0x0c,0xc0,0xcb,0x40,0x08,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x02,0xa8,0x3d, - 0x00,0xef,0x00,0x9c,0x85,0xf4,0x8f,0xc0, - 0x3d,0x02,0xff,0x00,0xfc,0x03,0xf0,0x17, - 0xc0,0x3f,0x02,0xfb,0x08,0xfc,0xa3,0x70, - 0x0f,0x00,0x3f,0x00,0x7f,0x01,0xf8,0x03, - 0xf0,0x0f,0xc0,0x0b,0x08,0x06,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x10,0xa0,0x53, - 0x00,0x17,0x01,0x4d,0x02,0x30,0x1d,0xc8, - 0x74,0x00,0x53,0x00,0x7c,0x00,0x34,0x09, - 0xd0,0x34,0x10,0xdf,0x01,0x6c,0x23,0xf0, - 0x1d,0xc2,0x04,0x08,0x9f,0x00,0x4d,0x03, - 0x30,0x0d,0xc0,0x50,0x00,0x06,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x33,0x98,0x19, - 0x20,0xf1,0x00,0x84,0x01,0x10,0x0e,0x40, - 0x39,0x00,0x61,0x20,0xf4,0x03,0xb0,0x07, - 0x40,0x38,0x00,0xed,0x20,0x84,0x13,0xd0, - 0x0c,0x00,0x38,0x00,0x49,0x00,0x84,0x03, - 0x10,0x0e,0x40,0xcc,0x60,0x04,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x04,0x00,0x7d, - 0x00,0x25,0x01,0xc4,0x06,0x10,0x1c,0x40, - 0x72,0x00,0xe5,0x01,0xb4,0x04,0x10,0x1a, - 0x40,0x78,0x00,0xcd,0x01,0x84,0xd7,0xd2, - 0x0e,0x00,0x48,0x00,0xad,0x01,0x84,0x05, - 0x10,0x1f,0x40,0x00,0x00,0x04,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x36,0x20,0x33, - 0x00,0xc1,0x40,0x04,0x81,0x10,0x6c,0x40, - 0xf3,0x01,0xc1,0x00,0x34,0x03,0x10,0x04, - 0x40,0xb0,0x00,0xcd,0x42,0x00,0x0b,0xd1, - 0x0c,0x00,0x34,0x00,0x4d,0x00,0x04,0x8f, - 0x14,0x0c,0x56,0x58,0x00,0x04,0x00,0x00, + 0x00,0xff,0xa0,0xfc,0x03,0x82,0x0f,0xd4, + 0x3f,0x10,0xff,0x28,0xfc,0x43,0xf1,0x07, + 0xc2,0x3d,0x82,0xff,0x18,0xfc,0x03,0xa0, + 0x03,0xc0,0x1d,0x00,0xff,0x08,0xfc,0x03, + 0xf0,0x0f,0xc0,0x0b,0x20,0x06,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x10,0xa0,0x37, + 0x0f,0xdf,0x25,0x4c,0x83,0xf0,0x0c,0x80, + 0x34,0x00,0xcd,0x09,0x4c,0x03,0xe0,0x10, + 0xc0,0x74,0x00,0xf2,0x00,0x0c,0x03,0x20, + 0x01,0xc0,0x37,0x20,0x13,0x40,0x0d,0x03, + 0x30,0x0d,0xc0,0x43,0x00,0x04,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x13,0x9a,0x39, + 0x01,0xed,0x08,0x84,0x1b,0xd0,0x0e,0x40, + 0x38,0x01,0xed,0x04,0x84,0x03,0xd0,0x06, + 0x40,0x39,0x01,0xe9,0x05,0x94,0x03,0x10, + 0x07,0xc0,0x38,0x00,0x61,0x00,0x85,0x03, + 0x14,0x0e,0x40,0x6f,0x60,0x04,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x04,0x00,0x79, + 0x01,0xed,0x0d,0x84,0x47,0xd1,0x1e,0x40, + 0x79,0x0a,0xfd,0x05,0x84,0x17,0xd0,0x16, + 0x44,0x78,0x07,0xe9,0x05,0xc4,0x3f,0x90, + 0x16,0x60,0x5d,0x00,0xc1,0x01,0xe4,0x07, + 0x10,0x9e,0x40,0x13,0x00,0x04,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x16,0x20,0x33, + 0x00,0xcd,0x00,0x04,0x17,0xd0,0x1c,0x50, + 0xb1,0x02,0xcd,0x4a,0x02,0x47,0xd0,0x04, + 0x40,0x31,0x00,0xc9,0x40,0x54,0x4f,0x90, + 0x84,0x40,0x17,0x02,0xd1,0x02,0x24,0x07, + 0x10,0x0c,0x40,0x1b,0x00,0x04,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x17,0xa8,0x17, - 0x00,0x57,0x00,0x0c,0x81,0x30,0x27,0xc0, - 0xde,0x40,0x47,0x00,0x3c,0x01,0x10,0x05, - 0xc0,0x1c,0x00,0x7f,0x00,0xcd,0x05,0xd0, - 0x05,0x94,0x14,0x00,0x5f,0x40,0x8c,0x6d, - 0x30,0x06,0xc1,0x7c,0x20,0x0e,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x12,0x80,0x05, - 0x00,0x3f,0x00,0xfc,0x00,0xf6,0x21,0xc0, - 0x05,0x02,0x1f,0x00,0xfc,0x00,0xf0,0x03, - 0xc0,0x07,0x01,0x1f,0x84,0x5c,0x00,0xf0, - 0x01,0xc0,0x0d,0x18,0x3b,0x00,0x7c,0x00, - 0xf0,0x21,0xc0,0x4b,0x00,0x06,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x10,0x08,0x25, - 0x00,0x9f,0x00,0x7c,0x02,0xb0,0x09,0x88, - 0x27,0x00,0x9f,0x00,0x6c,0x02,0xb0,0x09, - 0x40,0x24,0x20,0x9f,0x00,0x7c,0x54,0xf1, - 0x09,0xc0,0x64,0x01,0x83,0x03,0x4d,0x02, - 0x30,0x89,0xc0,0x40,0x20,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x01,0x20,0x26, - 0x00,0x9d,0x01,0x74,0x06,0x10,0x59,0x48, - 0x27,0x00,0x9d,0x00,0x44,0x06,0x10,0x18, - 0x40,0x24,0x00,0x9d,0x80,0x74,0x00,0xd2, - 0x09,0x40,0x64,0x00,0x95,0x00,0x4c,0x0a, - 0x14,0x29,0x40,0x04,0x00,0x08,0x00,0x00, + 0x00,0x5f,0x80,0xcc,0x09,0xf1,0xb7,0xc8, + 0xdd,0x12,0x7d,0x0b,0x8d,0x0d,0xd0,0x07, + 0xc0,0x1c,0x40,0x5b,0x40,0xcd,0x09,0xb4, + 0x17,0xc0,0x5d,0x40,0x73,0x00,0xed,0x15, + 0x31,0x05,0xc0,0x6f,0x20,0x0e,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x12,0x80,0x85, + 0x00,0x1f,0x00,0x7d,0x08,0xf0,0xa1,0xc0, + 0x06,0x08,0x1f,0x00,0x7c,0x28,0xf2,0x11, + 0xc0,0x07,0x04,0x17,0x00,0x7c,0x00,0x70, + 0x01,0xc0,0x04,0x20,0x1f,0x00,0x5d,0x08, + 0xf1,0x01,0xc0,0x4b,0x00,0x06,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x10,0x08,0x65, + 0x00,0x93,0x01,0x5c,0x04,0x30,0x49,0xc0, + 0x05,0x00,0x1f,0x00,0x5c,0x00,0x30,0x89, + 0xc0,0x07,0x00,0x9f,0x03,0x4d,0x00,0x30, + 0x08,0xc0,0x64,0x01,0x93,0x12,0x4c,0x02, + 0x30,0x08,0xc0,0x40,0x20,0x04,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x01,0x20,0xe2, + 0x06,0x91,0x01,0x34,0x28,0x10,0x28,0x40, + 0x04,0x00,0x1d,0x41,0x5c,0x60,0x10,0x19, + 0x48,0x87,0x02,0x8d,0x80,0x44,0x00,0x50, + 0x09,0x41,0x64,0x10,0x91,0x02,0x6c,0x0a, + 0xb5,0x09,0x40,0x04,0x00,0x08,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x1c,0xa0,0x24, - 0x00,0xb5,0x01,0xf4,0x06,0x10,0x49,0x40, - 0x27,0x00,0x9d,0x00,0xe4,0x06,0x90,0x1b, - 0x58,0x35,0x00,0xd5,0x00,0x74,0x00,0xd0, - 0x08,0x40,0x2c,0x00,0xb1,0x00,0x40,0x42, - 0x90,0x29,0x40,0x70,0x00,0x02,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x14,0x28,0xa0, - 0x00,0xad,0x42,0xf4,0x0a,0x90,0x08,0x60, - 0x23,0x00,0x9d,0x00,0xe4,0x02,0x10,0x0b, - 0x40,0x21,0x95,0x8d,0x14,0x36,0x0b,0xd1, - 0x48,0x69,0x28,0x0d,0xa5,0x54,0x44,0x02, - 0x92,0x29,0x48,0x50,0xa0,0x00,0x00,0x00, + 0x40,0x91,0x06,0x54,0x08,0x14,0x29,0x40, + 0x85,0x00,0x5d,0x08,0x54,0x01,0x10,0x09, + 0x40,0x07,0x04,0x9d,0x22,0x44,0x00,0x10, + 0x0d,0x64,0x24,0x10,0x91,0x02,0x24,0x02, + 0x50,0x09,0x40,0x70,0x00,0x02,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x14,0x28,0x20, + 0x05,0x81,0x14,0x34,0x12,0x10,0x09,0x40, + 0x20,0x11,0x8d,0x08,0x54,0x22,0x10,0x0c, + 0x40,0x23,0x01,0x8d,0x10,0x04,0x1a,0x58, + 0x08,0x44,0x20,0x00,0x81,0x02,0x24,0x02, + 0x94,0x48,0x40,0xd0,0xa0,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x1c,0xb0,0x06, - 0x00,0x17,0x00,0xfc,0x00,0x30,0x01,0xc0, - 0x07,0x00,0x1f,0x00,0x6c,0x00,0xb0,0x03, - 0x40,0x05,0x01,0x1f,0x04,0x7c,0x00,0xf0, - 0xe1,0xc0,0x84,0x43,0x33,0x0e,0x0c,0x28, - 0xb0,0x01,0xd0,0x70,0xc0,0x0a,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x19,0xa8,0x27, - 0x00,0x9d,0x00,0x3c,0x02,0x74,0x2b,0xc2, - 0xaf,0x00,0x9f,0x14,0x5c,0x52,0xf4,0x49, - 0xc1,0x2e,0x00,0xbf,0x11,0x74,0x0a,0xf0, - 0x09,0xc0,0x27,0x00,0x9f,0x00,0xfc,0x02, - 0x50,0x0e,0xc0,0x67,0x00,0x0e,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x18,0xa0,0x2f, - 0x00,0xa7,0x02,0xcc,0x02,0x30,0x1b,0xc0, - 0x66,0x01,0xb3,0x00,0xbc,0x02,0x30,0x8b, - 0xc0,0x64,0x00,0x9f,0x01,0x4c,0x1e,0xf0, - 0x79,0xc0,0x64,0x05,0x93,0x0d,0x6d,0x02, - 0xf0,0x29,0xc2,0x63,0x00,0x0e,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x1c,0x18,0x57, - 0x05,0x11,0x05,0x44,0x14,0x10,0x21,0x40, - 0x94,0x00,0x55,0x15,0x74,0x14,0x10,0x51, - 0x40,0x84,0x00,0x5d,0x00,0x54,0x0c,0xc0, - 0x11,0x40,0x44,0x01,0x11,0x09,0xc4,0xd4, - 0xd0,0x11,0x44,0x73,0x60,0x0c,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x32,0x00,0x25, - 0x00,0x85,0x00,0x05,0x42,0x14,0x28,0x40, - 0x22,0x02,0x81,0x04,0x34,0x52,0x14,0x48, - 0x50,0x20,0x02,0x8d,0x08,0x04,0xa2,0xd0, - 0x8a,0x42,0x29,0x4c,0xa9,0x20,0x87,0x12, - 0xd2,0x08,0x42,0x4b,0x00,0x04,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x18,0x20,0x25, - 0x00,0x85,0x00,0x04,0x82,0x10,0x49,0x00, - 0x26,0x00,0x95,0x00,0x34,0x02,0x10,0x08, - 0x40,0xa4,0x00,0x9d,0x00,0x54,0x80,0xd8, - 0x09,0x50,0x2c,0x00,0xb9,0x00,0xc6,0x02, - 0xd0,0x01,0x40,0x67,0x00,0x04,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x05,0xa8,0xa7, - 0x00,0x97,0x00,0x4c,0x02,0x30,0x69,0xc0, - 0x26,0x00,0x93,0x02,0x74,0x02,0x10,0x09, - 0x40,0x24,0x00,0x9f,0x00,0x4c,0x40,0xf0, - 0x09,0xc2,0x25,0x00,0x9b,0x00,0x4c,0x12, - 0xe2,0x31,0xc0,0x17,0x20,0x0e,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x13,0x80,0x25, - 0x00,0x9b,0x00,0x7c,0x02,0xf0,0x09,0xc1, - 0x21,0x00,0x9f,0x00,0x7c,0x02,0xf0,0x09, - 0xc0,0x27,0x00,0x8f,0x00,0x7c,0x08,0xf0, - 0x09,0xc0,0x23,0x00,0x87,0x20,0x5c,0x12, - 0xf1,0x31,0xe0,0x4f,0x08,0x06,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x10,0x08,0x85, - 0x40,0x13,0x40,0x4c,0x00,0xf0,0x21,0xc8, - 0x05,0x40,0x13,0x02,0x4d,0x00,0xb1,0x01, - 0xc0,0x04,0x00,0x1f,0x02,0x4c,0x48,0xb0, - 0x00,0xc0,0x07,0x01,0x13,0x00,0xfc,0x00, - 0x34,0x21,0xc0,0x43,0x20,0x04,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x14,0xa0,0x10, - 0x08,0x71,0x11,0xc4,0x11,0xd0,0x16,0x40, - 0x16,0x00,0x51,0x00,0xc4,0x45,0x10,0x07, - 0x40,0x14,0x00,0x57,0x40,0xc4,0x09,0x92, - 0x15,0x40,0x94,0x00,0x51,0x40,0xf4,0x05, - 0x10,0x07,0xc3,0x51,0x00,0x02,0x00,0x00, + 0x01,0x13,0x04,0x5c,0x10,0x30,0x01,0xc0, + 0x05,0x29,0x1f,0x04,0x5c,0x40,0x34,0x11, + 0x40,0x07,0x03,0x1d,0x04,0x4d,0x40,0x12, + 0x61,0xc0,0x04,0x42,0x13,0x06,0x6d,0x0d, + 0x70,0x71,0xd0,0x70,0xc0,0x08,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x19,0x88,0x27, + 0x00,0x8f,0x00,0x7c,0x22,0xf0,0x0b,0xc0, + 0xa7,0x00,0x9d,0x0c,0x7c,0x02,0xd0,0x2b, + 0xc6,0x23,0x0b,0x8f,0x00,0x7c,0x86,0xf0, + 0x6b,0xd1,0x2b,0x20,0xbf,0x06,0xfc,0x62, + 0xf0,0x69,0xc1,0x67,0x80,0x0c,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x18,0x80,0x6f, + 0x01,0xb7,0x05,0xfc,0x06,0xf2,0x0b,0xc2, + 0x67,0x01,0xbe,0x01,0x7c,0x66,0xc0,0x5b, + 0xc1,0xe7,0x00,0x93,0x05,0x64,0x26,0xf0, + 0x1b,0xd0,0x2c,0x0a,0xbf,0x09,0xcc,0x46, + 0x30,0x09,0xc0,0x63,0x00,0x0e,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x1c,0x10,0x87, + 0x02,0x11,0x00,0x74,0x00,0xf0,0x01,0x40, + 0x17,0x10,0x1d,0x01,0x66,0x1c,0xd1,0x21, + 0x44,0xc6,0x00,0x11,0x02,0x54,0x3c,0xd0, + 0x01,0x40,0x44,0x00,0x5d,0x0b,0x45,0x5c, + 0x50,0x01,0x40,0x73,0x60,0x0c,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x32,0x00,0x21, + 0x00,0x85,0x02,0x34,0x0a,0xd0,0x08,0x40, + 0xa3,0x00,0x8d,0x12,0x34,0x02,0xd8,0x08, + 0x62,0xa7,0x08,0x81,0x08,0x24,0x12,0xd0, + 0x28,0x40,0x70,0x01,0x8d,0x44,0x04,0x02, + 0x10,0x08,0x40,0x4b,0x00,0x04,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x18,0xa0,0x25, + 0x00,0x91,0x00,0x74,0x0a,0x51,0x09,0x01, + 0x27,0x80,0x9d,0x14,0x74,0x50,0xd9,0x29, + 0x40,0x86,0x00,0x91,0x00,0x54,0x82,0xd0, + 0x09,0x60,0x24,0x00,0x9d,0x00,0x45,0x0a, + 0x50,0x09,0x40,0x67,0x00,0x04,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x05,0xa8,0x27, + 0x00,0x97,0x00,0x7c,0x0a,0xd0,0x39,0x40, + 0xe7,0x00,0x9f,0x02,0x74,0x04,0xd0,0x29, + 0xc0,0x07,0x40,0x83,0x00,0x6c,0x6a,0xf0, + 0x09,0xc0,0x24,0x08,0x9f,0x82,0x4c,0x02, + 0x34,0x09,0xc0,0x17,0x20,0x0e,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x13,0x80,0x21, + 0x00,0x9f,0x00,0x7c,0x12,0xf0,0x59,0xc0, + 0x37,0x01,0x9f,0x00,0x6c,0x00,0xf1,0x49, + 0xc0,0x86,0x00,0xdf,0x00,0x7c,0x06,0xf0, + 0x38,0xc0,0x67,0x02,0x8f,0x09,0x7c,0x02, + 0xf0,0x09,0xc0,0x4f,0x00,0x06,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x10,0x08,0x05, + 0x00,0x1f,0x00,0x7c,0x20,0xf0,0x21,0xc8, + 0x85,0x00,0x1f,0x80,0x5c,0x18,0xf0,0x61, + 0xc0,0x87,0x04,0x1f,0x20,0x48,0x00,0xf0, + 0x01,0xc0,0x04,0x00,0x1f,0x12,0x4d,0x00, + 0x34,0x01,0xc0,0x40,0x20,0x04,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x14,0xa0,0x1c, + 0x00,0x7d,0x12,0xf4,0x05,0xd2,0x87,0x41, + 0x57,0x04,0x5d,0x20,0xce,0x19,0xd0,0x37, + 0x44,0x9b,0x00,0x5d,0x11,0x45,0x81,0x90, + 0xc7,0xc0,0x15,0x00,0x7d,0x03,0xc4,0x01, + 0x15,0x05,0x40,0x40,0x00,0x02,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x14,0xa0,0x32, - 0x00,0xc1,0x00,0x04,0x07,0xd2,0x1c,0x40, - 0x32,0x00,0xc1,0x00,0x04,0x03,0x90,0x6c, - 0x48,0x30,0x00,0xc5,0x00,0x04,0x0f,0xd0, - 0x1c,0x40,0x31,0x40,0xc1,0x00,0x34,0x01, - 0x50,0x0c,0x41,0x53,0x00,0x08,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x01,0x88,0x28, - 0x00,0x71,0x80,0x85,0x01,0xd0,0x0e,0x41, - 0x32,0x00,0xa1,0x01,0xc4,0x01,0x14,0x07, - 0x40,0x38,0x00,0xc5,0x80,0x86,0x1b,0xd8, - 0x06,0x41,0x38,0x00,0x61,0x40,0xb4,0x45, - 0x50,0x0e,0x40,0x05,0x20,0x0c,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x11,0x10,0x7c, - 0x00,0xa3,0x01,0x8c,0x06,0xd0,0x0e,0xc0, - 0x78,0x00,0xf3,0x01,0x8c,0x06,0xb0,0x1a, - 0xc0,0x78,0x20,0xe7,0x07,0x85,0x87,0xf9, - 0x1c,0xc0,0x61,0x00,0xa3,0x21,0xfc,0x07, - 0x70,0x5e,0xc4,0x47,0x40,0x08,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x10,0xa8,0x25, - 0x00,0x1f,0x00,0x70,0x00,0xf0,0x04,0xc0, - 0x34,0x00,0x9f,0x00,0x7c,0x00,0xc0,0x04, - 0xd0,0x35,0x00,0xd7,0x00,0x7c,0xa3,0xb8, - 0x07,0xc4,0x2f,0x50,0x1f,0x00,0x7c,0x83, - 0xb1,0x8d,0xc0,0x41,0x00,0x06,0x00,0x00, + 0x00,0xcd,0x12,0x34,0x07,0xd0,0x3c,0x40, + 0xf1,0x01,0xcd,0x81,0x14,0x03,0xd8,0x8c, + 0x40,0x33,0x0a,0xcd,0x07,0x05,0x03,0xd0, + 0x1c,0x40,0x32,0x00,0xcd,0x03,0x44,0x07, + 0x10,0x0c,0x40,0x50,0x00,0x0c,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x01,0x80,0x38, + 0x00,0xed,0x00,0xb4,0x03,0xd8,0x0e,0x40, + 0x2b,0x00,0xed,0x43,0xa4,0x03,0xd0,0x0e, + 0x40,0x3b,0x00,0x8d,0x80,0x84,0x13,0xd0, + 0x0e,0x40,0x39,0x00,0xed,0x10,0x84,0x1b, + 0x10,0xde,0x40,0x04,0x20,0x08,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x11,0x00,0x78, + 0x00,0xef,0x01,0xbc,0x07,0xf0,0x16,0xc0, + 0x59,0x00,0xff,0x01,0x94,0x17,0xf0,0x1e, + 0xc0,0xfb,0x01,0x6f,0x31,0x8c,0x17,0xf0, + 0x1f,0xc0,0x6a,0x20,0xcf,0x01,0xcd,0x15, + 0x34,0x1f,0xd0,0x44,0x40,0x08,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x10,0xb8,0x15, + 0x00,0x9f,0x00,0x7c,0x03,0xe2,0x0d,0xc0, + 0x87,0x04,0xdd,0x00,0x5c,0x03,0xd1,0x05, + 0xc0,0x37,0x00,0x5f,0x00,0x7c,0x27,0xb2, + 0x0d,0x40,0x27,0x00,0xdf,0x00,0x7c,0x25, + 0xf0,0x6d,0xc1,0x43,0x00,0x06,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x7d, - 0x00,0xfb,0x01,0xfc,0x07,0xf0,0x17,0xc0, - 0x7c,0x00,0xff,0x01,0xfc,0x07,0xf0,0x0f, - 0xc0,0x7e,0x00,0xff,0x01,0xfc,0x07,0xf0, - 0x1b,0xc0,0x5e,0x00,0xf3,0x29,0xcc,0x04, - 0x32,0x9f,0xc2,0x03,0x00,0x0c,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x11,0x18,0x29, - 0x00,0x6d,0x02,0xb4,0x01,0xd0,0x02,0x50, - 0x38,0x00,0xaf,0x00,0xb4,0x09,0xf0,0x4e, - 0xc0,0x3a,0x00,0xed,0x00,0xb4,0x03,0xd0, - 0x03,0xc0,0x18,0x01,0x61,0x88,0x94,0x10, - 0xb0,0x0e,0x40,0x57,0x60,0x04,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x39, - 0x00,0xe9,0x00,0xb4,0x03,0xd0,0x02,0x40, - 0x38,0x00,0xed,0x00,0xb4,0x03,0xd0,0x8b, - 0x60,0x38,0x00,0xe9,0x00,0xb4,0x23,0xd0, - 0x0a,0x40,0x08,0x80,0xa1,0x08,0xa6,0x86, - 0x10,0x0e,0x60,0x03,0x00,0x04,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x04,0x20,0x23, - 0x00,0x4d,0x00,0x74,0x05,0xd0,0x20,0x40, - 0x30,0x04,0x85,0x00,0x30,0x01,0x40,0x0c, - 0x40,0xb0,0x02,0xcd,0x0b,0x34,0x4b,0xd0, - 0x01,0x40,0x80,0x42,0x01,0x0c,0x70,0x4e, - 0x92,0x0c,0x01,0x13,0x80,0x0c,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x15,0xa8,0x35, - 0x00,0xdb,0x05,0x7c,0x47,0xf0,0x09,0xc0, - 0xb4,0x00,0xdd,0x00,0x7c,0x17,0xd0,0x5c, - 0x40,0x74,0x00,0xf9,0x0a,0x3c,0x0f,0xd0, - 0x0d,0x50,0xb4,0x80,0xc0,0x42,0x66,0x0d, - 0x20,0x3d,0xc4,0x57,0x20,0x0e,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x37, - 0x00,0xdf,0x12,0x7c,0x4b,0xf1,0x29,0xc0, - 0x37,0x00,0xdf,0x00,0x7c,0x4b,0xf0,0x05, - 0xd1,0x37,0x00,0xdf,0x40,0x7c,0x2b,0xf0, - 0x07,0xc0,0x3f,0x81,0x7f,0x80,0x5e,0x21, - 0xf1,0x8d,0xc0,0x07,0x00,0x06,0x00,0x00, + 0x00,0x7b,0x41,0xbc,0x07,0x30,0x9f,0xc0, + 0x7b,0x08,0xf3,0x01,0xfc,0x47,0xd2,0x9f, + 0x80,0x7f,0x12,0xff,0x09,0xc0,0x27,0xf0, + 0x17,0xc0,0x7f,0x00,0xbf,0x01,0x8c,0x06, + 0x30,0x1f,0xc0,0x00,0x00,0x04,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x11,0x18,0xb9, + 0x00,0xe1,0x00,0xb4,0x0b,0x10,0x0e,0x44, + 0x2b,0x00,0xe1,0x08,0xb4,0x03,0xd0,0x8e, + 0xc4,0x3b,0x00,0xaf,0x0c,0x84,0x03,0x70, + 0x6e,0x40,0x3b,0x04,0xbd,0x10,0xbc,0x03, + 0x14,0x0e,0x40,0x54,0x60,0x04,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x31, + 0x00,0xe9,0x00,0xf4,0x03,0x10,0x0e,0x41, + 0x5f,0x00,0xa9,0x00,0xb4,0x03,0xd0,0x8e, + 0x4a,0x3b,0x20,0x2d,0x00,0x85,0x03,0xd0, + 0x0e,0x44,0x2b,0x00,0xad,0x00,0x84,0x00, + 0x10,0x0e,0x40,0x00,0x00,0x04,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x13, + 0x00,0xc1,0x00,0x34,0x1a,0x10,0x3c,0x40, + 0x83,0x02,0x88,0x01,0x34,0x07,0xd0,0x4c, + 0x40,0xf3,0x04,0x05,0x00,0x06,0x03,0x40, + 0x2c,0x41,0x23,0x00,0x0d,0x06,0x34,0x2d, + 0x14,0x0d,0x40,0x10,0x00,0x04,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x11,0xa8,0x35, + 0x00,0xdb,0x00,0x74,0x47,0x34,0x3d,0xc2, + 0x77,0x40,0xd8,0x80,0x74,0x33,0xf0,0x3d, + 0xc0,0x77,0x04,0xdc,0x00,0xcc,0x27,0xf0, + 0x4d,0xc0,0x37,0x00,0xdf,0x02,0xcd,0x09, + 0x30,0x0f,0xc0,0x54,0x20,0x0e,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x01,0x00,0xb7, + 0x00,0xcf,0x20,0x7c,0x03,0xf1,0x0d,0x81, + 0xb7,0x00,0xd7,0x58,0x7c,0x0b,0xf0,0x19, + 0xc0,0xb5,0x08,0x9f,0x02,0x7c,0x23,0xf0, + 0x2d,0xc0,0x37,0x00,0xdf,0x00,0xde,0x01, + 0xf0,0x0d,0xc0,0x07,0x00,0x06,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x84,0x08,0x7f, - 0x01,0xbf,0x00,0xfc,0x02,0x30,0x0d,0x41, - 0x3f,0x80,0xff,0x05,0xfc,0x02,0x70,0x0b, - 0xc0,0x3c,0x04,0xff,0x00,0xfc,0x03,0x38, - 0x0f,0x40,0x2a,0x80,0xbf,0x60,0xdc,0x03, - 0x3a,0x4f,0xc6,0x10,0x22,0x04,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x85,0x20,0x76, - 0x08,0x9d,0x00,0x74,0x1a,0x10,0x1d,0x40, - 0x37,0x80,0xdd,0x01,0x74,0x02,0xd0,0x05, - 0x40,0x37,0x00,0xdd,0x00,0x74,0x17,0xb0, - 0x05,0x48,0x25,0x80,0x11,0x00,0x54,0x03, - 0xb1,0x1c,0x41,0x14,0x02,0x08,0x00,0x00, + 0x00,0xff,0x20,0xec,0x01,0xf0,0x07,0xc0, + 0x7f,0x05,0xff,0x40,0xfc,0x07,0x30,0x0f, + 0xc0,0x3f,0x00,0xdf,0x00,0xcc,0x03,0xf0, + 0x0e,0xd0,0x2c,0x20,0xff,0x00,0xcc,0x43, + 0x71,0x0f,0xc0,0x10,0x22,0x04,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x85,0x20,0xe6, + 0x00,0x9d,0x00,0x44,0x8b,0xd0,0x8d,0x40, + 0x37,0x01,0xdd,0x00,0x34,0x03,0x12,0x15, + 0x48,0x77,0x00,0xcd,0x02,0x6c,0x03,0xd0, + 0x3d,0x40,0x24,0x00,0x8d,0x01,0x44,0x4b, + 0x10,0x0d,0x40,0x14,0x02,0x08,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x01,0xa0,0x34, - 0x00,0xdd,0x00,0x74,0x83,0x10,0x11,0x49, - 0x37,0x00,0xdd,0x00,0x74,0x03,0xd0,0x0d, - 0x40,0x36,0x20,0xdd,0x00,0x74,0x23,0x18, - 0x09,0x48,0x14,0x00,0xd5,0x00,0x54,0x80, - 0x11,0x0d,0x60,0x06,0x00,0x02,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x10,0x28,0x30, - 0x00,0xcd,0x00,0x34,0x03,0x10,0x00,0x40, - 0x33,0x00,0xcd,0x00,0x34,0x03,0x90,0x0d, - 0x40,0x32,0x00,0xc9,0xc0,0x64,0x03,0x1c, - 0x00,0x40,0x11,0x08,0x41,0x00,0x04,0x00, - 0x90,0x0c,0x70,0x42,0xa0,0x00,0x00,0x00, + 0x02,0x5d,0x00,0x64,0x03,0xd0,0x09,0x40, + 0x07,0x00,0xdd,0x20,0x74,0x53,0x18,0x1d, + 0x40,0x35,0x06,0x5d,0x02,0x44,0x83,0xd0, + 0x19,0x40,0x76,0x00,0x9d,0x01,0x14,0x00, + 0x10,0x0d,0x40,0x04,0x00,0x02,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x14,0x28,0x30, + 0x00,0xcd,0x00,0x04,0x03,0xd0,0x08,0x44, + 0x03,0x10,0xcd,0x00,0x34,0x03,0x1c,0x0c, + 0x40,0x33,0x00,0x0d,0x00,0x25,0x03,0xd8, + 0x08,0x40,0x22,0x00,0x8d,0x00,0x04,0x01, + 0x14,0x0c,0x40,0x40,0xa0,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0xb0,0x36, - 0x00,0xdf,0x00,0x7c,0x03,0x34,0x01,0xc0, - 0x37,0x00,0xdd,0x00,0x7c,0x03,0xf0,0x09, - 0xc0,0x36,0x20,0xdd,0x00,0x7c,0x03,0x19, - 0x09,0xc8,0x00,0x80,0x8f,0x00,0x1c,0x02, - 0x10,0x0d,0xc2,0x02,0xc0,0x08,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x05,0xa8,0x3f, - 0x00,0xff,0x00,0xfc,0x03,0xf2,0x03,0xc0, - 0x3f,0x00,0xff,0x00,0xfc,0x03,0xf0,0x0e, - 0xf0,0x3d,0x00,0xff,0x00,0xfc,0x83,0xb0, - 0x03,0xc2,0x0d,0x00,0x3f,0x00,0xfc,0x02, - 0xf0,0x0f,0xc0,0x15,0x88,0x06,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x03,0xa0,0x0f, - 0x01,0x33,0x10,0xfc,0x12,0xf0,0x46,0xc0, - 0x0c,0x09,0xb3,0x04,0xcc,0x04,0x34,0x13, - 0xc4,0x7f,0x00,0xef,0x01,0xcc,0x06,0x30, - 0x0f,0xc0,0x7c,0x00,0xef,0x00,0xfc,0x07, - 0xf0,0x13,0xc0,0x0e,0x20,0x0e,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x01,0x08,0xc7, - 0x02,0xd1,0x02,0x74,0x0d,0xd0,0xb5,0x50, - 0xb4,0x00,0x51,0x02,0x7c,0x00,0x10,0x15, - 0x40,0x77,0x00,0xdd,0x21,0x45,0x06,0x14, - 0x1d,0x40,0x35,0x00,0xdd,0x01,0x74,0x03, - 0xd0,0x01,0x40,0x04,0x20,0x0c,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x10,0xa0,0x03, - 0x00,0x01,0x00,0x34,0x0a,0xd0,0x04,0x40, - 0x80,0x40,0x85,0x02,0x04,0x00,0x10,0x00, - 0x40,0x23,0x00,0x9d,0x00,0x46,0x05,0xd0, - 0x0c,0x40,0x31,0x00,0xc5,0x00,0x14,0x03, - 0x50,0x00,0x40,0x40,0x80,0x0e,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x03,0xa8,0x05, - 0x04,0xd1,0x00,0x74,0x01,0xd1,0x05,0x41, - 0x31,0x00,0x55,0x00,0x74,0x07,0x10,0x21, - 0x40,0x77,0x00,0xdd,0x00,0x44,0x05,0xd0, - 0x0d,0x40,0x35,0x10,0xdd,0x40,0x74,0x23, - 0xd0,0x11,0x40,0x0c,0x00,0x06,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x02,0xa8,0x87, - 0x40,0x13,0x00,0x7c,0x02,0xf0,0x24,0xc4, - 0x04,0x00,0x97,0x40,0x4c,0x07,0x31,0xa9, - 0xc0,0x57,0x08,0xcf,0x04,0x0c,0x03,0xf0, - 0x0c,0xc0,0x75,0x00,0xdf,0x80,0x7c,0x17, - 0xf2,0x35,0xd1,0x0a,0x00,0x0e,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x07,0x80,0x4d, - 0x05,0xdf,0x00,0x7c,0x01,0xf0,0x07,0xc1, - 0x3e,0x00,0x7b,0x00,0xfc,0x02,0xf0,0x1f, - 0xc0,0x2f,0x00,0xfc,0x85,0xfc,0x03,0x30, - 0x0f,0xc0,0xff,0x00,0xff,0x80,0xec,0x07, - 0xf0,0x07,0xc0,0x1f,0x00,0x06,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x03,0x08,0x81, - 0x00,0x13,0x00,0x4d,0x02,0x30,0x25,0x50, - 0x04,0x01,0x8f,0x00,0x4c,0x03,0xf0,0x09, - 0xd0,0x14,0x00,0x9f,0x02,0x6c,0x13,0xf0, - 0x0d,0xc0,0xb7,0x00,0xdf,0x00,0x5c,0x03, - 0x70,0xc5,0xc0,0x0f,0x00,0x04,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x13,0xa0,0x14, - 0x00,0xd5,0x00,0x44,0x01,0x10,0x15,0x00, - 0xb5,0x00,0x5d,0x0e,0x14,0x1b,0xd0,0x79, - 0x00,0x74,0x00,0xdd,0x08,0x44,0x0b,0xd0, - 0x1f,0x40,0x37,0x08,0xfd,0x01,0x64,0x03, - 0x11,0x15,0x40,0x4c,0x00,0x02,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x07,0xa0,0xa2, - 0x00,0x01,0x00,0x04,0x02,0x10,0x1c,0x00, - 0x02,0x00,0x8d,0x00,0x14,0x45,0xd0,0x40, - 0x04,0x70,0x02,0xc9,0x00,0x24,0x03,0x90, - 0x1c,0x40,0x33,0x80,0xc9,0x00,0x34,0x03, - 0x10,0x25,0x40,0x1c,0x20,0x0a,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x06,0x80,0x68, - 0x00,0xe5,0x01,0x84,0x05,0x10,0x9e,0x41, - 0x7a,0x00,0x6d,0x21,0x94,0x05,0xd0,0x1e, - 0x40,0x78,0x00,0xed,0x01,0xa0,0x27,0xd0, - 0x1e,0x43,0x7b,0x02,0xed,0xb9,0xe4,0x07, - 0x10,0x12,0x40,0x18,0x00,0x02,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x12,0x10,0x20, - 0x01,0x03,0x80,0x0c,0x22,0x34,0x8c,0xc0, - 0x02,0x08,0x9f,0x00,0x1c,0x01,0xf0,0x44, - 0xc0,0x30,0x00,0x4f,0x00,0x2c,0x43,0xb1, - 0x8c,0xc0,0xb3,0x00,0xcf,0x00,0x1c,0x03, - 0x74,0x01,0xd0,0xc9,0x40,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x02,0xb8,0x29, - 0x00,0xff,0x00,0xfc,0x05,0xd0,0x8f,0xc2, - 0x3d,0x02,0x7f,0x01,0xfc,0x03,0xf0,0x3e, - 0xc0,0x3f,0x02,0xff,0x00,0xdc,0x03,0xf0, - 0x0f,0xc3,0x3f,0x00,0xff,0x00,0x9c,0x43, - 0xf0,0x07,0xc0,0x09,0x60,0x06,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x15,0xa0,0x27, - 0x10,0x13,0x00,0x7c,0x02,0xf0,0x0d,0x88, - 0x04,0x00,0x93,0x00,0x4c,0x03,0x20,0x61, - 0xc0,0x57,0x00,0xd3,0x00,0x7c,0x03,0x30, - 0x0d,0xc2,0x77,0x42,0xd3,0x01,0x6c,0x07, - 0x34,0x05,0xc0,0x57,0x00,0x0e,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x13,0x88,0x21, - 0x00,0xe1,0x00,0xb4,0x01,0xd0,0x0c,0x40, - 0x38,0x00,0x61,0x00,0xac,0x03,0xb0,0x0e, - 0x40,0x3b,0x00,0xe1,0x00,0xb4,0x83,0x10, - 0x0e,0x40,0x3f,0x00,0xe1,0x02,0x84,0x03, - 0x10,0x06,0x40,0xcf,0x20,0x06,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x03,0x00,0x69, - 0x00,0x21,0x01,0xb4,0x06,0xd0,0x1e,0x40, - 0x40,0x00,0xa1,0x01,0xa4,0x07,0x90,0x16, - 0x40,0x5f,0x84,0x61,0x81,0xb4,0x07,0x18, - 0x5e,0x40,0x7b,0x01,0xc1,0x05,0xa4,0x97, - 0x10,0x1e,0x40,0x0f,0x00,0x04,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x12,0x28,0x23, - 0x02,0xc1,0x00,0x34,0x01,0xd0,0x0c,0x40, - 0x31,0x00,0x41,0x00,0x24,0x2f,0x90,0x6c, - 0x40,0x33,0x00,0xc1,0x00,0x36,0x23,0x14, - 0x0c,0x40,0xf3,0x01,0xc9,0x00,0x04,0x0b, - 0x10,0xb5,0x40,0x4b,0x20,0x0c,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x17,0xa8,0x51, - 0x40,0x51,0x00,0x7c,0x01,0xf0,0x05,0x94, - 0x14,0x40,0x53,0x00,0xec,0x0d,0xb0,0x05, - 0x40,0x1f,0x40,0x63,0x00,0xbc,0x0d,0x30, - 0x05,0xc0,0x9f,0x01,0x53,0x00,0xec,0x39, - 0x30,0x07,0xc0,0x5f,0x20,0x06,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x12,0x00,0x07, - 0x00,0x2f,0x00,0xfc,0x00,0xf2,0x01,0xc0, - 0x0e,0x00,0x3f,0x00,0x7c,0x08,0xf0,0x21, - 0xc0,0x07,0x01,0x1f,0x40,0x7c,0x40,0xf0, - 0x21,0xc0,0x07,0x10,0x17,0x02,0x7c,0x00, - 0xf1,0x41,0xc0,0x4b,0x00,0x0c,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x10,0x08,0x27, - 0x00,0x93,0x00,0x4c,0x02,0x70,0x09,0xc0, - 0x24,0x00,0x93,0x00,0x4c,0x42,0x30,0x09, - 0xc8,0xa7,0x00,0x9f,0x01,0x4c,0x0e,0x30, - 0x09,0xc0,0x07,0x00,0x9f,0x00,0x7c,0x00, - 0xf0,0x19,0xc0,0x40,0x20,0x0c,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x01,0x20,0xa6, - 0x00,0x95,0x00,0x44,0x02,0xd0,0x08,0x40, - 0x25,0x00,0x95,0x00,0x7d,0x1a,0x10,0x09, - 0x40,0xe7,0x01,0x9d,0x09,0x4d,0x06,0x10, - 0x29,0x40,0x07,0x00,0x9d,0x12,0x74,0x00, - 0x70,0x39,0xc0,0x06,0x00,0x08,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x18,0xa0,0x24, - 0x02,0xb1,0x00,0xe4,0x02,0x48,0x29,0x40, - 0x28,0x00,0xa1,0x00,0x04,0x02,0x18,0x09, - 0x41,0x27,0x00,0x9d,0x00,0x44,0x02,0x10, - 0x09,0x40,0x07,0x00,0x9d,0x20,0x74,0x00, - 0xd1,0x89,0x41,0x60,0x00,0x02,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x10,0x20,0x60, - 0x00,0xa5,0x02,0xa4,0x02,0xd0,0x08,0x40, - 0x29,0x00,0xa5,0x00,0x34,0x22,0x10,0x08, - 0x40,0x22,0x00,0x9d,0x00,0x44,0x0b,0x10, - 0x4c,0x4d,0x23,0x01,0x8d,0x94,0x34,0x02, - 0x50,0x08,0x44,0x42,0x80,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x1c,0xb0,0x06, - 0x00,0x13,0x00,0xed,0x00,0x70,0x11,0x40, - 0x44,0x00,0x23,0x09,0x0c,0x00,0x34,0x01, - 0xc0,0x07,0x00,0x1d,0x00,0x44,0x00,0x34, - 0x11,0xc0,0x07,0x0f,0x1f,0x01,0x7c,0x08, - 0xf0,0x21,0xc0,0x70,0xc0,0x0a,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x19,0x98,0xaf, - 0x00,0x9c,0x02,0x5c,0x0a,0xf0,0x29,0xc0, - 0xe7,0x04,0x9f,0x07,0xfc,0x17,0xf0,0x09, - 0xc0,0x2b,0x00,0xbf,0x00,0x9c,0x02,0xf0, - 0x09,0xc0,0x27,0x01,0x9f,0x00,0x3c,0xca, - 0xf0,0x4b,0xc1,0x67,0x60,0x0e,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x18,0xa0,0x6f, - 0x01,0x93,0x01,0x4c,0x06,0x30,0x19,0xc0, - 0xe5,0x01,0x93,0x15,0x0c,0x22,0x30,0x09, - 0xc0,0x2e,0x00,0xbb,0x00,0x5f,0x0a,0xf1, - 0x09,0xc0,0xe7,0x01,0x93,0x20,0xfc,0x16, - 0xf0,0x0a,0x40,0x63,0x00,0x0e,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x1c,0x08,0x07, - 0x02,0x11,0x02,0x44,0x00,0x10,0x81,0xc0, - 0x46,0x01,0x11,0x15,0xec,0x04,0x50,0x01, - 0x40,0x07,0x00,0x11,0x00,0x44,0x04,0xd0, - 0x01,0x40,0x47,0x00,0x11,0x40,0x74,0x01, - 0xd0,0x11,0x40,0x73,0x20,0x0c,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x10,0xa0,0x23, - 0x40,0x81,0x08,0x04,0x22,0x10,0x08,0x40, - 0x20,0x03,0xa1,0x00,0x84,0x12,0x10,0x08, - 0x40,0x23,0x80,0x81,0x80,0x04,0x02,0xd8, - 0x08,0x40,0xa7,0x01,0x89,0x00,0x34,0x0a, - 0xd0,0x48,0x41,0x43,0x80,0x0e,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x18,0xa8,0x25, - 0x08,0x91,0x00,0x44,0x82,0x10,0x09,0x40, - 0x26,0x00,0xb1,0x00,0xa4,0x02,0x50,0x4d, - 0x40,0x27,0x00,0x91,0x00,0x44,0x18,0xc0, - 0x09,0x42,0x27,0x20,0xd9,0x20,0x74,0x12, - 0xd0,0x89,0x40,0x63,0x20,0x06,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x05,0xa8,0x23, - 0x00,0x93,0x00,0x4c,0x02,0x30,0x08,0xc0, - 0x24,0x00,0x93,0x00,0x4d,0x2a,0x30,0x0d, - 0xc8,0x66,0x42,0x91,0x12,0x44,0x00,0xf1, - 0x09,0xc0,0xa7,0x44,0x99,0x00,0x74,0x0a, - 0xf0,0x09,0xc1,0x17,0x20,0x0e,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x15,0x80,0x65, - 0x02,0x9f,0x00,0x3d,0x02,0xf4,0x0d,0xc0, - 0x22,0x40,0x9f,0x00,0x7c,0x06,0xf0,0x19, - 0xc0,0x27,0x00,0x97,0x09,0x6c,0x00,0xf0, - 0x0d,0xc0,0x27,0x12,0xd7,0x10,0x7c,0x02, - 0xf1,0x19,0xc0,0x57,0x00,0x06,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x14,0x08,0x05, - 0x00,0x07,0x00,0x4d,0x00,0x30,0x01,0xc1, - 0x04,0x20,0x33,0x00,0xcd,0x00,0x70,0x81, - 0xc0,0x07,0x00,0x1f,0x03,0x7c,0x90,0xf0, - 0x81,0xc1,0x87,0x18,0x1f,0x48,0x7c,0x00, - 0x30,0x41,0xd0,0x50,0x20,0x04,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x14,0xa0,0x1c, - 0x02,0x51,0x00,0x44,0x01,0x10,0x35,0x40, - 0x14,0x00,0x51,0x00,0x54,0x01,0x10,0x05, - 0xc0,0x99,0x02,0x6d,0x01,0xf4,0x11,0xd0, - 0x25,0x40,0x13,0x10,0x5d,0x42,0xf4,0x01, - 0x14,0x27,0x42,0x50,0x00,0x02,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x34,0x20,0x30, - 0x02,0xc5,0x40,0x04,0x03,0x14,0x3c,0x00, - 0x10,0x40,0x11,0x00,0x05,0x02,0x50,0x1c, - 0x40,0xb3,0x00,0x0d,0x08,0x30,0x0b,0xd0, - 0x3c,0x40,0x33,0x00,0xcd,0x03,0x34,0x02, - 0x12,0xbc,0x40,0xd0,0x00,0x0a,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x05,0x80,0x38, - 0x40,0xe1,0x00,0x84,0x03,0x10,0x0e,0x41, - 0x38,0x00,0xe1,0x00,0xd4,0x03,0x10,0x0e, - 0x40,0x39,0x00,0x2d,0x00,0xb4,0x93,0xd0, - 0x0e,0x40,0x3b,0x00,0xed,0x40,0xb4,0x16, - 0x10,0x1f,0x40,0x14,0x00,0x02,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x15,0x10,0x78, - 0x00,0xf7,0x01,0x04,0x07,0x30,0x1c,0xc0, - 0x50,0x00,0x03,0x01,0x8c,0x04,0x70,0xd6, - 0xc0,0x5b,0x00,0x2f,0x01,0xbc,0x07,0xf2, - 0x1e,0xc4,0x7b,0x10,0x6f,0x01,0xfc,0x0e, - 0x30,0x1e,0xc0,0x54,0x40,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x10,0xb8,0x31, - 0x00,0xdf,0x08,0x7c,0x03,0xf3,0x4d,0xd0, - 0x36,0x00,0xff,0x00,0x7c,0x01,0xf0,0x4d, - 0xc0,0x15,0x00,0x1f,0x80,0x7c,0x23,0xf0, - 0x6d,0xc8,0x37,0x00,0x5f,0x32,0x7c,0x02, - 0xf0,0x0f,0xc2,0x43,0x60,0x06,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0xa0,0x7b, - 0x00,0xf7,0x01,0xfc,0x07,0xf2,0x37,0xc4, - 0x5c,0x00,0x33,0x01,0xcc,0x06,0xe0,0x1b, - 0xc1,0x7f,0x00,0x7f,0x09,0xf8,0x27,0xf0, - 0xb7,0xc0,0x7f,0x02,0xff,0x01,0xbc,0x86, - 0x34,0x1f,0xc0,0x03,0x00,0x0e,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x15,0x88,0x39, - 0x01,0xe1,0x08,0xb4,0x43,0xd0,0x4e,0x40, - 0x38,0x06,0xeb,0x00,0xac,0x03,0xd0,0x8e, - 0x40,0xbb,0x00,0x6d,0x00,0xb4,0x23,0xd0, - 0x02,0x40,0x3b,0x00,0xad,0x40,0xb4,0x02, - 0x10,0x0e,0x40,0x57,0x20,0x06,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x39, - 0x84,0xe5,0x00,0xb4,0x23,0xd0,0x0c,0x40, - 0x10,0x00,0x21,0x00,0x84,0x00,0xd0,0x12, - 0x40,0x3b,0x00,0x6d,0x80,0xb4,0x03,0xd8, - 0x1e,0x62,0x3b,0x80,0xed,0x00,0xb4,0x02, - 0x10,0x0e,0x41,0x03,0x00,0x04,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x04,0x28,0x33, - 0x00,0xc1,0x09,0x34,0x0b,0xd0,0x0c,0x40, - 0xb0,0x00,0xc9,0x0b,0x24,0x21,0xd8,0x1c, - 0x40,0xb3,0x00,0x4d,0x13,0x34,0x03,0xd0, - 0x08,0x44,0x73,0x08,0x8d,0x20,0x74,0x0e, - 0x10,0x1c,0x41,0x13,0x20,0x0c,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x15,0xa8,0x15, - 0x00,0xf7,0x02,0x7c,0x0f,0xf0,0x05,0xd0, - 0xd4,0x00,0x13,0x02,0x4c,0x06,0xf0,0x8d, - 0xc1,0x37,0x04,0x9f,0x03,0x7c,0x03,0xf0, - 0x09,0xc0,0xff,0x03,0x9f,0x00,0xfc,0x0a, - 0x30,0x0d,0xc4,0x57,0x20,0x06,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x01,0x00,0xb7, - 0x00,0xdf,0x04,0x3c,0x13,0xf0,0x2d,0xc0, - 0x3b,0x01,0xdf,0x04,0x7c,0x13,0xf0,0x21, - 0xc0,0xa7,0x01,0x1c,0x08,0x7c,0x0b,0xf0, - 0x0d,0xc0,0x37,0x00,0xdf,0x02,0x7c,0x22, - 0xf2,0x29,0xc0,0x07,0x00,0x0c,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x80,0x08,0x3e, - 0x00,0xe3,0x00,0xcc,0x03,0x10,0x0f,0x80, - 0x1c,0x00,0x23,0x00,0xcc,0x00,0x30,0x07, - 0xc2,0x2f,0x00,0xbf,0x21,0xec,0x0b,0xf0, - 0x02,0xc0,0x3c,0x20,0x3f,0x00,0xfc,0x42, - 0x30,0x0f,0xc0,0x03,0x22,0x0c,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x81,0x20,0xf2, - 0x41,0xd1,0x00,0x44,0x03,0x11,0x6c,0x40, - 0x34,0x00,0xd1,0x00,0x54,0x01,0x50,0x21, - 0x40,0xf7,0x00,0x0d,0x07,0x44,0x17,0xd0, - 0x65,0x40,0x35,0x10,0x5d,0x00,0x74,0x02, - 0x14,0x37,0x42,0x07,0x02,0x08,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x01,0xa0,0x74, - 0x00,0xd1,0x00,0x44,0x03,0x50,0x4d,0x40, - 0x15,0x00,0x11,0x00,0x04,0x02,0x10,0x89, - 0x40,0x77,0x00,0x5d,0x04,0x64,0x03,0xd0, - 0x81,0x40,0x34,0x00,0x1d,0x08,0x74,0x02, - 0x10,0x1d,0x41,0x07,0x00,0x02,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x10,0x20,0x30, - 0x00,0xc1,0x00,0x05,0x03,0x50,0x08,0x40, - 0x31,0x40,0xc1,0x00,0x15,0x03,0x50,0x00, - 0x44,0x23,0x00,0xcd,0x40,0x04,0x03,0xd0, - 0x00,0x40,0x31,0x80,0x0d,0x00,0x34,0x02, - 0x10,0x0c,0x40,0x43,0x80,0x00,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0xb0,0x26, - 0x00,0xd3,0x80,0x4c,0x03,0x74,0x0d,0xd0, - 0x15,0x20,0x03,0x00,0x4d,0x00,0x30,0x01, - 0xc0,0x27,0x00,0x1f,0x00,0x6c,0x83,0xf0, - 0x01,0xc0,0x34,0x08,0x1f,0x20,0x7c,0x02, - 0x30,0x0d,0xc0,0x03,0xc0,0x0a,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x05,0xb8,0x2f, - 0x00,0xff,0x00,0xfc,0x03,0xb0,0x0b,0xc0, - 0x3e,0x00,0xff,0x00,0xfc,0x01,0xf0,0x03, - 0xc0,0x3f,0x00,0xbf,0x00,0xfc,0x83,0xf0, - 0x03,0xc4,0x3f,0x00,0x3f,0x40,0xfc,0x02, - 0xf0,0x0f,0xc0,0x17,0x60,0x0e,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x03,0xa0,0x3b, - 0x00,0xf3,0x01,0xcc,0x87,0xf0,0x17,0xc8, - 0x4c,0x08,0xb3,0x01,0xcc,0x02,0x30,0x0b, - 0xc0,0x3c,0x00,0xff,0x00,0xec,0x07,0xf0, - 0x0f,0xc8,0x0e,0x08,0x3f,0x00,0x8c,0x02, - 0x34,0x1e,0xc0,0x0f,0x00,0x0e,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x01,0x08,0x7f, - 0x00,0xdb,0x14,0x45,0x06,0xd0,0x05,0x44, - 0x34,0x00,0x51,0x20,0x4d,0x06,0xb0,0x0d, - 0x60,0x7d,0x80,0xdd,0x01,0x44,0x03,0xd0, - 0x0d,0x40,0x34,0x00,0xdd,0x21,0x54,0x05, - 0x12,0x1d,0x40,0x0f,0x20,0x0c,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x10,0xa0,0x33, - 0x00,0xd5,0x00,0x04,0x03,0xd0,0x04,0x40, - 0x00,0x40,0x81,0x00,0x05,0x02,0x10,0x00, - 0x40,0x30,0x00,0xcd,0x00,0x24,0x03,0xd0, - 0x0c,0x40,0x02,0x00,0x0d,0x00,0x04,0x02, - 0x10,0x0c,0x48,0x4f,0x80,0x0e,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x03,0xa8,0x35, - 0x00,0x9d,0x08,0x44,0x09,0xd0,0x05,0x44, - 0x34,0x00,0x51,0x00,0x64,0x06,0x90,0x1d, - 0x42,0x35,0x80,0xdd,0x00,0x44,0x0b,0xd0, - 0x0d,0x40,0x34,0x00,0xdd,0x80,0x54,0x01, - 0x11,0x0d,0x46,0x1f,0x20,0x06,0x00,0x00, - 0x00,0x00,0x00,0x00,0x00,0x02,0xa8,0x33, - 0x10,0xc7,0x02,0x4c,0x0b,0xf2,0x0d,0xd0, - 0x04,0x40,0x93,0x00,0x4c,0x15,0x33,0x19, - 0x44,0x34,0x00,0xcd,0x00,0x6c,0x23,0xf0, - 0x0d,0xc0,0x06,0x00,0x1f,0x00,0x4c,0x02, - 0x32,0x0d,0xc1,0x0b,0x20,0x0e,0x00,0x00, + 0x00,0xdf,0x00,0x6c,0x01,0xf0,0x0d,0x40, + 0x07,0x00,0x9f,0x00,0x7c,0x03,0x30,0x0d, + 0xc4,0x37,0x00,0x1f,0x00,0x4c,0x03,0xf0, + 0x09,0xc0,0x26,0x00,0x9f,0x80,0x4c,0x02, + 0x74,0x0e,0xc0,0x00,0xc0,0x0a,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x05,0xa8,0x2f, + 0x00,0xfb,0x40,0xfc,0x82,0xf0,0x0f,0xc4, + 0x0f,0xa0,0xbf,0x00,0xfe,0x83,0xf0,0x0f, + 0xc4,0x3f,0x08,0x3f,0x00,0xfc,0x03,0xd0, + 0x0b,0xc0,0x3d,0x10,0x7f,0x00,0xfc,0x03, + 0xf0,0x0f,0xc0,0x17,0x20,0x0e,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x03,0xa0,0x5f, + 0x00,0x2b,0x01,0xcc,0x86,0xf0,0x0b,0xc0, + 0x2f,0x02,0xfa,0x21,0xfc,0x07,0xf0,0x4f, + 0xc0,0x7e,0x00,0x3f,0x01,0xcc,0x07,0xf0, + 0x1b,0xc0,0x3f,0x00,0xb3,0x01,0xdc,0x06, + 0xf0,0x0f,0xc0,0x0f,0x00,0x0e,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x01,0x08,0x17, + 0x00,0xd1,0x00,0x44,0x01,0xd0,0x19,0x40, + 0x27,0x21,0xd1,0x01,0x74,0x07,0xd0,0x9f, + 0x40,0x74,0x00,0x1d,0x81,0x44,0x07,0xd0, + 0x09,0x40,0x37,0x40,0x91,0x21,0x74,0x06, + 0xd1,0x0d,0x40,0x87,0x20,0x0c,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x10,0xa0,0x13, + 0x10,0x11,0x00,0x04,0x02,0xd2,0x08,0x40, + 0x33,0x00,0xc9,0x40,0x24,0x03,0xd0,0x0c, + 0x44,0x32,0x00,0x0d,0x00,0x06,0x03,0xd8, + 0x0c,0x40,0x33,0x00,0x81,0x00,0x34,0x03, + 0xd8,0x0c,0x40,0x43,0x80,0x0e,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x03,0x88,0x15, + 0x00,0xd1,0x00,0x45,0x01,0xd0,0x19,0x40, + 0x77,0x08,0xd1,0xb0,0x76,0x83,0xd0,0x0d, + 0x40,0x36,0x01,0x9d,0x21,0x44,0x43,0xd0, + 0x0d,0x60,0x37,0x00,0x91,0x01,0x74,0x03, + 0xd0,0x0d,0x40,0x0f,0x20,0x06,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x06,0xa8,0x37, + 0xc0,0x1b,0x00,0x4c,0x02,0xf0,0x35,0xc1, + 0x47,0x00,0xdb,0x22,0x6c,0x67,0xf2,0x0d, + 0xc0,0x76,0x00,0x0e,0x53,0x4c,0x0b,0xf0, + 0x09,0xc0,0x3f,0x20,0x93,0x03,0x5c,0x26, + 0xf0,0x0d,0xc0,0x0b,0x20,0x0e,0x00,0x00, [... truncated: 20354 lines follow ...] From korli at mail.berlios.de Mon Mar 19 21:46:02 2007 From: korli at mail.berlios.de (korli at BerliOS) Date: Mon, 19 Mar 2007 21:46:02 +0100 Subject: [Haiku-commits] r20395 - haiku/trunk/src/servers/registrar Message-ID: <200703192046.l2JKk2vG018878@sheep.berlios.de> Author: korli Date: 2007-03-19 21:46:01 +0100 (Mon, 19 Mar 2007) New Revision: 20395 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20395&view=rev Modified: haiku/trunk/src/servers/registrar/ShutdownProcess.cpp Log: fixed bug #637: "Shutdown window didn't draw fancy gray box where closing app's icons are shown as in BeOS." Modified: haiku/trunk/src/servers/registrar/ShutdownProcess.cpp =================================================================== --- haiku/trunk/src/servers/registrar/ShutdownProcess.cpp 2007-03-19 19:06:47 UTC (rev 20394) +++ haiku/trunk/src/servers/registrar/ShutdownProcess.cpp 2007-03-19 20:46:01 UTC (rev 20395) @@ -244,19 +244,13 @@ // create the views // root view - BView *rootView = new(nothrow) BView(BRect(0, 0, 100, 15), "app icons", + fRootView = new(nothrow) TAlertView(BRect(0, 0, 100, 15), "app icons", B_FOLLOW_NONE, 0); - if (!rootView) + if (!fRootView) return B_NO_MEMORY; - rootView->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR)); - AddChild(rootView); + fRootView->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR)); + AddChild(fRootView); - // current app icon view - fCurrentAppIconView = new(nothrow) CurrentAppIconView; - if (!fCurrentAppIconView) - return B_NO_MEMORY; - rootView->AddChild(fCurrentAppIconView); - // text view fTextView = new(nothrow) BTextView(BRect(0, 0, 10, 10), "text", BRect(0, 0, 10, 10), B_FOLLOW_NONE); @@ -266,14 +260,14 @@ fTextView->MakeEditable(false); fTextView->MakeSelectable(false); fTextView->SetWordWrap(true); - rootView->AddChild(fTextView); + fRootView->AddChild(fTextView); // kill app button fKillAppButton = new(nothrow) BButton(BRect(0, 0, 10, 10), "kill app", "Kill Application", NULL, B_FOLLOW_NONE); if (!fKillAppButton) return B_NO_MEMORY; - rootView->AddChild(fKillAppButton); + fRootView->AddChild(fKillAppButton); BMessage *message = new BMessage(MSG_KILL_APPLICATION); if (!message) @@ -288,7 +282,7 @@ "cancel shutdown", "Cancel Shutdown", NULL, B_FOLLOW_NONE); if (!fCancelShutdownButton) return B_NO_MEMORY; - rootView->AddChild(fCancelShutdownButton); + fRootView->AddChild(fCancelShutdownButton); message = new BMessage(MSG_CANCEL_SHUTDOWN); if (!message) @@ -302,7 +296,7 @@ if (!fRebootSystemButton) return B_NO_MEMORY; fRebootSystemButton->Hide(); - rootView->AddChild(fRebootSystemButton); + fRootView->AddChild(fRebootSystemButton); message = new BMessage(MSG_REBOOT_SYSTEM); if (!message) @@ -316,7 +310,7 @@ if (!fAbortedOKButton) return B_NO_MEMORY; fAbortedOKButton->Hide(); - rootView->AddChild(fAbortedOKButton); + fRootView->AddChild(fAbortedOKButton); message = new BMessage(MSG_CANCEL_SHUTDOWN); if (!message) @@ -353,14 +347,8 @@ fTextView->SetText("two\nlines"); int textHeight = (int)fTextView->TextHeight(0, 1) + 1; - // current app icon view - int currentAppIconWidth = fCurrentAppIconView->Frame().IntegerWidth() + int rightPartX = fRootView->Frame().IntegerWidth() + 1; - int currentAppIconHeight = fCurrentAppIconView->Frame().IntegerHeight() - + 1; - - int currentAppIconX = kHSpacing; - int rightPartX = currentAppIconX + currentAppIconWidth; int textX = rightPartX + kInnerHSpacing; int textY = kVSpacing; int buttonsY = textY + textHeight + kInnerVSpacing; @@ -372,10 +360,6 @@ // now layout the views - // current app icon view - fCurrentAppIconView->MoveTo(currentAppIconX, - textY + (textHeight - currentAppIconHeight) / 2); - // text view fTextView->MoveTo(textX, textY); fTextView->ResizeTo(rightPartWidth + rightPartX - textX - 1, @@ -400,7 +384,7 @@ buttonsY); // set the root view and window size - rootView->ResizeTo(width - 1, height - 1); + fRootView->ResizeTo(width - 1, height - 1); ResizeTo(width - 1, height - 1); // move the window to the same position as BAlerts @@ -452,7 +436,7 @@ AppInfo *info = (team >= 0 ? _AppInfoFor(team) : NULL); fCurrentApp = team; - fCurrentAppIconView->SetAppInfo(info); + fRootView->SetAppInfo(info); fKillAppMessage->ReplaceInt32("team", team); } @@ -481,7 +465,6 @@ void SetWaitForShutdown() { - fCurrentAppIconView->Hide(); fKillAppButton->Hide(); fCancelShutdownButton->Hide(); fRebootSystemButton->MakeDefault(true); @@ -493,7 +476,6 @@ void SetWaitForAbortedOK() { - fCurrentAppIconView->Hide(); fKillAppButton->Hide(); fCancelShutdownButton->Hide(); fAbortedOKButton->MakeDefault(true); @@ -536,31 +518,29 @@ return (index >= 0 ? (AppInfo*)fAppInfos.ItemAt(index) : NULL); } - class CurrentAppIconView : public BView { + class TAlertView : public BView { public: - CurrentAppIconView() - : BView(BRect(0, 0, 31, 31), "current app icon", B_FOLLOW_NONE, - B_WILL_DRAW), + TAlertView(BRect frame, const char *name, uint32 resizeMask, uint32 flags) + : BView(frame, name, resizeMask, flags | B_WILL_DRAW), fAppInfo(NULL) { - SetViewColor(B_TRANSPARENT_32_BIT); - fBackground = ui_color(B_PANEL_BACKGROUND_COLOR); } virtual void Draw(BRect updateRect) { - SetDrawingMode(B_OP_COPY); - SetLowColor(fBackground); - FillRect(Bounds(), B_SOLID_LOW); - + BRect stripeRect = Bounds(); + stripeRect.right = 30; + SetHighColor(tint_color(ViewColor(), B_DARKEN_1_TINT)); + FillRect(stripeRect); + if (fAppInfo && fAppInfo->largeIcon) { if (fAppInfo->largeIcon->ColorSpace() == B_RGBA32) { SetDrawingMode(B_OP_ALPHA); SetBlendingMode(B_PIXEL_ALPHA, B_ALPHA_OVERLAY); } else SetDrawingMode(B_OP_OVER); - - DrawBitmap(fAppInfo->largeIcon, BPoint(0, 0)); + + DrawBitmapAsync(fAppInfo->largeIcon, BPoint(18, 6)); } } @@ -572,12 +552,11 @@ private: const AppInfo *fAppInfo; - rgb_color fBackground; }; private: BList fAppInfos; - CurrentAppIconView *fCurrentAppIconView; + TAlertView *fRootView; BTextView *fTextView; BButton *fKillAppButton; BButton *fCancelShutdownButton; From bonefish at mail.berlios.de Tue Mar 20 17:20:14 2007 From: bonefish at mail.berlios.de (bonefish at BerliOS) Date: Tue, 20 Mar 2007 17:20:14 +0100 Subject: [Haiku-commits] r20396 - in haiku/trunk: headers/os/kernel headers/private/kernel src/system/kernel/debug src/system/libroot/os Message-ID: <200703201620.l2KGKEsf002502@sheep.berlios.de> Author: bonefish Date: 2007-03-20 17:20:13 +0100 (Tue, 20 Mar 2007) New Revision: 20396 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20396&view=rev Modified: haiku/trunk/headers/os/kernel/debugger.h haiku/trunk/headers/private/kernel/syscalls.h haiku/trunk/headers/private/kernel/user_debugger.h haiku/trunk/src/system/kernel/debug/user_debugger.cpp haiku/trunk/src/system/libroot/os/debug.c Log: Added new functions to the debugger API: {set,clear}_debugger_{break,watch}point(), allowing to set/clear break and watchpoints for the calling team. When a break/watchpoint is hit, the team enters the debugger. Handy in situations when the program in question can't really be started in a debugger (or it would be complicated to do so). The functions work only as long as no debugger is installed for the team. We clear the arch specific team and thread debug infos now, when a new debugger is installed, thus clearing break- and watchpoints. Modified: haiku/trunk/headers/os/kernel/debugger.h =================================================================== --- haiku/trunk/headers/os/kernel/debugger.h 2007-03-19 20:46:01 UTC (rev 20395) +++ haiku/trunk/headers/os/kernel/debugger.h 2007-03-20 16:20:13 UTC (rev 20396) @@ -29,6 +29,16 @@ extern status_t debug_thread(thread_id thread); extern void wait_for_debugger(void); +// EXPERIMENTAL: Self-debugging functions. Will fail when a team debugger is +// installed. A breakpoint/watchpoint hit will cause the default debugger to +// be installed for the team. +extern status_t set_debugger_breakpoint(void *address); +extern status_t clear_debugger_breakpoint(void *address); +extern status_t set_debugger_watchpoint(void *address, uint32 type, + int32 length); +extern status_t clear_debugger_watchpoint(void *address); + + // team debugging flags enum { // event mask: If a flag is set, any of the team's threads will stop when Modified: haiku/trunk/headers/private/kernel/syscalls.h =================================================================== --- haiku/trunk/headers/private/kernel/syscalls.h 2007-03-19 20:46:01 UTC (rev 20395) +++ haiku/trunk/headers/private/kernel/syscalls.h 2007-03-20 16:20:13 UTC (rev 20396) @@ -263,6 +263,10 @@ extern status_t _kern_debug_thread(thread_id thread); extern void _kern_wait_for_debugger(void); +extern status_t _kern_set_debugger_breakpoint(void *address, uint32 type, + int32 length, bool watchpoint); +extern status_t _kern_clear_debugger_breakpoint(void *address, + bool watchpoint); /* atomic_* ops (needed for CPUs that don't support them directly) */ #ifdef ATOMIC_FUNCS_ARE_SYSCALLS Modified: haiku/trunk/headers/private/kernel/user_debugger.h =================================================================== --- haiku/trunk/headers/private/kernel/user_debugger.h 2007-03-19 20:46:01 UTC (rev 20395) +++ haiku/trunk/headers/private/kernel/user_debugger.h 2007-03-20 16:20:13 UTC (rev 20396) @@ -177,7 +177,11 @@ status_t _user_debug_thread(thread_id thread); void _user_wait_for_debugger(void); +status_t _user_set_debugger_breakpoint(void *address, uint32 type, + int32 length, bool watchpoint); +status_t _user_clear_debugger_breakpoint(void *address, bool watchpoint); + #ifdef __cplusplus } // extern "C" #endif Modified: haiku/trunk/src/system/kernel/debug/user_debugger.cpp =================================================================== --- haiku/trunk/src/system/kernel/debug/user_debugger.cpp 2007-03-19 20:46:01 UTC (rev 20395) +++ haiku/trunk/src/system/kernel/debug/user_debugger.cpp 2007-03-20 16:20:13 UTC (rev 20396) @@ -1786,11 +1786,14 @@ /** \brief Helper function for install_team_debugger(), that sets up the team - * and thread debug infos. - * - * Interrupts must be enabled and the team debug info lock of the team to be - * debugged must be held. The function will release the lock, but leave - * interrupts disabled. + and thread debug infos. + + Interrupts must be disabled and the team debug info lock of the team to be + debugged must be held. The function will release the lock, but leave + interrupts disabled. + + The function also clears the arch specific team and thread debug infos + (including among other things formerly set break/watchpoints). */ static void install_team_debugger_init_debug_infos(struct team *team, team_id debuggerTeam, @@ -1805,6 +1808,8 @@ team->debug_info.debugger_port = debuggerPort; team->debug_info.debugger_write_lock = debuggerPortWriteLock; + arch_clear_team_debug_info(&team->debug_info.arch_info); + RELEASE_TEAM_DEBUG_INFO_LOCK(team->debug_info); // set the user debug flags and signal masks of all threads to the default @@ -1822,6 +1827,8 @@ flags | B_THREAD_DEBUG_DEFAULT_FLAGS); thread->debug_info.ignore_signals = 0; thread->debug_info.ignore_signals_once = 0; + + arch_clear_thread_debug_info(&thread->debug_info.arch_info); } } @@ -2229,6 +2236,7 @@ return error; } + void _user_wait_for_debugger(void) { @@ -2238,3 +2246,54 @@ } +status_t +_user_set_debugger_breakpoint(void *address, uint32 type, int32 length, + bool watchpoint) +{ + // check the address and size + if (address == NULL || !IS_USER_ADDRESS(address)) + return B_BAD_ADDRESS; + if (watchpoint && length < 0) + return B_BAD_VALUE; + + // check whether a debugger is installed already + team_debug_info teamDebugInfo; + get_team_debug_info(teamDebugInfo); + if (teamDebugInfo.flags & B_TEAM_DEBUG_DEBUGGER_INSTALLED) + return B_BAD_VALUE; + + // We can't help it, here's a small but relatively harmless race condition, + // since a debugger could be installed in the meantime. The worst case is + // that we install a break/watchpoint the debugger doesn't know about. + + // set the break/watchpoint + if (watchpoint) + return arch_set_watchpoint(address, type, length); + else + return arch_set_breakpoint(address); +} + + +status_t +_user_clear_debugger_breakpoint(void *address, bool watchpoint) +{ + // check the address + if (address == NULL || !IS_USER_ADDRESS(address)) + return B_BAD_ADDRESS; + + // check whether a debugger is installed already + team_debug_info teamDebugInfo; + get_team_debug_info(teamDebugInfo); + if (teamDebugInfo.flags & B_TEAM_DEBUG_DEBUGGER_INSTALLED) + return B_BAD_VALUE; + + // We can't help it, here's a small but relatively harmless race condition, + // since a debugger could be installed in the meantime. The worst case is + // that we clear a break/watchpoint the debugger has just installed. + + // clear the break/watchpoint + if (watchpoint) + return arch_clear_watchpoint(address); + else + return arch_clear_breakpoint(address); +} Modified: haiku/trunk/src/system/libroot/os/debug.c =================================================================== --- haiku/trunk/src/system/libroot/os/debug.c 2007-03-19 20:46:01 UTC (rev 20395) +++ haiku/trunk/src/system/libroot/os/debug.c 2007-03-20 16:20:13 UTC (rev 20396) @@ -114,6 +114,34 @@ } +status_t +set_debugger_breakpoint(void *address) +{ + return _kern_set_debugger_breakpoint(address, 0, 0, false); +} + + +status_t +clear_debugger_breakpoint(void *address) +{ + return _kern_clear_debugger_breakpoint(address, false); +} + + +status_t +set_debugger_watchpoint(void *address, uint32 type, int32 length) +{ + return _kern_set_debugger_breakpoint(address, type, length, true); +} + + +status_t +clear_debugger_watchpoint(void *address) +{ + return _kern_clear_debugger_breakpoint(address, true); +} + + static void get_debug_string(const debug_string_entry *stringEntries, const char *defaultString, uint32 code, char *buffer, int32 bufferSize) From axeld at mail.berlios.de Tue Mar 20 20:15:32 2007 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Tue, 20 Mar 2007 20:15:32 +0100 Subject: [Haiku-commits] r20397 - haiku/trunk/src/add-ons/kernel/network/stack Message-ID: <200703201915.l2KJFWa7028480@sheep.berlios.de> Author: axeld Date: 2007-03-20 20:15:31 +0100 (Tue, 20 Mar 2007) New Revision: 20397 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20397&view=rev Modified: haiku/trunk/src/add-ons/kernel/network/stack/datalink.cpp haiku/trunk/src/add-ons/kernel/network/stack/interfaces.cpp haiku/trunk/src/add-ons/kernel/network/stack/interfaces.h Log: No longer crashes when deleting "certain" interfaces (couldn't reproduce the crash in Qemu for some reason). Modified: haiku/trunk/src/add-ons/kernel/network/stack/datalink.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/network/stack/datalink.cpp 2007-03-20 16:20:13 UTC (rev 20396) +++ haiku/trunk/src/add-ons/kernel/network/stack/datalink.cpp 2007-03-20 19:15:31 UTC (rev 20397) @@ -539,7 +539,6 @@ interface_protocol *protocol = (interface_protocol *)_protocol; net_device_interface *deviceInterface = ((net_interface_private *)protocol->interface)->device_interface; - net_device *device = protocol->device; // TODO: locking! if (deviceInterface->up_count == 0) @@ -550,12 +549,7 @@ if (deviceInterface->up_count > 0) return; - device->flags &= ~IFF_UP; - protocol->device_module->down(protocol->device); - - // make sure the reader thread is gone before shutting down the interface - status_t status; - wait_for_thread(deviceInterface->reader_thread, &status); + down_device_interface(deviceInterface); } Modified: haiku/trunk/src/add-ons/kernel/network/stack/interfaces.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/network/stack/interfaces.cpp 2007-03-20 16:20:13 UTC (rev 20396) +++ haiku/trunk/src/add-ons/kernel/network/stack/interfaces.cpp 2007-03-20 19:15:31 UTC (rev 20397) @@ -160,7 +160,7 @@ if ((interface->flags & IFF_UP) != 0) { // the interface is still up - we need to change that before deleting it interface->flags &= ~IFF_UP; - interface->device_interface->module->down(interface->device_interface->device); + down_device_interface(interface->device_interface); } put_device_interface(interface->device_interface); @@ -398,6 +398,20 @@ } +void +down_device_interface(net_device_interface *interface) +{ + net_device *device = interface->device; + + device->flags &= ~IFF_UP; + interface->module->down(device); + + // make sure the reader thread is gone before shutting down the interface + status_t status; + wait_for_thread(interface->reader_thread, &status); +} + + // #pragma mark - devices Modified: haiku/trunk/src/add-ons/kernel/network/stack/interfaces.h =================================================================== --- haiku/trunk/src/add-ons/kernel/network/stack/interfaces.h 2007-03-20 16:20:13 UTC (rev 20396) +++ haiku/trunk/src/add-ons/kernel/network/stack/interfaces.h 2007-03-20 19:15:31 UTC (rev 20397) @@ -76,6 +76,7 @@ void put_device_interface(struct net_device_interface *interface); struct net_device_interface *get_device_interface(uint32 index); struct net_device_interface *get_device_interface(const char *name); +void down_device_interface(net_device_interface *interface); // devices status_t unregister_device_deframer(net_device *device); From axeld at mail.berlios.de Tue Mar 20 23:09:53 2007 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Tue, 20 Mar 2007 23:09:53 +0100 Subject: [Haiku-commits] r20398 - haiku/trunk/src/servers/net Message-ID: <200703202209.l2KM9r88022503@sheep.berlios.de> Author: axeld Date: 2007-03-20 23:09:53 +0100 (Tue, 20 Mar 2007) New Revision: 20398 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20398&view=rev Modified: haiku/trunk/src/servers/net/DHCPClient.cpp Log: Fixed a stupid bug that prevented DHCP from trying again if a request was lost (always happened here with my laptop :-)). Modified: haiku/trunk/src/servers/net/DHCPClient.cpp =================================================================== --- haiku/trunk/src/servers/net/DHCPClient.cpp 2007-03-20 19:15:31 UTC (rev 20397) +++ haiku/trunk/src/servers/net/DHCPClient.cpp 2007-03-20 22:09:53 UTC (rev 20398) @@ -404,8 +404,7 @@ char buffer[2048]; ssize_t bytesReceived = recvfrom(socket, buffer, sizeof(buffer), 0, NULL, NULL); -printf("recvfrom returned: %ld, %s\n", bytesReceived, strerror(errno)); - if (bytesReceived == B_TIMED_OUT) { + if (bytesReceived < 0 && errno == B_TIMED_OUT) { // depending on the state, we'll just try again if (!_TimeoutShift(socket, timeout, tries)) { close(socket); From axeld at mail.berlios.de Tue Mar 20 23:21:37 2007 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Tue, 20 Mar 2007 23:21:37 +0100 Subject: [Haiku-commits] r20399 - in haiku/trunk: headers/posix/net src/add-ons/kernel/network/datalink_protocols/arp Message-ID: <200703202221.l2KMLbNn024865@sheep.berlios.de> Author: axeld Date: 2007-03-20 23:21:36 +0100 (Tue, 20 Mar 2007) New Revision: 20399 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20399&view=rev Modified: haiku/trunk/headers/posix/net/if_dl.h haiku/trunk/src/add-ons/kernel/network/datalink_protocols/arp/arp.cpp Log: * Fixed the test for equality when a known ARP reply came in - you should no longer see the "ARP entry updated with different address" message. * sockaddr_dl::sdl_data is now unsigned (uint8_t instead of char). Modified: haiku/trunk/headers/posix/net/if_dl.h =================================================================== --- haiku/trunk/headers/posix/net/if_dl.h 2007-03-20 22:09:53 UTC (rev 20398) +++ haiku/trunk/headers/posix/net/if_dl.h 2007-03-20 22:21:36 UTC (rev 20399) @@ -1,5 +1,5 @@ /* - * Copyright 2006, Haiku, Inc. All Rights Reserved. + * Copyright 2006-2007, Haiku, Inc. All Rights Reserved. * Distributed under the terms of the MIT License. */ #ifndef _NET_IF_DL_H @@ -19,10 +19,10 @@ uint8_t sdl_nlen; /* interface name length (not terminated with a null byte) */ uint8_t sdl_alen; /* link level address length */ uint8_t sdl_slen; /* link layer selector length */ - char sdl_data[20]; /* minimum work area, can be larger */ + uint8_t sdl_data[20]; /* minimum work area, can be larger */ }; /* Macro to get a pointer to the link level address */ -#define LLADDR(s) ((char *)((s)->sdl_data + (s)->sdl_nlen)) +#define LLADDR(s) ((uint8_t *)((s)->sdl_data + (s)->sdl_nlen)) #endif /* _NET_IF_DL_H */ Modified: haiku/trunk/src/add-ons/kernel/network/datalink_protocols/arp/arp.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/network/datalink_protocols/arp/arp.cpp 2007-03-20 22:09:53 UTC (rev 20398) +++ haiku/trunk/src/add-ons/kernel/network/datalink_protocols/arp/arp.cpp 2007-03-20 22:21:36 UTC (rev 20399) @@ -1,5 +1,5 @@ /* - * Copyright 2006, Haiku, Inc. All Rights Reserved. + * Copyright 2006-2007, Haiku, Inc. All Rights Reserved. * Distributed under the terms of the MIT License. * * Authors: @@ -219,11 +219,13 @@ // Right now, you have to manually purge the ARP entries (or wait some // time) to let us switch to the new address. if (entry->hardware_address.sdl_alen != 0 - && memcmp(LLADDR(&entry->hardware_address), hardwareAddress, ETHER_ADDRESS_LENGTH)) { + && memcmp(LLADDR(&entry->hardware_address), + LLADDR(hardwareAddress), ETHER_ADDRESS_LENGTH)) { dprintf("ARP host %08lx updated with different hardware address %02x:%02x:%02x:%02x:%02x:%02x.\n", - protocolAddress, hardwareAddress->sdl_data[0] & 0xff, hardwareAddress->sdl_data[1] & 0xff, - hardwareAddress->sdl_data[2] & 0xff, hardwareAddress->sdl_data[3] & 0xff, - hardwareAddress->sdl_data[4] & 0xff, hardwareAddress->sdl_data[5] & 0xff); + protocolAddress, + hardwareAddress->sdl_data[0], hardwareAddress->sdl_data[1], + hardwareAddress->sdl_data[2], hardwareAddress->sdl_data[3], + hardwareAddress->sdl_data[4], hardwareAddress->sdl_data[5]); return B_ERROR; } From korli at mail.berlios.de Tue Mar 20 23:40:35 2007 From: korli at mail.berlios.de (korli at BerliOS) Date: Tue, 20 Mar 2007 23:40:35 +0100 Subject: [Haiku-commits] r20400 - haiku/trunk/src/preferences/backgrounds Message-ID: <200703202240.l2KMeZtb029504@sheep.berlios.de> Author: korli Date: 2007-03-20 23:40:34 +0100 (Tue, 20 Mar 2007) New Revision: 20400 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20400&view=rev Modified: haiku/trunk/src/preferences/backgrounds/BackgroundsView.cpp Log: calls again BMimeType::GuessMimeType() in BackgroundsView (was only called in the ImagePanel filter) should fix bug #1101 Modified: haiku/trunk/src/preferences/backgrounds/BackgroundsView.cpp =================================================================== --- haiku/trunk/src/preferences/backgrounds/BackgroundsView.cpp 2007-03-20 22:21:36 UTC (rev 20399) +++ haiku/trunk/src/preferences/backgrounds/BackgroundsView.cpp 2007-03-20 22:40:34 UTC (rev 20400) @@ -972,12 +972,8 @@ BNode node(&entry); if (node.IsFile()) { - BNodeInfo nodeInfo(&node); - char fileType[B_MIME_TYPE_LENGTH]; - if (nodeInfo.GetType(fileType) != B_OK) - continue; - - BMimeType refType(fileType); + BMimeType refType; + BMimeType::GuessMimeType(&ref, &refType); if (!imageType.Contains(&refType)) continue; From bonefish at mail.berlios.de Wed Mar 21 20:36:35 2007 From: bonefish at mail.berlios.de (bonefish at BerliOS) Date: Wed, 21 Mar 2007 20:36:35 +0100 Subject: [Haiku-commits] r20401 - haiku/trunk/src/tests/system/kernel Message-ID: <200703211936.l2LJaZ8d030949@sheep.berlios.de> Author: bonefish Date: 2007-03-21 20:36:34 +0100 (Wed, 21 Mar 2007) New Revision: 20401 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20401&view=rev Added: haiku/trunk/src/tests/system/kernel/cow_bug113_test.cpp Modified: haiku/trunk/src/tests/system/kernel/Jamfile Log: "Clean room" test for a "copy on write" problem leading to bugs #113 and #928. Under certain conditions a fork()ed child process can write to the parent process' memory. A fix follows... Modified: haiku/trunk/src/tests/system/kernel/Jamfile =================================================================== --- haiku/trunk/src/tests/system/kernel/Jamfile 2007-03-20 22:40:34 UTC (rev 20400) +++ haiku/trunk/src/tests/system/kernel/Jamfile 2007-03-21 19:36:34 UTC (rev 20401) @@ -3,10 +3,17 @@ UsePrivateHeaders kernel ; UseHeaders $(TARGET_PRIVATE_KERNEL_HEADERS) : true ; +SimpleTest cow_bug113_test : cow_bug113_test.cpp ; + SimpleTest fibo_load_image : fibo_load_image.cpp ; SimpleTest fibo_fork : fibo_fork.cpp ; SimpleTest fibo_exec : fibo_exec.cpp ; +SimpleTest lock_node_test : + lock_node_test.cpp + : be +; + SimpleTest port_close_test_1 : port_close_test_1.cpp ; SimpleTest port_close_test_2 : port_close_test_2.cpp ; @@ -22,17 +29,12 @@ SimpleTest port_wakeup_test_8 : port_wakeup_test_8.cpp ; SimpleTest port_wakeup_test_9 : port_wakeup_test_9.cpp ; +SimpleTest syscall_time : syscall_time.cpp ; + SimpleTest transfer_area_test : transfer_area_test.cpp ; -SimpleTest syscall_time : syscall_time.cpp ; - SimpleTest yield_test : yield_test.cpp ; -SimpleTest lock_node_test : - lock_node_test.cpp - : be - ; - SimpleTest wait_test_1 : wait_test_1.c ; SimpleTest wait_test_2 : wait_test_2.cpp ; SimpleTest wait_test_3 : wait_test_3.cpp ; Added: haiku/trunk/src/tests/system/kernel/cow_bug113_test.cpp =================================================================== --- haiku/trunk/src/tests/system/kernel/cow_bug113_test.cpp 2007-03-20 22:40:34 UTC (rev 20400) +++ haiku/trunk/src/tests/system/kernel/cow_bug113_test.cpp 2007-03-21 19:36:34 UTC (rev 20401) @@ -0,0 +1,64 @@ +#include +#include +#include + +#include + +const char* kInitialValue = "/dev/null"; +const char* kChangedValue = "Argh!"; + +int +main(int argc, const char* const* argv) +{ + thread_id parent = find_thread(NULL); + + char* globalVar = NULL; + area_id area = create_area("cow test", (void**)&globalVar, + B_ANY_ADDRESS, B_PAGE_SIZE, B_NO_LOCK, B_READ_AREA | B_WRITE_AREA); + if (area < 0) { + printf("failed to create area\n"); + return 1; + } + + strcpy(globalVar, kInitialValue); + + printf("[%ld] parent: before fork(): globalVar(%p): \"%s\"\n", parent, + globalVar, globalVar); + + pid_t child = fork(); + if (child == 0) { + // child + child = find_thread(NULL); + + // let the kernel read access the page + struct stat st; + stat(globalVar, &st); + + printf("[%ld] child: after kernel read: globalVar: \"%s\"\n", + child, globalVar); + + // write access the page from userland + strcpy(globalVar, kChangedValue); + + printf("[%ld] child: after change: globalVar: \"%s\"\n", child, + globalVar); + + } else { + // parent + + // wait for the child + status_t exitVal; + while (wait_for_thread(child, &exitVal) == B_INTERRUPTED); + + // check the value + printf("[%ld] parent: after exit child: globalVar: \"%s\"\n", + parent, globalVar); + + if (strcmp(globalVar, kInitialValue) == 0) + printf("test OK\n"); + else + printf("test FAILED: child process changed parent's memory!\n"); + } + + return 0; +} From bonefish at mail.berlios.de Wed Mar 21 20:48:39 2007 From: bonefish at mail.berlios.de (bonefish at BerliOS) Date: Wed, 21 Mar 2007 20:48:39 +0100 Subject: [Haiku-commits] r20402 - haiku/trunk/src/system/kernel/vm Message-ID: <200703211948.l2LJmdDu031603@sheep.berlios.de> Author: bonefish Date: 2007-03-21 20:48:38 +0100 (Wed, 21 Mar 2007) New Revision: 20402 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20402&view=rev Modified: haiku/trunk/src/system/kernel/vm/vm.cpp Log: In a copy-on-write situation a page from a lower cache must always be mapped fully read-only (for both kernel and userland). Previously a kernel read access to a yet unmapped r/w accessible userland address would cause the page from the lower cache to be mapped with write permission for userland (on x86 also for the kernel) thus e.g. allowing a fork()ed child process to write to the parent process' memory. Fixes bugs #113 and #928. Modified: haiku/trunk/src/system/kernel/vm/vm.cpp =================================================================== --- haiku/trunk/src/system/kernel/vm/vm.cpp 2007-03-21 19:36:34 UTC (rev 20401) +++ haiku/trunk/src/system/kernel/vm/vm.cpp 2007-03-21 19:48:38 UTC (rev 20402) @@ -3474,7 +3474,7 @@ // mapped in read-only, so that we cannot overwrite someone else's data (copy-on-write) uint32 newProtection = area->protection; if (page->cache != topCacheRef->cache && !isWrite) - newProtection &= ~(isUser ? B_WRITE_AREA : B_KERNEL_WRITE_AREA); + newProtection &= ~(B_WRITE_AREA | B_KERNEL_WRITE_AREA); vm_map_page(area, page, address, newProtection); } From jackburton at mail.berlios.de Thu Mar 22 15:48:03 2007 From: jackburton at mail.berlios.de (jackburton at BerliOS) Date: Thu, 22 Mar 2007 15:48:03 +0100 Subject: [Haiku-commits] r20403 - haiku/trunk/src/kits/interface Message-ID: <200703221448.l2MEm3ln009842@sheep.berlios.de> Author: jackburton Date: 2007-03-22 15:48:03 +0100 (Thu, 22 Mar 2007) New Revision: 20403 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20403&view=rev Modified: haiku/trunk/src/kits/interface/Menu.cpp Log: Update the window size when adding and removing items. This fix bug #683, but makes bug #582 look even more funny. Oh, well I hope I'll fix it one day. Modified: haiku/trunk/src/kits/interface/Menu.cpp =================================================================== --- haiku/trunk/src/kits/interface/Menu.cpp 2007-03-21 19:48:38 UTC (rev 20402) +++ haiku/trunk/src/kits/interface/Menu.cpp 2007-03-22 14:48:03 UTC (rev 20403) @@ -332,7 +332,7 @@ if (!fAttachAborted) { CacheFontInfo(); LayoutItems(0); - //UpdateWindowViewSize(); + UpdateWindowViewSize(false); } } @@ -365,6 +365,7 @@ if (LockLooper()) { if (!Window()->IsHidden()) { LayoutItems(index); + UpdateWindowViewSize(false); Invalidate(); } UnlockLooper(); @@ -483,7 +484,7 @@ if (locked && Window() != NULL && !Window()->IsHidden()) { // Make sure we update the layout if needed. LayoutItems(index); - //UpdateWindowViewSize(); + UpdateWindowViewSize(false); Invalidate(); } @@ -1202,7 +1203,7 @@ if (dynamic_cast(window) != NULL) MoveTo(1, 1); - UpdateWindowViewSize(); + UpdateWindowViewSize(true); window->Show(); if (selectFirstItem) @@ -1485,7 +1486,7 @@ if (invalidateLayout && locked && window != NULL) { LayoutItems(0); - //UpdateWindowViewSize(); + UpdateWindowViewSize(false); Invalidate(); } @@ -1655,6 +1656,7 @@ } +// Assumes the SuperMenu to be locked (due to calling ConvertToScreen()) BPoint BMenu::ScreenLocation() { @@ -2110,8 +2112,12 @@ if (window == NULL) return; + if (dynamic_cast(this) != NULL) + return; + bool scroll; - BRect frame = CalcFrame(ScreenLocation(), &scroll); + const BPoint screenLocation = upWind ? ScreenLocation() : window->Frame().LeftTop(); + BRect frame = CalcFrame(screenLocation, &scroll); ResizeTo(frame.Width(), frame.Height()); if (fItems.CountItems() > 0) { @@ -2139,7 +2145,8 @@ fFontHeight + fPad.top + fPad.bottom); } - window->MoveTo(frame.LeftTop()); + if (upWind) + window->MoveTo(frame.LeftTop()); } From axeld at mail.berlios.de Thu Mar 22 19:43:47 2007 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Thu, 22 Mar 2007 19:43:47 +0100 Subject: [Haiku-commits] r20404 - in haiku/trunk/src/add-ons/translators: . raw Message-ID: <200703221843.l2MIhlUU011721@sheep.berlios.de> Author: axeld Date: 2007-03-22 19:43:45 +0100 (Thu, 22 Mar 2007) New Revision: 20404 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20404&view=rev Added: haiku/trunk/src/add-ons/translators/raw/ haiku/trunk/src/add-ons/translators/raw/ConfigView.cpp haiku/trunk/src/add-ons/translators/raw/ConfigView.h haiku/trunk/src/add-ons/translators/raw/Jamfile haiku/trunk/src/add-ons/translators/raw/RAW.cpp haiku/trunk/src/add-ons/translators/raw/RAW.h haiku/trunk/src/add-ons/translators/raw/RAWTranslator.cpp haiku/trunk/src/add-ons/translators/raw/RAWTranslator.h haiku/trunk/src/add-ons/translators/raw/ReadHelper.h haiku/trunk/src/add-ons/translators/raw/TIFF.h haiku/trunk/src/add-ons/translators/raw/main.cpp Modified: haiku/trunk/src/add-ons/translators/Jamfile Log: * Initial and very basic version of a RAW image translator. * Based on Dave Coffin's fabuluous dcraw - it's basically the same thing in C++, but follows common sense programming rules a bit more :-). * Current version probably only supports PENTAX RAW format, though. * Still lots of places left to clean up. Modified: haiku/trunk/src/add-ons/translators/Jamfile =================================================================== --- haiku/trunk/src/add-ons/translators/Jamfile 2007-03-22 14:48:03 UTC (rev 20403) +++ haiku/trunk/src/add-ons/translators/Jamfile 2007-03-22 18:43:45 UTC (rev 20404) @@ -8,6 +8,7 @@ SubInclude HAIKU_TOP src add-ons translators libtiff ; SubInclude HAIKU_TOP src add-ons translators png ; SubInclude HAIKU_TOP src add-ons translators ppm ; +SubInclude HAIKU_TOP src add-ons translators raw ; SubInclude HAIKU_TOP src add-ons translators rtf ; SubInclude HAIKU_TOP src add-ons translators sgi ; SubInclude HAIKU_TOP src add-ons translators stxt ; Added: haiku/trunk/src/add-ons/translators/raw/ConfigView.cpp =================================================================== --- haiku/trunk/src/add-ons/translators/raw/ConfigView.cpp 2007-03-22 14:48:03 UTC (rev 20403) +++ haiku/trunk/src/add-ons/translators/raw/ConfigView.cpp 2007-03-22 18:43:45 UTC (rev 20404) @@ -0,0 +1,77 @@ +/* + * Copyright 2005-2007, Axel D?rfler, axeld at pinc-software.de. All rights reserved. + * Distributed under the terms of the MIT License. + */ + + +#include "ConfigView.h" +#include "RAWTranslator.h" + +#include +#include + +#include +#include + + +ConfigView::ConfigView(const BRect &frame, uint32 resize, uint32 flags) + : BView(frame, "RAWTranslator Settings", resize, flags) +{ + SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR)); + + font_height fontHeight; + be_bold_font->GetHeight(&fontHeight); + float height = fontHeight.descent + fontHeight.ascent + fontHeight.leading; + + BRect rect(10, 10, 200, 10 + height); + BStringView *stringView = new BStringView(rect, "title", "RAW Images"); + stringView->SetFont(be_bold_font); + stringView->ResizeToPreferred(); + AddChild(stringView); + + rect.OffsetBy(0, height + 10); + char version[256]; + sprintf(version, "Version %d.%d.%d, %s", + int(B_TRANSLATION_MAJOR_VERSION(RAW_TRANSLATOR_VERSION)), + int(B_TRANSLATION_MINOR_VERSION(RAW_TRANSLATOR_VERSION)), + int(B_TRANSLATION_REVISION_VERSION(RAW_TRANSLATOR_VERSION)), + __DATE__); + stringView = new BStringView(rect, "version", version); + stringView->ResizeToPreferred(); + AddChild(stringView); + + GetFontHeight(&fontHeight); + height = fontHeight.descent + fontHeight.ascent + fontHeight.leading; + + rect.OffsetBy(0, height + 5); + stringView = new BStringView(rect, "copyright", B_UTF8_COPYRIGHT "2007 Haiku Inc."); + stringView->ResizeToPreferred(); + AddChild(stringView); + + rect.OffsetBy(0, height + 20); + BCheckBox *checkBox = new BCheckBox(rect, "color", "Write 32 bit images on true color input", NULL); + checkBox->ResizeToPreferred(); + AddChild(checkBox); + + rect.OffsetBy(0, height + 10); + checkBox = new BCheckBox(rect, "size", "Enforce valid icon sizes", NULL); + checkBox->ResizeToPreferred(); + checkBox->SetValue(1); + AddChild(checkBox); + + rect.OffsetBy(0, height + 15); + stringView = new BStringView(rect, "valid1", "Valid icon sizes are 16, 32, or 48"); + stringView->ResizeToPreferred(); + AddChild(stringView); + + rect.OffsetBy(0, height + 5); + stringView = new BStringView(rect, "valid2", "pixel in either direction."); + stringView->ResizeToPreferred(); + AddChild(stringView); +} + + +ConfigView::~ConfigView() +{ +} + Added: haiku/trunk/src/add-ons/translators/raw/ConfigView.h =================================================================== --- haiku/trunk/src/add-ons/translators/raw/ConfigView.h 2007-03-22 14:48:03 UTC (rev 20403) +++ haiku/trunk/src/add-ons/translators/raw/ConfigView.h 2007-03-22 18:43:45 UTC (rev 20404) @@ -0,0 +1,19 @@ +/* + * Copyright 2004-2007, Axel D?rfler, axeld at pinc-software.de. All rights reserved. + * Distributed under the terms of the MIT License. + */ +#ifndef CONFIG_VIEW_H +#define CONFIG_VIEW_H + + +#include + + +class ConfigView : public BView { + public: + ConfigView(const BRect &frame, uint32 resize = B_FOLLOW_ALL, + uint32 flags = B_WILL_DRAW); + virtual ~ConfigView(); +}; + +#endif /* CONFIG_VIEW_H */ Added: haiku/trunk/src/add-ons/translators/raw/Jamfile =================================================================== --- haiku/trunk/src/add-ons/translators/raw/Jamfile 2007-03-22 14:48:03 UTC (rev 20403) +++ haiku/trunk/src/add-ons/translators/raw/Jamfile 2007-03-22 18:43:45 UTC (rev 20404) @@ -0,0 +1,26 @@ +SubDir HAIKU_TOP src add-ons translators raw ; + +SetSubDirSupportedPlatformsBeOSCompatible ; + +# Include code from shared translator directory +SEARCH_SOURCE += [ FDirName $(HAIKU_TOP) src add-ons translators shared ] ; + +Translator RAWTranslator : + # RawTranslator classes + main.cpp + RAWTranslator.cpp + ConfigView.cpp + RAW.cpp + + # shared classes + BaseTranslator.cpp + TranslatorSettings.cpp + TranslatorWindow.cpp + + : be translation +; + +Package haiku-translationkit-cvs : + RAWTranslator + : boot home config add-ons Translators + ; Added: haiku/trunk/src/add-ons/translators/raw/RAW.cpp =================================================================== --- haiku/trunk/src/add-ons/translators/raw/RAW.cpp 2007-03-22 14:48:03 UTC (rev 20403) +++ haiku/trunk/src/add-ons/translators/raw/RAW.cpp 2007-03-22 18:43:45 UTC (rev 20404) @@ -0,0 +1,2859 @@ +/* + * Copyright 2007, Axel D?rfler, axeld at pinc-software.de. All rights reserved. + * Distributed under the terms of the MIT License. + * + * Copyright 1997-2007, Dave Coffin, dcoffin a cybercom o net + * This code is based on Dave Coffin's dcraw 8.63 - it's basically the same + * thing in C++, but follows common sense programming rules a bit more :-) + * Except the Fovean functions, dcraw is public domain. + */ + + +#include "RAW.h" +#include "ReadHelper.h" + +#include +#include + +#include +#include +#include +#include + + +#define ABS(x) (((int)(x) ^ ((int)(x) >> 31)) - ((int)(x) >> 31)) +#define LIM(x,min,max) MAX(min,MIN(x,max)) +#define ULIM(x,y,z) ((y) < (z) ? LIM(x,y,z) : LIM(x,z,y)) +#define CLIP(x) LIM(x,0,65535) +#define SWAP(a,b) { a ^= b; a ^= (b ^= a); } + +#define FC(row,col) \ + (fFilters >> ((((row) << 1 & 14) + ((col) & 1)) << 1) & 3) + + +static const uint32 kImageBufferCount = 10; +static const uint32 kDecodeBufferCount = 2048; + +const double xyz_rgb[3][3] = { /* XYZ from RGB */ + { 0.412453, 0.357580, 0.180423 }, + { 0.212671, 0.715160, 0.072169 }, + { 0.019334, 0.119193, 0.950227 } }; +const float d65_white[3] = { 0.950456, 1, 1.088754 }; + +struct decode { + struct decode *branch[2]; + int32 leaf; +}; + +struct jhead { + int bits, high, wide, clrs, restart, vpred[4]; + struct decode *huff[4]; + uint16* row; +}; + +struct tiff_header { + uint16 order, magic; + int32 image_file_directory; + uint16 pad, ntag; + struct tiff_tag tag[15]; + int32 next_image_file_directory; + uint16 pad2, nexif; + struct tiff_tag exif[4]; + int16 bps[4]; + int32 rat[6]; + char make[64], model[64], soft[32], date[20]; +}; + + +template inline T +square(const T& value) +{ + return value * value; +} + + +// #pragma mark - + + +DCRaw::DCRaw(BPositionIO& stream) + : + fRead(stream), + fNumImages(0), + fRawIndex(-1), + fThumbIndex(-1), + fDNGVersion(0), + fThreshold(0), + fHalfSize(true), + fUseCameraWhiteBalance(true), + fUseAutoWhiteBalance(true), + fRawColor(true), + fUseGamma(true), + fBrightness(1.0f), + fOutputColor(1), + fHighlight(0), + fDocumentMode(0), + fOutputWidth(0), + fOutputHeight(0), + fInputWidth(0), + fInputHeight(0), + fTopMargin(0), + fLeftMargin(0), + fColors(3), + fOutputProfile(NULL), + fOutputBitsPerSample(8), + fDecodeLeaf(0), + fDecodeBitsZeroAfterMax(false), + fFilters(~0) +{ + fImages = new image_data_info[kImageBufferCount]; + fDecodeBuffer = new decode[kDecodeBufferCount]; + + cbrt = new float[0x10000]; + fHistogram = (int32 (*)[4])calloc(sizeof(int32) * 0x2000 * 4, 1); + + memset(fImages, 0, sizeof(image_data_info) * kImageBufferCount); + memset(&fMeta, 0, sizeof(image_meta_info)); + memset(fUserMultipliers, 0, sizeof(fUserMultipliers)); + memset(fWhite, 0, sizeof(fWhite)); + + fMeta.camera_multipliers[0] = -1; +} + + +DCRaw::~DCRaw() +{ + delete[] fImages; + delete[] fDecodeBuffer; + + delete[] cbrt; + free(fHistogram); +} + + +int32 +DCRaw::_AllocateImage() +{ + if (fNumImages + 1 == kImageBufferCount) + throw (status_t)B_ERROR; + + return fNumImages++; +} + + +image_data_info& +DCRaw::_Raw() +{ + if (fRawIndex < 0) + fRawIndex = _AllocateImage(); + if (fRawIndex < 0) + throw (status_t)B_ERROR; + + return fImages[fRawIndex]; +} + + +image_data_info& +DCRaw::_Thumb() +{ + if (fThumbIndex < 0) + fThumbIndex = _AllocateImage(); + if (fThumbIndex < 0) + throw (status_t)B_ERROR; + + return fImages[fThumbIndex]; +} + + +//! Make sure that the raw image always comes first +void +DCRaw::_CorrectIndex(uint32& index) const +{ + if (fRawIndex > 0) { + if (index == 0) + index = fRawIndex; + else if (index <= (uint32)fRawIndex) + index--; + } +} + + +inline uint16& +DCRaw::_Bayer(int32 column, int32 row) +{ + return fImageData[((row) >> fShrink) * fOutputWidth + + ((column) >> fShrink)][FC(row, column)]; +} + + +inline int32 +DCRaw::_FilterCoefficient(int32 x, int32 y) +{ + static const char filter[16][16] = { + { 2,1,1,3,2,3,2,0,3,2,3,0,1,2,1,0 }, + { 0,3,0,2,0,1,3,1,0,1,1,2,0,3,3,2 }, + { 2,3,3,2,3,1,1,3,3,1,2,1,2,0,0,3 }, + { 0,1,0,1,0,2,0,2,2,0,3,0,1,3,2,1 }, + { 3,1,1,2,0,1,0,2,1,3,1,3,0,1,3,0 }, + { 2,0,0,3,3,2,3,1,2,0,2,0,3,2,2,1 }, + { 2,3,3,1,2,1,2,1,2,1,1,2,3,0,0,1 }, + { 1,0,0,2,3,0,0,3,0,3,0,3,2,1,2,3 }, + { 2,3,3,1,1,2,1,0,3,2,3,0,2,3,1,3 }, + { 1,0,2,0,3,0,3,2,0,1,1,2,0,1,0,2 }, + { 0,1,1,3,3,2,2,1,1,3,3,0,2,1,3,2 }, + { 2,3,2,0,0,1,3,0,2,0,1,2,3,0,1,0 }, + { 1,3,1,2,3,2,3,2,0,2,0,1,1,0,3,0 }, + { 0,2,0,3,1,0,0,1,1,3,3,2,3,2,2,1 }, + { 2,1,3,2,3,1,2,1,0,3,0,2,0,2,0,2 }, + { 0,3,1,0,0,2,0,3,2,1,3,1,1,3,1,3 } + }; + + if (fFilters != 1) + return FC(y, x); + + return filter[(y + fTopMargin) & 15][(x + fLeftMargin) & 15]; +} + + +inline int32 +DCRaw::_FlipIndex(uint32 row, uint32 col, uint32 flip) +{ + if (flip & 4) + SWAP(row, col); + if (flip & 2) + row = fOutputHeight - 1 - row; + if (flip & 1) + col = fOutputWidth - 1 - col; + + return row * fOutputWidth + col; +} + + +void +DCRaw::_ParseThumbTag(off_t baseOffset, uint32 offsetTag, uint32 lengthTag) +{ + uint16 entries; + fRead(entries); + + while (entries--) { + off_t nextOffset; + tiff_tag tag; + _ParseTIFFTag(baseOffset, tag, nextOffset); + + if (tag.tag == offsetTag) + _Thumb().data_offset = fRead.Next(); + if (tag.tag == lengthTag) + _Thumb().bytes = fRead.Next(); + + fRead.Seek(nextOffset, SEEK_SET); + } +} + + +void +DCRaw::_ParseManufacturerTag(off_t baseOffset) +{ + static const uchar xlat[2][256] = { + { + 0xc1,0xbf,0x6d,0x0d,0x59,0xc5,0x13,0x9d,0x83,0x61,0x6b,0x4f,0xc7,0x7f,0x3d,0x3d, + 0x53,0x59,0xe3,0xc7,0xe9,0x2f,0x95,0xa7,0x95,0x1f,0xdf,0x7f,0x2b,0x29,0xc7,0x0d, + 0xdf,0x07,0xef,0x71,0x89,0x3d,0x13,0x3d,0x3b,0x13,0xfb,0x0d,0x89,0xc1,0x65,0x1f, + 0xb3,0x0d,0x6b,0x29,0xe3,0xfb,0xef,0xa3,0x6b,0x47,0x7f,0x95,0x35,0xa7,0x47,0x4f, + 0xc7,0xf1,0x59,0x95,0x35,0x11,0x29,0x61,0xf1,0x3d,0xb3,0x2b,0x0d,0x43,0x89,0xc1, + 0x9d,0x9d,0x89,0x65,0xf1,0xe9,0xdf,0xbf,0x3d,0x7f,0x53,0x97,0xe5,0xe9,0x95,0x17, + 0x1d,0x3d,0x8b,0xfb,0xc7,0xe3,0x67,0xa7,0x07,0xf1,0x71,0xa7,0x53,0xb5,0x29,0x89, + 0xe5,0x2b,0xa7,0x17,0x29,0xe9,0x4f,0xc5,0x65,0x6d,0x6b,0xef,0x0d,0x89,0x49,0x2f, + 0xb3,0x43,0x53,0x65,0x1d,0x49,0xa3,0x13,0x89,0x59,0xef,0x6b,0xef,0x65,0x1d,0x0b, + 0x59,0x13,0xe3,0x4f,0x9d,0xb3,0x29,0x43,0x2b,0x07,0x1d,0x95,0x59,0x59,0x47,0xfb, + 0xe5,0xe9,0x61,0x47,0x2f,0x35,0x7f,0x17,0x7f,0xef,0x7f,0x95,0x95,0x71,0xd3,0xa3, + 0x0b,0x71,0xa3,0xad,0x0b,0x3b,0xb5,0xfb,0xa3,0xbf,0x4f,0x83,0x1d,0xad,0xe9,0x2f, + 0x71,0x65,0xa3,0xe5,0x07,0x35,0x3d,0x0d,0xb5,0xe9,0xe5,0x47,0x3b,0x9d,0xef,0x35, + 0xa3,0xbf,0xb3,0xdf,0x53,0xd3,0x97,0x53,0x49,0x71,0x07,0x35,0x61,0x71,0x2f,0x43, + 0x2f,0x11,0xdf,0x17,0x97,0xfb,0x95,0x3b,0x7f,0x6b,0xd3,0x25,0xbf,0xad,0xc7,0xc5, + 0xc5,0xb5,0x8b,0xef,0x2f,0xd3,0x07,0x6b,0x25,0x49,0x95,0x25,0x49,0x6d,0x71,0xc7 + }, + { + 0xa7,0xbc,0xc9,0xad,0x91,0xdf,0x85,0xe5,0xd4,0x78,0xd5,0x17,0x46,0x7c,0x29,0x4c, + 0x4d,0x03,0xe9,0x25,0x68,0x11,0x86,0xb3,0xbd,0xf7,0x6f,0x61,0x22,0xa2,0x26,0x34, + 0x2a,0xbe,0x1e,0x46,0x14,0x68,0x9d,0x44,0x18,0xc2,0x40,0xf4,0x7e,0x5f,0x1b,0xad, + 0x0b,0x94,0xb6,0x67,0xb4,0x0b,0xe1,0xea,0x95,0x9c,0x66,0xdc,0xe7,0x5d,0x6c,0x05, + 0xda,0xd5,0xdf,0x7a,0xef,0xf6,0xdb,0x1f,0x82,0x4c,0xc0,0x68,0x47,0xa1,0xbd,0xee, + 0x39,0x50,0x56,0x4a,0xdd,0xdf,0xa5,0xf8,0xc6,0xda,0xca,0x90,0xca,0x01,0x42,0x9d, + 0x8b,0x0c,0x73,0x43,0x75,0x05,0x94,0xde,0x24,0xb3,0x80,0x34,0xe5,0x2c,0xdc,0x9b, + 0x3f,0xca,0x33,0x45,0xd0,0xdb,0x5f,0xf5,0x52,0xc3,0x21,0xda,0xe2,0x22,0x72,0x6b, + 0x3e,0xd0,0x5b,0xa8,0x87,0x8c,0x06,0x5d,0x0f,0xdd,0x09,0x19,0x93,0xd0,0xb9,0xfc, + 0x8b,0x0f,0x84,0x60,0x33,0x1c,0x9b,0x45,0xf1,0xf0,0xa3,0x94,0x3a,0x12,0x77,0x33, + 0x4d,0x44,0x78,0x28,0x3c,0x9e,0xfd,0x65,0x57,0x16,0x94,0x6b,0xfb,0x59,0xd0,0xc8, + 0x22,0x36,0xdb,0xd2,0x63,0x98,0x43,0xa1,0x04,0x87,0x86,0xf7,0xa6,0x26,0xbb,0xd6, + 0x59,0x4d,0xbf,0x6a,0x2e,0xaa,0x2b,0xef,0xe6,0x78,0xb6,0x4e,0xe0,0x2f,0xdc,0x7c, + 0xbe,0x57,0x19,0x32,0x7e,0x2a,0xd0,0xb8,0xba,0x29,0x00,0x3c,0x52,0x7d,0xa8,0x49, + 0x3b,0x2d,0xeb,0x25,0x49,0xfa,0xa3,0xaa,0x39,0xa7,0xc5,0xa7,0x50,0x11,0x36,0xfb, + 0xc6,0x67,0x4a,0xf5,0xa5,0x12,0x65,0x7e,0xb0,0xdf,0xaf,0x4e,0xb3,0x61,0x7f,0x2f + } + }; + + uint32 ver97 = 0, serial = 0; + uchar buf97[324], ci, cj, ck; + bool originalSwap = fRead.IsSwapping(); + image_data_info& image = fImages[fNumImages]; + + // The MakerNote might have its own TIFF header (possibly with + // its own byte-order!), or it might just be a table. + + char type[10]; + fRead(type, sizeof(type)); + + if (!strncmp(type, "KDK", 3) + || !strncmp(type, "VER", 3) + || !strncmp(type, "IIII", 4) + || !strncmp(type, "MMMM", 4)) { + // these aren't TIFF tables + return; + } + if (!strncmp(type, "KC", 2) // Konica KD-400Z, KD-510Z + || !strncmp(type, "MLY", 3)) { // Minolta DiMAGE G series + fRead.SetSwap(B_HOST_IS_LENDIAN != 0); + // this chunk is always in big endian + + uint32 whiteBalance[4] = {0, 0, 0, 0}; + + off_t offset; + while ((offset = fRead.Position()) < image.data_offset && offset < 16384) { + whiteBalance[0] = whiteBalance[2]; + whiteBalance[2] = whiteBalance[1]; + whiteBalance[1] = whiteBalance[3]; + + whiteBalance[3] = fRead.Next(); + if (whiteBalance[1] == 256 && whiteBalance[3] == 256 + && whiteBalance[0] > 256 && whiteBalance[0] < 640 + && whiteBalance[2] > 256 && whiteBalance[2] < 640) { + for (uint32 i = 0; i < 4; i++) { + fMeta.camera_multipliers[i] = whiteBalance[i]; + } + } + } + goto quit; + } + if (!strcmp(type, "Nikon")) { + baseOffset = fRead.Position(); + + uint16 endian; + fRead(endian); + +#if B_HOST_IS_LENDIAN + fRead.SetSwap(endian == 'MM'); +#else + fRead.SetSwap(endian == 'II'); +#endif + + if (fRead.Next() != 42) + goto quit; + + uint32 offset = fRead.Next(); + fRead.Seek(offset - 8, SEEK_CUR); + } else if (!strncmp(type, "FUJIFILM", 8) + || !strncmp(type, "SONY", 4) + || !strcmp(type, "Panasonic")) { + fRead.SetSwap(B_HOST_IS_BENDIAN != 0); + // this chunk is always in little endian + fRead.Seek(2, SEEK_CUR); + } else if (!strcmp(type, "OLYMP") + || !strcmp(type, "LEICA") + || !strcmp(type, "Ricoh") + || !strcmp(type, "EPSON")) + fRead.Seek(-2, SEEK_CUR); + else if (!strcmp(type, "AOC") || !strcmp(type, "QVC")) + fRead.Seek(-4, SEEK_CUR); + else + fRead.Seek(-10, SEEK_CUR); + + uint16 entries; + fRead(entries); + if (entries > 1000) + return; + + while (entries--) { + off_t nextOffset; + tiff_tag tag; + _ParseTIFFTag(baseOffset, tag, nextOffset); + //printf("got manufacturer tag %u (type %u, length %lu)\n", tag.tag, tag.type, tag.length); + + if (strstr(fMeta.manufacturer, "PENTAX")) { + if (tag.tag == 0x1b) + tag.tag = 0x1018; + if (tag.tag == 0x1c) + tag.tag = 0x1017; + } else if (tag.tag == 2 && strstr(fMeta.manufacturer, "NIKON")) { + fRead.Next(); + // ignored + fMeta.iso_speed = fRead.Next(); + } + + if (tag.tag == 4 && tag.length == 27) { + fRead.Next(); + // ignored + fMeta.iso_speed = 50 * pow(2, fRead.Next() / 32.0 - 4); + fRead.Next(); + // ignored + fMeta.aperture = pow(2, fRead.Next() / 64.0); + fMeta.shutter = pow(2, fRead.Next() / -32.0); + } + if (tag.tag == 8 && tag.type == 4) + fMeta.shot_order = fRead.Next(); + if (tag.tag == 0xc && tag.length == 4) { + fMeta.camera_multipliers[0] = fRead.NextDouble(TIFF_FRACTION_TYPE); + fMeta.camera_multipliers[2] = fRead.NextDouble(TIFF_FRACTION_TYPE); + } + if (tag.tag == 0x10 && tag.type == 4) + fUniqueID = fRead.Next(); + if (tag.tag == 0x11) { + if (_ParseTIFFImageFileDirectory(baseOffset, fRead.Next()) == B_OK) + fNumImages++; + } + if (tag.tag == 0x14 && tag.length == 2560 && tag.type == 7) { + fRead.Seek(1248, SEEK_CUR); + goto get2_256; + } + if (tag.tag == 0x1d) { + int c; + while ((c = fRead.Next()) && c != EOF) { + serial = serial * 10 + (isdigit(c) ? c - '0' : c % 10); + } + } + if (tag.tag == 0x81 && tag.type == 4) { + _Raw().data_offset = fRead.Next(); + fRead.Seek(_Raw().data_offset + 41, SEEK_SET); + _Raw().height = fRead.Next() * 2; + _Raw().width = fRead.Next(); + fFilters = 0x61616161; + } + if ((tag.tag == 0x81 && tag.type == 7) + || (tag.tag == 0x100 && tag.type == 7) + || (tag.tag == 0x280 && tag.type == 1)) { + _Thumb().data_offset = fRead.Position(); + _Thumb().bytes = tag.length; + } + if (tag.tag == 0x88 && tag.type == 4 && (_Thumb().data_offset = fRead.Next())) { + _Thumb().data_offset += baseOffset; + } + if (tag.tag == 0x89 && tag.type == 4) + _Thumb().bytes = fRead.Next(); + if (tag.tag == 0x8c) + fCurveOffset = fRead.Position() + 2112; + if (tag.tag == 0x96) + fCurveOffset = fRead.Position() + 2; + if (tag.tag == 0x97) { + for (uint32 i = 0; i < 4; i++) { + ver97 = (ver97 << 4) + fRead.Next() - '0'; + } + switch (ver97) { + case 0x100: + fRead.Seek(68, SEEK_CUR); + for (uint32 i = 0; i < 4; i++) { + fMeta.camera_multipliers[(i >> 1) | ((i & 1) << 1)] + = fRead.Next(); + } + break; + case 0x102: + fRead.Seek(6, SEEK_CUR); + goto get2_rggb; + case 0x103: + fRead.Seek(16, SEEK_CUR); + for (uint32 i = 0; i < 4; i++) { + fMeta.camera_multipliers[i] = fRead.Next(); + } + break; + } + if (ver97 >> 8 == 2) { + if (ver97 != 0x205) + fRead.Seek(280, SEEK_CUR); + fRead(buf97, sizeof(buf97)); + } + } + if (tag.tag == 0xa7 && ver97 >> 8 == 2) { + ci = xlat[0][serial & 0xff]; + cj = xlat[1][fRead.Next() ^ fRead.Next() + ^ fRead.Next() ^ fRead.Next()]; + ck = 0x60; + for (uint32 i = 0; i < 324; i++) { + buf97[i] ^= (cj += ci * ck++); + } + for (uint32 i = 0; i < 4; i++) { + uint16* data = (uint16*)(buf97 + (ver97 == 0x205 ? 14 : 6) + i*2); + + if (fRead.IsSwapping()) { + fMeta.camera_multipliers[i ^ (i >> 1)] = __swap_int16(*data); + } else { + fMeta.camera_multipliers[i ^ (i >> 1)] = *data; + } + } + } + if (tag.tag == 0x200 && tag.length == 4) { + fMeta.black = (fRead.Next() + fRead.Next() + + fRead.Next() + fRead.Next()) / 4; + } + if (tag.tag == 0x201 && tag.length == 4) + goto get2_rggb; + if (tag.tag == 0x401 && tag.length == 4) { + fMeta.black = (fRead.Next() + fRead.Next() + + fRead.Next() + fRead.Next()) / 4; + } + if (tag.tag == 0xe01) { + // Nikon Capture Note + bool previousSwap = fRead.IsSwapping(); + fRead.SetSwap(B_HOST_IS_BENDIAN != 0); + // this chunk is always in little endian + + off_t offset = 22; + fRead.Seek(offset, SEEK_CUR); + + int32 i = 0; + + for (; offset + 22 < tag.length; offset += 22 + i) { + tag.tag = fRead.Next(); + fRead.Seek(14, SEEK_CUR); + i = fRead.Next() - 4; + if (tag.tag == 0x76a43207) + fMeta.flip = fRead.Next(); + else + fRead.Seek(i, SEEK_CUR); + } + + fRead.SetSwap(previousSwap); + } + if (tag.tag == 0xe80 && tag.length == 256 && tag.type == 7) { + fRead.Seek(48, SEEK_CUR); + fMeta.camera_multipliers[0] = fRead.Next() * 508 * 1.078 / 0x10000; + fMeta.camera_multipliers[2] = fRead.Next() * 382 * 1.173 / 0x10000; + } + if (tag.tag == 0xf00 && tag.type == 7) { + if (tag.length == 614) + fRead.Seek(176, SEEK_CUR); + else if (tag.length == 734 || tag.length == 1502) + fRead.Seek(148, SEEK_CUR); + else + goto next; + goto get2_256; + } + if (tag.tag == 0x1011 && tag.length == 9 && fUseCameraWhiteBalance) { + for (uint32 i = 0; i < 3; i++) { + for (uint32 j = 0; j < 3; j++) { + fMeta.rgb_camera[i][j] = fRead.Next() / 256.0; + } + } + fRawColor = fMeta.rgb_camera[0][0] < 1; + } + if (tag.tag == 0x1012 && tag.length == 4) { + fMeta.black = 0; + for (uint32 i = 0; i < 4; i++) { + fMeta.black += fRead.Next() << 2; + } + } + if (tag.tag == 0x1017) + fMeta.camera_multipliers[0] = fRead.Next() / 256.0; + if (tag.tag == 0x1018) + fMeta.camera_multipliers[2] = fRead.Next() / 256.0; + + if (tag.tag == 0x2011 && tag.length == 2) { +get2_256: + bool previousSwap = fRead.IsSwapping(); + fRead.SetSwap(B_HOST_IS_LENDIAN != 0); + // this chunk is always in big endian + + fMeta.camera_multipliers[0] = fRead.Next() / 256.0; + fMeta.camera_multipliers[2] = fRead.Next() / 256.0; + + fRead.SetSwap(previousSwap); + } + + if (tag.tag == 0x2020) + _ParseThumbTag(baseOffset, 257, 258); + if (tag.tag == 0xb028) { + fRead.Seek(fRead.Next(), SEEK_SET); + _ParseThumbTag(baseOffset, 136, 137); + } + + if (tag.tag == 0x4001) { + { + off_t offset = tag.length == 582 ? 50 : tag.length == 653 ? 68 : 126; + fRead.Seek(offset, SEEK_CUR); + } +get2_rggb: + for (uint32 i = 0; i < 4; i++) { + fMeta.camera_multipliers[i ^ (i >> 1)] = fRead.Next(); + } + } + +next: + fRead.Seek(nextOffset, SEEK_SET); + } + +quit: + fRead.SetSwap(originalSwap); +} + + +void +DCRaw::_ParseEXIF(off_t baseOffset) +{ + bool kodak = !strncmp(fMeta.manufacturer, "EASTMAN", 7); + + uint16 entries; + fRead(entries); + + while (entries--) { + off_t nextOffset; + tiff_tag tag; + _ParseTIFFTag(baseOffset, tag, nextOffset); +//printf("got EXIF tag %u (type %u, length %lu)\n", tag.tag, tag.type, tag.length); + + switch (tag.tag) { + case 33434: + fMeta.shutter = fRead.NextDouble(TIFF_FRACTION_TYPE); + break; + case 33437: + fMeta.aperture = fRead.NextDouble(TIFF_FRACTION_TYPE); + break; + case 34855: + fMeta.iso_speed = fRead.Next(); + break; + case 36867: + case 36868: + fMeta.timestamp = _ParseTIFFTimestamp(false); + break; + case 37377: + { + double expo; + if ((expo = -fRead.NextDouble(TIFF_FRACTION_TYPE)) < 128) + fMeta.shutter = pow(2, expo); + break; + } + case 37378: + fMeta.aperture = pow(2, fRead.NextDouble(TIFF_FRACTION_TYPE) / 2); + break; + case 37386: + fMeta.focal_length = fRead.NextDouble(TIFF_FRACTION_TYPE); + break; + case 37500: + _ParseManufacturerTag(baseOffset); + break; + case 40962: + if (kodak) + _Raw().width = fRead.Next(); + break; + case 40963: + if (kodak) + _Raw().height = fRead.Next(); + break; + case 41730: + if (fRead.Next() == 0x20002) { + fEXIFFilters = 0; + for (uint32 c = 0; c < 8; c += 2) { + fEXIFFilters |= fRead.Next() * 0x01010101 << c; + } + } + break; + } + + fRead.Seek(nextOffset, SEEK_SET); + } +} + + +// #pragma mark - Image Conversion + + +void +DCRaw::_ScaleColors() +{ + int dblack, c, val, sum[8]; + uint32 row, col, x, y; + double dsum[8], dmin, dmax; + float scale_mul[4]; + + if (fUseCameraWhiteBalance && fMeta.camera_multipliers[0] != -1) { + memset(sum, 0, sizeof(sum)); + for (row = 0; row < 8; row++) { + for (col = 0; col < 8; col++) { + c = FC(row, col); + if ((val = fWhite[row][col] - fMeta.black) > 0) + sum[c] += val; + sum[c + 4]++; + } + } + + if (sum[0] && sum[1] && sum[2] && sum[3]) { + for (int c = 0; c < 4; c++) { + fMeta.pre_multipliers[c] = (float)sum[c+4] / sum[c]; + } + } else if (fMeta.camera_multipliers[0] && fMeta.camera_multipliers[2]) { + memcpy(fMeta.pre_multipliers, fMeta.camera_multipliers, + sizeof(fMeta.pre_multipliers)); + } else + fprintf(stderr, "Cannot use camera white balance.\n"); + } else if (fUseAutoWhiteBalance) { + memset(dsum, 0, sizeof(dsum)); + for (row = 0; row < fOutputHeight - 7; row += 8) { + for (col = 0; col < fOutputWidth - 7; col += 8) { + memset(sum, 0, sizeof(sum)); + for (y = row; y < row + 8; y++) { + for (x = col; x < col + 8; x++) { + for (int c = 0; c < 4; c++) { + val = fImageData[y * fOutputWidth + x][c]; + if (!val) + continue; + if (val > fMeta.maximum - 25) + goto skip_block; + val -= fMeta.black; + if (val < 0) + val = 0; + sum[c] += val; + sum[c+4]++; + } + } + } + + for (c=0; c < 8; c++) { + dsum[c] += sum[c]; + } + + skip_block: + continue; + } + } + for (int c = 0; c < 4; c++) { + if (dsum[c]) + fMeta.pre_multipliers[c] = dsum[c + 4] / dsum[c]; + } + } + + + if (fUserMultipliers[0]) + memcpy(fMeta.pre_multipliers, fUserMultipliers, sizeof(fMeta.pre_multipliers)); + if (fMeta.pre_multipliers[3] == 0) + fMeta.pre_multipliers[3] = fColors < 4 ? fMeta.pre_multipliers[1] : 1; + + dblack = fMeta.black; + if (fThreshold) + _WaveletDenoise(); + + fMeta.maximum -= fMeta.black; + for (dmin = DBL_MAX, dmax = c = 0; c < 4; c++) { + if (dmin > fMeta.pre_multipliers[c]) + dmin = fMeta.pre_multipliers[c]; + if (dmax < fMeta.pre_multipliers[c]) + dmax = fMeta.pre_multipliers[c]; + } + + if (!fHighlight) + dmax = dmin; + + for (int c = 0; c < 4; c++) { + scale_mul[c] = (fMeta.pre_multipliers[c] /= dmax) * 65535.0 / fMeta.maximum; + } + +#if 1 + if (1/*verbose*/) { + fprintf(stderr, "Scaling with black %d, multipliers", dblack); + for (int c = 0; c < 4; c++) { + fprintf(stderr, " %f", fMeta.pre_multipliers[c]); + } + fputc('\n', stderr); + } +#endif + + for (row = 0; row < fOutputHeight; row++) { + for (col = 0; col < fOutputWidth; col++) { + for (int c = 0; c < 4; c++) { + val = fImageData[row * fOutputWidth + col][c]; + if (!val) + continue; + val -= fMeta.black; + val = int(val * scale_mul[c]); + fImageData[row * fOutputWidth + col][c] = CLIP(val); + } + } + } +} + + +void +DCRaw::_WaveletDenoise() +{ +} + + +void +DCRaw::_PreInterpolate() +{ + uint32 row, col; + + if (fShrink) { + if (fHalfSize) { + fInputHeight = fOutputHeight; + fInputWidth = fOutputWidth; + fFilters = 0; + } else { + uint16 (*data)[4] = (uint16 (*)[4])calloc(fInputHeight + * fInputWidth, sizeof(*data)); + if (data == NULL) + throw (status_t)B_NO_MEMORY; + + for (row = 0; row < fInputHeight; row++) { + for (col = 0; col < fInputWidth; col++) { + data[row * fInputWidth + col][FC(row, col)] = _Bayer(col, row); + } + } + + free(fImageData); + fImageData = data; + fShrink = 0; + } + } + + if (fFilters && fColors == 3) { +// if ((mix_green = four_color_rgb)) +// fColors++; +// else + { + for (row = FC(1,0) >> 1; row < fInputHeight; row += 2) { + for (col = FC(row, 1) & 1; col < fInputWidth; col += 2) { + fImageData[row * fInputWidth + col][1] + = fImageData[row * fInputWidth + col][3]; + } + } + fFilters &= ~((fFilters & 0x55555555) << 1); + } + } +} + + +void +DCRaw::_CameraToCIELab(ushort cam[4], float lab[3]) +{ + if (cam == NULL) { + for (uint32 i = 0; i < 0x10000; i++) { + float r = i / 65535.0; + cbrt[i] = r > 0.008856 ? pow(r, 1 / 3.0) : 7.787 * r + 16 / 116.0; + } + for (uint32 i = 0; i < 3; i++) { + for (uint32 j = 0; j < fColors; j++) { + xyz_cam[i][j] = 0; + for (uint32 k = 0; k < 3; k++) { + xyz_cam[i][j] += xyz_rgb[i][k] * fMeta.rgb_camera[k][j] / d65_white[i]; [... truncated: 2855 lines follow ...] From bonefish at mail.berlios.de Fri Mar 23 01:04:00 2007 From: bonefish at mail.berlios.de (bonefish at BerliOS) Date: Fri, 23 Mar 2007 01:04:00 +0100 Subject: [Haiku-commits] r20405 - in haiku/trunk/headers/private: kernel/util userlandfs/shared Message-ID: <200703230004.l2N040tu021128@sheep.berlios.de> Author: bonefish Date: 2007-03-23 01:03:59 +0100 (Fri, 23 Mar 2007) New Revision: 20405 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20405&view=rev Modified: haiku/trunk/headers/private/kernel/util/AutoLock.h haiku/trunk/headers/private/userlandfs/shared/AutoLocker.h Log: Added the last useful features I dare imagine: A Lock() method and the possibility to initialize the AutoLocker without locking the object even if it is unlocked yet. Especially in loops Lock()/Unlock() come handy when an otherwise constantly hold lock needs to be unlocked for a short time. I suppose we should move the kernel utils AutoLocker implementation to headers/private/shared, and drop the less powerful ObjectLocker. Modified: haiku/trunk/headers/private/kernel/util/AutoLock.h =================================================================== --- haiku/trunk/headers/private/kernel/util/AutoLock.h 2007-03-22 18:43:45 UTC (rev 20404) +++ haiku/trunk/headers/private/kernel/util/AutoLock.h 2007-03-23 00:03:59 UTC (rev 20405) @@ -69,49 +69,64 @@ { } - inline AutoLocker(Lockable *lockable, bool alreadyLocked = false) + inline AutoLocker(Lockable *lockable, bool alreadyLocked = false, + bool lockIfNotLocked = true) : fLockable(lockable), fLocked(fLockable && alreadyLocked) { - if (!fLocked) - _Lock(); + if (!alreadyLocked && lockIfNotLocked) + Lock(); } - inline AutoLocker(Lockable &lockable, bool alreadyLocked = false) + inline AutoLocker(Lockable &lockable, bool alreadyLocked = false, + bool lockIfNotLocked = true) : fLockable(&lockable), fLocked(fLockable && alreadyLocked) { - if (!fLocked) - _Lock(); + if (!alreadyLocked && lockIfNotLocked) + Lock(); } inline ~AutoLocker() { - _Unlock(); + Unlock(); } - inline void SetTo(Lockable *lockable, bool alreadyLocked) + inline void SetTo(Lockable *lockable, bool alreadyLocked, + bool lockIfNotLocked = true) { - _Unlock(); + Unlock(); fLockable = lockable; fLocked = alreadyLocked; - if (!fLocked) - _Lock(); + if (!alreadyLocked && lockIfNotLocked) + Lock(); } - inline void SetTo(Lockable &lockable, bool alreadyLocked) + inline void SetTo(Lockable &lockable, bool alreadyLocked, + bool lockIfNotLocked = true) { - SetTo(&lockable, alreadyLocked); + SetTo(&lockable, alreadyLocked, lockIfNotLocked); } inline void Unset() { - _Unlock(); + Unlock(); + Detach(); } + inline bool Lock() + { + if (fLockable && !fLocked) + fLocked = fLocking.Lock(fLockable); + return fLocked; + } + inline void Unlock() { - _Unlock(); + if (fLockable && fLocked) { + fLocking.Unlock(fLockable); + fLocked = false; + } } inline void Detach() @@ -137,21 +152,6 @@ inline operator bool() const { return fLocked; } private: - inline void _Lock() - { - if (fLockable) - fLocked = fLocking.Lock(fLockable); - } - - inline void _Unlock() - { - if (fLockable && fLocked) { - fLocking.Unlock(fLockable); - fLocked = false; - } - } - -private: Lockable *fLockable; bool fLocked; Locking fLocking; Modified: haiku/trunk/headers/private/userlandfs/shared/AutoLocker.h =================================================================== --- haiku/trunk/headers/private/userlandfs/shared/AutoLocker.h 2007-03-22 18:43:45 UTC (rev 20404) +++ haiku/trunk/headers/private/userlandfs/shared/AutoLocker.h 2007-03-23 00:03:59 UTC (rev 20405) @@ -77,27 +77,35 @@ } }; -// AutoLocker + template > class AutoLocker { private: typedef AutoLocker ThisClass; public: - inline AutoLocker(Lockable *lockable, bool alreadyLocked = false) + inline AutoLocker() + : fLockable(NULL), + fLocked(false) + { + } + + inline AutoLocker(Lockable *lockable, bool alreadyLocked = false, + bool lockIfNotLocked = true) : fLockable(lockable), fLocked(fLockable && alreadyLocked) { - if (!fLocked) - _Lock(); + if (!alreadyLocked && lockIfNotLocked) + Lock(); } - inline AutoLocker(Lockable &lockable, bool alreadyLocked = false) + inline AutoLocker(Lockable &lockable, bool alreadyLocked = false, + bool lockIfNotLocked = true) : fLockable(&lockable), fLocked(fLockable && alreadyLocked) { - if (!fLocked) - _Lock(); + if (!alreadyLocked && lockIfNotLocked) + Lock(); } inline ~AutoLocker() @@ -105,25 +113,49 @@ Unlock(); } - inline void SetTo(Lockable *lockable, bool alreadyLocked) + inline void SetTo(Lockable *lockable, bool alreadyLocked, + bool lockIfNotLocked = true) { Unlock(); fLockable = lockable; fLocked = alreadyLocked; - if (!fLocked) - _Lock(); + if (!alreadyLocked && lockIfNotLocked) + Lock(); } - inline void SetTo(Lockable &lockable, bool alreadyLocked) + inline void SetTo(Lockable &lockable, bool alreadyLocked, + bool lockIfNotLocked = true) { - SetTo(&lockable, alreadyLocked); + SetTo(&lockable, alreadyLocked, lockIfNotLocked); } inline void Unset() { Unlock(); + Detach(); } + inline bool Lock() + { + if (fLockable && !fLocked) + fLocked = fLocking.Lock(fLockable); + return fLocked; + } + + inline void Unlock() + { + if (fLockable && fLocked) { + fLocking.Unlock(fLockable); + fLocked = false; + } + } + + inline void Detach() + { + fLockable = NULL; + fLocked = false; + } + inline AutoLocker &operator=(Lockable *lockable) { SetTo(lockable); @@ -138,24 +170,9 @@ inline bool IsLocked() const { return fLocked; } - inline void Unlock() - { - if (fLockable && fLocked) { - fLocking.Unlock(fLockable); - fLocked = false; - } - } - inline operator bool() const { return fLocked; } private: - inline void _Lock() - { - if (fLockable) - fLocked = fLocking.Lock(fLockable); - } - -private: Lockable *fLockable; bool fLocked; Locking fLocking; From bonefish at mail.berlios.de Fri Mar 23 01:09:57 2007 From: bonefish at mail.berlios.de (bonefish at BerliOS) Date: Fri, 23 Mar 2007 01:09:57 +0100 Subject: [Haiku-commits] r20406 - haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server Message-ID: <200703230009.l2N09vMt029060@sheep.berlios.de> Author: bonefish Date: 2007-03-23 01:09:55 +0100 (Fri, 23 Mar 2007) New Revision: 20406 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20406&view=rev Added: haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/haiku_file_cache.cpp Modified: haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/HaikuKernelVolume.cpp haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/HaikuKernelVolume.h haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/Jamfile haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/UserlandFSServer.cpp haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/haiku_fs_cache.h haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/haiku_kernel_emu.cpp Log: Added a Haiku file cache implementation to the UserlandFSServer. Basically reused the kernel implementation, but needed to hack it quite a bit and also add an emulation of the required VM interface. Completely untested yet. Modified: haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/HaikuKernelVolume.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/HaikuKernelVolume.cpp 2007-03-23 00:03:59 UTC (rev 20405) +++ haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/HaikuKernelVolume.cpp 2007-03-23 00:09:55 UTC (rev 20406) @@ -9,6 +9,7 @@ #include "Debug.h" #include "kernel_emu.h" +#include "haiku_fs_cache.h" // constructor @@ -35,8 +36,22 @@ { if (!fFSModule->mount) return B_BAD_VALUE; - return fFSModule->mount(GetID(), device, flags, parameters, &fVolumeCookie, - rootID); + + // make the volume know to the file cache emulation + status_t error + = UserlandFS::HaikuKernelEmu::file_cache_register_volume(this); + if (error != B_OK) + return error; + + // mount + error = fFSModule->mount(GetID(), device, flags, parameters, + &fVolumeCookie, rootID); + if (error != B_OK) { + UserlandFS::HaikuKernelEmu::file_cache_unregister_volume(this); + return error; + } + + return B_OK; } // Unmount @@ -45,7 +60,14 @@ { if (!fFSModule->unmount) return B_BAD_VALUE; - return fFSModule->unmount(fVolumeCookie); + + // unmount + status_t error = fFSModule->unmount(fVolumeCookie); + + // unregister with the file cache emulation + UserlandFS::HaikuKernelEmu::file_cache_unregister_volume(this); + + return error; } // Sync @@ -76,6 +98,21 @@ } +// #pragma mark - file cache + + +// GetFileMap +status_t +HaikuKernelVolume::GetFileMap(fs_vnode node, off_t offset, size_t size, + struct file_io_vec* vecs, size_t* count) +{ + if (!fFSModule->get_file_map) + return B_BAD_VALUE; + return fFSModule->get_file_map(fVolumeCookie, node, offset, size, vecs, + count); +} + + // #pragma mark - vnodes Modified: haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/HaikuKernelVolume.h =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/HaikuKernelVolume.h 2007-03-23 00:03:59 UTC (rev 20405) +++ haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/HaikuKernelVolume.h 2007-03-23 00:09:55 UTC (rev 20406) @@ -25,6 +25,11 @@ virtual status_t WriteFSInfo(const struct fs_info* info, uint32 mask); + // file cache + virtual status_t GetFileMap(fs_vnode node, off_t offset, + size_t size, struct file_io_vec* vecs, + size_t* count); + // vnodes virtual status_t Lookup(fs_vnode dir, const char* entryName, vnode_id* vnid, int* type); Modified: haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/Jamfile =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/Jamfile 2007-03-23 00:03:59 UTC (rev 20405) +++ haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/Jamfile 2007-03-23 00:09:55 UTC (rev 20406) @@ -41,6 +41,7 @@ DispatcherFileSystem.cpp FileSystem.cpp haiku_block_cache.cpp + haiku_file_cache.cpp haiku_hash.cpp haiku_lock.cpp HaikuKernelFileSystem.cpp Modified: haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/UserlandFSServer.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/UserlandFSServer.cpp 2007-03-23 00:03:59 UTC (rev 20405) +++ haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/UserlandFSServer.cpp 2007-03-23 00:09:55 UTC (rev 20406) @@ -24,6 +24,7 @@ #include "FileSystem.h" #include "FSInfo.h" #include "haiku_block_cache_priv.h" +#include "haiku_fs_cache.h" #include "HaikuKernelFileSystem.h" #include "RequestThread.h" #include "ServerDefs.h" @@ -281,6 +282,11 @@ if (error != B_OK) RETURN_ERROR(error); + // init file cache + error = UserlandFS::HaikuKernelEmu::file_cache_init(); + if (error != B_OK) + RETURN_ERROR(error); + // init the FS error = fileSystem->Init(); if (error != B_OK) Copied: haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/haiku_file_cache.cpp (from rev 20374, haiku/trunk/src/system/kernel/cache/file_cache.cpp) =================================================================== --- haiku/trunk/src/system/kernel/cache/file_cache.cpp 2007-03-11 23:17:28 UTC (rev 20374) +++ haiku/trunk/src/add-ons/kernel/file_systems/userlandfs/server/haiku_file_cache.cpp 2007-03-23 00:09:55 UTC (rev 20406) @@ -0,0 +1,1893 @@ +/* + * Copyright 2004-2007, Haiku Inc. All rights reserved. + * Distributed under the terms of the MIT License. + * + * Authors: + * Axel D?rfler + * Ingo Weinhold + */ + +#include "haiku_fs_cache.h" + +#include + +#include +#include +#include + +#include + +#include + +#include "haiku_hash.h" +#include "haiku_lock.h" +#include "HaikuKernelVolume.h" +#include "kernel_emu.h" + +#undef TRACE +//#define TRACE_FILE_CACHE +#ifdef TRACE_FILE_CACHE +# define TRACE(x) dprintf x +#else +# define TRACE(x) ; +#endif + +using std::nothrow; + + +// This is a hacked version of the kernel file cache implementation. The main +// part of the implementation didn't change that much -- some code not needed +// in userland has been removed, file_cache_ref, vm_cache_ref and vm_cache +// have been unified, and the complete interface to the VM (vm_*()) and the +// VFS (vfs_*()) has been re-implemented to suit our needs. +// +// The PagePool class is a data structure used for managing the pages (vm_page) +// allocated and assigned to caches (file_cache_ref). It has a list for free +// pages, i.e. those that are not assigned to any cache and can be reused at +// once. A second list contains those pages that belong to a cache, but are +// not in use by any of the functions. These pages have a reference count of +// 0. They will be stolen from the owning cache when a usable page is needed, +// there are no free pages anymore, and the limit of pages that shall be used +// at maximum has already been reached. +// +// The only purpose of the page reference count (vm_page::ref_count) is to +// indicate whether the page is in use (i.e. known to one or more of the cache +// functions currently being executed). vm_page_get_page(), +// vm_page_allocate_page(), and vm_cache_lookup_page acquire a reference to +// the page, vm_page_put_page() releases a reference. + +// vm_page::state indicates in what state +// a page currently is. PAGE_STATE_FREE is only encountered for pages not +// belonging to a cache (being in page pool's free pages list, or just having +// been removed or not yet added). PAGE_STATE_ACTIVE/MODIFIED indicate that +// the page contains valid file data, in the latter case not yet written to +// disk. PAGE_STATE_BUSY means that the page is currently being manipulated by +// an operation, usually meaning that page data are being read from/written to +// disk. The required behavior when encountering a busy page, is to put the +// page, release the page pool and cache locks, wait a short time, and +// retry again later. +// +// Changing the page state requires having a reference to the page, +// holding the lock of the owning cache (if any) and the lock of the page pool +// (in case the page is not newly allocated). +// +// A page is in up to three lists. The free or unused list in the page pool +// (guarded by the page pool lock), the pages list of the cache the page +// belongs to, and the modified pages list of the cache (both cache lists +// are guarded by both the page pool and the cache lock). The modified pages +// list only contains PAGE_STATE_MODIFIED or PAGE_STATE_BUSY pages. + + +// maximum number of iovecs per request +#define MAX_IO_VECS 64 // 256 kB +#define MAX_FILE_IO_VECS 32 + +#define CACHED_FILE_EXTENTS 2 + // must be smaller than MAX_FILE_IO_VECS + // ToDo: find out how much of these are typically used + +using UserlandFS::KernelEmu::dprintf; +using UserlandFS::KernelEmu::panic; +#define user_memcpy(a, b, c) memcpy(a, b, c) + +#define PAGE_ALIGN(x) (((x) + (B_PAGE_SIZE - 1)) & ~(B_PAGE_SIZE - 1)) + +namespace UserlandFS { +namespace HaikuKernelEmu { + +enum { + PAGE_STATE_ACTIVE = 0, + PAGE_STATE_BUSY, + PAGE_STATE_MODIFIED, + PAGE_STATE_FREE +}; + +enum { + PHYSICAL_PAGE_NO_WAIT = 0, + PHYSICAL_PAGE_CAN_WAIT, +}; + +struct vm_page; +struct file_cache_ref; + +typedef DoublyLinkedListLink page_link; + +// vm page +struct vm_page { + vm_page* next; + page_link link_cache; + page_link link_cache_modified; + page_link link_pool; + file_cache_ref* cache; + off_t offset; + void* data; + uint8 state; + uint32 ref_count; + + vm_page() + : next(NULL), + cache(NULL), + offset(0), + data(malloc(B_PAGE_SIZE)), + state(PAGE_STATE_FREE), + ref_count(1) + { + } + + ~vm_page() + { + free(data); + } + + addr_t Address() const { return (addr_t)data; } + + static int Compare(void *_cacheEntry, const void *_key); + static uint32 Hash(void *_cacheEntry, const void *_key, uint32 range); +}; + +struct file_extent { + off_t offset; + file_io_vec disk; +}; + +struct file_map { + file_map(); + ~file_map(); + + file_extent *operator[](uint32 index); + file_extent *ExtentAt(uint32 index); + status_t Add(file_io_vec *vecs, size_t vecCount, off_t &lastOffset); + void Free(); + + union { + file_extent direct[CACHED_FILE_EXTENTS]; + file_extent *array; + }; + size_t count; +}; + + +static vm_page *vm_page_allocate_page(int state); +static void vm_page_get_page(vm_page* page); +static status_t vm_page_put_page(vm_page* page); +static status_t vm_page_set_state(vm_page *page, int state); + +static void vm_cache_insert_page(file_cache_ref *cacheRef, vm_page *page, + off_t offset); +static void vm_cache_remove_page(file_cache_ref *cacheRef, vm_page *page); +static vm_page *vm_cache_lookup_page(file_cache_ref *cacheRef, off_t page); +static status_t vm_cache_resize(file_cache_ref *cacheRef, off_t newSize); +static status_t vm_cache_write_modified(file_cache_ref *ref, bool fsReenter); + +static status_t vfs_read_pages(int fd, off_t pos, const iovec *vecs, + size_t count, size_t *_numBytes, bool fsReenter); +static status_t vfs_write_pages(int fd, off_t pos, const iovec *vecs, + size_t count, size_t *_numBytes, bool fsReenter); +static status_t vfs_get_file_map(file_cache_ref *cache, off_t offset, + size_t size, struct file_io_vec *vecs, size_t *_count); + +static HaikuKernelVolume* file_cache_get_volume(mount_id mountID); + +static status_t pages_io(file_cache_ref *ref, off_t offset, const iovec *vecs, + size_t count, size_t *_numBytes, bool doWrite); + + +typedef DoublyLinkedList > cache_modified_page_list; + +typedef DoublyLinkedList > cache_page_list; + +struct file_cache_ref { + mutex lock; + mount_id mountID; + vnode_id nodeID; + fs_vnode nodeHandle; + int deviceFD; + off_t virtual_size; + + cache_page_list pages; + cache_modified_page_list modifiedPages; + + file_map map; +}; + +struct page_hash_key { + page_hash_key() {} + page_hash_key(int fd, vnode_id id, off_t offset) + : deviceFD(fd), + nodeID(id), + offset(offset) + { + } + + int deviceFD; + vnode_id nodeID; + off_t offset; +}; + + +struct volume_list_entry; +typedef DoublyLinkedListLink volume_list_link; + +struct volume_list_entry { + volume_list_link link; + HaikuKernelVolume* volume; +}; + +typedef DoublyLinkedList > volume_list; + +typedef DoublyLinkedList > pool_page_list; + +struct PagePool { + + PagePool() + : pageHash(NULL), + unusedPages(), + freePages(), + allocatedPages(0) + { + } + + ~PagePool() + { + } + + status_t Init() + { + status_t error = recursive_lock_init(&lock, "page pool"); + if (error != B_OK) { + panic("PagePool: Failed to init lock\n"); + return error; + } + + pageHash = hash_init(256, 0, &vm_page::Compare, &vm_page::Hash); + if (pageHash == NULL) { + panic("PagePool: Failed to create page hash\n"); + return B_NO_MEMORY; + } + + return B_OK; + } + + bool Lock() { return (recursive_lock_lock(&lock) == B_OK); } + void Unlock() { recursive_lock_unlock(&lock); } + + recursive_lock lock; + hash_table* pageHash; + pool_page_list unusedPages; + pool_page_list freePages; + uint32 allocatedPages; +}; + +struct PagePutter { + PagePutter(vm_page* page) + : fPage(page) + { + } + + ~PagePutter() + { + if (fPage) + vm_page_put_page(fPage); + } + +private: + vm_page* fPage; +}; + +static PagePool sPagePool; +static const uint32 kMaxAllocatedPages = 1024; +static volume_list sVolumeList; +static mutex sVolumeListLock; + + +int +vm_page::Compare(void *_cacheEntry, const void *_key) +{ + vm_page *page = (vm_page*)_cacheEntry; + const page_hash_key *key = (const page_hash_key *)_key; + + // device FD + if (page->cache->deviceFD != key->deviceFD) + return page->cache->deviceFD - key->deviceFD; + + // node ID + if (page->cache->nodeID < key->nodeID) + return -1; + if (page->cache->nodeID > key->nodeID) + return 1; + + // offset + if (page->offset < key->offset) + return -1; + if (page->offset > key->offset) + return 1; + + return 0; +} + +uint32 +vm_page::Hash(void *_cacheEntry, const void *_key, uint32 range) +{ + vm_page *page = (vm_page*)_cacheEntry; + const page_hash_key *key = (const page_hash_key *)_key; + + int fd = (page ? page->cache->deviceFD : key->deviceFD); + vnode_id id = (page ? page->cache->nodeID : key->nodeID); + off_t offset = (page ? page->offset : key->offset); + + uint32 value = fd; + value = value * 17 + id; + value = value * 17 + offset; + + return value % range; +} + + +vm_page * +vm_page_allocate_page(int state) +{ + AutoLocker poolLocker(sPagePool); + + // is a queued free page available? + vm_page* page = sPagePool.freePages.RemoveHead(); + if (page) { + page->ref_count++; + return page; + } + + // no free page + + // If the limit for allocated pages has been reached, we try to steal an + // unused page. + if (sPagePool.allocatedPages >= kMaxAllocatedPages + && !sPagePool.unusedPages.IsEmpty()) { + // we grab the first non-busy page + for (pool_page_list::Iterator it(&sPagePool.unusedPages); + vm_page* currentPage = it.Next();) { + if (currentPage->state != PAGE_STATE_BUSY) { + it.Remove(); + page = currentPage; + page->ref_count++; + break; + } + } + + // If we've found a suitable page, we need to mark it busy, write it + // if it was modified, and finally remove it from its cache. + if (page != NULL) { + bool modified = (page->state == PAGE_STATE_MODIFIED); + + // mark the page busy + page->state = PAGE_STATE_BUSY; + + // We don't need the pool lock anymore. + poolLocker.Unlock(); + + file_cache_ref* cache = page->cache; + + // If the page is modified, we write it to the disk. + if (modified) { + // find out, how much to write, and remove the page from the + // cache's modified pages list + MutexLocker cacheLocker(cache->lock); + size_t bytes = min_c(B_PAGE_SIZE, + cache->virtual_size - page->offset); + cache->modifiedPages.Remove(page); + cacheLocker.Unlock(); + + // if we need to write anything, do it now + if (bytes > 0) { + iovec vecs[1]; + vecs[0].iov_base = page->data; + vecs[0].iov_len = bytes; + status_t error = pages_io(cache, page->offset, vecs, 1, + &bytes, true); + if (error != B_OK) { + // failed to write the page: bad, but we can't do + // much about it + dprintf("vm_page_allocate_page(): Failed to write " + "page %p (cache %p, offset: %lld).\n", page, + cache, page->offset); + } + } + } + + // remove the page from the cache + MutexLocker cacheLocker(cache->lock); + vm_cache_remove_page(cache, page); + + // now it's ours + page->state = PAGE_STATE_FREE; + + return page; + } + } + + // no page yet -- allocate a new one + + page = new(nothrow) vm_page; + if (!page || !page->data) { + delete page; + return NULL; + } + + sPagePool.allocatedPages++; + + return page; +} + + +static void +vm_page_get_page(vm_page* page) +{ + if (page) { + AutoLocker _(sPagePool); + + // increase ref count + page->ref_count++; + + // if the page was unused before, remove it from the unused pages list + if (page->ref_count == 1) + sPagePool.unusedPages.Remove(page); + } +} + + +static status_t +vm_page_put_page(vm_page* page) +{ + if (!page) + return B_BAD_VALUE; + + AutoLocker _(sPagePool); + + if (page->ref_count <= 0) { + panic("vm_page_put_page(): page %p already unreferenced!\n", page); + return B_BAD_VALUE; + } + + // decrease ref count + page->ref_count--; + + if (page->ref_count > 0) + return B_OK; + + // the page is unreference now: add it to the unused or free pages list + + if (page->state == PAGE_STATE_FREE) { + // page is free + // if we've maxed out the allowed allocated page, free this one, + // otherwise add it to the free list + if (sPagePool.allocatedPages > kMaxAllocatedPages) { + delete page; + sPagePool.allocatedPages--; + } else + sPagePool.freePages.Add(page); + } else { + // page is is not free; add to unused pages list + sPagePool.unusedPages.Add(page); + } + + return B_OK; +} + + +status_t +vm_page_set_state(vm_page *page, int state) +{ + AutoLocker _(sPagePool); + + if (page->ref_count <= 0) { + panic("vm_page_set_state(): page %p is already unreferenced!\n", + page); + return B_BAD_VALUE; + } + + if (state == page->state) + return B_OK; + + // If it was modified before, remove the page from the cache's modified + // pages list. + if (page->state == PAGE_STATE_MODIFIED && page->cache) + page->cache->modifiedPages.Remove(page); + + switch (state) { + case PAGE_STATE_ACTIVE: + case PAGE_STATE_BUSY: + case PAGE_STATE_FREE: + page->state = state; + break; + + case PAGE_STATE_MODIFIED: + { + page->state = state; + + // add page to the modified list of the cache + if (!page->cache) { + panic("vm_page_set_state(): setting page state of page %p " + "to PAGE_STATE_MODIFIED, but page is not in a cache\n", + page); + return B_BAD_VALUE; + } + + page->cache->modifiedPages.Add(page); + + break; + } + + default: + panic("vm_page_set_state(): invalid page state: %d\n", state); + return B_BAD_VALUE; + } + + return B_OK; +} + + +void +vm_cache_insert_page(file_cache_ref *cache, vm_page *page, off_t offset) +{ + AutoLocker _(sPagePool); + + if (page->cache != NULL) { + panic("vm_cache_insert_page(%p, %p): page already in cache %p\n", + cache, page, page->cache); + return; + } + + page->cache = cache; + page->offset = offset; + + // insert page into hash + status_t error = hash_insert(sPagePool.pageHash, page); + if (error != B_OK) { + panic("vm_cache_insert_page(): Failed to insert page %p into hash!\n", + page); + page->cache = NULL; + page->offset = 0; + return; + } + + // add page to cache page list + cache->pages.Add(page); +} + + +void +vm_cache_remove_page(file_cache_ref *cache, vm_page *page) +{ + if (cache != page->cache) { + panic("vm_cache_remove_page(%p, %p): page is in cache %p\n", + cache, page, page->cache); + return; + } + + AutoLocker _(sPagePool); + + if (page->state == PAGE_STATE_MODIFIED) + cache->modifiedPages.Remove(page); + + cache->pages.Remove(page); + + hash_remove(sPagePool.pageHash, page); + + page->cache = NULL; + page->offset = 0; +} + + +vm_page * +vm_cache_lookup_page(file_cache_ref *cache, off_t offset) +{ + if (!cache) + return NULL; + + AutoLocker _(sPagePool); + + page_hash_key key(cache->deviceFD, cache->nodeID, offset); + + vm_page* page = (vm_page*)hash_lookup(sPagePool.pageHash, &key); + + if (page) + vm_page_get_page(page); + + return page; +} + + +// cache must be locked +// +status_t +vm_cache_resize(file_cache_ref *cache, off_t newSize) +{ + off_t oldAlignedSize = PAGE_ALIGN(cache->virtual_size); + off_t newAlignedSize = PAGE_ALIGN(newSize); + + cache->virtual_size = newSize; + + // if the aligned cache size increased or remained the same, we're done + if (newAlignedSize >= oldAlignedSize) + return B_OK; + + // the file shrinks, so we need to get rid of excess pages + + // Hold the page pool lock virtually all the time from now on. + AutoLocker poolLocker(sPagePool); + + // For sake of efficiency we sort the cache's list of pages so that all + // pages that need to be removed are at the beginning of the list. + vm_page* page = cache->pages.Head(); + if (newAlignedSize > 0) { + while (page) { + vm_page* nextPage = cache->pages.GetNext(page); + + if (page->offset >= newAlignedSize) { + // move to the beginning of the list + cache->pages.Remove(page); + cache->pages.Add(page, false); + } + + page = nextPage; + } + } + + // now we remove and free the excess pages one by one + while (true) { + // get the first page in the list to remove + // (since we sorted the list, this is usually very cheap) + for (cache_page_list::Iterator it(&cache->pages); (page = it.Next());) { + if (page->offset >= newAlignedSize) + break; + } + + // no more pages? -- then we're done + if (!page) + return B_OK; + + if (page->state == PAGE_STATE_BUSY) { + // the page is busy -- wait a while and try again + poolLocker.Unlock(); + mutex_unlock(&cache->lock); + sleep(20000); + mutex_lock(&cache->lock); + poolLocker.Lock(); + } else { + // the page isn't busy -- get rid of it + vm_page_get_page(page); + vm_cache_remove_page(cache, page); + vm_page_set_state(page, PAGE_STATE_FREE); + vm_page_put_page(page); + } + } + + return B_OK; +} + + +status_t +vm_cache_write_modified(file_cache_ref *cache, bool fsReenter) +{ + // TODO: Write more than one page at a time. To avoid deadlocks, when a + // busy page is encountered the previously collected pages need to be + // written. Otherwise as many pages as our on-stack array can contain + // can be processed at once. + MutexLocker locker(cache->lock); + while (true) { + // get the next modified page and mark it busy + vm_page* page = NULL; + + while (true) { + // get the first modified page + AutoLocker poolLocker(sPagePool); + page = cache->modifiedPages.Head(); + + if (!page) + return B_OK; + + // if not marked busy, remove it and mark it busy + if (page->state != PAGE_STATE_BUSY) { + cache->modifiedPages.Remove(page); + vm_page_get_page(page); + page->state = PAGE_STATE_BUSY; + break; + } + + // page is busy -- wait a while + vm_page_put_page(page); + poolLocker.Unlock(); + locker.Unlock(); + sleep(20000); + locker.Lock(); + } + + locker.Unlock(); + + // write the page + size_t bytes = min_c(B_PAGE_SIZE, cache->virtual_size - page->offset); + iovec vecs[1]; + vecs[0].iov_base = page->data; + vecs[0].iov_len = bytes; + status_t error = pages_io(cache, page->offset, vecs, 1, &bytes, true); + if (error != B_OK) + return error; + + locker.Lock(); + + vm_page_set_state(page, PAGE_STATE_ACTIVE); + vm_page_put_page(page); + } + + return B_OK; +} + + +status_t +vfs_read_pages(int fd, off_t pos, const iovec *vecs, size_t count, + size_t *_numBytes, bool fsReenter) +{ + // check how much the iovecs allow us to read + size_t toRead = 0; + for (size_t i = 0; i < count; i++) + toRead += vecs[i].iov_len; + + iovec* newVecs = NULL; + if (*_numBytes < toRead) { + // We're supposed to read less than specified by the vecs. Since + // readv_pos() doesn't support this, we need to clone the vecs. + newVecs = new(nothrow) iovec[count]; + if (!newVecs) + return B_NO_MEMORY; + + size_t newCount = 0; + for (size_t i = 0; i < count && toRead > 0; i++) { + size_t vecLen = min_c(vecs[i].iov_len, toRead); + newVecs[i].iov_base = vecs[i].iov_base; + newVecs[i].iov_len = vecLen; + toRead -= vecLen; + newCount++; + } + + vecs = newVecs; + count = newCount; + } + + ssize_t bytesRead = readv_pos(fd, pos, vecs, count); + delete[] newVecs; + if (bytesRead < 0) + return bytesRead; + + *_numBytes = bytesRead; + return B_OK; +} + + +status_t +vfs_write_pages(int fd, off_t pos, const iovec *vecs, size_t count, + size_t *_numBytes, bool fsReenter) +{ + // check how much the iovecs allow us to write + size_t toWrite = 0; + for (size_t i = 0; i < count; i++) + toWrite += vecs[i].iov_len; + + iovec* newVecs = NULL; + if (*_numBytes < toWrite) { + // We're supposed to write less than specified by the vecs. Since + // writev_pos() doesn't support this, we need to clone the vecs. + newVecs = new(nothrow) iovec[count]; + if (!newVecs) + return B_NO_MEMORY; + + size_t newCount = 0; + for (size_t i = 0; i < count && toWrite > 0; i++) { + size_t vecLen = min_c(vecs[i].iov_len, toWrite); + newVecs[i].iov_base = vecs[i].iov_base; + newVecs[i].iov_len = vecLen; + toWrite -= vecLen; + newCount++; + } + + vecs = newVecs; + count = newCount; + } + + ssize_t bytesWritten = writev_pos(fd, pos, vecs, count); + delete[] newVecs; + if (bytesWritten < 0) + return bytesWritten; + + *_numBytes = bytesWritten; + return B_OK; +} + + +status_t +vfs_get_file_map(file_cache_ref *cache, off_t offset, size_t size, + struct file_io_vec *vecs, size_t *_count) +{ + // get the volume for the cache + HaikuKernelVolume* volume = file_cache_get_volume(cache->mountID); + if (!volume) { + panic("vfs_get_file_map(): no volume for ID %ld\n", cache->mountID); + return B_ERROR; + } + + // node handle cached? + fs_vnode nodeHandle = NULL; + { + MutexLocker _(cache->lock); + nodeHandle = cache->nodeHandle; + } + + // if not cached, get the node handle + if (!nodeHandle) { + status_t error = UserlandFS::KernelEmu::get_vnode(cache->mountID, + cache->nodeID, &nodeHandle); + if (error != B_OK) + return error; + UserlandFS::KernelEmu::put_vnode(cache->mountID, cache->nodeID); + + // cache the handle + MutexLocker _(cache->lock); + cache->nodeHandle = nodeHandle; + } + + return volume->GetFileMap(nodeHandle, offset, size, vecs, _count); +} [... truncated: 1144 lines follow ...] From axeld at mail.berlios.de Fri Mar 23 12:48:41 2007 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Fri, 23 Mar 2007 12:48:41 +0100 Subject: [Haiku-commits] r20407 - in haiku/trunk: headers/private/kernel src/system/kernel/vm Message-ID: <200703231148.l2NBmfo9028716@sheep.berlios.de> Author: axeld Date: 2007-03-23 12:48:37 +0100 (Fri, 23 Mar 2007) New Revision: 20407 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20407&view=rev Modified: haiku/trunk/headers/private/kernel/vm.h haiku/trunk/headers/private/kernel/vm_page.h haiku/trunk/src/system/kernel/vm/vm.cpp haiku/trunk/src/system/kernel/vm/vm_page.c Log: * The new vm_page_mappings weren't updated correctly in many cases. * Added a comment to vm_remove_all_page_mappings() that shows that we need to change the mapping spinlock into a mutex. * Pointed out some potential problems in the code. * Added vm_page_at_index(), vm_clear_map_activation(), and vm_test_map_activation() in preparation of the page scanner rewrite. Modified: haiku/trunk/headers/private/kernel/vm.h =================================================================== --- haiku/trunk/headers/private/kernel/vm.h 2007-03-23 00:09:55 UTC (rev 20406) +++ haiku/trunk/headers/private/kernel/vm.h 2007-03-23 11:48:37 UTC (rev 20407) @@ -62,6 +62,8 @@ vm_area *vm_area_lookup(vm_address_space *addressSpace, addr_t address); status_t vm_set_area_memory_type(area_id id, addr_t physicalBase, uint32 type); status_t vm_get_page_mapping(team_id team, addr_t vaddr, addr_t *paddr); +int32 vm_test_map_activation(vm_page *page); +void vm_clear_map_activation(vm_page *page); void vm_remove_all_page_mappings(vm_page *page); status_t vm_unmap_pages(vm_area *area, addr_t base, size_t length); status_t vm_map_page(vm_area *area, vm_page *page, addr_t address, Modified: haiku/trunk/headers/private/kernel/vm_page.h =================================================================== --- haiku/trunk/headers/private/kernel/vm_page.h 2007-03-23 00:09:55 UTC (rev 20406) +++ haiku/trunk/headers/private/kernel/vm_page.h 2007-03-23 11:48:37 UTC (rev 20407) @@ -38,7 +38,8 @@ status_t vm_page_allocate_pages(int pageState, vm_page **pages, uint32 numPages); vm_page *vm_page_allocate_page_run(int state, addr_t length); vm_page *vm_page_allocate_specific_page(addr_t page_num, int state); -vm_page *vm_lookup_page(addr_t page_num); +vm_page *vm_page_at_index(int32 index); +vm_page *vm_lookup_page(addr_t pageNumber); #ifdef __cplusplus } Modified: haiku/trunk/src/system/kernel/vm/vm.cpp =================================================================== --- haiku/trunk/src/system/kernel/vm/vm.cpp 2007-03-23 00:09:55 UTC (rev 20406) +++ haiku/trunk/src/system/kernel/vm/vm.cpp 2007-03-23 11:48:37 UTC (rev 20407) @@ -1616,6 +1616,9 @@ map->ops->unmap(map, area->base, area->base - 1 + area->size); map->ops->flush(map); + // TODO: does anything guarantee that we remap the same pages here? + // Shouldn't we better introduce a "change mapping"? + for (page = lowerCache->page_list; page; page = page->cache_next) { map->ops->map(map, area->base + (page->cache_offset << PAGE_SHIFT) - area->cache_offset, page->physical_page_number << PAGE_SHIFT, @@ -1836,9 +1839,67 @@ } +int32 +vm_test_map_activation(vm_page *page) +{ + int32 activation = 0; + + // TODO: this can't work... (we need to lock the map, so this has to be a mutex) + cpu_status state = disable_interrupts(); + acquire_spinlock(&sMappingLock); + + vm_page_mappings::Iterator iterator = page->mappings.GetIterator(); + vm_page_mapping *mapping; + while ((mapping = iterator.Next()) != NULL) { + vm_area *area = mapping->area; + vm_translation_map *map = &area->address_space->translation_map; + + addr_t physicalAddress; + uint32 flags; +// map->ops->lock(map); + addr_t address = area->base + (page->cache_offset << PAGE_SHIFT); + map->ops->query_interrupt(map, address, &physicalAddress, &flags); +// map->ops->unlock(map); + + if (flags & PAGE_ACCESSED) + activation++; + } + + release_spinlock(&sMappingLock); + restore_interrupts(state); + + return activation; +} + + void +vm_clear_map_activation(vm_page *page) +{ + // TODO: this can't work... (we need to lock the map, so this has to be a mutex) + cpu_status state = disable_interrupts(); + acquire_spinlock(&sMappingLock); + + vm_page_mappings::Iterator iterator = page->mappings.GetIterator(); + vm_page_mapping *mapping; + while ((mapping = iterator.Next()) != NULL) { + vm_area *area = mapping->area; + vm_translation_map *map = &area->address_space->translation_map; + +// map->ops->lock(map); + addr_t address = area->base + (page->cache_offset << PAGE_SHIFT); + map->ops->clear_flags(map, address, PAGE_ACCESSED); +// map->ops->unlock(map); + } + + release_spinlock(&sMappingLock); + restore_interrupts(state); +} + + +void vm_remove_all_page_mappings(vm_page *page) { + // TODO: this can't work... (we need to lock the map, so this has to be a mutex) cpu_status state = disable_interrupts(); acquire_spinlock(&sMappingLock); @@ -1851,10 +1912,10 @@ vm_area *area = mapping->area; vm_translation_map *map = &area->address_space->translation_map; - map->ops->lock(map); +// map->ops->lock(map); addr_t base = area->base + (page->cache_offset << PAGE_SHIFT); map->ops->unmap(map, base, base + (B_PAGE_SIZE - 1)); - map->ops->unlock(map); +// map->ops->unlock(map); area->mappings.Remove(mapping); } @@ -2485,6 +2546,9 @@ } +/*! + Frees physical pages that were used during the boot process. +*/ static void unmap_and_free_physical_pages(vm_translation_map *map, addr_t start, addr_t end) { @@ -3470,6 +3534,13 @@ if (status == B_OK) { // All went fine, all there is left to do is to map the page into the address space + // In case this is a copy-on-write page, we need to unmap it from the area now + if (isWrite && page->cache == topCacheRef->cache) + vm_unmap_pages(area, address - area->base, B_PAGE_SIZE); + + // TODO: there is currently no mechanism to prevent a page being mapped + // more than once in case of a second page fault! + // If the page doesn't reside in the area's cache, we need to make sure it's // mapped in read-only, so that we cannot overwrite someone else's data (copy-on-write) uint32 newProtection = area->protection; @@ -4127,13 +4198,8 @@ current->size = newSize; // we also need to unmap all pages beyond the new size, if the area has shrinked - if (newSize < oldSize) { - vm_translation_map *map = ¤t->address_space->translation_map; - - map->ops->lock(map); - map->ops->unmap(map, current->base + newSize, current->base + oldSize - 1); - map->ops->unlock(map); - } + if (newSize < oldSize) + vm_unmap_pages(current, current->base + newSize, oldSize - newSize); } if (status == B_OK) @@ -4193,6 +4259,11 @@ acquire_sem_etc(sourceAddressSpace->sem, WRITE_COUNT, 0, 0); + // unmap the area in the source address space + vm_unmap_pages(area, area->base, area->size); + + // TODO: there might be additional page faults at this point! + reservedAddress = (void *)area->base; remove_area_from_address_space(sourceAddressSpace, area, true); status = insert_area(sourceAddressSpace, &reservedAddress, B_EXACT_ADDRESS, @@ -4204,12 +4275,6 @@ if (status != B_OK) goto err3; - // unmap the area in the source address space - map = &sourceAddressSpace->translation_map; - map->ops->lock(map); - map->ops->unmap(map, area->base, area->base + (area->size - 1)); - map->ops->unlock(map); - // insert the area into the target address space acquire_sem_etc(targetAddressSpace->sem, WRITE_COUNT, 0, 0); @@ -4228,6 +4293,8 @@ // The area was successfully transferred to the new team when we got here area->address_space = targetAddressSpace; + // TODO: take area lock/wiring into account! + release_sem_etc(targetAddressSpace->sem, WRITE_COUNT, 0); vm_unreserve_address_range(sourceAddressSpace->id, reservedAddress, area->size); Modified: haiku/trunk/src/system/kernel/vm/vm_page.c =================================================================== --- haiku/trunk/src/system/kernel/vm/vm_page.c 2007-03-23 00:09:55 UTC (rev 20406) +++ haiku/trunk/src/system/kernel/vm/vm_page.c 2007-03-23 11:48:37 UTC (rev 20407) @@ -1030,16 +1030,23 @@ vm_page * -vm_lookup_page(addr_t page_num) +vm_page_at_index(int32 index) { - if (page_num < sPhysicalPageOffset) + return &sPages[index]; +} + + +vm_page * +vm_lookup_page(addr_t pageNumber) +{ + if (pageNumber < sPhysicalPageOffset) return NULL; - page_num -= sPhysicalPageOffset; - if (page_num >= sNumPages) + pageNumber -= sPhysicalPageOffset; + if (pageNumber >= sNumPages) return NULL; - return &sPages[page_num]; + return &sPages[pageNumber]; } From axeld at mail.berlios.de Fri Mar 23 13:36:25 2007 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Fri, 23 Mar 2007 13:36:25 +0100 Subject: [Haiku-commits] r20408 - haiku/trunk/src/system/kernel/vm Message-ID: <200703231236.l2NCaPP5011470@sheep.berlios.de> Author: axeld Date: 2007-03-23 13:36:24 +0100 (Fri, 23 Mar 2007) New Revision: 20408 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20408&view=rev Modified: haiku/trunk/src/system/kernel/vm/vm.cpp Log: Accidently unmapped the wrong pages in case of COW after the last commit... Modified: haiku/trunk/src/system/kernel/vm/vm.cpp =================================================================== --- haiku/trunk/src/system/kernel/vm/vm.cpp 2007-03-23 11:48:37 UTC (rev 20407) +++ haiku/trunk/src/system/kernel/vm/vm.cpp 2007-03-23 12:36:24 UTC (rev 20408) @@ -1935,12 +1935,13 @@ vm_unmap_pages(vm_area *area, addr_t base, size_t size) { vm_translation_map *map = &area->address_space->translation_map; + addr_t end = base + (size - 1); map->ops->lock(map); if (area->wiring != B_NO_LOCK && area->cache_type != CACHE_TYPE_DEVICE) { // iterate through all pages and decrease their wired count - for (addr_t virtualAddress = base; virtualAddress < base + (size - 1); + for (addr_t virtualAddress = base; virtualAddress < end; virtualAddress += B_PAGE_SIZE) { addr_t physicalAddress; uint32 flags; @@ -1960,7 +1961,7 @@ } } - map->ops->unmap(map, base, base + (size - 1)); + map->ops->unmap(map, base, end); if (area->wiring == B_NO_LOCK) { vm_area_mappings queue; @@ -3536,7 +3537,7 @@ // In case this is a copy-on-write page, we need to unmap it from the area now if (isWrite && page->cache == topCacheRef->cache) - vm_unmap_pages(area, address - area->base, B_PAGE_SIZE); + vm_unmap_pages(area, address, B_PAGE_SIZE); // TODO: there is currently no mechanism to prevent a page being mapped // more than once in case of a second page fault! From axeld at mail.berlios.de Fri Mar 23 16:30:45 2007 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Fri, 23 Mar 2007 16:30:45 +0100 Subject: [Haiku-commits] r20409 - haiku/trunk/src/add-ons/translators/raw Message-ID: <200703231530.l2NFUjaG025642@sheep.berlios.de> Author: axeld Date: 2007-03-23 16:30:44 +0100 (Fri, 23 Mar 2007) New Revision: 20409 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20409&view=rev Modified: haiku/trunk/src/add-ons/translators/raw/RAW.cpp haiku/trunk/src/add-ons/translators/raw/RAW.h haiku/trunk/src/add-ons/translators/raw/ReadHelper.h haiku/trunk/src/add-ons/translators/raw/main.cpp Log: Now also supports Canon's CR2 format - note, all images are only opened in half of their original size for now. Modified: haiku/trunk/src/add-ons/translators/raw/RAW.cpp =================================================================== --- haiku/trunk/src/add-ons/translators/raw/RAW.cpp 2007-03-23 12:36:24 UTC (rev 20408) +++ haiku/trunk/src/add-ons/translators/raw/RAW.cpp 2007-03-23 15:30:44 UTC (rev 20409) @@ -21,6 +21,11 @@ #include +//#define TRACE(x) dprintf x +#define TRACE(x) +//#define TAG(x) dprintf x +#define TAG(x) + #define ABS(x) (((int)(x) ^ ((int)(x) >> 31)) - ((int)(x) >> 31)) #define LIM(x,min,max) MAX(min,MIN(x,max)) #define ULIM(x,y,z) ((y) < (z) ? LIM(x,y,z) : LIM(x,z,y)) @@ -82,6 +87,7 @@ fRawIndex(-1), fThumbIndex(-1), fDNGVersion(0), + fIsTIFF(false), fThreshold(0), fHalfSize(true), fUseCameraWhiteBalance(true), @@ -107,6 +113,10 @@ { fImages = new image_data_info[kImageBufferCount]; fDecodeBuffer = new decode[kDecodeBufferCount]; + fCurve = new uint16[0x1000]; + for (uint32 i = 0; i < 0x1000; i++) { + fCurve[i] = i; + } cbrt = new float[0x10000]; fHistogram = (int32 (*)[4])calloc(sizeof(int32) * 0x2000 * 4, 1); @@ -117,6 +127,7 @@ memset(fWhite, 0, sizeof(fWhite)); fMeta.camera_multipliers[0] = -1; + fCR2Slice[0] = 0; } @@ -124,6 +135,7 @@ { delete[] fImages; delete[] fDecodeBuffer; + delete[] fCurve; delete[] cbrt; free(fHistogram); @@ -228,6 +240,41 @@ } +bool +DCRaw::_IsCanon() const +{ + return !strncasecmp(fMeta.manufacturer, "Canon", 5); +} + + +bool +DCRaw::_IsKodak() const +{ + return !strncasecmp(fMeta.manufacturer, "Kodak", 5); +} + + +bool +DCRaw::_IsNikon() const +{ + return !strncasecmp(fMeta.manufacturer, "Nikon", 5); +} + + +bool +DCRaw::_IsPentax() const +{ + return !strncasecmp(fMeta.manufacturer, "Pentax", 6); +} + + +bool +DCRaw::_IsSamsung() const +{ + return !strncasecmp(fMeta.manufacturer, "Samsung", 7); +} + + void DCRaw::_ParseThumbTag(off_t baseOffset, uint32 offsetTag, uint32 lengthTag) { @@ -375,7 +422,7 @@ off_t nextOffset; tiff_tag tag; _ParseTIFFTag(baseOffset, tag, nextOffset); - //printf("got manufacturer tag %u (type %u, length %lu)\n", tag.tag, tag.type, tag.length); + TAG(("Manufacturer tag %u (type %u, length %lu)\n", tag.tag, tag.type, tag.length)); if (strstr(fMeta.manufacturer, "PENTAX")) { if (tag.tag == 0x1b) @@ -604,9 +651,14 @@ off_t nextOffset; tiff_tag tag; _ParseTIFFTag(baseOffset, tag, nextOffset); -//printf("got EXIF tag %u (type %u, length %lu)\n", tag.tag, tag.type, tag.length); + TAG(("EXIF tag %u (type %u, length %lu)\n", tag.tag, tag.type, tag.length)); switch (tag.tag) { +#if 0 + default: + printf(" unhandled EXIF tag %u\n", tag.tag); + break; +#endif case 33434: fMeta.shutter = fRead.NextDouble(TIFF_FRACTION_TYPE); break; @@ -659,6 +711,160 @@ } +void +DCRaw::_ParseLinearTable(uint32 length) +{ + if (length > 0x1000) + length = 0x1000; + + fRead.NextShorts(fCurve, length); + + for (uint32 i = length; i < 0x1000; i++) { + fCurve[i] = fCurve[i - 1]; + } + + fMeta.maximum = fCurve[0xfff]; +} + + +/*! + This (lengthy) method contains fixes for the values in the image data to + be able to actually read the image data correctly. +*/ +void +DCRaw::_FixupValues() +{ + // PENTAX and SAMSUNG section + // (Samsung sells rebranded Pentax cameras) + + if (_IsPentax() || _IsSamsung()) { + if (fInputWidth == 3936 && fInputHeight == 2624) { + // Pentax K10D and Samsumg GX10 + fInputWidth = 3896; + fInputHeight = 2616; + } + } + + // CANON + + if (_IsCanon()) { + bool isCR2 = false; + if (strstr(fMeta.model, "EOS D2000C")) { + fFilters = 0x61616161; + fMeta.black = fCurve[200]; + } + + switch (_Raw().width) { + case 2144: + fInputHeight = 1550; + fInputWidth = 2088; + fTopMargin = 8; + fLeftMargin = 4; + if (!strcmp(fMeta.model, "PowerShot G1")) { + fColors = 4; + fFilters = 0xb4b4b4b4; + } + break; + + case 2224: + fInputHeight = 1448; + fInputWidth = 2176; + fTopMargin = 6; + fLeftMargin = 48; + break; + + case 2376: + fInputHeight = 1720; + fInputWidth = 2312; + fTopMargin = 6; + fLeftMargin = 12; + break; + + case 2672: + fInputHeight = 1960; + fInputWidth = 2616; + fTopMargin = 6; + fLeftMargin = 12; + break; + + case 3152: + fInputHeight = 2056; + fInputWidth = 3088; + fTopMargin = 12; + fLeftMargin = 64; + if (fUniqueID == 0x80000170) + _AdobeCoefficients("Canon", "EOS 300D"); + fMeta.maximum = 0xfa0; + break; + + case 3160: + fInputHeight = 2328; + fInputWidth = 3112; + fTopMargin = 12; + fLeftMargin = 44; + break; + + case 3344: + fInputHeight = 2472; + fInputWidth = 3288; + fTopMargin = 6; + fLeftMargin = 4; + break; + + case 3516: + fTopMargin = 14; + fLeftMargin = 42; + if (fUniqueID == 0x80000189) + _AdobeCoefficients("Canon", "EOS 350D"); + isCR2 = true; + break; + + case 3596: + fTopMargin = 12; + fLeftMargin = 74; + isCR2 = true; + break; + + case 3948: + fTopMargin = 18; + fLeftMargin = 42; + fInputHeight -= 2; + if (fUniqueID == 0x80000236) + _AdobeCoefficients("Canon", "EOS 400D"); + isCR2 = true; + break; + + case 3984: + fTopMargin = 20; + fLeftMargin = 76; + fInputHeight -= 2; + fMeta.maximum = 0x3bb0; + isCR2 = true; + break; + + case 4476: + fTopMargin = 34; + fLeftMargin = 90; + fMeta.maximum = 0xe6c; + isCR2 = true; + break; + + case 5108: + fTopMargin = 13; + fLeftMargin = 98; + fMeta.maximum = 0xe80; + isCR2 = true; + break; + } + + if (isCR2) { + fInputHeight -= fTopMargin; + fInputWidth -= fLeftMargin; + } + } +} + + // #pragma mark - Image Conversion @@ -1848,8 +2054,11 @@ // #pragma mark - RAW loaders +/*! + This is, for example, used in PENTAX RAW images +*/ void -DCRaw::_LoadRAWPacked12() +DCRaw::_LoadRAWPacked12(const image_data_info& image) { uint32 rawWidth = _Raw().width; uint32 column, row; @@ -1869,6 +2078,298 @@ } +void +DCRaw::_MakeCanonDecoder(uint32 table) +{ + static const uchar kFirstTree[3][29] = { + { 0,1,4,2,3,1,2,0,0,0,0,0,0,0,0,0, + 0x04,0x03,0x05,0x06,0x02,0x07,0x01,0x08,0x09,0x00,0x0a,0x0b,0xff }, + { 0,2,2,3,1,1,1,1,2,0,0,0,0,0,0,0, + 0x03,0x02,0x04,0x01,0x05,0x00,0x06,0x07,0x09,0x08,0x0a,0x0b,0xff }, + { 0,0,6,3,1,1,2,0,0,0,0,0,0,0,0,0, + 0x06,0x05,0x07,0x04,0x08,0x03,0x09,0x02,0x00,0x0a,0x01,0x0b,0xff }, + }; + static const uchar kSecondTree[3][180] = { + { 0,2,2,2,1,4,2,1,2,5,1,1,0,0,0,139, + 0x03,0x04,0x02,0x05,0x01,0x06,0x07,0x08, + 0x12,0x13,0x11,0x14,0x09,0x15,0x22,0x00,0x21,0x16,0x0a,0xf0, + 0x23,0x17,0x24,0x31,0x32,0x18,0x19,0x33,0x25,0x41,0x34,0x42, + 0x35,0x51,0x36,0x37,0x38,0x29,0x79,0x26,0x1a,0x39,0x56,0x57, + 0x28,0x27,0x52,0x55,0x58,0x43,0x76,0x59,0x77,0x54,0x61,0xf9, + 0x71,0x78,0x75,0x96,0x97,0x49,0xb7,0x53,0xd7,0x74,0xb6,0x98, + 0x47,0x48,0x95,0x69,0x99,0x91,0xfa,0xb8,0x68,0xb5,0xb9,0xd6, + 0xf7,0xd8,0x67,0x46,0x45,0x94,0x89,0xf8,0x81,0xd5,0xf6,0xb4, + 0x88,0xb1,0x2a,0x44,0x72,0xd9,0x87,0x66,0xd4,0xf5,0x3a,0xa7, + 0x73,0xa9,0xa8,0x86,0x62,0xc7,0x65,0xc8,0xc9,0xa1,0xf4,0xd1, + 0xe9,0x5a,0x92,0x85,0xa6,0xe7,0x93,0xe8,0xc1,0xc6,0x7a,0x64, + 0xe1,0x4a,0x6a,0xe6,0xb3,0xf1,0xd3,0xa5,0x8a,0xb2,0x9a,0xba, + 0x84,0xa4,0x63,0xe5,0xc5,0xf3,0xd2,0xc4,0x82,0xaa,0xda,0xe4, + 0xf2,0xca,0x83,0xa3,0xa2,0xc3,0xea,0xc2,0xe2,0xe3,0xff,0xff }, + { 0,2,2,1,4,1,4,1,3,3,1,0,0,0,0,140, + 0x02,0x03,0x01,0x04,0x05,0x12,0x11,0x06, + 0x13,0x07,0x08,0x14,0x22,0x09,0x21,0x00,0x23,0x15,0x31,0x32, + 0x0a,0x16,0xf0,0x24,0x33,0x41,0x42,0x19,0x17,0x25,0x18,0x51, + 0x34,0x43,0x52,0x29,0x35,0x61,0x39,0x71,0x62,0x36,0x53,0x26, + 0x38,0x1a,0x37,0x81,0x27,0x91,0x79,0x55,0x45,0x28,0x72,0x59, + 0xa1,0xb1,0x44,0x69,0x54,0x58,0xd1,0xfa,0x57,0xe1,0xf1,0xb9, + 0x49,0x47,0x63,0x6a,0xf9,0x56,0x46,0xa8,0x2a,0x4a,0x78,0x99, + 0x3a,0x75,0x74,0x86,0x65,0xc1,0x76,0xb6,0x96,0xd6,0x89,0x85, + 0xc9,0xf5,0x95,0xb4,0xc7,0xf7,0x8a,0x97,0xb8,0x73,0xb7,0xd8, + 0xd9,0x87,0xa7,0x7a,0x48,0x82,0x84,0xea,0xf4,0xa6,0xc5,0x5a, + 0x94,0xa4,0xc6,0x92,0xc3,0x68,0xb5,0xc8,0xe4,0xe5,0xe6,0xe9, + 0xa2,0xa3,0xe3,0xc2,0x66,0x67,0x93,0xaa,0xd4,0xd5,0xe7,0xf8, + 0x88,0x9a,0xd7,0x77,0xc4,0x64,0xe2,0x98,0xa5,0xca,0xda,0xe8, + 0xf3,0xf6,0xa9,0xb2,0xb3,0xf2,0xd2,0x83,0xba,0xd3,0xff,0xff }, + { 0,0,6,2,1,3,3,2,5,1,2,2,8,10,0,117, + 0x04,0x05,0x03,0x06,0x02,0x07,0x01,0x08, + 0x09,0x12,0x13,0x14,0x11,0x15,0x0a,0x16,0x17,0xf0,0x00,0x22, + 0x21,0x18,0x23,0x19,0x24,0x32,0x31,0x25,0x33,0x38,0x37,0x34, + 0x35,0x36,0x39,0x79,0x57,0x58,0x59,0x28,0x56,0x78,0x27,0x41, + 0x29,0x77,0x26,0x42,0x76,0x99,0x1a,0x55,0x98,0x97,0xf9,0x48, + 0x54,0x96,0x89,0x47,0xb7,0x49,0xfa,0x75,0x68,0xb6,0x67,0x69, + 0xb9,0xb8,0xd8,0x52,0xd7,0x88,0xb5,0x74,0x51,0x46,0xd9,0xf8, + 0x3a,0xd6,0x87,0x45,0x7a,0x95,0xd5,0xf6,0x86,0xb4,0xa9,0x94, + 0x53,0x2a,0xa8,0x43,0xf5,0xf7,0xd4,0x66,0xa7,0x5a,0x44,0x8a, + 0xc9,0xe8,0xc8,0xe7,0x9a,0x6a,0x73,0x4a,0x61,0xc7,0xf4,0xc6, + 0x65,0xe9,0x72,0xe6,0x71,0x91,0x93,0xa6,0xda,0x92,0x85,0x62, + 0xf3,0xc5,0xb2,0xa4,0x84,0xba,0x64,0xa5,0xb3,0xd2,0x81,0xe5, + 0xd3,0xaa,0xc4,0xca,0xf2,0xb1,0xe4,0xd1,0x83,0x63,0xea,0xc3, + 0xe2,0x82,0xf1,0xa3,0xc2,0xa1,0xc1,0xe3,0xa2,0xe1,0xff,0xff } + }; + + if (table > 2) + table = 2; + + _InitDecoder(); + + _MakeDecoder(kFirstTree[table], 0); + fSecondDecode = fFreeDecode; + _MakeDecoder(kSecondTree[table], 0); +} + + +/*! + Return 0 if the image starts with compressed data, + 1 if it starts with uncompressed low-order bits. + + In Canon compressed data, 0xff is always followed by 0x00. + */ +bool +DCRaw::_CanonHasLowBits() +{ + bool hasLowBits = true; + uchar test[0x4000 - 540]; + + fRead.Seek(540, SEEK_SET); + fRead(test, sizeof(test)); + + for (uint32 i = 0; i < sizeof(test) - 1; i++) + if (test[i] == 0xff) { + if (test[i + 1]) + return 1; + hasLowBits = 0; + } + + return hasLowBits; +} + +void +dump_to_disk(void* data, size_t length) +{ + FILE* file = fopen("/tmp/RAW.out", "wb"); + if (file == NULL) + return; + + fwrite(data, length, 1, file); + fclose(file); +} + +void +DCRaw::_LoadRAWCanonCompressed(const image_data_info& image) +{ + uint32 rawWidth = _Raw().width; + int carry = 0, pnum = 0, base[2]; + + _MakeCanonDecoder(image.compression); + + uint16* pixel = (uint16 *)calloc(rawWidth * 8, sizeof(*pixel)); + if (pixel == NULL) + throw (status_t)B_NO_MEMORY; + + bool hasLowBits = _CanonHasLowBits(); + if (!hasLowBits) + fMeta.maximum = 0x3ff; + + fRead.Seek(540 + (hasLowBits ? _Raw().height * rawWidth / 4 : 0), + SEEK_SET); + + fDecodeBitsZeroAfterMax = true; + _InitDecodeBits(); + + for (uint32 row = 0; row < _Raw().height; row += 8) { + for (uint32 block = 0; block < rawWidth >> 3; block++) { + int diffbuf[64]; + memset(diffbuf, 0, sizeof diffbuf); + struct decode* decode = fDecodeBuffer; + + for (uint32 i = 0; i < 64; i++) { + struct decode* dindex = decode; + while (dindex->branch[0]) { + dindex = dindex->branch[_GetDecodeBits(1)]; + } + int leaf = dindex->leaf; + decode = fSecondDecode; + if (leaf == 0 && i) + break; + if (leaf == 0xff) + continue; + i += leaf >> 4; + + int len = leaf & 15; + if (len == 0) + continue; + int diff = _GetDecodeBits(len); + if ((diff & (1 << (len-1))) == 0) + diff -= (1 << len) - 1; + if (i < 64) + diffbuf[i] = diff; + } + + diffbuf[0] += carry; + carry = diffbuf[0]; + + for (uint32 i = 0; i < 64; i++) { + if (pnum++ % _Raw().width == 0) + base[0] = base[1] = 512; + pixel[(block << 6) + i] = (base[i & 1] += diffbuf[i]); + } + } + + if (hasLowBits) { + off_t savedOffset = fRead.Position(); + fRead.Seek(26 + row * _Raw().width / 4, SEEK_SET); + + uint16* pixelRow = pixel; + for (uint32 i = 0; i < rawWidth * 2; i++) { + uint8 c = fRead.Next(); + + for (uint32 r = 0; r < 8; r += 2, pixelRow++) { + uint32 val = (*pixelRow << 2) + ((c >> r) & 3); + if (rawWidth == 2672 && val < 512) + val += 2; + *pixelRow = val; + } + } + + fRead.Seek(savedOffset, SEEK_SET); + } + + for (uint32 r = 0; r < 8; r++) { + uint32 irow = row - fTopMargin + r; + if (irow >= fInputHeight) + continue; + + for (uint32 col = 0; col < rawWidth; col++) { + uint32 icol = col - fLeftMargin; + if (icol < fInputWidth) + _Bayer(icol, irow) = pixel[r * rawWidth + col]; + else + fMeta.black += pixel[r * rawWidth + col]; + } + } + } + + free(pixel); + + if (rawWidth > fInputWidth) + fMeta.black /= (rawWidth - fInputWidth) * fInputHeight; +} + + +void +DCRaw::_LoadRAWLosslessJPEG(const image_data_info& image) +{ + int jwide, jrow, jcol, val, jidx, i, j, row = 0, col = 0; + uint32 rawWidth = _Raw().width; + int min = INT_MAX; + + struct jhead jh; + if (_LosslessJPEGInit(&jh, false) != B_OK) + throw (status_t)B_NO_TRANSLATOR; + + jwide = jh.wide * jh.clrs; + + for (jrow = 0; jrow < jh.high; jrow++) { + _LosslessJPEGRow(&jh, jrow); + + for (jcol = 0; jcol < jwide; jcol++) { + val = jh.row[jcol]; + if (jh.bits <= 12) + val = fCurve[val]; + + if (fCR2Slice[0]) { + jidx = jrow * jwide + jcol; + i = jidx / (fCR2Slice[1] * jh.high); + if ((j = i >= fCR2Slice[0])) + i = fCR2Slice[0]; + jidx -= i * (fCR2Slice[1] * jh.high); + row = jidx / fCR2Slice[1 + j]; + col = jidx % fCR2Slice[1 + j] + i * fCR2Slice[1]; + } + + if (_Raw().width == 3984 && (col -= 2) < 0) { + col += rawWidth; + row--; + } + + if (uint32(row - fTopMargin) < fInputHeight) { + if (uint32(col - fLeftMargin) < fInputWidth) { + _Bayer(col - fLeftMargin, row - fTopMargin) = val; + if (min > val) + min = val; + } else + fMeta.black += val; + } + if (++col >= (int32)rawWidth) { + col = 0; + row++; + } + } + } + + dump_to_disk(fImageData, fInputWidth * fColors * 100); + free(jh.row); + + if (rawWidth > fInputWidth) + fMeta.black /= (rawWidth - fInputWidth) * fInputHeight; + if (_IsKodak()) + fMeta.black = min; +} + + +void +DCRaw::_LoadRAW(const image_data_info& image) +{ + if (_IsCanon()) { + if (fIsTIFF) + _LoadRAWLosslessJPEG(image); + else + _LoadRAWCanonCompressed(image); + } else { + switch (image.compression) { + case 32773: + _LoadRAWPacked12(image); + break; + + default: + printf("unknown compression: %ld\n", image.compression); + throw (status_t)B_NO_TRANSLATOR; + break; + } + } +} + + // #pragma mark - Image writers @@ -1899,6 +2400,9 @@ int32 colStep = _FlipIndex(0, 1, image.flip) - sourceOffset; int32 rowStep = _FlipIndex(1, 0, image.flip) - _FlipIndex(0, fOutputWidth, image.flip); + TRACE(("flip = %ld, sourceOffset = %ld, colStep = %ld, rowStep = %ld, input: %lu x %lu, output: %lu x %lu\n", + image.flip, sourceOffset, colStep, rowStep, fInputWidth, fInputHeight, fOutputWidth, fOutputHeight)); + if (fOutputBitsPerSample == 8) { for (uint32 row = 0; row < fOutputHeight; row++, sourceOffset += rowStep) { for (uint32 col = 0; col < fOutputWidth; col++, sourceOffset += colStep) { @@ -2050,7 +2554,6 @@ uint16 tags; fRead(tags); -//printf("%u tags in file\n", tags); if (tags > 512) return B_BAD_DATA; @@ -2060,12 +2563,14 @@ off_t nextOffset; tiff_tag tag; _ParseTIFFTag(baseOffset, tag, nextOffset); + TAG(("TIFF tag: %u\n", tag.tag)); -//printf("got tag: %u\n", tag.tag); switch (tag.tag) { +#if 0 default: - //printf("tag %ld NOT HANDLED!\n", tag.tag); + printf("tag %u NOT HANDLED!\n", tag.tag); break; +#endif case 17: case 18: @@ -2378,12 +2883,10 @@ break; #endif -#if 0 case 291: // Linearization Table case 50712: - linear_table(tag.length); + _ParseLinearTable(tag.length); break; -#endif case 50714: /* BlackLevel */ case 50715: /* BlackLevelDeltaH */ @@ -2449,10 +2952,11 @@ fseek (ifp, j, SEEK_SET); parse_tiff_ifd (base); break; - case 50752: - read_shorts (cr2_slice, 3); - break; #endif + case 50752: + fRead.NextShorts(fCR2Slice, 3); + break; + case 50829: // Active Area fTopMargin = fRead.Next(tag.type); fLeftMargin = fRead.Next(tag.type); @@ -2564,6 +3068,7 @@ // but may vary for RAW images _ParseTIFFImageFileDirectory(baseOffset); + fIsTIFF = true; uint32 maxSamples = 0; @@ -2682,20 +3187,15 @@ // brush up some variables for later use + fInputWidth = _Raw().width; + fInputHeight = _Raw().height; + + _FixupValues(); + if ((_Raw().width | _Raw().height) < 0) _Raw().width = _Raw().height = 0; if (fMeta.maximum == 0) fMeta.maximum = (1 << _Raw().bits_per_sample) - 1; - if (fInputWidth == 0) - fInputWidth = _Raw().width; - if (fInputHeight == 0) - fInputHeight = _Raw().height; - - if (fInputWidth == 3936 && fInputHeight == 2624) { - // Pentax K10D and Samsumg GX10 - fInputWidth = 3896; - fInputHeight = 2616; - } if (fFilters == ~0UL) fFilters = 0x94949494; @@ -2755,19 +3255,19 @@ image_data_info& image = fImages[index]; fShrink = (fHalfSize || fThreshold) && fFilters; - fOutputWidth = (image.width + fShrink) >> fShrink; - fOutputHeight = (image.height + fShrink) >> fShrink; + fOutputWidth = (fInputWidth + fShrink) >> fShrink; + fOutputHeight = (fInputHeight + fShrink) >> fShrink; image.output_width = fOutputWidth; image.output_height = fOutputHeight; - if (image.is_raw) + if (image.is_raw) { bufferSize = fOutputWidth * 4 * fOutputHeight; fImageData = (uint16 (*)[4])calloc(fOutputWidth * fOutputHeight * sizeof(*fImageData) + 0, 1); //meta_length, 1); if (fImageData == NULL) throw (status_t)B_NO_MEMORY; - else { + } else { bufferSize = image.bytes + sizeof(tiff_header) + 10; // TIFF header plus EXIF identifier } @@ -2779,16 +3279,8 @@ fRead.Seek(image.data_offset, SEEK_SET); if (image.is_raw) { - switch (image.compression) { - case 32773: - _LoadRAWPacked12(); - break; + _LoadRAW(image); - default: - printf("unknown compression: %ld\n", image.compression); - break; - } - //bad_pixels(); //if (dark_frame) subtract (dark_frame); //quality = 2 + !fuji_width; @@ -2825,8 +3317,6 @@ _WriteJPEG(image, outputBuffer); } - bufferSize = fOutputWidth * 4 * fOutputHeight; - return B_OK; } Modified: haiku/trunk/src/add-ons/translators/raw/RAW.h =================================================================== --- haiku/trunk/src/add-ons/translators/raw/RAW.h 2007-03-23 12:36:24 UTC (rev 20408) +++ haiku/trunk/src/add-ons/translators/raw/RAW.h 2007-03-23 15:30:44 UTC (rev 20409) @@ -71,6 +71,11 @@ uint16& _Bayer(int32 column, int32 row); int32 _FilterCoefficient(int32 column, int32 row); int32 _FlipIndex(uint32 row, uint32 col, uint32 flip); + bool _IsCanon() const; + bool _IsKodak() const; + bool _IsNikon() const; + bool _IsPentax() const; + bool _IsSamsung() const; // image manipulation and conversion void _ScaleColors(); @@ -88,6 +93,8 @@ void _ParseThumbTag(off_t baseOffset, uint32 offsetTag, uint32 lengthTag); void _ParseManufacturerTag(off_t baseOffset); void _ParseEXIF(off_t baseOffset); + void _ParseLinearTable(uint32 length); + void _FixupValues(); // Lossless JPEG void _InitDecoder(); @@ -99,7 +106,12 @@ void _LosslessJPEGRow(struct jhead *jh, int jrow); // RAW Loader - void _LoadRAWPacked12(); + void _LoadRAWPacked12(const image_data_info& info); + void _MakeCanonDecoder(uint32 table); + bool _CanonHasLowBits(); + void _LoadRAWCanonCompressed(const image_data_info& info); + void _LoadRAWLosslessJPEG(const image_data_info& image); + void _LoadRAW(const image_data_info& info); // Image writers void _WriteJPEG(image_data_info& image, uint8* outputBuffer); @@ -120,6 +132,7 @@ int32 fRawIndex; int32 fThumbIndex; uint32 fDNGVersion; + bool fIsTIFF; uint16 (*fImageData)[4]; // output image data @@ -144,6 +157,8 @@ uint32 fColors; uint16 fWhite[8][8]; float fUserMultipliers[4]; + uint16* fCurve; + uint16 fCR2Slice[3]; uint32* fOutputProfile; uint32 fOutputBitsPerSample; int32 (*fHistogram)[4]; Modified: haiku/trunk/src/add-ons/translators/raw/ReadHelper.h =================================================================== --- haiku/trunk/src/add-ons/translators/raw/ReadHelper.h 2007-03-23 12:36:24 UTC (rev 20408) +++ haiku/trunk/src/add-ons/translators/raw/ReadHelper.h 2007-03-23 15:30:44 UTC (rev 20409) @@ -157,6 +157,22 @@ } } + inline void + NextShorts(uint16* data, size_t length) + { + fError = fStream.Read(data, length); + if (fError < (ssize_t)length) + fError = B_ERROR; + + if (fError >= B_OK) { + if (IsSwapping()) + swap_data(B_INT16_TYPE, data, length, B_SWAP_ALWAYS); + return; + } + + throw fError; + } + status_t Status() { return fError >= B_OK ? B_OK : fError; }; Modified: haiku/trunk/src/add-ons/translators/raw/main.cpp =================================================================== --- haiku/trunk/src/add-ons/translators/raw/main.cpp 2007-03-23 12:36:24 UTC (rev 20408) +++ haiku/trunk/src/add-ons/translators/raw/main.cpp 2007-03-23 15:30:44 UTC (rev 20409) @@ -10,8 +10,9 @@ #include -#define TEST_MODE 0 -#if TEST_MODE +#define TEST_MODE 1 +#define SHOW_MODE 1 +#if SHOW_MODE # include # include # include @@ -84,7 +85,8 @@ printf(" [%ld] %s %lu x %lu (%ld bits per sample, compression %ld)\n", i, data.is_raw ? "RAW " : "JPEG", data.width, data.height, data.bits_per_sample, data.compression); - + +#if SHOW_MODE if (!data.is_raw) { // write data to file uint8* buffer; @@ -130,6 +132,7 @@ wait_for_thread(window->Thread(), &status); } } +#endif } } return 0; From korli at mail.berlios.de Fri Mar 23 20:02:00 2007 From: korli at mail.berlios.de (korli at BerliOS) Date: Fri, 23 Mar 2007 20:02:00 +0100 Subject: [Haiku-commits] r20410 - haiku/trunk/src/apps/expander Message-ID: <200703231902.l2NJ20fW024182@sheep.berlios.de> Author: korli Date: 2007-03-23 20:01:59 +0100 (Fri, 23 Mar 2007) New Revision: 20410 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20410&view=rev Modified: haiku/trunk/src/apps/expander/DirectoryFilePanel.cpp Log: resize button only for width fix bug #766 Modified: haiku/trunk/src/apps/expander/DirectoryFilePanel.cpp =================================================================== --- haiku/trunk/src/apps/expander/DirectoryFilePanel.cpp 2007-03-23 15:30:44 UTC (rev 20409) +++ haiku/trunk/src/apps/expander/DirectoryFilePanel.cpp 2007-03-23 19:01:59 UTC (rev 20410) @@ -60,11 +60,13 @@ rect.top = rect.bottom - 35; rect.bottom -= 10; } - + + rect.right = rect.left -= 30; + float directory_width = be_plain_font->StringWidth("Select current") + 20; + rect.left = (directory_width > 75) ? (rect.right - directory_width) : (rect.right - 75); fCurrentButton = new BButton(rect, "directoryButton", "Select current", new BMessage(MSG_DIRECTORY), B_FOLLOW_RIGHT | B_FOLLOW_BOTTOM); - fCurrentButton->ResizeToPreferred(); - fCurrentButton->MoveBy(-fCurrentButton->Bounds().Width() - 30, 0); + background->AddChild(fCurrentButton); fCurrentButton->SetTarget(Messenger()); @@ -96,14 +98,14 @@ Window()->GetSizeLimits(&maxWidth, &dummy, &dummy, &dummy); maxWidth -= Window()->Bounds().Width() + 8 - fCurrentButton->Frame().right; - float oldWidth = fCurrentButton->Bounds().Width(); + BRect oldBounds = fCurrentButton->Bounds(); fCurrentButton->SetLabel(label); float width, height; fCurrentButton->GetPreferredSize(&width, &height); if (width > maxWidth) width = maxWidth; - fCurrentButton->ResizeTo(width, height); - fCurrentButton->MoveBy(oldWidth - width, 0); + fCurrentButton->ResizeTo(width, oldBounds.Height()); + fCurrentButton->MoveBy(oldBounds.Width() - width, 0); Window()->Unlock(); From korli at mail.berlios.de Fri Mar 23 20:08:11 2007 From: korli at mail.berlios.de (korli at BerliOS) Date: Fri, 23 Mar 2007 20:08:11 +0100 Subject: [Haiku-commits] r20411 - haiku/trunk/build/jam Message-ID: <200703231908.l2NJ8BUM024645@sheep.berlios.de> Author: korli Date: 2007-03-23 20:08:10 +0100 (Fri, 23 Mar 2007) New Revision: 20411 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20411&view=rev Modified: haiku/trunk/build/jam/HaikuImage Log: added make and tr Modified: haiku/trunk/build/jam/HaikuImage =================================================================== --- haiku/trunk/build/jam/HaikuImage 2007-03-23 19:01:59 UTC (rev 20410) +++ haiku/trunk/build/jam/HaikuImage 2007-03-23 19:08:10 UTC (rev 20411) @@ -25,12 +25,12 @@ dstcheck du echo eject env error expr factor false fdinfo ffm find finddir fortune ftp funzip gawk $(X86_ONLY)gdb grep groups gzip head hey id ideinfo idestatus ifconfig iroster isvolume join keymap kill less lessecho lesskey link listarea listattr listdev listimage - listport listres listsem ln locate logger logname ls lsindex makebootable md5sum mimeset + listport listres listsem ln locate logger logname ls lsindex make makebootable md5sum mimeset mkdos mkdir mkindex modifiers mount mount_nfs mountvolume mv netstat open pathchk ping play playfile playsound playwav ps pwd query quit release renice rescan rm rmattr rmindex rmdir roster route safemode screen_blanker sed settype setversion setvolume sh shutdown sleep sort split strace su sum sync sysinfo - tail tar tcpdump tee telnet test top touch tput traceroute translate true tty uname unmount unrar unzip + tail tar tcpdump tee telnet test top touch tput tr traceroute translate true tty uname unmount unrar unzip unzipsfx uptime usb_dev_info version vim waitfor wc wget whoami xargs xres yes zdiff zforce zgrep zip zipcloak zipnote zipsplit zmore znew ; From axeld at mail.berlios.de Fri Mar 23 21:40:04 2007 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Fri, 23 Mar 2007 21:40:04 +0100 Subject: [Haiku-commits] r20412 - haiku/trunk/src/system/kernel/fs Message-ID: <200703232040.l2NKe4B6030179@sheep.berlios.de> Author: axeld Date: 2007-03-23 21:40:03 +0100 (Fri, 23 Mar 2007) New Revision: 20412 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20412&view=rev Modified: haiku/trunk/src/system/kernel/fs/vfs_select.cpp Log: select() is supposed to clear the sets in case of B_TIMED_OUT - found and patch by Hugo Santos - thanks! Modified: haiku/trunk/src/system/kernel/fs/vfs_select.cpp =================================================================== --- haiku/trunk/src/system/kernel/fs/vfs_select.cpp 2007-03-23 19:08:10 UTC (rev 20411) +++ haiku/trunk/src/system/kernel/fs/vfs_select.cpp 2007-03-23 20:40:03 UTC (rev 20412) @@ -183,9 +183,16 @@ } } break; + case B_INTERRUPTED: count = B_INTERRUPTED; break; + + case B_TIMED_OUT: + fd_zero(readSet, numfds); + fd_zero(writeSet, numfds); + fd_zero(errorSet, numfds); + // supposed to fall through default: // B_TIMED_OUT, and B_WOULD_BLOCK count = 0; From bonefish at mail.berlios.de Fri Mar 23 22:19:05 2007 From: bonefish at mail.berlios.de (bonefish at BerliOS) Date: Fri, 23 Mar 2007 22:19:05 +0100 Subject: [Haiku-commits] r20413 - haiku/trunk/src/system/kernel/fs Message-ID: <200703232119.l2NLJ5oF001731@sheep.berlios.de> Author: bonefish Date: 2007-03-23 22:19:02 +0100 (Fri, 23 Mar 2007) New Revision: 20413 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20413&view=rev Modified: haiku/trunk/src/system/kernel/fs/vfs.cpp Log: * The close-on-exit bitmap vfs_new_io_context() created was a byte short, if the FD table size wasn't a multiple of 8. * vfs_resize_fd_table() didn't seem to know at all about the close-on-exit bitmap. The pointer in the io_context would point to free()d memory afterwards. This explains the sporadically closed stdin/out/err descriptors in programs started from Tracker and Deskbar. Modified: haiku/trunk/src/system/kernel/fs/vfs.cpp =================================================================== --- haiku/trunk/src/system/kernel/fs/vfs.cpp 2007-03-23 20:40:03 UTC (rev 20412) +++ haiku/trunk/src/system/kernel/fs/vfs.cpp 2007-03-23 21:19:02 UTC (rev 20413) @@ -3244,14 +3244,14 @@ // allocate space for FDs and their close-on-exec flag context->fds = (file_descriptor **)malloc(sizeof(struct file_descriptor *) * tableSize - + tableSize / 8); + + (tableSize + 7) / 8); if (context->fds == NULL) { free(context); return NULL; } memset(context->fds, 0, sizeof(struct file_descriptor *) * tableSize - + tableSize / 8); + + (tableSize + 7) / 8); context->fds_close_on_exec = (uint8 *)(context->fds + tableSize); if (mutex_init(&context->io_mutex, "I/O context") < 0) { @@ -3330,7 +3330,7 @@ static status_t vfs_resize_fd_table(struct io_context *context, const int newSize) { - void *fds; + struct file_descriptor **fds; int status = B_OK; if (newSize <= 0 || newSize > MAX_FD_TABLE_SIZE) @@ -3338,42 +3338,57 @@ mutex_lock(&context->io_mutex); - if ((size_t)newSize < context->table_size) { + int oldSize = context->table_size; + int oldCloseOnExitBitmapSize = (oldSize + 7) / 8; + int newCloseOnExitBitmapSize = (newSize + 7) / 8; + + if (newSize < oldSize) { // shrink the fd table - int i; // Make sure none of the fds being dropped are in use - for(i = context->table_size; i-- > newSize;) { + for (int i = oldSize; i-- > newSize;) { if (context->fds[i]) { status = EBUSY; goto out; } } - fds = malloc(sizeof(struct file_descriptor *) * newSize); + fds = (struct file_descriptor **)malloc( + sizeof(struct file_descriptor *) * newSize + + newCloseOnExitBitmapSize); if (fds == NULL) { status = ENOMEM; goto out; } memcpy(fds, context->fds, sizeof(struct file_descriptor *) * newSize); + + // copy close-on-exit bitmap + memcpy(fds + newSize, context->fds + oldSize, newCloseOnExitBitmapSize); } else { // enlarge the fd table - fds = malloc(sizeof(struct file_descriptor *) * newSize); + fds = (struct file_descriptor **)malloc( + sizeof(struct file_descriptor *) * newSize + + newCloseOnExitBitmapSize); if (fds == NULL) { status = ENOMEM; goto out; } // copy the fd array, and zero the additional slots - memcpy(fds, context->fds, sizeof(void *) * context->table_size); - memset((char *)fds + (sizeof(void *) * context->table_size), 0, - sizeof(void *) * (newSize - context->table_size)); + memcpy(fds, context->fds, sizeof(void *) * oldSize); + memset(fds + oldSize, 0, sizeof(void *) * (newSize - oldSize)); + + // copy close-on-exit bitmap, and zero out additional bytes + memcpy(fds + newSize, context->fds + oldSize, oldCloseOnExitBitmapSize); + memset((uint8*)(fds + newSize) + oldCloseOnExitBitmapSize, 0, + newCloseOnExitBitmapSize - oldCloseOnExitBitmapSize); } free(context->fds); - context->fds = (file_descriptor **)fds; + context->fds = fds; + context->fds_close_on_exec = (uint8 *)(context->fds + newSize); context->table_size = newSize; out: From bonefish at mail.berlios.de Fri Mar 23 22:52:49 2007 From: bonefish at mail.berlios.de (bonefish at BerliOS) Date: Fri, 23 Mar 2007 22:52:49 +0100 Subject: [Haiku-commits] r20414 - haiku/trunk/src/bin/strace Message-ID: <200703232152.l2NLqnte010537@sheep.berlios.de> Author: bonefish Date: 2007-03-23 22:52:48 +0100 (Fri, 23 Mar 2007) New Revision: 20414 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20414&view=rev Modified: haiku/trunk/src/bin/strace/TypeHandler.cpp haiku/trunk/src/bin/strace/TypeHandler.h Log: Support for printing fd_sets. Patch by Hugo Santos. Modified: haiku/trunk/src/bin/strace/TypeHandler.cpp =================================================================== --- haiku/trunk/src/bin/strace/TypeHandler.cpp 2007-03-23 21:19:02 UTC (rev 20413) +++ haiku/trunk/src/bin/strace/TypeHandler.cpp 2007-03-23 21:52:48 UTC (rev 20414) @@ -1,6 +1,10 @@ /* - * Copyright 2005, Ingo Weinhold, bonefish at users.sf.net. + * Copyright 2005-2007, Haiku Inc. All rights reserved. * Distributed under the terms of the MIT License. + * + * Authors: + * Ingo Weinhold + * Hugo Santos */ #include "MemoryReader.h" @@ -78,7 +82,13 @@ return new TypeHandlerImpl(); } +TypeHandler * +create_fdset_type_handler() +{ + return new TypeHandlerImpl(); +} + // #pragma mark - // complete specializations @@ -377,6 +387,43 @@ return get_pointer_value(&data) + " (" + strerror(error) + ")"; } +static string +read_fdset(MemoryReader &reader, void *data) +{ + /* default FD_SETSIZE is 1024 */ + unsigned long tmp[1024 / (sizeof(unsigned long) * 8)]; + int32 bytesRead; + + status_t err = reader.Read(data, &tmp, sizeof(tmp), bytesRead); + if (err != B_OK) + return get_pointer_value(&data); + + /* implicitly align to unsigned long lower boundary */ + int count = bytesRead / sizeof(unsigned long); + int added = 0; + + string r = "["; + + for (int i = 0; i < count && added < 8; i++) { + for (int j = 0; + j < (int)(sizeof(unsigned long) * 8) && added < 8; j++) { + if (tmp[i] & (1 << j)) { + if (added > 0) + r += ", "; + r += get_number_value( + i * (sizeof(unsigned long) * 8) + j, + "%u"); + added++; + } + } + } + + if (added >= 8) + r += " ..."; + + return r + "]"; +} + // const void* template<> string @@ -419,3 +466,26 @@ return get_pointer_value(&data); } +// struct fd_set * +template<> +string +TypeHandlerImpl::GetParameterValue(const void *address, + bool getContents, MemoryReader &reader) +{ + void *data = *(void **)address; + if (getContents && data) + return read_fdset(reader, data); + return get_pointer_value(&data); +} + +template<> +string +TypeHandlerImpl::GetReturnValue(uint64 value, + bool getContents, MemoryReader &reader) +{ + void *data = (void *)value; + if (getContents && data) + return read_fdset(reader, data); + + return get_pointer_value(&data); +} Modified: haiku/trunk/src/bin/strace/TypeHandler.h =================================================================== --- haiku/trunk/src/bin/strace/TypeHandler.h 2007-03-23 21:19:02 UTC (rev 20413) +++ haiku/trunk/src/bin/strace/TypeHandler.h 2007-03-23 21:52:48 UTC (rev 20414) @@ -1,6 +1,10 @@ /* - * Copyright 2005, Ingo Weinhold, bonefish at users.sf.net. + * Copyright 2005-2007, Haiku Inc. All rights reserved. * Distributed under the terms of the MIT License. + * + * Authors: + * Ingo Weinhold + * Hugo Santos */ #ifndef STRACE_TYPE_HANDLER_H #define STRACE_TYPE_HANDLER_H @@ -40,6 +44,7 @@ extern TypeHandler *create_pointer_type_handler(); extern TypeHandler *create_string_type_handler(); +extern TypeHandler *create_fdset_type_handler(); // specialization for "const char*" template<> @@ -50,6 +55,15 @@ } }; +// specialization for 'struct fdset *' +template<> +struct TypeHandlerFactory { + static inline TypeHandler *Create() + { + return create_fdset_type_handler(); + } +}; + // partial specialization for generic pointers template struct TypeHandlerFactory { From bonefish at mail.berlios.de Sun Mar 25 00:34:29 2007 From: bonefish at mail.berlios.de (bonefish at BerliOS) Date: Sun, 25 Mar 2007 00:34:29 +0100 Subject: [Haiku-commits] r20415 - in haiku/trunk/build: jam scripts Message-ID: <200703242334.l2ONYTkd029032@sheep.berlios.de> Author: bonefish Date: 2007-03-25 00:34:28 +0100 (Sun, 25 Mar 2007) New Revision: 20415 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=20415&view=rev Modified: haiku/trunk/build/jam/HaikuImage haiku/trunk/build/jam/ImageRules haiku/trunk/build/jam/UserBuildConfig.sample haiku/trunk/build/scripts/build_haiku_image Log: * Modified AddVariableToScript to support multi-element arrays. * Added rule AddSourceDirectoryToHaikuImage to copy source directories onto the image. They will be placed in /boot/home/HaikuSource/... according to their relative path. This should make it a bit more comfortable to use gdb as a source level debugger. Alas, the directories have to be made known to gdb individually (with the "directory" command). I guess we should update to 6.6... Modified: haiku/trunk/build/jam/HaikuImage =================================================================== --- haiku/trunk/build/jam/HaikuImage 2007-03-23 21:52:48 UTC (rev 20414) +++ haiku/trunk/build/jam/HaikuImage 2007-03-24 23:34:28 UTC (rev 20415) @@ -336,6 +336,7 @@ # causes a cyclic dependency AddVariableToScript $(script) : imagePath : [ FDirName $(HAIKU_IMAGE_DIR) $(HAIKU_IMAGE_NAME) ] ; +AddVariableToScript $(script) : sourceDirsToCopy : $(HAIKU_INSTALL_SOURCE_DIRS) ; # create the other scripts HAIKU_IMAGE_MAKE_DIRS_SCRIPT = haiku.image-make-dirs ; Modified: haiku/trunk/build/jam/ImageRules =================================================================== --- haiku/trunk/build/jam/ImageRules 2007-03-23 21:52:48 UTC (rev 20414) +++ haiku/trunk/build/jam/ImageRules 2007-03-24 23:34:28 UTC (rev 20415) @@ -41,18 +41,27 @@ echo -n > $(1) } -rule AddVariableToScript +rule AddVariableToScript script : variable : value { # AddVariableToScript