search for: oldf

Displaying 20 results from an estimated 37 matches for "oldf".

Did you mean: old
2011 Feb 28
3
[LLVMdev] Extending FunctionType
...ull clone is necessary, since he wants to replace the function. He only needs to create the new function and splice in the body of the old one. Gabriel: look at Function::getBasicBlockList() and iplist<>::splice(iterator, iplist). Something like Function *NewF = Function::Create(NewFnType, OldF->getLinkage()); NewF->getBasicBlockList().splice(NewF->begin(), OldF->getBasicBlockList()); NewF->takeName(OldF); OldF->eraseFromParent(); is probably what you're looking for. (Note: completely untested)
2011 Feb 28
2
[LLVMdev] Extending FunctionType
...sWith() on each old argument, since there's no need to worry about preserving the integrity of the old function. >> Gabriel: look at Function::getBasicBlockList() and >> iplist<>::splice(iterator, iplist). Something like >>   Function *NewF = Function::Create(NewFnType, OldF->getLinkage()); >>   NewF->getBasicBlockList().splice(NewF->begin(), >> OldF->getBasicBlockList()); >>   NewF->takeName(OldF); >>   OldF->eraseFromParent(); >> is probably what you're looking for. >> (Note: completely untested) And I did pu...
2011 Feb 28
0
[LLVMdev] Extending FunctionType
...see a mechanism that updates instructions that use the old function's arguments to use the new function's arguments. > Gabriel: look at Function::getBasicBlockList() and > iplist<>::splice(iterator, iplist). Something like > Function *NewF = Function::Create(NewFnType, OldF->getLinkage()); > NewF->getBasicBlockList().splice(NewF->begin(), OldF->getBasicBlockList()); > NewF->takeName(OldF); > OldF->eraseFromParent(); > is probably what you're looking for. > (Note: completely untested) -- John T.
2020 Apr 04
0
[PATCH 6/6] kernel: set USER_DS in kthread_use_mm
...drivers/usb/gadget/function/f_fs.c +++ b/drivers/usb/gadget/function/f_fs.c @@ -824,13 +824,9 @@ static void ffs_user_copy_worker(struct work_struct *work) bool kiocb_has_eventfd = io_data->kiocb->ki_flags & IOCB_EVENTFD; if (io_data->read && ret > 0) { - mm_segment_t oldfs = get_fs(); - - set_fs(USER_DS); kthread_use_mm(io_data->mm); ret = ffs_copy_to_iter(io_data->buf, ret, &io_data->data); kthread_unuse_mm(io_data->mm); - set_fs(oldfs); } io_data->kiocb->ki_complete(io_data->kiocb, ret, ret); diff --git a/drivers/vhost/vho...
2020 Apr 16
0
[PATCH 3/3] kernel: set USER_DS in kthread_use_mm
...drivers/usb/gadget/function/f_fs.c +++ b/drivers/usb/gadget/function/f_fs.c @@ -824,13 +824,9 @@ static void ffs_user_copy_worker(struct work_struct *work) bool kiocb_has_eventfd = io_data->kiocb->ki_flags & IOCB_EVENTFD; if (io_data->read && ret > 0) { - mm_segment_t oldfs = get_fs(); - - set_fs(USER_DS); kthread_use_mm(io_data->mm); ret = ffs_copy_to_iter(io_data->buf, ret, &io_data->data); kthread_unuse_mm(io_data->mm); - set_fs(oldfs); } io_data->kiocb->ki_complete(io_data->kiocb, ret, ret); diff --git a/drivers/vhost/vho...
2017 Jun 08
4
DICompileUnit duplication in LLVM 4.0.0?
...FunctionType *NewTy) const { Function *New = Function::Create(NewTy, Old.getLinkage(), "", &M); New->setAttributes(Old.getAttributes()); New->setCallingConv(Old.getCallingConv()); // Map old arguments to the new arguments. ValueToValueMapTy VMap; for (auto OldFI = Old.arg_begin(), OldFE = Old.arg_end(), NewFI = New->arg_begin(); OldFI != OldFE; ++OldFI, ++NewFI) { Argument &OldA = *OldFI; Argument &NewA = *NewFI; NewA.setName(OldA.getName()); VMap[&OldA] = &NewA; } SmallVector<ReturnInst *, 16&...
2011 Feb 28
0
[LLVMdev] Extending FunctionType
On 2/28/11 6:31 AM, Gabriel Rodríguez wrote: > Hi all, > > I am trying to extend a FunctionType to include new parameters. In > particular, I want to > ensure that the main function has been declared with both argsc and > argsv. However > there seems to be no easy way to accomplish this: > llvm::Function::getFunctionType() returns a > a reference to a const object,
2011 Feb 28
2
[LLVMdev] Extending FunctionType
Hi all, I am trying to extend a FunctionType to include new parameters. In particular, I want to ensure that the main function has been declared with both argsc and argsv. However there seems to be no easy way to accomplish this: llvm::Function::getFunctionType() returns a a reference to a const object, while modifying only the argument list yields an error during verification since the
2020 Apr 04
14
improve use_mm / unuse_mm
Hi all, this series improves the use_mm / unuse_mm interface by better documenting the assumptions, and my taking the set_fs manipulations spread over the callers into the core API.
2020 Apr 04
14
improve use_mm / unuse_mm
Hi all, this series improves the use_mm / unuse_mm interface by better documenting the assumptions, and my taking the set_fs manipulations spread over the callers into the core API.
2017 Jun 08
2
DICompileUnit duplication in LLVM 4.0.0?
...w = Function::Create(NewTy, Old.getLinkage(), "", &M); >> New->setAttributes(Old.getAttributes()); >> New->setCallingConv(Old.getCallingConv()); >> >> // Map old arguments to the new arguments. >> ValueToValueMapTy VMap; >> for (auto OldFI = Old.arg_begin(), OldFE = Old.arg_end(), >> NewFI = New->arg_begin(); >> OldFI != OldFE; ++OldFI, ++NewFI) { >> Argument &OldA = *OldFI; >> Argument &NewA = *NewFI; >> NewA.setName(OldA.getName()); >> VMap[&OldA...
2020 Apr 16
8
improve use_mm / unuse_mm v2
Hi all, this series improves the use_mm / unuse_mm interface by better documenting the assumptions, and my taking the set_fs manipulations spread over the callers into the core API. Changes since v1: - drop a few patches - fix a comment typo - cover the newly merged use_mm/unuse_mm caller in vfio
2020 Apr 16
8
improve use_mm / unuse_mm v2
Hi all, this series improves the use_mm / unuse_mm interface by better documenting the assumptions, and my taking the set_fs manipulations spread over the callers into the core API. Changes since v1: - drop a few patches - fix a comment typo - cover the newly merged use_mm/unuse_mm caller in vfio
2016 Apr 26
2
[PATCH 1/2] vhost: simplify work flushing
...rk->queue_seq++; spin_unlock_irqrestore(&dev->work_lock, flags); wake_up_process(dev->worker); } else { @@ -310,7 +306,6 @@ static int vhost_worker(void *data) { struct vhost_dev *dev = data; struct vhost_work *work = NULL; - unsigned uninitialized_var(seq); mm_segment_t oldfs = get_fs(); set_fs(USER_DS); @@ -321,11 +316,6 @@ static int vhost_worker(void *data) set_current_state(TASK_INTERRUPTIBLE); spin_lock_irq(&dev->work_lock); - if (work) { - work->done_seq = seq; - if (work->flushing) - wake_up_all(&work->done); - } if...
2016 Apr 26
2
[PATCH 1/2] vhost: simplify work flushing
...rk->queue_seq++; spin_unlock_irqrestore(&dev->work_lock, flags); wake_up_process(dev->worker); } else { @@ -310,7 +306,6 @@ static int vhost_worker(void *data) { struct vhost_dev *dev = data; struct vhost_work *work = NULL; - unsigned uninitialized_var(seq); mm_segment_t oldfs = get_fs(); set_fs(USER_DS); @@ -321,11 +316,6 @@ static int vhost_worker(void *data) set_current_state(TASK_INTERRUPTIBLE); spin_lock_irq(&dev->work_lock); - if (work) { - work->done_seq = seq; - if (work->flushing) - wake_up_all(&work->done); - } if...
2009 Jun 30
1
S4 class redefinition
I haven't found much on S4 class redefinition; the little I've seen indicates the following is to be expected: 1. setClass("foo", ....) 2. create objects of class foo. 3. execute the same setClass("foo", ...) again (source the same file). 4. objects from step 2 are now NULL. Is that the expected behavior (I ran under R 2.7.1)? Assuming it is, it's kind of
2020 Apr 04
0
[PATCH 5/6] kernel: better document the use_mm/unuse_mm API contract
...ff --git a/drivers/usb/gadget/function/f_fs.c b/drivers/usb/gadget/function/f_fs.c index c57b1b2507c6..d9e48bd7c692 100644 --- a/drivers/usb/gadget/function/f_fs.c +++ b/drivers/usb/gadget/function/f_fs.c @@ -827,9 +827,9 @@ static void ffs_user_copy_worker(struct work_struct *work) mm_segment_t oldfs = get_fs(); set_fs(USER_DS); - use_mm(io_data->mm); + kthread_use_mm(io_data->mm); ret = ffs_copy_to_iter(io_data->buf, ret, &io_data->data); - unuse_mm(io_data->mm); + kthread_unuse_mm(io_data->mm); set_fs(oldfs); } diff --git a/drivers/usb/gadget/legacy/i...
2020 Apr 16
0
[PATCH 2/3] kernel: better document the use_mm/unuse_mm API contract
...ff --git a/drivers/usb/gadget/function/f_fs.c b/drivers/usb/gadget/function/f_fs.c index c57b1b2507c6..d9e48bd7c692 100644 --- a/drivers/usb/gadget/function/f_fs.c +++ b/drivers/usb/gadget/function/f_fs.c @@ -827,9 +827,9 @@ static void ffs_user_copy_worker(struct work_struct *work) mm_segment_t oldfs = get_fs(); set_fs(USER_DS); - use_mm(io_data->mm); + kthread_use_mm(io_data->mm); ret = ffs_copy_to_iter(io_data->buf, ret, &io_data->data); - unuse_mm(io_data->mm); + kthread_unuse_mm(io_data->mm); set_fs(oldfs); } diff --git a/drivers/usb/gadget/legacy/i...
2004 May 03
4
ctags(1) command execution vulnerability
Hello, ctags(1) uses external application sort(1) for sorting the tags file. It calls it via system(3) function. Look at the /usr/src/usr.bin/ctags/ctags.c file, there are such lines here: if (uflag) { (void)asprintf(&cmd, "sort -o %s %s", outfile, outfile); if (cmd == NULL) err(1, "out of space"); system(cmd); free(cmd); cmd = NULL; } This code will be
2016 Apr 26
0
[PATCH 2/2] vhost: lockless enqueuing
...; } EXPORT_SYMBOL_GPL(vhost_has_work); @@ -305,7 +306,8 @@ static void vhost_vq_reset(struct vhost_dev *dev, static int vhost_worker(void *data) { struct vhost_dev *dev = data; - struct vhost_work *work = NULL; + struct vhost_work *work, *work_next; + struct llist_node *node; mm_segment_t oldfs = get_fs(); set_fs(USER_DS); @@ -315,29 +317,25 @@ static int vhost_worker(void *data) /* mb paired w/ kthread_stop */ set_current_state(TASK_INTERRUPTIBLE); - spin_lock_irq(&dev->work_lock); - if (kthread_should_stop()) { - spin_unlock_irq(&dev->work_lock); __s...