瀏覽代碼

src/lib.rs: fix bytecode in some examples

Some doc examples have programs written in bytecode with assembly
instructions written in comments. Some of the "mov r0, 0" instructions
were not correct, fix them.

I just happened to notice those errors, I haven't run any particular
test to double check all instructions.
Quentin Monnet 6 年之前
父節點
當前提交
af2495e891
共有 1 個文件被更改,包括 3 次插入3 次删除
  1. 3 3
      src/lib.rs

+ 3 - 3
src/lib.rs

@@ -133,7 +133,7 @@ impl<'a> EbpfVmMbuff<'a> {
     ///
     /// ```
     /// let prog1 = &[
-    ///     0xb7, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, // mov r0, 0
+    ///     0xb7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // mov r0, 0
     ///     0x95, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00  // exit
     /// ];
     /// let prog2 = &[
@@ -778,7 +778,7 @@ impl<'a> EbpfVmFixedMbuff<'a> {
     ///
     /// ```
     /// let prog1 = &[
-    ///     0xb7, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, // mov r0, 0
+    ///     0xb7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // mov r0, 0
     ///     0x95, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00  // exit
     /// ];
     /// let prog2 = &[
@@ -1069,7 +1069,7 @@ impl<'a> EbpfVmRaw<'a> {
     ///
     /// ```
     /// let prog1 = &[
-    ///     0xb7, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, // mov r0, 0
+    ///     0xb7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // mov r0, 0
     ///     0x95, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00  // exit
     /// ];
     /// let prog2 = &[