// LateNoticeReceived void VideoProducer::LateNoticeReceived(const media_source &source, bigtime_t how_much, bigtime_t performance_time) { TOUCH(source); TOUCH(how_much); TOUCH(performance_time); ldebug("Late!!!\n"); }
void VideoProducer::LatencyChanged(const media_source &source, const media_destination &destination, bigtime_t new_latency, uint32 flags) { TOUCH(source); TOUCH(destination); TOUCH(new_latency); TOUCH(flags); }
void VideoProducer::AdditionalBufferRequested(const media_source& source, media_buffer_id prevBuffer, bigtime_t prevTime, const media_seek_tag* prevTag) { TOUCH(source); TOUCH(prevBuffer); TOUCH(prevTime); TOUCH(prevTag); }
// HandleEvent void VideoProducer::HandleEvent(const media_timed_event *event, bigtime_t lateness, bool realTimeEvent) { TOUCH(lateness); TOUCH(realTimeEvent); switch(event->type) { case BTimedEventQueue::B_START: ldebug("VideoProducer::HandleEvent(B_START)\n"); _HandleStart(event->event_time); ldebug("VideoProducer::HandleEvent(B_START) done\n"); break; case BTimedEventQueue::B_STOP: ldebug("VideoProducer::HandleEvent(B_STOP)\n"); _HandleStop(); ldebug("VideoProducer::HandleEvent(B_STOP) done\n"); break; case BTimedEventQueue::B_WARP: _HandleTimeWarp(event->bigdata); break; case BTimedEventQueue::B_SEEK: _HandleSeek(event->bigdata); break; case BTimedEventQueue::B_HANDLE_BUFFER: case BTimedEventQueue::B_DATA_STATUS: case BTimedEventQueue::B_PARAMETER: default: PRINTF(-1, ("HandleEvent: Unhandled event -- %lx\n", event->type)); break; } }
// SetPlayRate status_t VideoProducer::SetPlayRate(int32 numer, int32 denom) { TOUCH(numer); TOUCH(denom); return B_ERROR; }
status_t VideoProducer::SetBufferGroup(const media_source &for_source, BBufferGroup *group) { TOUCH(for_source); TOUCH(group); return B_ERROR; }
status_t VideoProducer::VideoClippingChanged(const media_source& forSource, int16 numShorts, int16* clipData, const media_video_display_info& display, int32* _deprecated_) { TOUCH(forSource); TOUCH(numShorts); TOUCH(clipData); TOUCH(display); TOUCH(_deprecated_); return B_ERROR; }
status_t VideoProducer::FormatChangeRequested(const media_source &source, const media_destination &destination, media_format *io_format, int32 *_deprecated_) { TOUCH(destination); TOUCH(io_format); TOUCH(_deprecated_); if (source != fOutput.source) return B_MEDIA_BAD_SOURCE; return B_ERROR; }
int nfs_removevnode(fs_cookie fs, fs_vnode _v, bool r) { nfs_fs *nfs = (nfs_fs *)fs; nfs_vnode *v = (nfs_vnode *)_v; TOUCH(nfs);TOUCH(v); TRACE("nfs_removevnode: fsid 0x%x, vnid 0x%Lx\n", nfs->id, VNODETOVNID(v)); return ERR_UNIMPLEMENTED; }
int nfs_wstat(fs_cookie fs, fs_vnode _v, struct file_stat *stat, int stat_mask) { nfs_fs *nfs = (nfs_fs *)fs; nfs_vnode *v = (nfs_vnode *)_v; TOUCH(nfs);TOUCH(v); TRACE("nfs_wstat: fsid 0x%x, vnid 0x%Lx, stat %p, stat_mask 0x%x\n", nfs->id, VNODETOVNID(v), stat, stat_mask); return ERR_UNIMPLEMENTED; }
int nfs_fsync(fs_cookie fs, fs_vnode _v) { nfs_fs *nfs = (nfs_fs *)fs; nfs_vnode *v = (nfs_vnode *)_v; TOUCH(nfs);TOUCH(v); TRACE("nfs_fsync: fsid 0x%x, vnid 0x%Lx\n", nfs->id, VNODETOVNID(v)); return NO_ERROR; }
int nfs_ioctl(fs_cookie fs, fs_vnode _v, file_cookie cookie, int op, void *buf, size_t len) { nfs_fs *nfs = (nfs_fs *)fs; nfs_vnode *v = (nfs_vnode *)_v; TOUCH(nfs);TOUCH(v); TRACE("nfs_ioctl: fsid 0x%x, vnid 0x%Lx, op %d, buf %p, len %ld\n", nfs->id, VNODETOVNID(v), op, buf, len); return ERR_UNIMPLEMENTED; }
int nfs_rename(fs_cookie fs, fs_vnode _olddir, const char *oldname, fs_vnode _newdir, const char *newname) { nfs_fs *nfs = (nfs_fs *)fs; nfs_vnode *olddir = (nfs_vnode *)_olddir; nfs_vnode *newdir = (nfs_vnode *)_newdir; TOUCH(nfs);TOUCH(olddir);TOUCH(newdir); TRACE("nfs_rename: fsid 0x%x, vnid 0x%Lx, oldname '%s', newdir 0x%Lx, newname '%s'\n", nfs->id, VNODETOVNID(olddir), oldname, VNODETOVNID(newdir), newname); return ERR_UNIMPLEMENTED; }
status_t packagefs_rewind_attr_dir(fs_volume* fsVolume, fs_vnode* fsNode, void* _cookie) { Volume* volume = (Volume*)fsVolume->private_volume; Node* node = (Node*)fsNode->private_node; AttributeDirectoryCookie* cookie = (AttributeDirectoryCookie*)_cookie; FUNCTION("volume: %p, node: %p (%" B_PRId64 "), cookie: %p\n", volume, node, node->ID(), cookie); TOUCH(volume); TOUCH(node); return cookie->Rewind(); }
int nfs_close(fs_cookie fs, fs_vnode _v, file_cookie _cookie) { nfs_fs *nfs = (nfs_fs *)fs; nfs_vnode *v = (nfs_vnode *)_v; TOUCH(nfs);TOUCH(v); TRACE("nfs_close: fsid 0x%x, vnid 0x%Lx\n", nfs->id, VNODETOVNID(v)); if(v->st == STREAM_TYPE_DIR) return ERR_VFS_IS_DIR; return NO_ERROR; }
ssize_t nfs_writepage(fs_cookie fs, fs_vnode _v, iovecs *vecs, off_t pos) { nfs_fs *nfs = (nfs_fs *)fs; nfs_vnode *v = (nfs_vnode *)_v; TOUCH(nfs);TOUCH(v); TRACE("nfs_writepage: fsid 0x%x, vnid 0x%Lx, vecs %p, pos 0x%Lx\n", nfs->id, VNODETOVNID(v), vecs, pos); if(v->st == STREAM_TYPE_DIR) return ERR_VFS_IS_DIR; return ERR_UNIMPLEMENTED; }
int nfs_canpage(fs_cookie fs, fs_vnode _v) { nfs_fs *nfs = (nfs_fs *)fs; nfs_vnode *v = (nfs_vnode *)_v; TOUCH(nfs);TOUCH(v); TRACE("nfs_canpage: fsid 0x%x, vnid 0x%Lx\n", nfs->id, VNODETOVNID(v)); if(v->st == STREAM_TYPE_FILE) return 1; else return 0; }
status_t packagefs_read_attr_dir(fs_volume* fsVolume, fs_vnode* fsNode, void* _cookie, struct dirent* buffer, size_t bufferSize, uint32* _count) { Volume* volume = (Volume*)fsVolume->private_volume; Node* node = (Node*)fsNode->private_node; AttributeDirectoryCookie* cookie = (AttributeDirectoryCookie*)_cookie; FUNCTION("volume: %p, node: %p (%" B_PRId64 "), cookie: %p\n", volume, node, node->ID(), cookie); TOUCH(volume); TOUCH(node); return cookie->Read(volume->ID(), node->ID(), buffer, bufferSize, _count); }
status_t packagefs_read_attr(fs_volume* fsVolume, fs_vnode* fsNode, void* _cookie, off_t offset, void* buffer, size_t* bufferSize) { Volume* volume = (Volume*)fsVolume->private_volume; Node* node = (Node*)fsNode->private_node; AttributeCookie* cookie = (AttributeCookie*)_cookie; FUNCTION("volume: %p, node: %p (%" B_PRId64 "), cookie: %p\n", volume, node, node->ID(), cookie); TOUCH(volume); TOUCH(node); return cookie->ReadAttribute(offset, buffer, bufferSize); }
status_t packagefs_read_attr_stat(fs_volume* fsVolume, fs_vnode* fsNode, void* _cookie, struct stat* st) { Volume* volume = (Volume*)fsVolume->private_volume; Node* node = (Node*)fsNode->private_node; AttributeCookie* cookie = (AttributeCookie*)_cookie; FUNCTION("volume: %p, node: %p (%" B_PRId64 "), cookie: %p\n", volume, node, node->ID(), cookie); TOUCH(volume); TOUCH(node); return cookie->ReadAttributeStat(st); }
status_t dosfs_rewind_attrdir(fs_volume *_vol, fs_vnode *_node, void *_cookie) { TOUCH(_vol); TOUCH(_node); DPRINTF(0, ("dosfs_rewind_attrdir called\n")); if (_cookie == NULL) { dprintf("error: dosfs_rewind_attrcookie called with null cookie\n"); return EINVAL; } *(uint32 *)_cookie = 0; return 0; }
// DisposeOutputCookie status_t VideoProducer::DisposeOutputCookie(int32 cookie) { TOUCH(cookie); return B_OK; }
/* Compute TSP for the tree t -- use conquer for problems <= sz */ Tree tsp(Tree t,int sz,int nproc) { Tree left,right; Tree leftval; #ifdef FUTURES future_cell_pointer fc; #endif Tree rightval; int nproc_2 = nproc/2; if (t->sz <= sz) return conquer(t); left = t->left; right = t->right; #ifndef FUTURES leftval = tsp(left,sz,nproc_2); #else FUTURE(left,sz,nproc_2,tsp,&fc); #endif rightval = tsp(right,sz,nproc_2); #ifdef FUTURES leftval = (Tree) TOUCH(&fc); leftval = (Tree) fc.value; return merge(leftval,rightval,t,nproc); #else return merge(leftval,rightval,t,nproc); #endif }
status_t dosfs_read_attrdir(fs_volume *_vol, fs_vnode *_node, void *_cookie, struct dirent *entry, size_t bufsize, uint32 *num) { nspace *vol = (nspace *)_vol->private_volume; vnode *node = (vnode *)_node->private_node; int32 *cookie = (int32 *)_cookie; TOUCH(bufsize); DPRINTF(0, ("dosfs_read_attrdir called\n")); *num = 0; LOCK_VOL(vol); if ((*cookie == 0) && (node->mime)) { *num = 1; entry->d_ino = node->vnid; entry->d_dev = vol->id; entry->d_reclen = 10; strcpy(entry->d_name, "BEOS:TYPE"); } *cookie = 1; UNLOCK_VOL(vol); return 0; }
static int pipefs_opendir(fs_cookie _fs, fs_vnode _v, dir_cookie *_cookie) { struct pipefs *fs = (struct pipefs *)_fs; struct pipefs_vnode *v = (struct pipefs_vnode *)_v; struct pipefs_cookie *cookie; int err = 0; TOUCH(fs); TRACE(("pipefs_opendir: vnode 0x%x\n", v)); if(v->stream.type != STREAM_TYPE_DIR) return ERR_VFS_NOT_DIR; cookie = kmalloc(sizeof(struct pipefs_cookie)); if(cookie == NULL) return ERR_NO_MEMORY; mutex_lock(&v->stream.u.dir.dir_lock); cookie->s = &v->stream; cookie->u.dir.ptr = v->stream.u.dir.dir_head; insert_cookie_in_jar(v, cookie); *_cookie = cookie; mutex_unlock(&v->stream.u.dir.dir_lock); return err; }
status_t packagefs_open_attr(fs_volume* fsVolume, fs_vnode* fsNode, const char* name, int openMode, void** _cookie) { Volume* volume = (Volume*)fsVolume->private_volume; Node* node = (Node*)fsNode->private_node; FUNCTION("volume: %p, node: %p (%" B_PRId64 "), name: \"%s\", openMode " "%#x\n", volume, node, node->ID(), name, openMode); TOUCH(volume); NodeReadLocker nodeLocker(node); // check the open mode and permissions if ((openMode & O_RWMASK) != O_RDONLY) return B_NOT_ALLOWED; status_t error = check_access(node, R_OK); if (error != B_OK) return error; AttributeCookie* cookie; error = node->OpenAttribute(StringKey(name), openMode, cookie); if (error != B_OK) return error; *_cookie = cookie; return B_OK; }
status_t packagefs_free_attr_cookie(fs_volume* fsVolume, fs_vnode* fsNode, void* _cookie) { Volume* volume = (Volume*)fsVolume->private_volume; Node* node = (Node*)fsNode->private_node; AttributeCookie* cookie = (AttributeCookie*)_cookie; FUNCTION("volume: %p, node: %p (%" B_PRId64 "), cookie: %p\n", volume, node, node->ID(), cookie); TOUCH(volume); TOUCH(node); delete cookie; return B_OK; }
void arch_thread_enter_uspace(struct thread *t, addr_t entry, void *args, addr_t ustack_top) { dprintf("arch_thread_entry_uspace: thread 0x%x, entry 0x%lx, args %p, ustack_top 0x%lx\n", t->id, entry, args, ustack_top); // make sure the fpu is in a good state asm("fninit"); /* * semi-hack: touch the user space stack first to page it in before we * disable interrupts. We can't take a fault with interrupts off */ { int a = *(volatile long *)(ustack_top - 4); TOUCH(a); } int_disable_interrupts(); x86_64_set_kstack(t->kernel_stack_base + KSTACK_SIZE); // set the interrupt disable count to zero, since we'll have ints enabled as soon as we enter user space t->int_disable_level = 0; x86_64_enter_uspace(entry, args, ustack_top - 8); }
int nfs_open(fs_cookie fs, fs_vnode _v, file_cookie *_cookie, int oflags) { nfs_fs *nfs = (nfs_fs *)fs; nfs_vnode *v = (nfs_vnode *)_v; nfs_cookie *cookie; int err; TOUCH(nfs); TRACE("nfs_open: fsid 0x%x, vnid 0x%Lx, oflags 0x%x\n", nfs->id, VNODETOVNID(v), oflags); if(v->st == STREAM_TYPE_DIR) { err = ERR_VFS_IS_DIR; goto err; } cookie = kmalloc(sizeof(nfs_cookie)); if(cookie == NULL) { err = ERR_NO_MEMORY; goto err; } cookie->v = v; cookie->u.file.pos = 0; cookie->u.file.oflags = oflags; *_cookie = (file_cookie)cookie; err = NO_ERROR; err: return err; }
static status_t packagefs_open_dir(fs_volume* fsVolume, fs_vnode* fsNode, void** _cookie) { Volume* volume = (Volume*)fsVolume->private_volume; Node* node = (Node*)fsNode->private_node; FUNCTION("volume: %p, node: %p (%" B_PRId64 ")\n", volume, node, node->ID()); TOUCH(volume); if (!S_ISDIR(node->Mode())) return B_NOT_A_DIRECTORY; Directory* dir = dynamic_cast<Directory*>(node); status_t error = check_access(dir, R_OK); if (error != B_OK) return error; // create a cookie NodeWriteLocker dirLocker(dir); DirectoryCookie* cookie = new(std::nothrow) DirectoryCookie(dir); if (cookie == NULL) RETURN_ERROR(B_NO_MEMORY); *_cookie = cookie; return B_OK; }