Ignore:
Timestamp:
Mar 2, 2021, 1:58:12 PM (8 months ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
arm-eh, jacob/cs343-translation, master, new-ast-unique-expr
Children:
2cd784a
Parents:
6047b00
Message:

Changed io to use ring per kernel threads.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/concurrency/io/call.cfa.in

    r6047b00 rdddb3dd0  
    7575
    7676        extern struct $io_context * cfa_io_allocate(struct io_uring_sqe * out_sqes[], __u32 out_idxs[], __u32 want)  __attribute__((nonnull (1,2)));
    77         extern void cfa_io_submit( struct $io_context * in_ctx, __u32 in_idxs[], __u32 have ) __attribute__((nonnull (1,2)));
     77        extern void cfa_io_submit( struct $io_context * in_ctx, __u32 in_idxs[], __u32 have, bool lazy ) __attribute__((nonnull (1,2)));
    7878#endif
    7979
     
    185185                return ', '.join(args_a)
    186186
    187 AsyncTemplate = """inline void async_{name}(io_future_t & future, {params}, int submit_flags) {{
     187AsyncTemplate = """inline void async_{name}(io_future_t & future, {params}, __u64 submit_flags) {{
    188188        #if !defined(CFA_HAVE_LINUX_IO_URING_H) || !defined(CFA_HAVE_IORING_OP_{op})
    189189                ssize_t res = {name}({args});
     
    216216
    217217                verify( sqe->user_data == (__u64)(uintptr_t)&future );
    218                 cfa_io_submit( ctx, &idx, 1 );
     218                cfa_io_submit( ctx, &idx, 1, 0 != (submit_flags & CFA_IO_LAZY) );
    219219        #endif
    220220}}"""
    221221
    222 SyncTemplate = """{ret} cfa_{name}({params}, int submit_flags) {{
     222SyncTemplate = """{ret} cfa_{name}({params}, __u64 submit_flags) {{
    223223        io_future_t future;
    224224
     
    388388        if c.define:
    389389                print("""#if defined({define})
    390         {ret} cfa_{name}({params}, int submit_flags);
     390        {ret} cfa_{name}({params}, __u64 submit_flags);
    391391#endif""".format(define=c.define,ret=c.ret, name=c.name, params=c.params))
    392392        else:
    393                 print("{ret} cfa_{name}({params}, int submit_flags);"
     393                print("{ret} cfa_{name}({params}, __u64 submit_flags);"
    394394                .format(ret=c.ret, name=c.name, params=c.params))
    395395
     
    399399        if c.define:
    400400                print("""#if defined({define})
    401         void async_{name}(io_future_t & future, {params}, int submit_flags);
     401        void async_{name}(io_future_t & future, {params}, __u64 submit_flags);
    402402#endif""".format(define=c.define,name=c.name, params=c.params))
    403403        else:
    404                 print("void async_{name}(io_future_t & future, {params}, int submit_flags);"
     404                print("void async_{name}(io_future_t & future, {params}, __u64 submit_flags);"
    405405                .format(name=c.name, params=c.params))
    406406print("\n")
Note: See TracChangeset for help on using the changeset viewer.