Thread (13 messages) 13 messages, 4 authors, 2020-08-04

RE: [PATCH v1 0/4] [RFC] Implement Trampoline File Descriptor

From: David Laight <hidden>
Date: 2020-08-04 14:45:08
Also in: linux-api, linux-arm-kernel, linux-fsdevel, linux-integrity, lkml

quoted
quoted
If you look at the libffi reference patch I have included, the architecture
specific changes to use trampfd just involve a single C function call to
a common code function.
No idea what libffi is, but it must surely be simpler to
rewrite it to avoid nested function definitions.

Or find a book from the 1960s on how to do recursive
calls and nested functions in FORTRAN-IV.
FWIW it is probably as simple as:
1) Put all the 'variables' the nested function accesses into a struct.
2) Add a field for the address of the 'nested' function.
3) Pass the address of the structure down instead of the
   address of the function.

If you aren't in control of the call sites then add the
structure to a linked list on a thread-local variable.

	David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help