• R/O
  • HTTP
  • SSH
  • HTTPS

提交

標籤
無標籤

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

GNU Binutils with patches for OS216


Commit MetaInfo

修訂d73be6116811aeaedd1863c2597ede78be3cf4e5 (tree)
時間2020-06-26 03:34:29
作者David Faust <david.faust@orac...>
CommiterJose E. Marchesi

Log Message

cpu: fix offset16 type, update c-calls in bpf.cpu

Correct the type of the offset16 field to HI, and simplify memory
accesses which use it. Also update c-calls in semantics for a
few instructions.

cpu/ChangeLog:

2020-06-25 David Faust <david.faust@oracle.com>

* bpf.cpu (f-offset16): Change type from INT to HI.
(dxli): Simplify memory access.
(dxsi): Likewise.
(define-endian-insn): Update c-call in semantics.
(dlabs) Likewise.
(dlind) Likewise.

Change Summary

差異

--- a/cpu/ChangeLog
+++ b/cpu/ChangeLog
@@ -1,3 +1,12 @@
1+2020-06-25 David Faust <david.faust@oracle.com>
2+
3+ * bpf.cpu (f-offset16): Change type from INT to HI.
4+ (dxli): Simplify memory access.
5+ (dxsi): Likewise.
6+ (define-endian-insn): Update c-call in semantics.
7+ (dlabs) Likewise.
8+ (dlind) Likewise.
9+
110 2020-06-02 Jose E. Marchesi <jose.marchesi@oracle.com>
211
312 * bpf.cpu (define-bpf-isa): Set base-insn-bitsize to 64.
--- a/cpu/bpf.cpu
+++ b/cpu/bpf.cpu
@@ -273,7 +273,7 @@
273273 ;; difficulty: we put them in their own instruction word so the
274274 ;; byte-endianness will be properly applied.
275275
276-(dwf f-offset16 "eBPF offset field" (all-isas) 16 16 15 16 INT)
276+(dwf f-offset16 "eBPF offset field" (all-isas) 16 16 15 16 HI)
277277 (dwf f-imm32 "eBPF 32-bit immediate field" (all-isas) 32 32 31 32 INT)
278278
279279 ;; For the disjoint 64-bit signed immediate, however, we need to use a
@@ -488,7 +488,7 @@
488488 (+ (f-offset16 0) ((.sym f-src x-endian) 0) (.sym dst x-endian) endsize
489489 OP_CLASS_ALU x-op-src OP_CODE_END)
490490 (set (.sym dst x-endian)
491- (c-call DI "bpfbf_end" (.sym dst x-endian) endsize))
491+ (c-call DI (.str "bpfbf_end" x-suffix) (.sym dst x-endian) endsize))
492492 ()))
493493
494494 (define-endian-insn "le" OP_SRC_K le)
@@ -538,11 +538,7 @@
538538 (mem DI
539539 (add DI
540540 (reg DI h-gpr 6) ;; Pointer to struct sk_buff
541- (const DI 0))) ;; XXX offsetof
542- ;; (struct sk_buff, data) XXX but the offset
543- ;; depends on CONFIG_* options, so this should
544- ;; be configured in the simulator and driven by
545- ;; command-line options. Handle with a c-call.
541+ (c-call "bpfbf_skb_data_offset")))
546542 imm32)))
547543 ;; XXX this clobbers R1-R5
548544 ()))
@@ -572,11 +568,7 @@
572568 (mem DI
573569 (add DI
574570 (reg DI h-gpr 6) ;; Pointer to struct sk_buff
575- (const DI 0))) ;; XXX offsetof
576- ;; (struct sk_buff, data) XXX but the offset
577- ;; depends on CONFIG_* options, so this should
578- ;; be configured in the simulator and driven by
579- ;; command-line options. Handle with a c-call.
571+ (c-call "bpfbf_skb_data_offset")))
580572 (add DI
581573 (.sym src x-endian)
582574 imm32))))
@@ -612,7 +604,7 @@
612604 OP_CLASS_LDX (.sym OP_SIZE_ x-size) OP_MODE_MEM)
613605 (set x-mode
614606 (.sym dst x-endian)
615- (mem x-mode (add DI (.sym src x-endian) (ext DI (trunc HI offset16)))))
607+ (mem x-mode (add DI (.sym src x-endian) offset16)))
616608 ()))
617609
618610 (define-pmacro (dxsi x-basename x-suffix x-size x-endian x-mode)
@@ -623,7 +615,7 @@
623615 (+ (f-imm32 0) offset16 (.sym src x-endian) (.sym dst x-endian)
624616 OP_CLASS_STX (.sym OP_SIZE_ x-size) OP_MODE_MEM)
625617 (set x-mode
626- (mem x-mode (add DI (.sym dst x-endian) (ext DI (trunc HI offset16))))
618+ (mem x-mode (add DI (.sym dst x-endian) offset16))
627619 (.sym src x-endian)) ;; XXX address is section-relative
628620 ()))
629621