Codebase list golang-golang-x-sys / 0fcbb8f
unix: add linux constants and types for PPS devices ioctl's After trying to implement Pulse Per Second devices in go, I found that the ioctl values and structs where not in the unix package yet: ~# strace ppstest /dev/pps0 |& grep ioctl ioctl(3, PPS_GETPARAMS, 0xbee63b18) = 0 ioctl(3, PPS_GETCAP, 0xbee63b84) = 0 ioctl(3, PPS_GETPARAMS, 0xbee63b18) = 0 ioctl(3, PPS_SETPARAMS, 0xbee63b18) = 0 ioctl(3, PPS_FETCH, 0xbee63b00) = 0 ioctl(3, PPS_FETCH, 0xbee63b00) = 0 ioctl(3, PPS_FETCH, 0xbee63b00) = 0 ioctl(3, PPS_FETCH, 0xbee63b00) = 0 ioctl(3, PPS_FETCH, 0xbee63b00) = 0 This commit should add them. Change-Id: If1225ab7c4c38aad5d8ae841d1fdebfa45055549 GitHub-Last-Rev: c1469112b8d73d711d3038a2a0fec19e83690486 GitHub-Pull-Request: golang/sys#90 Reviewed-on: https://go-review.googlesource.com/c/sys/+/265217 Trust: Tobias Klauser <tobias.klauser@gmail.com> Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com> Reviewed-by: Matt Layher <mdlayher@gmail.com> Ben Cartwright-Cox authored 3 years ago Tobias Klauser committed 3 years ago
16 changed file(s) with 244 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
112112 #include <linux/nexthop.h>
113113 #include <linux/openat2.h>
114114 #include <linux/perf_event.h>
115 #include <linux/pps.h>
115116 #include <linux/random.h>
116117 #include <linux/rtc.h>
117118 #include <linux/rtnetlink.h>
25752576 // Watchdog API
25762577
25772578 type WatchdogInfo C.struct_watchdog_info
2579
2580 // PPS API
2581
2582 type PPSFData C.struct_pps_fdata
2583
2584 type PPSKParams C.struct_pps_kparams
2585
2586 type PPSKInfo C.struct_pps_kinfo
2587
2588 type PPSKTime C.struct_pps_ktime
2589
2590 const (
2591 PPS_GETPARAMS = C.PPS_GETPARAMS
2592 PPS_SETPARAMS = C.PPS_SETPARAMS
2593 PPS_GETCAP = C.PPS_GETCAP
2594 PPS_FETCH = C.PPS_FETCH
2595 )
232232 #include <linux/net_namespace.h>
233233 #include <linux/nsfs.h>
234234 #include <linux/perf_event.h>
235 #include <linux/pps.h>
235236 #include <linux/ptrace.h>
236237 #include <linux/random.h>
237238 #include <linux/reboot.h>
26372637 Version uint32
26382638 Identity [32]uint8
26392639 }
2640
2641 type PPSFData struct {
2642 Info PPSKInfo
2643 Timeout PPSKTime
2644 }
2645
2646 type PPSKParams struct {
2647 Api_version int32
2648 Mode int32
2649 Assert_off_tu PPSKTime
2650 Clear_off_tu PPSKTime
2651 }
2652
2653 type PPSKTime struct {
2654 Sec int64
2655 Nsec int32
2656 Flags uint32
2657 }
601601 Peer uint32
602602 Id [16]int8
603603 }
604
605 type PPSKInfo struct {
606 Assert_sequence uint32
607 Clear_sequence uint32
608 Assert_tu PPSKTime
609 Clear_tu PPSKTime
610 Current_mode int32
611 }
612
613 const (
614 PPS_GETPARAMS = 0x800470a1
615 PPS_SETPARAMS = 0x400470a2
616 PPS_GETCAP = 0x800470a3
617 PPS_FETCH = 0xc00470a4
618 )
618618 Peer uint32
619619 Id [16]int8
620620 }
621
622 type PPSKInfo struct {
623 Assert_sequence uint32
624 Clear_sequence uint32
625 Assert_tu PPSKTime
626 Clear_tu PPSKTime
627 Current_mode int32
628 _ [4]byte
629 }
630
631 const (
632 PPS_GETPARAMS = 0x800870a1
633 PPS_SETPARAMS = 0x400870a2
634 PPS_GETCAP = 0x800870a3
635 PPS_FETCH = 0xc00870a4
636 )
595595 Peer uint32
596596 Id [16]uint8
597597 }
598
599 type PPSKInfo struct {
600 Assert_sequence uint32
601 Clear_sequence uint32
602 Assert_tu PPSKTime
603 Clear_tu PPSKTime
604 Current_mode int32
605 _ [4]byte
606 }
607
608 const (
609 PPS_GETPARAMS = 0x800470a1
610 PPS_SETPARAMS = 0x400470a2
611 PPS_GETCAP = 0x800470a3
612 PPS_FETCH = 0xc00470a4
613 )
597597 Peer uint32
598598 Id [16]int8
599599 }
600
601 type PPSKInfo struct {
602 Assert_sequence uint32
603 Clear_sequence uint32
604 Assert_tu PPSKTime
605 Clear_tu PPSKTime
606 Current_mode int32
607 _ [4]byte
608 }
609
610 const (
611 PPS_GETPARAMS = 0x800870a1
612 PPS_SETPARAMS = 0x400870a2
613 PPS_GETCAP = 0x800870a3
614 PPS_FETCH = 0xc00870a4
615 )
601601 Peer uint32
602602 Id [16]int8
603603 }
604
605 type PPSKInfo struct {
606 Assert_sequence uint32
607 Clear_sequence uint32
608 Assert_tu PPSKTime
609 Clear_tu PPSKTime
610 Current_mode int32
611 _ [4]byte
612 }
613
614 const (
615 PPS_GETPARAMS = 0x400470a1
616 PPS_SETPARAMS = 0x800470a2
617 PPS_GETCAP = 0x400470a3
618 PPS_FETCH = 0xc00470a4
619 )
600600 Peer uint32
601601 Id [16]int8
602602 }
603
604 type PPSKInfo struct {
605 Assert_sequence uint32
606 Clear_sequence uint32
607 Assert_tu PPSKTime
608 Clear_tu PPSKTime
609 Current_mode int32
610 _ [4]byte
611 }
612
613 const (
614 PPS_GETPARAMS = 0x400870a1
615 PPS_SETPARAMS = 0x800870a2
616 PPS_GETCAP = 0x400870a3
617 PPS_FETCH = 0xc00870a4
618 )
600600 Peer uint32
601601 Id [16]int8
602602 }
603
604 type PPSKInfo struct {
605 Assert_sequence uint32
606 Clear_sequence uint32
607 Assert_tu PPSKTime
608 Clear_tu PPSKTime
609 Current_mode int32
610 _ [4]byte
611 }
612
613 const (
614 PPS_GETPARAMS = 0x400870a1
615 PPS_SETPARAMS = 0x800870a2
616 PPS_GETCAP = 0x400870a3
617 PPS_FETCH = 0xc00870a4
618 )
601601 Peer uint32
602602 Id [16]int8
603603 }
604
605 type PPSKInfo struct {
606 Assert_sequence uint32
607 Clear_sequence uint32
608 Assert_tu PPSKTime
609 Clear_tu PPSKTime
610 Current_mode int32
611 _ [4]byte
612 }
613
614 const (
615 PPS_GETPARAMS = 0x400470a1
616 PPS_SETPARAMS = 0x800470a2
617 PPS_GETCAP = 0x400470a3
618 PPS_FETCH = 0xc00470a4
619 )
607607 Peer uint32
608608 Id [16]uint8
609609 }
610
611 type PPSKInfo struct {
612 Assert_sequence uint32
613 Clear_sequence uint32
614 Assert_tu PPSKTime
615 Clear_tu PPSKTime
616 Current_mode int32
617 _ [4]byte
618 }
619
620 const (
621 PPS_GETPARAMS = 0x400870a1
622 PPS_SETPARAMS = 0x800870a2
623 PPS_GETCAP = 0x400870a3
624 PPS_FETCH = 0xc00870a4
625 )
607607 Peer uint32
608608 Id [16]uint8
609609 }
610
611 type PPSKInfo struct {
612 Assert_sequence uint32
613 Clear_sequence uint32
614 Assert_tu PPSKTime
615 Clear_tu PPSKTime
616 Current_mode int32
617 _ [4]byte
618 }
619
620 const (
621 PPS_GETPARAMS = 0x400870a1
622 PPS_SETPARAMS = 0x800870a2
623 PPS_GETCAP = 0x400870a3
624 PPS_FETCH = 0xc00870a4
625 )
625625 Peer uint32
626626 Id [16]uint8
627627 }
628
629 type PPSKInfo struct {
630 Assert_sequence uint32
631 Clear_sequence uint32
632 Assert_tu PPSKTime
633 Clear_tu PPSKTime
634 Current_mode int32
635 _ [4]byte
636 }
637
638 const (
639 PPS_GETPARAMS = 0x800870a1
640 PPS_SETPARAMS = 0x400870a2
641 PPS_GETCAP = 0x800870a3
642 PPS_FETCH = 0xc00870a4
643 )
621621 Peer uint32
622622 Id [16]int8
623623 }
624
625 type PPSKInfo struct {
626 Assert_sequence uint32
627 Clear_sequence uint32
628 Assert_tu PPSKTime
629 Clear_tu PPSKTime
630 Current_mode int32
631 _ [4]byte
632 }
633
634 const (
635 PPS_GETPARAMS = 0x800870a1
636 PPS_SETPARAMS = 0x400870a2
637 PPS_GETCAP = 0x800870a3
638 PPS_FETCH = 0xc00870a4
639 )
602602 Peer uint32
603603 Id [16]int8
604604 }
605
606 type PPSKInfo struct {
607 Assert_sequence uint32
608 Clear_sequence uint32
609 Assert_tu PPSKTime
610 Clear_tu PPSKTime
611 Current_mode int32
612 _ [4]byte
613 }
614
615 const (
616 PPS_GETPARAMS = 0x400870a1
617 PPS_SETPARAMS = 0x800870a2
618 PPS_GETCAP = 0x400870a3
619 PPS_FETCH = 0xc00870a4
620 )