並び順

ブックマーク数

期間指定

  • から
  • まで

1 - 6 件 / 6件

新着順 人気順

setjmpの検索結果1 - 6 件 / 6件

  • Understanding Non-Local Jumps (setjmp/longjmp) in RISC-V Assembly

    This post explores RISC-V assembly by examining the implementation of the setjmp and longjmp functions from the C standard library. I frequently find that I grasp concepts more quickly when I have actual code that I can disassemble because it allows me to connect information with intent. I believe RISC-V and similar efforts will fundamentally shift how computers are made and programmed. I hope tha

      Understanding Non-Local Jumps (setjmp/longjmp) in RISC-V Assembly
    • setjmpとlongjmp はどのように実現されているのか - FPGA開発日記

      setjump(), longjump()について基本的なことを調査するために、まずは以下のページなどを読んで勉強した。 http://www.nurs.or.jp/~sug/soft/super/longjmp.htm (制限はあるが)どのような場所からでも、setjump()を実行した場所に戻ってくることが出来る。これにより、例外処理もどきのようなものが作れる。 #include <setjmp.h> #include <stdio.h> #include <stdlib.h> jmp_buf jmp_div; void divide_test (int a, int b) { if (b == 0) { longjmp(jmp_div, 1); } int div = a / b; printf ("divide_test (%d, %d) = %d\n", a, b, div);

        setjmpとlongjmp はどのように実現されているのか - FPGA開発日記
      • setjmp()/longjmp()によるタスク切替え実験用サンプル

        ■ 概要 setjmp()/longjmp()により,タスクディスパッチをするサンプルです. (2016/11/05) FreeBSDの環境で動作します.Linux環境では,現状うまく動作しません → Linuxと64ビット環境に対応しました(2017/08/22). FreeBSD/amd64, CentOS(32bit), Debian(32bit)で動作確認済み. 優先度スケジューリングのサンプルを追加し,コード全体を整理しました.(2020/04/21) メモリ管理(sample11)を追加しました.(2020/11/05) setjmp.zip ...各ファイルをまとめたもの sample0.c ...setjmp()/longjmp()利用のサンプル sample1.c ...ノンプリエンプティブな動作 sample2.c ...タスクが終了できるようにする sample3.c

        • Let's write a setjmp

          This article was discussed on Hacker News. Yesterday I wrote that setjmp is handy and that it would be nice to have without linking the C standard library. It’s conceptually simple, after all. Today let’s explore some differently-portable implementation possibilities with distinct trade-offs. At the very least it should illuminate why setjmp sometimes requires the use of volatile. First, a quick r

          • setjmp/longjmpでタスク切り替えしてみた - Qiita

            はじめに ソフトを開発するときに、とりあえずコードがどう動くのか確認したいということがあります。 TOPPERS/ASPなどを使った組込み開発では、配線やポート設定などの準備で、やりたい事までの道のりが長くなりそうで、気が重くなります。 そんな時は、実機を使わずにVisual Studioなどでコードを書いて、Windowsアプリとしてデバッグしてから、実機に入れてみたりしています。 ただし、TOPPERS/ASPなどRTOSを使ったソフトだと、マルチタスクで動作さてデバッグすることは出来ません。 そこで、setjmp/longjmpを使用してTOPPERS/ASP3のディスパッチャーを実装してWindowsのソフトでマルチタスク動作をさせてみました。 setjmp/longjmpとマルチタスク RTOSでマルチタスクを実現するには、ディスパッチャーと呼ばれているCPUコンテキストの切り替

              setjmp/longjmpでタスク切り替えしてみた - Qiita
            • [C言語] setjmp() と longjmp() の使いかた | Tech控え帳

              C言語の標準ライブラリ関数 setjmp() と longjmp() を呼び出すことで多段の関数呼出階層を飛び越えるジャンプ(いわゆるGOTO処理)を実現できます。しかしながら、現代的なプログラミングでは GOTO文 が忌避されるように、setjmp() と longjmp() を使ったジャンプも推奨されません。やむを得ず setjmp() と longjmp() で実装された既存のソースコードを理解するための助けとなることを目論んだ解説です。 1. 単純なロングジャンプの例 1.1. サンプル・ソースコード #include <stdio.h> #include <stdlib.h> #include <setjmp.h> jmp_buf jump_buffer; /* longjmp() から復帰したときに復元するためのバッファ */ void top_function(void);

              1