[patch #9831] Move core lock macros to include/lwip/sys.h

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

[patch #9831] Move core lock macros to include/lwip/sys.h

David GIRAULT-2
URL:
  <https://savannah.nongnu.org/patch/?9831>

                 Summary: Move core lock macros to include/lwip/sys.h
                 Project: lwIP - A Lightweight TCP/IP stack
            Submitted by: jllledo
            Submitted on: Sat 13 Jul 2019 10:31:32 AM CEST
                Category: None
                Priority: 5 - Normal
                  Status: None
                 Privacy: Public
             Assigned to: None
        Originator Email:
             Open/Closed: Open
         Discussion Lock: Any
         Planned Release: None

    _______________________________________________________

Details:

contrib/ports/unix/lib/lwipopts.h: sys_check_core_locking() and pals are
declared in lwipopts.h, is this the proper place? why aren't they declared in
sys_arch.h?

More info at:

https://lists.nongnu.org/archive/html/lwip-devel/2019-07/msg00001.html



    _______________________________________________________

File Attachments:


-------------------------------------------------------
Date: Sat 13 Jul 2019 10:31:32 AM CEST  Name:
0001-Move-core-lock-macros-to-include-lwip-sys.h.patch  Size: 10KiB   By:
jllledo

<http://savannah.nongnu.org/patch/download.php?file_id=47209>

    _______________________________________________________

Reply to this item at:

  <https://savannah.nongnu.org/patch/?9831>

_______________________________________________
  Message sent via Savannah
  https://savannah.nongnu.org/


_______________________________________________
lwip-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-devel
Reply | Threaded
Open this post in threaded view
|

[patch #9831] Move core lock macros to include/lwip/sys.h

David GIRAULT-2
Follow-up Comment #1, patch #9831 (project lwip):

> [..] is this the proper place? why aren't they declared in sys_arch.h?

Because sys.h is meant for files depending on NO_SYS=0, in other words, lwIP
compiled with NO_SYS=1 (single threaded callback style without OS) would not
need sys.h at all.

But yes, I see your problem of defining a function in lwipopts.h, which is not
that ideal. Can you come up with a patch that allows you to declare those
functions in sys_arch.h while preventing to change all those files to include
sys.h?

    _______________________________________________________

Reply to this item at:

  <https://savannah.nongnu.org/patch/?9831>

_______________________________________________
  Message sent via Savannah
  https://savannah.nongnu.org/


_______________________________________________
lwip-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-devel
Reply | Threaded
Open this post in threaded view
|

[patch #9831] Move core lock macros to include/lwip/sys.h

David GIRAULT-2
Follow-up Comment #2, patch #9831 (project lwip):

It seems LWIP_MARK_TCPIP_THREAD it's only used when !NO_SYS, and same for
LOCK_TCPIP_CORE and UNLOCK_TCPIP_CORE. So I could move LWIP_MARK_TCPIP_THREAD
declaration to sys.h and [UN]LOCK_TCPIP_CORE to sys_arch.h in the linux port.

About LWIP_ASSERT_CORE_LOCKED, I couldn't find a way to move it to sys.h w/o
updating all #includes, so I left it in opt.h, but at least now it's only one
macro.

(file #47254)
    _______________________________________________________

Additional Item Attachment:

File name: 0001-Move-LWIP_MARK_TCPIP_THREAD-to-include-lwip-sys.h.patch Size:3
KB
   
<https://savannah.nongnu.org/file/0001-Move-LWIP_MARK_TCPIP_THREAD-to-include-lwip-sys.h.patch?file_id=47254>



    _______________________________________________________

Reply to this item at:

  <https://savannah.nongnu.org/patch/?9831>

_______________________________________________
  Message sent via Savannah
  https://savannah.nongnu.org/


_______________________________________________
lwip-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-devel
Reply | Threaded
Open this post in threaded view
|

[patch #9831] Move core lock macros to include/lwip/sys.h

David GIRAULT-2
Update of patch #9831 (project lwip):

                  Status:                    None => Done                  
             Assigned to:                    None => goldsimon              
             Open/Closed:                    Open => Closed                

    _______________________________________________________

Follow-up Comment #3:

Applied file #47254 with tiny fixes. Thanks for the patch.

    _______________________________________________________

Reply to this item at:

  <https://savannah.nongnu.org/patch/?9831>

_______________________________________________
  Message sent via Savannah
  https://savannah.nongnu.org/


_______________________________________________
lwip-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-devel