[{"id":3676510,"web_url":"http://patchwork.ozlabs.org/comment/3676510/","msgid":"<adydfwc879isZ8OY@waldemar-brodkorb.de>","list_archive_url":null,"date":"2026-04-13T07:38:39","subject":"[uclibc-ng-devel] Re: [PATCH v1 0/3] Misc Additions for RISC-V","submitter":{"id":68677,"url":"http://patchwork.ozlabs.org/api/people/68677/","name":"Waldemar Brodkorb","email":"wbx@uclibc-ng.org"},"content":"Hi Charles,\n\nthanks, applied and pushed.\n\nBTW: Do you have any application example which uses \"green\" threads?\n\nbest regards\n Waldemar\n\nCharles Mirabile wrote,\n\n> These three patches add some features/support missing from\n> riscv64/riscv32 that I ran into while playing with uClibc-ng\n> \n> Charles Mirabile (3):\n>   riscv: add defconfigs\n>   riscv: add support for static pie binaries\n>   riscv: add support for ucontext functions\n> \n>  extra/Configs/Config.riscv32                 |   1 +\n>  extra/Configs/Config.riscv64                 |   1 +\n>  extra/Configs/defconfigs/riscv32/defconfig   |   1 +\n>  extra/Configs/defconfigs/riscv64/defconfig   |   1 +\n>  libc/sysdeps/linux/riscv32/Makefile.arch     |   2 +\n>  libc/sysdeps/linux/riscv32/crt1.S            |   9 +-\n>  libc/sysdeps/linux/riscv32/getcontext.S      |  77 ++++++++++++\n>  libc/sysdeps/linux/riscv32/makecontext.c     |  78 ++++++++++++\n>  libc/sysdeps/linux/riscv32/setcontext.S      | 114 +++++++++++++++++\n>  libc/sysdeps/linux/riscv32/swapcontext.S     | 125 +++++++++++++++++++\n>  libc/sysdeps/linux/riscv32/ucontext-macros.h |  49 ++++++++\n>  libc/sysdeps/linux/riscv32/ucontext_i.sym    |  31 +++++\n>  libc/sysdeps/linux/riscv64/Makefile.arch     |   2 +\n>  libc/sysdeps/linux/riscv64/crt1.S            |   9 +-\n>  libc/sysdeps/linux/riscv64/getcontext.S      |  77 ++++++++++++\n>  libc/sysdeps/linux/riscv64/makecontext.c     |  78 ++++++++++++\n>  libc/sysdeps/linux/riscv64/setcontext.S      | 114 +++++++++++++++++\n>  libc/sysdeps/linux/riscv64/swapcontext.S     | 125 +++++++++++++++++++\n>  libc/sysdeps/linux/riscv64/ucontext-macros.h |  49 ++++++++\n>  libc/sysdeps/linux/riscv64/ucontext_i.sym    |  31 +++++\n>  20 files changed, 972 insertions(+), 2 deletions(-)\n>  create mode 100644 extra/Configs/defconfigs/riscv32/defconfig\n>  create mode 100644 extra/Configs/defconfigs/riscv64/defconfig\n>  create mode 100644 libc/sysdeps/linux/riscv32/getcontext.S\n>  create mode 100644 libc/sysdeps/linux/riscv32/makecontext.c\n>  create mode 100644 libc/sysdeps/linux/riscv32/setcontext.S\n>  create mode 100644 libc/sysdeps/linux/riscv32/swapcontext.S\n>  create mode 100644 libc/sysdeps/linux/riscv32/ucontext-macros.h\n>  create mode 100644 libc/sysdeps/linux/riscv32/ucontext_i.sym\n>  create mode 100644 libc/sysdeps/linux/riscv64/getcontext.S\n>  create mode 100644 libc/sysdeps/linux/riscv64/makecontext.c\n>  create mode 100644 libc/sysdeps/linux/riscv64/setcontext.S\n>  create mode 100644 libc/sysdeps/linux/riscv64/swapcontext.S\n>  create mode 100644 libc/sysdeps/linux/riscv64/ucontext-macros.h\n>  create mode 100644 libc/sysdeps/linux/riscv64/ucontext_i.sym\n> \n> -- \n> 2.53.0\n> \n> _______________________________________________\n> devel mailing list -- devel@uclibc-ng.org\n> To unsubscribe send an email to devel-leave@uclibc-ng.org\n>","headers":{"Return-Path":"<devel-bounces@uclibc-ng.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@legolas.ozlabs.org","Authentication-Results":"legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=uclibc-ng.org\n (client-ip=89.238.66.15; helo=helium.openadk.org;\n envelope-from=devel-bounces@uclibc-ng.org; receiver=patchwork.ozlabs.org)","Received":["from helium.openadk.org (helium.openadk.org [89.238.66.15])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fvK6M1mcCz1yDF\n\tfor <incoming@patchwork.ozlabs.org>; Mon, 13 Apr 2026 17:39:06 +1000 (AEST)","from helium.openadk.org (localhost [127.0.0.1])\n\tby helium.openadk.org (Postfix) with ESMTP id 3D1B031E0D05;\n\tMon, 13 Apr 2026 09:38:58 +0200 (CEST)","by helium.openadk.org (Postfix, from userid 1000)\n\tid 70F3031E0CBB; Mon, 13 Apr 2026 09:38:39 +0200 (CEST)"],"Date":"Mon, 13 Apr 2026 09:38:39 +0200","From":"Waldemar Brodkorb <wbx@uclibc-ng.org>","To":"Charles Mirabile <cmirabil@redhat.com>","Message-ID":"<adydfwc879isZ8OY@waldemar-brodkorb.de>","References":"<20260408053507.2640564-1-cmirabil@redhat.com>","MIME-Version":"1.0","Content-Disposition":"inline","In-Reply-To":"<20260408053507.2640564-1-cmirabil@redhat.com>","X-Operating-System":"Linux 6.12.63+deb13-amd64 x86_64","Message-ID-Hash":"BGL3Q4LHUQTQCWKYLOERCO2JNFPA5536","X-Message-ID-Hash":"BGL3Q4LHUQTQCWKYLOERCO2JNFPA5536","X-MailFrom":"wbx@uclibc-ng.org","X-Mailman-Rule-Misses":"dmarc-mitigation; no-senders; approved; loop;\n banned-address; emergency; member-moderation; nonmember-moderation;\n administrivia; implicit-dest; max-recipients; max-size; news-moderation;\n no-subject; digests; suspicious-header","CC":"devel@uclibc-ng.org","X-Mailman-Version":"3.3.10","Precedence":"list","Subject":"[uclibc-ng-devel] Re: [PATCH v1 0/3] Misc Additions for RISC-V","List-Id":"uClibc-ng Development <devel.uclibc-ng.org>","Archived-At":"\n <https://uclibc-ng.org/mailman3/hyperkitty/list/devel@uclibc-ng.org/message/BGL3Q4LHUQTQCWKYLOERCO2JNFPA5536/>","List-Archive":"\n <https://uclibc-ng.org/mailman3/hyperkitty/list/devel@uclibc-ng.org/>","List-Help":"<mailto:devel-request@uclibc-ng.org?subject=help>","List-Owner":"<mailto:devel-owner@uclibc-ng.org>","List-Post":"<mailto:devel@uclibc-ng.org>","List-Subscribe":"<mailto:devel-join@uclibc-ng.org>","List-Unsubscribe":"<mailto:devel-leave@uclibc-ng.org>","Content-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"7bit"}},{"id":3676789,"web_url":"http://patchwork.ozlabs.org/comment/3676789/","msgid":"<CABe3_aH-AcQdRBB=OY12_3kWSbc-iJyhzMmytgM+B3jQ449wSw@mail.gmail.com>","list_archive_url":null,"date":"2026-04-13T14:19:57","subject":"[uclibc-ng-devel] Re: [PATCH v1 0/3] Misc Additions for RISC-V","submitter":{"id":82370,"url":"http://patchwork.ozlabs.org/api/people/82370/","name":"Charles Mirabile","email":"cmirabil@redhat.com"},"content":"Hi Waldemar—\n\nOn Mon, Apr 13, 2026 at 3:38 AM Waldemar Brodkorb <wbx@uclibc-ng.org> wrote:\n>\n> Hi Charles,\n>\n> thanks, applied and pushed.\n>\n> BTW: Do you have any application example which uses \"green\" threads?\n\nThey are like a more powerful setjmp/longjmp; OpenSSL uses them for\nasync crypto on some platforms / compilers (though it can fall back to\nsetjmp/longjmp from what I see\nhttps://grep.app/search?f.repo=openssl%2Fopenssl&q=USE_SWAPCONTEXT). I\nwill also attach a small example program that demos the functionality,\nwhere two functions containing loops swap back and forth to interleave\ntheir output.\n\nI became interested in these functions because I want to teach\nstudents about execution contexts / threading and it was nice to have\na demo that runs fully in userspace that is a bit easy to single step\nthrough with a debugger.\n\n>\n> best regards\n>  Waldemar\n\nBest—Charlie\n\n>\n> Charles Mirabile wrote,\n>\n> > These three patches add some features/support missing from\n> > riscv64/riscv32 that I ran into while playing with uClibc-ng\n> >\n> > Charles Mirabile (3):\n> >   riscv: add defconfigs\n> >   riscv: add support for static pie binaries\n> >   riscv: add support for ucontext functions\n> >\n> >  extra/Configs/Config.riscv32                 |   1 +\n> >  extra/Configs/Config.riscv64                 |   1 +\n> >  extra/Configs/defconfigs/riscv32/defconfig   |   1 +\n> >  extra/Configs/defconfigs/riscv64/defconfig   |   1 +\n> >  libc/sysdeps/linux/riscv32/Makefile.arch     |   2 +\n> >  libc/sysdeps/linux/riscv32/crt1.S            |   9 +-\n> >  libc/sysdeps/linux/riscv32/getcontext.S      |  77 ++++++++++++\n> >  libc/sysdeps/linux/riscv32/makecontext.c     |  78 ++++++++++++\n> >  libc/sysdeps/linux/riscv32/setcontext.S      | 114 +++++++++++++++++\n> >  libc/sysdeps/linux/riscv32/swapcontext.S     | 125 +++++++++++++++++++\n> >  libc/sysdeps/linux/riscv32/ucontext-macros.h |  49 ++++++++\n> >  libc/sysdeps/linux/riscv32/ucontext_i.sym    |  31 +++++\n> >  libc/sysdeps/linux/riscv64/Makefile.arch     |   2 +\n> >  libc/sysdeps/linux/riscv64/crt1.S            |   9 +-\n> >  libc/sysdeps/linux/riscv64/getcontext.S      |  77 ++++++++++++\n> >  libc/sysdeps/linux/riscv64/makecontext.c     |  78 ++++++++++++\n> >  libc/sysdeps/linux/riscv64/setcontext.S      | 114 +++++++++++++++++\n> >  libc/sysdeps/linux/riscv64/swapcontext.S     | 125 +++++++++++++++++++\n> >  libc/sysdeps/linux/riscv64/ucontext-macros.h |  49 ++++++++\n> >  libc/sysdeps/linux/riscv64/ucontext_i.sym    |  31 +++++\n> >  20 files changed, 972 insertions(+), 2 deletions(-)\n> >  create mode 100644 extra/Configs/defconfigs/riscv32/defconfig\n> >  create mode 100644 extra/Configs/defconfigs/riscv64/defconfig\n> >  create mode 100644 libc/sysdeps/linux/riscv32/getcontext.S\n> >  create mode 100644 libc/sysdeps/linux/riscv32/makecontext.c\n> >  create mode 100644 libc/sysdeps/linux/riscv32/setcontext.S\n> >  create mode 100644 libc/sysdeps/linux/riscv32/swapcontext.S\n> >  create mode 100644 libc/sysdeps/linux/riscv32/ucontext-macros.h\n> >  create mode 100644 libc/sysdeps/linux/riscv32/ucontext_i.sym\n> >  create mode 100644 libc/sysdeps/linux/riscv64/getcontext.S\n> >  create mode 100644 libc/sysdeps/linux/riscv64/makecontext.c\n> >  create mode 100644 libc/sysdeps/linux/riscv64/setcontext.S\n> >  create mode 100644 libc/sysdeps/linux/riscv64/swapcontext.S\n> >  create mode 100644 libc/sysdeps/linux/riscv64/ucontext-macros.h\n> >  create mode 100644 libc/sysdeps/linux/riscv64/ucontext_i.sym\n> >\n> > --\n> > 2.53.0\n> >\n> > _______________________________________________\n> > devel mailing list -- devel@uclibc-ng.org\n> > To unsubscribe send an email to devel-leave@uclibc-ng.org\n> >\n>","headers":{"Return-Path":"<devel-bounces@uclibc-ng.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@legolas.ozlabs.org","Authentication-Results":["legolas.ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256\n header.s=mimecast20190719 header.b=XKz8AQ3S;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=uclibc-ng.org\n (client-ip=89.238.66.15; helo=helium.openadk.org;\n envelope-from=devel-bounces@uclibc-ng.org; receiver=patchwork.ozlabs.org)","helium.openadk.org;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256\n header.s=mimecast20190719 header.b=XKz8AQ3S;\n\tdkim-atps=neutral"],"Received":["from helium.openadk.org (helium.openadk.org [89.238.66.15])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fvV1Q5MJwz1yDF\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 14 Apr 2026 00:20:26 +1000 (AEST)","from helium.openadk.org (localhost [127.0.0.1])\n\tby helium.openadk.org (Postfix) with ESMTP id 927B531E0CF9;\n\tMon, 13 Apr 2026 16:20:20 +0200 (CEST)","from us-smtp-delivery-124.mimecast.com\n (us-smtp-delivery-124.mimecast.com [170.10.133.124])\n\tby helium.openadk.org (Postfix) with ESMTPS id 2352231E0B9B\n\tfor <devel@uclibc-ng.org>; Mon, 13 Apr 2026 16:20:15 +0200 (CEST)","from mail-ua1-f71.google.com (mail-ua1-f71.google.com\n [209.85.222.71]) by relay.mimecast.com with ESMTP with STARTTLS\n (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id\n us-mta-88-UFVH1ZxyMcezdeNYkwfyEA-1; Mon, 13 Apr 2026 10:20:11 -0400","by mail-ua1-f71.google.com with SMTP id\n a1e0cc1a2514c-95674175677so282166241.3\n        for <devel@uclibc-ng.org>; Mon, 13 Apr 2026 07:20:11 -0700 (PDT)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n\ts=mimecast20190719; t=1776090013;\n\th=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n\t to:to:cc:cc:mime-version:mime-version:content-type:content-type:\n\t in-reply-to:in-reply-to:references:references;\n\tbh=nxkAPRQVC6MS/aC/YMsYQGh40IpV/oFZNHc/vEPIY7Y=;\n\tb=XKz8AQ3SmbQTiIKogDCQc9zVWfmeZLX0cDxJAoFyq0HJzn50YCww2LitgMYvMwjOS1WOyG\n\tHxus/+YWMCv9vIcohOyskl/3yTdURfcRzKuLBkZudJaCH5arwrkcFdATpug7+PKVyPj6lu\n\tR6ykjwi3Equu/+9JtkchRJIhn+Vp6EM=","X-MC-Unique":"UFVH1ZxyMcezdeNYkwfyEA-1","X-Mimecast-MFC-AGG-ID":"UFVH1ZxyMcezdeNYkwfyEA_1776090010","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n        d=1e100.net; s=20251104; t=1776090010; x=1776694810;\n        h=cc:to:subject:message-id:date:from:in-reply-to:references\n         :mime-version:x-gm-gg:x-gm-message-state:from:to:cc:subject:date\n         :message-id:reply-to;\n        bh=nxkAPRQVC6MS/aC/YMsYQGh40IpV/oFZNHc/vEPIY7Y=;\n        b=f8on1KabrGZQRCv8M3C/GkRgD+sexOzhNhyW2JMJslWUlFiFTsGyqWu8zwT0/C+jHa\n         rBOOXFHy9UPVrWm2lDldUD/Te8pgWQEj8nKZ/ZfcbnQvircjqJkF5Kh6uJCMb8XwDWSA\n         rLI8TrmdhVr20IlVaxPXpSvtQZVj+kclFREdkdLLZ3EUbt23z4cpGOQadf53QsCW9kUE\n         dhmgeBACAZxwstGDv7CEIBZR79mh85F31y+swyTEdYvBE0OQ8GRFOAzLBoJocXYdQauE\n         R8bCo/T/j6+rE02PJti3WraZBuumqLTXWA7apT5AsUKKnr9N7bDJlDFNsJ/NDvWK5xcs\n         fO9A==","X-Gm-Message-State":"AOJu0Yx254btbzgd18+SmLC1LkMiqlQqQZGJsnAuzFohHFqzPmnJ9C0A\n\tMWcbWM3yLDFyy6FsjjTjQ6p/gVNozWpvK4JPTJQIc5pyGf8M/LhZOAnHjc+VlwrmO3EyYIfCGrk\n\t7tfQDv3K4QfM/oPk1uYNY7WkATMJFzgAroNbSMORtYWJQf3dnsX2C0FpdGRU0RolaeMY/PR9LJ3\n\tyLodonD7prY35tA8yGg93yGMU/oNxlw76spCNZr9A=","X-Gm-Gg":"AeBDievWZ2yrY7V14fGyO3xJCz51xfzLTQ9VVgq2R19RHj6aeNXjHb7KBe+bj0BKpPO\n\tazeXnZ7ERWZGp/UoErrdENiaC5ue0hcidXJb8vM6XWIN0F31OavFjTQ9OMRaOs3R+lLZ2dkWa5y\n\t7qGP+OIz5S/6/f0+XMTVplETXZfakqEHGZz+dPsN0ZDaUMsn/dc0SxWNGxjZpP27Jyqgr8F0fBD\n\tUSc0OBcJGkwcUlLsqIox2K1Scs7vSbcgic69i2ehWvw+y7fwxzbrF3iZHs0KKgATtIiWRD19lh3","X-Received":["by 2002:a05:6122:4d01:b0:56e:e33f:2ffd with SMTP id\n 71dfb90a1353d-56f3bd48718mr5153934e0c.14.1776090010465;\n        Mon, 13 Apr 2026 07:20:10 -0700 (PDT)","by 2002:a05:6122:4d01:b0:56e:e33f:2ffd with SMTP id\n 71dfb90a1353d-56f3bd48718mr5153868e0c.14.1776090009829; Mon, 13 Apr 2026\n 07:20:09 -0700 (PDT)"],"MIME-Version":"1.0","References":"<20260408053507.2640564-1-cmirabil@redhat.com>\n <adydfwc879isZ8OY@waldemar-brodkorb.de>","In-Reply-To":"<adydfwc879isZ8OY@waldemar-brodkorb.de>","From":"Charles Mirabile <cmirabil@redhat.com>","Date":"Mon, 13 Apr 2026 10:19:57 -0400","X-Gm-Features":"AQROBzBvzGIGCPQB3MtQLawALSwoOeobAfGBRbKOf_Ih3AFZMSDovM7aBXphgsM","Message-ID":"\n <CABe3_aH-AcQdRBB=OY12_3kWSbc-iJyhzMmytgM+B3jQ449wSw@mail.gmail.com>","To":"Waldemar Brodkorb <wbx@uclibc-ng.org>","X-Mimecast-Spam-Score":"0","X-Mimecast-MFC-PROC-ID":"5vrs6J7tntcJQbmUc41PmNcjZpQizqg2lnKF0Vae9MM_1776090010","X-Mimecast-Originator":"redhat.com","Content-Type":"multipart/mixed; boundary=\"000000000000202adf064f582e65\"","Message-ID-Hash":"FUKN56ODGILTR2MUSVDJVMXNEPJ4CZKC","X-Message-ID-Hash":"FUKN56ODGILTR2MUSVDJVMXNEPJ4CZKC","X-MailFrom":"cmirabil@redhat.com","X-Mailman-Rule-Misses":"dmarc-mitigation; no-senders; approved; loop;\n banned-address; emergency; member-moderation; nonmember-moderation;\n administrivia; implicit-dest; max-recipients; max-size; news-moderation;\n no-subject; digests; suspicious-header","CC":"devel@uclibc-ng.org","X-Mailman-Version":"3.3.10","Precedence":"list","Subject":"[uclibc-ng-devel] Re: [PATCH v1 0/3] Misc Additions for RISC-V","List-Id":"uClibc-ng Development <devel.uclibc-ng.org>","Archived-At":"\n <https://uclibc-ng.org/mailman3/hyperkitty/list/devel@uclibc-ng.org/message/FUKN56ODGILTR2MUSVDJVMXNEPJ4CZKC/>","List-Archive":"\n <https://uclibc-ng.org/mailman3/hyperkitty/list/devel@uclibc-ng.org/>","List-Help":"<mailto:devel-request@uclibc-ng.org?subject=help>","List-Owner":"<mailto:devel-owner@uclibc-ng.org>","List-Post":"<mailto:devel@uclibc-ng.org>","List-Subscribe":"<mailto:devel-join@uclibc-ng.org>","List-Unsubscribe":"<mailto:devel-leave@uclibc-ng.org>"}}]