Compare commits

...

655 Commits

Author SHA1 Message Date
Oscar Zhao
0799db0cd6 merge from main 2023-04-03 04:17:38 -04:00
Peter Holm
26562cbd11 stress2: Add comment about problem found. Disable run of this test 2023-04-03 04:15:41 -04:00
Bjoern A. Zeeb
5a249f91a3 LinuxKPI: 802.11: remove extra spaces
Remove two extra spaces.  No functional change.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2023-04-03 04:15:41 -04:00
Zhenlei Huang
5ddfb2058d ifconfig: Improve VLAN identifier parsing
VLAN identifier 0xFFF is reserved. It must not be configured or
transmitted.

Also validate during parsing to prevent potential integer overflow.

Reviewed by:	#network, melifaro
Fixes:		c7cffd65c5 Add support for stacked VLANs (IEEE 802.1ad, AKA Q-in-Q)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D39282
2023-04-03 04:15:41 -04:00
Zhenlei Huang
e04d79ac41 lagg(4): Tap traffic after protocol processing
Different lagg protocols have different means and policies to process incoming
traffic. For example, for failover protocol, by default received traffic is only
accepted when they are received through the active port. For lacp protocol, LACP
control messages are tapped off, also traffic will be dropped if they are
received through the port which is not in collecting state or is not joined to
the active aggregator. It confuses if user dump and see inbound traffic on
lagg(4) interfaces but they are actually silently dropped and not passed into
the net stack.

Tap traffic after protocol processing so that user will have consistent view of
the inbound traffic, meanwhile mbuf is set with correct receiving interface and
bpf(4) will diagnose the right direction of inbound packets.

PR:		270417
Reviewed by:	melifaro (previous version)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D39225
2023-04-03 04:15:41 -04:00
Zhenlei Huang
4f98db4019 infiniband: Widen NET_EPOCH coverage
From static code analysis, some device drivers (cxgbe, mlx4, mthca, and qlnx)
do not enter net epoch before lagg_input_infiniband(). If IPoIB interface is a
member of lagg(4) interface, and after returning from lagg_input_infiniband()
the receiving interface of mbuf is set to lagg(4) interface, then when
concurrently destroying the lagg(4) interface, there is a small window that the
interface gets destroyed and becomes invalid before infiniband_input() re-enter
net epoch, thus leading use-after-free.

Widen NET_EPOCH coverage to prevent use-after-free.

Thanks hselasky@ for testing with mlx5 devices.

Reviewed by:	hselasky
Tested by:	hselasky
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D39275
2023-04-03 04:15:41 -04:00
Alexander V. Chernikov
3ed80ea71c netlink: add NETLINK to the DEFAULTS for each architecture
NETLINK is going to replace rtsock and a number of other ioctl/sysctl interfaces.
In-base utilies such as route(8), netstat(8) and soon ifconfig(8)
 are being converted to use netlink sockets as a transport between
 kernel and userland.
In the current configuration, it still possible have the kernel
 without NETLINK (`nooptions NETLINK`) and use the aforementioned
 utilies by buidling the world with `WITHOUT_NETLINK` src.conf knob.
However, this approach does not cover the cases when person unintentionally
 builds a custom kernel without netlink and tries to use the standard userland.

This change adds `option NETLINK` to the default options for each
 architecture, fixing the custom kernel issue.
For arm, this change uses `std.armv6` and `std.armv7` (netlink already in)
 instead of DEFAULTS.

Reviewed By: imp
Differential Revision: https://reviews.freebsd.org/D39339
2023-04-03 04:15:40 -04:00
Emmanuel Vadot
8b4d56823b linuxkpi: hdmi: Remove wrong dependency on wlan
Copy-paste mistake.

Reported by:	Alastair Hogge <agh@riseup.net>
Fixes:	f1d7ae31d4 ("linuxkpi: Add hdmi helpers")
2023-04-03 04:15:40 -04:00
Alexander V. Chernikov
8fcaff33d6 ping: fix failing test_pinger[_3_1_verbose_false] test. 2023-04-03 04:15:40 -04:00
Alexander V. Chernikov
b411d13c2b route: add support for exact-prefix-match via netlink. 2023-04-03 04:15:40 -04:00
Alexander V. Chernikov
80616931d6 netlink: allow exact-match route lookups via RTM_GETROUTE.
Use already-existing RTM_F_PREFIX rtm_flag to indicate that the
 request assumes exact-prefix lookup instead of the
 longest-prefix-match.

MFC after:	2 weeks
2023-04-03 04:15:40 -04:00
Alexander V. Chernikov
d53a61632d netlink: fix NULL check in the default route snl(3) parser.
CID:		1506959
MFC after:	2 weeks
2023-04-03 04:15:40 -04:00
Alexander V. Chernikov
2fb696c195 netlink: fix snl_read_reply_multi().
CID:		1506956
MFC after:	2 weeks
2023-04-03 04:15:40 -04:00
Alexander V. Chernikov
0728c0b06d tests: fix utils import in netlink tests
MFC after:	2 weeks
2023-04-03 04:15:40 -04:00
Dmitry Chagin
09b326eed9 pseudofs: Simplify pfs_visible_proc
Reviewed by:		des
Differential revision:	https://reviews.freebsd.org/D39383
MFC after:		1 month
2023-04-03 04:15:39 -04:00
Dmitry Chagin
c1827839fe pseudofs: Allow vis callback to be called for a named node
This will be used later in the linsysfs module to filter out VNETs.

Reviewed by:		des
Differential revision:	https://reviews.freebsd.org/D39382
MFC after:		1 month
2023-04-03 04:15:39 -04:00
Dmitry Chagin
6bb559f644 pseudofs: Microoptimize struct pfs_node
Since 81167243b the size of struct pfs_node is 280 bytes, so the kernel
memory allocator takes memory from 384 bytes sized bucket. However, the
length of the node name is mostly short, e.g., for Linux emulation layer
it is up to 16 bytes. The size of struct pfs_node w/o pfs_name is 152
bytes, i.e., we have 104 bytes left to fit the node name into the 256
bytes-sized bucket.

Reviewed by:		des
Differential revision:	https://reviews.freebsd.org/D39381
MFC after:		1 month
2023-04-03 04:15:39 -04:00
Cy Schubert
d7cd2eae4d heimdal: Do not build a redundant source file
Heimdal's lib/hdb/db3.c is only built if DB3 is enabled, i.e. #if HAVE_DB3.
FreeBSD's bdb is DB1. Therefore the entire db3.c file is #ifdef'd out.
Let's avoid building a file that results in a useless object file.

MFC after:	1 week
2023-04-03 04:15:39 -04:00
Navdeep Parhar
1b5e9011cd cxgbetool(8): Add support for tracing loopback traffic for a port.
Use lo<n> to tap the loopback for port <n>.

MFC after:	1 week
Sponsored by:	Chelsio Communications
2023-04-03 04:15:39 -04:00
Navdeep Parhar
a3c4ff6d6c cxgbe(4): Allow tracing filters on loopback ports.
Each physical port has an associated loopback tx channel and anything
transmitted over that channel by the driver is looped back internally by
the hardware as if received on that physical port.  This change allows
tracing filters to be installed in this loopback path.

MFC after:	1 week
Sponsored by:	Chelsio Communications
2023-04-03 04:15:39 -04:00
Navdeep Parhar
a3d7032106 cxgbe/iw_cxgbe: Always set a vnet around calls to IN_LOOPBACK.
This is catch up with efe58855f3.

MFC after:	1 week
Sponsored by:	Chelsio Communications
2023-04-03 04:15:39 -04:00
Rick Macklem
5bf33cc297 nfscommon: Add support for an NFSv4 operation bitmap
NFSv4.1/4.2 uses operation bitmaps for various operations,
such as the SP4_MACH_CRED case for ExchangeID.
This patch adds support for operation bitmaps so that
support for SP4_MACH_CRED can be added to the NFSv4.1/4.2
server in a future commit.

This commit should not change any NFSv4.1/4.2 semantics.

MFC after:	3 months
2023-04-03 04:15:38 -04:00
Alexander V. Chernikov
30744c3765 tests: refactor atf_python a bit
* Move more logic from conftest.py to the actual atf_pytest handler
* Move nodeid_to_method_name() to the utils.py so it can be shared

MFC after:	2 weeks
2023-04-03 04:15:38 -04:00
Alexander V. Chernikov
705e4cfdc4 tests: add support for parsing generic netlink families.
MFC after:	2 weeks
Differential Revision: https://reviews.freebsd.org/D39370
2023-04-03 04:15:38 -04:00
Alexander V. Chernikov
01bc99c246 tests: split netlink.py into multiple files to impove maintainability.
This diff does not contain any functional changes.
Its sole purpose is splitting netlink.py into smaller chunks.
The new code simplifies the upcoming generic netlink support
introduction.

MFC after:	2 weeks
Differential Revision: https://reviews.freebsd.org/D39365
2023-04-03 04:15:38 -04:00
Cheng Cui
10c31a9f76 Add myself (cc) as a src commiter.
Summary: Adding mentor relationships for cc when committing new diffs.

Reviewed by: rscheff (mentor), tuexen (mentor)
Approved by: rscheff (mentor), tuexen (mentor)
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D39368
2023-04-03 04:15:38 -04:00
黃清隆
f2645ab309 arcmsr(4): Fix reading buffer empty length error.
MFC after:	2 weeks
2023-04-03 04:15:38 -04:00
Rene Ladan
97a504c703 Complete my mentees list.
Originally submitted by rnagy.
2023-04-03 04:15:38 -04:00
Bjoern A. Zeeb
1b9dc4f25a LinuxKPI: 802.11: adjust locking
Split up the lhw lock and the scan lock.  The latter is a mtx
while the former changes from mtx to sx as mac80211 downcalls may
sleep (and the ic lock is not usable in that case either and a larger
project to fix).
This will also enforce some lookups under lock (mostly scan) as well
as general protection for more compat code and avoid a possible
deadlock with one of the upcoming callbacks from driver into the
compat code.

Sponsored by:	The FreeBSD Foundation
MFC after:	7 days
2023-04-03 04:15:37 -04:00
Joseph Mingrone
44e2c6f9a5 Import libpcap 1.10.3
Reviewed by:	emaste
Sponsored by:	The FreeBSD Foundation
2023-04-03 04:15:36 -04:00
Ed Maste
d7a85845cd kqueue: tidy up indentation in man page example
Fixes: e07b0c12ba ("[patch][doc] Fix EXAMPLE in kqueue(2)")
Sponsored by:	The FreeBSD Foundation
2023-04-03 04:14:08 -04:00
Gleb Smirnoff
dbff6b43c6 amd64 loader: plug hard hang with serial console enabled
The hang basically bricks a physical box and it can be recovered
only if you are able to boot from alternate media.  This isn't a
perfect fix, but throw it in before loader experts decide on
proper one.

Submitted by:	whu
Fixes:		927358dd98
2023-04-03 04:14:08 -04:00
John Baldwin
b0a514e5f7 fuse: Remove set but unused cr_gid variable.
Reviewed by:	asomers
Reported by:	GCC
Differential Revision:	https://reviews.freebsd.org/D39350
2023-04-03 04:14:08 -04:00
John Baldwin
955bff0f64 LinuxKPI: Appease -Wunused-but-set-variable warnings from GCC.
- Mark assert dummy variables as __unused.

- Use a dummy (void) cast of the flags argument passed to
  spin_unlock_irqrestore so it gets treated as used.

Reviewed by:	manu, hselasky
Differential Revision:	https://reviews.freebsd.org/D39349
2023-04-03 04:14:08 -04:00
John Baldwin
19867adf44 nanobsd: Remove MIPS configurations.
Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D39332
2023-04-03 04:14:08 -04:00
Zhenlei Huang
4fe1b1de9c lacp: Use C99 bool for boolean return value
This improves readability.

No functional change intended.

MFC after:	1 week
2023-04-03 04:14:07 -04:00
Mitchell Horne
e5a8fc508e arm64/gicv3: correct the size of the distributor resource
Use the GICD_SIZE macro (0x10000), which is half the size of the current
fixed-sized mapping (128 * 1024 == 0x20000).

In ARM64 Hyper-V instances, it seems the Distributor's registers are
located immediately preceding a range of physical memory in the bus
address space. Thus, when ram0 is attaching and attempts to reserve
SYS_RES_MEMORY resources corresponding to its physmem ranges, it fails,
because the first 0x10000 bytes of this range are already owned by gic0.

PR:		270415
Reported by:	whu
Tested by:	whu
Differential Revision:	https://reviews.freebsd.org/D39260
2023-04-03 04:14:07 -04:00
Mark Johnston
6b33e87f62 arm64: Move the initial kernel stack out of the init_pagetables section
init_pagetables is mapped into the segment containing the BSS, but does
not get zeroed by locore.  It is used for bootstrap page table pages.

It happens that the bootstrap kernel stack is also placed in that
section, but there's no reason it shouldn't live in the BSS, so move it
there.  No functional change intended.

Reviewed by:	andrew
MFC after:	1 week
Sponsored by:	Klara, Inc.
Sponsored by:	Juniper Networks
Differential Revision:	https://reviews.freebsd.org/D39367
2023-04-03 04:14:07 -04:00
Andrew Turner
68b7e8fa3a Move arm64 EENTRY uses before ENTRY
The ENTRY macro adds instructions to the start of a function but not
EENTRY. To use these instructions in both functions move the EENTRY
use before the ENTRY use.

Sponsored by:	Arm Ltd
2023-04-03 04:14:07 -04:00
Andrew Gallatin
f02cc2ff2b bectl: Improve error message when ZFS root is not found.
When recovering a system that is unbootable due to some
problem with the active BE, it is likely you'll be booted
from a rescue image running UFS.  In this case, bectl
needs help finding the zpool root that you want to operate
on.  In this case, improve the error message to suggest
specifying a root, rather than just emitting a generic
error message that might imply, to the naive user, that
there is a ZFS compatibility issue between the rescue
image and the on-disk ZFS pool.

Reviewed by: imp, kevans
Sponsored by: Netflix
Differential Revision:	https://reviews.freebsd.org/D39346
2023-04-03 04:14:07 -04:00
Ed Maste
93dd6b19f3 makefs: improve some cd9660 error messages
Obtained from:	OpenBSD
Sponsored by:	The FreeBSD Foundation
2023-04-03 04:14:07 -04:00
Cheng Cui
cd5c6d633b Revert "Add myself (cc) as a src commiter."
Summary: This reverts commit 134ced89c4.

Reviewers: rscheff, tuexen
Subscribers: imp
Approved by: tuexen (mentor)
Differential Revision: https://reviews.freebsd.org/D39363
2023-04-03 04:14:07 -04:00
Mark Johnston
b8f88877a5 arm64: Ensure that thread0's PCB flags are initialized
On arm64, the PCB is stored at the top of the thread stack.  For thread0
this comes from the static "initstack" region, which is placed in the
.init_pagetable section, which is not part of the BSS and thus doesn't
get zeroed by locore.  (See the comment in ldscript.arm64.)  It is thus
possible for the pcb_flags field to be uninitialized, which can result
in PCB_SINGLE_STEP being set.

Fix this by simply initializing the field.  A separate commit will move
initstack out of the .init_pagetable section, since it has no reason to
be there, but it is preferable to explicitly initialize PCB fields
anyway.  In particular, regular kernel stacks are not zeroed upon
allocation, so we should be consistent here.

Reviewed by:	andrew
MFC after:	1 week
Sponsored by:	Klara, Inc.
Sponsored by:	Juniper Networks
Differential Revision:	https://reviews.freebsd.org/D39343
2023-04-03 04:14:06 -04:00
Dmitry Chagin
e0cac84ae0 linux(4): Fix opt_netlink.h inclusion
Add opt_netlink.h to the linux_common module, on i386, where we don't
uses linux_common module, move opt_netlink.h inclusion under
i386 condition.

MFC after:		2 weeks
2023-04-03 04:14:06 -04:00
Dmitry Chagin
a3e9cabc27 linux(4): Move inclusion of i386-specific files under common condition 2023-04-03 04:14:06 -04:00
Dmitry Chagin
901c1b5dd3 Revert "linsysfs(4): Reimplement listnics() using ifAPI"
This reverts commit 0b56641cfc.

As it poorly interacts with vnet subsystem
2023-04-03 04:14:06 -04:00
Kristof Provost
22a4aadf8c carp: allow commands to use interface name rather than index
Get/set commands can now choose to provide the interface name rather
than the interface index. This allows userspace to avoid a call to
if_nametoindex().

Suggested by:	melifaro
Reviewed by:	melifaro
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D39359
2023-04-03 04:14:06 -04:00
Andrew Turner
9185dee208 Handle the arm64 unknown exception separately
Rather than falling through to the default case handle the unknown
exception with its own panic message. As ESR_EL1 is zero for this
exception stop printing it.

Sponsored by:	Arm Ltd
2023-04-03 04:14:06 -04:00
Bjoern A. Zeeb
afa54ae2d9 LinuxKPI: 802.11: use ic_printf more consistently
Rather than printing ic_name ourselves (or not at all) use ic_printf()
as a common function from net80211 where possible.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2023-04-03 04:14:06 -04:00
Juraj Lutter
4628607727 committers-ports.dot: Fix double space
Fix double space in pgollucci's entry.

Approved by:		fernape
Differential Revision:	https://reviews.freebsd.org/D39345
2023-04-03 04:14:06 -04:00
Corvin Köhne
ef4cad263d bhyve: scan PCI device functions to find host LPC
At least on some AMD devices the host LPC bridge could be located as
seperate function of another PCI device.

Fixes:			f4ceaff56d
MFC after:		1 week
Sponsored by:		Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D39310
2023-04-03 04:14:05 -04:00
Cheng Cui
9bd76b29db Add myself (cc) as a src commiter.
Summary: Adding mentor relationships for cc when committing new diffs.

Reviewers: rscheff, tuexen
Subscribers: imp
Reviewed by:    rscheff (mentor), tuexen (mentor)
Approved by:    rscheff (mentor), tuexen (mentor)
MFC after:      3 days
Differential Revision: https://reviews.freebsd.org/D39342
2023-04-03 04:14:05 -04:00
Mark Johnston
80b9892380 cap_dns tests: Convert to ATF, avoid failing when lookups don't resolve
The cap_dns tests require Internet access.  Currently they fail when
that's not available, which for CI purposes is undesirable.  Let's
instead skip the tests if none of the non-casper name/addr lookups
succeed.

To that end:
- Convert the tests to ATF so that skipping is easier to implement.
- Break up the tests into separate test cases.
- If one of the system (i.e., non-casper) lookup functions fails, skip
  the test if all of them failed, otherwise fail the tests, since
  partial failure indicates something is flaky and deserves a closer
  look.

Reviewed by:	oshogbo
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D39241
2023-04-03 04:14:05 -04:00
Mark Johnston
86dbd121b1 cap_sysctl tests: Serialize
These tests fail spuriously when run in parallel, since some of them
write a value to a global sysctl, read it back, and expect to see the
written value.  These tests complete quite quickly in any case.

MFC after:	1 week
2023-04-03 04:14:05 -04:00
Mark Johnston
0c6a7587a3 pf tests: Serialize
These tests reuse jail names and cannot run in parallel.  Until this is
fixed - which is desirable since these takes take a while to run - tell
kyua to serialize them.

MFC after:	1 week
2023-04-03 04:14:05 -04:00
Mark Johnston
e2b8c9d7b3 if_ovpn tests: Serialize
These tests reuse jail names and so cannot run in parallel.

MFC after:	1 week
2023-04-03 04:14:05 -04:00
Mark Johnston
e59b07ec91 acl tests: Serialize
Some of these tests import a ZFS pool with a hard-coded name, so they
cannot run in parallel.

MFC after:	1 week
2023-04-03 04:14:05 -04:00
Mark Johnston
57cf6309af aio tests: Use unique names for zvols
Otherwise tests which create zvols cannot be run in parallel.

MFC after:	1 week
2023-04-03 04:14:04 -04:00
Mark Johnston
7a3dea61ac netpfil tests: Serialize
These tests reuse jail names and so cannot run in parallel.

MFC after:	1 week
2023-04-03 04:14:04 -04:00
Ed Maste
d79e4ea0bc fs/cd9660: add header include guards
Diff reduction against NetBSD files in sys/fs/cd9660/ and OpenBSD files
in usr.sbin/makefs/cd9660/.

Sponsored by:	The FreeBSD Foundation
2023-04-03 04:14:04 -04:00
Konstantin Belousov
36212092dc ifcapnv: cap_bit in ifcap2_nv_bit_names[] is bit, not index
Sponsored by:	Nvidia networking
2023-04-03 04:14:04 -04:00
Joseph Mingrone
46951173bc tcpdump: Backport a fix required for upcoming libpcap update
See also:	51f9c3b947
Reviewed by:	emaste
Sponsored by:	The FreeBSD Foundation
2023-04-03 04:14:04 -04:00
John Baldwin
4331016c4f sys: Disable errors for -Wunused-function on GCC.
This matches the handling of this warning on clang.
2023-04-03 04:14:04 -04:00
Ed Maste
c9969a3c5c makefs: #define Apple Partition bits
NetBSD defines these in sys/bootblock.h, which we don't have.  Add local
defintions in cd9660_eltorito.c (as OpenBSD did) to reduce diffs between
the three makefs implementations.

Obtained from:	OpenBSD
Sponsored by:	The FreeBSD Foundation
2023-04-03 04:14:04 -04:00
John Baldwin
c7b53f1b07 Add libcap_netdb.so.1 to the list of libcasper helper libraries.
Reported by:	Yuri <yuri@aetern.org>
Fixes:		7d8e1e8dd9 libcasper: Move helper libraries from /lib/casper to /lib.
2023-04-03 04:14:04 -04:00
Navdeep Parhar
93b2c0220a cxgbe(4): Remove dead code.
Fixes:	e7e0844422 cxgbe(4): Replace T4_PKT_TIMESTAMP with something slightly less hackish.
MFC after:	1 week
Sponsored by:	Chelsio Communications
2023-04-03 04:14:03 -04:00
Joseph Mingrone
68b76745f3 pflogd: Do not access obsolete structure member pcap.tzoff
This change is in preparation for a libpcap update.

See also:	d4d65e7c4c
Reviewed by:	emaste
Sponsored by:	The FreeBSD Foundation
2023-04-03 04:14:03 -04:00
Mark Johnston
f197a01c38 fdgrowtable tests: Address a set-but-not-used warning
MFC after:	1 week
2023-04-03 04:14:03 -04:00
Mark Johnston
71947e0a6a ktls tests: Populate sockaddr fields before binding
Reported by:	Jenkins
Fixes:		b4b33821fa ("ktls: Fix interlocking between ktls_enable_rx() and listen(2)")
2023-04-03 04:14:03 -04:00
Mark Johnston
25f6e9a70a graid3: Pre-allocate the timeout event structure
As in commit 2f1cfb7f63 ("gmirror: Pre-allocate the timeout event
structure"), graid3 must avoid M_WAITOK allocations in callout handlers.

Reported by:	graid3 regression tests
MFC after	2 weeks
2023-04-03 04:14:03 -04:00
Ed Maste
196370c4c8 makefs: correct "filname" typo
Obtained from:	NetBSD cd9660.c r1.58
2023-04-03 04:14:03 -04:00
Ed Maste
62e31ff149 memmem: add a note about other systems which have memmem
memmem started as a GNU extension but is now widely available.

Reviewed by:	mhorne (slightly earlier version)
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D39337
2023-04-03 04:14:03 -04:00
Corvin Köhne
348b05cdf0 bhyve: return EEXIST when adding a fwcfg item twice
Reviewed by:		rew
MFC after:		1 week
Sponsored by:		Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D39338
2023-04-03 04:14:02 -04:00
Ed Maste
817252099c makefs: Whitespace cleanup to sync with NetBSD 2023-04-03 04:14:02 -04:00
Hans Petter Selasky
dbdd815499 libusb(3): Implement libusb_init_context() and the needed structures and definitions.
Differential Revision:	https://reviews.freebsd.org/D38212
MFC after:	1 week
Sponsored by:	NVIDIA Networking
2023-04-03 04:14:02 -04:00
Fernando Apesteguía
330016cd91 committers-ports.dot: Use gj@ last commit date
Use the date of the last commit from gj@ (d276a4dfa6f5f3711808eff44ff20a92114b4d6e)
Note that for other developers the date is that when the commit bit was taken
in.
2023-04-03 04:14:02 -04:00
Fernando Apesteguía
64f2352144 committers-ports.dot: Fix alexbl entry and add gj
Reported by:	garyj@gmx.de yuri@aetern.org
2023-04-03 04:14:02 -04:00
Mark Johnston
f5d6f7cb47 kdb: Modify securelevel policy
Currently, sysctls which enable KDB in some way are flagged with
CTLFLAG_SECURE, meaning that you can't modify them if securelevel > 0.
This is so that KDB cannot be used to lower a running system's
securelevel, see commit 3d7618d8bf.  However, the newer mac_ddb(4)
restricts DDB operations which could be abused to lower securelevel
while retaining some ability to gather useful debugging information.

To enable the use of KDB (specifically, DDB) on systems with a raised
securelevel, change the KDB sysctl policy: rather than relying on
CTLFLAG_SECURE, add a check of the current securelevel to kdb_trap().
If the securelevel is raised, only pass control to the backend if MAC
specifically grants access; otherwise simply check to see if mac_ddb
vetoes the request, as before.

Add a new secure sysctl, debug.kdb.enter_securelevel, to override this
behaviour.  That is, the sysctl lets one enter a KDB backend even with a
raised securelevel, so long as it is set before the securelevel is
raised.

Reviewed by:	mhorne, stevek
MFC after:	1 month
Sponsored by:	Juniper Networks
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D37122
2023-04-03 04:14:02 -04:00
Ed Maste
2a9f0901e0 makefs: do not pass mode to open() call lacking O_CREAT
Obtained from:	OpenBSD ffs.c 1.35
2023-04-03 04:14:02 -04:00
Ed Maste
aabe1069e6 makefs: remove vestigial '?' cases from top-level getopt(3) loop
getopt(3) returns '?' when it encounters a flag not present in the in
the optstring or if a flag is missing its option argument.  We can
handle this case with the "default" failure case with no loss of
legibility.

Obtained from:	OpenBSD makefs.c 1.22
2023-04-03 04:14:01 -04:00
Fernando Apesteguía
3f5d4655fe committers-ports.dot: Fix alexbl entry
Copy-paste error.

Reported by:	dchagin
Fixes:		5faf90050e
2023-04-03 04:14:01 -04:00
Fernando Apesteguía
77836cd903 committers-ports.dot: Bring file up to date.
Many listed committers are actually alumni.

Related to this change: 52f5764598

Approved by:		bcr@
Differential Revision:	https://reviews.freebsd.org/D39340
2023-04-03 04:14:01 -04:00
Corvin Köhne
f2fa7b4196 bhyve: remove unnecessary const qualifier in acpi_device.h
Those const qualifier declare that the function doesn't change the
values internally. It makes no sense to add them in the header file.

Reviewed by:		markj
MFC after:		1 week
Sponsored by:		Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D39318
2023-04-03 04:14:01 -04:00
Alexander V. Chernikov
73559a7cbf netlink: Fix adding routes with nexthops on p2p interfaces.
Use full-featured ifa_ifwithroute() to guess route ifa/ifp
 instead of ifa_ifwithnet(). This change makes the route addition
 logic closer to the rt_getifa_fib() used by rtsock.

Reported by:	glebius
Tested by:	glebius
Differential Revision: https://reviews.freebsd.org/D39335
MFC after:	2 weeks
2023-04-03 04:14:01 -04:00
Alexander V. Chernikov
53587fff0e route: try to autoload netlink(4) module if not present in the kernel.
Differential Revision: https://reviews.freebsd.org/D39324
2023-04-03 04:14:01 -04:00
Mateusz Guzik
ffd2a1ec23 inet6: protect address manipulation with a lock
This is a total hack/bare minimum which follows inet4.

Otherwise 2 threads removing the same address can easily crash.

Reviewed by:	kp
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D39317
2023-04-03 04:14:01 -04:00
Fernando Apesteguía
3a41b1b8ee committers-doc.dot: bring file up to date
Long due task. Many developers should be in alumni by now.

Approved by:	docs (bcr, carlavilla)
Differential Revision:	D39309
2023-04-03 04:14:01 -04:00
Mark Johnston
bcf5c37f78 cross-build: Add secure_getenv() for MacOS cross builds
Reviewed by:	arichardson
Fixes:		68ca8363c7 ("libc: Use secure_getenv(3) where appropriate")
Differential Revision:	https://reviews.freebsd.org/D39295
2023-04-03 04:14:00 -04:00
Kirk McKusick
0b37f7c2e8 Improvement in UFS/FFS directory placement when doing mkdir(2).
The algorithm for laying out new directories was devised in the 1980s
and markedly improved the performance of the filesystem. In those days
large disks had at most 100 cylinder groups and often as few as 10-20.
Modern multi-terrabyte disks have thousands of cylinder groups. The
original algorithm does not handle these large sizes well. This change
attempts to expand the scope of the original algorithm to work well
with these much larger disks while still retaining the properties
of the original algorithm for small disks.

The filesystem implementation is divided into policy routines and
implementation routines. The policy routines can be changed in any
way desired without risk of corrupting the filesystem. The policy
requests are handled by the implementation layer. If the policy
asks for an available resource, it is granted. But if it asks for
an already in-use resource, then the implementation will provide
an available one nearby the request. Thus it is impossible for a
policy to double allocate. This change is limited to the policy
implementation.

This change updates the ffs_dirpref() routine which is responsible
for selecting the cylinder group into which a new directory should
be placed. If we are near the root of the filesystem we aim to
spread them out as much as possible. As we descend deeper from the
root we cluster them closer together around their parent as we
expect them to be more closely interactive. Higher-level directories
like usr/src/sys and usr/src/bin should be separated while the
directories in these areas are more likely to be accessed together
so should be closer. And directories within commands or kernel
subsystems should be closer still.

We pick a range of cylinder groups around the cylinder group of the
directory in which we are being created. The size of the range for
our search is based on our depth from the root of our filesystem.
We then probe that range based on how many directories are already
present. The first new directory is at 1/2 (middle) of the range;
the second is in the first 1/4 of the range, then at 3/4, 1/8, 3/8,
5/8, 7/8, 1/16, 3/16, 5/16, etc.

It is desirable to store the depth of a directory in its on-disk
inode so that it is available when we need it. We add a new field
di_dirdepth to track the depth of each directory. Because there are
few spare fields left in the inode, we choose to share an existing
field in the inode rather than having one of our own. Specifically
we create a union with the di_freelink field. The di_freelink field
is used to track inodes that have been unlinked but remain referenced.
It is not needed until a rmdir(2) operation has been done on a
directory. At that point, the directory has no contents and even
if it is kept active as a current directory is no longer able to
have any new directories or files created in it. Thus the use of
di_dirdepth and di_freelink will never coincide.

Reported by:  Timo Voelker
Reviewed by:  kib
Tested by:    Peter Holm
MFC after:    2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D39246
2023-04-03 04:14:00 -04:00
Ed Maste
94dd88aaf1 makefs: spelling
Obtained from:	OpenBSD msdosfs_fat.c 1.7
2023-04-03 04:14:00 -04:00
Ed Maste
d137461cd1 ssh: update FREEBSD-upgrade for upstream CheckHostIP default change
We changed the CheckHostIP default to "no" years ago.  Upstream has now
made the same change, so do not list it as a local change any longer.

I did not just remove the "Modified client-side defaults" section to
avoid having to renumber everything, and we may add a new local change
in the future.

Sponsored by:	The FreeBSD Foundation
2023-04-03 04:14:00 -04:00
John Baldwin
d9e1f5af69 Remove LLVM build glue for MIPS as a native architecture.
This does not remove LLVM_TARGET_MIPS.  Note that the only
MACHINE_ARCH values ending in 'hf' were all MIPS architectures, hence
removing the pattern matches for 'hf'.

Reviewed by:	emaste
Differential Revision:	https://reviews.freebsd.org/D39331
2023-04-03 04:14:00 -04:00
John Baldwin
49234dcf3a tests/sys/audit: Remove MIPS-specific sysarch(2) test.
Reviewed by:	emaste
Differential Revision:	https://reviews.freebsd.org/D39330
2023-04-03 04:14:00 -04:00
John Baldwin
8d7fd6c4a4 libarchive: Remove MIPS build glue.
Reviewed by:	emaste
Differential Revision:	https://reviews.freebsd.org/D39329
2023-04-03 04:14:00 -04:00
John Baldwin
18d896a510 libcompiler_rt/libgcc_s: Remove MIPS build glue.
Reviewed by:	emaste
Differential Revision:	https://reviews.freebsd.org/D39328
2023-04-03 04:13:59 -04:00
John Baldwin
4492971a96 libcasper: Move helper libraries from /lib/casper to /lib.
These libraries are linked to directly by applications rather than
opened at runtime via dlopen().

Discussed with:	oshogbo
Reviewed by:	markj, emaste
Differential Revision:	https://reviews.freebsd.org/D39245
2023-04-03 04:13:59 -04:00
Rick Macklem
112c0e600a nfsd.8: Update for nfsd running in jails
Nfsd can now be run in an appropriately
configured vnet jail.

This man page update adds some information
for this case.

This is a content change.

Reviewed by:	karels, markj
MFC after:	3 months
Differential Revision:	https://reviews.freebsd.org/D39219
2023-04-03 04:13:59 -04:00
Alexander V. Chernikov
c2d046fd2b routing: fix panic when adding an interface route to the p2p interface
without and inet/inet6 addresses attached.

MFC after:      3 days
2023-04-03 04:13:59 -04:00
Konstantin Belousov
ab065524f1 amd64 wakeup: recalculate mitigations after APICs are woken
APICs are needed to broadcast IPIs for MSR writes.

PR:	270489
Reviewed by:	dchagin, emaste, jhb
Tested by:	dchagin, manu
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D39302
2023-04-03 04:13:59 -04:00
Dimitry Andric
3f6fc657d6 Revert "Ensure .inc files are regenerated when llvm/clang tblgen binaries change"
This reverts commit ab80f0b21f. The intent
of this change was to avoid possible compilation errors when certain
.inc files were not regenerated, but the method turns out to cause way
more rebuilds than anticipated. Another method will have to be found,
and in the mean time, WITH_CLEAN is the solution that always works.

Fixes:		ab80f0b21f
2023-04-03 04:13:59 -04:00
Dimitry Andric
c82f47546d Revert "Rework {clang,lldb,llvm}-tblgen invocations to add --write-if-changed"
This reverts commit 8f391d9098. There are
still a bunch of problems, and apparently ${.ALLSRC} does not work as I
expected.

Fixes:          8f391d9098
2023-04-03 04:13:58 -04:00
Eric van Gyzen
31c280ba4b camcontrol powermode: fix use-after-free
Free the ccb after processing the response therein.

Reported by:	Coverity
Fixes:		3bed0179ee
MFC after:	1 week
Sponsored by:	Dell EMC Isilon
2023-04-03 04:13:58 -04:00
Dimitry Andric
64bedda6a5 Rework {clang,lldb,llvm}-tblgen invocations to add --write-if-changed
This flag ensures that the tblgen tools do not actually touch the
produced .inc file, if there are no changes to the contents. In turn,
this may prevent a number of rebuilds of files that include such .inc
files, saving build time.

While here, ensure that the shell invocations to locate the used tblgen
binary do not show unnecessary error messages.

Reported by:	des
MFC after:	1 week
2023-04-03 04:13:58 -04:00
John Baldwin
3a2c0b8c3a OptionalObsoleteFiles.inc: Remove MIPS-specific hwpmc manpages.
These are unconditionally removed in ObsoleteFiles.inc.
2023-04-03 04:13:58 -04:00
John Baldwin
b0ba62459e libproc: Trim a MIPS leftover.
Fixes:	101ba46bb6 libproc: retire now-unused MIPS support
2023-04-03 04:13:58 -04:00
John Baldwin
b40ae636d9 rc.d/ldconfig: Remove mips64 check for ldconfig32. 2023-04-03 04:13:58 -04:00
Zhenlei Huang
bcc05e5853 lagg(4): Do not enter net epoch recursively
This saves a little resources.

No functional change intended.

Reviewed by:	kp
Fixes:		b8a6e03fac Widen NET_EPOCH coverage
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D39267
2023-04-03 04:13:58 -04:00
Zhenlei Huang
a1e9b6ff94 lagg(4): Refactor out some lagg protocol input routines into a default one
Those input routines are identical.

Also inline two fast paths.

No functional change intended.

MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D39251
2023-04-03 04:13:57 -04:00
Zhenlei Huang
aa909dfbb9 lagg(4): Make lagg_list and lagg_detach_cookie static
They are used internally only.

No functional change intended.

MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D39250
2023-04-03 04:13:57 -04:00
Maxim Konovalov
58005ad219 pf.conf.5: typo fixes
PR:	270501 (partially)
2023-04-03 04:13:57 -04:00
Corvin Köhne
b155c45264 bhyve: fix spelling mistake of pcireg option
The option is spelled "pcireg" not "pcir".

MFC after:		1 week
Fixes:			f4ceaff56d
Sponsored by:		Beckhoff Automation GmbH & Co. KG
2023-04-03 04:13:57 -04:00
Mateusz Guzik
0aa219a1f9 proc: shave a lock trip on exit if possible
... which happens to be vast majority of the time
2023-04-03 04:13:57 -04:00
Mateusz Guzik
34ed719492 ufs: stop doing refcount_init on made up creds
creds are not using the refcount API for a long time now, but this
previously failed to fail to compile because the type remained int.

Now it broke due to conversion to long.
2023-04-03 04:13:57 -04:00
Joseph Koshy
8b7b71874e pmc: Add a reminder to maintain documentation.
Approved by:	gnn (mentor)
Differential Revision: https://reviews.freebsd.org/D39298
2023-04-03 04:13:57 -04:00
Stefan Eßer
38c814533a Fix typo in statfs man page
There are FAT12 and FAT16 file systems, but FAT13 of was an
unintentional invention of mine ...

Reported by:	Ravi Pokala <rpokala@freebsd.org>
MFC after:	1 month
2023-04-03 04:13:57 -04:00
Elliott Mitchell
0fb5d59eda xen/intr: rework xen_intr_resume() for in-place remapping
The prior implementation of xen_intr_resume() was wiping
xen_intr_port_to_isrc[] and then rebuilding from the x86 interrupt
table.  Rework to instead wipe the channel numbers (->xi_port) and then
scan the table for sources with invalid channels.

This will be slower due to scanning the whole table, but this removes
the dependency on the x86 interrupt code.

Reviewed by: royger
Differential Revision: https://reviews.freebsd.org/D30599
[royger]
Split line over 80 characters.
2023-04-03 04:13:56 -04:00
Elliott Mitchell
7895021336 xen/intr: merge parts of resume functionality into new function
The portions of xen_rebind_ipi() and xen_rebind_virq() were already
near-identical.  While xen_rebind_ipi() should panic() on
single-processor, still having the functionality to invoke seems
harmless.

Meanwhile much of the loop from xen_intr_resume() seemed to want to be
closer to this same code.  This pushes related bits closer together.

Reviewed by: royger
Differential Revision: https://reviews.freebsd.org/D30598
2023-04-03 04:13:56 -04:00
Julien Grall
a5f9811b1b xen/intr: remove x86 APIC headers from xen_intr.c
Remove these no longer needed headers.  Key for making xen_intr.c
machine-independent as they don't exist on other architectures.

Originally this was part of a much larger commit, but was broken off
for submission to the FreeBSD project.

Reviewed by: royger
Submitted by: Elliott Mitchell <ehem+freebsd@m5p.com>
Original implementation: Julien Grall <julien@xen.org>, 2015-10-20 09:14:56
MFC after: 1 week
2023-04-03 04:13:56 -04:00
Elliott Mitchell
bf86973181 xen/intr: stop passing shared_info_t to xen_intr_active_ports()
There is only a single global HYPERVISOR_shared_info pointer, so
directly use the global pointer.

Reviewed by: royger
MFC after: 1 week
2023-04-03 04:13:56 -04:00
Elliott Mitchell
270f7069ee xen: switch to using core atomics for synchronization
Now that the atomic macros are always genuinely atomic on x86, they can
be used for synchronization with Xen.  A single core VM isn't too
unusual, but actual single core hardware is uncommon.

Replace an open-coding of evtchn_clear_port() with the inline.

Substantially inspired by work done by Julien Grall <julien@xen.org>,
2014-01-13 17:40:58.

Reviewed by: royger
MFC after: 1 week
2023-04-03 04:13:56 -04:00
Elliott Mitchell
6ef0026d97 xen/intr: add check for intr_register_source() errors
While unusual, intr_register_source() can return failure.  A likely
cause might be another device grabbing from Xen's interrupt range.
This should NOT happen, but could happen due to a bug.  As such check
for this and fail if it occurs.

This theoretical situation also effects xen_intr_find_unused_isrc().
There, .is_pic must be tested to ensure such an intrusion doesn't cause
misbehavior.

Reviewed by: royger
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D31995
2023-04-03 04:13:56 -04:00
Elliott Mitchell
4f83064b94 xen/intr: cleanup event channel number use
Consistently use ~0 instead of 0 when clearing xenisrc structures.
0 is a valid event channel number, even though it is reserved by Xen.
Whereas ~0 is guaranteed invalid.

Reviewed by: royger
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D30743
2023-04-03 04:13:56 -04:00
Elliott Mitchell
6ff9f9400c xen/intr: fix corruption of event channel table
In xen_intr_release_isrc(), the isrc should only be removed if it is
assigned to a valid port.  This had been mitigated by using 0 for not
having a port, but this is actually corrupting the table.  Fix this bug
as modifying the code would cause this bug to manifest as kernel memory
corruption.  Similar issue for the vCPU bitmap masks.

The KASSERT() doesn't need lock protection.

Reviewed by: royger
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D30743
2023-04-03 04:13:55 -04:00
Elliott Mitchell
fffc6c36d4 xen/intr: fix overflow of Xen interrupt range
The comparison was wrong.  Hopefully this never occurred in the wild,
but now ensure the error message will occur before damage is caused.
This appears non-exploitable as exploitation would require a guest to
force Domain 0 to allocate all event channels, which a guest shouldn't
be able to do.

Adjust the error message to better describe what has occurred.

Reviewed by: royger
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D30743
2023-04-03 04:13:55 -04:00
Elliott Mitchell
2bb57e121b xen/intr: always set xi_close in xen_intr_bind_isrc()
Appears errors are uncommon since calling xen_intr_release_isrc() on a
xenisrc with xi_close in an undefined state could be bad.  Fix this
problematic lurking nasty.

Reviewed by: royger
MFC after: 1 week
2023-04-03 04:13:55 -04:00
Stefan Eßer
b42a78a19a fs/msdosfs: add tracking of free root directory entries
This update implements tallying of free directory entries during
create, delete,	or rename operations on FAT12 and FAT16 file systems.

Prior to this change, the total number of root directory entries
was reported as number of inodes, but 0 as the number of free
inodes, causing system health monitoring software to warn about
a suspected disk full issue.

The FAT12 and FAT16 file systems provide a limited number of
root directory entries, e.g. 512 on typical hard disk formats.
The valid range of values is 1 to 65535, but the msdosfs code
will effectively round up "odd" values to the next multiple of 16
(e.g. 513 would allow for 528 root directory entries).

This update implements tracking of directory entries during create,
delete, or rename operations, with initial values determined by
scanning the directory when the file system is mounted.

Total and free directory entries are reported in the f_files and
f_ffree elements of struct statfs, despite differences in semantics
of these values:

- There is no limit on the number of files and directories that can
  be created on a FAT file system. Only the root directory of FAT12
  and FAT16 file systems is limited, any number of files can still be
  created in sub-directories, even when 0 free "inodes" are reported.

- A single file can require 1 to 21 directory entries, depending on
  the character set, structure, and length of the name. The DOS 8.3
  style file name takes up 1 entry, and if the name does not comply
  with the syntax of a DOS 8.3 file name, 1 additional entry is used
  for each 13 characters of the file name. Since all these entries
  have to be contiguous, it is possible that a file or directory with
  a long name can not be created, despite a sufficient total number of
  free directory entries.

- Renaming a file can require more directory entries than currently
  allocated to store its long name, which may prevent an in-place
  update of the name if more entries are needed. This may cause a
  rename operation to fail if no contiguous range of free entries for
  the new name can be found.

- The volume label is stored in a directory entry. An empty FAT file
  system with a volume label will therefore show 1 used "inode" in
  df.

- The perceentage of free inodes shown in df or monitoring tools does
  only represent the state of the root directory of a FAT12 or FAT16
  file system. Neither does a reported value of 0% free inodes does
  prevent files from being created in sub-directories, nor does a
  value of 50% free inodes guarantee that even a single file with
  a "long" name can be created in the root directory (if every other
  directory entry is occupied and there are no 2 contiguous entries).

The statfs(2) and df(1) man pages have been updated with a notice
regarding the possibly different semantics of values reported as
total and free inodes for non-Unix file systems.

PR:		270053
Reported by:	Ben Woods <woodsb02@freebsd.org>
Approved by:	mckusick
MFC after:	1 month
Differential Revision:	https://reviews.freebsd.org/D38987
2023-04-03 04:13:55 -04:00
Mateusz Guzik
2ed852d972 cred: convert the refcount from int to long
On 64-bit platforms this sorts out worries about mitigating bugs which
overflow the counter, all while not pessimizng anything -- most notably
it avoids whacking per-thread operation in favor of refcount(9) API.

The struct already had two instances of 4 byte padding with 256 bytes in
size, cr_flags gets moved around to avoid growing it.

32-bit platforms could also get the extended counter, but I did not do
it as one day(tm) the mutex protecting centralized operation should be
replaced with atomics and 64-bit ops on 32-bit platforms remain quite
penalizing.

While worries of counter overflow are addressed, the following is not
(just like it would not be with conversion to refcount(9)):
- counter *underflows*
- buffer overruns from adjacent allocations
- UAF due to stale cred pointer
- .. and other goodies

As such, while lipstick was placed, the pig should not be participating
in any beauty pageants.

Prodded by:	emaste
Differential Revision:	https://reviews.freebsd.org/D39220
2023-04-03 04:13:55 -04:00
Mateusz Guzik
5b5c093a93 cred: make the refcount signed
There are asserts on the count being > 0, but they are less useful than
they can be because the type itself is unsigned.

The kernel is compiled with -frapv, making wraparound perfectly defined.

Differential Revision:	https://reviews.freebsd.org/D39220
2023-04-03 04:13:55 -04:00
Philip Paeps
9bbaa84a01 Import tzdata 2023c 2023-04-03 04:13:55 -04:00
Rick Macklem
34f06c41e6 nfscl: Make coverity happy
Coverity does not like code that checks a function's
return value sometimes.  Add "(void)" in front of the
function when the return value does not matter to try
and make it happy.

A recent commit deleted "(void)"s in front of nfsm_fhtom().
This commit puts them back in.

Reported by:	emaste
MFC after:	3 months
2023-04-03 04:13:54 -04:00
Bartosz Sobczak
eeb400170c irdma(4): Upgrade the driver to 1.1.11-k
Summary of changes:
- postpone mtu size assignment during load to avoid race condition
- refactor some of the debug prints
- add request reset handler
- refactor flush scheduler to increase efficiency and avoid racing
- put correct vlan_tag for UD traffic with PFC
- suspend QP before going to ERROR state to avoid CQP timout
- fix arithmetic error on irdma_debug_bugf
- allow debug flag to be settable during driver load
- introduce meaningful default values for DCQCN algorithm
- interrupt naming convention improvements
- skip unsignaled completions in poll_cmpl

Signed-off-by: Bartosz Sobczak bartosz.sobczak@intel.com
Signed-off-by: Eric Joyner <erj@FreeBSD.org>

Reviewed by:	hselasky@
MFC after:	1 week
Sponsored by:	Intel Corporation
Differential Revision:	https://reviews.freebsd.org/D39173
2023-04-03 04:13:54 -04:00
Jung-uk Kim
845fc12897 MAINTAINERS: Remove myself from OpenSSL maintenance 2023-04-03 04:13:54 -04:00
Simon J. Gerraty
1922e5f8d3 tarfs_mount allow control of vfs_mountedfrom
We default to passing the path of the tar file to vfs_mountedfrom
so we can tell where a filesystem was mounted from.
However this can make the output of mount(8) hard to read.

Allow things like:

	mount -t tarfs -o as=`basename $tar` $tar /mnt

so "as" is recorded instead of $tar

Reviewed by:	des
Sponsored by:	Juniper Networks
Differential Revision:	https://reviews.freebsd.org/D39273
2023-04-03 04:13:54 -04:00
Yuri Pankov
25f7a24a0f libc: use separate collate objects for C, POSIX, and C.UTF-8
Fix newlocale() overwriting the locale name in collate object
when same instance was used for those locales, and querylocale()
reporting unexpected value for LC_COLLATE_MASK.

PR:		255646, 269375
Reviewed by:	markj, bapt (previous version)
Differential Revision:	https://reviews.freebsd.org/D30146
2023-04-03 04:13:54 -04:00
Emmanuel Vadot
99c9a89102 linuxkpi: Add alderlake defines in intel-family
Needed by drm-kmod.

Sponsored by:	Beckhoff Automation GmbH & Co. KG
2023-04-03 04:13:53 -04:00
Alexander V. Chernikov
2435d476d5 route: revert transport to rtsock
Temporary switch route(8) back to using rtsock to address
 the discovered issues.
2023-04-03 04:13:53 -04:00
Emmanuel Vadot
2992da2171 Bump __FreeBSD_version after linuxkpi updates.
Sponsored by:	Beckhoff Automation GmbH & Co. KG
2023-04-03 04:13:53 -04:00
Emmanuel Vadot
f4d2f8394c linuxkpi: Add devm_add_action and devm_add_action_or_reset
Those adds a new devres and will exectute some function on release.

Reviewed by:	bz
Differential Revision:	https://reviews.freebsd.org/D39142
Sponsored by:	Beckhoff Automation GmbH & Co. KG
2023-04-03 04:13:53 -04:00
Emmanuel Vadot
3b701be4a8 linuxkpi: Add hdmi helpers
This is a direct port of the Linux code as the licence allows it, so
style(9) isn't respected to allow applying directly the upstream commits.
Do not add it to linuxkpi directly but add a new linuxkpi_hdmi module
that drm modules will require later, no need to bloat linuxkpi more.

Sponsored by:	Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D39122
2023-04-03 04:13:53 -04:00
Richard Scheffenegger
4cc6ee9984 tcp: send SACK rescue retransmission also mid-stream
Previously, SACK rescue retransmissions would only happen
on a loss recovery at the tail end of the send buffer.

This extends the mechanism such that partial ACKs without SACK
mid-stream also trigger a rescue retransmission to try avoid
an otherwise unavoidable retransmission timeout.

Reviewed By:		tuexen, #transport
Sponsored by:		NetApp, Inc.
Differential Revision:	https://reviews.freebsd.org/D39274
2023-04-03 04:13:53 -04:00
Gleb Smirnoff
21ab7c7bac tcp: update error counter when dropping a packet due to bad source
Use the same counter that ip_input()/ip6_input() use for bad destination
address.  For IPv6 this is already heavily abused ip6s_badscope, which
needs to be split into several separate error counters.

Reviewed by:		markj
Differential Revision:	https://reviews.freebsd.org/D39234
2023-04-03 04:13:53 -04:00
Kristof Provost
041ba47de6 carp: fix source MAC
When we're not in unicast mode we need to change the source MAC address.
The check for this was wrong, because IN_MULTICAST() assumes host
endianness and the address in sc_carpaddr is in network endianness.

Sponsored by:	Rubicon Communications, LLC ("Netgate")
2023-04-03 04:13:52 -04:00
Kristof Provost
6fec25dc9f pf: remove pd_refs from pfsync
It only served to complicate cleanup, and added no value.

While here drop packets in pfsync_defer_tmo() if we don't have a syncif,
rather than just leaving them on the queue.

Reviewed by:	markj
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D39248
2023-04-03 04:13:52 -04:00
Kristof Provost
a43d3aa578 pfsync: hold b_mtx for callout_stop(pd_tmo)
The pd_tmo callout has an associated mutex, which we must hold while
calling callout_stop().

Reported by:	markj
Reviewed by:	markj
MFC after:	3 days
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D39223
2023-04-03 04:13:52 -04:00
Rick Macklem
45a04822d7 nfscl: Make coverity happy
Coverity does not like code that checks a function's
return value sometimes.  Add "(void)" in front of the
function when the return value does not matter to try
and make it happy.

Reported by:	emaste
MFC after:	3 months
2023-04-03 04:13:52 -04:00
Konstantin Belousov
0fd812ee01 Regen 2023-04-03 04:13:52 -04:00
Konstantin Belousov
32f922748f kqueue1(2): document
Reviewed by:	emaste, jhb
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D39271
2023-04-03 04:13:52 -04:00
Konstantin Belousov
02c4ecf814 kqueue1(2): export the symbol from libc
Reviewed by:	emaste, jhb
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D39271
2023-04-03 04:13:52 -04:00
Konstantin Belousov
11a6dfb62d Add kqueue1() syscall
It takes the flags argument.  Immediate use is to provide the KQUEUE_CLOEXEC
flag for kqueue(2).

Reviewed by:	emaste, jhb
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D39271
2023-04-03 04:13:51 -04:00
John Baldwin
b3d1e45ab4 build: glibc on Linux defines explicit_bzero in <string.h>.
Don't install strings.h on such systems.  The local prototype doesn't
match the native Linux one when built as C++ breaking the build of
config(8) as a bootstrap tool on some Linux systems.  If the missing
prototype becomes a problem in the future,
tools/build/cross-build/include/linux/strings.h can be patched to add
it.

Reviewed by:	imp, emaste
Obtained from:	CheriBSD
Sponsored by:	DARPA
Differential Revision:	https://reviews.freebsd.org/D39289
2023-04-03 04:13:51 -04:00
Tom Hukins
2013267db6 CONTRIBUTING.md: Fix checkstyle9.pl name
Pull request: https://github.com/freebsd/freebsd-src/pull/703
2023-04-03 04:13:51 -04:00
Alan Somers
ea2783191b ses: cleanup ses tests
Address mav's feedback RE eea7c61590

See also: https://reviews.freebsd.org/D31809

Reported by:	mav
MFC after:	2 weeks
MFC with:	eea7c61590
Sponsored by:	Axcient
Reviewed by:	mav
Differential Revision: https://reviews.freebsd.org/D33954
2023-04-03 04:13:51 -04:00
Alan Somers
356f22be0f sesutil: fix "fault all" with zoned jbods
Some SAS JBODs support zoning.  This feature allows individual SAS
targets to be accessible by only some initiator ports.  One application
would be connecting two servers to the same JBOD, but they wouldn't be
able to see each other's disks.

A zoned JBOD should also prohibit initiators from accessing SES elements
corresponding to inaccessible SAS targets.  It reports that by setting
the element's status code to 0x8 (No Access Allowed).

The bug is that when doing "sesutil (fault|locate) all ...", sesutil
will attempt a ENCIOC_SETELMSTAT ioctl for every single element, even
the inaccessible ones.  The enclosure will reject the command, the
kernel will return EINVAL, and sesutil will exit.

The solution is to check the element's status, and skip trying to set it
if the status is 0x8.  But if the user actually supplied a ses ID, then
assume that he knows what he's doing and try to set it anyway.

PR:		270093
MFC after:	1 week
Sponsored by:	Axcient
Reviewed by:	mav, trasz
Differential Revision: https://reviews.freebsd.org/D39017
2023-04-03 04:13:51 -04:00
Alexander V. Chernikov
b9e1325486 netlink: fix linux module build w/ netlink.
Reported by:	Marek Zarychta <zarychtam@plan-b.pwste.edu.pl>
MFC after:	2 weeks
2023-04-03 04:13:51 -04:00
Ruslan Bukin
fd6ae10a9c Include Embedded Trace Extensions (ETE) source code to the OpenCSD build.
Sponsored by:	UKRI
2023-04-03 04:13:51 -04:00
Alexander V. Chernikov
104eb5d879 netlink: fix 19e43c163c by adding miseed netlinkg_glue.c 2023-04-03 04:13:50 -04:00
Ruslan Bukin
a45d0d65b7 Update OpenCSD to v1.4.0.
Sponsored by:	UKRI
2023-04-03 04:13:49 -04:00
Alexander V. Chernikov
04ce393f6c netlink: add netlink KPI to the kernel by default
This change does the following:

Base Netlink KPIs (ability to register the family, parse and/or
 write a Netlink message) are always present in the kernel. Specifically,
* Implementation of genetlink family/group registration/removal,
  some base accessors (netlink_generic_kpi.c, 260 LoC) are compiled in
  unconditionally.
* Basic TLV parser functions (netlink_message_parser.c, 507 LoC) are
  compiled in unconditionally.
* Glue functions (netlink<>rtsock), malloc/core sysctl definitions
 (netlink_glue.c, 259 LoC) are compiled in unconditionally.
* The rest of the KPI _functions_ are defined in the netlink_glue.c,
 but their implementation calls a pointer to either the stub function
 or the actual function, depending on whether the module is loaded or not.

This approach allows to have only 1k LoC out of ~3.7k LoC (current
 sys/netlink implementation) in the kernel, which will not grow further.
It also allows for the generic netlink kernel customers to load
 successfully without requiring Netlink module and operate correctly
 once Netlink module is loaded.

Reviewed by:	imp
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D39269
2023-04-03 04:12:57 -04:00
Yuri Pankov
fcd305e384 nvmecontrol(8): fix resv register -i synopsis
-i is "ignore existing key" and does not take argument

Reviewed by:	pauamma (manpages)
Differential Revision:	https://reviews.freebsd.org/D37709
2023-04-03 04:12:57 -04:00
Mark Johnston
da9cbabf92 libc: Use secure_getenv(3) where appropriate
No functional change intended.

Reviewed by:	mjg, imp, kib
Differential Revision:	https://reviews.freebsd.org/D39278
2023-04-03 04:12:57 -04:00
Mark Johnston
1d0b2e2923 arm64: Remove duplicated function prototypes for PAC
No functional change intended.

Sponsored by:	The FreeBSD Foundation
2023-04-03 04:12:57 -04:00
Yuri Pankov
48df49af22 nvme: fix resv commands with nda device
- passing I/O commands through nda requires nsid field to be set (it was
  unused when going through nvme_ns_ioctl())
- ccb's status can be OR'ed with the flags, use CAM_STATUS_MASK

Reviewed by:	imp (cam)
Differential Revision:	https://reviews.freebsd.org/D37696
2023-04-03 04:12:57 -04:00
Yuri Pankov
a3d166347b kern.post.mk: fix PORTSDIR handling
Using subshell's PORTSDIR variable (via $${PORTSDIR}}) seems to be
only working if PORTSDIR is specified directly on the make command
line.

Use ${PORTDIR} here instead so that setting the variable in
/etc/{make,src,src-env}.conf would work (also works for variable
being set on command line or in the environment).

PR:		268299
Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D37868
2023-04-03 04:12:57 -04:00
Alexander V. Chernikov
bd0ba500b9 netlink: make nlattr_add_in[6]_addr inline
MFC after:	2 weeks
2023-04-03 04:12:56 -04:00
Alexander V. Chernikov
3fadc2a2a6 netlink: remove forgotten debug message in handle_rtm_getroute().
MFC after:	2 weeks
2023-04-03 04:12:56 -04:00
Alexander V. Chernikov
b1f88e8e66 netlink: ensure genetlink control family always registers under the same ID.
MFC after:	2 weeks
2023-04-03 04:12:56 -04:00
Corvin Köhne
48a1ce8157 pci: expose intel_graphics_stolen as sysctl
The Intel graphics stolen memory is used by the Intel GOP driver on
boot. When using bhyve with GPU passthrough, it's also used by the guest
GOP driver at guest boot. For that reason, bhyve needs to know the
address and size of this region to inform the guest about this region.
Exposing the variables as sysctl allows bhyve to easily read them.
2023-04-03 04:12:56 -04:00
Corvin Köhne
5a1380a83a pci: add tunable hw.pci.enable_mps_tune
If the tunable is set to 0, the tuning of the MPS (maximum payload size)
is disabled and the default MPS values set by the BIOS are used. In this
case the system may use a lower speed or operate in a less optimized
state, but it can resolve issues with stability and compatibility. With
specific devices the tuning of the mps, can lead to a complete freeze of
the system.

Reviewed by:		manu
MFC after:		1 week
Sponsored by:		Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D38397
2023-04-03 04:12:56 -04:00
Corvin Köhne
7f3fd299bf bhyve: add config option to modify LPC IDs
The Intel GOP driver checks the LPC IDs to detect the platform it's
running on. The GOP driver only works on the platforms it's written for.
Maybe other Intel driver have the same behaviour. For that reason, we
should use the LPC IDs of the FreeBSD host for GPU passthrough to work
properly.

We don't know if setting different LPC IDs have any side effect.
Therefore, don't use the host LPC IDs by default on Intel system. Give
the user the opportunity to modify the LPC IDs.

Reviewed by:		jhb
MFC after:		1 week
Sponsored by:		Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D28280
2023-04-03 04:12:56 -04:00
Corvin Köhne
f112f48fa7 bhyve: make use of helper to read PCI IDs from bhyve config
For compatibilty reasons, the old config values are still supported.

Reviewed by:		jhb
MFC after:		1 week
Sponsored by:		Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D38403
2023-04-03 04:12:56 -04:00
Corvin Köhne
c910c3db76 bhyve: add helper to read PCI IDs from bhyve config
Changing the PCI IDs is valuable in some situations. The Intel GOP
driver requires that some PCI IDs of the LPC bridge are aligned with the
physical values of the host LPC bridge. Another use case are oracles
virtio driver. They require different subvendor ID than the default one.
For that reason, create a helper which makes it easy to read PCI IDs
from bhyve config. Additionally, this helper ensures that all emulation
devices are using the same config keys.

Reviewed by:		jhb
MFC after:		1 week
Sponsored by:		Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D38402
2023-04-03 04:12:56 -04:00
Gordon Bergling
7689b76383 rarpd(8): Fix a typo in a source code comment
- s/combinataion/combination/

Obtained from:	NetBSD
MFC after:	3 days
2023-04-03 04:12:55 -04:00
Jose Luis Duran
81337e75d7 ping tests: Add a regression test
Test regression fixed in 4630a3252a. Add two tests that do not
use the verbose flag, so the code path in question can be reached:

1. Respond with a proper ICMP destination host unreachable packet.
2. Respond with a doctored ICMP destination host unreachable packet,
   that has the ICMP Identifier field modified (+1 bit).

Reviewed by:	cy
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D39244
2023-04-03 04:12:55 -04:00
Kyle Evans
35bbf5511f arm64: cpu_switch: don't zero out pcb_onfault
Previously this would zero out x18 in the pcb, now it's attacking the
innocent pcb_onfault -- drop it entirely.

This technically fixes
e605b87a9e ("Save only callee-saved registers in pcb"), but it's
harmless until the below commit trims down pcb_x.

Reported by:	mmel
Reviewed by:	andrew, mmel
Fixes:	1c1f31a5e5 ("Remove unused registes from the arm pcb")
Differential Revision:	https://reviews.freebsd.org/D39277
2023-04-03 04:12:55 -04:00
Alexander V. Chernikov
18c222a7a3 route: fix RTF_HOST & non-empty mask handling in netlink translation. 2023-04-03 04:12:55 -04:00
Mark Johnston
a0a56901a7 tftp tests: Fix a typo in the makefile
Fixes:	64c2a712d6 ("tftp: Add tests.")
2023-04-03 04:12:55 -04:00
Alexander V. Chernikov
efe142b6f8 route(8): convert to netlink
This change converts all kernel rtsock interactions in route(8)
 to Netlink.

Based on the WITHOUT_NETLINK_SUPPORT src.conf(5) variable, route(8)
 now fully operates either via Netlink or via rtsock/sysctl.
The default (compile-time) is Netlink.

The output for route delete/add/get/flush is targeted to be exactly
 the same (apart from some error handling cases).
The output for the route monitor has been changed to improve
 readability and support netlink models.

Other behaviour changes:
* exact prefix lookup (route -n get a.b.c.d/e) is not yet supported.
* route monitor does not show the change originator yet.

Differential Revision:	https://reviews.freebsd.org/D39007
2023-04-03 04:12:55 -04:00
Alexander V. Chernikov
d75fd9b259 netlink: restrict default userland switch to netlink to i386/amd64. 2023-04-03 04:12:55 -04:00
Alexander V. Chernikov
30501b2022 netlink: add standrard ifaddr/neigh parsers to snl(3).
MFC after:	2 weeks
2023-04-03 04:12:54 -04:00
Alexander V. Chernikov
7a4c151469 netlink: add NETLINK/NETLINK_SUPPORT userland options.
Make userland tools such as netstat, route, arp and ndp use
 either netlink or rtsock interfaces based on the NETLINK_SUPPORT
 options.
Both NETLINK and NETLINK_SUPPORT options are turned on by default.

Reviewed By: eugen
Differential Revision: https://reviews.freebsd.org/D39148
2023-04-03 04:12:54 -04:00
Alexander V. Chernikov
6888b50fdd netlink: allow netlink sockets in non-vnet jails.
This change allow to open Netlink sockets in the non-vnet jails, even for
 unpriviledged processes.
The security model largely follows the existing one. To be more specific:
* by default, every `NETLINK_ROUTE` command is **NOT** allowed in non-VNET
 jail UNLESS `RTNL_F_ALLOW_NONVNET_JAIL` flag is specified in the command
 handler.
* All notifications are **disabled** for non-vnet jails (requests to
 subscribe for the notifications are ignored). This will change to be more
 fine-grained model once the first netlink provider requiring this gets
 committed.
* Listing interfaces (RTM_GETLINK) is **allowed** w/o limits (**including**
 interfaces w/o any addresses attached to the jail). The value of this is
 questionable, but it follows the existing approach.
* Listing ARP/NDP neighbours is **forbidden**. This is a **change** from the
 current approach - currently we list static ARP/ND entries belonging to the
 addresses attached to the jail.
* Listing interface addresses is **allowed**, but the addresses are filtered
 to match only ones attached to the jail.
* Listing routes is **allowed**, but the routes are filtered to provide only
 host routes matching the addresses attached to the jail.
* By default, every `NETLINK_GENERIC` command is **allowed** in non-VNET jail
 (as sub-families may be unrelated to network at all).
 It is the goal of the family author to implement the restriction if
 necessary.

Differential Revision: https://reviews.freebsd.org/D39206
MFC after:	1 month
2023-04-03 04:12:54 -04:00
Alexander V. Chernikov
8f031528db routing: add public rt_is_exportable() version to check if
the route can be exported to userland when jailed.

Differential Revision: https://reviews.freebsd.org/D39204
MFC after:	2 weeks
2023-04-03 04:12:54 -04:00
Gordon Bergling
7ff4641804 devd.conf.5: Fix a typo in the manual page
- s/deteted/detected/

MFC after:	5 days
2023-04-03 04:12:54 -04:00
Cy Schubert
ef351b9a0a share/misc/committers-*: Document my mentors
Document my ports and src mentors.
2023-04-03 04:12:54 -04:00
Konstantin Belousov
c79ca1937a vnode_pager_input: return runningbufspace back
Both vnode_pager_input_smlfs() and vnode_pager_generic_getpages()
increment runningbufspace, but also both delegate io completion handling
on the pbuf to either plain bdone() or filesystem-specific strategy
routine. Accidentally, for e.g. UFS it is g_vfs_strategy()/g_vfs_done().
The later calls bufdone() which handles runningbufspace reclamation.

For plain bdone() io done handler, nothing would return
accounted b_runningbufspace back. Do it in the new
helper vnode_pager_input_bdone(), as well as in
vnode_pager_generic_getpages_done() explicitly.

Note that potential multiple calls to runningbufwakeup() for the same
pbuf or buf completion are safe. runningbufwakeup() clears accounting
for the buffer, so second and later calls are nop.

The problem was found due to tarfs using small vnode pager input but not
g_vfs_strategy().

Reported by:	des
Reviewed by:	markj, sjg
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D39263
2023-04-03 04:12:54 -04:00
Mateusz Guzik
f501597cf4 vm: add unlocked page lookup before trying vm_fault_soft_fast
Shaves a read lock + tryupgrade trip most of the time.

Stats from doing a kernel build (counters not present in the tree):
vm.fault_soft_fast_ok: 262653
vm.fault_soft_fast_failed_other: 41
vm.fault_soft_fast_failed_no_page: 39595772
vm.fault_soft_fast_failed_page_busy: 1929
vm.fault_soft_fast_failed_page_invalid: 22183

Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D39268
2023-04-03 04:12:53 -04:00
Mateusz Guzik
186cc00b18 vfs cache: always assert on ndp->ni_resflags 2023-04-03 04:12:53 -04:00
Dmitry Chagin
5eda4f40f5 i386: ansify
Reported by:	clang 15
2023-04-03 04:12:53 -04:00
Warner Losh
787f8c79b5 CONTRIBUTING.md: Suggest using checkstyle9.pl 2023-04-03 04:12:53 -04:00
Warner Losh
76a66f1ce3 checkstyle9.pl: Perl script to check if a change is approximately style(9)
This code is adapted from the QEMU checkpatch.pl script. It can check
either a patch, a file or a git branch. It tries to warn about things
that I believe might be style(9) violations. It's experimental, since I
heavily hacked on the qemu version to get it to not complain (much)
about iconic code in the tree. At the moment, it's use should be
considered expermental. It will likely miss violations, and complain
about code that's perfectly fine.  It's offered as an experiment
and to make it easier for contributors to submit patches.
2023-04-03 04:12:53 -04:00
Warner Losh
067d61715e secure_getenv: Improve documentation wording
Improve the documentation wording to be more consistent with FreeBSD
manual pages.

Suggested by:		mjg (though reworded)
Sponsored by:		Netflix
2023-04-03 04:12:53 -04:00
Warner Losh
1c35a9fcc9 secure_getenv: Add () around return values
Style only change, no functional change intended.

Sponsored by:		Netflix
2023-04-03 04:12:53 -04:00
Joseph Koshy
0fc87e3952 procfs: Add manual page cross references.
Approved by:	gnn (mentor)
Differential Revision: https://reviews.freebsd.org/D39264
2023-04-03 04:12:53 -04:00
Andrew Gallatin
12061d7141 LRO: Add missing checks for invalid IP addresses
LRO bypasses normal ip_input()/tcp_input() and lacks several checks
that are present in the normal path.  Without these checks, it
is possible to trigger assertions added in b0ccf53f24

Reviewed by: glebius, rrs
Sponsored by: Netflix
2023-04-03 04:12:52 -04:00
Dag-Erling Smørgrav
a37704ea86 pwd_mkdb: Sort options and update usage message.
Sponsored by:	Klara, Inc.
Reviewed by:	allanjude
Differential Revision:	https://reviews.freebsd.org/D39266
2023-04-03 04:12:52 -04:00
Mateusz Guzik
85e743d5b5 vfs: trylock vnode requeue
The quasi-LRU still gets in the way for example when doing an
incremental bzImage build, with vnode_list lock being at the
top of the profile. Further damage control the problem by trylocking.

Note the entire mechanism desperately wants to be reaped out in favor
of something(tm) which both scales in a multicore setting and provides
sensible replacement policy.

With this change everything vfs almost disappears from the on CPU
flamegraph, what is left is tons of contention in the VM.
2023-04-03 04:12:52 -04:00
Mateusz Guzik
7ed69d8fdf vfs: flip deferred_inact to atomic
Turns out it is very rarely triggered, making a per-cpu
counter a waste.

Examples from real life boxes:
uptime		counter
135 days	847
138 days	2190
141 days	1
2023-04-03 04:12:52 -04:00
Mateusz Guzik
f9c974fdae vfs: replace some spelled out VNASSERTs with VNPASS
nfc
2023-04-03 04:12:52 -04:00
Ed Maste
cb717e614e makefs: emit NM records for all directory entries
We previously attempted to emit Rock Ridge NM records only when the name
represented by the Rock Ridge extensions would actually differ. We would
omit the record for an all-upper-case directory name, however Linux (and
perhaps other operating systems) map names with no NM record to
lowercase.

This affected only directories, as file names have an implicit ";1"
version number appended and thus always differ.  To solve, just emit NM
records for all entries other than DOT and DOTDOT .

We could continue to omit the NM record for directories that would avoid
mapping (for example, one named 1234.567) but this does not seem worth
the complexity.

PR:		203531
Reported by:	Thomas Schmitt <scdbackup@gmx.net
Reviewed by:	kevans
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D39258
2023-04-03 04:12:52 -04:00
Vico Chen
78fca9333a linsysfs(4): Keep Linux compatible sysfs the same as Ubuntu
By checking Ubuntu, there is no `/sys/subsystem' in sysfs. To compatible
with Ubuntu, delete the 'subsystem' creation in Linux compatible module.

On the other hand, the sysfs `/sys/subsystem' cause failure for some
Linux udev cases. In Linux udev source code, there is a function named
`scan_devices_all', and it will scan `/sys/subsystem' if it is existed,
but now there are nothing in /sys/subsystem `, and it returns empty
to cause some use cases failed.

Reviewed by:		dchagin
Differential Revision:	https://reviews.freebsd.org/D38885
MFC after:		1 month
XMFC with:		ifAPI
2023-04-03 04:12:52 -04:00
Dmitry Chagin
dffe506d38 linsysfs(4): Reimplement listnics() using ifAPI
Handle if arrival/departure events.

Reviewed by:		melifaro (early version)
Differential Revision:	https://reviews.freebsd.org/D38901
MFC after:		1 month
XMFC with:		ifAPI
2023-04-03 04:12:51 -04:00
Lorenzo Salvadore
425b4e06d9 share/misc/committers-doc.dot: Add myself
Add myself as a doc committer, mentored by carlavilla and dbaio.

Approved by:	carlavilla (mentor)
Differential Revision: https://reviews.freebsd.org/D39254
2023-04-03 04:12:51 -04:00
Dag-Erling Smørgrav
6ec35a3e46 local-unbound-setup: Disable the libc subscriber.
This is the correct way to prevent resolvconf from updating resolv.conf.

Reviewed by:	cy
Differential Revision:	https://reviews.freebsd.org/D39262
2023-04-03 04:12:51 -04:00
John Baldwin
462ad53bc6 Remove libvmmapi.so.5 after the shlib version was bumped to 6. 2023-04-03 04:12:51 -04:00
John Baldwin
29eee92eee bhyve: Remove vmctx member from struct vm_snapshot_meta.
This is a userland-only pointer that isn't relevant to the kernel and
doesn't belong in the ioctl structure shared between userland and the
kernel.  For the kernel, the old structure for the ioctl is still
supported under COMPAT_FREEBSD13.

This changes vm_snapshot_req() in libvmmapi to accept an explicit
vmctx argument.

It also changes vm_snapshot_guest2host_addr to take an explicit vmctx
argument.  As part of this change, move the declaration for this
function and its wrapper macro from vmm_snapshot.h to snapshot.h as it
is a userland-only API.

Reviewed by:	corvink, markj
Differential Revision:	https://reviews.freebsd.org/D38125
2023-04-03 04:12:51 -04:00
John Baldwin
c126030bb9 libvmmapi: Add a struct vcpu and use it in most APIs.
This replaces the 'struct vm, int vcpuid' tuple passed to most API
calls and is similar to the changes recently made in vmm(4) in the
kernel.

struct vcpu is an opaque type managed by libvmmapi.  For now it stores
a pointer to the VM context and an integer id.

As an immediate effect this removes the divergence between the kernel
and userland for the instruction emulation code introduced by the
recent vmm(4) changes.

Since this is a major change to the vmmapi API, bump VMMAPI_VERSION to
0x200 (2.0) and the shared library major version.

While here (and since the major version is bumped), remove unused
vcpu argument from vm_setup_pptdev_msi*().

Add new functions vm_suspend_all_cpus() and vm_resume_all_cpus() for
use by the debug server.  The underyling ioctl (which uses a vcpuid of
-1) remains unchanged, but the userlevel API now uses separate
functions for global CPU suspend/resume.

Reviewed by:	corvink, markj
Differential Revision:	https://reviews.freebsd.org/D38124
2023-04-03 04:12:51 -04:00
Joseph Koshy
724bd7ac59 pmcstat: Warn about text output format stability.
The formats for pmcstat(8)'s human-readable output are not part of its
user interface definition, and may change in the future.  Highlight
this in its manual page.

Approved by:	gnn (mentor)
Differential Revision: https://reviews.freebsd.org/D39249
2023-04-03 04:12:51 -04:00
Konstantin Belousov
802d620935 fdesc_lookup(): drop fdropped
Reviewed by:	markj
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D39207
2023-04-03 04:12:50 -04:00
Konstantin Belousov
3a8f50e898 fdesc_lookup(): the condition to use vn_vget_ino() is always true
The ix number for the fdescfs root is 1, while any fd vnode has the ix
value at least 3.

Reviewed by:	markj
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D39207
2023-04-03 04:12:50 -04:00
Konstantin Belousov
1864ffd1e7 fdesc_lookup(): no need to vhold the dvp vnode
It is already referenced by the VOP_LOOKUP() caller, otherwise vdrop()
after vn_lock() is invalid anyway.

Reviewed by:	markj
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D39207
2023-04-03 04:12:50 -04:00
Konstantin Belousov
639a2d519a fdesc_allocvp(): fix potential use after free
Just owning the interlock is not enough for vget() to operate on the
vnode race-free with vgone(), the vnode should be held.  Use
vget_prep()/vget_finish() to avoid vholding the vnode explicitly, and
drop LK_INTERLOCK.

Reviewed by:	markj
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D39207
2023-04-03 04:12:50 -04:00
Konstantin Belousov
12aacb959f fdescfs: remove useless XXX comment, unwrap line
Reviewed by:	markj
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D39207
2023-04-03 04:12:50 -04:00
Cy Schubert
4855435f42 rc: Chase bfb202c455 and remove ifconfig down/up for wpa_supplicant
bfb202c455 addresses the CTRL-EVENT-SCAN-FAILED. Upstream d807e289d
caused FreeBSD regression in driver_bsd.c, which this rc.d patch
worked around. As of bfb202c455 this workaround is no longer needed.

Reviewed by:	bz (for wireless)
MFC after:	10 days
X-MFC with:	bfb202c455
Differential Revision:	https://reviews.freebsd.org/D39257
2023-04-03 04:12:50 -04:00
Justin Hibbits
65ff2db79c infiniband: Bring back M_ASSERTVALID() check in infiband_bpf_mtap()
Reported by:	rpokala
Fixes:		adf62e8363
2023-04-03 04:12:50 -04:00
Justin Hibbits
2e643cd0bb inet6: Include if_private.h in one more netstack file
ip6_input() and ip6_destroy() both directly reference ifnet members.
This file was missed in 3d0d5b21

Fixes:		3d0d5b21 ("IfAPI: Explicitly include <net/if_private.h>...")
Sponsored by:	Juniper Networks, Inc.
2023-04-03 04:12:49 -04:00
Justin Hibbits
a215674633 Mechanically convert qlnx(4) to IfAPI
Reviewed By:	zlei
Sponsored by:	Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D37856
2023-04-03 04:12:49 -04:00
Justin Hibbits
72f8fa7978 ofed: Mechanically convert to IfAPI
Summary:
Because of the intricacies of this code it wasn't purely scripted, but
instead hand-mechanical.

Reviewed by:	hselasky
Sponsored by:	Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D38560
2023-04-03 04:12:49 -04:00
Zhenlei Huang
f6ab1e562c lagg: Various style fixes
MFC after:	1 week
2023-04-03 04:12:49 -04:00
Kristof Provost
6dc9f23d44 pf: ignore ip6_output() return value in pf_refragment6()
We can't do anything if ip6_output() fails, other than discard the
packet which ip6_output() already does for us.
Mark the return value as ignored.

Reported by:	emaste, Coverity
Sponsored by:	Rubicon Communications, LLC (Netgate)
2023-04-03 04:12:49 -04:00
Kristof Provost
c45051c7dd ifconfig: free memory allocated by getaddrinfo()
Reported by:	emaste, Coverity
Sponsored by:	Rubicon Communications, LLC (Netgate)
2023-04-03 04:12:49 -04:00
Eric Joyner
517db80f16 ice(4): Restore old conditional overwritten by last update
Commit 8923de5905 ("ice(4): Update to 1.37.7-k", 2023-02-13)
unintentionally overwrote the change made in commit 52f45d8ace ("net:
iflib: let the drivers use isc_capenable", 2021-12-28).

Signed-off-by: Eric Joyner <erj@FreeBSD.org>

Reported by:	jhibbits@
MFC after:	3 days
Sponsored by:	Intel Corporation
2023-04-03 04:12:49 -04:00
Jose Luis Duran
4ec2a72cd0 ping: Fix an uninitialized variable
The variable oicmp, which holds the original ("quoted packet") ICMP
packet in a structured way, did not have a copy of the original ICMP
packet obtained from the raw data.

The code was accidentally removed in 20b4130314. Bring it back.

Reported by:	Coverity Scan, cy
Reviewed by:	cy
CID:		1506960 (UNINIT)
Fixes:		20b4130314
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D39233
2023-04-03 04:12:48 -04:00
Philip Paeps
193675f0cc Import tzdata 2023b 2023-04-03 04:12:48 -04:00
Mark Johnston
ee36ff916d kasan.9: Update to note arm64 support 2023-04-03 04:12:48 -04:00
Danilo G. Baio
952689a229 committers-doc.dot: Add myself; late entry 2023-04-03 04:12:48 -04:00
Bjoern A. Zeeb
e04d9e1c46 WPA: driver_bsd.c: backout upstream IFF_ change and add logging
This reverts the state to our old supplicant logic setting or clearing
IFF_UP if needed.  In addition this adds logging for the cases in which
we do (not) change the interface state.

Depending on testing this seems to help bringing WiFi up or not log
any needed changes (which would be the expected wpa_supplicant logic
now).  People should look out for ``(changed)`` log entries (at least
if debugging the issue; this way we will at least have data points).

There is a hypothesis still pondered that the entire IFF_UP toggling
only exploits a race in net80211 (see further discssussions for more
debugging and alternative solutions see D38508 and D38753).
That may also explain why the changes to the rc startup script [1]
only helped partially for some people to no longer see the
continuous CTRL-EVENT-SCAN-FAILED.

It is highly likely that we will want further changes and until
we know for sure that people are seeing ''(changed)'' events
this should stay local.  Should we need to upstream this we'll
likely need #ifdef __FreeBSD__ around this code.

[1] 5fcdc19a81 and
    d06d7eb091

Sponsored by:	The FreeBSD Foundation
MFC after:	10 days
Reviewed by:	cy, enweiwu (earlier)
Differential Revision: https://reviews.freebsd.org/D38807
2023-04-03 04:12:48 -04:00
Kyle Evans
355bb83610 arm64: add KASAN support
This entails:
- Marking some obvious candidates for __nosanitizeaddress
- Similar trap frame markings as amd64, for similar reasons
- Shadow map implementation

The shadow map implementation is roughly similar to what was done on
amd64, with some exceptions.  Attempting to use available space at
preinit_map_va + PMAP_PREINIT_MAPPING_SIZE (up to the end of that range,
as depicted in the physmap) results in odd failures, so we instead
search the physmap for free regions that we can carve out, fragmenting
the shadow map as necessary to try and fit as much as we need for the
initial kernel map.  pmap_bootstrap_san() is thus after
pmap_bootstrap(), which still included some technically reserved areas
of the memory map that needed to be included in the DMAP.

The odd failure noted above may be a bug, but I haven't investigated it
all that much.

Initial work by mhorne with additional fixes from kevans and markj.

Reviewed by:	andrew, markj
Sponsored by:	Juniper Networks, Inc.
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D36701
2023-04-03 04:12:47 -04:00
Mitchell Horne
09fcd90653 arm64: add a GENERIC-KASAN config
Reviewed by:	andrew, markj
Sponsored by:	Juniper Networks, Inc.
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D36702
2023-04-03 04:12:47 -04:00
Ed Maste
1c047ad316 makefs: correct El Torito bood record
The boot catalog pointer is a DWord, but we previously populated it via
cd9660_bothendian_dword which overwrote four unused bytes following it.
See El Torito 1.0 (1995) Figure 7 for details.

PR:		203531
Reported by:	Coverity Scan
Reported by:	Thomas Schmitt <scdbackup@gmx.net>
Reviewed by:	kevans
CID:		977470
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D39231
2023-04-03 04:12:47 -04:00
John Baldwin
2f70860e69 ktls: Drop all the INET and INET6 compile-time guards.
Consistent with 9fd0d9b16e, KERN_TLS is
not supported on kernels without any INET support.

Reviewed by:	gallatin, hselasky
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D39232
2023-04-03 04:12:47 -04:00
Gordon Bergling
7d76e7df83 acpi(4): Fix a typo in a kernel message
- s/enitialization/initialization/

MFC afer:	5 days
2023-04-03 04:12:47 -04:00
Kirk McKusick
a3cd69906d Improve chance of finding an alternate superblock in sbsearch(3).
When requesting a superblock read for the sole purpose of getting
the parameters needed to find if backup parameters have been stored,
specify UFS_NOCSUM as only the base superblock is needed. This
change reduces the number of checks that the superblock must pass.

MFC after:    1 week
2023-04-03 04:12:47 -04:00
Mateusz Guzik
db819e936d vfs cache: return ENOTDIR for not_a_dir/{.,..} lookups
Reported by:	Oliver Kiddle
PR:	270419
MFC:	3 days
2023-04-03 04:12:47 -04:00
Andrew Turner
b1c578af5d Mark the arm64 PSR register fields with UL
These are for a 64 bit register. Make them 64 bit values on arm64.

Sponsored by:	Arm Ltd
2023-04-03 04:12:46 -04:00
Andrew Turner
d9cf5bcfe5 Bump __FreeBSD_version for changing spsr on arm64
This changed a few structures, bump __FreeBSD_version for kgdb and
userspace consumers.

Sponsored by:	Arm Ltd
2023-04-03 04:12:46 -04:00
Andrew Turner
0583bb6677 Remove unused registes from the arm pcb
These were kept for ABI reasons. Remove them and bump __FreeBSD_version
so debuggers can be updated to use the new layout.

Reviewed by:	jhb
Sponsored by:	Arm Ltd
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D35378
2023-04-03 04:12:46 -04:00
Andrew Turner
032a1ed4bc Add compat support for struct reg on arm64
The size of the spsr field in struct reg has changed. Mask the bits
that userspace doesn't know about out as they may be invalid.

While here add a comment why we don't need compat support in set_regs.

Sponsored by:	Arm Ltd
2023-04-03 04:12:46 -04:00
Zachary Leaf
76d8efc2b5 arm64: add fault address to trapframe
It was previously possible for the fault address register to get
clobbered before it was saved. This small window occurred when an
additional exception was encountered inside the exception handler,
overwriting the previous value.

Commit f29942229d ("Read the arm64 far early in el0 exceptions")
patched this issue, but avoided changing the trapframe since this could
be considered a KBI change in FreeBSD 13.

Revert the above fix and save the fault address in the trapframe
instead. This saves the fault address even earlier in the exception
handling process, and is a more robust and simple fix.

Reviewed by:	andrew, jhb, jrtc27
Sponsored by: Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D38984
2023-04-03 04:12:46 -04:00
Zachary Leaf
b2c53cd04a arm64: extend ESR/SPSR registers to 64b
For the Exception Syndrome Register, ESR_ELx, the upper 32b were
previously unused, but now may contain additional exception info as of
Armv8.7 (FEAT_LS64).

Extend ESR from u32->u64 in exception handling code to support this. In
addition, also extend Saved Program Status Register SPSR_ELx in the same
way to allow for future extensions.

Reviewed by:	andrew
Sponsored by: Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D38983
2023-04-03 04:12:46 -04:00
John Baldwin
fb3d437320 libpmc: Use LIB_CXX instead of explicit LDADD to link a C++ library.
This uses the C++ compiler as the linker instead of the C compiler
letting the compiler driver pick the right libraries.  This is a no-op
on main and stable/13 but matters for stable/12 where the current
logic breaks for external GCC since it tries to use a non-existent
libstdc++.

Reviewed by:	emaste
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D39197
2023-04-03 04:12:46 -04:00
Justin Hibbits
f20b0353c3 IfAPI: Add iterator to complement if_foreach()
Summary:
Sometimes an if_foreach() callback can be trivial, or need a lot of
outer context.  In this case a regular `for` loop makes more sense.  To
keep things hidden in the new API, use an opaque `if_iter` structure
that can still be instantiated on the stack.  The current implementation
uses just a single pointer out of the 4 alotted to the opaque context,
and the cleanup does nothing, but may be used in the future.

Reviewed by:	melifaro
Sponsored by:	Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D39138
2023-04-03 04:12:46 -04:00
Ed Maste
2f181c0cd6 makefs: add missing break for 'g' case in tarfs test
Reported by:	Coverity Scan
CID:		1506954
Fixes: 6cb78fa479 ("tarfs: Repeat tests using GNU tar if available.")
Sponsored by:	The FreeBSD Foundation
2023-04-03 04:12:45 -04:00
Ed Maste
9c4afbe569 makefs: correct iso9660 Rock Ridge NM values
These are not actually used by makefs (yet), but ought to match the
spec.

See RRIP 4.1.4 Description of the "NM" System Use Entry for details.

PR:		203531
Sponsored by:	The FreeBSD Foundation
2023-04-03 04:12:45 -04:00
Ed Maste
bff958e045 makefs: correct iso9660 Rock Ridge TF timestamps
The bit definitions for the TF_* timestamp bits (TF_MODIFY, etc.) were
incorrect, and timestamps were written in the wrong order.

See RRIP 4.1.6 Description of the "TF" System Use Entry for details.

PR:		203531
Reported by:	Thomas Schmitt <scdbackup@gmx.net>
Reviewed by:	jrtc27, kevans
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D39221
2023-04-03 04:12:45 -04:00
Kyle Evans
2a7c51e510 daemon: reformat longopts
Use a single tab instead of eight spaces, these aren't line
continuations.
2023-04-03 04:12:45 -04:00
Ihor Antonov
95e119547d daemon: decouple init logic from main loop
main() func contained both initialization and main loop logic.
This made certain operations like restarting problematic and
required dirty hacks in form of goto jumps.

This commit moves the main loop logic into daemon_eventloop(),
cleans up main, and makes restart logic clear: daemon_mainloop()
is run in a loop with a restart condition checked at the end.

Reviewed by:	kevans
Pull Request:	https://github.com/freebsd/freebsd-src/pull/699
2023-04-03 04:12:45 -04:00
Philip Paeps
98401dbe4a Import tzdata 2023a 2023-04-03 04:12:42 -04:00
Bjoern A. Zeeb
28967f2625 LinuxKPI: remove now implemented dummy headers.
Both iommu.h and kconfig.h now exist in the common code.
There is no need for the duplicate (empty) headers anymore.
2023-04-03 04:12:29 -04:00
Bjoern A. Zeeb
b683178663 rtw89: fix -Wunused-but-set-variable
Fix a -Wunused-but-set-variable warning by adding the field to the
debug logging as is done for other versions handler functions.

MFC after:	3 days
2023-04-03 04:12:29 -04:00
Bjoern A. Zeeb
4a83f58a09 ifconfig: ifieee80211: print bssid name
In certain setups (e.g., autonomous APs) it is extremly helpful to have
a way to map the BSSIDs to names for both normal status output as well
as the scan list.  This often allows a quicker overview than remembering
(or manually looking up) BSSIDs.
Call ether_ntohost() on the bssid and consult /etc/ethers
and print "(name)" after the bssid for the status output and "(name)"
at the end of the line after the IE list.

MFC after:	10 days
Reviewed by:	adrian, cy
Differential Revision: https://reviews.freebsd.org/D39192
2023-04-03 04:12:29 -04:00
Mateusz Guzik
76cb288a40 vfs: decouple freevnodes from vnode batching
In principle one cpu can keep vholding vnodes, while another vdrops
them. In this case it may be the local count will keep growing in an
unbounded manner. Roll it up after a threshold instead.

While here move it out of dpcpu into struct pcpu.

Reviewed by:	kib (previous version)
Differential Revision:	https://reviews.freebsd.org/D39195
2023-04-03 04:12:29 -04:00
Kirk McKusick
e99fc1b80d Rewrite function definitions with identifier lists.
A few functions snuck in with K&R style definitions.

Also add some missing memory frees.

MFC after:    1 week
2023-04-03 04:12:29 -04:00
Rene Ladan
cc2785783c misc/organization: add bofh as a new portmgr member
Hat:	portmgr-secretary
2023-04-03 04:12:29 -04:00
John Baldwin
c23d860193 sys: Retire OPENZFS_CWARNFLAGS now that it is empty.
Reviewed by:	markj, emaste
Differential Revision:	https://reviews.freebsd.org/D39217
2023-04-03 04:12:29 -04:00
John Baldwin
90b90089b6 sys: Stop enabling -Wnested-externs.
clang doesn't implement this warning, so violations are only caught by
GCC.  It is also no longer a common practice to use this as it was in
the original BSD code, so the need for the warning is not as important
as when it was used to do cleanups 20 years ago.  A recent commit
(c3179891f8) triggers this warning on
GCC, but that commit uses nested externs purposefully.

Reviewed by:	markj, emaste
Differential Revision:	https://reviews.freebsd.org/D39214
2023-04-03 04:12:28 -04:00
John Baldwin
ea8d3189e9 bhyve: Don't return -ENOMEM from qemu_fwcfg_add_file.
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D39212
2023-04-03 04:12:28 -04:00
John Baldwin
fd684aa548 bhyve: Accept a variable-length string name for qemu_fwcfg_add_file.
It is illegal (UB?) to pass a shorter array to a function argument
that takes a fixed-length array.  Do a runtime check for names that
are too long via strlen() instead.

Reviewed by:	markj
Reported by:	GCC -Wstringop-overread
Differential Revision:	https://reviews.freebsd.org/D39211
2023-04-03 04:12:28 -04:00
John Baldwin
44d51d382b libpfctl: Don't pass stack garbage to free.
GCC 9 on stable/12 reports a -Wmaybe-uninitialized error for the call
to free in _pfctl_clear_states.

Reviewed by:	mjg
Differential Revision:	https://reviews.freebsd.org/D39198
2023-04-03 04:12:28 -04:00
Val Packett
7904ce1a82 arpa: garbage collect ns_newmsg/ns_rdata decls
These were brought in by the libbind import, but these functions were
never actually implemented anywhere, only header declarations and symbol
map entries were imported.

Fixes: 046c3635cd ("Bring final version of libbind:")
Fixes: e45764721a ("Update our stub resolver to final version of ...")
Reported by:	ld.lld 16 being --no-undefined-version by default
Sponsored by:	https://www.patreon.com/valpackett
Reviewed by:	emaste
Pull request:	https://github.com/freebsd/freebsd-src/pull/700
Differential Revision: https://reviews.freebsd.org/D38407
2023-04-03 04:12:28 -04:00
Brooks Davis
540cfb6b7a amd64: reduce header pollution in _stdint.h
In 38d1ac34ff SIGATOMIC_{MIN,MAX} were
defined in terms of LONG_{MIN,MAX}.  Later, they were switched to
__LONG_{MIN,MAX} in 78fe75bc28 where an
include of machine/_limits.h was added.  Switch to using fixed width
INT64_{MIN,MAX} and remove the header pollution.

No functional change.

Reviewed by:	theraven, emaste
Sponsored by:	DARPA
Differential Revision:	https://reviews.freebsd.org/D39196
2023-04-03 04:12:28 -04:00
Brooks Davis
fc5c404f63 riscv: Fix sig_atomic_t limit definitions
sig_atomic_t is defined as a long and thus is 64-bit on arm64.  For some
reason its limit was incorrectly specified as a 32-bit number.  This had
the unfortunate side effect of causing gnulib to override most of the
definitions in stdint.h.  On CheriBSD this breaks all software that uses
gnulib in annoying and hard to debug ways.

Technically updating the limits might be an ABI change, but these
defines are largely unused (the only use in tree is in the libc++ test
suite where it's use an assertion that will fail due to this bug).
Further, since the underlying type remains the same, we're just
increasing the range of values a paranoid program might use.

Reviewed by:	emaste
Sponsored by:	DARPA
Differential Revision:	https://reviews.freebsd.org/D39194
2023-04-03 04:12:28 -04:00
Brooks Davis
63e5a9c2dc arm64: Fix sig_atomic_t limit definitions
sig_atomic_t is defined as a long and thus is 64-bit on arm64.  For some
reason its limit was incorrectly specified as a 32-bit number.  This had
the unfortunate side effect of causing gnulib to override most of the
definitions in stdint.h.  On CheriBSD this breaks all software that uses
gnulib in annoying and hard to debug ways.

Technically updating the limits might be an ABI change, but these
defines are largely unused (the only use in tree is in the libc++ test
suite where it's use an assertion that will fail due to this bug).
Further, since the underlying type remains the same, we're just
increasing the range of values a paranoid program might use.

Reviewed by:	andrew, emaste
Sponsored by:	DARPA
Differential Revision:	https://reviews.freebsd.org/D39193
2023-04-03 04:12:28 -04:00
Andrew Turner
74236cde45 arm64: Use the new PCB macros in swtch.S
Rather than hard coding the location of these registers in the array
use the new macros to find the correct offset.

Sponsored by:	Arm Ltd
2023-04-03 04:12:27 -04:00
Andrew Turner
18834929d5 Add macros for arm64 pcb register offsets
Add macros for offsets of macros we set in the arm64 pcb pcb_x array.
This will simplift reducing the size of this array in a later change.

Sponsored by:	Arm Ltd
2023-04-03 04:12:27 -04:00
Ed Maste
a0bc107a54 sftp: add description of memory leak fix 2023-04-03 04:12:27 -04:00
Ed Maste
50509c362e sftp: avoid leaking path arg in calls to make_absolute_pwd_glob
As Coverity reports:
    Overwriting tmp in tmp = make_absolute_pwd_glob(tmp, remote_path)
    leaks the storage that tmp points to.

Consume the first arg in make_absolute_pwd_glob, and add xstrdup() to
the one case which did not assign to the same variable that was passed
in. With this change make_absolute() and make_absolute_pwd_glob() have
the same semantics with respect to freeing the input string.

This change was reported to OpenSSH in
https://lists.mindrot.org/pipermail/openssh-unix-dev/2022-November/040497.html
but was not acted on. It appears that OpenBSD subsequently received a
Coverity report for the same issue (their Coverity ID 405196) but fixed
only the specific instance reported by Coverity.

This change reverts OpenBSD's sftp.c 1.228 / OpenSSH-portable
commit 36c6c3eff5e4.

Reported by:	Coverity Scan
CID:		1500409
Reviewed by:	markj
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D37253
2023-04-03 04:12:27 -04:00
Mark Johnston
4d887ddc29 bhyve: Sleep briefly in the VMEXIT_DEBUG handler
As of commit 0bda8d3e9f ("vmm: permit some IPIs to be handled by
userspace") and commit 9cc9abf409 ("bhyve: create all vcpus on
startup"), we have a misbehaviour where AP vCPU threads spin until they
receive a SIPI.  In particular, since they are "suspended", they simply
call the VMEXIT_DEBUG handler in a loop, but the handler is a no-op by
default.

This is tricky to fix since the gdb stub isn't aware of whether a given
vCPU is supposed to be running.  For 13.2's sake, introduce a simple
workaround wherein the VMEXIT_DEBUG handler sleeps for a short period.
This ensures that host CPU usage remains sane when VMs are starting
without penalizing users of VMEXIT_DEBUG too much.

Reviewed by:	corvink, jhb
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D39174
2023-04-03 04:12:27 -04:00
Mark Johnston
54ca6e8e67 fdescfs: Fix a file ref leak
In fdesc_lookup(), vn_vget_ino_gen() may fail without invoking the
callback, in which case the ref on fp is leaked.  This happens if the
fdescfs mount is being concurrently unmounted.  Moreover, we cannot
safely drop the ref while the dvp is locked.

So:
- Use a flag variable to indicate whether the ref is dropped.
- Reorganize things to handle the leak.

Reported by:	C Turt <ecturt@gmail.com>
Reviewed by:	mjg, kib
Tested by:	pho
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D39189
2023-04-03 04:12:27 -04:00
Mark Johnston
6619c06630 path_test: Add a test case for openat(O_EMPTY_PATH) in capability mode
MFC after:	1 week
2023-04-03 04:12:27 -04:00
Ed Maste
c5bbd2279f etdump: exit on error if section header or entry offset is OOB
PR:		263663
Reported by:	Robert Morris <rtm@lcs.mit.edu>
Reviewed by:	markj
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D35868
2023-04-03 04:12:26 -04:00
Peter Holm
80596d86bf stress2: Fix syntax error. Remove redundant backup 2023-04-03 04:12:26 -04:00
Peter Holm
d8208d8519 stress2: Fix compiler warning 2023-04-03 04:12:26 -04:00
Warner Losh
c0ecfd00c6 _endian.h: Include sys/ctypes.h for visibility macros
BYTE_ORDER, LITTLE_ENDIAN and BIG_ENDIAN will be required by the
forthcoming POSIX Issue 8. In addition, they are provided in the BSD
compilation environments. However, depending on the order includes
happend, sys/cdefs.h may or may not be included when endian.h is
included. Include it here so we can safely test __BSD_VISIBLE.  Add
visibility when we're compiling in the future for issue 8, but since the
date number for issue 8 hasn't been fixed, use strictly greater than the
issue 7 date.of 200809.

This had the side effect of sometimes (in the traditional BSD
compliation environment)
 #if BYTE_ORDER == LITTLE_ENDIAN
and
 #if BYTE_ORDER == BIG_ENDIAN
both being true because none of these were defined. This fixes
that. It also fixes including it after <stdio.h> but not before.

PR:			269249
MFC After:		1d (build related)
Reviewed by:		kib, emaste
Differential Revision:	https://reviews.freebsd.org/D39176

Sponsored by:		Netflix
2023-04-03 04:12:26 -04:00
John Baldwin
1719513c8d Remove /usr/lib/dtrace/ipfw.d for WITHOUT_DTRACE.
Reviewed by:	brooks
Sponsored by:	DARPA
Differential Revision:	https://reviews.freebsd.org/D39099
2023-04-03 04:12:26 -04:00
Vincenzo Maffione
7c70ef3b4a netmap: fix copyin/copyout of nmreq options list
The previous code unsuccesfully attempted to report a precise error for
each option in the user list. Moreover, commit 253b2ec199 broke some
ctrl-api-test (see https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=260547).

With this patch we bail out as soon as an unrecoverable error is detected and
we properly check for copy boundaries. EOPNOTSUPP no longer immediately
returns an error, so that any other option in the list may be examined
by the caller code and a precise report of the (un)supported options can
be returned to the user.

With this patch, all ctrl-api-test unit tests pass again.

PR:			260547
Submitted by:		giuseppe.lettieri@unipi.it
Reviewed by:		vmaffione
MFC after:		14 days
2023-04-03 04:12:26 -04:00
Jean-Sébastien Pédron
7fb1dd1ce6 linuxkpi: Define pat_enabled()
This new <asm/memtype.h> header is included from <linux/pci.h> because
that's how it is included in Linux too. DRM drivers depend on this.

Reviewed by:	manu
Approved by:	manu
Differential Revision:	https://reviews.freebsd.org/D39052
2023-04-03 04:12:26 -04:00
Ed Maste
0404d7aa63 tcp_wrappers: Use ANSI (c89) definitions for one more function
Fixes: 14f102eacc ("tcp_wrappers: Use ANSI (c89) function definit...")
Sponsored by: The FreeBSD Foundation
2023-04-03 04:12:25 -04:00
Mark Johnston
4d3add9df4 ktls: Fix interlocking between ktls_enable_rx() and listen(2)
The TCP_TXTLS_ENABLE and TCP_RXTLS_ENABLE socket option handlers check
whether the socket is listening socket and fail if so, but this check is
racy.  Since we have to lock the socket buffer later anyway, defer the
check to that point.

ktls_enable_tx() locks the send buffer's I/O lock, which will fail if
the socket is a listening socket, so no explicit checks are needed.  In
ktls_enable_rx(), which does not acquire the I/O lock (see the review
for some discussion on this), use an explicit SOLISTENING() check after
locking the recv socket buffer.

Otherwise, a concurrent solisten_proto() call can trigger crashes and
memory leaks by wiping out socket buffers as ktls_enable_*() is
modifying them.

Also make sure that a KTLS-enabled socket can't be converted to a
listening socket, and use SOCK_(SEND|RECV)BUF_LOCK macros instead of the
old ones while here.

Add some simple regression tests involving listen(2).

Reported by:	syzkaller
MFC after:	2 weeks
Reviewed by:	gallatin, glebius, jhb
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D38504
2023-04-03 04:12:25 -04:00
Jung-uk Kim
500844d53c OpenSSL: Regen an assembly file for arm
X-MFC with:	af19988f6c
2023-04-03 04:12:25 -04:00
Kornel Dulęba
e0eece0fa3 OpenSSL: aes/asm/bsaes-armv7.pl: Replace adrl with add
"adrl" is a pseudo-instruction used to calculate an address relative
to PC. It's not recognized by clang resulting in a compilation error.
I've stumbled upon it when trying to integrate the bsaes-armv7 assmebly
logic into FreeBSD kernel, which uses clang as it's default compiler.
Note that this affect the build only if BSAES_ASM_EXTENDED_KEY is
defined, which is not the default option in OpenSSL.

The solution here is to replace it with an add instruction.
This mimics what has already been done in !BSAES_ASM_EXTENDED_KEY logic.
Because of that I've marked this as trivial CLA.

No objections from: jkim
Obtained from: OpenSSL commit 27093ba73372935fe4ef91d0a45ce6ea90a1ac8e
Differential Revision:	https://reviews.freebsd.org/D39091
2023-04-03 04:12:25 -04:00
Alexander V. Chernikov
8d19575fde netlink: reduce the default debugging levels
Reported by:	kp
MFC after:	2 weeks
2023-04-03 04:12:25 -04:00
Ed Maste
ebe889e57d lorder: add deprecation notice
lorder has not been used by the base system since 0e1e341b48 and
hasn't really been necessary for a very long time.

PR:		259254 [exp-run]
Reviewed by:	arichardson (earlier)
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D30080
2023-04-03 04:12:25 -04:00
Ed Maste
bb6182f567 ldd: clarify format options
-f may be specified zero, one, or two times.  Make this clear in the
usage.

Reviewed by:	markj, kib
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D34733
2023-04-03 04:12:25 -04:00
Ed Maste
a16ad7833f tcp_wrappers: Use ANSI (c89) function definitions
Although this code is in contrib/ there is no active upstream.

Reviewed by:	brooks
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D36047
2023-04-03 04:12:25 -04:00
Ed Maste
e15794ea99 gvinum: correct assertions
Pointer addresses are always >= 0.  Assert that the value is >= 0
instead.

PR:		207855, 207856
Reviewed by:	imp
Reported by:	David Binderman
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D37677
2023-04-03 04:12:24 -04:00
Justin Hibbits
ca90fd1686 powerpc/pmap: Account for a potential NULL pmap in pmap_sync_icache
It's apparently possible for pcpu->pc_curpmap to be NULL at some point,
leading to a panic.  Account for this as is done with the other 64-bit
AIM pmap.

Reported by:	pkubaj
Tested by:	pkubaj
Fixes:		6f0b2a235a ("Add pmap_sync_icache() for radix pmap")
MFC after:	3 days
2023-04-03 04:12:24 -04:00
David E. O'Brien
b177aa936f pmap_mapdev_attr() doesn't use any of its arguments. 2023-04-03 04:12:24 -04:00
Ihor Antonov
0cbf308022 daemon: move signal setup into a function
No functional change intended.

Reviewed by:	kevans
2023-04-03 04:12:24 -04:00
Zhenlei Huang
1e16025dfd if_re: Drop redundant assignments for ifq_maxlen and ifq_drv_maxlen
Fixes:	4519a073c3 Mechanically convert if_re(4) to DrvAPI
2023-04-03 04:12:24 -04:00
Rick Macklem
db527ae3f2 mountd.8: Update for mountd running in jails
Mountd can now be run in an appropriately
configured vnet jail.

This man page update adds some information
for this case.

This is a content change.

Reviewed by:	markj
MFC after:	3 months
Differential Revision:	https://reviews.freebsd.org/D39168
2023-04-03 04:12:24 -04:00
Jean-Sébastien Pédron
b20f3ee398 x86/pci_early_quirks: Support Intel 11th+ gen
Newer Intel CPUs/iGPUs use a new method to determine the base address of
the stolen memory. This code was ported from Linux.

Reviewed by:	manu
Approved by:	manu
Differential Revision:	https://reviews.freebsd.org/D39057
2023-04-03 04:12:24 -04:00
Jean-Sébastien Pédron
f8c2d40227 linuxkpi: Define seq_has_overflowed() and single_open_size()
This required non-trivial changes to `linux_seq_file.c` to manage a new
`(struct seq_file)->size` field. This field is read directly by DRM
drivers, so we can't alias it to a call to sbuf_len(9).

`single_open_size()` also depended on the ability to allocate the sbuf
with a specified size instead of relying on `sbuf_new_auto()`.

Reviewed by:	manu
Approved by:	manu
Differential Revision:	https://reviews.freebsd.org/D39056
2023-04-03 04:12:23 -04:00
Jean-Sébastien Pédron
af0361fcc8 linuxkpi: Support non-NULL zero-size pointers
DRM drivers set some pointers to `ZERO_SIZE_PTR` directly (without
allocating anything), to treat pointers which were "initialized" (set to
`ZERO_SIZE_PTR`) with no memory allocation like really allocated
pointers. NULL isn't used because it represents a third state.

Reviewed by:	emaste, manu
Approved by:	emaste, manu
Differential Revision:	https://reviews.freebsd.org/D39055
2023-04-03 04:12:23 -04:00
Jean-Sébastien Pédron
9bf11ee8f8 linuxkpi: Add <linux/iommu.h>
It defines a small part of the IOMMU API of Linux. We don't implement
that yet.

Reviewed by:	manu
Approved by:	manu
Differential Revision:	https://reviews.freebsd.org/D39054
2023-04-03 04:12:23 -04:00
Jean-Sébastien Pédron
7de26952af linuxkpi: Define pcie_aspm_enabled()
This is not the same as querying the PCIE ASPM capability. The function
should return if the feature is actually enabled or not. It always
return false on FreeBSD.

Reviewed by:	manu
Approved by:	manu
Differential Revision:	https://reviews.freebsd.org/D39053
2023-04-03 04:12:23 -04:00
Jean-Sébastien Pédron
d4093f8424 linuxkpi: Add default_groups field to struct kobj_type
We don't use it, but it is set by the DRM drivers.

Reviewed by:	manu
Approved by:	manu
Differential Revision:	https://reviews.freebsd.org/D39051
2023-04-03 04:12:23 -04:00
Jean-Sébastien Pédron
5e51b3254f linuxkpi: Define device_iommu_mapped()
For now, it always return false.

Reviewed by:	manu
Approved by:	manu
Differential Revision:	https://reviews.freebsd.org/D39050
2023-04-03 04:12:23 -04:00
Jean-Sébastien Pédron
c5b6e66417 linuxkpi: Define dev_WARN() and dev_WARN_ONCE()
Reviewed by:	manu
Approved by:	manu
Differential Revision:	https://reviews.freebsd.org/D39049
2023-04-03 04:12:23 -04:00
Mitchell Horne
0dd86d978a x86: nexus code tidy-up
Make a pass at the various nexus implementations, fixing some very minor
style issues, obsolete comments, etc.

The method declaration section has become unwieldy in many respects.
Attempt to tame it by:
 - Using generated method typedefs
 - Grouping methods roughly by category, and then alphabetically.

Reviewed by:	jhb
Differential Revision:	https://reviews.freebsd.org/D38495
2023-04-03 04:12:23 -04:00
Mitchell Horne
afab6ab3fd powerpc: nexus code tidy-up
Make a pass at the various nexus implementations, fixing some very minor
style issues, obsolete comments, etc.

Update the top-level comment to be closer to other nexus
implementations.

The method declaration section has become unwieldy in many respects.
Attempt to tame it by:
 - Using generated method typedefs
 - Grouping methods roughly by category, and then alphabetically.

Reviewed by:	jhb
Differential Revision:	https://reviews.freebsd.org/D38495
2023-04-03 04:12:22 -04:00
Mitchell Horne
b89a9ba540 riscv: nexus code tidy-up
Make a pass at the various nexus implementations, fixing some very minor
style issues, obsolete comments, etc.

The method declaration section has become unwieldy in many respects.
Attempt to tame it by:
 - Using generated method typedefs
 - Grouping methods roughly by category, and then alphabetically.

Reviewed by:	jhb
Differential Revision:	https://reviews.freebsd.org/D38495
2023-04-03 04:12:22 -04:00
Mitchell Horne
df08929b6c arm64: nexus code tidy-up
Make a pass at the various nexus implementations, fixing some very minor
style issues, obsolete comments, etc.

The method declaration section has become unwieldy in many respects.
Attempt to tame it by:
 - Using generated method typedefs
 - Grouping methods roughly by category, and then alphabetically.

Reviewed by:	jhb
Differential Revision:	https://reviews.freebsd.org/D38495
2023-04-03 04:12:22 -04:00
Mitchell Horne
eb3cabeeed arm: nexus code tidy-up
Make a pass at the various nexus implementations, fixing some very minor
style issues, obsolete comments, etc.

The method declaration section has become unwieldy in many respects.
Attempt to tame it by:
 - Using generated method typedefs
 - Grouping methods roughly by category, and then alphabetically.

Reviewed by:	jhb
Differential Revision:	https://reviews.freebsd.org/D38495
2023-04-03 04:12:22 -04:00
Mark Johnston
f9512cea83 vmrun: Expose bhyve's -G option
MFC after:	1 week
2023-04-03 04:12:22 -04:00
Mitchell Horne
48b22a39ac mi_switch(9): fix comma placement
Sponsored by:	The FreeBSD Foundation
Fixes:	175db7b582 ("mi_switch(9): update to current day")
2023-04-03 04:12:22 -04:00
Mitchell Horne
19a2bab266 Cross-reference coretemp(4) and amdtemp(4)
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
2023-04-03 04:12:22 -04:00
Mitchell Horne
10c8471031 printf(9): add MLINKS for vlog(9) and vprintf(9)
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
2023-04-03 04:12:21 -04:00
Mitchell Horne
ce87379b74 hardclock(9): small cleanups
- Improve the wording that describes cnt and hz (avoid "the long haul")
 - Use .Fa for function arguments
 - Fix formatting of parenthesis around swi(9) xref
 - removed xref to non-existent options(4)
 - xref polling(4)
 - consistently list xrefs in SEE ALSO
 - xref eventtimers(9) in SEE ALSO

Reviewed by:	mav, rpokala
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D39137
2023-04-03 04:12:21 -04:00
Mitchell Horne
232e37df82 callout(9): adopt old references to timeout(9)
timeout(9) was removed a couple of years ago; all consumers now use the
callout(9) interface.

Explicitly do not bump .Dd anywhere, as this is not a content or
semantic change.

Reviewed by:	markj, jhb, Pau Amma <pauamma@gundo.com>
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D39136
2023-04-03 04:12:21 -04:00
Mitchell Horne
3bff6ac6df kern_reboot(9): describe event handlers
Add more details about the execution and purpose of these shutdown
handlers. Make a point to mention the requirement that they can be run
in a normal or panic context. Add some simple examples.

Add a brief comment to the declaration in sys/eventhandler.h.

Reviewed by:	markj
Discussed with:	rpokala, Pau Amma <pauamma@gundo.com>
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D39135
2023-04-03 04:12:21 -04:00
Mitchell Horne
689f5b4fc6 kern_reboot(9): document shutdown_nice()
Reviewed by:	markj, Pau Amma <pauamma@gundo.com>
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D39134
2023-04-03 04:12:21 -04:00
Mitchell Horne
ee285c6980 kern_reboot(9): some updates
- This function no longer disables interrupts
 - MLINK to reboot.9
 - The mentions of autoconfiguration is more about shutdown_nice(),
   coming in the next commit.
 - Describe the RB_* flags relevant to this function
 - Describe behaviour when shutdown hooks fail the reset
 - Describe expected execution contexts
 - Add FF copyright
 - xref panic(9)
 - xref this page in reboot(2)

Reviewed by:	markj
Discussed with:	rpokala, Pau Amma <pauamma@gundo.com>
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D39133
2023-04-03 04:12:21 -04:00
Mitchell Horne
b1137dfbad panic(9): some updates
- Better description of what the panic() function does
 - Document KERNEL_PANICKED()
 - Add a section describing panic execution context
 - Add SEE ALSO

Reviewed by:	kib, markj, rpokala
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D39132
2023-04-03 04:12:21 -04:00
Mitchell Horne
3b7993f867 KASSERT(9): some updates
- Add a little bit of introductory text
 - Improve the existing example: ANSI C, use a better assertion than a
   NULL check (which is discouraged)
 - Document the widely used MPASS macro in this page
 - Drop the cross-reference to config(8)

Reviewed by:	kib, markj, rpokala, Pau Amma <pauamma@gundo.com>
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D39131
2023-04-03 04:12:20 -04:00
Mitchell Horne
8030b8ae7a critical(9): small updates
- Document CRITICAL_ASSERT() in this man page.
 - Clarify that a thread may also handle interrupts in a critical
   section, not only faults/exceptions.
 - Note the negative effects of critical section abuse
 - Some other minor clarifications
 - Add short SEE ALSO

Reviewed by:	kib, markj, rpokala, Pau Amma <pauamma@gundo.com>
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D39130
2023-04-03 04:12:20 -04:00
Mitchell Horne
d98202980e vcount.9: remove obsolete man page
These functions, vcount() and count_dev(), no longer exist in the source
tree.

Reviewed by:	rpokala
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D39128
2023-04-03 04:12:20 -04:00
Fedor Uporov
8bed02c0f8 Fix compilation issue, when DTRACE is not defined
PR:             270346
Reported by:    Michael Paepcke
MFC after:      2 week
2023-04-03 04:12:20 -04:00
Kyle Evans
2d675f411b pkill: tests: do a pass for case-sensitive conflicts
As in 76b6a59f9d, encode upper-case flag tests with a leading
underbar to avoid collisions (thus, erroneously dirty git repos) on
case-sensitive filesystems.

Sponsored by:	Klara, Inc.
2023-04-03 04:12:20 -04:00
Kyle Evans
73c6afb30e pkill: use an ARG_MAX size buffer for argument matching
Right now pkill/pgrep cut off at _POSIX2_LINE_MAX (2048), but argument
strings can be much larger (ARG_MAX is 256K/512K).  Stop arbitrarily
cutting the search off at 2K, rather than documenting the limit.

Reviewed by:	allanjude (earlier version), des
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D38663
2023-04-03 04:12:20 -04:00
Mark Johnston
02e86504d5 kerneldump: Inline dump_savectx() into its callers
The callers of dump_savectx() (i.e., doadump() and livedump_start())
subsequently call dumpsys()/minidumpsys(), which dump the calling
thread's stack when writing the dump.  If dump_savectx() gets its own
stack frame, that frame might be clobbered when its caller later calls
dumpsys()/minidumpsys(), making it difficult for debuggers to unwind the
stack.

Fix this by making dump_savectx() a macro, so that savectx() is always
called directly by the function which subsequently calls
dumpsys()/minidumpsys().

This fixes stack unwinding for the panicking thread from arm64
minidumps.  The same happened to work on amd64, but kgdb reports the
dump_savectx() calls as coming from dumpsys(), so in that case it
appears to work by accident.

Fixes:	c9114f9f86 ("Add new vnode dumper to support live minidumps")
Reviewed by:	mhorne, jhb
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D39151
2023-04-03 04:12:20 -04:00
Daniel Kolesa
46636b22d3 sh(1): fix history file write checking
We cannot just compare histsizeval() against 0, since that returns
a string pointer, which is always non-zero (non-null). The logic
in sethistsize() initializes the history size to 100 with values
that are non-number, and an empty string counts as that. Therefore,
the only time we want to not write into history with HISTSIZE val
set is when it's explicitly 0.

MFC after:	2 weeks
2023-04-03 04:12:19 -04:00
Kristof Provost
aeeb3cd0c9 pf tests: try to trigger locking issues in pfsync_timeout()
PR:		268246
MFC after:	1 week
Sponsored by:	Rubicon Communications, LLC (Netgate)
2023-04-03 04:12:19 -04:00
Kristof Provost
5942d0bd54 pfsync: fix pfsync_undefer_state() locking
pfsync_undefer_state() takes the bucket lock, but could get called from
places (e.g. from pfsync_update_state() or pfsync_delete_state()) where
we already held the lock.

As it can also be called from places where we don't yet hold the lock
create new locked variant for use when the lock is already held. Keep
using pfsync_undefer_state() where the lock must still be taken.

PR:		268246
MFC after:	1 week
Sponsored by:	Rubicon Communications, LLC (Netgate)
2023-04-03 04:12:19 -04:00
Kristof Provost
e507a6ce7e pfsync: add missing unlock in pfsync_defer_tmo()
The callout for pfsync_defer_tmo() is created with
CALLOUT_RETURNUNLOCKED, because while the callout framework takes care
of taking the lock we want to run a few operations outside of the lock,
so we unlock ourselves.

However, if `sc->sc_sync_if == NULL` we return without releasing the
lock, and leak the lock, causing later deadlocks.
Ensure we always release the bucket lock when we exit pfsync_defer_tmo()

PR:		268246
MFC after:	1 week
Sponsored by:	Rubicon Communications, LLC (Netgate)
2023-04-03 04:12:19 -04:00
Mark Johnston
ba6b2a2603 netipsec tests: Serialize
The tunnel mode tests use VNET jails and reuse jail names.  Until this
is addressed, serialize them.

MFC after:	1 week
2023-04-03 04:12:19 -04:00
Glen Barber
c25bdd89a5 pkg-stage.sh: update port trailing version information
Reported by:	Ian Smith, Graham Perrin
MFC after:	1 week
X-MFC-13.2:	NO

Sponsored by:	Rubicon Communications, LLC ("Netgate")
2023-04-03 04:12:19 -04:00
Kristof Provost
7f36f8861d carp: use if_name()
Reported by:	melifaro
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2023-04-03 04:12:19 -04:00
Kristof Provost
a72a570c1c carp: document peer/peer6 and mcast/mcast6 in the relevant man pages
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D38943
2023-04-03 04:12:19 -04:00
Kristof Provost
47d582e0cb carp tests: unicast tests (IPv6)
Test the new unicast carp mode for IPv6.

There's a routing hop between the peers, to ensure that the TTL check is
correctly disabled for unicast carp.

Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D38942
2023-04-03 04:12:18 -04:00
Kristof Provost
d81e4337e3 carp tests: unicast tests (IPv4)
Test the new unicast carp mode for IPv4.

There's a routing hop between the peers, to ensure that the TTL check is
correctly disabled for unicast carp.

Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D38941
2023-04-03 04:12:18 -04:00
Kristof Provost
81c72e3b63 carp: support unicast
Allow users to configure the address to send carp messages to. This
allows carp to be used in unicast mode, which is useful in certain
virtual configurations (e.g. AWS, VMWare ESXi, ...)

Reviewed by:	melifaro
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D38940
2023-04-03 04:12:18 -04:00
Christos Margiolis
129d2e06d1 libdtrace: fix indendation in dt_printd()
No functional change.

Reviewed by:	markj
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D39145
2023-04-03 04:12:18 -04:00
Dmitry Mikushin
5b4c0a8114 arm64: Adding a missing include file
Adding a missing include file, which provides the definition of
SYSCTL_INT.

Reviewed by:	andrew
Differential Revision:	https://reviews.freebsd.org/D39149
2023-04-03 04:12:18 -04:00
Kristof Provost
aa537b35be carp tests: test manually switch between backup and master
There's been at least one issue where we failed to correctly enter
NET_EPOCH that was triggered in this scenario.
Add a test case for it to make it easier to detect issues like this in
the future.

Reviewed by:	zlei
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D39115
2023-04-03 04:12:18 -04:00
Kristof Provost
c2de15a535 carp: add netlink interface
Allow carp configuration information to be supplied and retrieved via
netlink.

Reviewed by:	melifaro
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D39048
2023-04-03 04:12:18 -04:00
Konstantin Belousov
78d496e05f ext2_dirbad(): fix !DTRACE build
Fixes:	3c2dc524c3
Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
2023-04-03 04:12:17 -04:00
Zhenlei Huang
ae241fbea7 xhci(4): Describe Fresco Logic FL1009 USB 3.0 controller
Reviewed by:	hselasky
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D38922
2023-04-03 04:12:17 -04:00
Xin LI
0f9980dc9c Vendor import of xz 5.4.2 (trimmed) 2023-04-03 04:12:15 -04:00
Jose Luis Duran
0a5e76186b ping: Avoid reporting negative time statistics
Display a warning when the time goes back.

PR:		192417
Reviewed by:	markj
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D38480
2023-04-03 04:11:51 -04:00
Jose Luis Duran
7c50b79c17 ping tests: Add tests for IP header options
The function pr_pack() prints out a packet, if the IP packet contains
options, these are printed as well.

Test the functionality fixed in
70960bb86a.

Reviewed by:	markj
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D38470
2023-04-03 04:11:51 -04:00
Jose Luis Duran
861e5e3832 ping: Remove pr_retip()
Ping used to provide some sort of packet sniffing capabilities, this was
in an era where hubs were used and tcpdump wasn't invented.

pr_iph() is a function that prints the IP header of the packet.

pr_retip() is essentially a wrapper function to pr_iph(), that also
displays the source and destination ports of a TCP or UDP packet.

After ef9e6dc7ee some of this
functionality was almost removed, to only display packets sent by us
(26+ years ago).

At this point, reaching this code path was only possible by doctoring
the original packet.

After 46d7b45a26 this code path can never
be reached.

Remove the code.

Reviewed by:	markj
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D38475
2023-04-03 04:11:51 -04:00
Jose Luis Duran
5889560690 ping: Print the IP options of the original packet
When an ICMP packet contains an IP packet in its payload, and that
original IP packet contains options, these options were not displayed
accordingly in pr_iph().

pr_iph() is a function that prints the original "quoted packet" IP
header, with only an IP struct as an argument.  The IP struct does not
contain IP options, and it is not guaranteed that the options will be
contiguous in memory to the IP struct after
d9cacf605e.

Pass the raw ICMP data along with the IP struct, in order to print the
options, if any.

Reviewed by:	markj
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D38469
2023-04-03 04:11:51 -04:00
Peter Holm
8543304772 stress2: Added more FFS tests 2023-04-03 04:11:51 -04:00
Gordon Bergling
a01b2ec360 tcp_rack.4: Correct a link in the SEE ALSO section
The PDF at arxiv.org is only accessible when
retrieving it via the website.

MFC after:	3 days
2023-04-03 04:11:51 -04:00
Kirk McKusick
3436d9784d Fix syntax error in 0697670.
Reported by: Michael Tuexen
2023-04-03 04:11:51 -04:00
Michael Tuexen
d68a6b9b50 sctp: fix typo in assignment 2023-04-03 04:11:51 -04:00
Kirk McKusick
ea1d917345 Do not panic in case of corrupted UFS/FFS directory.
Historically the system panic'ed when it encountered a corrupt
directory. This change recovers well enough to continue operations.
This change is made in response to a similar change made in the ext2
filesystem as described in the cited Differential Revision.

MFC after:    2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D38503
2023-04-03 04:11:50 -04:00
Mark Johnston
fb43cdd09a netgraph tests: Serialize
Some tests share names for netgraph nodes, so they cannot be run in
parallel.

MFC after:	1 week
2023-04-03 04:11:50 -04:00
Konstantin Belousov
879194d050 acpi_wakeup.c: apply the reviewer' editorial corrections to the comment text.
Fixes:	02904a06c7
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D39146
2023-04-03 04:11:50 -04:00
Konstantin Belousov
dd3750cea3 amd64: properly recalculate mitigations knobs after resume
Revision r333125 AKA 986c4ca387 forced clear cpu_stdext_feature3
on suspend, since at that time microcode update was not reloaded
early on resume. Then, revision 050f5a8405 started re-reading
cpu_stdext_feature3 again. Since modern CPUs do not require mitigations
from the Skylake era, this went unnoticed for some time.

Keep zeroing cpu_stdext_feature3 on suspend, but re-read it in more
controlled way on resume after microcode is reloaded, and recalculate
active workarounds based on actual microcode capabilities.

Reported and tested by:	romain
Reviewed by:	emaste, markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D39146
2023-04-03 04:11:50 -04:00
Alexander V. Chernikov
268629fefc netstat: fix double-free in netlink error code path.
CID:	1504382
2023-04-03 04:11:50 -04:00
Alexander V. Chernikov
a10ee27528 netstat: simplify netlink route printing code.
A number of improvements has commited to snl(3) recently.
A notable one is snl(3) build-in parsers for all of the objects
 exported by the kernel.

This change updates netlink handling code to the latest available snl(3)
API.
2023-04-03 04:11:49 -04:00
Alexander V. Chernikov
d2a6d1b95e netlink: add public ucred accessor for nlp.
MFC after:	2 weeks
2023-04-03 04:11:49 -04:00
Alexander V. Chernikov
0b3cd04b49 netlink: fix capped uncapped ack handling in snl(3).
Reviewed by:	kp
Differential Revision: https://reviews.freebsd.org/D39144
MFC after:	2 weeks
2023-04-03 04:11:49 -04:00
Peter Holm
2dd20ad87f stress2: Added two syzkaller reproducers 2023-04-03 04:11:49 -04:00
Gordon Bergling
8f775107dd smbfs.5: Us .An -nosplit for the AUTHORS section
Use .An -nosplit for the AUTHORS section, so that
it renders without an unnecessary newline.

No .Dd bump since it isn't a content change.

MFC after:	3 days
2023-04-03 04:11:49 -04:00
Wei Hu
4303328c17 uart: Don't change settings or throttle putc for Hyper-V
Azure setup does not like it when FreeBSD overrides the settings of the
UART device. When Hyper-V is detected, don't do this and also don't
throttle putc() output. This is a workaround for the early boot hang
of FreeBSD on Azure.

Tested on Azure, ESXi (VM with serial port), and SG-8200

PR:		264267
Reviewed by:	kevans, whu
Tested by:	whu
Obtained from:	Rubicon Communications, LLC (Netgate)
MFC after:	2 weeks
Sponsored by:	Rubicon Communications, LLC (Netgate)
2023-04-03 04:11:49 -04:00
Wei Hu
d9a557896b amd64 loader: Use efiserialio for Hyper-V booted systems
UEFI provides ConIn/ConOut handles for consoles that it supports,
which include the text-video and serial ports. When the serial port
is available, use the UEFI driver instead of direct io-port accesses
to avoid conflicts between the firmware and direct hardware access, as
happens on Hyper-V (Azure) setups.

This change enables efiserialio to be built for efi-amd64 and has
higher order priority vs comconsole, and only uses efiserialio
if the hypervisor is Hyper-V. When efiserialio successfully
probes, it will set efi_comconsole_avail=true which will prevent
comconsole from probing in this setup.

Tested on Hyper-V, ESXi and Azure VMs.

PR:		264267
Reviewed by:	kevans, whu
Tested by:	whu
Obtained from:	Rubicon Communications, LLC (Netgate)
MFC after:	2 weeks
Sponsored by:	Rubicon Communications, LLC (Netgate)
2023-04-03 04:11:49 -04:00
Konstantin Belousov
fe9c18b3af Belately bump __FreeBSD_version for introduction of __libc_start1()
and move of most of the initialization code from csu to libc.

Requested by:	jrtc27
Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
2023-04-03 04:11:48 -04:00
Fedor Uporov
65387a4a01 Do not panic in case of corrupted directory
The panic() will be called under ext2_dirbad()
function in case of rw mount. It cause user confusion,
like in BZ 265951.

PR:			265951
Reviewed by:		pfg, mckusick
MFC after:		2 week
Differential revision:  https://reviews.freebsd.org/D38503
2023-04-03 04:11:48 -04:00
Fedor Uporov
7d2cc3413b Add root directory entry check.
Add check that directory entry with ino=EXT2_ROOTINO
have correct namelength and name. It is possible to
create malicious image which will cause panic if root
directory entry have incorrect name.

PR:			259068
Reported by:		Robert Morris
Reviewed by:		pfg
MFC after:		2 weeks
Differential Revision:  https://reviews.freebsd.org/D38502
2023-04-03 04:11:48 -04:00
Kyle Evans
1efe3d5307 daemon: kill off some stray blank lines
Overlooked in review; mea culpa.

Reported by:	jrtc27
2023-04-03 04:11:48 -04:00
Ihor Antonov
b6aee111c0 daemon: remove unnecessary memset in daemon_state_init()
Pull Request:	https://github.com/freebsd/freebsd-src/pull/694
2023-04-03 04:11:48 -04:00
Ihor Antonov
6bd4cb987f daemon: repace goto exit with daemon_terminate()
Start breaking down big main()
Remove goto exit label and replace it with a function that does cleanup.

Comment re-worded by kevans@.

Pull Request:	https://github.com/freebsd/freebsd-src/pull/694
2023-04-03 04:11:48 -04:00
Zhenlei Huang
ce49c45931 uhci(4): Correct PCI device ID for Zhaoxin USB controller
And minor style fixes.

Tested by:	Weitao Wang <WeitaoWang-oc@zhaoxin.com>
Fixes:		986c7be472 uhci(4): Add new USB IDs
Differential Revision:	https://reviews.freebsd.org/D38924
2023-04-03 04:11:48 -04:00
Zhenlei Huang
a0fa198847 ehci(4): Correct PCI device ID for Zhaoxin USB 2.0 controller
And minor style fixes.

Tested by:	Weitao Wang <WeitaoWang-oc@zhaoxin.com>
Fixes:		f9237e1937 ehci(4): Add new USB IDs
Differential Revision:	https://reviews.freebsd.org/D38923
2023-04-03 04:11:47 -04:00
Zhenlei Huang
bb68d1188a xhci(4): Correct PCI device IDs for Zhaoxin USB 3.0 controllers
And minor style fixes.

Reviewed by:	hselasky
Tested by:	Weitao Wang <WeitaoWang-oc@zhaoxin.com>
Fixes:		0d7064d58f xhci(4): Add new USB IDs
Differential Revision:	https://reviews.freebsd.org/D38921
2023-04-03 04:11:47 -04:00
Mateusz Guzik
46d53bdc8a vfs: retire KERN_VNODE
It got disabled in 2003:

commit acb18acfec
Author: Poul-Henning Kamp <phk@FreeBSD.org>
Date:   Sun Feb 23 18:09:05 2003 +0000

    Bracket the kern.vnode sysctl in #ifdef notyet because it results
    in massive locking issues on diskless systems.

    It is also not clear that this sysctl is non-dangerous in its
    requirements for locked down memory on large RAM systems.

There does not seem to be practical use for it and the disabled routine
does not work anyway.

Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D39127
2023-04-03 04:11:47 -04:00
Jose Luis Duran
ed237af823 ping: Avoid magic numbers
The sizeof(struct ip) is 20.
The sizeof(struct in_addr) is 4.

No functional change intended.

Reviewed by:	asomers, markj
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D39125
2023-04-03 04:11:47 -04:00
Konstantin Belousov
e59746f33b amd64 acpi_wakeup.c: fix typo
Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2023-04-03 04:11:47 -04:00
Vitaliy Gusev
0c3b13c78c vmm: fix missing ipi statistic
ipi counters are missing in bhyvectl's output because vm_maxcpu is 0
when initializing them. That's because vmm_stat_register is executed
before vmm_init.

Instead of directly fixing it, there's a better solution in illumos
which is cherry picked:
65a3bc8373

It replaces the matrix statistic by two counters per vcpu. One for
counting the ipis to the vcpu and one counting the ipis received by the
vcpu. This has several advantages:

- A matrix statistic becomes huge when using many vcpus.
- A matrix statistic easily reaches the MAX_VMM_STAT_ELEMS limit.
- Two counters are enough in most cases. DTrace can be used for more
  advanced debugging purposes.
- A matrix statistic wastes memory. The matrix size is determined by
  vm_maxcpu regardless of the number of vcpus assigned to the vm.

Reviewed by:		corvink, markj
Fixes:			ee98f99d7a ("vmm: Convert VM_MAXCPU into a loader tunable hw.vmm.maxcpu.")
MFC after:		1 week
Sponsored by:		vStack
Differential Revision:	https://reviews.freebsd.org/D39038
2023-04-03 04:11:47 -04:00
Emmanuel Vadot
97446e9799 arm: Remove SOCFPGA specific kernel configs
We had GENERIC for a while now so anyone still interested in those boards
should make sure that we can boot on them with it and with upstream DTS files.

Sponsored by:   Beckhoff Automation GmbH & Co. KG
Reviewed by:	br
Differential Revision:	https://reviews.freebsd.org/D39088
2023-04-03 04:11:47 -04:00
Emmanuel Vadot
afd771333f UPDATING: Document arm video devices renaming.
Sponsored by:	Beckhoff Automation GmbH & Co. KG
Reviewed by:	andrew
Differential Revision:	https://reviews.freebsd.org/D39121
2023-04-03 04:11:47 -04:00
Emmanuel Vadot
0a22d30259 arm: Rename hdmi_if.m to crtc_if.m
There is nothing hdmi related in this interface, it's just a generic interface
for crt controller so rename it.
This also remove the 'hdmi' device used in arm kernel config. 'vt' now controls
if we build this interface (sc(4) isn't supported on arm).

Sponsored by:	Beckhoff Automation GmbH & Co. KG
Reviewed by:	andrew
Differential Revision:	https://reviews.freebsd.org/D39120
2023-04-03 04:11:46 -04:00
Emmanuel Vadot
3bab08669e arm: ti: Rename video related devices
device 'hdmi' is too generic (and will be used later in a new device) so rename
the arm TI devices to some proper name.

Sponsored by:   Beckhoff Automation GmbH & Co. KG
Reviewed by:	andrew
Differential Revision:	https://reviews.freebsd.org/D39119
2023-04-03 04:11:46 -04:00
Emmanuel Vadot
f67ca89560 arm: imx: Rename video related devices
device 'hdmi' is too generic (and will be used later in a new device) so rename
the arm IMX devices to some proper name.

Sponsored by:	Beckhoff Automation GmbH & Co. KG
Reviewed by:	andrew
Differential Revision:	https://reviews.freebsd.org/D39118
2023-04-03 04:11:46 -04:00
Emmanuel Vadot
76db189e86 arm: allwinner: Garbage collect a10_hdmi driver
It was disconnected 5 years ago in 4573cd3914
("arm: allwinner: Disconnect A10/A20 HDMI driver") as it wasn't working.

Sponsored by:	Beckhoff Automation GmbH & Co. KG
Reviewed by:	andrew
Differential Revision:	https://reviews.freebsd.org/D39117
2023-04-03 04:11:46 -04:00
Emmanuel Vadot
6c6db9189a arm: Remove IMX6 kernel config
All devices are in GENERIC and GENERIC is known to boot on those SoCs.

Sponsored by:	Beckhoff Automation GmbH & Co. KG
Reviewed by:	andrew
Differential Revision:	https://reviews.freebsd.org/D39090
2023-04-03 04:11:46 -04:00
Emmanuel Vadot
2632e71f26 arm: Remove IMX5 specific kernel configs
We had GENERIC for a while now so anyone still interested in those boards
should make sure that we can boot on them with it and with upstream DTS files.

Sponsored by:   Beckhoff Automation GmbH & Co. KG
Reviewed by:	andrew
Differential Revision:	https://reviews.freebsd.org/D39089
2023-04-03 04:11:46 -04:00
Emmanuel Vadot
9b2c2dc689 arm: Remove VYBRID specific kernel config
We had GENERIC for a while now so anyone still interested in those boards
should make sure that we can boot on them with it and with upstream DTS files.

Sponsored by:	Beckhoff Automation GmbH & Co. KG
Reviewed by:	andrew
Differential Revision:	https://reviews.freebsd.org/D39087
2023-04-03 04:11:46 -04:00
Emmanuel Vadot
ed5d5a23d5 arm: Remove kernel config APALIS-IMX6
It reference to a non-existant dts file apalis-imx6.dts so unlikekly to compile.
Aldo IMX6 support is in GENERIC so anyone interested in this board should
make it work with GENERIC kernel (if that's not already the case).

Sponsored by:	Beckhoff Automation GmbH & Co. KG
Reviewed by:	andrew
Differential Revision:	https://reviews.freebsd.org/D39086
2023-04-03 04:11:45 -04:00
Peter Holm
6d1ca092cf stress2: Fix compiler warning 2023-04-03 04:11:45 -04:00
Corvin Köhne
78844be942 bhyve: add cmdline option to enable qemu's fwcfg
Let the user decide if he wants to use bhyve's fwctl or qemu's fwcfg. He
can set the interface by adding a fwcfg option to bootrom:

-l bootrom,<path/to/rom>,fwcfg=bhyve
-l bootrom,<path/to/rom>,fwcfg=qemu

Reviewed by:		markj
MFC after:		1 week
Sponsored by:		Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D38337
2023-04-03 04:11:45 -04:00
Corvin Köhne
e14b3ccc2d bhyve: add helper for adding fwcfg files
Fwcfg items without a fixed index are reported by the file_dir. They
have an index of 0x20 and above. This helper simplifies the addition of
such fwcfg items. It selects a new free index, assigns it to the fwcfg
items and creates an proper entry in the file_dir.

Reviewed by:		markj
MFC after:		1 week
Sponsored by:		Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D38336
2023-04-03 04:11:45 -04:00
Kyle Evans
9497cb13d2 x86: gate smbios hypervisor identification behind vm_guest
cpuid detection may have picked up a more specific guest type already,
and a follow-up check of smbios vendor/product may erroneously blow
away the previously detected type.

This reportedly fixes the boot under Hyper-V, which advertises an
smbios.system.product of "Virtual Machine."

PR:		270239
Reviewed by:	imp, kib (both earlier version, same concept)
Fixes:	2fee875629 ("abstract out the vm detection via smbios..")
Differential Revision:	https://reviews.freebsd.org/D39140
2023-04-03 04:11:45 -04:00
Rick Macklem
b2db25b5f9 nfscl: Add a new NFSv4.1/4.2 mount option for Kerberized mounts
Without this patch, a Kerberized NFSv4.1/4.2 mount must provide
a Kerberos credential for the client at mount time.  This credential
is typically referred to as a "machine credential".  It can be
created one of two ways:
- The user (usually root) has a valid TGT at the time the mount
  is done and this becomes the machine credential.
  There are two problems with this.
  1 - The user doing the mount must have a valid TGT for a user
      principal at mount time.  As such, the mount cannot be put
      in fstab(5) or similar.
  2 - When the TGT expires, the mount breaks.
- The client machine has a service principal in its default keytab
  file and this service principal (typically called a host-based
  initiator credential) is used as the machine credential.
  There are problems with this approach as well:
  1 - There is a certain amount of administrative overhead creating
      the service principal for the NFS client, creating a keytab
      entry for this principal and then copying the keytab entry
      into the client's default keytab file via some secure means.
  2 - The NFS client must have a fixed, well known, DNS name, since
      that FQDN is in the service principal name as the instance.

This patch uses a feature of NFSv4.1/4.2 called SP4_NONE, which
allows the state maintenance operations to be performed by any
authentication mechanism, to do these operations via AUTH_SYS
instead of RPCSEC_GSS (Kerberos).  As such, neither of the above
mechanisms is needed.

It is hoped that this option will encourage adoption of Kerberized
NFS mounts using TLS, to provide a more secure NFS mount.

This new NFSv4.1/4.2 mount option, called "syskrb5" must be used
with "sec=krb5[ip]" to avoid the need for either of the above
Kerberos setups to be done by the client.

Note that all file access/modification operations still require
users on the NFS client to have a valid TGT recognized by the
NFSv4.1/4.2 server.  As such, this option allows, at most, a
malicious client to do some sort of DOS attack.

Although not required, use of "tls" with this new option is
encouraged, since it provides on-the-wire encryption plus,
optionally, client identity verification via a X.509
certificate provided to the server during TLS handshake.
Alternately, "sec=krb5p" does provide on-the-wire
encryption of file data.

A mount_nfs(8) man page update will be done in a separate commit.

Discussed on:	freebsd-current@
MFC after:	3 months
2023-04-03 04:11:45 -04:00
Mateusz Guzik
48b73a01e5 libipsec: ansify
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2023-04-03 04:11:45 -04:00
Mateusz Guzik
96d0c125c7 libmd: ansify
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2023-04-03 04:11:45 -04:00
Mateusz Guzik
04f3fa423d libc/yp: sort out warnings
.. in least-effort manner

Sponsored by:	Rubicon Communications, LLC ("Netgate")
2023-04-03 04:11:44 -04:00
Mateusz Guzik
fd683091e6 less: silence K&R warns
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2023-04-03 04:11:44 -04:00
Mateusz Guzik
6b00861e79 libz: silence K&R warns
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2023-04-03 04:11:44 -04:00
Mateusz Guzik
fc6da0cd2b sendmail: silence K&R warns
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2023-04-03 04:11:44 -04:00
Mark Johnston
0f38dd0d59 tun tests: Fix cleanup definitions
Without this, vnet jails for the tests don't get torn down.

Fixes:	fe701c39e8 ("if_tun: Add basic connectivity test with nc tun support")
2023-04-03 04:11:44 -04:00
Andrew Turner
bdcb524e27 Mark arm64 mair_el1 fields as unsigned long
The register is 64-bit so the upper bits could be shifted past the
signed 32-bit size of an int the values were before.

Sponsored by:	Arm Ltd
2023-04-03 04:11:44 -04:00
Andrew Turner
5f7cdf773b Switch the arm64 VM_MEMATTR_DEVICE to nGnRE
Move device memory to a weaker type. The new device memory type allows
the system to acknowledge a write to a device before the write has
completed. This is inline with VM_MEMATTR_DEVICE on armv6/armv7.

Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D38945
2023-04-03 04:11:44 -04:00
Andrew Turner
189fabfb63 Allow forcing non-posted memory on arm64
To allow for debugging after changing the arm64 VM_MEMATTR_DEVICE
memory type add a new set of tunables to tell the kernel to use
non-posted memory.

This adds the following tunables:
 - kern.force_nonposted: When set to non-zero the kernel will use
   non-posted memory for all device allocations.
 - hint.<dev>.<unit>.force_nonposted: As above, however only forces
   non-posted memory on the named device.

Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D38944
2023-04-03 04:11:43 -04:00
Andrew Turner
071f1c4a66 Remove an unneeded CTASSERT in the smmu driver
We don't map the DMAP here

Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D38951
2023-04-03 04:11:43 -04:00
Andrew Turner
473b378936 Remove unneeded arm64 smmu macros
These aren't used by the driver so can be removed.

Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D38950
2023-04-03 04:11:43 -04:00
Andrew Turner
9844b12c7c Only support a 4 level smmu page table
We only ever build a 4 level page table for the Arm SMMU. Remove the
support for a 3 level table.

Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D38949
2023-04-03 04:11:43 -04:00
Andrew Turner
ab0f1d9476 Rename smmu pmap functions
These are SMMU (and MALI GPU) specific. Give them a SMMU specific name.

Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D38948
2023-04-03 04:11:43 -04:00
Michael Tuexen
24ee0bec69 sctp: enforce Kahn's rule during the handshake
Don't take RTT measurements on packets containing INIT or COOKIE-ECHO
chunks, when they were retransmitted.

MFC after:	1 week
2023-04-03 04:11:43 -04:00
Randall Stewart
d6fbbe5d42 Move access to tcp's t_logstate into inline functions and provide new tracepoint and bbpoint capabilities.
The TCP stacks have long accessed t_logstate directly, but in order to do tracepoints and the new bbpoints
we need to move to using the new inline functions. This adds them and moves rack to now use
the tcp_tracepoints.

Reviewed by: tuexen, gallatin
Sponsored by: Netflix Inc
Differential Revision: https://reviews.freebsd.org/D38831
2023-04-03 04:11:43 -04:00
Dag-Erling Smørgrav
ca8017e870 tail: Verify correct behavior when input does not end in a newline.
Sponsored by:	Klara, Inc.
Reviewed by:	kevans
Differential Revision:	https://reviews.freebsd.org/D39116
2023-04-03 04:11:42 -04:00
Ed Maste
5ffb4e1adc Vendor import of OpenSSH 9.3p1 2023-04-03 04:11:39 -04:00
Andrew Turner
54145db383 Add PSCI affinity info return values
These can be returned from the PSCI AFFINITY_INFO call. This is not
marked as optional so bhyve will need to implement it & can use these
macros.

Sponsored by:	Arm Ltd
2023-04-03 04:10:21 -04:00
Andrew Turner
f19f203694 Add a psci macro to build a version value
Add PSCI_VER that takes a major and minor version and builds the value
returned by the firmware. This will be used by bhyve.

Sponsored by:	Arm Ltd
2023-04-03 04:10:21 -04:00
Andrew Turner
640f2a40ca Allow psci.h to be used by userspace
Wrap parts of psci.h that aren't usable by userspace in _KERNEL checks.
This allows it to be used to implement PSCI and SMCCC by bhyve in
userspace.

Sponsored by:	Arm Ltd
Sponsored by:	Innovate UK
Sponsored by:	The FreeBSD Foundation
2023-04-03 04:10:21 -04:00
Peter Holm
911f4a1daf stress2: New problem found was added 2023-04-03 04:10:20 -04:00
Dag-Erling Smørgrav
08e0a65b4b tarfs: Fix backtracking during node creation.
Sponsored by:	Juniper Networks, Inc.
Sponsored by:	Klara, Inc.
Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D39082
2023-04-03 04:10:20 -04:00
Dag-Erling Smørgrav
6a87b1fe19 tarfs: Support tar files which include file modes with permissions.
Sponsored by:	Juniper Networks, Inc.
Sponsored by:	Klara, Inc.
Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D39020
2023-04-03 04:10:20 -04:00
Dag-Erling Smørgrav
f4f2dfc1dc tarfs: Correctly track link count.
Sponsored by:	Juniper Networks, Inc.
Sponsored by:	Klara, Inc.
Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D39019
2023-04-03 04:10:20 -04:00
Dag-Erling Smørgrav
144e0f1f0c tarfs: Repeat tests using GNU tar if available.
Sponsored by:	Juniper Networks, Inc.
Sponsored by:	Klara, Inc.
Reviewed by:	ngie, asomers
Differential Revision:	https://reviews.freebsd.org/D39018
2023-04-03 04:10:20 -04:00
Zhenlei Huang
b1dc7b5359 carp: carp_master_down_locked() requires net epoch
Reviewed by:	kp
Fixes:		1d126e9b94 carp: Widen epoch coverage
MFC after:	1 day
Differential Revision:	https://reviews.freebsd.org/D39113
2023-04-03 04:10:20 -04:00
Kristof Provost
0190466b01 pf tests: test IPv6 fragmentation with link-local addresses
We've observed a panic after pf_refragment6() with link-local addresses,
because pf_refragment6() calls ip6_forward() even for a simple output
case.
That results in us entering ip6_forward() with an mbuf with a NULL
m->m_pkthdr.rcvif, which can cause a NULL deref (but seemingly not for
GUAs.

Test sending fragmented link-local packets to pf.

MFC after:	3 days
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D39063
2023-04-03 04:10:20 -04:00
Kristof Provost
9701cc226a pf: set scope in pf_refragment6()
Link-local traffic needs to have a scope embedded before it's passed on
to ip6_output(). Do so in pf_refragment6(), because when we end up here
in the output path we may have passed through ip6_output() already
(before being reassembled), where the scope would have been removed.

Re-embed the scope so that link-local traffic is sent correctly.

Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D39062
2023-04-03 04:10:19 -04:00
Kristof Provost
6922abdb87 pf: distinguish forwarding and output cases for pf_refragment6()
Re-introduce PFIL_FWD, because pf's pf_refragment6() needs to know if
we're ip6_forward()-ing or ip6_output()-ing.

ip6_forward() relies on m->m_pkthdr.rcvif, at least for link-local
traffic (for in6_get_unicast_scopeid()). rcvif is not set for locally
generated traffic (e.g. from icmp6_reflect()), so we need to call the
correct output function.

Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revisi:	https://reviews.freebsd.org/D39061
2023-04-03 04:10:19 -04:00
Michael Tuexen
7ab214b4dd sctp: don't do RTT measurements with cookies
When receiving a cookie, the receiver does not know whether the
peer retransmitted the COOKIE-ECHO chunk or not. Therefore, don't
do an RTT measurement. It might be much too long.
To overcome this limitation, one could do at least two things:
1. Bundle the INIT-ACK chunk with a HEARTBEAT chunk for doing the
   RTT measurement. But this is not allowed.
2. Add a flag to the COOKIE-ECHO chunk, which indicates that it
   is the initial transmission, and not a retransmission. But
   this requires an RFC.

MFC after:	1 week
2023-04-03 04:10:19 -04:00
Michael Tuexen
1d3fe4d43e sctp: allow disabling of SCTP_ACCEPT_ZERO_CHECKSUM socket option 2023-04-03 04:10:19 -04:00
Michael Tuexen
88b7680550 sctp: improve negotiation of zero checksum feature
Enforce consistency between announcing 0-cksum support and actually
using it in the association. The value from the inp when the
INIT ACK is sent must be used, not the one from the inp when the
cookie is received.
2023-04-03 04:10:19 -04:00
Alexander V. Chernikov
9b12438db8 netlink: improve snl(3)
Summary:
* add snl_send_message() as a convenient send wrapper
* add signed integer parsers
* add snl_read_reply_code() to simplify operation result checks
* add snl_read_reply_multi() to simplify reading multipart messages
* add snl_create_genl_msg_request()
* add snl_get_genl_family() to simplify family name->id resolution
* add tests for some of the functionality

Reviewed by:	kp
Differential Revision: https://reviews.freebsd.org/D39092
MFC after:	2 weeks
2023-04-03 04:10:19 -04:00
Andrew Turner
901e4a3683 arm64: Support stage 2 mappings in pmap_remove_all
This has been hit when testing bhyve.

Sponsored by:	Arm Ltd
2023-04-03 04:10:19 -04:00
Ed Maste
a949d4241a ssh: update FREEBSD-upgrade instructions
Make it clear that the 'freebsd-configure.sh' and 'freebsd-namespace.sh'
scripts are run from the crypto/openssh directory.

Sponsored by:	The FreeBSD Foundation
2023-04-03 04:10:19 -04:00
Andrew Turner
74c9cd5fdc Stop using the rid as an index in the arm timer
The order of the interrupt array doesn't matter. Store the described
interrupts at the start of the array to simplify iterating over them.

Reviewed by:	imp, kevans
Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D39094
2023-04-03 04:10:18 -04:00
Andrew Turner
8baf54e46a Use the arm physical timer when able
To allow bhyve manage the virtual timer while in a guest have FreeBSD
use the virtual timer only when bhyve will be unavailable due to not
starting at EL2 where the hypervisor switcher will run.

Reviewed by:	imp, kevans
Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D39093
2023-04-03 04:10:18 -04:00
Andrew Turner
94f623e35a Support the arm64 pmap_remove_write for stage 2
The fields we need to adjust are different in stage 1 and stage 2
tables. Handle this by adding variables to hold the bits to check,
set, and clear.

Reviewed by:	alc
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D37399
2023-04-03 04:10:18 -04:00
Mitchell Horne
c70b72f47c arm64: limit EFI excluded regions to physical memory types
Consolidate add_efi_map_entry() and exclude_efi_map_entry() into a
single function, handle_efi_map_entry(), so that the exact set of entry
types handled is the same in the addition or exclusion cases. Before,
exclude_efi_map_entry() had a 'default' case that would exclude all
entry types that were not listed explicitly in the switch statement.

Logically, we do not need to exclude a range that could not possibly be
added to physmem, and we do not need to exclude bus ranges that are not
physical memory, for example EFI_MD_TYPE_IOMEM.

Since physmem's ram0 device will reserve bus memory resources for its
owned ranges, this was preventing attachment of the watchdog device on
the RPI4B. For some reason its region of memory-mapped I/O appeared in
the EFI memory map (with the aforementioned EFI_MD_TYPE_IOMEM type).
This change fixes the attachment issue, as we prevent the physmem API
from messing with this range of bus space.

PR:		270044
Reported by:	karels, Mark Millard
Reviewed by:	andrew, karels, imp
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D39003
2023-04-03 04:10:18 -04:00
Alexander V. Chernikov
3bd32b5c18 net: refactor if_clone.c #1
* Add ifc_find_cloner()
* Rename current ifc_find_cloner() to ifc_find_cloner_in_vnet()
* Add ifc_find_cloner_match()

This change simplifies the code a bit and reduces the diff to
 the netlink interface cloners merge (D39032).

Reviewed by:	glebius, kp
Differential Revision: https://reviews.freebsd.org/D39046
MFC after:	2 weeks
2023-04-03 04:10:18 -04:00
Andrew Turner
626cef498c Support arm64 stage2 TLB invalidation
To invalidate stage 2 mappings on arm64 we may need to call into the
hypervisor so add a function pointer that bhyve can use to implement
this.

Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D37254
2023-04-03 04:10:18 -04:00
Andrew Turner
c3bfd0030b Keep per-timer interrupt data together
Eliminate a redundant resource array allow possible use by bhyve later.

Reviewed by:	kevans
Sponsored by:	Arm Ltd
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D37424
2023-04-03 04:10:18 -04:00
Warner Losh
b7644cd5b7 veriexec: Improve comments
Make it clear we're checking to see if the target is a verified file and
prevent its replacement if so.

Sponsored by:		Netflix
Reviewed by:		rpokala
Differential Revision:	https://reviews.freebsd.org/D39079
2023-04-03 04:10:17 -04:00
John Grafton
2be77074a7 libbe: Avoid double printing cloning errors.
be_clone calls be_clone_cb and both call set_error on the return
error path.  set_error prints the error resulting in a double print.
be_clone_cb should just return the error code and allow be_clone
to print it.

PR: 265248
Reported by: Graham Perrin
Reviewed by: imp, kevans
Pull Request: https://github.com/freebsd/freebsd-src/pull/685
2023-04-03 04:10:17 -04:00
Mina Galić
e43f3a99a3 jail: convert several functions from int to bool
these functions exclusively return (0) and (1), so convert them to bool

We also convert some networking related jail functions from int to bool
some of which were returning an error that was never used.

Differential Revision: https://reviews.freebsd.org/D29659
Reviewed by: imp, jamie (earlier version)
Pull Request: https://github.com/freebsd/freebsd-src/pull/663
2023-04-03 04:10:17 -04:00
Mina Galić
7d36c22e9b rc: ignore .pkgsave files
The local parts of rc already skip .sample files; we add .pkgsave to the
list, and add logic for base.

Thanks to @RhodiumToad for getting this started.

Differential Revision: https://reviews.freebsd.org/D27962
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/662
2023-04-03 04:10:17 -04:00
Elyes Haouas
f33fadb778 ppp: Remove trailing semicolon
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/654
2023-04-03 04:10:17 -04:00
Elyes Haouas
be261a0d0e pmccontrol: Remove trailing semicolon
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/654
2023-04-03 04:10:17 -04:00
Elyes Haouas
2d3ce621f8 lpr: Remove trailing semicolon
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/654
2023-04-03 04:10:17 -04:00
Elyes Haouas
7c60788f89 bhyve: Remove trailing semicolon
Macros shouldn't use trailing semicolon.

Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/654
2023-04-03 04:10:17 -04:00
Ed Maste
7ab6b4b5b3 CI: Run pkgbase METALOG lint script
tools/pkgbase/metalog_reader.lua checks for errors in METALOG (for
pkgbase staging), such as hard links with differing modes, duplicate
entries, etc.  Run it as part of the Cirrus-CI job to prevent
regressions.

Reviewed by:	manu, imp
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D37521
2023-04-03 04:10:16 -04:00
Jessica Clarke
c25d2ef988 .github: Test DISK_IMAGE_TOOLS_BOOTSTRAP in CI
Building the tools is quick so we should provide coverage of this to
ensure it keeps working, especially on non-FreeBSD.

Reviewed by:	emaste, arichardson
Differential Revision:	https://reviews.freebsd.org/D39073
2023-04-03 04:10:16 -04:00
Jessica Clarke
82ab1a5ed7 Add new DISK_IMAGE_TOOLS_BOOTSTRAP option
This will build etdump, makefs and mkimg as bootstrap tools to allow
easily creating disk images. Note that etdump is bootstrapped due to its
use in the release scripts for building ISO images.

Reviewed by:	emaste, arichardson
Differential Revision:	https://reviews.freebsd.org/D39072
2023-04-03 04:10:16 -04:00
Jessica Clarke
4f1d353ea9 src.conf.5: Regen after ZFS-related options changes
Since 9503d2704c LOADER_ZFS gets turned off when ZFS is, and since
63715498ac ZFS is no longer disabled on powerpc and powerpcspe.

Reviewed by:	emaste
Fixes:	9503d2704c ("opts: Minor cleanup of ZFS options")
Fixes:	63715498ac ("powerpc: enable ZFS on 32 bit powerpc/powerpcspe")
Differential Revision:	https://reviews.freebsd.org/D39071
2023-04-03 04:10:16 -04:00
Warner Losh
b4c8fb5c52 secure_getenv: Put under __BSD_VISIBLE
Sponsored by:		Netflix
Reviewed by:		delphij
Differential Revision:	https://reviews.freebsd.org/D39076
2023-04-03 04:10:16 -04:00
Rick Macklem
9f068cbf39 jail.8: Update the allow.nfsd section
This patch updates the information for "allow.nfsd"
and adds configuration information.

This is a content change.

Reviewed by:	karels, markj, pauamma (manpages)
MFC after:	3 months
Differential Revision:	https://reviews.freebsd.org/D39033
2023-04-03 04:10:16 -04:00
Bjoern A. Zeeb
886f599965 net80211: make ieee80211_scan_dump_channels private
ieee80211_scan_dump_channels() is only used locally and only when
IEEE80211_DEBUG is compiled.  Stop exporting it, make it file local
and hide under the #ifdef to reduce the footprint for production
kernels a tiny bit.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
Differential Revision: https://reviews.freebsd.org/D38833
2023-04-03 04:10:16 -04:00
Bjoern A. Zeeb
aa01340631 net80211: define mask for ss_flags rather than using hardcoded 0xfff
scan state ss_flags in two places cut off the "internal" GOTPICK
options.  Replace the hardcoded 0xfff with a defined mask.
Note that "internal" flags is confusing as we also supplement the
the 16bit by another 16bit of "internal flags" passed around but
comaparing to GOTPICK never stored to my understanding.

No functional change.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
Reviewed by:	adrian
Differential Revision: https://reviews.freebsd.org/D38832
2023-04-03 04:10:16 -04:00
Vincenzo Maffione
b0c1a8adbf netmap: get rid of save_if_input for emulated adapters
The save_if_input function pointer was meant to save the previous
value of ifp->if_input before replacing it with the emulated
adapter hook.
However, the same pointer value is already stored in the if_input
field of the netmap_adapter struct, to be used for host TX ring processing.

Reuse the netmap_adapter if_input field to simplify the code
and save some space.

MFC after:	14 days
2023-04-03 04:10:15 -04:00
Justin Hibbits
fb9480671b infiniband: Convert BPF handling for IfAPI
Summary:
All callers of infiniband_bpf_mtap() call it through the wrapper macro,
which checks the if_bpf member explicitly.  Since this is getting
hidden, move this check into the internal function and remove the
wrapper macro.

Reviewed by:	hselasky
Sponsored by:	Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D39024
2023-04-03 04:10:15 -04:00
Ed Maste
07253b19e2 ssh: fix leak and apply style(9) to hostname canonicalization
Fixes:		bf2e2524a2 ("ssh: canonicize the host name before...")
Fixes:		3e74849a1e ("ssh: canonicize the host name before...")
Reviewed by:	rew
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D38441
2023-04-03 04:10:15 -04:00
Ed Maste
d4211ef5cd compiler-rt: remove eprintf
It was used by ancient GCC assert.h.  Prior to 2001 GCC used to provide
its own assert.h  The GCC assert.h required __eprintf to emit the error
message.  FreeBSD's own assert.h never used this.

Reviewed by:	ed (previously), imp
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D2597
2023-04-03 04:10:15 -04:00
Ed Maste
cf6bd34808 Reserve u2f group for FIDO/U2F key support (SSH, etc.)
We have FIDO/U2F support in the base system now, so reserve a group ID
for it (maching the security/u2f-devd port).

Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D34341
2023-04-03 04:10:15 -04:00
Jose Luis Duran
ade68c64b7 ping: Remove ifndef icmp_data guards
Early versions of <netinet/ip_icmp.h> [1] did not have icmp_data
defined, but FreeBSD has always had.  Remove these guards.

NetBSD [2] and OpenBSD [3] have already removed them.

[1]: https://www.tuhs.org/cgi-bin/utree.pl?file=4.2BSD/usr/src/sys/netinet/ip_icmp.h
[2]: 203dfd3486
[3]: d83449c83c

Reviewed by:	markj
MFC after:	1 week
2023-04-03 04:10:15 -04:00
Jose Luis Duran
4a8c743d4a ping: Fix the display of Flags/Fragment Offset
In the IP header, Flags + Fragment Offset is a 16-bit field.

Use ntohs() instead of ntohl(), otherwise the Flags/Fragment Offset
values may not display correctly.

Before (DF set)

    Vr HL TOS  Len   ID Flg  off TTL Pro  cks      Src      Dst
     4  5  00 0054 0001   0 0000  40  01 b6a4 192.0.2.1  192.0.2.2

After (DF set)

    Vr HL TOS  Len   ID Flg  off TTL Pro  cks      Src      Dst
     4  5  00 0054 0001   2 0000  40  01 b6a4 192.0.2.1  192.0.2.2

Reviewed by:	markj
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D38479
2023-04-03 04:10:15 -04:00
Jose Luis Duran
eb85841698 ping6: Use errx to avoid appending a specious error message
Reviewed by:	asomers, markj
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D38418
2023-04-03 04:10:14 -04:00
Mark Johnston
7853ad2d6c udp: Fix a memory leak in udp6_send()
Reviewed by:	glebius
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D38993
2023-04-03 04:10:14 -04:00
dl
5ae9cfa58f Increase protection provided by veriexec with new unlink/rename hooks.
Functions implemented :

- mac_veriexec_vnode_check_unlink: Unlink on a file has been
  requested and requires validation. This function prohibits the
  deleting a protected file (or deleting one of these hard links, if
  any).
- mac_veriexec_vnode_check_rename_from: Rename the file has been
  requested and must be validated. This function controls the renaming
  of protected file
- mac_veriexec_vnode_check_rename_to: File overwrite rename has been
  requested and must be validated. This function prevent overwriting of
  a file protected (overwriting by mv command).

The 3 fonctions together aim to control the 'removal' (via unlink) and
the 'mv' on files protected by veriexec. The intention is to reach the
functional level of NetBSD veriexec.

Add sysctl node security.mac.veriexec.unlink to toggle control on
syscall unlink.

Add tunable kernel variable security.mac.veriexec.block_unlink to toggle
unlink protection. Add the corresponding read-only sysctl.

[ tidied up commit message, trailing whitespace, long lines, { placement ]

Reviewed by: sjg, imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/613
2023-04-03 04:10:14 -04:00
Allan Jude
0519f10473 loader: Add support for booting from a ZFS snapshot
When booting from a snapshot we need to follow a different code path
to turn the objset ID into the name, and for forward lookups we need
to walk the parent's snapnames_zap.

With this, it is possible to set the pools BOOTFS property to a
snapshot and boot with a read-only filesystem of that snapshot.

Reviewed by:	tsoome, rew, imp
Sponsored By:	Beckhoff Automation GmbH & Co. KG
Sponsored By:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D38600
2023-04-03 04:10:14 -04:00
Gordon Bergling
2f2b1dd40b route.8: Don't reference an external command in EXAMPLES
It is better to mention the externel command for showing
the routing table as using an explicit command.

PR:	231579
Suggested by:	karels
Reviewed by:	karles, gbe
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D39075
2023-04-03 04:10:14 -04:00
Ed Maste
47f26fe0fd CI: update QEMU command line to avoid deprecated option format
> warning: short-form boolean option 'readonly' deprecated
> Please use readonly=on instead

Sponsored by:	The FreeBSD Foundation
2023-04-03 04:10:14 -04:00
Andrew Turner
7807fcf819 Always enable the virtual timer for userspace
We always have it, some languages assume it's present, e.g. go
before 1.20. Enable it by default on arm and arm64.

PR:		269070
Reviewed by:	kevans
Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D39059
2023-04-03 04:10:14 -04:00
Andrew Turner
2bc5ae4e29 Fix the ofw parent check in arm64 nexus
OF_parent returns 0 for no parent. Fix the check in teh arm64
nexus_fdt_activate_resource.

Sponsored by:	Arm Ltd
2023-04-03 04:10:14 -04:00
Roger Pau Monné
e37b62b075 xen: take struct size into account for video information
The xenpf_dom0_console_t structure can grow as more data is added, and
hence we need to check that the fields we accesses have been filled by
Xen.  The only extra field FreeBSD currently uses is the top 32 bits
for the frame buffer physical address.

Note that this field is present in all the versions that make the
information available from the platform hypercall interface, so the
check here is mostly cosmetic, and to remember us that newly added
fields require checking the size of the returned data.

Fixes: 6f80738b22 ('xen: fetch dom0 video console information from Xen')
Sponsored by: Citrix Systems R&D
2023-04-03 04:10:13 -04:00
lucy
71dd4939f7 Add GNU glibc compatible secure_getenv
Add mostly glibc and msl compatible secure_getenv. Return NULL if
issetugid() indicates the process is tainted, otherwise getenv(x).  The
rational behind this is the fact that many Linux applications use this
function instead of getenv() as it's widely consider a, "best
practice".

Reviewed by: imp, mjg (feedback)
Pull Request: https://github.com/freebsd/freebsd-src/pull/686
Signed-off-by: Lucy Marsh <seafork@disroot.org>
2023-04-03 04:10:13 -04:00
Jessica Clarke
6ad79d5161 arm64: Delete redundant badly formatted and capitalised comment
Fixes:	9729f076e4 ("arm64: Hyper-V: enablement for ARM64 in Hyper-V (Part 3, final)")
2023-04-03 04:10:13 -04:00
Jessica Clarke
32c6bcee5c arm64: Move Azure-specific config from std.hyperv to std.azure
Hyper-V does not provide Mellanox hardware, some of Azure's instances
do, thus the configuration to enable them does not belong in the generic
std.hyperv config.

Fixes:	15e7fa83ef ("arm64: Hyper-V: Add vPCI and Mellanox driver modules into build")
2023-04-03 04:10:13 -04:00
Warner Losh
d2f207ca30 Parse /kboot.conf
If there's a kboot.conf, prase it after the command line args are
parsed. It's not always easy to get all the right command line args
depending on the environment. Allow an escape hatch. While we can't do
everything one might like in this file, we can do enough.

Sponsored by:		Netflix
2023-04-03 04:10:13 -04:00
Ed Maste
dcd577ab72 makefs: do not call brelse if bread returns an error
If bread returns an error there is no bp to brelse.  One of these
changes was taken from NetBSD commit 0a62dad69f62 ("This works well
enough to populate..."), the rest were found by looking for the same
pattern.

Reviewed by:	imp
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D39069
2023-04-03 04:10:13 -04:00
Kyle Evans
52adb8ea36 arm: generic_timer: use interrupt-names when available
Offsets for all of thse can be a bit complicated as not all interrupts
will be present, only phys and virt are actually required, and sec-phys
could optionally be specified before phys.  Push idx/name pairs into
a new config struct and maintain the old indices while still getting the
correct timers.

Split fdt/acpi attach out independently and allocate interrupts before
we head into the common attach().  The secure physical timer is also
optional there, so mark it so to avoid erroring out if we run into
problems.

Reviewed by:	andrew
Differential Revision:	https://reviews.freebsd.org/D38911
2023-04-03 04:10:13 -04:00
Warner Losh
bb21cbedfb makefs: make msdos creation go fast
Add missing brelse(bp). Without it the cache grows and we have a n^2
lookup.  I'm not entirely sure why we read the block before we write it
back out, since the only side effect of that is to allocate memory,
clear the memory, read it in from disk, throw it away with the contents
of the file being written out. We likely should just do a getblk() here
instead, but even with all that, this takes the time it takes to create
a 150MB msdos fs image down from 5 minutes to 30 seconds.

Old: 317.663u 0.685s 5:18.34 100.0%	198+360k 0+19io 1009pf+0w
New: 7.330u 23.841s 0:31.17 100.0%	198+360k 0+250522io 4pf+0w

See code review for how we got this. tl;dr: netbsd move brelse
into bwrite and we picked up msdos code after that, but not the
move. That change should be picked up later.

Sponsored by:		Netflix
Reviewed by:		emaste
MFC After:		1 day (13.2 is coming fast)
Differential Revision:	https://reviews.freebsd.org/D39025
2023-04-03 04:10:13 -04:00
Pawel Biernacki
c690969f78 net.inet6.ip6.log_interval: use ppsratecheck(9) internally
Reported by:	mjg
Differential Revision:	https://reviews.freebsd.org/D38758
2023-04-03 04:10:12 -04:00
Pawel Biernacki
5431a6ea85 netinet6: allow disabling excess log messages
RFC 4443 specifies cases where certain packets, like those originating from
local-scope addresses destined outside of the scope shouldn't be forwarded.
The current practice is to drop them, send ICMPv6 message where appropriate,
and log the message:

cannot forward src fe80:10::426:82ff:fe36:1d8, dst 2001:db8:db8::10, nxt
58, rcvif vlan5, outif vlan2

At times the volume of such messages cat get very high. Let's allow local
admins to disable such messages on per vnet basis, keeping the current
default (log).

Reported by:	zarychtam@plan-b.pwste.edu.pl
Reviewed by:	zlei (previous version), pauamma (docs)
Differential Revision:	https://reviews.freebsd.org/D38644
2023-04-03 04:10:12 -04:00
Dag-Erling Smørgrav
49c853c6f8 tftp: Add test cases for URL mode.
Sponsored by:	Klara, Inc.
Reviewed by:	asomers
Differential Revision:	https://reviews.freebsd.org/D39014
2023-04-03 04:10:12 -04:00
Justin Hibbits
ea44ce24a0 dtrace/powerpc: Remove accidental commented out line
Fixes:	3e1155ade1
2023-04-03 04:10:12 -04:00
Mark Johnston
479b35353e netinet: Disallow unspecified addresses in ICMP-embedded packets
Reported by:	glebius
Reported by:	syzbot+981c528ccb5c5534dffc@syzkaller.appspotmail.com
Reviewed by:	tuexen, glebius
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D38936
2023-04-03 04:10:12 -04:00
Mark Johnston
3b641914d3 epair: Remove unneeded includes and sort some of the rest
No functional change intended.

MFC after:	1 week
2023-04-03 04:10:12 -04:00
Mark Johnston
75c53ae7e1 smr: Remove the return value from smr_wait()
This is supposed to be a blocking version of smr_poll(), so there's no
need for a return value.  No functional change intended.

MFC after:	1 week
2023-04-03 04:10:12 -04:00
Mark Johnston
12b951082e sendfile tests: Mount filesystems under the test workdir
Otherwise they can't be run in parallel as they share a mount point.

MFC after:	1 week
2023-04-03 04:10:11 -04:00
Dimitry Andric
590c747d85 zfs: Use .section .rodata instead of .rodata on FreeBSD
In commit 0a5b942d4 the FreeBSD SECTION_STATIC macro was set to
".rodata". This assembler directive is supported by LLVM (as a
convenience alias for ".section .rodata") by not by GNU as.

This caused the FreeBSD builds that are done with gcc to fail.
Therefore, use ".section .rodata" instead, similar to the other
asm_linkage.h headers.

[mjg: cherry-picked from upstream zfs bf1bec394e715de9f7ac4a54b5b1b884d7e41a32
 to unbreak gcc12 build]

Reviewed-by: Mateusz Guzik <mjguzik@gmail.com>
Reviewed-by: Attila Fülöp <attila@fueloep.org>
Reviewed-by: Jorgen Lundman <lundman@lundman.net>
Signed-off-by: Dimitry Andric <dimitry@andric.com>
Closes #14526
2023-04-03 04:10:11 -04:00
Mateusz Guzik
0c5b0f60df vm: consistently prefix fault helpers with vm_fault_
Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D39029
2023-04-03 04:10:11 -04:00
Alexander V. Chernikov
882954e521 tests: fix python parsing of netlink nested attributes
MFC after:	2 weeks
2023-04-03 04:10:11 -04:00
Wei Hu
5253e0e4d1 arm64: Hyper-V: Add vPCI and Mellanox driver modules into build
These changes in conf and std.hyperv files got missed in previous commit.
Reviewed by:	whu
Tested by:	whu
Obtained from:	Souradeep Chakrabarti <schakrabarti@microsoft.com>
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D38529
2023-04-03 04:10:11 -04:00
David E. O'Brien
52d7506d20 Document gethostbyname_r's public exposure in 6.2. 2023-04-03 04:10:11 -04:00
David E. O'Brien
93717f776b Look in getlocalbase() for the calendar-data package data
Fix d20d655018 where getlocalbase()
wasn't used to fill out the printf(3) format of _PATH_INCLUDE_LOCAL.

Differential Revision:	https://reviews.freebsd.org/D38975
Reviewed by:	imp
2023-04-03 04:10:11 -04:00
Rick Macklem
2596f678be RELNOTES: Add an entry for NFS server support in vnet prisons 2023-04-03 04:10:11 -04:00
Konstantin Belousov
fbe890972c lib/csu: do not compile the body of handle_static_init() for PIC build at all
The referenced symbols that provide init array boundaries are weak,
hidden, and undefined.  The code that iterates over that arrays is not
used for the case when libc is compiled as dso.

This should fix linking with ld.bfd.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 weeks
2023-04-03 04:10:10 -04:00
Konstantin Belousov
3f9c89b803 libc/csu: add powerpcspe
Reported and tested by:	alfredo
Sponsored by:	The FreeBSD Foundation
MFC after:	3 weeks
2023-04-03 04:10:10 -04:00
Rick Macklem
530e0b3928 rc.d: Fix NFS server startup scripts to enable vnet prison use
Now that commit cbbb22031f is in main,
it is possible to run nfsd(8), nfsuserd(8), mountd(8),
gssd(8) and rpc.tlsservd(8) in an appropriately configured vnet
prison if the "allow.nfsd" option is specified in jail.conf.

This patch fixes the rc scripts for this.
Mostly just replaces the "nojail" KEYWORD with "nojailvnet",
but also avoids setting vfs.nfsd.srvmaxio in a prison, since it
must be set outside of the prisons and applies to all
nfsd(8) instances.

Reviewed by:	jamie
MFC after:	3 months
Differential Revision:	https://reviews.freebsd.org/D38809
2023-04-03 04:10:10 -04:00
Mateusz Guzik
aafa553303 vfs: whack leftover cn_origflags
Unused since 5b5b7e2ca2 ("vfs: always retain path buffer after lookup")

Reported by:	dchagin
2023-04-03 04:10:10 -04:00
Ihor Antonov
24a9cd2aaa daemon: move variables into struct daemon_state
The fact that most of the daemon's state is stored on the stack
of the main() makes it hard to split the logic smaller chunks.
Which in turn leads to huge main func that does a a lot of things.
struct log_params existed because some variables need to be passed
into other functions together.

This change renames struct log_params into daemon_state
and moves the rest of the variables into it. This is a necessary
preparation step for further refactroing.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/687
2023-04-03 04:10:10 -04:00
Justin Hibbits
75b34363a7 powerpc/pmap: Add pmap_sync_icache() for radix pmap
DTrace pid provider writes to user space to set breakpoints.  Failing to
sync the icache can lead to SIGTRAP.  Radix pmap is the only one missing
a pmap_sync_icache() method, so the pid provider would only potentially
crash a process on a POWER9 or later system.
2023-04-03 04:10:10 -04:00
Alfredo Dal'Ava Junior
31dd15bac1 powerpc: enable ZFS on 32 bit powerpc/powerpcspe
Enable ZFS on powerpc 32 bit since it appears to build and work
correctly.

MFC after:	3 weeks
Relnotes:	yes
2023-04-03 04:10:10 -04:00
Konstantin Belousov
8f2fdce2ec libc/csu: rename ignore_init.c to libc_start1.c
The current name was a historical curiosity that started when init array
support was added, and then the file appeared a convenient place for the
addition of the MI common code to csu.  It is now referenced by name in
single place and the rename is easy, so do it.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 weeks
2023-04-03 04:10:09 -04:00
Konstantin Belousov
c3b900271e libc: move declaration of 'char **environ' to common private header
Suggested by:	imp
Reviewed by:	markj
Tested by:	markj (aarch64)
Sponsored by:	The FreeBSD Foundation
MFC after:	3 weeks
Differential revision:	https://reviews.freebsd.org/D37220
2023-04-03 04:10:09 -04:00
Konstantin Belousov
de1d4c47cc x86: microoptimize static PIE startup
Do not call CPUID on each ireloc, instead call it once and cache
results, similar to how it is done on powerpc64.

Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	3 weeks
Differential revision:	https://reviews.freebsd.org/D37220
2023-04-03 04:10:09 -04:00
Konstantin Belousov
b3d294baf4 csu: move common code to libc
Why? Most trivial point, it shaves around 600 bytes from the dynamic
binaries on amd64. Less trivial, the removed code is no longer part of
the ABI, and we can ship updates to it with libc updates. Right now most
of the csu is linked into the binaries and require us to do somewhat
tricky ABI compat when it needs to change. For instance, the init_array
change would be much simpler and does not require note tagging if we
have init calling code in libc.

This could be improved more, by splitting dynamic and static
initialization. For instance, &_DYNAMIC tests can be removed then.
Such change, nonetheless, would require building libc three times.
I left this for later, after this change stabilizes, if ever.

Reviewed by:	markj
Discussed with:	jrtc27 (some objections, see the review), imp
Tested by:	markj (aarch64)
Sponsored by:	The FreeBSD Foundation
MFC after:	3 weeks
Differential revision:	https://reviews.freebsd.org/D37220
2023-04-03 04:10:09 -04:00
Mateusz Guzik
9ac591afd4 vm: avoid lock upgrade if possible in vm_fault_next
In my tests during buildkernel fs->m was always NULL at that stage.

Note the change has no impact on vm obj contention during said workload.

Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D39027
2023-04-03 04:10:09 -04:00
Maxim Konovalov
f17825d148 rc.conf.5: a stray whitespace removed
PR:	270124
2023-04-03 04:10:09 -04:00
Vincenzo Maffione
d529060be9 netmap: get rid of WNA() macro
MFC after:	7 days
2023-04-03 04:10:09 -04:00
Justin Hibbits
73a844cd12 dtrace/powerpc: "Fix" stack traces across trap frames
In function boundary tracing the link register is not yet saved to the
save stack location, so the save point contains whatever the previous
'lr' save was, or even garbage, at the time the trap is taken.  Address
this by explicitly loading the link register from the trap frame instead
of the stack, and propagate that out.
2023-04-03 04:10:09 -04:00
Justin Hibbits
a6e53d1594 dtrace/powerpc: Adjust AFRAMES for fbt and profile
FBT_AFRAMES was skipping over too many frames, while PROFILE_AFRAMES was
skipping over too few.  Adjust them empirically.
2023-04-03 04:10:08 -04:00
Justin Hibbits
21c9ab0666 phyp_llan: Mechanically convert to IfAPI
Sponsored by:	Juniper Networks, Inc.
2023-04-03 04:10:08 -04:00
Justin Hibbits
f8326c1433 dtsec: Complete mechanical conversion to IfAPI
Some changes were missed in 0083fc5c76.

Sponsored by:	Juniper Networks, Inc.
2023-04-03 04:10:08 -04:00
Ceri Davies
6744fd7073 rc.conf.5: fix typo of route6d that I introduced while nitpicking 2023-04-03 04:10:08 -04:00
Ceri Davies
6ef283c06e rc.conf.5: dhclient came from OpenBSD, but now isn't the OpenBSD client 2023-04-03 04:10:08 -04:00
Mateusz Guzik
9438b931b0 vm: read-locked fault handling for backing objects
This is almost the simplest patch which manages to avoid write locking
for backing objects, as a result mostly fixing vm object contention
problems.

What is not fixed:
1. cacheline ping pong due to read-locks
2. cacheline ping pong due to pip
3. cacheling ping pong due to object busying
4. write locking on first object

On top of it the use of VM_OBJECT_UNLOCK instead of explicitly tracking
the state is slower multithreaded that it needs to be, done for
simplicity for the time being.

Sample lock profiling results doing -j 104 buildkernel on tmpfs:
before:
71446200 (rw:vmobject)
14689706 (sx:vm map (user))
4166251 (rw:pmap pv list)
2799924 (spin mutex:turnstile chain)

after:
19940411 (rw:vmobject)
8166012 (rw:pmap pv list)
6017608 (sx:vm map (user))
1151416 (sleep mutex:pipe mutex)

Reviewed by:	kib
Reviewed by:	markj
Tested by:	pho
Differential Revision:	https://reviews.freebsd.org/D38964
2023-04-03 04:10:08 -04:00
Mateusz Guzik
9d877f2dc7 vm: add VM_OBJECT_UNLOCK
Reviewed by:	kib
Reviewed by:	markj
Tested by:	pho
Differential Revision:	https://reviews.freebsd.org/D38964
2023-04-03 04:10:08 -04:00
Mateusz Guzik
358a0ddfde vm: move up object lock asserts in fault functions
No functional changes.

Reviewed by:	kib
Reviewed by:	markj
Tested by:	pho
Differential Revision:	https://reviews.freebsd.org/D38964
2023-04-03 04:10:07 -04:00
Mark Johnston
26beba1012 qat: Reconnect qat.4 to the build
It was disconnected when the new QAT driver was imported, and never
reconnected.
2023-04-03 04:10:07 -04:00
Mark Johnston
74269eb182 netbsd-tests: Serialize message queue tests
They can fail when run in parallel since they all share a global queue
key.

MFC after:	1 week
2023-04-03 04:10:07 -04:00
Mark Johnston
647f9cb162 netbsd-tests: Remove some pointless sleeps from message queue tests
- In the msgctl tests, there is no point in sleeping after a fork().
  Just block immediately in wait().
- In non-blocking send/recv tests, just wait for the child to exit once
  it's reached a message limit.  If a bug prevents the child from
  exiting promptly, the test will time out.

MFC after:	1 week
2023-04-03 04:10:07 -04:00
Warner Losh
d570b6e8e8 opts: fix silly typo
It's powerpcspe not powerpcspc

Pointy Hat To:		imp
Noticed by:		jhibbits
Fixes:			41cf798e82
Sponsored by:		Netflix
2023-04-03 04:10:07 -04:00
Warner Losh
1a154082e9 opts: popwerpcspc is also 32-bit
Mark ZFS broken here too, add comment about why.  Add comments about
OFED being disabled on 32-bit arm, add comment about why too.

Sponsored by:		Netflix
2023-04-03 04:10:07 -04:00
Warner Losh
b7673fa24d opts: Minor cleanup of ZFS options
Remove redundant CPUARCH test: we really just want a plain MACHINE_ARCH
here.

Second, always turn off LOADER_ZFS when we turn off ZFS. Not 100%
required, but we did it some places and not others. There's no current
mechanism to say that if X is disabled then X_Y must be too.

Sponsored by:		Netflix
2023-04-03 04:10:07 -04:00
Dag-Erling Smørgrav
2727260690 tftpd: Gracefully skip tests if networking is not enabled.
Sponsored by:	Klara, Inc.
Reviewed by:	asomers
Differential Revision:	https://reviews.freebsd.org/D39012
2023-04-03 04:10:07 -04:00
Dag-Erling Smørgrav
ea87d8492c tftp: Add tests.
Sponsored by:	Klara, Inc.
Reviewed by:	asomers
Differential Revision:	https://reviews.freebsd.org/D38969
2023-04-03 04:10:06 -04:00
Dag-Erling Smørgrav
de78e3c42f tftpd: Don't forget to close stderr on startup.
Just like stdin and stdout, stderr is a copy of the listen socket inherited from inetd.  We need to close it so inetd can process further requests, be restarted, etc.

Sponsored by:	Klara, Inc.
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D38968
2023-04-03 04:10:06 -04:00
Dag-Erling Smørgrav
c0458ac12e tftpd: Don't consume arbitrary requests when failing to fork.
We've already consumed one request, which is sufficient to prevent inetd from endlessly restarting us in this particular and extremely unlikely case.

Sponsored by:	Klara, Inc.
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D38967
2023-04-03 04:10:06 -04:00
Dag-Erling Smørgrav
d9da33bcee tftpd: Use poll() instead of alarm() + setjmp().
While there, don't log an error when timing out waiting for a possible retransmit after a successful transfer.

Sponsored by:	Klara, Inc.
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D38966
2023-04-03 04:10:06 -04:00
Dag-Erling Smørgrav
88097bd35e tftpd: Make the -d option behave as documented.
Sponsored by:	Klara, Inc.
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D38965
2023-04-03 04:10:06 -04:00
Dag-Erling Smørgrav
c0c855301c tftp: Correctly propagate transfer errors.
Sponsored by:	Klara, Inc.
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D38958
2023-04-03 04:10:06 -04:00
Dag-Erling Smørgrav
25288f1ace tftpd: Make the transfer functions return success / failure.
Sponsored by:	Klara, Inc.
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D38957
2023-04-03 04:10:06 -04:00
Dag-Erling Smørgrav
b8b991a9a9 tftpd: Ensure that tftp_log() preserves errno.
Sponsored by:	Klara, Inc.
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D38956
2023-04-03 04:10:05 -04:00
Dag-Erling Smørgrav
21836ffac5 tftpd: Fix max block size calculation.
Sponsored by:	Klara, Inc.
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D38953
2023-04-03 04:10:05 -04:00
Stefan Eßer
dd9c351766 contrib/bc: update to version 6.4.0
This version contains a fix for an issue that can affect complex
bc scripts that use multiple read() functions that receive input from
an interactive user. The same value could be returned multiple times.

MFC after:	2 weeks
2023-04-03 04:10:05 -04:00
Kyle Evans
c18d857895 kern: physmem: don't create a new exregion for different flags...
... if the region we're adding is an exact match to one that we already
have.  Simply extend the flags of the existing entry as needed so that
we don't end up with duplicate regions.

It could be that we got the exclusion through two different means, e.g.,
FDT memreserve and the EFI memory map, and we may derive different
characteristics from each.  Apply the most restrictive set to the
region.

Reported by:	Mark Millard <marklmi yahoo com>
Reviewed by:	mhorne
2023-04-03 04:10:05 -04:00
Xin LI
f143c500c6 cap_*(2): Document ENOSYS behavior.
Summary:
All cap_* system calls would fail when capability mode support is
not present.

MFC after:	2 weeks
Reviewed by:	emaste, pauamma
Differential Revision: https://reviews.freebsd.org/D38976
2023-04-03 04:10:05 -04:00
Cy Schubert
90d8bffbdc heimdal: Fix CVE-2022-4152, signature validation error
When CVE-2022-3437 was fixed by changing memcmp to be a constant
time and the workaround for th e compiler was to add "!=0". However
the logic implmented was inverted resulting in CVE-2022-4152.

Reported by:	Timothy E Zingelman <zingelman _AT_ fnal.gov>
MFC after:	1 day
Security:	CVE-2022-4152
Security:	https://www.cve.org/CVERecord?id=CVE-2022-45142
Security:	https://nvd.nist.gov/vuln/detail/CVE-2022-45142
Security:	https://security-tracker.debian.org/tracker/CVE-2022-45142
Security:	https://bugs.gentoo.org/show_bug.cgi?id=CVE-2022-45142
Security:	https://bugzilla.samba.org/show_bug.cgi?id=15296
Security:	https://www.openwall.com/lists/oss-security/2023/02/08/1
2023-04-03 04:10:05 -04:00
Michael Tuexen
2e5cb4eb1b sctp: initial implementation of draft-tuexen-tsvwg-sctp-zero-checksum 2023-04-03 04:10:05 -04:00
Mark Johnston
71cc6e4424 netmap: Remove obsolete compatibility defines
No functional change intended.

Reviewed by:	vmaffione
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D39001
2023-04-03 04:10:04 -04:00
Brooks Davis
c962419048 Add WITH_LOADER_VERIEXEC_VECTX description
PR:		270017
Reviewed by:	emaste
Sponsored by:	DARPA
Differential Revision:	https://reviews.freebsd.org/D39002
2023-04-03 04:10:04 -04:00
Michael Butler
2065adcab3 include: Remove no longer existing netgraph/atm
Reviewed by:	emaste
Differential Revision:	https://reviews.freebsd.org/D39005
2023-04-03 04:10:04 -04:00
Ceri Davies
020f2aeef0 man5/rc.conf.5: finally retire references to pccard_ifconfig variable
It was removed in June 2005.
2023-04-03 04:10:04 -04:00
Ceri Davies
c9ca4e7786 man5/rc.conf.5: minor nitpicks to formatting, grammar, spelling 2023-04-03 04:10:04 -04:00
Ceri Davies
0f351756b3 rc.conf: update comment referring to /etc/motd 2023-04-03 04:10:04 -04:00
Baptiste Daroussin
ab9e9cd0c7 pkg(7): now that we do use libmd, use it completly
Use SHA256_Fd and SHA256_Data instead of home made equivalent.
wrap those functions into hash.c to avoid header collition between
openssl and libmd

Suggested by:	kevans
2023-04-03 04:10:04 -04:00
Ceri Davies
b69f36300e man5/rc.conf.5: document hostid and machine-id related variables 2023-04-03 04:10:04 -04:00
Brooks Davis
b88ad87683 Remove WITH(OUT)_ATM option
With the removal of NgATM it no longer controls anything.

Reviewed by:	manu, emaste
Sponsored by:	DARPA
Differential Revision:	https://reviews.freebsd.org/D38882
2023-04-03 04:10:03 -04:00
Brooks Davis
d1b719f1af ng_atmllc: remove
This standalone module is the last vestage of ATM support in the tree so
send it on its way.

Reviewed by:	manu, emaste
Relnotes:	yes
Sponsored by:	DARPA
Differential Revision:	https://reviews.freebsd.org/D38880
2023-04-03 04:10:03 -04:00
Brooks Davis
638bb45a43 NgATM: Remove netgraph ATM support
Most ATM support was removed prior to FreeBSD 12.  The netgraph support
was kept as it was less intrusive, but it is presumed to be unused.

Reviewed by:	manu
Relnotes:	yes
Sponsored by:	DARPA
Differential Revision:	https://reviews.freebsd.org/D38879
2023-04-03 04:10:03 -04:00
Baptiste Daroussin
3fcf3c5fe4 pkg(7): use libmd for sha256 instead of openssl
OpenSSL 3.0 has deprecated the sha256 api, let's use libmd which has the
same API instead.

In order to avoid the collision in definitions (sha256.h cannot be
included in the same file as a file where openssl headers has been
included) let's move the sha256 related code in its own file

PR:		270023
Reported by:	ngie
2023-04-03 04:10:03 -04:00
Mark Johnston
2c82ed4a5a vm_fault: Update a comment to reflect the removal of the default pager
Fixes:	5d32157d4e ("vm_object: Modify vm_object_allocate_anon() to return OBJT_SWAP objects")
Reviewed by:	alc, kib
Differential Revision:	https://reviews.freebsd.org/D38985
2023-04-03 04:10:03 -04:00
Roger Pau Monné
7627e1b940 xen: fetch dom0 video console information from Xen
It's possible for Xen to switch the video mode set by the boot loader,
so that the information passed in the kernel metadata is no longer
valid.  Fetch the video mode used by Xen using an hypercall and update
the medatada for the kernel to use the correct video mode.

Sponsored by: Citrix Systems R&D
2023-04-03 04:10:03 -04:00
Roger Pau Monné
d4f2d84e13 xen: bump used interface version
This is required for a further change that will make use of a field
that was added in version 0x00040d00.

No functional change expected.

Sponsored by: Citrix Systems R&D
2023-04-03 04:10:03 -04:00
Alexander V. Chernikov
fc41fceb81 fix buildworld after 595d23f777.
Reported by:	se
2023-04-03 04:10:02 -04:00
Alexander Motin
0a655519e2 nvmecontrol: Fix default ns create parameters.
Instead of passing 0xff's for all unset parameters, prefer reasonable
defaults.  It is much easier to use it this was without specs in hand.

MFC after:	1 week
2023-04-03 04:10:02 -04:00
Alexander V. Chernikov
eac3113c0f netlink: add snl(3) default parsers for routes and links.
This change adds the "default" parsers of _all_ route/link attributes
 exported by the kernel.
It removes the need to declare similar parsers in the userland applications,
 simplifying their logic.

Differential Revision: https://reviews.freebsd.org/D38979
MFC after:	2 weeks
2023-04-03 04:10:02 -04:00
Alexander V. Chernikov
3863a6e2f8 netlink: add rtsock-compatible header to use with netlink snl(3).
Some routing socket defines (`RTM_` and `RTA_` ones) clash with the ones
 used by the the Netlink.
As some rtsock definitions like interface flags or route flags are used in
 both netlink and rtsock, provide a convenient way to include those without
 running into the define collision.

Differential Revision: https://reviews.freebsd.org/D38982
MFC after:	2 weeks
2023-04-03 04:10:02 -04:00
Alexander V. Chernikov
a2610d6836 netlink: add basic message writing support to snl(3).
Differential Revision:	https://reviews.freebsd.org/D38947
MFC after:	2 weeks
2023-04-03 04:10:02 -04:00
Tijl Coosemans
45438ac2b9 rc.d: Generate machine-id from hostid_save
rc.d/hostid_save saves a UUID generated by rc.d/hostid in /etc/hostid.
Store the same UUID, without hyphens, in /etc/machine-id.  The hypĥens
are removed with a shell function because hostid_save runs before file
systems are mounted so other tools may not be available yet.

This eliminates some duplication between hostid and machine-id and for
virtual machines machine-id now contains the UUID configured in the
hypervisor like it does on Linux.

Reviewed by:	delphij
Discussed with:	bapt
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D38811
2023-04-03 04:10:02 -04:00
Tijl Coosemans
e14d7e5431 hostid: Generate random UUID by default
This way MAC addresses are no longer exposed.

Discussed with:	bapt
MFC after:	3 days
2023-04-03 04:10:02 -04:00
Kyle Evans
fa69f8441b grep: remove tautological condition
st_size is an off_t, it cannot hold values larger than OFF_MAX.

CID:		1008931
2023-04-03 04:10:02 -04:00
Kyle Evans
a66c3a8599 Revert "grep: remove tautological condition"
This reverts commit f6d6c66889.

Gremlins snuck into my tree and injected some WIP.
2023-04-03 04:10:01 -04:00
Kyle Evans
b1141c89fb grep: remove tautological condition
st_size is an off_t, it cannot hold values larger than OFF_MAX.

CID:		1008931
2023-04-03 04:10:01 -04:00
Ed Maste
a7cd8f4577 src.conf.5: Use common phrasing in WITHOUT_OFED text
Reported by:	jhb
Sponsored by:	The FreeBSD Foundation
2023-04-03 04:10:01 -04:00
Ed Maste
179fd0c3f9 src.conf.5: Add some WITH_/WITHOUT_ option descriptions
Reviewed by:	markj, brooks
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D38961
2023-04-03 04:10:01 -04:00
Ed Maste
0366749506 nvram2env: Retire unused MIPS-specific driver
This code was used only on MIPS platforms, and has not built in some
time.

Reviewed by: ray
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D38986
2023-04-03 04:10:01 -04:00
John Baldwin
fe68f18a06 sys/modules/Makefile: Add a section for arm64 + x86 + powerpc64.
This reduces some duplication between the existing arm64 + x86 section
and the powerpc64 section.  To make the diff simpler, enable mlx4 on
powerpc64 since it compiles.

Reviewed by:	pkubaj, imp, emaste
Differential Revision:	https://reviews.freebsd.org/D38973
2023-04-03 04:10:01 -04:00
John Baldwin
2fe00d0a61 Enable OFED on all platforms except for 32-bit arm.
32-bit arm triggers multiple -Wunaligned-access errors due to
structure packing.

Reviewed by:	emaste
Differential Revision:	https://reviews.freebsd.org/D38972
2023-04-03 04:10:01 -04:00
John Baldwin
38217c1393 krping: Use get_cyclecount for get_cycles.
This avoids having to duplicate identical MD code.

Reviewed by:	np, emaste
Differential Revision:	https://reviews.freebsd.org/D38971
2023-04-03 04:10:00 -04:00
John Baldwin
7fbd5cdea3 arch.7: Drop most mentions of MIPS.
Only keep MIPS in the list of deprecated architectures.

Reviewed by:	emaste
Differential Revision:	https://reviews.freebsd.org/D38970
2023-04-03 04:10:00 -04:00
John Baldwin
a13b5fad79 Make <sys/systm.h> more self-contained.
Replace <sys/cdefs.h> with <sys/types.h>.  Other includes need types
defined in <sys/types.h> and <sys/types.h> includes <sys/cdefs.h>
already.

While here, move the <machine/*.h> headers below the <sys/*.h>
headers.

Reviewed by:	imp, kib
Sponsored by:	DARPA
Differential Revision:	https://reviews.freebsd.org/D38841
2023-04-03 04:10:00 -04:00
Brooks Davis
0377ed9f43 makeman: replace -\|/ twiddles with dots
It shows progress more clearly, there aren't so many that the output
is excessive, and it's more friendly for things like Cirrus-CI's
logging that print the backspaces as boxes.

Reviewed by:	emaste
Sponsored by:	DARPA
Differential Revision:	https://reviews.freebsd.org/D38990
2023-04-03 04:10:00 -04:00
Brooks Davis
4bc1b1c3ca src.conf.5: regen without $FreeBSD$ 2023-04-03 04:10:00 -04:00
Brooks Davis
783dfc3c8d makeman: don't insert a $FreeBSD$
There's no need to insert this line which won't be expanded in git.  Not
generating it won't impact MFCs to 12 since the removal won't be MFCd.

Reviewed by:	emaste
Sponsored by:	DARPA
Differential Revision:	https://reviews.freebsd.org/D38989
2023-04-03 04:10:00 -04:00
Brooks Davis
9e9c758c9d makeman: fix a whitespace bug
Reviewed by:	emaste
Sponsored by:	DARPA
Differential Revision:	https://reviews.freebsd.org/D38988
2023-04-03 04:10:00 -04:00
Joerg Wunsch
e4e33591be dpaa2_mc.c: unbreak by adding <sys/lock.h>
When compiling current on arm64, it breaks since LA_UNLOCKED is
undefined. This was in turn caused by the mutex code aliasing
it as MA_NOTOWNED.

Add <sys/lock.h> so the macro is defined.
2023-04-03 04:10:00 -04:00
Alexander Motin
e960a33171 Add NAMESPACE MANAGEMENT into admin_opcode[].
MFC after: 1 week
2023-04-03 04:09:59 -04:00
Joerg Wunsch
c54cb89c22 usb: dwc3: add <sys/mutex.h>
Commit 5e54bb1ea9 added USB_BUS_LOCK/USB_BUS_UNLOCK. They, in
consequence, require mutexes so <sys/mutex.h> is needed.
2023-04-03 04:09:59 -04:00
Stefan Eßer
718f717774 msdosfs: fix debug print format and parameter
Building with -DMSDOSFS_DEBUG failed due to a format mismatch and
a variable that has been renamed but not updated in the printf()
parameter list.

MFC after:	1 month
2023-04-03 04:09:59 -04:00
Justin Hibbits
a21d553349 dpaa2: Mechanically convert to IfAPI
Reviewed By:	zlei
Sponsored by:	Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D38959
2023-04-03 04:09:59 -04:00
Justin Hibbits
f42abb719d eqos: Mechanically convert to IfAPI
Reviewed by:	zlei
Sponsored by:	Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D38963
2023-04-03 04:09:59 -04:00
Alexander V. Chernikov
6906fcc9b4 netlink: make snl(3) scratch buffer growable
Differential Revision: https://reviews.freebsd.org/D38946
MFC after:	2 weeks
2023-04-03 04:09:59 -04:00
Kirk McKusick
b5a7fa161c FFS/UFS snapshots: improve documentation for removal (deletion) and unlinking.
Clarification of the size of the snapshot file.

Suggested by: Matteo Riondato
PR:           266358
MFC after:    2 weeks
Differential Revision: https://reviews.freebsd.org/D38817
2023-04-03 04:09:59 -04:00
Yuri
08bf7bb505 acpica: do not print warning for missing _ADR
Started seeing the following after updating to VMware ESXi 8.0:

pcib2: <ACPI Host-PCI bridge> on acpi0
pcib2: could not evaluate _ADR - AE_NOT_FOUND
pci2: <ACPI PCI bus> on pcib2
vmx0: <VMware VMXNET3 Ethernet Adapter> ...

The virtual NIC works fine, and the code comment suggests that
missing _ADR is not something fatal, skip printing the message
if status is AE_NOT_FOUND.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/682
2023-04-03 04:09:58 -04:00
Kirk McKusick
89fd99c251 Correct several bugs in fsck_ffs(8) triggered by corrupted filesystems.
If a directory entry has an illegal inode number (less than zero
or greater than the last inode in the filesystem) the entry is removed.
If a directory '.' or '..' entry had an illegal inode number they
were being removed. Since fsck_ffs knows what the correct value is
for these two entries fix them rather deleting them.

Add much more extensive cylinder group checks and use them to be
more careful about rebuilding a cylinder group.

Check for out-of-range block numbers before trying to free them.

When a directory is deleted also remove its cache entry created
in pass1 so that later passes do not try to operate on a deleted
directory.

Check for ctime(3) returning NULL before trying to use its return.

When freeing a  directory inode, do not try to interpret it as a
directory.

Reserve space in the inostatlist to have room to allocate a
lost+found directory.

If an invalid block number is found past the end of an inode simply
remove it rather than clearing and removing the inode.

Modernize the inoinfo structure to use queue(3) LIST rather than a
handrolled linked list implementation.

Reported by:  Bob Prohaska, John-Mark Gurney, and Mark Millard
Tested by:    Peter Holm
Reviewed by:  Peter Holm
MFC after:    2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D38668
2023-04-03 04:09:58 -04:00
Jose Luis Duran
bc961d75ac Revert "Fix cross-build support for Ubuntu 16.04"
This reverts commit d6327ae8c1.

Before version 2.25, glibc's unistd.h would define the POSIX subset of
getopt.h by defining __need_getopt, including getopt.h (which would
disable the header guard) and then undefining it so later including
getopt.h explicitly would define the extensions. However, we wrap
getopt, and so the wrapper's #pragma once breaks that. Thus getopt.h was
included before the real unistd.h to ensure we get all the extensions.

However, with clang 12 that causes problems where we get a function
mismatch (since getopt can throw exceptions). If we include it after
unistd.h, it will get the full definitions since glibc no longer does
the subsetting thing. This will result in matching definitions and fix
clang 12.

Reviewed by: imp, jrtc27 (OK'd on irc)
Pull Request: https://github.com/freebsd/freebsd-src/pull/668
2023-04-03 04:09:58 -04:00
Kirk McKusick
a7d69cd8f2 Updates to UFS/FFS superblock integrity checks when reading a superblock.
Have to add a check that the computed cylinder group size does not
exceed the block size of the filesystem.

It is also necessary to validate additional parameters when a
superblock is going to be used in read-only mode if its supplementary
information is going to be read in to ensure that the size and
location of the supplementary information is valid. Also when a
warning is raised let it be accepted, but bound the flagged field
to the value checked by the warning.

No legitimate superblocks should fail as a result of these changes.

Reported by:  Bob Prohaska, John-Mark Gurney, and Mark Millard
Tested by:    Peter Holm
Reviewed by:  Peter Holm
MFC after:    2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D38668
2023-04-03 04:09:58 -04:00
Ed Maste
b2ba34707f src.opts.mk: Remove long-unused NDIS option
NDIS was removed a couple of years ago, but the src.conf knob was left
behind.

Fixes: bfc99943b0 ("ndis(4): remove as previous announced")
Sponsored by: The FreeBSD Foundation
2023-04-03 04:09:58 -04:00
Justin Hibbits
9e297cee08 Mechanically convert cxgb(4) and cxgbe(4) to IfAPI
Reviewed by:	np
Sponsored by:	Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D38597
2023-04-03 04:09:58 -04:00
Justin Hibbits
376822d83f Mechanically convert qlxgbe(4) to IfAPI
Reviewed by:	zlei
Sponsored by:	Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D37821
2023-04-03 04:09:58 -04:00
Justin Hibbits
41cddf01d4 Mechanically convert qlxgb(4) to IfAPI
Reviewed by:	zlei
Sponsored by:	Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D37820
2023-04-03 04:09:58 -04:00
Justin Hibbits
993bd2296f Mechanically convert qlxge(4) to IfAPI
Reviewed by:	zlei
Sponsored by:	Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D37819
2023-04-03 04:09:57 -04:00
Ed Maste
10fa5a7759 src.opts.mk: sync FDT and OFED options with kern.opts.mk
Where options exist in both src.opts.mk and kern.opts.mk they should be
kept in sync.

It may be that the option should be flipped the other way (e.g.,
enabling OFED in the kernel on arm64); if so that will be done as a
subsequent commit after further testing.

PR:		269994
Reviewed by:	imp
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D38952
2023-04-03 04:09:57 -04:00
Alexander V. Chernikov
9dc496923a netlink: cleanup netlink_writer code
* Remove unused nlattr_add_nla() - that's a duplicate of nlattr_add_raw().
* Calculate alignment only once in nlmsg_reserve_data_raw()

MFC after:	2 weeks
2023-04-03 04:09:57 -04:00
Kyle Evans
e5e81cf1ad arm64: fix the LINT-ACPI build
This file uses VM_MEMATTR_DEVICE_NP, which it gets through header
pollution somewhere with FDT enabled.  Pull in vm/vm.h to make it
explicit.
2023-04-03 04:09:57 -04:00
Alexander V. Chernikov
d6d8afc0b6 tests: add more netlink tests for neighbors/routes
Differential Revision: https://reviews.freebsd.org/D38912
MFC after:	2 weeks
2023-04-03 04:09:57 -04:00
Dag-Erling Smørgrav
ab89029804 libc: Remove prototype and documentation for tzsetwall().
PR:		269445
Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D38481
2023-04-03 04:09:57 -04:00
Dag-Erling Smørgrav
a0c71b5c87 byacc: Disable backtracking extension.
When updating byacc to 20230201, I enabled the backtracking extension as it seemed useful and harmless.  With a little more experience, it appears to have more impact than I initially thought and I'm no longer sure how useful it really is, so turn it back off.

PR:		244149, 269425
Sponsored by:	Klara, Inc.
Reviewed by:	imp, jkim
Differential Revision:	https://reviews.freebsd.org/D38931
2023-04-03 04:09:57 -04:00
Dag-Erling Smørgrav
ca951d2eb5 tarfs: Set mountedfrom correctly.
Sponsored by:	Juniper Networks, Inc.
Sponsored by:	Klara, Inc.
Reviewed by:	sjg, kib
Differential Revision:	https://reviews.freebsd.org/D38930
2023-04-03 04:09:56 -04:00
Justin Hibbits
8c9335a234 altera: Fix build from 068f2c0e10
Missed the altera dwc driver in the conversion.

Fixes:		068f2c0e10
Sponsored by:	Juniper Networks, Inc.
2023-04-03 04:09:56 -04:00
Vitaliy Gusev
404918a82c bhyve: Move libcasper dependecy to lib9p
libcasper(3) is not used in bhyve. So move dependency to the appropriate
place.

Reviewed by:	markj
MFC after:	1 week
Sponsored by:	vStack
Differential Revision:	https://reviews.freebsd.org/D38905
2023-04-03 04:09:56 -04:00
Jake Freeland
cb724a2684 .gitignore: Ignore LSP generated .cache
Language servers like clangd generate a .cache directory to store
compilation cache. Tell Git to ignore this directory when staging files.

Reviewed by:	markj
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D38937
2023-04-03 04:09:56 -04:00
Justin Hibbits
9f115f8b85 Mechanically convert dwc(4) to IfAPI
Reviewed by:	manu (older)
Sponsored by:	Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D37846
2023-04-03 04:09:56 -04:00
Justin Hibbits
1de6720488 cpsw(4): Finish conversion to IfAPI
Two ifnet accesses were missed in 2c7bc0f55.

Sponsored by:	Juniper Networks, Inc.
2023-04-03 04:09:56 -04:00
Justin Hibbits
b2987aeb87 linux: Use the if_name() accessor to get loopback name
Avoid directly accessing the if_xname ifnet member. and use the
designated accessor function instead.

Sponsored by:	Juniper Networks, Inc.
2023-04-03 04:09:56 -04:00
Justin Hibbits
d0618117c3 ktls: Use IfAPI accessors to get capabilities
Summary:
Avoid referencing the ifnet struct directly, and use the IfAPI accessors
instead.

Reviewed by:	gallatin
Sponsored by:	Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D38932
2023-04-03 04:09:55 -04:00
Justin Hibbits
c80a9cabf1 iflib: Further convert to use IfAPI accessors
Summary:
When iflib was first converted some IfAPI APIs were not yet present, so
were tagged with "XXX" comments.  Finish the conversion by using these
new APIs.

Reviewed by:	gallatin, erj
Sponsored by:	Juniper Networks, Inc
Differential Revision: https://reviews.freebsd.org/D38928
2023-04-03 04:09:55 -04:00
Kristof Provost
609c94016f carp tests: ensure exactly one jail is master
Verify that we only have one master, not two.

Sponsored by:	Rubicon Communications, LLC ("Netgate")
2023-04-03 04:09:55 -04:00
Kyle Evans
c6582381a7 arm64: ofw: respect the nonposted-mmio prop in OF_decode_addr()
This is the only mapping remaining which needs to respect nonposted-mmio
to avoid breaking the boot on Apple silicon.

Reviewed by:	andrew
Differential Revision:	https://reviews.freebsd.org/D38920
2023-04-03 04:09:55 -04:00
Kirk McKusick
d263d4ab8a FFS/UFS snapshots: improve documentation for removal (deletion) and unlinking.
Minor clarification.
2023-04-03 04:09:55 -04:00
Ed Maste
6c7bb3c7cc src.opts.mk: mark ZFS broken on powerpc, matching kern.opts.mk
Where options exist in both src.opts.mk and kern.opts.mk they should be
kept in sync.

PR:		269994
Reviewed by:	imp
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D38935
2023-04-03 04:09:55 -04:00
Herbert J. Skuhra
e63930a88a ATM: Remove /usr/include/netnatm when disbled 2023-04-03 04:09:55 -04:00
Ed Maste
70517f8791 src.conf: regen after d7a491dd30
Machine-dependent kernel options are now detected correctly.

PR:		269994
Sponsored by:	The FreeBSD Foundation
2023-04-03 04:09:55 -04:00
Ed Maste
4deebe6832 make showconfig: set MACHINE and MACHINE_ARCH
Previously these were not set for the showconfig target, so took the
host's value rather than the target.  As a result some machine-dependent
kernel options were not reported with correct defaults in the src.conf
manpage.

PR:		269994
Reviewed by:	imp
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D38926
2023-04-03 04:09:54 -04:00
Mark Johnston
ee169d1d56 netinet: Tighten checks for unspecified source addresses
The assertions added in commit b0ccf53f24 ("inpcb: Assert against
wildcard addrs in in_pcblookup_hash_locked()") revealed that protocol
layers may pass the unspecified address to in_pcblookup().

Add some checks to filter out such packets before we attempt an inpcb
lookup:
- Disallow the use of an unspecified source address in in_pcbladdr() and
  in6_pcbladdr().
- Disallow IP packets with an unspecified destination address.
- Disallow TCP packets with an unspecified source address, and add an
  assertion to verify the comment claiming that the case of an
  unspecified destination address is handled by the IP layer.

Reported by:	syzbot+9ca890fb84e984e82df2@syzkaller.appspotmail.com
Reported by:	syzbot+ae873c71d3c71d5f41cb@syzkaller.appspotmail.com
Reported by:	syzbot+e3e689aba1d442905067@syzkaller.appspotmail.com
Reviewed by:	glebius, melifaro
MFC after:	2 weeks
Sponsored by:	Klara, Inc.
Sponsored by:	Modirum MDPay
Differential Revision:	https://reviews.freebsd.org/D38570
2023-04-03 04:09:54 -04:00
Kristof Provost
b3314c4352 pfctl: remove set but unused variable
In pfctl_show_ifaces() `i` is set, but never used. Remove it.

Sponsored by:	Rubicon Communications, LLC ("Netgate")
2023-04-03 04:09:54 -04:00
Kajetan Staszkiewicz
09d47a0e85 pfctl: fix superblock printf format mismatch
It is impossible to compile pfctl with OPT_DEBUG due to integer width mismatch:

	/usr/home/kajetan.staszkiewicz/freebsd.git/sbin/pfctl/pfctl_optimize.c:1479:9: error: format specifies type 'unsigned int' but the argument has type 'unsigned long' [-Werror,-Wformat]
					    i - pf_rule_desc[closest].prf_off--- pfctl_optimize.o ---
	^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
	/usr/home/kajetan.staszkiewicz/freebsd.git/sbin/pfctl/pfctl_optimize.c:52:44: note: expanded from macro 'DEBUG'
		printf("%s: " str "\n", __FUNCTION__ , ## v)
			      ~~~                         ^
	1 error generated.

Reviewed by:	kp
Obtained from:	OpenBSD (pfctl_optimize.c 1.15)
Differential Revision:	https://reviews.freebsd.org/D38918
2023-04-03 04:09:54 -04:00
Christos Margiolis
a9f5a8550f readelf: fix -wR option, memory leaks, and -wf minor bug
Reviewed by:	markj
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D38419
2023-04-03 04:09:54 -04:00
Mark Johnston
5d36c4fd28 epair: Simplify the transmit path and address lost wakeups
epairs currently shuttle all transmitted packets through a single global
taskqueue thread.  To hand packets over to the taskqueue thread, each
epair maintains a pair of ring buffers and a lockless scheme for
notifying the thread of pending work.  The implementation can lead to
lost wakeups, causing to-be-transmitted packets to end up stuck in the
queue.

Rather than extending the existing scheme, simply replace it with a
linked list protected by a mutex, and use the mutex to synchronize
wakeups of the taskqueue thread.  This appears to give equivalent or
better throughput with >= 16 producer threads and eliminates the lost
wakeups.

Reviewed by:	kp
MFC after:	1 week
Sponsored by:	Klara, Inc.
Sponsored by:	Modirum MDPay
Differential Revision:	https://reviews.freebsd.org/D38843
2023-04-03 04:09:54 -04:00
Mark Johnston
ce9bc02975 epair: Avoid loading m_flags into a short
The m_flags field of struct mbuf is 24 bits wide and so gets truncated
in a couple of places in the epair code.  Instead of preserving the
entire flag set, just remember whether M_BCAST or M_MCAST is set.

MFC after:	1 week
Sponsored by:	Klara, Inc.
2023-04-03 04:09:54 -04:00
Vincenzo Maffione
ca03a24f24 netmap: pkt-gen: init all slots of every tx ring
sender_body() uses OPT_COPY to copy the frame into the destination slot
for the first 100,000 packets. Then it removes OPT_COPY to improve
performance. The function always starts with the first tx ring.

If multiple tx rings are in use, it is possible that the initial 100k
packets will only use the first ring. After OPT_COPY is removed, there
may come a time when the first ring is full and sender_body() will move
to the next ring which was never initialized. As a result it will send
all zero packets. (This was discovered when the receiving NIC reported
rx errors.)

Before any transmissions, step through every tx ring and set
NS_BUF_CHANGED on every slot. That will force send_packets() to
initialize the slot when first used. Since it only copies when
necessary, it performs better than always setting OPT_COPY. With this
change, there is no reason for the "drop copy" code.

Submitted by:	Brian Poole <brian90013@gmail.com>
MFC after:	7 days
2023-04-03 04:09:53 -04:00
Justin Hibbits
f862059f10 Mechanically convert usb ethernet drivers to DrvAPI
Reviewed by:	zlei
Sponsored by:	Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D37812
2023-04-03 04:09:53 -04:00
Justin Hibbits
00b511b2ef mlx5: Enter network epoch when using if_foreach()
Summary: IFNET_RLOCK() is not sufficient, the epoch needs entered.

Reviewed by:	hselasky
Sponsored by:	Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D38711
2023-04-03 04:09:53 -04:00
Alexander V. Chernikov
72faf7b61d netstat: fix IPv6 link-locals & custom multipath printing. 2023-04-03 04:09:53 -04:00
Alexander V. Chernikov
e5b8274b97 dhclient: do not add 0.0.0.0 interface alias.
Subscribers: imp

Differential Revision: https://reviews.freebsd.org/D38908
2023-04-03 04:09:53 -04:00
Alexander V. Chernikov
6109d4be4e netlink: use newly-added if_foreach_sleep() to iterate over the interface list.
Summary: MFC after:	2 weeks

Subscribers: imp, glebius

Differential Revision: https://reviews.freebsd.org/D38907
2023-04-03 04:09:53 -04:00
Alexander V. Chernikov
ebe4b2d8ca ifnet: add if_foreach_sleep() to allow ifnet iterations with sleep.
Subscribers: imp, ae, glebius

Differential Revision: https://reviews.freebsd.org/D38904
2023-04-03 04:09:53 -04:00
Alexander V. Chernikov
b8ad2dfdc3 net: unify mtu update code
Subscribers: imp, ae, glebius

Differential Revision: https://reviews.freebsd.org/D38893
2023-04-03 04:09:53 -04:00
Vitaliy Gusev
d920c12b6c bhyvectl: don't permit using --suspend and --checkpoint at same time
When using the --suspend and --checkpoint parameter, bhyvectl will
produce two checkpoint images and the exits. This is slightly ambiguous.
So, permit only one of theses parameters at the same time.

Reviewed by:		corvink, markj
MFC after:		1 week
Sponsored by:		vStack
Differential Revision:	https://reviews.freebsd.org/D38887
2023-04-03 04:09:52 -04:00
Vitaliy Gusev
780732678e bhyve: init checkput before caph_enter
init_checkpoint_thread binds to a socket. Bhyve isn't allowed to do that
after caph_enter.

Reviewed by:		corvink, markj
MFC after:		1 week
Sponsored by:		vStack
Differential Revision:	https://reviews.freebsd.org/D38857
2023-04-03 04:09:52 -04:00
Vitaliy Gusev
985bfdc5ff bhyve: exit with EX_OSERR if init checkpoint or restore time failed
Reviewed by:		corvink, markj
MFC after:		1 week
Sponsored by:		vStack
Differential Revision:	https://reviews.freebsd.org/D38872
2023-04-03 04:09:52 -04:00
Vitaliy Gusev
d92bd22791 bhyve: add cap limits for ipc socket
Reviewed by:		corvink, markj
MFC after:		1 week
Sponsored by:		vStack
Differential Revision:	https://reviews.freebsd.org/D38856
2023-04-03 04:09:52 -04:00
Vitaliy Gusev
8678beae24 bhyve: don't flush readonly device at blockif_pause
Reviewed by:		corvink, markj
MFC after:		1 week
Sponsored by:		vStack
Differential Revision:	https://reviews.freebsd.org/D38855
2023-04-03 04:09:52 -04:00
Vitaliy Gusev
09c06686ad libvmm: add missing ioctl's to vm_ioctl_cmds
Reviewed by:		corvink, markj
MFC after:		1 week
Sponsored by:		vStack
Differential Revision:	https://reviews.freebsd.org/D38866
2023-04-03 04:09:52 -04:00
Vitaliy Gusev
dd57b86222 bhyvectl: don't leak nvlist in send_message
Reviewed by:		corvink, markj
MFC after:		1 week
Sponsored by:		vStack
Differential Revision:	https://reviews.freebsd.org/D38900
2023-04-03 04:09:52 -04:00
Vitaliy Gusev
2d69d671af bhyvectl: correct socket_fd closing in send_message
Reviewed by:		corvink, markj
MFC after:		1 week
Sponsored by:		vStack
Differential Revision:	https://reviews.freebsd.org/D38889
2023-04-03 04:09:51 -04:00
Vitaliy Gusev
286094848e bhyvectl: do not return garbage from send_message
err is used uninitialized in some cases.

Reviewed by:		corvink, markj
MFC after:		1 week
Sponsored by:		vStack
Differential Revision:	https://reviews.freebsd.org/D38886
2023-04-03 04:09:51 -04:00
Peter Holm
e44b5422c4 stress2: Fix a off-by-one error. Added check for argument file type 2023-04-03 04:09:51 -04:00
Andrew Turner
d95b0f8c51 Remove a #error that sneaked in 2023-04-03 04:09:51 -04:00
Baptiste Daroussin
3859ac3409 uuidgen(1): fix another typo 2023-04-03 04:09:51 -04:00
Kirk McKusick
2689f2476e FFS/UFS snapshots: improve documentation.
This update provides a more detailed description of FFS/UFS snapshots
and adds links to useful man pages.

Requested by: Graham Perrin
Submitted by: darius-dons.net.au
Reviewed by:  Ravi Pokala
PR:           266358
MFC after:    2 weeks
Differential Revision: https://reviews.freebsd.org/D38817
2023-04-03 04:09:51 -04:00
Kajetan Staszkiewicz
17bf26a09c netstat: fix pfsync stats spelling
Reviewed by:	mjg
2023-04-03 04:09:51 -04:00
Andrew Turner
cf499a1873 Support non-posted MMIO on arm64 with FDT
To allow hardware to work around a broken memory bus where we need to
support the nonposted-mmio flag.

Reviewed by:	kevans
Differential Revision:	https://reviews.freebsd.org/D34333
2023-04-03 04:09:51 -04:00
Andrew Turner
62f0405b73 Map arm64 pci config memory as non-posted
On arm64 PCI config memory is expected to be mapped with a non-posted
device type. To handle this use the new bus_map_resource support in
arm64 to map memory with the new VM_MEMATTR_DEVICE_NP attribute. This
memory has already been allocated and activated, it just needs to be
mapped.

Reviewed by:	kevans, mmel
Differential Revision:	https://reviews.freebsd.org/D30079
2023-04-03 04:09:50 -04:00
Colin Percival
6d7c266376 linux_80211: Don't dequeue lsta if not queued
This fixes an instapanic when restarting wpa_supplicant on my laptop's
iwlwifi device.  After this change, iwlwifi enters a nonfunctional
state if wpa_supplicant is restarted, but "service netif restart wlan0"
is enough to get it working again.

releng/13.2 candidate.

Reviewed by:	bz
MFC after:	3 days
2023-04-03 04:09:50 -04:00
Xin LI
38388b3bfd xz: Improve compatibility with systems without capability mode support
When the kernel is built without capability mode support, or when
using an emulator like qemu-user-static that does not translate
system calls, these calls will return a negative number and set
the errno to ENOSYS. However, this error does not indicate a
real programming or runtime error and is generally ignored by
base system applications built with capability mode sandboxing.

Match this behavior by making xz(1) to ignore ENOSYS errors
when calling capability mode system calls too.

PR:		269185
Reported by:	Dan Kotowski
MFC after:	2 days
2023-04-03 04:09:50 -04:00
Tom Hukins
1a33a71673 netlink: Fix "version introduced" documentation
netlink(4) and associated features will exist in FreeBSD 14.0 but they
will also exist in 13.2, an older version, from commits such as 02b958b1
and b309249b.

This commit needs merging to stable/13 and releng/13.2.

MFC after: 2days (needs to be in RC2)
Reviewed by: imp,melifaro
Pull Request: https://github.com/freebsd/freebsd-src/pull/651
2023-04-03 04:09:50 -04:00
Kristof Provost
4cf2b7e8c2 netpfil tests: Add functions for testing routing scenarios
Many pf tests use identical setup where one jail is a router and
optionally another jail is a server. Add functions to create such jails
for IPv6 and IPv4 and functions to perform tests on such setup.

Add tests using those functions: scrub actions, routing table, tcp
sequence number modulation.

Reviewed by:	kp
Sponsored by:	InnoGames GmbH
Differential Revision:	https://reviews.freebsd.org/D38126
2023-04-03 04:09:50 -04:00
Kristof Provost
4dd9fb616a ifconfig: remove unused variable
In printgroup() 'cnt' is set, but never read. Remove it.

Sponsored by:	Rubicon Communications, LLC ("Netgate")
2023-04-03 04:09:50 -04:00
Dmitry Chagin
df8c9dc96f linux(4): Fixup 5c32488de0 mis-merge 2023-04-03 04:09:50 -04:00
Dmitry Chagin
07b3a045a3 linux(4): Add a counterpart to linux_ifflags
For further use in linux_ioctl_socket add bsd_to_linux_ifflags() which
accepts FreeBSD interface flags and translate it to Linux if flags.

Reviewed by:		melifaro
Differential Revision:	https://reviews.freebsd.org/D38873
2023-04-03 04:09:50 -04:00
Dmitry Chagin
d0f4c79581 linux(4): Assert that the FreeBSD size of struct sockaddr is equal to Linux
Our code depends on the fact that the size of struct sockaddr and
the size of sa_data is equal between FreeBSD and Linux.
2023-04-03 04:09:49 -04:00
Dmitry Chagin
d3e0096774 linux(4): Drop excess assert that Linux IFNAMSIZ is equal to FreeBSD
While here use _Static_assert() instead of the older CTASSERT().
2023-04-03 04:09:49 -04:00
Dmitry Chagin
c3824ae9f6 linux(4): Improve linux_ifconf readability
Initialize max_len and full variables in a code block where
they are used.
2023-04-03 04:09:49 -04:00
Dmitry Chagin
f142facc47 linux(4): Fixup of the pointer cast when comparing to an integer 2023-04-03 04:09:49 -04:00
Dmitry Chagin
a2771cdc90 linux(4): Add net epoch assert to the linux_ifhwaddr, linux_ifflags
Now this functions are intended to use in the net epoch.

Reviewed by:		emaste, melifaro
Differential Revision:	https://reviews.freebsd.org/D38795
2023-04-03 04:09:49 -04:00
Dmitry Chagin
2e8c972634 linux(4): Refactor socket ioctl path to avoid referencing an unstable interfaces
Split the linux_ioctl_socket() function on two counterparts, where
the linux_ioctl_socket_ifreq() intended to use in a code path which
requires the struct ifreq manipulation, i.e., translating in/out
values of the struct, while the linux_ioctl_socket() function is left
as is, it calls sys_ioctl() without touching in/out values.

Due to structures ifreq, sockaddr difference between FreeBSD and Linux
the linux_ioctl_socket_ifreq() calls kern_ioctl() directly, converting
in and out values to FreeBSD and to Linux accordingly.

Finally, modify the ifname_linux_to_bsd() to return error code, not
an unstable reference to the interface.

Reviewed by:		melifaro
Differential Revision:	https://reviews.freebsd.org/D38794
2023-04-03 04:09:49 -04:00
Dmitry Chagin
5e7a4df2e7 linux(4): Drop unncessary struct l_ifconf declaration from amd64/linux
Its needed only for amd64/linux32 Linuxulator.

Differential Revision:	https://reviews.freebsd.org/D38793
2023-04-03 04:09:49 -04:00
Dmitry Chagin
55ed591b65 linux(4): Rename struct l_ifreq members names to avoid conflicts with FreeBSD
For now we are using mixed names to access struct ifreq members, some
of Linux (ifr_name, ifr_ifindex), others of FreeBSD. To avoid conflicts
switch to use FreeBSD names.

Reviewed by:		jhibbits
Differential Revision:	https://reviews.freebsd.org/D38792
2023-04-03 04:09:48 -04:00
Dmitry Chagin
423fa711b8 linux(4): Reduce code duplication between MD files
Move struct ifnet definitions under compat/linux.

Reviewed by:		emaste
Differential Revision:	https://reviews.freebsd.org/D38791
2023-04-03 04:09:48 -04:00
Dmitry Chagin
b17c015e6b linsysfs(4): Refactor to avoid referencing an unstable interfaces
Enter the net epoch when traversing a list of interfaces. For that
split the ifname_linux_to_bsd() function on two counterparts, where
the ifname_linux_to_ifp() intended to use in epoch, while the
ifname_linux_to_bsd() intended to be a self-contained.
Until the linux_ioctl_coket() function is refactored, the
ifname_linux_to_bsd() temporarily returns interface outside
of the net epoch.

Reviewed by:		melifaro
Differential Revision:	https://reviews.freebsd.org/D38790
2023-04-03 04:09:48 -04:00
Dmitry Chagin
748c2d459b linux(4): Make linux_ifflags return a value
To simplify the use of the function in the printf-like statements.

Differential Revision:	https://reviews.freebsd.org/D38830
2023-04-03 04:09:48 -04:00
Dmitry Chagin
c1a363ad5f linux(4): Migrate to IfAPI
Migrate linux and linprocfs to use the IfAPI interfaces instead of
direct ifnet accesses.
The code initially writed by jhibbits@, and adapted by me to 3ab3c9c2.

Reviewed by:		jhibbits
Differential Revision:  https://reviews.freebsd.org/D38735
2023-04-03 04:09:48 -04:00
Fidaullah Noonari
c25dc4ce23 in_mcat.c: change multicast not member condition
If there is no source filter entry => block if that's SSM ("exclude"
mode per RFC 3678 clause 3).  If there is an entry => check its action &
block if the action is "exclude".

It would be nice if the test case in this PR were converted into an ATF
test case, but not blocking on that.

Reviewed by: imp, melifaro
Pull Request: https://github.com/freebsd/freebsd-src/pull/601
2023-04-03 04:09:48 -04:00
oscar
fa6c04dd56 Merge branch 'main' into main-nq 2023-03-03 16:51:43 -05:00
quackerd
ad7cd9cebe tmpfs NUMA and iflib drew's fix 2022-12-09 09:19:19 +01:00
492 changed files with 114393 additions and 182 deletions

42
.gitignore vendored
View File

@ -1,10 +1,42 @@
*.a
*.core
*.o
*.orig
*.rej
*.la
*.lo
# gcc dependency files
*.d
# Shared objects (inc. Windows DLLs)
*.dll
*.so
*.sw[nop]
*.so.*
*.dylib
# Executables
*.exe
*.out
*.app
*.i*86
*.x86_64
*.hex
# Debug files
*.dSYM/
# Vc++ build files
*tlog
Debug/
ipch/
*.opensdf
*.sdf
*.suo
*.user
*.idb
*.pdb
*.exp
*.ilk
.vs/
# ignore emacs backup saves
*~
_.tinderbox.*
_.universe-toolchain

View File

@ -8,7 +8,12 @@ how to build different parts of the project, etc. The
[developer's handbook](https://docs.freebsd.org/en/books/developers-handbook/)
is another useful resource.
## GitHub Pull Requests
* libpcap version (e.g. from `tcpdump --version`)
* operating system name and version and any other details that may be relevant
(`uname -a`, compiler name and version, CPU type etc.)
* `configure` or `cmake` flags if any were used
* statement of the problem
* steps to reproduce
Presently, GitHub 'freebsd-src' repository is one of the publish-only services
for the FreeBSD 'src' repository the project uses to promote collaboration and

941
Makefile
View File

@ -1,67 +1,280 @@
# Make and install tzdb code and data.
# This file is in the public domain, so clarified as of
# 2009-05-17 by Arthur David Olson.
# Package name for the code distribution.
PACKAGE= tzcode
# Version number for the distribution, overridden in the 'tarballs' rule below.
VERSION= unknown
# Email address for bug reports.
BUGEMAIL= tz@iana.org
# DATAFORM selects the data format.
# Available formats represent essentially the same data, albeit
# possibly with minor discrepancies that users are not likely to notice.
# To get new features and the best data right away, use:
# DATAFORM= vanguard
# To wait a while before using new features, to give downstream users
# time to upgrade zic (the default), use:
# DATAFORM= main
# To wait even longer for new features, use:
# DATAFORM= rearguard
# Rearguard users might also want "ZFLAGS = -b fat"; see below.
DATAFORM= main
# Change the line below for your timezone (after finding the one you want in
# one of the $(TDATA) source files, or adding it to a source file).
# Alternatively, if you discover you've got the wrong timezone, you can just
# 'zic -l -' to remove it, or 'zic -l rightzone' to change it.
# Use the command
# make zonenames
# to get a list of the values you can use for LOCALTIME.
LOCALTIME= Factory
# The POSIXRULES macro controls interpretation of POSIX-like TZ
# settings like TZ='EET-2EEST' that lack DST transition rules.
# If POSIXRULES is '-', no template is installed; this is the default.
# Any other value for POSIXRULES is obsolete and should not be relied on, as:
# * It does not work correctly in popular implementations such as GNU/Linux.
# * It does not work even in tzcode, except for historical timestamps
# that precede the last explicit transition in the POSIXRULES file.
# Hence it typically does not work for current and future timestamps.
# If, despite the above, you want a template for handling these settings,
# you can change the line below (after finding the timezone you want in the
# one of the $(TDATA) source files, or adding it to a source file).
# Alternatively, if you discover you've got the wrong timezone, you can just
# 'zic -p -' to remove it, or 'zic -p rightzone' to change it.
# Use the command
# make zonenames
# to get a list of the values you can use for POSIXRULES.
POSIXRULES= -
# Also see TZDEFRULESTRING below, which takes effect only
# if POSIXRULES is '-' or if the template file cannot be accessed.
# Installation locations.
#
# $FreeBSD$
# The defaults are suitable for Debian, except that if REDO is
# posix_right or right_posix then files that Debian puts under
# /usr/share/zoneinfo/posix and /usr/share/zoneinfo/right are instead
# put under /usr/share/zoneinfo-posix and /usr/share/zoneinfo-leaps,
# respectively. Problems with the Debian approach are discussed in
# the commentary for the right_posix rule (below).
# Destination directory, which can be used for staging.
# 'make DESTDIR=/stage install' installs under /stage (e.g., to
# /stage/etc/localtime instead of to /etc/localtime). Files under
# /stage are not intended to work as-is, but can be copied by hand to
# the root directory later. If DESTDIR is empty, 'make install' does
# not stage, but installs directly into production locations.
DESTDIR =
# Everything is installed into subdirectories of TOPDIR, and used there.
# TOPDIR should be empty (meaning the root directory),
# or a directory name that does not end in "/".
# TOPDIR should be empty or an absolute name unless you're just testing.
TOPDIR =
# The default local timezone is taken from the file TZDEFAULT.
TZDEFAULT = $(TOPDIR)/etc/localtime
# The subdirectory containing installed program and data files, and
# likewise for installed files that can be shared among architectures.
# These should be relative file names.
USRDIR = usr
USRSHAREDIR = $(USRDIR)/share
# "Compiled" timezone information is placed in the "TZDIR" directory
# (and subdirectories).
# TZDIR_BASENAME should not contain "/" and should not be ".", ".." or empty.
TZDIR_BASENAME= zoneinfo
TZDIR = $(TOPDIR)/$(USRSHAREDIR)/$(TZDIR_BASENAME)
# The "tzselect" and (if you do "make INSTALL") "date" commands go in:
BINDIR = $(TOPDIR)/$(USRDIR)/bin
# The "zdump" command goes in:
ZDUMPDIR = $(BINDIR)
# The "zic" command goes in:
ZICDIR = $(TOPDIR)/$(USRDIR)/sbin
# Manual pages go in subdirectories of. . .
MANDIR = $(TOPDIR)/$(USRSHAREDIR)/man
# Library functions are put in an archive in LIBDIR.
LIBDIR = $(TOPDIR)/$(USRDIR)/lib
# Types to try, as an alternative to time_t.
TIME_T_ALTERNATIVES = $(TIME_T_ALTERNATIVES_HEAD) $(TIME_T_ALTERNATIVES_TAIL)
TIME_T_ALTERNATIVES_HEAD = int_least64_t
TIME_T_ALTERNATIVES_TAIL = int_least32_t uint_least32_t uint_least64_t
# What kind of TZif data files to generate. (TZif is the binary time
# zone data format that zic generates; see Internet RFC 8536.)
# If you want only POSIX time, with time values interpreted as
# seconds since the epoch (not counting leap seconds), use
# REDO= posix_only
# below. If you want only "right" time, with values interpreted
# as seconds since the epoch (counting leap seconds), use
# REDO= right_only
# below. If you want both sets of data available, with leap seconds not
# counted normally, use
# REDO= posix_right
# below. If you want both sets of data available, with leap seconds counted
# normally, use
# REDO= right_posix
# below. POSIX mandates that leap seconds not be counted; for compatibility
# with it, use "posix_only" or "posix_right". Use POSIX time on systems with
# leap smearing; this can work better than unsmeared "right" time with
# applications that are not leap second aware, and is closer to unsmeared
# "right" time than unsmeared POSIX time is (e.g., 0.5 vs 1.0 s max error).
REDO= posix_right
# Whether to put an "Expires" line in the leapseconds file.
# Use EXPIRES_LINE=1 to put the line in, 0 to omit it.
# The EXPIRES_LINE value matters only if REDO's value contains "right".
# If you change EXPIRES_LINE, remove the leapseconds file before running "make".
# zic's support for the Expires line was introduced in tzdb 2020a,
# and was modified in tzdb 2021b to generate version 4 TZif files.
# EXPIRES_LINE defaults to 0 for now so that the leapseconds file
# can be given to pre-2020a zic implementations and so that TZif files
# built by newer zic implementations can be read by pre-2021b libraries.
EXPIRES_LINE= 0
# To install data in text form that has all the information of the TZif data,
# (optionally incorporating leap second information), use
# TZDATA_TEXT= tzdata.zi leapseconds
# To install text data without leap second information (e.g., because
# REDO='posix_only'), use
# TZDATA_TEXT= tzdata.zi
# To avoid installing text data, use
# TZDATA_TEXT=
TZDATA_TEXT= leapseconds tzdata.zi
# For backward-compatibility links for old zone names, use
# BACKWARD= backward
# To omit these links, use
# BACKWARD=
BACKWARD= backward
# If you want out-of-scope and often-wrong data from the file 'backzone',
# but only for entries listed in the backward-compatibility file zone.tab, use
# PACKRATDATA= backzone
# PACKRATLIST= zone.tab
# If you want all the 'backzone' data, use
# PACKRATDATA= backzone
# PACKRATLIST=
# To omit this data, use
# PACKRATDATA=
# PACKRATLIST=
PACKRATDATA=
PACKRATLIST=
# The name of a locale using the UTF-8 encoding, used during self-tests.
# The tests are skipped if the name does not appear to work on this system.
UTF8_LOCALE= en_US.utf8
# Non-default libraries needed to link.
# On some hosts, this should have -lintl unless CFLAGS has -DHAVE_GETTEXT=0.
LDLIBS=
# Add the following to the end of the "CFLAGS=" line as needed to override
# defaults specified in the source code. "-DFOO" is equivalent to "-DFOO=1".
# -DDEPRECATE_TWO_DIGIT_YEARS for optional runtime warnings about strftime
# formats that generate only the last two digits of year numbers
# -DEPOCH_LOCAL if the 'time' function returns local time not UT
# -DEPOCH_OFFSET=N if the 'time' function returns a value N greater
# than what POSIX specifies, assuming local time is UT.
# For example, N is 252460800 on AmigaOS.
# -DHAVE_DECL_ASCTIME_R=0 if <time.h> does not declare asctime_r
# -DHAVE_DECL_ENVIRON if <unistd.h> declares 'environ'
# -DHAVE_DECL_TIMEGM=0 if <time.h> does not declare timegm
# -DHAVE_DIRECT_H if mkdir needs <direct.h> (MS-Windows)
# -DHAVE__GENERIC=0 if _Generic does not work*
# -DHAVE_GETRANDOM if getrandom works (e.g., GNU/Linux),
# -DHAVE_GETRANDOM=0 to avoid using getrandom
# -DHAVE_GETTEXT if gettext works (e.g., GNU/Linux, FreeBSD, Solaris),
# where LDLIBS also needs to contain -lintl on some hosts;
# -DHAVE_GETTEXT=0 to avoid using gettext
# -DHAVE_INCOMPATIBLE_CTIME_R if your system's time.h declares
# ctime_r and asctime_r incompatibly with the POSIX standard
# (Solaris when _POSIX_PTHREAD_SEMANTICS is not defined).
# -DHAVE_INTTYPES_H=0 if <inttypes.h> does not work*+
# -DHAVE_LINK=0 if your system lacks a link function
# -DHAVE_LOCALTIME_R=0 if your system lacks a localtime_r function
# -DHAVE_LOCALTIME_RZ=0 if you do not want zdump to use localtime_rz
# localtime_rz can make zdump significantly faster, but is nonstandard.
# -DHAVE_MALLOC_ERRNO=0 if malloc etc. do not set errno on failure.
# -DHAVE_POSIX_DECLS=0 if your system's include files do not declare
# functions like 'link' or variables like 'tzname' required by POSIX
# -DHAVE_SETENV=0 if your system lacks the setenv function
# -DHAVE_SNPRINTF=0 if your system lacks the snprintf function+
# -DHAVE_STDCKDINT_H=0 if neither <stdckdint.h> nor substitutes like
# __builtin_add_overflow work*
# -DHAVE_STDINT_H=0 if <stdint.h> does not work*+
# -DHAVE_STRFTIME_L if <time.h> declares locale_t and strftime_l
# -DHAVE_STRDUP=0 if your system lacks the strdup function
# -DHAVE_STRTOLL=0 if your system lacks the strtoll function+
# -DHAVE_SYMLINK=0 if your system lacks the symlink function
# -DHAVE_SYS_STAT_H=0 if <sys/stat.h> does not work*
# -DHAVE_TZSET=0 if your system lacks a tzset function
# -DHAVE_UNISTD_H=0 if <unistd.h> does not work*
# -DHAVE_UTMPX_H=0 if <utmpx.h> does not work*
# -Dlocale_t=XXX if your system uses XXX instead of locale_t
# -DPORT_TO_C89 if tzcode should also run on C89 platforms+
# -DRESERVE_STD_EXT_IDS if your platform reserves standard identifiers
# with external linkage, e.g., applications cannot define 'localtime'.
# -Dssize_t=long on hosts like MS-Windows that lack ssize_t
# -DSUPPORT_C89 if the tzcode library should support C89 callers+
# -DSUPPRESS_TZDIR to not prepend TZDIR to file names; this has
# security implications and is not recommended for general use
# -DTHREAD_SAFE to make localtime.c thread-safe, as POSIX requires;
# not needed by the main-program tz code, which is single-threaded.
# Append other compiler flags as needed, e.g., -pthread on GNU/Linux.
# -Dtime_tz=\"T\" to use T as the time_t type, rather than the system time_t
# This is intended for internal use only; it mangles external names.
# -DTZ_DOMAIN=\"foo\" to use "foo" for gettext domain name; default is "tz"
# -DTZ_DOMAINDIR=\"/path\" to use "/path" for gettext directory;
# the default is system-supplied, typically "/usr/lib/locale"
# -DTZDEFRULESTRING=\",date/time,date/time\" to default to the specified
# DST transitions for POSIX-style TZ strings lacking them,
# in the usual case where POSIXRULES is '-'. If not specified,
# TZDEFRULESTRING defaults to US rules for future DST transitions.
# This mishandles some past timestamps, as US DST rules have changed.
# It also mishandles settings like TZ='EET-2EEST' for eastern Europe,
# as Europe and US DST rules differ.
# -DTZNAME_MAXIMUM=N to limit time zone abbreviations to N bytes (default 255)
# -DUNINIT_TRAP if reading uninitialized storage can cause problems
# other than simply getting garbage data
# -DUSE_LTZ=0 to build zdump with the system time zone library
# Also set TZDOBJS=zdump.o and CHECK_TIME_T_ALTERNATIVES= below.
# -DZIC_BLOAT_DEFAULT=\"fat\" to default zic's -b option to "fat", and
# similarly for "slim". Fat TZif files work around incompatibilities
# and bugs in some TZif readers, notably older ones that
# ignore or otherwise mishandle 64-bit data in TZif files;
# however, fat TZif files may trigger bugs in newer TZif readers.
# Slim TZif files are more efficient, and are the default.
# -DZIC_MAX_ABBR_LEN_WO_WARN=3
# (or some other number) to set the maximum time zone abbreviation length
# that zic will accept without a warning (the default is 6)
# $(GCC_DEBUG_FLAGS) if you are using recent GCC and want lots of checking
#
# The common user-driven targets are (for a complete list, see build(7)):
#
# universe - *Really* build *everything* (buildworld and
# all kernels on all architectures). Define
# MAKE_JUST_KERNELS or WITHOUT_WORLDS to only build kernels,
# MAKE_JUST_WORLDS or WITHOUT_KERNELS to only build userland.
# tinderbox - Same as universe, but presents a list of failed build
# targets and exits with an error if there were any.
# worlds - Same as universe, except just makes the worlds.
# kernels - Same as universe, except just makes the kernels.
# buildworld - Rebuild *everything*, including glue to help do
# upgrades.
# installworld - Install everything built by "buildworld".
# world - buildworld + installworld, no kernel.
# buildkernel - Rebuild the kernel and the kernel-modules.
# installkernel - Install the kernel and the kernel-modules.
# installkernel.debug
# reinstallkernel - Reinstall the kernel and the kernel-modules.
# reinstallkernel.debug
# kernel - buildkernel + installkernel.
# kernel-toolchain - Builds the subset of world necessary to build a kernel
# kernel-toolchains - Build kernel-toolchain for all universe targets.
# doxygen - Build API documentation of the kernel, needs doxygen.
# checkworld - Run test suite on installed world.
# check-old - List obsolete directories/files/libraries.
# check-old-dirs - List obsolete directories.
# check-old-files - List obsolete files.
# check-old-libs - List obsolete libraries.
# delete-old - Delete obsolete directories/files.
# delete-old-dirs - Delete obsolete directories.
# delete-old-files - Delete obsolete files.
# delete-old-libs - Delete obsolete libraries.
# list-old-dirs - Raw list of possibly obsolete directories.
# list-old-files - Raw list of possibly obsolete files.
# list-old-libs - Raw list of possibly obsolete libraries.
# targets - Print a list of supported TARGET/TARGET_ARCH pairs
# for world and kernel targets.
# toolchains - Build a toolchain for all world and kernel targets.
# makeman - Regenerate src.conf(5)
# sysent - (Re)build syscall entries from syscalls.master.
# xdev - xdev-build + xdev-install for the architecture
# specified with TARGET and TARGET_ARCH.
# xdev-build - Build cross-development tools.
# xdev-install - Install cross-development tools.
# xdev-links - Create traditional links in /usr/bin for cc, etc
# native-xtools - Create host binaries that produce target objects
# for use in qemu user-mode jails. TARGET and
# TARGET_ARCH should be defined.
# native-xtools-install
# - Install the files to the given DESTDIR/NXTP where
# NXTP defaults to /nxb-bin.
#
# This makefile is simple by design. The FreeBSD make automatically reads
# the /usr/share/mk/sys.mk unless the -m argument is specified on the
# command line. By keeping this makefile simple, it doesn't matter too
# much how different the installed mk files are from those in the source
# tree. This makefile executes a child make process, forcing it to use
# the mk files from the source tree which are supposed to DTRT.
#
# Most of the user-driven targets (as listed above) are implemented in
# Makefile.inc1. The exceptions are universe, tinderbox and targets.
# * Options marked "*" can be omitted if your compiler is C23 compatible.
# * Options marked "+" are obsolescent and are planned to be removed
# once the code assumes C99 or later.
#
# If you want to build your system from source, be sure that /usr/obj has
# at least 6 GB of disk space available. A complete 'universe' build of
@ -78,18 +291,16 @@
# For individuals wanting to upgrade their sources (even if only a
# delta of a few days):
#
# 1. `cd /usr/src' (or to the directory containing your source tree).
# 2. `make buildworld'
# 3. `make buildkernel KERNCONF=YOUR_KERNEL_HERE' (default is GENERIC).
# 4. `make installkernel KERNCONF=YOUR_KERNEL_HERE' (default is GENERIC).
# [steps 3. & 4. can be combined by using the "kernel" target]
# 5. `reboot' (in single user mode: boot -s from the loader prompt).
# 6. `etcupdate -p'
# 7. `make installworld'
# 8. `etcupdate -B'
# 9. `make delete-old'
# 10. `reboot'
# 11. `make delete-old-libs' (in case no 3rd party program uses them anymore)
# If you don't want functions that were inspired by NetBSD, add
# -DNETBSD_INSPIRED=0
# to the end of the "CFLAGS=" line. Otherwise, the functions
# "localtime_rz", "mktime_z", "tzalloc", and "tzfree" are added to the
# time library, and if STD_INSPIRED is also defined to nonzero the functions
# "posix2time_z" and "time2posix_z" are added as well.
# The functions ending in "_z" (or "_rz") are like their unsuffixed
# (or suffixed-by-"_r") counterparts, except with an extra first
# argument of opaque type timezone_t that specifies the timezone.
# "tzalloc" allocates a timezone_t value, and "tzfree" frees it.
#
# For individuals wanting to build from source with GCC from ports, first
# install the appropriate GCC cross toolchain package:
@ -99,24 +310,570 @@
# CROSS_TOOLCHAIN=${TARGET_ARCH}-gccN while building with the above steps,
# e.g., `make buildworld CROSS_TOOLCHAIN=amd64-gcc6`.
#
# The ${TARGET_ARCH}-gccN packages are provided as flavors of the
# devel/freebsd-gccN ports.
#
# See src/UPDATING `COMMON ITEMS' for more complete information.
#
# If TARGET=machine (e.g. powerpc, arm64, ...) is specified you can
# cross build world for other machine types using the buildworld target,
# and once the world is built you can cross build a kernel using the
# buildkernel target.
#
# Define the user-driven targets. These are listed here in alphabetical
# order, but that's not important.
#
# Targets that begin with underscore are internal targets intended for
# developer convenience only. They are intentionally not documented and
# completely subject to change without notice.
#
# For more information, see the build(7) manual page.
# If you want strict compliance with XPG4 as of 1994-04-09, add
# -DXPG4_1994_04_09
# to the end of the "CFLAGS=" line. This causes "strftime" to always return
# 53 as a week number (rather than 52 or 53) for January days before
# January's first Monday when a "%V" format is used and January 1
# falls on a Friday, Saturday, or Sunday.
CFLAGS=
# Linker flags. Default to $(LFLAGS) for backwards compatibility
# to release 2012h and earlier.
LDFLAGS= $(LFLAGS)
# For leap seconds, this Makefile uses LEAPSECONDS='-L leapseconds' in
# submake command lines. The default is no leap seconds.
LEAPSECONDS=
# The zic command and its arguments.
zic= ./zic
ZIC= $(zic) $(ZFLAGS)
# To shrink the size of installed TZif files,
# append "-r @N" to omit data before N-seconds-after-the-Epoch.
# To grow the files and work around bugs in older applications,
# possibly at the expense of introducing bugs in newer ones,
# append "-b fat"; see ZIC_BLOAT_DEFAULT above.
# See the zic man page for more about -b and -r.
ZFLAGS=
# How to use zic to install TZif files.
ZIC_INSTALL= $(ZIC) -d '$(DESTDIR)$(TZDIR)' $(LEAPSECONDS)
# The name of a Posix-compliant 'awk' on your system.
# mawk 1.3.3 and Solaris 10 /usr/bin/awk do not work.
# Also, it is better (though not essential) if 'awk' supports UTF-8,
# and unfortunately mawk and busybox awk do not support UTF-8.
# Try AWK=gawk or AWK=nawk if your awk has the abovementioned problems.
AWK= awk
# The full path name of a Posix-compliant shell, preferably one that supports
# the Korn shell's 'select' statement as an extension.
# These days, Bash is the most popular.
# It should be OK to set this to /bin/sh, on platforms where /bin/sh
# lacks 'select' or doesn't completely conform to Posix, but /bin/bash
# is typically nicer if it works.
KSHELL= /bin/bash
# Name of curl <https://curl.haxx.se/>, used for HTML validation.
CURL= curl
# Name of GNU Privacy Guard <https://gnupg.org/>, used to sign distributions.
GPG= gpg
# This expensive test requires USE_LTZ.
# To suppress it, define this macro to be empty.
CHECK_TIME_T_ALTERNATIVES = check_time_t_alternatives
# SAFE_CHAR is a regular expression that matches a safe character.
# Some parts of this distribution are limited to safe characters;
# others can use any UTF-8 character.
# For now, the safe characters are a safe subset of ASCII.
# The caller must set the shell variable 'sharp' to the character '#',
# since Makefile macros cannot contain '#'.
# TAB_CHAR is a single tab character, in single quotes.
TAB_CHAR= ' '
SAFE_CHARSET1= $(TAB_CHAR)' !\"'$$sharp'$$%&'\''()*+,./0123456789:;<=>?@'
SAFE_CHARSET2= 'ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\^_`'
SAFE_CHARSET3= 'abcdefghijklmnopqrstuvwxyz{|}~'
SAFE_CHARSET= $(SAFE_CHARSET1)$(SAFE_CHARSET2)$(SAFE_CHARSET3)
SAFE_CHAR= '[]'$(SAFE_CHARSET)'-]'
# These non-alphabetic, non-ASCII printable characters are Latin-1,
# and so are likely displayable even in editors like XEmacs 21
# that have limited display capabilities.
UNUSUAL_OK_LATIN_1 = ¡¢£¤¥¦§¨©«¬®¯°±²³´¶·¸¹»¼½¾¿×÷
# Non-ASCII non-letters that OK_CHAR allows, as these characters are
# useful in commentary.
UNUSUAL_OK_CHARSET= $(UNUSUAL_OK_LATIN_1)
# Put this in a bracket expression to match spaces.
s = [:space:]
# OK_CHAR matches any character allowed in the distributed files.
# This is the same as SAFE_CHAR, except that UNUSUAL_OK_CHARSET and
# multibyte letters are also allowed so that commentary can contain a
# few safe symbols and people's names and can quote non-English sources.
# Other non-letters are limited to ASCII renderings for the
# convenience of maintainers using XEmacs 21.5.34, which by default
# mishandles Unicode characters U+0100 and greater.
OK_CHAR= '[][:alpha:]$(UNUSUAL_OK_CHARSET)'$(SAFE_CHARSET)'-]'
# SAFE_LINE matches a line of safe characters.
# SAFE_SHARP_LINE is similar, except any OK character can follow '#';
# this is so that comments can contain non-ASCII characters.
# OK_LINE matches a line of OK characters.
SAFE_LINE= '^'$(SAFE_CHAR)'*$$'
SAFE_SHARP_LINE='^'$(SAFE_CHAR)'*('$$sharp$(OK_CHAR)'*)?$$'
OK_LINE= '^'$(OK_CHAR)'*$$'
# Flags to give 'tar' when making a distribution.
# Try to use flags appropriate for GNU tar.
GNUTARFLAGS= --format=pax --pax-option='delete=atime,delete=ctime' \
--numeric-owner --owner=0 --group=0 \
--mode=go+u,go-w --sort=name
TARFLAGS= `if tar $(GNUTARFLAGS) --version >/dev/null 2>&1; \
then echo $(GNUTARFLAGS); \
else :; \
fi`
# Flags to give 'gzip' when making a distribution.
GZIPFLAGS= -9n
# When comparing .tzs files, use GNU diff's -F'^TZ=' option if supported.
# This makes it easier to see which Zone has been affected.
DIFF_TZS= diff -u$$(! diff -u -F'^TZ=' - - <>/dev/null >&0 2>&1 \
|| echo ' -F^TZ=')
###############################################################################
#MAKE= make
cc= cc
CC= $(cc) -DTZDIR='"$(TZDIR)"'
AR= ar
# ':' on typical hosts; 'ranlib' on the ancient hosts that still need ranlib.
RANLIB= :
TZCOBJS= zic.o
TZDOBJS= zdump.o localtime.o asctime.o strftime.o
DATEOBJS= date.o localtime.o strftime.o asctime.o
LIBSRCS= localtime.c asctime.c difftime.c strftime.c
LIBOBJS= localtime.o asctime.o difftime.o strftime.o
HEADERS= tzfile.h private.h
NONLIBSRCS= zic.c zdump.c
NEWUCBSRCS= date.c
SOURCES= $(HEADERS) $(LIBSRCS) $(NONLIBSRCS) $(NEWUCBSRCS) \
tzselect.ksh workman.sh
MANS= newctime.3 newstrftime.3 newtzset.3 time2posix.3 \
tzfile.5 tzselect.8 zic.8 zdump.8
MANTXTS= newctime.3.txt newstrftime.3.txt newtzset.3.txt \
time2posix.3.txt \
tzfile.5.txt tzselect.8.txt zic.8.txt zdump.8.txt \
date.1.txt
COMMON= calendars CONTRIBUTING LICENSE Makefile \
NEWS README SECURITY theory.html version
WEB_PAGES= tz-art.html tz-how-to.html tz-link.html
CHECK_WEB_PAGES=check_theory.html check_tz-art.html \
check_tz-how-to.html check_tz-link.html
DOCS= $(MANS) date.1 $(MANTXTS) $(WEB_PAGES)
PRIMARY_YDATA= africa antarctica asia australasia \
europe northamerica southamerica
YDATA= $(PRIMARY_YDATA) etcetera
NDATA= factory
TDATA_TO_CHECK= $(YDATA) $(NDATA) backward
TDATA= $(YDATA) $(NDATA) $(BACKWARD)
ZONETABLES= zone1970.tab zone.tab
TABDATA= iso3166.tab $(TZDATA_TEXT) $(ZONETABLES)
LEAP_DEPS= leapseconds.awk leap-seconds.list
TZDATA_ZI_DEPS= ziguard.awk zishrink.awk version $(TDATA) \
$(PACKRATDATA) $(PACKRATLIST)
DSTDATA_ZI_DEPS= ziguard.awk $(TDATA) $(PACKRATDATA) $(PACKRATLIST)
DATA= $(TDATA_TO_CHECK) backzone iso3166.tab leap-seconds.list \
leapseconds $(ZONETABLES)
AWK_SCRIPTS= checklinks.awk checktab.awk leapseconds.awk \
ziguard.awk zishrink.awk
MISC= $(AWK_SCRIPTS)
TZS_YEAR= 2050
TZS_CUTOFF_FLAG= -c $(TZS_YEAR)
TZS= to$(TZS_YEAR).tzs
TZS_NEW= to$(TZS_YEAR)new.tzs
TZS_DEPS= $(YDATA) asctime.c localtime.c \
private.h tzfile.h zdump.c zic.c
TZDATA_DIST = $(COMMON) $(DATA) $(MISC)
# EIGHT_YARDS is just a yard short of the whole ENCHILADA.
EIGHT_YARDS = $(TZDATA_DIST) $(DOCS) $(SOURCES) tzdata.zi
ENCHILADA = $(EIGHT_YARDS) $(TZS)
# Consult these files when deciding whether to rebuild the 'version' file.
# This list is not the same as the output of 'git ls-files', since
# .gitignore is not distributed.
VERSION_DEPS= \
calendars CONTRIBUTING LICENSE Makefile NEWS README SECURITY \
africa antarctica asctime.c asia australasia \
backward backzone \
checklinks.awk checktab.awk \
date.1 date.c difftime.c \
etcetera europe factory iso3166.tab \
leap-seconds.list leapseconds.awk localtime.c \
newctime.3 newstrftime.3 newtzset.3 northamerica \
private.h southamerica strftime.c theory.html \
time2posix.3 tz-art.html tz-how-to.html tz-link.html \
tzfile.5 tzfile.h tzselect.8 tzselect.ksh \
workman.sh zdump.8 zdump.c zic.8 zic.c \
ziguard.awk zishrink.awk \
zone.tab zone1970.tab
# And for the benefit of csh users on systems that assume the user
# shell should be used to handle commands in Makefiles. . .
SHELL= /bin/sh
all: tzselect zic zdump libtz.a $(TABDATA) \
vanguard.zi main.zi rearguard.zi
ALL: all date $(ENCHILADA)
install: all $(DATA) $(REDO) $(MANS)
mkdir -p '$(DESTDIR)$(BINDIR)' \
'$(DESTDIR)$(ZDUMPDIR)' '$(DESTDIR)$(ZICDIR)' \
'$(DESTDIR)$(LIBDIR)' \
'$(DESTDIR)$(MANDIR)/man3' '$(DESTDIR)$(MANDIR)/man5' \
'$(DESTDIR)$(MANDIR)/man8'
$(ZIC_INSTALL) -l $(LOCALTIME) \
`case '$(POSIXRULES)' in ?*) echo '-p';; esac \
` $(POSIXRULES) \
-t '$(DESTDIR)$(TZDEFAULT)'
cp -f $(TABDATA) '$(DESTDIR)$(TZDIR)/.'
cp tzselect '$(DESTDIR)$(BINDIR)/.'
cp zdump '$(DESTDIR)$(ZDUMPDIR)/.'
cp zic '$(DESTDIR)$(ZICDIR)/.'
cp libtz.a '$(DESTDIR)$(LIBDIR)/.'
$(RANLIB) '$(DESTDIR)$(LIBDIR)/libtz.a'
cp -f newctime.3 newtzset.3 '$(DESTDIR)$(MANDIR)/man3/.'
cp -f tzfile.5 '$(DESTDIR)$(MANDIR)/man5/.'
cp -f tzselect.8 zdump.8 zic.8 '$(DESTDIR)$(MANDIR)/man8/.'
INSTALL: ALL install date.1
mkdir -p '$(DESTDIR)$(BINDIR)' '$(DESTDIR)$(MANDIR)/man1'
cp date '$(DESTDIR)$(BINDIR)/.'
cp -f date.1 '$(DESTDIR)$(MANDIR)/man1/.'
# Calculate version number from git, if available.
# Otherwise, use $(VERSION) unless it is "unknown" and there is already
# a 'version' file, in which case reuse the existing 'version' contents
# and append "-dirty" if the contents do not already end in "-dirty".
version: $(VERSION_DEPS)
{ (type git) >/dev/null 2>&1 && \
V=`git describe --match '[0-9][0-9][0-9][0-9][a-z]*' \
--abbrev=7 --dirty` || \
if test '$(VERSION)' = unknown && V=`cat $@`; then \
case $$V in *-dirty);; *) V=$$V-dirty;; esac; \
else \
V='$(VERSION)'; \
fi; } && \
printf '%s\n' "$$V" >$@.out
mv $@.out $@
# These files can be tailored by setting BACKWARD, PACKRATDATA, PACKRATLIST.
vanguard.zi main.zi rearguard.zi: $(DSTDATA_ZI_DEPS)
$(AWK) \
-v DATAFORM=`expr $@ : '\(.*\).zi'` \
-v PACKRATDATA='$(PACKRATDATA)' \
-v PACKRATLIST='$(PACKRATLIST)' \
-f ziguard.awk \
$(TDATA) $(PACKRATDATA) >$@.out
mv $@.out $@
# This file has a version comment that attempts to capture any tailoring
# via BACKWARD, DATAFORM, PACKRATDATA, PACKRATLIST, and REDO.
tzdata.zi: $(DATAFORM).zi version zishrink.awk
version=`sed 1q version` && \
LC_ALL=C $(AWK) \
-v dataform='$(DATAFORM)' \
-v deps='$(DSTDATA_ZI_DEPS) zishrink.awk' \
-v redo='$(REDO)' \
-v version="$$version" \
-f zishrink.awk \
$(DATAFORM).zi >$@.out
mv $@.out $@
version.h: version
VERSION=`cat version` && printf '%s\n' \
'static char const PKGVERSION[]="($(PACKAGE)) ";' \
"static char const TZVERSION[]=\"$$VERSION\";" \
'static char const REPORT_BUGS_TO[]="$(BUGEMAIL)";' \
>$@.out
mv $@.out $@
zdump: $(TZDOBJS)
$(CC) -o $@ $(CFLAGS) $(LDFLAGS) $(TZDOBJS) $(LDLIBS)
zic: $(TZCOBJS)
$(CC) -o $@ $(CFLAGS) $(LDFLAGS) $(TZCOBJS) $(LDLIBS)
leapseconds: $(LEAP_DEPS)
$(AWK) -v EXPIRES_LINE=$(EXPIRES_LINE) \
-f leapseconds.awk leap-seconds.list >$@.out
mv $@.out $@
# Arguments to pass to submakes of install_data.
# They can be overridden by later submake arguments.
INSTALLARGS = \
BACKWARD='$(BACKWARD)' \
DESTDIR='$(DESTDIR)' \
LEAPSECONDS='$(LEAPSECONDS)' \
PACKRATDATA='$(PACKRATDATA)' \
PACKRATLIST='$(PACKRATLIST)' \
TZDEFAULT='$(TZDEFAULT)' \
TZDIR='$(TZDIR)' \
ZIC='$(ZIC)'
INSTALL_DATA_DEPS = zic leapseconds tzdata.zi
# 'make install_data' installs one set of TZif files.
install_data: $(INSTALL_DATA_DEPS)
$(ZIC_INSTALL) tzdata.zi
posix_only: $(INSTALL_DATA_DEPS)
$(MAKE) $(INSTALLARGS) LEAPSECONDS= install_data
right_only: $(INSTALL_DATA_DEPS)
$(MAKE) $(INSTALLARGS) LEAPSECONDS='-L leapseconds' \
install_data
# In earlier versions of this makefile, the other two directories were
# subdirectories of $(TZDIR). However, this led to configuration errors.
# For example, with posix_right under the earlier scheme,
# TZ='right/Australia/Adelaide' got you localtime with leap seconds,
# but gmtime without leap seconds, which led to problems with applications
# like sendmail that subtract gmtime from localtime.
# Therefore, the other two directories are now siblings of $(TZDIR).
# You must replace all of $(TZDIR) to switch from not using leap seconds
# to using them, or vice versa.
right_posix: right_only
rm -fr '$(DESTDIR)$(TZDIR)-leaps'
ln -s '$(TZDIR_BASENAME)' '$(DESTDIR)$(TZDIR)-leaps' || \
$(MAKE) $(INSTALLARGS) TZDIR='$(TZDIR)-leaps' right_only
$(MAKE) $(INSTALLARGS) TZDIR='$(TZDIR)-posix' posix_only
posix_right: posix_only
rm -fr '$(DESTDIR)$(TZDIR)-posix'
ln -s '$(TZDIR_BASENAME)' '$(DESTDIR)$(TZDIR)-posix' || \
$(MAKE) $(INSTALLARGS) TZDIR='$(TZDIR)-posix' posix_only
$(MAKE) $(INSTALLARGS) TZDIR='$(TZDIR)-leaps' right_only
zones: $(REDO)
# dummy.zd is not a real file; it is mentioned here only so that the
# top-level 'make' does not have a syntax error.
ZDS = dummy.zd
# Rule used only by submakes invoked by the $(TZS_NEW) rule.
# It is separate so that GNU 'make -j' can run instances in parallel.
$(ZDS): zdump
./zdump -i $(TZS_CUTOFF_FLAG) '$(wd)/'$$(expr $@ : '\(.*\).zd') \
>$@
TZS_NEW_DEPS = tzdata.zi zdump zic
$(TZS_NEW): $(TZS_NEW_DEPS)
rm -fr tzs$(TZS_YEAR).dir
mkdir tzs$(TZS_YEAR).dir
$(zic) -d tzs$(TZS_YEAR).dir tzdata.zi
$(AWK) '/^L/{print "Link\t" $$2 "\t" $$3}' \
tzdata.zi | LC_ALL=C sort >$@.out
wd=`pwd` && \
x=`$(AWK) '/^Z/{print "tzs$(TZS_YEAR).dir/" $$2 ".zd"}' \
tzdata.zi \
| LC_ALL=C sort -t . -k 2,2` && \
set x $$x && \
shift && \
ZDS=$$* && \
$(MAKE) wd="$$wd" TZS_CUTOFF_FLAG="$(TZS_CUTOFF_FLAG)" \
ZDS="$$ZDS" $$ZDS && \
sed 's,^TZ=".*\.dir/,TZ=",' $$ZDS >>$@.out
rm -fr tzs$(TZS_YEAR).dir
mv $@.out $@
# If $(TZS) exists but 'make check_tzs' fails, a maintainer should inspect the
# failed output and fix the inconsistency, perhaps by running 'make force_tzs'.
$(TZS):
touch $@
force_tzs: $(TZS_NEW)
cp $(TZS_NEW) $(TZS)
libtz.a: $(LIBOBJS)
rm -f $@
$(AR) -rc $@ $(LIBOBJS)
$(RANLIB) $@
date: $(DATEOBJS)
$(CC) -o $@ $(CFLAGS) $(LDFLAGS) $(DATEOBJS) $(LDLIBS)
tzselect: tzselect.ksh version
VERSION=`cat version` && sed \
-e 's|#!/bin/bash|#!$(KSHELL)|g' \
-e 's|AWK=[^}]*|AWK='\''$(AWK)'\''|g' \
-e 's|\(PKGVERSION\)=.*|\1='\''($(PACKAGE)) '\''|' \
-e 's|\(REPORT_BUGS_TO\)=.*|\1=$(BUGEMAIL)|' \
-e 's|TZDIR=[^}]*|TZDIR=$(TZDIR)|' \
-e 's|\(TZVERSION\)=.*|\1='"$$VERSION"'|' \
<$@.ksh >$@.out
chmod +x $@.out
mv $@.out $@
check: check_back check_mild
check_mild: check_character_set check_white_space check_links \
check_name_lengths check_slashed_abbrs check_sorted \
check_tables check_web check_ziguard check_zishrink check_tzs
check_character_set: $(ENCHILADA)
test ! '$(UTF8_LOCALE)' || \
! printf 'A\304\200B\n' | \
LC_ALL='$(UTF8_LOCALE)' grep -q '^A.B$$' >/dev/null 2>&1 || { \
LC_ALL='$(UTF8_LOCALE)' && export LC_ALL && \
sharp='#' && \
! grep -Env $(SAFE_LINE) $(MANS) date.1 $(MANTXTS) \
$(MISC) $(SOURCES) $(WEB_PAGES) \
CONTRIBUTING LICENSE README SECURITY \
version tzdata.zi && \
! grep -Env $(SAFE_LINE)'|^UNUSUAL_OK_'$(OK_CHAR)'*$$' \
Makefile && \
! grep -Env $(SAFE_SHARP_LINE) $(TDATA_TO_CHECK) backzone \
leapseconds zone.tab && \
! grep -Env $(OK_LINE) $(ENCHILADA); \
}
touch $@
check_white_space: $(ENCHILADA)
patfmt=' \t|[\f\r\v]' && pat=`printf "$$patfmt\\n"` && \
! grep -En "$$pat" \
$$(ls $(ENCHILADA) | grep -Fvx leap-seconds.list)
! grep -n '[$s]$$' \
$$(ls $(ENCHILADA) | grep -Fvx leap-seconds.list)
touch $@
PRECEDES_FILE_NAME = ^(Zone|Link[$s]+[^$s]+)[$s]+
FILE_NAME_COMPONENT_TOO_LONG = $(PRECEDES_FILE_NAME)[^$s]*[^/$s]{15}
check_name_lengths: $(TDATA_TO_CHECK) backzone
! grep -En '$(FILE_NAME_COMPONENT_TOO_LONG)' \
$(TDATA_TO_CHECK) backzone
touch $@
PRECEDES_STDOFF = ^(Zone[$s]+[^$s]+)?[$s]+
STDOFF = [-+]?[0-9:.]+
RULELESS_SAVE = (-|$(STDOFF)[sd]?)
RULELESS_SLASHED_ABBRS = \
$(PRECEDES_STDOFF)$(STDOFF)[$s]+$(RULELESS_SAVE)[$s]+[^$s]*/
check_slashed_abbrs: $(TDATA_TO_CHECK)
! grep -En '$(RULELESS_SLASHED_ABBRS)' $(TDATA_TO_CHECK)
touch $@
CHECK_CC_LIST = { n = split($$1,a,/,/); for (i=2; i<=n; i++) print a[1], a[i]; }
check_sorted: backward backzone
$(AWK) '/^Link/ {printf "%.5d %s\n", g, $$3} !/./ {g++}' \
backward | LC_ALL=C sort -cu
$(AWK) '/^Zone/ {print $$2}' backzone | LC_ALL=C sort -cu
touch $@
check_back: checklinks.awk $(TDATA_TO_CHECK)
$(AWK) \
-v DATAFORM=$(DATAFORM) \
-v backcheck=backward \
-f checklinks.awk $(TDATA_TO_CHECK)
touch $@
check_links: checklinks.awk tzdata.zi
$(AWK) \
-v DATAFORM=$(DATAFORM) \
-f checklinks.awk tzdata.zi
touch $@
check_tables: checktab.awk $(YDATA) backward $(ZONETABLES)
for tab in $(ZONETABLES); do \
test "$$tab" = zone.tab && links='$(BACKWARD)' || links=''; \
$(AWK) -f checktab.awk -v zone_table=$$tab $(YDATA) $$links \
|| exit; \
done
touch $@
check_tzs: $(TZS) $(TZS_NEW)
if test -s $(TZS); then \
$(DIFF_TZS) $(TZS) $(TZS_NEW); \
else \
cp $(TZS_NEW) $(TZS); \
fi
touch $@
check_web: $(CHECK_WEB_PAGES)
check_theory.html: theory.html
check_tz-art.html: tz-art.html
check_tz-how-to.html: tz-how-to.html
check_tz-link.html: tz-link.html
check_theory.html check_tz-art.html check_tz-how-to.html check_tz-link.html:
$(CURL) -sS --url https://validator.w3.org/nu/ -F out=gnu \
-F file=@$$(expr $@ : 'check_\(.*\)') -o $@.out && \
test ! -s $@.out || { cat $@.out; exit 1; }
mv $@.out $@
check_ziguard: rearguard.zi vanguard.zi ziguard.awk
$(AWK) -v DATAFORM=rearguard -f ziguard.awk vanguard.zi | \
diff -u rearguard.zi -
$(AWK) -v DATAFORM=vanguard -f ziguard.awk rearguard.zi | \
diff -u vanguard.zi -
touch $@
# Check that zishrink.awk does not alter the data, and that ziguard.awk
# preserves main-format data.
check_zishrink: check_zishrink_posix check_zishrink_right
check_zishrink_posix check_zishrink_right: \
zic leapseconds $(PACKRATDATA) $(PACKRATLIST) \
$(TDATA) $(DATAFORM).zi tzdata.zi
rm -fr $@.dir $@-t.dir $@-shrunk.dir
mkdir $@.dir $@-t.dir $@-shrunk.dir
case $@ in \
*_right) leap='-L leapseconds';; \
*) leap=;; \
esac && \
$(ZIC) $$leap -d $@.dir $(DATAFORM).zi && \
$(ZIC) $$leap -d $@-shrunk.dir tzdata.zi && \
case $(DATAFORM),$(PACKRATLIST) in \
main,) \
$(ZIC) $$leap -d $@-t.dir $(TDATA) && \
$(AWK) '/^Rule/' $(TDATA) | \
$(ZIC) $$leap -d $@-t.dir - $(PACKRATDATA) && \
diff -r $@.dir $@-t.dir;; \
esac
diff -r $@.dir $@-shrunk.dir
rm -fr $@.dir $@-t.dir $@-shrunk.dir
touch $@
clean_misc:
rm -fr check_*.dir
rm -f *.o *.out $(TIME_T_ALTERNATIVES) \
check_* core typecheck_* \
date tzselect version.h zdump zic libtz.a
clean: clean_misc
rm -fr *.dir tzdb-*/
rm -f *.zi $(TZS_NEW)
maintainer-clean: clean
@echo 'This command is intended for maintainers to use; it'
@echo 'deletes files that may need special tools to rebuild.'
rm -f leapseconds version $(MANTXTS) $(TZS) *.asc *.tar.*
names:
@echo $(ENCHILADA)
public: check check_public $(CHECK_TIME_T_ALTERNATIVES) \
tarballs signatures
date.1.txt: date.1
newctime.3.txt: newctime.3
newstrftime.3.txt: newstrftime.3
newtzset.3.txt: newtzset.3
time2posix.3.txt: time2posix.3
tzfile.5.txt: tzfile.5
tzselect.8.txt: tzselect.8
zdump.8.txt: zdump.8
zic.8.txt: zic.8
$(MANTXTS): workman.sh
LC_ALL=C sh workman.sh `expr $@ : '\(.*\)\.txt$$'` >$@.out
mv $@.out $@
# Set file timestamps deterministically if possible,
# so that tarballs containing the timestamps are reproducible.
#
.if defined(UNIVERSE_TARGET) || defined(MAKE_JUST_WORLDS) || defined(WITHOUT_KERNELS)

View File

@ -1,45 +1,65 @@
FreeBSD Source:
---------------
This is the top level of the FreeBSD source directory.
# LIBPCAP 1.x.y by [The Tcpdump Group](https://www.tcpdump.org)
FreeBSD is an operating system used to power modern servers, desktops, and embedded platforms.
A large community has continually developed it for more than thirty years.
Its advanced networking, security, and storage features have made FreeBSD the platform of choice for many of the busiest web sites and most pervasive embedded networking and storage devices.
**To report a security issue please send an e-mail to security@tcpdump.org.**
For copyright information, please see [the file COPYRIGHT](COPYRIGHT) in this directory.
Additional copyright information also exists for some sources in this tree - please see the specific source directories for more information.
To report bugs and other problems, contribute patches, request a
feature, provide generic feedback etc please see the
[guidelines for contributing](CONTRIBUTING.md).
The Makefile in this directory supports a number of targets for building components (or all) of the FreeBSD source tree.
See build(7), config(8), [FreeBSD handbook on building userland](https://docs.freebsd.org/en/books/handbook/cutting-edge/#makeworld), and [Handbook for kernels](https://docs.freebsd.org/en/books/handbook/kernelconfig/) for more information, including setting make(1) variables.
The [documentation directory](doc/) has README files about specific
operating systems and options.
For information on the CPU architectures and platforms supported by FreeBSD, see the [FreeBSD
website's Platforms page](https://www.freebsd.org/platforms/).
Anonymous Git is available via:
Source Roadmap:
---------------
| Directory | Description |
| --------- | ----------- |
| bin | System/user commands. |
| cddl | Various commands and libraries under the Common Development and Distribution License. |
| contrib | Packages contributed by 3rd parties. |
| crypto | Cryptography stuff (see [crypto/README](crypto/README)). |
| etc | Template files for /etc. |
| gnu | Commands and libraries under the GNU General Public License (GPL) or Lesser General Public License (LGPL). Please see [gnu/COPYING](gnu/COPYING) and [gnu/COPYING.LIB](gnu/COPYING.LIB) for more information. |
| include | System include files. |
| kerberos5 | Kerberos5 (Heimdal) package. |
| lib | System libraries. |
| libexec | System daemons. |
| release | Release building Makefile & associated tools. |
| rescue | Build system for statically linked /rescue utilities. |
| sbin | System commands. |
| secure | Cryptographic libraries and commands. |
| share | Shared resources. |
| stand | Boot loader sources. |
| sys | Kernel sources (see [sys/README.md](sys/README.md)). |
| targets | Support for experimental `DIRDEPS_BUILD` |
| tests | Regression tests which can be run by Kyua. See [tests/README](tests/README) for additional information. |
| tools | Utilities for regression testing and miscellaneous tasks. |
| usr.bin | User commands. |
| usr.sbin | System administration commands. |
https://github.com/the-tcpdump-group/libpcap.git
For information on synchronizing your source tree with one or more of the FreeBSD Project's development branches, please see [FreeBSD Handbook](https://docs.freebsd.org/en/books/handbook/cutting-edge/#current-stable).
From version 0.4, library versioning will use a semantic versioning format
(per http://semver.org) of the form _Major.minor.patch_ (M.m.p).
```text
formerly from Lawrence Berkeley National Laboratory
Network Research Group <libpcap@ee.lbl.gov>
ftp://ftp.ee.lbl.gov/old/libpcap-0.4a7.tar.Z
```
### Support for particular platforms and BPF
For some platforms there are `README.{system}` files that discuss issues
with the OS's interface for packet capture on those platforms, such as
how to enable support for that interface in the OS, if it's not built in
by default.
The libpcap interface supports a filtering mechanism based on the
architecture in the BSD packet filter. BPF is described in the 1993
Winter Usenix paper ``The BSD Packet Filter: A New Architecture for
User-level Packet Capture''
([compressed PostScript](https://www.tcpdump.org/papers/bpf-usenix93.ps.Z),
[gzipped PostScript](https://www.tcpdump.org/papers/bpf-usenix93.ps.gz),
[PDF](https://www.tcpdump.org/papers/bpf-usenix93.pdf)).
- ITM software trace - packet processing and decode.
- ETMv3 data trace - packet decode.
- ETMv4 data trace - packet processing and decode.
BPF is standard in 4.4BSD, BSD/OS, NetBSD, FreeBSD, OpenBSD, DragonFly
BSD, macOS, and Solaris 11; an older, modified and undocumented version
is standard in AIX. {DEC OSF/1, Digital UNIX, Tru64 UNIX} uses the
packetfilter interface but has been extended to accept BPF filters
(which libpcap utilizes).
Linux has a number of BPF based systems, and libpcap does not support
any of the eBPF mechanisms as yet, although it supports many of the
memory mapped receive mechanisms.
See the [Linux-specific README](doc/README.linux) for more information.
### Note to Linux distributions and *BSD systems that include libpcap:
CoreSight kernel drivers and perf suport for CoreSight trace is maintained in the latest
upstream kernel versions.
It sets the soname of the library to `libpcap.so.1`; this is what it
should be, **NOT** `libpcap.so.1.x` or `libpcap.so.1.x.y` or something such as
that.
We've been maintaining binary compatibility between libpcap releases for
quite a while; there's no reason to tie a binary linked with libpcap to
a particular release of libpcap.

217
charconv.c Normal file
View File

@ -0,0 +1,217 @@
/* -*- Mode: c; tab-width: 8; indent-tabs-mode: 1; c-basic-offset: 8; -*- */
/*
* Copyright (c) 1993, 1994, 1995, 1996, 1997
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the Computer Systems
* Engineering Group at Lawrence Berkeley Laboratory.
* 4. Neither the name of the University nor of the Laboratory may be used
* to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#ifdef _WIN32
#include <stdio.h>
#include <errno.h>
#include <pcap/pcap.h> /* Needed for PCAP_ERRBUF_SIZE */
#include "charconv.h"
wchar_t *
cp_to_utf_16le(UINT codepage, const char *cp_string, DWORD flags)
{
int utf16le_len;
wchar_t *utf16le_string;
/*
* Map from the specified code page to UTF-16LE.
* First, find out how big a buffer we'll need.
*/
utf16le_len = MultiByteToWideChar(codepage, flags, cp_string, -1,
NULL, 0);
if (utf16le_len == 0) {
/*
* Error. Fail with EINVAL.
*/
errno = EINVAL;
return (NULL);
}
/*
* Now attempt to allocate a buffer for that.
*/
utf16le_string = malloc(utf16le_len * sizeof (wchar_t));
if (utf16le_string == NULL) {
/*
* Not enough memory; assume errno has been
* set, and fail.
*/
return (NULL);
}
/*
* Now convert.
*/
utf16le_len = MultiByteToWideChar(codepage, flags, cp_string, -1,
utf16le_string, utf16le_len);
if (utf16le_len == 0) {
/*
* Error. Fail with EINVAL.
* XXX - should this ever happen, given that
* we already ran the string through
* MultiByteToWideChar() to find out how big
* a buffer we needed?
*/
free(utf16le_string);
errno = EINVAL;
return (NULL);
}
return (utf16le_string);
}
char *
utf_16le_to_cp(UINT codepage, const wchar_t *utf16le_string)
{
int cp_len;
char *cp_string;
/*
* Map from UTF-16LE to the specified code page.
* First, find out how big a buffer we'll need.
* We convert composite characters to precomposed characters,
* as that's what Windows expects.
*/
cp_len = WideCharToMultiByte(codepage, WC_COMPOSITECHECK,
utf16le_string, -1, NULL, 0, NULL, NULL);
if (cp_len == 0) {
/*
* Error. Fail with EINVAL.
*/
errno = EINVAL;
return (NULL);
}
/*
* Now attempt to allocate a buffer for that.
*/
cp_string = malloc(cp_len * sizeof (char));
if (cp_string == NULL) {
/*
* Not enough memory; assume errno has been
* set, and fail.
*/
return (NULL);
}
/*
* Now convert.
*/
cp_len = WideCharToMultiByte(codepage, WC_COMPOSITECHECK,
utf16le_string, -1, cp_string, cp_len, NULL, NULL);
if (cp_len == 0) {
/*
* Error. Fail with EINVAL.
* XXX - should this ever happen, given that
* we already ran the string through
* WideCharToMultiByte() to find out how big
* a buffer we needed?
*/
free(cp_string);
errno = EINVAL;
return (NULL);
}
return (cp_string);
}
/*
* Convert an error message string from UTF-8 to the local code page, as
* best we can.
*
* The buffer is assumed to be PCAP_ERRBUF_SIZE bytes long; we truncate
* if it doesn't fit.
*/
void
utf_8_to_acp_truncated(char *errbuf)
{
wchar_t *utf_16_errbuf;
int retval;
DWORD err;
/*
* Do this by converting to UTF-16LE and then to the local
* code page. That means we get to use Microsoft's
* conversion routines, rather than having to understand
* all the code pages ourselves, *and* that this routine
* can convert in place.
*/
/*
* Map from UTF-8 to UTF-16LE.
* First, find out how big a buffer we'll need.
* Convert any invalid characters to REPLACEMENT CHARACTER.
*/
utf_16_errbuf = cp_to_utf_16le(CP_UTF8, errbuf, 0);
if (utf_16_errbuf == NULL) {
/*
* Error. Give up.
*/
snprintf(errbuf, PCAP_ERRBUF_SIZE,
"Can't convert error string to the local code page");
return;
}
/*
* Now, convert that to the local code page.
* Use the current thread's code page. For unconvertable
* characters, let it pick the "best fit" character.
*
* XXX - we'd like some way to do what utf_16le_to_utf_8_truncated()
* does if the buffer isn't big enough, but we don't want to have
* to handle all local code pages ourselves; doing so requires
* knowledge of all those code pages, including knowledge of how
* characters are formed in thoe code pages so that we can avoid
* cutting a multi-byte character into pieces.
*
* Converting to an un-truncated string using Windows APIs, and
* then copying to the buffer, still requires knowledge of how
* characters are formed in the target code page.
*/
retval = WideCharToMultiByte(CP_THREAD_ACP, 0, utf_16_errbuf, -1,
errbuf, PCAP_ERRBUF_SIZE, NULL, NULL);
if (retval == 0) {
err = GetLastError();
free(utf_16_errbuf);
if (err == ERROR_INSUFFICIENT_BUFFER)
snprintf(errbuf, PCAP_ERRBUF_SIZE,
"The error string, in the local code page, didn't fit in the buffer");
else
snprintf(errbuf, PCAP_ERRBUF_SIZE,
"Can't convert error string to the local code page");
return;
}
free(utf_16_errbuf);
}
#endif

View File

@ -38,7 +38,7 @@ PROJECT_NAME = "BearSSL"
# could be handy for archiving the generated documentation or if some version
# control system is used.
PROJECT_NUMBER =
PROJECT_NUMBER = 1.4.0
# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a
@ -771,7 +771,23 @@ WARN_LOGFILE =
# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING
# Note: If this tag is empty the current directory is searched.
INPUT = inc/bearssl.h inc/bearssl_aead.h inc/bearssl_block.h inc/bearssl_ec.h inc/bearssl_hash.h inc/bearssl_hmac.h inc/bearssl_kdf.h inc/bearssl_pem.h inc/bearssl_prf.h inc/bearssl_rand.h inc/bearssl_rsa.h inc/bearssl_ssl.h inc/bearssl_x509.h
INPUT = ../include \
../include/interfaces \
../include/opencsd/etmv3 \
../include/opencsd/etmv4 \
../include/opencsd/ptm \
../include/opencsd/c_api \
../include/opencsd/stm \
../include/mem_acc \
../../README.md \
. \
../../HOWTO.md \
../include/common \
./prog_guide \
../include/opencsd \
../include \
../tests/auto-fdo/autofdo.md \
../include/opencsd/ete
# This tag can be used to specify the character encoding of the source files
# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses

View File

@ -40,6 +40,7 @@
#define required_argument 1
#define optional_argument 2
#if 0
struct option {
/* name of long option */
const char *name;
@ -58,6 +59,8 @@ int getopt_long(int, char * const *, const char *,
const struct option *, int *);
int getopt_long_only(int, char * const *, const char *,
const struct option *, int *);
#endif
#ifndef _GETOPT_DEFINED_
#define _GETOPT_DEFINED_
int getopt(int, char * const *, const char *);

View File

@ -281,7 +281,8 @@ struct bpf_insn {
#endif
#define BPF_JUMP(code, k, jt, jf) { (u_short)(code), jt, jf, k }
#endif /* defined(__FreeBSD__) */
PCAP_AVAILABLE_0_4
PCAP_API u_int bpf_filter(const struct bpf_insn *, const u_char *, u_int, u_int);
PCAP_AVAILABLE_0_4
PCAP_API u_int bpf_filter(const struct bpf_insn *, const u_char *, u_int, u_int);

View File

@ -18,7 +18,7 @@ To email small changes, please run a POSIX shell command like
'diff -u old/europe new/europe >myfix.patch', and attach
'myfix.patch' to the email.
For more-elaborate or possibly-controversial changes,
For more-elaborate or possibly controversial changes,
such as renaming, adding or removing zones, please read
"Theory and pragmatics of the tz code and data"
<https://www.iana.org/time-zones/repository/theory.html>.

View File

@ -1,5 +1,116 @@
News for the tz database
Release 2023c - 2023-03-28 12:42:14 -0700
Changes to past and future timestamps
Model Lebanon's DST chaos by reverting data to tzdb 2023a.
(Thanks to Rany Hany for the heads-up.)
Release 2023b - 2023-03-23 19:50:38 -0700
Changes to future timestamps
This year Lebanon springs forward April 20/21 not March 25/26.
(Thanks to Saadallah Itani.) [This was reverted in 2023c.]
Release 2023a - 2023-03-22 12:39:33 -0700
Briefly:
Egypt now uses DST again, from April through October.
This year Morocco springs forward April 23, not April 30.
Palestine delays the start of DST this year.
Much of Greenland still uses DST from 2024 on.
America/Yellowknife now links to America/Edmonton.
tzselect can now use current time to help infer timezone.
The code now defaults to C99 or later.
Fix use of C23 attributes.
Changes to future timestamps
Starting in 2023, Egypt will observe DST from April's last Friday
through October's last Thursday. (Thanks to Ahmad ElDardiry.)
Assume the transition times are 00:00 and 24:00, respectively.
In 2023 Morocco's spring-forward transition after Ramadan
will occur April 23, not April 30. (Thanks to Milamber.)
Adjust predictions for future years accordingly. This affects
predictions for 2023, 2031, 2038, and later years.
This year Palestine will delay its spring forward from
March 25 to April 29 due to Ramadan. (Thanks to Heba Hamad.)
Make guesses for future Ramadans too.
Much of Greenland, represented by America/Nuuk, will continue to
observe DST using European Union rules. When combined with
Greenland's decision not to change the clocks in fall 2023,
America/Nuuk therefore changes from -03/-02 to -02/-01 effective
2023-10-29 at 01:00 UTC. (Thanks to Thomas M. Steenholdt.)
This change from 2022g doesn't affect timestamps until 2024-03-30,
and doesn't affect tm_isdst until 2023-03-25.
Changes to past timestamps
America/Yellowknife has changed from a Zone to a backward
compatibility Link, as it no longer differs from America/Edmonton
since 1970. (Thanks to Almaz Mingaleev.) This affects some
pre-1948 timestamps. The old data are now in 'backzone'.
Changes to past time zone abbreviations
When observing Moscow time, Europe/Kirov and Europe/Volgograd now
use the abbreviations MSK/MSD instead of numeric abbreviations,
for consistency with other timezones observing Moscow time.
Changes to code
You can now tell tzselect local time, to simplify later choices.
Select the 'time' option in its first prompt.
You can now compile with -DTZNAME_MAXIMUM=N to limit time zone
abbreviations to N bytes (default 255). The reference runtime
library now rejects POSIX-style TZ strings that contain longer
abbreviations, treating them as UTC. Previously the limit was
platform dependent and abbreviations were silently truncated to
16 bytes even when the limit was greater than 16.
The code by default is now designed for C99 or later. To build in
a C89 environment, compile with -DPORT_TO_C89. To support C89
callers of the tzcode library, compile with -DSUPPORT_C89. The
two new macros are transitional aids planned to be removed in a
future version, when C99 or later will be required.
The code now builds again on pre-C99 platforms, if you compile
with -DPORT_TO_C89. This fixes a bug introduced in 2022f.
On C23-compatible platforms tzcode no longer uses syntax like
'static [[noreturn]] void usage(void);'. Instead, it uses
'[[noreturn]] static void usage(void);' as strict C23 requires.
(Problem reported by Houge Langley.)
The code's functions now constrain their arguments with the C
'restrict' keyword consistently with their documentation.
This may allow future optimizations.
zdump again builds standalone with ckdadd and without setenv,
fixing a bug introduced in 2022g. (Problem reported by panic.)
leapseconds.awk can now process a leap seconds file that never
expires; this might be useful if leap seconds are discontinued.
Changes to commentary
tz-link.html has a new section "Coordinating with governments and
distributors". (Thanks to Neil Fuller for some of the text.)
To improve tzselect diagnostics, zone1970.tab's comments column is
now limited to countries that have multiple timezones.
Note that leap seconds are planned to be discontinued by 2035.
Release 2022g - 2022-11-29 08:58:31 -0800
Briefly:
@ -596,7 +707,7 @@ Release 2021b - 2021-09-24 16:23:00 -0700
Starting with 2020a, zic -L truncated its output according to the
"Expires" directive or "#expires" comment in the leapseconds file.
The resulting TZif files omitted daylight saving transitions after
the leap second table expired, which led to far less-accurate
the leap second table expired, which led to far less accurate
predictions of times after the expiry. Although future timestamps
cannot be converted accurately in the presence of leap seconds, it
is more accurate to convert near-future timestamps with a few
@ -616,7 +727,7 @@ Release 2021b - 2021-09-24 16:23:00 -0700
zic -L LEAPFILE -r @LO no longer generates an invalid TZif file
that omits leap second information for the range LO..B when LO
falls between two leap seconds A and B. Instead, it generates a
TZif version 4 file that represents the previously-missing
TZif version 4 file that represents the previously missing
information.
The TZif reader now allows the leap second table to begin with a
@ -670,7 +781,7 @@ Release 2021b - 2021-09-24 16:23:00 -0700
Fix a bug with 'zic -r @X' when X is a negative leap second that
has a nonnegative correction. Without the fix, the output file
was truncated so that X appeared to be a positive leap second.
Fix a similar, even-less-likely bug when truncating at a positive
Fix a similar, even less likely bug when truncating at a positive
leap second that has a nonpositive correction.
zic -r now reports an error if given rolling leap seconds, as this
@ -691,7 +802,7 @@ Release 2021b - 2021-09-24 16:23:00 -0700
fixing a bug introduced in 2014g.
zdump -v now outputs timestamps at boundaries of what localtime
and gmtime can represent, instead of the less-useful timestamps
and gmtime can represent, instead of the less useful timestamps
one day after the minimum and one day before the maximum.
(Thanks to Arthur David Olson for prototype code, and to Manuela
Friedrich for debugging help.)
@ -2311,7 +2422,7 @@ Release 2016g - 2016-09-13 08:56:38 -0700
names internally.
zdump has a new -i option to generate transitions in a
more-compact but still human-readable format. This option is
smaller but still human-readable format. This option is
experimental, and the output format may change in future versions.
(Thanks to Jon Skeet for suggesting that an option was needed,
and thanks to Tim Parenti and Chris Rovick for further comments.)
@ -2333,7 +2444,7 @@ Release 2016g - 2016-09-13 08:56:38 -0700
release 2016g, the version number is now something like
'2016g-23-g50556e3-dirty' instead of the misleading '2016g'.
Tagged releases use the same version number format as before,
e.g., '2016g'. To support the more-accurate version number, its
e.g., '2016g'. To support the more accurate version number, its
specification has moved from a line in the Makefile to a new
source file 'version'.
@ -2964,7 +3075,7 @@ Release 2014i - 2014-10-21 22:04:57 -0700
Since Belarus is not changing its clocks even though Moscow is,
the time zone abbreviation in Europe/Minsk is changing from FET
to its more-traditional value MSK on 2014-10-26 at 01:00.
to its more traditional value MSK on 2014-10-26 at 01:00.
(Thanks to Alexander Bokovoy for the heads-up about Belarus.)
The new abbreviation IDT stands for the pre-1976 use of UT +08 in
@ -3056,7 +3167,7 @@ Release 2014h - 2014-09-25 18:59:03 -0700
Changes affecting build procedure
'make check' now checks better for properly-sorted data.
'make check' now checks better for properly sorted data.
Changes affecting documentation and commentary
@ -3557,7 +3668,7 @@ Release 2014a - 2014-03-07 23:30:29 -0800
Changes affecting past timestamps
Fiji ended DST on 2014-01-19 at 02:00, not the previously-scheduled 03:00.
Fiji ended DST on 2014-01-19 at 02:00, not the previously scheduled 03:00.
(Thanks to Steffen Thorsen.)
Ukraine switched from Moscow to Eastern European time on 1990-07-01
@ -3811,7 +3922,7 @@ Release 2013e - 2013-09-19 23:50:04 -0700
Allow POSIX-like TZ strings where the transition time's hour can
range from -167 through 167, instead of the POSIX-required 0
through 24. E.g., TZ='FJT-12FJST,M10.3.1/146,M1.3.4/75' for the
new Fiji rules. This is a more-compact way to represent
new Fiji rules. This is a more compact way to represent
far-future timestamps for America/Godthab, America/Santiago,
Antarctica/Palmer, Asia/Gaza, Asia/Hebron, Asia/Jerusalem,
Pacific/Easter, and Pacific/Fiji. Other zones are unaffected by
@ -3819,7 +3930,7 @@ Release 2013e - 2013-09-19 23:50:04 -0700
Allow POSIX-like TZ strings where daylight saving time is in
effect all year. E.g., TZ='WART4WARST,J1/0,J365/25' for Western
Argentina Summer Time all year. This supports a more-compact way
Argentina Summer Time all year. This supports a more compact way
to represent the 2013d data for America/Argentina/San_Luis.
Because of the change for San Luis noted above this change does not
affect the current data. (Thanks to Andrew Main (Zefram) for
@ -3908,13 +4019,13 @@ Release 2013e - 2013-09-19 23:50:04 -0700
zdump now outputs "UT" when referring to Universal Time, not "UTC".
"UTC" does not make sense for timestamps that predate the introduction
of UTC, whereas "UT", a more-generic term, does. (Thanks to Steve Allen
of UTC, whereas "UT", a more generic term, does. (Thanks to Steve Allen
for clarifying UT vs UTC.)
Data changes affecting behavior of tzselect and similar programs
Country code BQ is now called the more-common name "Caribbean Netherlands"
rather than the more-official "Bonaire, St Eustatius & Saba".
Country code BQ is now called the more common name "Caribbean Netherlands"
rather than the more official "Bonaire, St Eustatius & Saba".
Remove from zone.tab the names America/Montreal, America/Shiprock,
and Antarctica/South_Pole, as they are equivalent to existing
@ -4098,7 +4209,7 @@ Release 2013c - 2013-04-19 16:17:40 -0700
Macquarie Island is politically part of Australia, not Antarctica.
(Thanks to Tobias Conradi.)
Sort Macquarie more-consistently with other parts of Australia.
Sort Macquarie more consistently with other parts of Australia.
(Thanks to Tim Parenti.)
@ -5322,7 +5433,7 @@ Release data1998g - 1998-08-11 03:28:35 -0000
Release data1998f - 1998-07-20 13:50:00 -0000
[tzdata1998f.tar.gz is missing!]
Update the "leapseconds" file to include the newly-announced
Update the "leapseconds" file to include the newly announced
insertion at the end of 1998.

View File

@ -23,7 +23,7 @@
<li><a href="#stability">Interface stability</a></li>
<li><a href="#leapsec">Leap seconds</a></li>
<li><a href="#calendar">Calendrical issues</a></li>
<li><a href="#planets">Time and time zones on other planets</a></li>
<li><a href="#planets">Time and time zones off earth</a></li>
</ul>
</nav>
@ -443,11 +443,11 @@ in decreasing order of importance:
CAT/CAST Central Africa,
CET/CEST/CEMT Central European,
ChST Chamorro,
CST/CDT/CWT/CPT/CDDT Central [North America],
CST/CDT/CWT/CPT Central [North America],
CST/CDT China,
GMT/BST/IST/BDST Greenwich,
EAT East Africa,
EST/EDT/EWT/EPT/EDDT Eastern [North America],
EST/EDT/EWT/EPT Eastern [North America],
EET/EEST Eastern European,
GST/GDT Guam,
HST/HDT/HWT/HPT Hawaii,
@ -460,13 +460,13 @@ in decreasing order of importance:
MET/MEST Middle European (a backward-compatibility alias for
Central European),
MSK/MSD Moscow,
MST/MDT/MWT/MPT/MDDT Mountain,
MST/MDT/MWT/MPT Mountain,
NST/NDT/NWT/NPT/NDDT Newfoundland,
NST/NDT/NWT/NPT Nome,
NZMT/NZST New Zealand through 1945,
NZST/NZDT New Zealand 1946&ndash;present,
PKT/PKST Pakistan,
PST/PDT/PWT/PPT/PDDT Pacific,
PST/PDT/PWT/PPT Pacific,
PST/PDT Philippine,
SAST South Africa,
SST Samoa,
@ -494,7 +494,7 @@ in decreasing order of importance:
<p>
<small>These abbreviations are:
AMT Asunción, Athens;
BMT Baghdad, Bangkok, Batavia, Bermuda, Bern, Bogotá, Bridgetown,
BMT Baghdad, Bangkok, Batavia, Bermuda, Bern, Bogotá,
Brussels, Bucharest;
CMT Calamarca, Caracas, Chisinau, Colón, Córdoba;
DMT Dublin/Dunsink;
@ -506,12 +506,13 @@ in decreasing order of importance:
IMT Irkutsk, Istanbul;
JMT Jerusalem;
KMT Kaunas, Kyiv, Kingston;
LMT Lima, Lisbon, local, Luanda;
LMT Lima, Lisbon, local;
MMT Macassar, Madras, Malé, Managua, Minsk, Monrovia, Montevideo,
Moratuwa, Moscow;
PLMT Phù Liễn;
PMT Paramaribo, Paris, Perm, Pontianak, Prague;
PMMT Port Moresby;
PPMT Port-au-Prince;
QMT Quito;
RMT Rangoon, Riga, Rome;
SDMT Santo Domingo;
@ -519,8 +520,7 @@ in decreasing order of importance:
SMT Santiago, Simferopol, Singapore, Stanley;
TBMT Tbilisi;
TMT Tallinn, Tehran;
WMT Warsaw;
ZMT Zomba.</small>
WMT Warsaw.</small>
</p>
<p>
@ -791,7 +791,7 @@ href="https://www.dissentmagazine.org/blog/booked-a-global-history-of-time-vanes
with days starting at midnight.
Although <abbr>UT</abbr> equals <abbr>UTC</abbr> for modern
timestamps, <abbr>UTC</abbr> was not defined until 1960, so
commentary uses the more-general abbreviation <abbr>UT</abbr> for
commentary uses the more general abbreviation <abbr>UT</abbr> for
timestamps that might predate 1960.
Since <abbr>UT</abbr>, <abbr>UT1</abbr>, etc. disagree slightly,
and since pre-1972 <abbr>UTC</abbr> seconds varied in length,
@ -818,7 +818,8 @@ href="https://www.dissentmagazine.org/blog/booked-a-global-history-of-time-vanes
<li>
The relationship between POSIX time (that is, <abbr>UTC</abbr> but
ignoring <a href="https://en.wikipedia.org/wiki/Leap_second">leap
seconds</a>) and <abbr>UTC</abbr> is not agreed upon after 1972.
seconds</a>) and <abbr>UTC</abbr> is not agreed upon.
This affects time stamps during the leap second era (1972&ndash;2035).
Although the POSIX
clock officially stops during an inserted leap second, at least one
proposed standard has it jumping back a second instead; and in
@ -877,7 +878,7 @@ an older <code>zic</code>.
is error-prone in practice.
Also, POSIX <code>TZ</code> strings cannot deal with daylight
saving time rules not based on the Gregorian calendar (as in
Iran), or with situations where more than two time zone
Morocco), or with situations where more than two time zone
abbreviations or <abbr>UT</abbr> offsets are used in an area.
</p>
@ -913,8 +914,8 @@ an older <code>zic</code>.
<dt><var>date</var>[<code>/</code><var>time</var>]<code>,</code><var>date</var>[<code>/</code><var>time</var>]</dt><dd>
specifies the beginning and end of <abbr>DST</abbr>.
If this is absent, the system supplies its own ruleset
for <abbr>DST</abbr>, and its rules can differ from year to year;
typically <abbr>US</abbr> <abbr>DST</abbr> rules are used.
for <abbr>DST</abbr>, typically current <abbr>US</abbr>
<abbr>DST</abbr> rules.
</dd>
<dt><var>time</var></dt><dd>
takes the form
@ -974,10 +975,11 @@ an older <code>zic</code>.
Traditionally the current <abbr>US</abbr> <abbr>DST</abbr> rules
were used to interpret such values, but this meant that the
<abbr>US</abbr> <abbr>DST</abbr> rules were compiled into each
program that did time conversion. This meant that when
time conversion package, and when
<abbr>US</abbr> time conversion rules changed (as in the United
States in 1987), all programs that did time conversion had to be
recompiled to ensure proper results.
States in 1987 and again in 2007), all packages that
interpreted <code>TZ</code> values had to be updated
to ensure proper results.
</li>
<li>
The <code>TZ</code> environment variable is process-global, which
@ -1173,7 +1175,7 @@ The vestigial <abbr>API</abbr>s are:
</li>
<li>
The functions that are conditionally compiled
if <code>STD_INSPIRED</code> is defined should, at this point, be
if <code>STD_INSPIRED</code> is nonzero should, at this point, be
looked on primarily as food for thought.
They are not in any sense "standard compatible" &ndash; some are
not, in fact, specified in <em>any</em> standard.
@ -1240,7 +1242,7 @@ The <code><abbr>tz</abbr></code> code and data supply the following interfaces:
Interface changes in a release attempt to preserve compatibility with
recent releases.
For example, <code><abbr>tz</abbr></code> data files typically do not
rely on recently-added <code>zic</code> features, so that users can
rely on recently added <code>zic</code> features, so that users can
run older <code>zic</code> versions to process newer data files.
<a href="tz-link.html#download">Downloading
the <code><abbr>tz</abbr></code> database</a> describes how releases
@ -1268,6 +1270,18 @@ between now and the future time.
<section>
<h2 id="leapsec">Leap seconds</h2>
<p>
Leap seconds were introduced in 1972 to accommodate the
difference between atomic time and the less regular rotation of the earth.
Unfortunately they caused so many problems with civil
timekeeping that they
are <a href="https://www.bipm.org/en/cgpm-2022/resolution-4">planned
to be discontinued by 2035</a>, with some as-yet-undetermined
mechanism replacing them, perhaps after the year 2135.
Despite their impending obsolescence, a record of leap seconds is still
needed to resolve timestamps from 1972 through 2035.
</p>
<p>
The <code><abbr>tz</abbr></code> code and data can account for leap seconds,
thanks to code contributed by Bradley White.
@ -1282,12 +1296,12 @@ commonly used by
<a href="https://www.ntp.org"><abbr title="Network Time Protocol">NTP</abbr></a>
software that adjusts the kernel clock.
However, kernel-clock twiddling approximates UTC only roughly,
and systems needing more-precise UTC can use this package's leap
and systems needing more precise UTC can use this package's leap
second support directly.
</p>
<p>
The directly-supported mechanism assumes that <code>time_t</code>
The directly supported mechanism assumes that <code>time_t</code>
counts of seconds since the POSIX epoch normally include leap seconds,
as opposed to POSIX <code>time_t</code> counts which exclude leap seconds.
This modified timescale is converted to <abbr>UTC</abbr>
@ -1348,7 +1362,15 @@ They sometimes disagree.
</section>
<section>
<h2 id="planets">Time and time zones on other planets</h2>
<h2 id="planets">Time and time zones off Earth</h2>
<p>
The European Space Agency is <a
href='https://www.esa.int/Applications/Navigation/Telling_time_on_the_Moon'>considering</a>
the establishment of a reference timescale for the Moon, which has
days roughly equivalent to 29.5 Earth days, and where relativistic
effects cause clocks to tick slightly faster than on Earth.
</p>
<p>
Some people's work schedules have used
<a href="https://en.wikipedia.org/wiki/Timekeeping_on_Mars">Mars time</a>.

View File

@ -1 +1 @@
2022g
2023c

View File

@ -196,7 +196,12 @@ io_sandbox_enter(int src_fd)
goto error;
if (cap_rights_limit(src_fd, cap_rights_init(&rights,
CAP_EVENT, CAP_FCNTL, CAP_LOOKUP, CAP_READ, CAP_SEEK)))
CAP_EVENT, CAP_FCNTL, CAP_LOOKUP, CAP_READ, CAP_SEEK)) < 0 &&
errno != ENOSYS)
goto error;
if (src_fd != STDIN_FILENO && cap_rights_limit(
STDIN_FILENO, cap_rights_clear(&rights)))
goto error;
if (src_fd != STDIN_FILENO && cap_rights_limit(
@ -205,7 +210,7 @@ io_sandbox_enter(int src_fd)
if (cap_rights_limit(STDOUT_FILENO, cap_rights_init(&rights,
CAP_EVENT, CAP_FCNTL, CAP_FSTAT, CAP_LOOKUP,
CAP_WRITE, CAP_SEEK)))
CAP_WRITE, CAP_SEEK)) < 0 && errno != ENOSYS)
goto error;
if (cap_rights_limit(STDERR_FILENO, cap_rights_init(&rights,

View File

@ -0,0 +1,213 @@
########################################################
# Copyright 2015 ARM Limited. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
#
# 3. Neither the name of the copyright holder nor the names of its contributors
# may be used to endorse or promote products derived from this software without
# specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS' AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
#################################################################################
# OpenCSD - master makefile for libraries and tests
#
# command line options
# DEBUG=1 create a debug build
#
# Set project root - relative to build makefile
ifeq ($(OCSD_ROOT),)
OCSD_ROOT := $(shell echo $(dir $(abspath $(lastword $(MAKEFILE_LIST)))) | sed 's,/build/linux.*,,')
export OCSD_ROOT
endif
# library names
LIB_BASE_NAME=opencsd
export LIB_BASE_NAME
LIB_CAPI_NAME=$(LIB_BASE_NAME)_c_api
export LIB_CAPI_NAME
# source root directories
export OCSD_LIB_ROOT=$(OCSD_ROOT)/lib
export OCSD_INCLUDE=$(OCSD_ROOT)/include
export OCSD_SOURCE=$(OCSD_ROOT)/source
export OCSD_TESTS=$(OCSD_ROOT)/tests
export LIB_UAPI_INC_DIR=opencsd
# tools
export MASTER_CC=$(CROSS_COMPILE)gcc
export MASTER_CXX=$(CROSS_COMPILE)g++
export MASTER_LINKER=$(CROSS_COMPILE)g++
export MASTER_LIB=$(CROSS_COMPILE)ar
export INSTALL=install
# installation directory
PREFIX ?=/usr
LIB_PATH ?= lib
INSTALL_LIB_DIR=$(DESTDIR)$(PREFIX)/$(LIB_PATH)
INSTALL_BIN_DIR=$(DESTDIR)$(PREFIX)/bin
export INSTALL_INCLUDE_DIR=$(DESTDIR)$(PREFIX)/include/
INSTALL_MAN_DIR=$(DESTDIR)$(PREFIX)/share/man/man1
# compile flags
CFLAGS += $(CPPFLAGS) -c -Wall -DLINUX -Wno-switch -Wlogical-op -fPIC
CXXFLAGS += $(CPPFLAGS) -c -Wall -DLINUX -Wno-switch -Wlogical-op -fPIC -std=c++11
LDFLAGS += -Wl,-z,defs
ARFLAGS ?= rcs
# debug variant
ifdef DEBUG
CFLAGS += -g -O0 -DDEBUG
CXXFLAGS += -g -O0 -DDEBUG
BUILD_VARIANT=dbg
else
CFLAGS += -O2 -DNDEBUG
CXXFLAGS += -O2 -DNDEBUG
BUILD_VARIANT=rel
endif
# export build flags
export CFLAGS
export CXXFLAGS
export LDFLAGS
export ARFLAGS
# target directories - fixed for default packaging build
PLAT_DIR ?= builddir
export PLAT_DIR
export LIB_TARGET_DIR=$(OCSD_LIB_ROOT)/$(PLAT_DIR)
export LIB_TEST_TARGET_DIR=$(OCSD_TESTS)/lib/$(PLAT_DIR)
export BIN_TEST_TARGET_DIR=$(OCSD_TESTS)/bin/$(PLAT_DIR)
# Fish version out of header file (converting from hex)
getver:=printf "%d" $$(awk '/\#define VARNAME/ { print $$3 }' $(OCSD_ROOT)/include/opencsd/ocsd_if_version.h)
export SO_MAJOR_VER := $(shell $(subst VARNAME,OCSD_VER_MAJOR,$(getver)))
SO_MINOR_VER := $(shell $(subst VARNAME,OCSD_VER_MINOR,$(getver)))
SO_PATCH_VER := $(shell $(subst VARNAME,OCSD_VER_PATCH,$(getver)))
export SO_VER := $(SO_MAJOR_VER).$(SO_MINOR_VER).$(SO_PATCH_VER)
###########################################################
# build targets
all: libs tests
libs: $(LIB_BASE_NAME)_lib $(LIB_CAPI_NAME)_lib
DEF_SO_PERM ?= 644
install: libs tests
mkdir -p $(INSTALL_LIB_DIR) $(INSTALL_INCLUDE_DIR) $(INSTALL_BIN_DIR)
cp -d $(LIB_TARGET_DIR)/lib$(LIB_BASE_NAME).so $(INSTALL_LIB_DIR)/
cp -d $(LIB_TARGET_DIR)/lib$(LIB_BASE_NAME).so.$(SO_MAJOR_VER) $(INSTALL_LIB_DIR)/
$(INSTALL) --mode=$(DEF_SO_PERM) $(LIB_TARGET_DIR)/lib$(LIB_BASE_NAME).so.$(SO_VER) $(INSTALL_LIB_DIR)/
cp -d $(LIB_TARGET_DIR)/lib$(LIB_CAPI_NAME).so $(INSTALL_LIB_DIR)/
cp -d $(LIB_TARGET_DIR)/lib$(LIB_CAPI_NAME).so.$(SO_MAJOR_VER) $(INSTALL_LIB_DIR)/
$(INSTALL) --mode=$(DEF_SO_PERM) $(LIB_TARGET_DIR)/lib$(LIB_CAPI_NAME).so.$(SO_VER) $(INSTALL_LIB_DIR)/
ifndef DISABLE_STATIC
$(INSTALL) --mode=644 $(LIB_TARGET_DIR)/lib$(LIB_BASE_NAME).a $(INSTALL_LIB_DIR)/
$(INSTALL) --mode=644 $(LIB_TARGET_DIR)/lib$(LIB_CAPI_NAME).a $(INSTALL_LIB_DIR)/
endif
cd $(OCSD_ROOT)/build/linux/rctdl_c_api_lib && make install_inc
$(INSTALL) --mode=755 $(BIN_TEST_TARGET_DIR)/trc_pkt_lister $(INSTALL_BIN_DIR)/
install_man:
mkdir -p $(INSTALL_MAN_DIR)
$(INSTALL) --mode=644 $(OCSD_ROOT)/docs/man/trc_pkt_lister.1 $(INSTALL_MAN_DIR)/
################################
# build OpenCSD trace decode library
#
$(LIB_BASE_NAME)_lib: $(LIB_TARGET_DIR)/lib$(LIB_BASE_NAME).a $(LIB_TARGET_DIR)/lib$(LIB_BASE_NAME).so
$(LIB_TARGET_DIR)/lib$(LIB_BASE_NAME).so: $(LIB_BASE_NAME)_all
$(LIB_TARGET_DIR)/lib$(LIB_BASE_NAME).a: $(LIB_BASE_NAME)_all
# single command builds both .a and .so targets in sub-makefile
$(LIB_BASE_NAME)_all:
mkdir -p $(LIB_TARGET_DIR)
cd $(OCSD_ROOT)/build/linux/ref_trace_decode_lib && $(MAKE)
################################
# build OpenCSD trace decode C API library
#
$(LIB_CAPI_NAME)_lib: $(LIB_TARGET_DIR)/lib$(LIB_CAPI_NAME).a $(LIB_TARGET_DIR)/lib$(LIB_CAPI_NAME).so
$(LIB_TARGET_DIR)/lib$(LIB_CAPI_NAME).so: $(LIB_CAPI_NAME)_all
$(LIB_TARGET_DIR)/lib$(LIB_CAPI_NAME).a: $(LIB_CAPI_NAME)_all
# single command builds both .a and .so targets in sub-makefile
$(LIB_CAPI_NAME)_all: $(LIB_BASE_NAME)_lib
mkdir -p $(LIB_TARGET_DIR)
cd $(OCSD_ROOT)/build/linux/rctdl_c_api_lib && $(MAKE)
#################################
# build tests
.PHONY: tests
tests: libs
cd $(OCSD_ROOT)/tests/build/linux/echo_test_dcd_lib && $(MAKE)
cd $(OCSD_ROOT)/tests/build/linux/snapshot_parser_lib && $(MAKE)
cd $(OCSD_ROOT)/tests/build/linux/trc_pkt_lister && $(MAKE)
cd $(OCSD_ROOT)/tests/build/linux/c_api_pkt_print_test && $(MAKE)
cd $(OCSD_ROOT)/tests/build/linux/mem_buffer_eg && $(MAKE)
cd $(OCSD_ROOT)/tests/build/linux/frame_demux_test && $(MAKE)
#
# build docs
.PHONY: docs
docs:
(cd $(OCSD_ROOT)/docs; doxygen doxygen_config.dox)
#############################################################
# clean targets
#
clean: clean_libs clean_tests clean_docs
.PHONY: clean_libs clean_tests clean_docs clean_install
clean_libs:
cd $(OCSD_ROOT)/build/linux/ref_trace_decode_lib && $(MAKE) clean
cd $(OCSD_ROOT)/build/linux/rctdl_c_api_lib && $(MAKE) clean
clean_tests:
cd $(OCSD_ROOT)/tests/build/linux/echo_test_dcd_lib && $(MAKE) clean
cd $(OCSD_ROOT)/tests/build/linux/snapshot_parser_lib && $(MAKE) clean
cd $(OCSD_ROOT)/tests/build/linux/trc_pkt_lister && $(MAKE) clean
cd $(OCSD_ROOT)/tests/build/linux/c_api_pkt_print_test && $(MAKE) clean
cd $(OCSD_ROOT)/tests/build/linux/mem_buffer_eg && $(MAKE) clean
cd $(OCSD_ROOT)/tests/build/linux/frame_demux_test && $(MAKE) clean
-rmdir $(OCSD_TESTS)/lib
clean_docs:
-rm -r $(OCSD_ROOT)/docs/html
clean_install:
-rm $(INSTALL_LIB_DIR)/lib$(LIB_BASE_NAME).*
-rm $(INSTALL_LIB_DIR)/lib$(LIB_CAPI_NAME).*
-rm -r $(INSTALL_INCLUDE_DIR)/$(LIB_UAPI_INC_DIR)
-rm $(INSTALL_BIN_DIR)/trc_pkt_lister
-rm $(INSTALL_MAN_DIR)/trc_pkt_lister.1

View File

@ -0,0 +1,70 @@
########################################################
# Copyright 2018 ARM Limited. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
#
# 3. Neither the name of the copyright holder nor the names of its contributors
# may be used to endorse or promote products derived from this software without
# specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS' AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
#################################################################################
## Set up some addtional parameters for development environment builds. ##
## define arch/build sub-dirs for non installed dev builds
ifndef ARCH
ARCH := $(shell dpkg-architecture -q DEB_HOST_GNU_CPU || echo not)
endif
# platform bit size variant
ifeq ($(ARCH),x86)
MFLAG:="-m32"
BIT_VARIANT=32
else ifeq ($(ARCH),x86_64)
MFLAG:="-m64"
BIT_VARIANT=64
else ifeq ($(ARCH),arm)
BIT_VARIANT=-arm
else ifeq ($(ARCH),arm64)
BIT_VARIANT=-arm64
else ifeq ($(ARCH),aarch64)
BIT_VARIANT=-arm64
else ifeq ($(ARCH),aarch32)
BIT_VARIANT=-arm
endif
CXXFLAGS += $(MFLAG)
CFLAGS += $(MFLAG)
LDFLAGS += $(MFLAG)
ifdef GCCDIR
GCCVER:= $(shell $(CROSS_COMPILE)gcc -dumpversion | cut -c 1-3)
PLAT_DIR=builddir/linux$(BIT_VARIANT)/GCC_$(GCCVER)
else
PLAT_DIR=linux$(BIT_VARIANT)/$(BUILD_VARIANT)
endif
# for dev env, enable static link build test
export TEST_STATIC_LINKING=1
# include the main makefile
include makefile

View File

@ -0,0 +1,123 @@
########################################################
# Copyright 2015 ARM Limited. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
#
# 3. Neither the name of the copyright holder nor the names of its contributors
# may be used to endorse or promote products derived from this software without
# specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS' AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
#################################################################################
# OpenCSD - makefile for C API wrapper library
#
CXX := $(MASTER_CXX)
LINKER := $(MASTER_LINKER)
LIB := $(MASTER_LIB)
LIB_NAME = lib$(LIB_CAPI_NAME)
SO_LIB_DEPS= -L$(LIB_TARGET_DIR) -l$(LIB_BASE_NAME)
BUILD_DIR=./$(PLAT_DIR)
VPATH= $(OCSD_SOURCE)/c_api
CXX_INCLUDES= \
-I$(OCSD_INCLUDE) \
-I$(OCSD_SOURCE)/c_api
OBJECTS=$(BUILD_DIR)/ocsd_c_api.o \
$(BUILD_DIR)/ocsd_c_api_custom_obj.o
INST_INC_SRC=$(OCSD_INCLUDE)/$(LIB_UAPI_INC_DIR)
INST_INC_DST=$(INSTALL_INCLUDE_DIR)/$(LIB_UAPI_INC_DIR)
all: links
links: $(LIB_TARGET_DIR)/$(LIB_NAME).so.$(SO_MAJOR_VER) $(LIB_TARGET_DIR)/$(LIB_NAME).so
.PHONY: links
LIBS:= $(LIB_TARGET_DIR)/$(LIB_NAME).a $(LIB_TARGET_DIR)/$(LIB_NAME).so.$(SO_VER)
$(LIB_TARGET_DIR):
mkdir -p $(LIB_TARGET_DIR)
$(BUILD_DIR):
mkdir -p $(BUILD_DIR)
$(LIB_TARGET_DIR)/$(LIB_NAME).a: $(OBJECTS) | $(BUILD_DIR) $(LIB_TARGET_DIR)
$(LIB) $(ARFLAGS) $(LIB_TARGET_DIR)/$(LIB_NAME).a $(OBJECTS)
$(LIB_TARGET_DIR)/$(LIB_NAME).so.$(SO_VER): $(OBJECTS) | $(BUILD_DIR) $(LIB_TARGET_DIR)
$(LINKER) $(LDFLAGS) -shared -o $(LIB_TARGET_DIR)/$(LIB_NAME).so.$(SO_VER) -Wl,-soname,$(LIB_NAME).so.$(SO_MAJOR_VER) $(OBJECTS) $(SO_LIB_DEPS)
$(LIB_TARGET_DIR)/$(LIB_NAME).so.$(SO_MAJOR_VER): $(LIBS) | $(LIB_TARGET_DIR)
( cd $(LIB_TARGET_DIR); ln -sf $(LIB_NAME).so.$(SO_VER) $(LIB_NAME).so.$(SO_MAJOR_VER) )
$(LIB_TARGET_DIR)/$(LIB_NAME).so: $(LIB_TARGET_DIR)/$(LIB_NAME).so.$(SO_MAJOR_VER) | $(LIB_TARGET_DIR)
( cd $(LIB_TARGET_DIR); ln -sf $(LIB_NAME).so.$(SO_MAJOR_VER) $(LIB_NAME).so )
##### build rules
## object dependencies
DEPS := $(OBJECTS:%.o=%.d)
-include $(DEPS)
## object compile
$(BUILD_DIR)/%.o : %.cpp | $(BUILD_DIR)
$(CXX) $(CXXFLAGS) $(CXX_INCLUDES) -MMD $< -o $@
#### clean
.PHONY: clean
clean:
rm -f $(OBJECTS)
rm -f $(DEPS)
rm -f $(LIB_TARGET_DIR)/$(LIB_NAME).a
rm -f $(LIB_TARGET_DIR)/$(LIB_NAME).so*
-rmdir $(BUILD_DIR)
#### install the necessary include files for the c-api library on linux
install_inc:
$(INSTALL) -d --mode=0755 $(INST_INC_DST)/
$(INSTALL) --mode=0644 $(INST_INC_SRC)/trc_gen_elem_types.h $(INST_INC_DST)/
$(INSTALL) --mode=0644 $(INST_INC_SRC)/ocsd_if_types.h $(INST_INC_DST)/
$(INSTALL) --mode=0644 $(INST_INC_SRC)/ocsd_if_version.h $(INST_INC_DST)/
$(INSTALL) --mode=0644 $(INST_INC_SRC)/trc_pkt_types.h $(INST_INC_DST)/
$(INSTALL) -d --mode=0755 $(INST_INC_DST)/ptm
$(INSTALL) --mode=0644 $(INST_INC_SRC)/ptm/trc_pkt_types_ptm.h $(INST_INC_DST)/ptm/
$(INSTALL) -d --mode=0755 $(INST_INC_DST)/stm
$(INSTALL) --mode=0644 $(INST_INC_SRC)/stm/trc_pkt_types_stm.h $(INST_INC_DST)/stm/
$(INSTALL) -d --mode=0755 $(INST_INC_DST)/etmv3
$(INSTALL) --mode=0644 $(INST_INC_SRC)/etmv3/trc_pkt_types_etmv3.h $(INST_INC_DST)/etmv3/
$(INSTALL) -d --mode=0755 $(INST_INC_DST)/etmv4
$(INSTALL) --mode=0644 $(INST_INC_SRC)/etmv4/trc_pkt_types_etmv4.h $(INST_INC_DST)/etmv4/
$(INSTALL) -d --mode=0755 $(INST_INC_DST)/ete
$(INSTALL) --mode=0644 $(INST_INC_SRC)/ete/trc_pkt_types_ete.h $(INST_INC_DST)/ete/
$(INSTALL) -d --mode=0755 $(INST_INC_DST)/c_api
$(INSTALL) --mode=0644 $(INST_INC_SRC)/c_api/ocsd_c_api_types.h $(INST_INC_DST)/c_api/
$(INSTALL) --mode=0644 $(INST_INC_SRC)/c_api/opencsd_c_api.h $(INST_INC_DST)/c_api/
$(INSTALL) --mode=0644 $(INST_INC_SRC)/c_api/ocsd_c_api_custom.h $(INST_INC_DST)/c_api/

View File

@ -0,0 +1,160 @@
########################################################
# Copyright 2015 ARM Limited. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
#
# 3. Neither the name of the copyright holder nor the names of its contributors
# may be used to endorse or promote products derived from this software without
# specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS' AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
#################################################################################
# OpenCSD - makefile for main trace decode library
#
CXX := $(MASTER_CXX)
LINKER := $(MASTER_LINKER)
LIB := $(MASTER_LIB)
LIB_NAME= lib$(LIB_BASE_NAME)
BUILD_DIR=./$(PLAT_DIR)
VPATH= $(OCSD_SOURCE) \
$(OCSD_SOURCE)/etmv3 \
$(OCSD_SOURCE)/etmv4 \
$(OCSD_SOURCE)/ete \
$(OCSD_SOURCE)/ptm \
$(OCSD_SOURCE)/i_dec \
$(OCSD_SOURCE)/mem_acc \
$(OCSD_SOURCE)/stm \
$(OCSD_SOURCE)/pkt_printers
CXX_INCLUDES= \
-I$(OCSD_INCLUDE) \
-I$(OCSD_SOURCE)
ETMV3OBJ= $(BUILD_DIR)/trc_cmp_cfg_etmv3.o \
$(BUILD_DIR)/trc_pkt_decode_etmv3.o \
$(BUILD_DIR)/trc_pkt_elem_etmv3.o \
$(BUILD_DIR)/trc_pkt_proc_etmv3.o \
$(BUILD_DIR)/trc_pkt_proc_etmv3_impl.o
ETMV4OBJ= $(BUILD_DIR)/trc_cmp_cfg_etmv4.o \
$(BUILD_DIR)/trc_etmv4_stack_elem.o \
$(BUILD_DIR)/trc_pkt_proc_etmv4i.o \
$(BUILD_DIR)/trc_pkt_decode_etmv4i.o \
$(BUILD_DIR)/trc_pkt_elem_etmv4i.o \
$(BUILD_DIR)/trc_cmp_cfg_ete.o
PTMOBJ= $(BUILD_DIR)/trc_cmp_cfg_ptm.o \
$(BUILD_DIR)/trc_pkt_elem_ptm.o \
$(BUILD_DIR)/trc_pkt_proc_ptm.o \
$(BUILD_DIR)/trc_pkt_decode_ptm.o
IDECOBJ= $(BUILD_DIR)/trc_i_decode.o \
$(BUILD_DIR)/trc_idec_arminst.o
MEMACCOBJ= $(BUILD_DIR)/trc_mem_acc_mapper.o \
$(BUILD_DIR)/trc_mem_acc_bufptr.o \
$(BUILD_DIR)/trc_mem_acc_file.o \
$(BUILD_DIR)/trc_mem_acc_base.o \
$(BUILD_DIR)/trc_mem_acc_cb.o \
$(BUILD_DIR)/trc_mem_acc_cache.o
STMOBJ= $(BUILD_DIR)/trc_pkt_elem_stm.o \
$(BUILD_DIR)/trc_pkt_proc_stm.o \
$(BUILD_DIR)/trc_pkt_decode_stm.o
PKTPRNTOBJ= $(BUILD_DIR)/raw_frame_printer.o \
$(BUILD_DIR)/trc_print_fact.o
OBJECTS=$(BUILD_DIR)/ocsd_code_follower.o \
$(BUILD_DIR)/ocsd_dcd_tree.o \
$(BUILD_DIR)/ocsd_error.o \
$(BUILD_DIR)/ocsd_error_logger.o \
$(BUILD_DIR)/ocsd_gen_elem_list.o \
$(BUILD_DIR)/ocsd_gen_elem_stack.o \
$(BUILD_DIR)/ocsd_lib_dcd_register.o \
$(BUILD_DIR)/ocsd_msg_logger.o \
$(BUILD_DIR)/ocsd_version.o \
$(BUILD_DIR)/trc_component.o \
$(BUILD_DIR)/trc_core_arch_map.o \
$(BUILD_DIR)/trc_frame_deformatter.o \
$(BUILD_DIR)/trc_gen_elem.o \
$(BUILD_DIR)/trc_printable_elem.o \
$(BUILD_DIR)/trc_ret_stack.o \
$(ETMV3OBJ) \
$(ETMV4OBJ) \
$(IDECOBJ) \
$(MEMACCOBJ) \
$(STMOBJ) \
$(PTMOBJ) \
$(PKTPRNTOBJ)
all: links
links: $(LIB_TARGET_DIR)/$(LIB_NAME).so.$(SO_MAJOR_VER) $(LIB_TARGET_DIR)/$(LIB_NAME).so
.PHONY: links
LIBS:= $(LIB_TARGET_DIR)/$(LIB_NAME).a $(LIB_TARGET_DIR)/$(LIB_NAME).so.$(SO_VER)
$(LIB_TARGET_DIR):
mkdir -p $(LIB_TARGET_DIR)
$(BUILD_DIR):
mkdir -p $(BUILD_DIR)
$(LIB_TARGET_DIR)/$(LIB_NAME).a: $(OBJECTS) | $(BUILD_DIR) $(LIB_TARGET_DIR)
$(LIB) $(ARFLAGS) $(LIB_TARGET_DIR)/$(LIB_NAME).a $(OBJECTS)
$(LIB_TARGET_DIR)/$(LIB_NAME).so.$(SO_VER): $(OBJECTS) | $(BUILD_DIR) $(LIB_TARGET_DIR)
$(LINKER) $(LDFLAGS) -shared -o $(LIB_TARGET_DIR)/$(LIB_NAME).so.$(SO_VER) -Wl,-soname,$(LIB_NAME).so.$(SO_MAJOR_VER) $(OBJECTS)
$(LIB_TARGET_DIR)/$(LIB_NAME).so.$(SO_MAJOR_VER): $(LIBS) | $(LIB_TARGET_DIR)
( cd $(LIB_TARGET_DIR); ln -sf $(LIB_NAME).so.$(SO_VER) $(LIB_NAME).so.$(SO_MAJOR_VER) )
$(LIB_TARGET_DIR)/$(LIB_NAME).so: $(LIB_TARGET_DIR)/$(LIB_NAME).so.$(SO_MAJOR_VER) | $(LIB_TARGET_DIR)
( cd $(LIB_TARGET_DIR); ln -sf $(LIB_NAME).so.$(SO_MAJOR_VER) $(LIB_NAME).so )
##### build rules
## object dependencies
DEPS := $(OBJECTS:%.o=%.d)
-include $(DEPS)
## object compile
$(BUILD_DIR)/%.o : %.cpp | $(BUILD_DIR)
$(CXX) $(CXXFLAGS) $(CXX_INCLUDES) -MMD $< -o $@
#### clean
.PHONY: clean
clean:
rm -f $(OBJECTS)
rm -f $(DEPS)
rm -f $(LIB_TARGET_DIR)/$(LIB_NAME).a
rm -f $(LIB_TARGET_DIR)/$(LIB_NAME).so*
-rmdir $(BUILD_DIR)

View File

@ -0,0 +1,460 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug-dll|Win32">
<Configuration>Debug-dll</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug-dll|x64">
<Configuration>Debug-dll</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release-dll|Win32">
<Configuration>Release-dll</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release-dll|x64">
<Configuration>Release-dll</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{7F500891-CC76-405F-933F-F682BC39F923}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>ref_trace_decode_lib</RootNamespace>
<ProjectName>opencsd_lib</ProjectName>
<WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v140</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug-dll|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v140</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v140</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug-dll|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v140</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v140</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release-dll|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v140</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v140</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release-dll|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v140</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\opencsd.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug-dll|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\opencsd.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\opencsd.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug-dll|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\opencsd.props" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\opencsd.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release-dll|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\opencsd.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\opencsd.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release-dll|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\opencsd.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<OutDir>..\..\..\lib\win$(PlatformArchitecture)\dbg\</OutDir>
<TargetName>lib$(LIB_BASE_NAME)</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug-dll|x64'">
<OutDir>..\..\..\lib\win$(PlatformArchitecture)\dbg\</OutDir>
<TargetName>lib$(LIB_BASE_NAME)</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<OutDir>..\..\..\lib\win$(PlatformArchitecture)\rel\</OutDir>
<TargetName>lib$(LIB_BASE_NAME)</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release-dll|x64'">
<OutDir>..\..\..\lib\win$(PlatformArchitecture)\rel\</OutDir>
<TargetName>lib$(LIB_BASE_NAME)</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<OutDir>..\..\..\lib\win$(PlatformArchitecture)\rel\</OutDir>
<TargetName>lib$(LIB_BASE_NAME)</TargetName>
<IntDir>$(Platform)\$(Configuration)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release-dll|Win32'">
<OutDir>..\..\..\lib\win$(PlatformArchitecture)\rel\</OutDir>
<TargetName>lib$(LIB_BASE_NAME)</TargetName>
<IntDir>$(Platform)\$(Configuration)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<OutDir>..\..\..\lib\win$(PlatformArchitecture)\dbg\</OutDir>
<IntDir>$(Platform)\$(Configuration)\</IntDir>
<TargetName>lib$(LIB_BASE_NAME)</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug-dll|Win32'">
<OutDir>..\..\..\lib\win$(PlatformArchitecture)\dbg\</OutDir>
<TargetName>lib$(LIB_BASE_NAME)</TargetName>
<IntDir>$(Platform)\$(Configuration)\</IntDir>
<TargetExt>.lib</TargetExt>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<ProgramDataBaseFileName>$(OutDir)$(TargetName)_vc$(PlatformToolsetVersion).pdb</ProgramDataBaseFileName>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug-dll|Win32'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<ProgramDataBaseFileName>$(OutDir)$(TargetName)_vc$(PlatformToolsetVersion).pdb</ProgramDataBaseFileName>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions);</PreprocessorDefinitions>
<AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<ProgramDataBaseFileName>$(OutDir)$(TargetName)_vc$(PlatformToolsetVersion).pdb</ProgramDataBaseFileName>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug-dll|x64'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions);</PreprocessorDefinitions>
<AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<ProgramDataBaseFileName>$(OutDir)$(TargetName)_vc$(PlatformToolsetVersion).pdb</ProgramDataBaseFileName>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<ProgramDataBaseFileName>$(OutDir)$(TargetName)_vc$(PlatformToolsetVersion).pdb</ProgramDataBaseFileName>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release-dll|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<ProgramDataBaseFileName>$(OutDir)$(TargetName)_vc$(PlatformToolsetVersion).pdb</ProgramDataBaseFileName>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<ProgramDataBaseFileName>$(OutDir)$(TargetName)_vc$(PlatformToolsetVersion).pdb</ProgramDataBaseFileName>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release-dll|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<ProgramDataBaseFileName>$(OutDir)$(TargetName)_vc$(PlatformToolsetVersion).pdb</ProgramDataBaseFileName>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<None Include="..\..\..\..\HOWTO.md" />
<None Include="..\..\..\..\LICENSE" />
<None Include="..\..\..\..\README.md" />
<None Include="..\..\..\..\TODO" />
<None Include="..\..\..\docs\build_libs.md" />
<None Include="..\..\..\docs\external_custom.md" />
<None Include="..\..\..\docs\man\trc_pkt_lister.1" />
<None Include="..\..\..\docs\test_progs.md" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\..\include\common\comp_attach_notifier_i.h" />
<ClInclude Include="..\..\..\include\common\comp_attach_pt_t.h" />
<ClInclude Include="..\..\..\include\common\ocsd_code_follower.h" />
<ClInclude Include="..\..\..\include\common\ocsd_dcd_mngr.h" />
<ClInclude Include="..\..\..\include\common\ocsd_dcd_mngr_i.h" />
<ClInclude Include="..\..\..\include\common\ocsd_dcd_tree.h" />
<ClInclude Include="..\..\..\include\common\ocsd_dcd_tree_elem.h" />
<ClInclude Include="..\..\..\include\common\ocsd_error.h" />
<ClInclude Include="..\..\..\include\common\ocsd_error_logger.h" />
<ClInclude Include="..\..\..\include\common\ocsd_gen_elem_list.h" />
<ClInclude Include="..\..\..\include\common\ocsd_gen_elem_stack.h" />
<ClInclude Include="..\..\..\include\common\ocsd_lib_dcd_register.h" />
<ClInclude Include="..\..\..\include\common\ocsd_msg_logger.h" />
<ClInclude Include="..\..\..\include\common\ocsd_pe_context.h" />
<ClInclude Include="..\..\..\include\common\ocsd_version.h" />
<ClInclude Include="..\..\..\include\common\trc_component.h" />
<ClInclude Include="..\..\..\include\common\trc_core_arch_map.h" />
<ClInclude Include="..\..\..\include\common\trc_cs_config.h" />
<ClInclude Include="..\..\..\include\common\trc_frame_deformatter.h" />
<ClInclude Include="..\..\..\include\common\trc_gen_elem.h" />
<ClInclude Include="..\..\..\include\common\trc_pkt_decode_base.h" />
<ClInclude Include="..\..\..\include\common\trc_pkt_elem_base.h" />
<ClInclude Include="..\..\..\include\common\trc_pkt_proc_base.h" />
<ClInclude Include="..\..\..\include\common\trc_printable_elem.h" />
<ClInclude Include="..\..\..\include\common\trc_ret_stack.h" />
<ClInclude Include="..\..\..\include\mem_acc\trc_mem_acc_cache.h" />
<ClInclude Include="..\..\..\include\opencsd\ete\ete_decoder.h" />
<ClInclude Include="..\..\..\include\opencsd\ete\trc_cmp_cfg_ete.h" />
<ClInclude Include="..\..\..\include\opencsd\ete\trc_dcd_mngr_ete.h" />
<ClInclude Include="..\..\..\include\opencsd\ete\trc_pkt_types_ete.h" />
<ClInclude Include="..\..\..\include\opencsd\etmv3\etmv3_decoder.h" />
<ClInclude Include="..\..\..\include\opencsd\etmv3\trc_cmp_cfg_etmv3.h" />
<ClInclude Include="..\..\..\include\opencsd\etmv3\trc_dcd_mngr_etmv3.h" />
<ClInclude Include="..\..\..\include\opencsd\etmv3\trc_pkt_decode_etmv3.h" />
<ClInclude Include="..\..\..\include\opencsd\etmv3\trc_pkt_elem_etmv3.h" />
<ClInclude Include="..\..\..\include\opencsd\etmv3\trc_pkt_proc_etmv3.h" />
<ClInclude Include="..\..\..\include\opencsd\etmv3\trc_pkt_types_etmv3.h" />
<ClInclude Include="..\..\..\include\opencsd\etmv4\etmv4_decoder.h" />
<ClInclude Include="..\..\..\include\opencsd\etmv4\trc_cmp_cfg_etmv4.h" />
<ClInclude Include="..\..\..\include\opencsd\etmv4\trc_dcd_mngr_etmv4i.h" />
<ClInclude Include="..\..\..\include\opencsd\etmv4\trc_etmv4_stack_elem.h" />
<ClInclude Include="..\..\..\include\opencsd\etmv4\trc_pkt_decode_etmv4i.h" />
<ClInclude Include="..\..\..\include\opencsd\etmv4\trc_pkt_elem_etmv4d.h" />
<ClInclude Include="..\..\..\include\opencsd\etmv4\trc_pkt_elem_etmv4i.h" />
<ClInclude Include="..\..\..\include\opencsd\etmv4\trc_pkt_proc_etmv4.h" />
<ClInclude Include="..\..\..\include\opencsd\etmv4\trc_pkt_proc_etmv4i.h" />
<ClInclude Include="..\..\..\include\opencsd\etmv4\trc_pkt_types_etmv4.h" />
<ClInclude Include="..\..\..\include\interfaces\trc_abs_typed_base_i.h" />
<ClInclude Include="..\..\..\include\interfaces\trc_data_rawframe_in_i.h" />
<ClInclude Include="..\..\..\include\interfaces\trc_data_raw_in_i.h" />
<ClInclude Include="..\..\..\include\interfaces\trc_error_log_i.h" />
<ClInclude Include="..\..\..\include\interfaces\trc_gen_elem_in_i.h" />
<ClInclude Include="..\..\..\include\interfaces\trc_indexer_pkt_i.h" />
<ClInclude Include="..\..\..\include\interfaces\trc_indexer_src_i.h" />
<ClInclude Include="..\..\..\include\interfaces\trc_instr_decode_i.h" />
<ClInclude Include="..\..\..\include\interfaces\trc_pkt_in_i.h" />
<ClInclude Include="..\..\..\include\interfaces\trc_pkt_raw_in_i.h" />
<ClInclude Include="..\..\..\include\interfaces\trc_tgt_mem_access_i.h" />
<ClInclude Include="..\..\..\include\i_dec\trc_idec_arminst.h" />
<ClInclude Include="..\..\..\include\i_dec\trc_i_decode.h" />
<ClInclude Include="..\..\..\include\mem_acc\trc_mem_acc.h" />
<ClInclude Include="..\..\..\include\mem_acc\trc_mem_acc_base.h" />
<ClInclude Include="..\..\..\include\mem_acc\trc_mem_acc_bufptr.h" />
<ClInclude Include="..\..\..\include\mem_acc\trc_mem_acc_cb.h" />
<ClInclude Include="..\..\..\include\mem_acc\trc_mem_acc_cb_if.h" />
<ClInclude Include="..\..\..\include\mem_acc\trc_mem_acc_file.h" />
<ClInclude Include="..\..\..\include\mem_acc\trc_mem_acc_mapper.h" />
<ClInclude Include="..\..\..\include\opencsd\ocsd_if_types.h" />
<ClInclude Include="..\..\..\include\opencsd.h" />
<ClInclude Include="..\..\..\include\opencsd\ocsd_if_version.h" />
<ClInclude Include="..\..\..\include\pkt_printers\gen_elem_printer.h" />
<ClInclude Include="..\..\..\include\pkt_printers\item_printer.h" />
<ClInclude Include="..\..\..\include\pkt_printers\pkt_printer_t.h" />
<ClInclude Include="..\..\..\include\pkt_printers\raw_frame_printer.h" />
<ClInclude Include="..\..\..\include\pkt_printers\trc_pkt_printers.h" />
<ClInclude Include="..\..\..\include\pkt_printers\trc_print_fact.h" />
<ClInclude Include="..\..\..\include\opencsd\ptm\ptm_decoder.h" />
<ClInclude Include="..\..\..\include\opencsd\ptm\trc_cmp_cfg_ptm.h" />
<ClInclude Include="..\..\..\include\opencsd\ptm\trc_dcd_mngr_ptm.h" />
<ClInclude Include="..\..\..\include\opencsd\ptm\trc_pkt_decode_ptm.h" />
<ClInclude Include="..\..\..\include\opencsd\ptm\trc_pkt_elem_ptm.h" />
<ClInclude Include="..\..\..\include\opencsd\ptm\trc_pkt_proc_ptm.h" />
<ClInclude Include="..\..\..\include\opencsd\ptm\trc_pkt_types_ptm.h" />
<ClInclude Include="..\..\..\include\opencsd\stm\stm_decoder.h" />
<ClInclude Include="..\..\..\include\opencsd\stm\trc_cmp_cfg_stm.h" />
<ClInclude Include="..\..\..\include\opencsd\stm\trc_dcd_mngr_stm.h" />
<ClInclude Include="..\..\..\include\opencsd\stm\trc_pkt_decode_stm.h" />
<ClInclude Include="..\..\..\include\opencsd\stm\trc_pkt_elem_stm.h" />
<ClInclude Include="..\..\..\include\opencsd\stm\trc_pkt_proc_stm.h" />
<ClInclude Include="..\..\..\include\opencsd\stm\trc_pkt_types_stm.h" />
<ClInclude Include="..\..\..\include\opencsd\trc_gen_elem_types.h" />
<ClInclude Include="..\..\..\include\opencsd\trc_pkt_types.h" />
<ClInclude Include="..\..\..\source\etmv3\trc_pkt_proc_etmv3_impl.h" />
<ClInclude Include="..\..\..\source\trc_frame_deformatter_impl.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\..\source\ete\trc_cmp_cfg_ete.cpp" />
<ClCompile Include="..\..\..\source\etmv3\trc_cmp_cfg_etmv3.cpp" />
<ClCompile Include="..\..\..\source\etmv3\trc_pkt_decode_etmv3.cpp" />
<ClCompile Include="..\..\..\source\etmv3\trc_pkt_elem_etmv3.cpp" />
<ClCompile Include="..\..\..\source\etmv3\trc_pkt_proc_etmv3.cpp" />
<ClCompile Include="..\..\..\source\etmv3\trc_pkt_proc_etmv3_impl.cpp" />
<ClCompile Include="..\..\..\source\etmv4\trc_cmp_cfg_etmv4.cpp" />
<ClCompile Include="..\..\..\source\etmv4\trc_etmv4_stack_elem.cpp" />
<ClCompile Include="..\..\..\source\etmv4\trc_pkt_decode_etmv4i.cpp" />
<ClCompile Include="..\..\..\source\etmv4\trc_pkt_elem_etmv4i.cpp" />
<ClCompile Include="..\..\..\source\etmv4\trc_pkt_proc_etmv4i.cpp" />
<ClCompile Include="..\..\..\source\i_dec\trc_idec_arminst.cpp" />
<ClCompile Include="..\..\..\source\i_dec\trc_i_decode.cpp" />
<ClCompile Include="..\..\..\source\mem_acc\trc_mem_acc_base.cpp" />
<ClCompile Include="..\..\..\source\mem_acc\trc_mem_acc_bufptr.cpp" />
<ClCompile Include="..\..\..\source\mem_acc\trc_mem_acc_cache.cpp" />
<ClCompile Include="..\..\..\source\mem_acc\trc_mem_acc_cb.cpp" />
<ClCompile Include="..\..\..\source\mem_acc\trc_mem_acc_file.cpp" />
<ClCompile Include="..\..\..\source\mem_acc\trc_mem_acc_mapper.cpp" />
<ClCompile Include="..\..\..\source\ocsd_code_follower.cpp" />
<ClCompile Include="..\..\..\source\ocsd_dcd_tree.cpp" />
<ClCompile Include="..\..\..\source\ocsd_error.cpp" />
<ClCompile Include="..\..\..\source\ocsd_error_logger.cpp" />
<ClCompile Include="..\..\..\source\ocsd_gen_elem_list.cpp" />
<ClCompile Include="..\..\..\source\ocsd_gen_elem_stack.cpp" />
<ClCompile Include="..\..\..\source\ocsd_lib_dcd_register.cpp" />
<ClCompile Include="..\..\..\source\ocsd_msg_logger.cpp" />
<ClCompile Include="..\..\..\source\ocsd_version.cpp" />
<ClCompile Include="..\..\..\source\pkt_printers\raw_frame_printer.cpp" />
<ClCompile Include="..\..\..\source\pkt_printers\trc_print_fact.cpp" />
<ClCompile Include="..\..\..\source\ptm\trc_cmp_cfg_ptm.cpp" />
<ClCompile Include="..\..\..\source\ptm\trc_pkt_decode_ptm.cpp" />
<ClCompile Include="..\..\..\source\ptm\trc_pkt_elem_ptm.cpp" />
<ClCompile Include="..\..\..\source\ptm\trc_pkt_proc_ptm.cpp" />
<ClCompile Include="..\..\..\source\stm\trc_pkt_decode_stm.cpp" />
<ClCompile Include="..\..\..\source\stm\trc_pkt_elem_stm.cpp" />
<ClCompile Include="..\..\..\source\stm\trc_pkt_proc_stm.cpp" />
<ClCompile Include="..\..\..\source\trc_component.cpp" />
<ClCompile Include="..\..\..\source\trc_core_arch_map.cpp" />
<ClCompile Include="..\..\..\source\trc_frame_deformatter.cpp" />
<ClCompile Include="..\..\..\source\trc_gen_elem.cpp" />
<ClCompile Include="..\..\..\source\trc_printable_elem.cpp" />
<ClCompile Include="..\..\..\source\trc_ret_stack.cpp" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@ -0,0 +1,515 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
<Filter Include="interfaces">
<UniqueIdentifier>{80012968-9f0d-4623-901a-c2fa5f1c0890}</UniqueIdentifier>
</Filter>
<Filter Include="Header Files\etmv3">
<UniqueIdentifier>{98cd2a71-b44f-4884-bb8a-56c851cc8321}</UniqueIdentifier>
</Filter>
<Filter Include="Header Files\etmv4">
<UniqueIdentifier>{dd155712-7990-4cdd-b9b0-299d97f625e4}</UniqueIdentifier>
</Filter>
<Filter Include="Header Files\ptm">
<UniqueIdentifier>{9ec501e2-9ba4-4bad-a3d3-cdb604cc38b4}</UniqueIdentifier>
</Filter>
<Filter Include="Header Files\mem_acc">
<UniqueIdentifier>{23a35c62-e38f-43f6-a03b-6f1287478a69}</UniqueIdentifier>
</Filter>
<Filter Include="Header Files\i_dec">
<UniqueIdentifier>{f550018a-8974-4f8b-975a-bd8b86ae418f}</UniqueIdentifier>
</Filter>
<Filter Include="Header Files\stm">
<UniqueIdentifier>{2c796b59-81f6-49c9-88cf-e90ed2e741a3}</UniqueIdentifier>
</Filter>
<Filter Include="docs-files">
<UniqueIdentifier>{5ea7e02d-0667-4d2d-8c3d-039daf112edc}</UniqueIdentifier>
</Filter>
<Filter Include="Source Files\ptm">
<UniqueIdentifier>{2aa8a97b-13da-4bd1-bdb5-02f3e1cf030b}</UniqueIdentifier>
</Filter>
<Filter Include="Source Files\etmv4">
<UniqueIdentifier>{ff9157b6-ef07-41e4-8ff4-322c50ea6665}</UniqueIdentifier>
</Filter>
<Filter Include="Source Files\etmv3">
<UniqueIdentifier>{0c2ba881-cc82-4567-ab59-d2363b4c3d1b}</UniqueIdentifier>
</Filter>
<Filter Include="Source Files\stm">
<UniqueIdentifier>{73a56760-b7ff-4d56-88f0-13249201081c}</UniqueIdentifier>
</Filter>
<Filter Include="Source Files\i_dec">
<UniqueIdentifier>{cb3682ee-abbd-44c3-a175-4522d76e2d68}</UniqueIdentifier>
</Filter>
<Filter Include="Source Files\mem_acc">
<UniqueIdentifier>{eb9beab1-99c6-4eaa-88c0-893b05b2e673}</UniqueIdentifier>
</Filter>
<Filter Include="Header Files\common">
<UniqueIdentifier>{58d2398e-efdd-45d9-b7be-fc6096f3bec2}</UniqueIdentifier>
</Filter>
<Filter Include="Header Files\pkt_printers">
<UniqueIdentifier>{0e6e1f5d-465e-4f91-88a3-479952bbd316}</UniqueIdentifier>
</Filter>
<Filter Include="Source Files\pkt_printers">
<UniqueIdentifier>{baf047d0-0ff7-4502-b42b-4f1fda94d54b}</UniqueIdentifier>
</Filter>
<Filter Include="Header Files\ete">
<UniqueIdentifier>{3d119e90-c89b-4f27-8163-305924453e1f}</UniqueIdentifier>
</Filter>
<Filter Include="Source Files\ete">
<UniqueIdentifier>{8cfdb19c-28fc-4e79-b8d5-4e54907b1f82}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<None Include="..\..\..\..\LICENSE">
<Filter>docs-files</Filter>
</None>
<None Include="..\..\..\..\README.md">
<Filter>docs-files</Filter>
</None>
<None Include="..\..\..\..\TODO">
<Filter>docs-files</Filter>
</None>
<None Include="..\..\..\docs\build_libs.md">
<Filter>docs-files</Filter>
</None>
<None Include="..\..\..\docs\test_progs.md">
<Filter>docs-files</Filter>
</None>
<None Include="..\..\..\..\HOWTO.md">
<Filter>docs-files</Filter>
</None>
<None Include="..\..\..\docs\external_custom.md">
<Filter>docs-files</Filter>
</None>
<None Include="..\..\..\docs\man\trc_pkt_lister.1">
<Filter>docs-files</Filter>
</None>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\..\source\trc_frame_deformatter_impl.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\interfaces\trc_tgt_mem_access_i.h">
<Filter>interfaces</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\interfaces\trc_pkt_raw_in_i.h">
<Filter>interfaces</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\interfaces\trc_pkt_in_i.h">
<Filter>interfaces</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\interfaces\trc_instr_decode_i.h">
<Filter>interfaces</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\interfaces\trc_indexer_src_i.h">
<Filter>interfaces</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\interfaces\trc_indexer_pkt_i.h">
<Filter>interfaces</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\interfaces\trc_gen_elem_in_i.h">
<Filter>interfaces</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\interfaces\trc_error_log_i.h">
<Filter>interfaces</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\interfaces\trc_data_raw_in_i.h">
<Filter>interfaces</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\interfaces\trc_data_rawframe_in_i.h">
<Filter>interfaces</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd\etmv3\etmv3_decoder.h">
<Filter>Header Files\etmv3</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd\etmv3\trc_pkt_elem_etmv3.h">
<Filter>Header Files\etmv3</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd\etmv3\trc_cmp_cfg_etmv3.h">
<Filter>Header Files\etmv3</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd\etmv3\trc_pkt_proc_etmv3.h">
<Filter>Header Files\etmv3</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd\etmv3\trc_pkt_types_etmv3.h">
<Filter>Header Files\etmv3</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd\etmv4\trc_pkt_proc_etmv4.h">
<Filter>Header Files\etmv4</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd\etmv4\trc_pkt_types_etmv4.h">
<Filter>Header Files\etmv4</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd\etmv4\trc_pkt_elem_etmv4d.h">
<Filter>Header Files\etmv4</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd\etmv4\trc_pkt_elem_etmv4i.h">
<Filter>Header Files\etmv4</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd\etmv4\trc_cmp_cfg_etmv4.h">
<Filter>Header Files\etmv4</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd\etmv4\etmv4_decoder.h">
<Filter>Header Files\etmv4</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd\ptm\trc_pkt_elem_ptm.h">
<Filter>Header Files\ptm</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd\ptm\trc_cmp_cfg_ptm.h">
<Filter>Header Files\ptm</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd\ptm\trc_pkt_types_ptm.h">
<Filter>Header Files\ptm</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd\ptm\trc_pkt_proc_ptm.h">
<Filter>Header Files\ptm</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd\ptm\ptm_decoder.h">
<Filter>Header Files\ptm</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\mem_acc\trc_mem_acc_base.h">
<Filter>Header Files\mem_acc</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\mem_acc\trc_mem_acc_file.h">
<Filter>Header Files\mem_acc</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\mem_acc\trc_mem_acc_bufptr.h">
<Filter>Header Files\mem_acc</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\mem_acc\trc_mem_acc_mapper.h">
<Filter>Header Files\mem_acc</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\i_dec\trc_idec_arminst.h">
<Filter>Header Files\i_dec</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\i_dec\trc_i_decode.h">
<Filter>Header Files\i_dec</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd\etmv4\trc_pkt_decode_etmv4i.h">
<Filter>Header Files\etmv4</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\mem_acc\trc_mem_acc.h">
<Filter>Header Files\mem_acc</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd\stm\stm_decoder.h">
<Filter>Header Files\stm</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd\stm\trc_pkt_elem_stm.h">
<Filter>Header Files\stm</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd\stm\trc_cmp_cfg_stm.h">
<Filter>Header Files\stm</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd\stm\trc_pkt_proc_stm.h">
<Filter>Header Files\stm</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd\stm\trc_pkt_types_stm.h">
<Filter>Header Files\stm</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd\etmv3\trc_pkt_decode_etmv3.h">
<Filter>Header Files\etmv3</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\mem_acc\trc_mem_acc_cb_if.h">
<Filter>Header Files\mem_acc</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\mem_acc\trc_mem_acc_cb.h">
<Filter>Header Files\mem_acc</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd\ptm\trc_pkt_decode_ptm.h">
<Filter>Header Files\ptm</Filter>
</ClInclude>
<ClInclude Include="..\..\..\source\etmv3\trc_pkt_proc_etmv3_impl.h">
<Filter>Source Files\etmv3</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\common\comp_attach_notifier_i.h">
<Filter>Header Files\common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\common\comp_attach_pt_t.h">
<Filter>Header Files\common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\common\ocsd_dcd_tree.h">
<Filter>Header Files\common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\common\ocsd_dcd_tree_elem.h">
<Filter>Header Files\common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\common\ocsd_error.h">
<Filter>Header Files\common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\common\ocsd_error_logger.h">
<Filter>Header Files\common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\common\ocsd_msg_logger.h">
<Filter>Header Files\common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\common\ocsd_version.h">
<Filter>Header Files\common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\common\trc_component.h">
<Filter>Header Files\common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\common\trc_core_arch_map.h">
<Filter>Header Files\common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\common\trc_frame_deformatter.h">
<Filter>Header Files\common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\common\trc_gen_elem.h">
<Filter>Header Files\common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\common\trc_pkt_decode_base.h">
<Filter>Header Files\common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\common\trc_pkt_proc_base.h">
<Filter>Header Files\common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\common\trc_printable_elem.h">
<Filter>Header Files\common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\common\ocsd_pe_context.h">
<Filter>Header Files\common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\common\ocsd_code_follower.h">
<Filter>Header Files\common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\common\ocsd_gen_elem_list.h">
<Filter>Header Files\common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\common\trc_cs_config.h">
<Filter>Header Files\common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\common\ocsd_dcd_mngr.h">
<Filter>Header Files\common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\common\ocsd_dcd_mngr_i.h">
<Filter>Header Files\common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\common\ocsd_lib_dcd_register.h">
<Filter>Header Files\common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\interfaces\trc_abs_typed_base_i.h">
<Filter>interfaces</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd\etmv4\trc_dcd_mngr_etmv4i.h">
<Filter>Header Files\etmv4</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd\etmv3\trc_dcd_mngr_etmv3.h">
<Filter>Source Files\etmv3</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd\ptm\trc_dcd_mngr_ptm.h">
<Filter>Header Files\ptm</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd\stm\trc_dcd_mngr_stm.h">
<Filter>Header Files\stm</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\common\trc_pkt_elem_base.h">
<Filter>Header Files\common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd\stm\trc_pkt_decode_stm.h">
<Filter>Header Files\stm</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\pkt_printers\gen_elem_printer.h">
<Filter>Header Files\pkt_printers</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\pkt_printers\item_printer.h">
<Filter>Header Files\pkt_printers</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\pkt_printers\pkt_printer_t.h">
<Filter>Header Files\pkt_printers</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\pkt_printers\raw_frame_printer.h">
<Filter>Header Files\pkt_printers</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\pkt_printers\trc_pkt_printers.h">
<Filter>Header Files\pkt_printers</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\pkt_printers\trc_print_fact.h">
<Filter>Header Files\pkt_printers</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\common\trc_ret_stack.h">
<Filter>Header Files\common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd\etmv4\trc_etmv4_stack_elem.h">
<Filter>Header Files\etmv4</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd\ocsd_if_types.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd\trc_gen_elem_types.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd\trc_pkt_types.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\mem_acc\trc_mem_acc_cache.h">
<Filter>Header Files\mem_acc</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd\ocsd_if_version.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\common\ocsd_gen_elem_stack.h">
<Filter>Header Files\common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd\ete\trc_pkt_types_ete.h">
<Filter>Header Files\ete</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd\ete\trc_cmp_cfg_ete.h">
<Filter>Header Files\ete</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd\ete\trc_dcd_mngr_ete.h">
<Filter>Header Files\ete</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd\ete\ete_decoder.h">
<Filter>Header Files\ete</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd\etmv4\trc_pkt_proc_etmv4i.h">
<Filter>Header Files\etmv4</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\..\source\trc_component.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\trc_frame_deformatter.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\trc_core_arch_map.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\trc_printable_elem.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\trc_gen_elem.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\ptm\trc_pkt_decode_ptm.cpp">
<Filter>Source Files\ptm</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\ptm\trc_pkt_elem_ptm.cpp">
<Filter>Source Files\ptm</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\ptm\trc_pkt_proc_ptm.cpp">
<Filter>Source Files\ptm</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\etmv4\trc_pkt_elem_etmv4i.cpp">
<Filter>Source Files\etmv4</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\etmv4\trc_pkt_decode_etmv4i.cpp">
<Filter>Source Files\etmv4</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\etmv3\trc_pkt_elem_etmv3.cpp">
<Filter>Source Files\etmv3</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\etmv3\trc_pkt_decode_etmv3.cpp">
<Filter>Source Files\etmv3</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\etmv3\trc_cmp_cfg_etmv3.cpp">
<Filter>Source Files\etmv3</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\etmv3\trc_pkt_proc_etmv3.cpp">
<Filter>Source Files\etmv3</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\etmv3\trc_pkt_proc_etmv3_impl.cpp">
<Filter>Source Files\etmv3</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\etmv4\trc_cmp_cfg_etmv4.cpp">
<Filter>Source Files\etmv4</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\ptm\trc_cmp_cfg_ptm.cpp">
<Filter>Source Files\ptm</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\stm\trc_pkt_proc_stm.cpp">
<Filter>Source Files\stm</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\stm\trc_pkt_elem_stm.cpp">
<Filter>Source Files\stm</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\i_dec\trc_i_decode.cpp">
<Filter>Source Files\i_dec</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\i_dec\trc_idec_arminst.cpp">
<Filter>Source Files\i_dec</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\mem_acc\trc_mem_acc_base.cpp">
<Filter>Source Files\mem_acc</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\mem_acc\trc_mem_acc_mapper.cpp">
<Filter>Source Files\mem_acc</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\mem_acc\trc_mem_acc_bufptr.cpp">
<Filter>Source Files\mem_acc</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\mem_acc\trc_mem_acc_cb.cpp">
<Filter>Source Files\mem_acc</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\mem_acc\trc_mem_acc_file.cpp">
<Filter>Source Files\mem_acc</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\ocsd_dcd_tree.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\ocsd_error.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\ocsd_error_logger.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\ocsd_msg_logger.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\ocsd_version.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\ocsd_code_follower.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\ocsd_gen_elem_list.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\ocsd_lib_dcd_register.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\stm\trc_pkt_decode_stm.cpp">
<Filter>Source Files\stm</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\pkt_printers\raw_frame_printer.cpp">
<Filter>Source Files\pkt_printers</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\pkt_printers\trc_print_fact.cpp">
<Filter>Source Files\pkt_printers</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\trc_ret_stack.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\etmv4\trc_etmv4_stack_elem.cpp">
<Filter>Source Files\etmv4</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\mem_acc\trc_mem_acc_cache.cpp">
<Filter>Source Files\mem_acc</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\etmv4\trc_pkt_proc_etmv4i.cpp">
<Filter>Source Files\etmv4</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\ocsd_gen_elem_stack.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\ete\trc_cmp_cfg_ete.cpp">
<Filter>Source Files\ete</Filter>
</ClCompile>
</ItemGroup>
</Project>

View File

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ImportGroup Label="PropertySheets" />
<PropertyGroup Label="UserMacros">
<LIB_BASE_NAME>opencsd</LIB_BASE_NAME>
<LIB_CAPI_NAME>opencsd_c_api</LIB_CAPI_NAME>
</PropertyGroup>
<PropertyGroup />
<ItemDefinitionGroup />
<ItemGroup>
<BuildMacro Include="LIB_BASE_NAME">
<Value>$(LIB_BASE_NAME)</Value>
<EnvironmentVariable>true</EnvironmentVariable>
</BuildMacro>
<BuildMacro Include="LIB_CAPI_NAME">
<Value>$(LIB_CAPI_NAME)</Value>
<EnvironmentVariable>true</EnvironmentVariable>
</BuildMacro>
</ItemGroup>
</Project>

View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<Project>
<ProjectOutputs>
<ProjectOutput>
<FullPath>C:\work\OpenCSD\ocsd-linaro\decoder\lib\win32\dbg\libopencsd_c_api.dll</FullPath>
</ProjectOutput>
</ProjectOutputs>
<ContentFiles />
<SatelliteDlls />
<NonRecipeFileRefs />
</Project>

View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<Project>
<ProjectOutputs>
<ProjectOutput>
<FullPath>C:\work\OpenCSD\ocsd-linaro\decoder\lib\win32\rel\libopencsd_c_api.dll</FullPath>
</ProjectOutput>
</ProjectOutputs>
<ContentFiles />
<SatelliteDlls />
<NonRecipeFileRefs />
</Project>

View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<Project>
<ProjectOutputs>
<ProjectOutput>
<FullPath>C:\work\OpenCSD\ocsd-linaro\decoder\lib\win32\rel\opencsd_c_api.dll</FullPath>
</ProjectOutput>
</ProjectOutputs>
<ContentFiles />
<SatelliteDlls />
<NonRecipeFileRefs />
</Project>

View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project>
<ProjectOutputs />
<ContentFiles />
<SatelliteDlls />
<NonRecipeFileRefs />
</Project>

View File

@ -0,0 +1,327 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug-dll|Win32">
<Configuration>Debug-dll</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug-dll|x64">
<Configuration>Debug-dll</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release-dll|Win32">
<Configuration>Release-dll</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release-dll|x64">
<Configuration>Release-dll</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{533F929A-A73B-46B6-9D5F-FFCD62F734E3}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>rctdl_c_api_lib</RootNamespace>
<ProjectName>ocsd_c_api_lib</ProjectName>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v143</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug-dll|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v143</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v143</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug-dll|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v143</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v143</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release-dll|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v143</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v143</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release-dll|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v143</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\opencsd.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug-dll|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\opencsd.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\opencsd.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug-dll|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\opencsd.props" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\opencsd.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release-dll|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\opencsd.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\opencsd.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release-dll|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\opencsd.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<OutDir>..\..\..\lib\win$(PlatformArchitecture)\rel\</OutDir>
<TargetName>lib$(LIB_CAPI_NAME)</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release-dll|x64'">
<OutDir>..\..\..\lib\win$(PlatformArchitecture)\rel\</OutDir>
<TargetName>lib$(LIB_CAPI_NAME)</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<OutDir>..\..\..\lib\win$(PlatformArchitecture)\dbg\</OutDir>
<TargetName>lib$(LIB_CAPI_NAME)</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug-dll|x64'">
<OutDir>..\..\..\lib\win$(PlatformArchitecture)\dbg\</OutDir>
<TargetName>lib$(LIB_CAPI_NAME)</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<OutDir>..\..\..\lib\win$(PlatformArchitecture)\dbg\</OutDir>
<TargetName>lib$(LIB_CAPI_NAME)</TargetName>
<IntDir>$(Platform)\$(Configuration)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug-dll|Win32'">
<OutDir>..\..\..\lib\win$(PlatformArchitecture)\dbg\</OutDir>
<TargetName>lib$(LIB_CAPI_NAME)</TargetName>
<IntDir>$(Platform)\$(Configuration)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<OutDir>..\..\..\lib\win$(PlatformArchitecture)\rel\</OutDir>
<TargetName>lib$(LIB_CAPI_NAME)</TargetName>
<IntDir>$(Platform)\$(Configuration)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release-dll|Win32'">
<OutDir>..\..\..\lib\win$(PlatformArchitecture)\rel\</OutDir>
<TargetName>lib$(LIB_CAPI_NAME)</TargetName>
<IntDir>$(Platform)\$(Configuration)\</IntDir>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<ProgramDataBaseFileName>$(OutDir)$(TargetName)_vc$(PlatformToolsetVersion).pdb</ProgramDataBaseFileName>
<BasicRuntimeChecks />
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug-dll|Win32'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;_OCSD_C_API_DLL_EXPORT;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<ProgramDataBaseFileName>$(OutDir)$(TargetName)_vc$(PlatformToolsetVersion).pdb</ProgramDataBaseFileName>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<ProgramDataBaseFileName>$(OutDir)$(TargetName)_vc$(PlatformToolsetVersion).pdb</ProgramDataBaseFileName>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug-dll|x64'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;_OCSD_C_API_DLL_EXPORT;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<ProgramDataBaseFileName>$(OutDir)$(TargetName)_vc$(PlatformToolsetVersion).pdb</ProgramDataBaseFileName>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<ProgramDataBaseFileName>$(OutDir)$(TargetName)_vc$(PlatformToolsetVersion).pdb</ProgramDataBaseFileName>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release-dll|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;_OCSD_C_API_DLL_EXPORT;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<ProgramDataBaseFileName>$(OutDir)$(TargetName)_vc$(PlatformToolsetVersion).pdb</ProgramDataBaseFileName>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<ProgramDataBaseFileName>$(OutDir)$(TargetName)_vc$(PlatformToolsetVersion).pdb</ProgramDataBaseFileName>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release-dll|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;_OCSD_C_API_DLL_EXPORT;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<ProgramDataBaseFileName>$(OutDir)$(TargetName)_vc$(PlatformToolsetVersion).pdb</ProgramDataBaseFileName>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="..\..\..\include\opencsd\c_api\ocsd_c_api_custom.h" />
<ClInclude Include="..\..\..\include\opencsd\c_api\ocsd_c_api_cust_fact.h" />
<ClInclude Include="..\..\..\include\opencsd\c_api\ocsd_c_api_cust_impl.h" />
<ClInclude Include="..\..\..\include\opencsd\c_api\ocsd_c_api_types.h" />
<ClInclude Include="..\..\..\include\opencsd\c_api\opencsd_c_api.h" />
<ClInclude Include="..\..\..\source\c_api\ocsd_c_api_custom_obj.h" />
<ClInclude Include="..\..\..\source\c_api\ocsd_c_api_obj.h" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\ref_trace_decode_lib\ref_trace_decode_lib.vcxproj">
<Project>{7f500891-cc76-405f-933f-f682bc39f923}</Project>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\..\source\c_api\ocsd_c_api.cpp" />
<ClCompile Include="..\..\..\source\c_api\ocsd_c_api_custom_obj.cpp" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@ -0,0 +1,48 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\..\include\opencsd\c_api\ocsd_c_api_types.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd\c_api\opencsd_c_api.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\source\c_api\ocsd_c_api_obj.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd\c_api\ocsd_c_api_custom.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\source\c_api\ocsd_c_api_custom_obj.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd\c_api\ocsd_c_api_cust_fact.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd\c_api\ocsd_c_api_cust_impl.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\..\source\c_api\ocsd_c_api.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\c_api\ocsd_c_api_custom_obj.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
</Project>

View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<Project>
<ProjectOutputs>
<ProjectOutput>
<FullPath>C:\work\OpenCSD\ocsd-linaro\decoder\lib\win64\dbg\libopencsd_c_api.dll</FullPath>
</ProjectOutput>
</ProjectOutputs>
<ContentFiles />
<SatelliteDlls />
<NonRecipeFileRefs />
</Project>

View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<Project>
<ProjectOutputs>
<ProjectOutput>
<FullPath>C:\work\OpenCSD\ocsd-linaro\decoder\lib\win64\rel\libopencsd_c_api.dll</FullPath>
</ProjectOutput>
</ProjectOutputs>
<ContentFiles />
<SatelliteDlls />
<NonRecipeFileRefs />
</Project>

View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project>
<ProjectOutputs />
<ContentFiles />
<SatelliteDlls />
<NonRecipeFileRefs />
</Project>

View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<Project>
<ProjectOutputs>
<ProjectOutput>
<FullPath>C:\work\OpenCSD\ocsd-linaro\decoder\lib\win32\dbg\libopencsd.dll</FullPath>
</ProjectOutput>
</ProjectOutputs>
<ContentFiles />
<SatelliteDlls />
<NonRecipeFileRefs />
</Project>

View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project>
<ProjectOutputs />
<ContentFiles />
<SatelliteDlls />
<NonRecipeFileRefs />
</Project>

View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project>
<ProjectOutputs />
<ContentFiles />
<SatelliteDlls />
<NonRecipeFileRefs />
</Project>

View File

@ -0,0 +1,166 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.0.32929.387
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "opencsd_lib", "ref_trace_decode_lib.vcxproj", "{7F500891-CC76-405F-933F-F682BC39F923}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ocsd_c_api_lib", "..\rctdl_c_api_lib\rctdl_c_api_lib.vcxproj", "{533F929A-A73B-46B6-9D5F-FFCD62F734E3}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "c_api_pkt_print_test", "..\..\..\tests\build\win-vs2022\c_api_pkt_print_test\c_api_pkt_print_test.vcxproj", "{3AC169DA-E156-4D16-95DF-73D7302A5606}"
ProjectSection(ProjectDependencies) = postProject
{46219A32-8178-41C1-B3B1-B5A6E547515F} = {46219A32-8178-41C1-B3B1-B5A6E547515F}
{533F929A-A73B-46B6-9D5F-FFCD62F734E3} = {533F929A-A73B-46B6-9D5F-FFCD62F734E3}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ext_dcd_echo_test", "..\..\..\tests\build\win-vs2022\ext_dcd_echo_test\ext_dcd_echo_test.vcxproj", "{46219A32-8178-41C1-B3B1-B5A6E547515F}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mem-buffer-eg", "..\..\..\tests\build\win-vs2022\mem-buffer-eg\mem-buffer-eg.vcxproj", "{BC090130-2C53-4CF6-8AD4-37BF72B8D01A}"
ProjectSection(ProjectDependencies) = postProject
{7F500891-CC76-405F-933F-F682BC39F923} = {7F500891-CC76-405F-933F-F682BC39F923}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "snapshot_parser_lib", "..\..\..\tests\build\win-vs2022\snapshot_parser_lib\snapshot_parser_lib.vcxproj", "{DE1F395D-4F53-42FB-8AEF-993A4BF7E411}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "trc_pkt_lister", "..\..\..\tests\build\win-vs2022\trc_pkt_lister\trc_pkt_lister.vcxproj", "{18ABC652-AB11-4993-9491-1A7FB7117339}"
ProjectSection(ProjectDependencies) = postProject
{7F500891-CC76-405F-933F-F682BC39F923} = {7F500891-CC76-405F-933F-F682BC39F923}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "frame_demux_test", "..\..\..\tests\build\win-vs2022\frame_demux_test\frame_demux_test.vcxproj", "{98EE9884-A4EB-4C75-A911-DFEDF992754F}"
ProjectSection(ProjectDependencies) = postProject
{7F500891-CC76-405F-933F-F682BC39F923} = {7F500891-CC76-405F-933F-F682BC39F923}
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Debug|x64 = Debug|x64
Debug-dll|Win32 = Debug-dll|Win32
Debug-dll|x64 = Debug-dll|x64
Release|Win32 = Release|Win32
Release|x64 = Release|x64
Release-dll|Win32 = Release-dll|Win32
Release-dll|x64 = Release-dll|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{7F500891-CC76-405F-933F-F682BC39F923}.Debug|Win32.ActiveCfg = Debug|Win32
{7F500891-CC76-405F-933F-F682BC39F923}.Debug|Win32.Build.0 = Debug|Win32
{7F500891-CC76-405F-933F-F682BC39F923}.Debug|x64.ActiveCfg = Debug|x64
{7F500891-CC76-405F-933F-F682BC39F923}.Debug|x64.Build.0 = Debug|x64
{7F500891-CC76-405F-933F-F682BC39F923}.Debug-dll|Win32.ActiveCfg = Debug|Win32
{7F500891-CC76-405F-933F-F682BC39F923}.Debug-dll|Win32.Build.0 = Debug|Win32
{7F500891-CC76-405F-933F-F682BC39F923}.Debug-dll|x64.ActiveCfg = Debug|x64
{7F500891-CC76-405F-933F-F682BC39F923}.Debug-dll|x64.Build.0 = Debug|x64
{7F500891-CC76-405F-933F-F682BC39F923}.Release|Win32.ActiveCfg = Release|Win32
{7F500891-CC76-405F-933F-F682BC39F923}.Release|Win32.Build.0 = Release|Win32
{7F500891-CC76-405F-933F-F682BC39F923}.Release|x64.ActiveCfg = Release|x64
{7F500891-CC76-405F-933F-F682BC39F923}.Release|x64.Build.0 = Release|x64
{7F500891-CC76-405F-933F-F682BC39F923}.Release-dll|Win32.ActiveCfg = Release|Win32
{7F500891-CC76-405F-933F-F682BC39F923}.Release-dll|Win32.Build.0 = Release|Win32
{7F500891-CC76-405F-933F-F682BC39F923}.Release-dll|x64.ActiveCfg = Release|x64
{7F500891-CC76-405F-933F-F682BC39F923}.Release-dll|x64.Build.0 = Release|x64
{533F929A-A73B-46B6-9D5F-FFCD62F734E3}.Debug|Win32.ActiveCfg = Debug|Win32
{533F929A-A73B-46B6-9D5F-FFCD62F734E3}.Debug|Win32.Build.0 = Debug|Win32
{533F929A-A73B-46B6-9D5F-FFCD62F734E3}.Debug|x64.ActiveCfg = Debug|x64
{533F929A-A73B-46B6-9D5F-FFCD62F734E3}.Debug|x64.Build.0 = Debug|x64
{533F929A-A73B-46B6-9D5F-FFCD62F734E3}.Debug-dll|Win32.ActiveCfg = Debug-dll|Win32
{533F929A-A73B-46B6-9D5F-FFCD62F734E3}.Debug-dll|Win32.Build.0 = Debug-dll|Win32
{533F929A-A73B-46B6-9D5F-FFCD62F734E3}.Debug-dll|x64.ActiveCfg = Debug-dll|x64
{533F929A-A73B-46B6-9D5F-FFCD62F734E3}.Debug-dll|x64.Build.0 = Debug-dll|x64
{533F929A-A73B-46B6-9D5F-FFCD62F734E3}.Release|Win32.ActiveCfg = Release|Win32
{533F929A-A73B-46B6-9D5F-FFCD62F734E3}.Release|Win32.Build.0 = Release|Win32
{533F929A-A73B-46B6-9D5F-FFCD62F734E3}.Release|x64.ActiveCfg = Release|x64
{533F929A-A73B-46B6-9D5F-FFCD62F734E3}.Release|x64.Build.0 = Release|x64
{533F929A-A73B-46B6-9D5F-FFCD62F734E3}.Release-dll|Win32.ActiveCfg = Release-dll|Win32
{533F929A-A73B-46B6-9D5F-FFCD62F734E3}.Release-dll|Win32.Build.0 = Release-dll|Win32
{533F929A-A73B-46B6-9D5F-FFCD62F734E3}.Release-dll|x64.ActiveCfg = Release-dll|x64
{533F929A-A73B-46B6-9D5F-FFCD62F734E3}.Release-dll|x64.Build.0 = Release-dll|x64
{3AC169DA-E156-4D16-95DF-73D7302A5606}.Debug|Win32.ActiveCfg = Debug|Win32
{3AC169DA-E156-4D16-95DF-73D7302A5606}.Debug|Win32.Build.0 = Debug|Win32
{3AC169DA-E156-4D16-95DF-73D7302A5606}.Debug|x64.ActiveCfg = Debug|x64
{3AC169DA-E156-4D16-95DF-73D7302A5606}.Debug|x64.Build.0 = Debug|x64
{3AC169DA-E156-4D16-95DF-73D7302A5606}.Debug-dll|Win32.ActiveCfg = debug-dll|Win32
{3AC169DA-E156-4D16-95DF-73D7302A5606}.Debug-dll|Win32.Build.0 = debug-dll|Win32
{3AC169DA-E156-4D16-95DF-73D7302A5606}.Debug-dll|x64.ActiveCfg = debug-dll|x64
{3AC169DA-E156-4D16-95DF-73D7302A5606}.Debug-dll|x64.Build.0 = debug-dll|x64
{3AC169DA-E156-4D16-95DF-73D7302A5606}.Release|Win32.ActiveCfg = Release|Win32
{3AC169DA-E156-4D16-95DF-73D7302A5606}.Release|Win32.Build.0 = Release|Win32
{3AC169DA-E156-4D16-95DF-73D7302A5606}.Release|x64.ActiveCfg = Release|x64
{3AC169DA-E156-4D16-95DF-73D7302A5606}.Release|x64.Build.0 = Release|x64
{3AC169DA-E156-4D16-95DF-73D7302A5606}.Release-dll|Win32.ActiveCfg = Release-dll|Win32
{3AC169DA-E156-4D16-95DF-73D7302A5606}.Release-dll|Win32.Build.0 = Release-dll|Win32
{3AC169DA-E156-4D16-95DF-73D7302A5606}.Release-dll|x64.ActiveCfg = Release-dll|x64
{3AC169DA-E156-4D16-95DF-73D7302A5606}.Release-dll|x64.Build.0 = Release-dll|x64
{46219A32-8178-41C1-B3B1-B5A6E547515F}.Debug|Win32.ActiveCfg = Debug|Win32
{46219A32-8178-41C1-B3B1-B5A6E547515F}.Debug|Win32.Build.0 = Debug|Win32
{46219A32-8178-41C1-B3B1-B5A6E547515F}.Debug|x64.ActiveCfg = Debug|x64
{46219A32-8178-41C1-B3B1-B5A6E547515F}.Debug|x64.Build.0 = Debug|x64
{46219A32-8178-41C1-B3B1-B5A6E547515F}.Debug-dll|Win32.ActiveCfg = Debug|Win32
{46219A32-8178-41C1-B3B1-B5A6E547515F}.Debug-dll|Win32.Build.0 = Debug|Win32
{46219A32-8178-41C1-B3B1-B5A6E547515F}.Debug-dll|x64.ActiveCfg = Debug|x64
{46219A32-8178-41C1-B3B1-B5A6E547515F}.Debug-dll|x64.Build.0 = Debug|x64
{46219A32-8178-41C1-B3B1-B5A6E547515F}.Release|Win32.ActiveCfg = Release|Win32
{46219A32-8178-41C1-B3B1-B5A6E547515F}.Release|Win32.Build.0 = Release|Win32
{46219A32-8178-41C1-B3B1-B5A6E547515F}.Release|x64.ActiveCfg = Release|x64
{46219A32-8178-41C1-B3B1-B5A6E547515F}.Release|x64.Build.0 = Release|x64
{46219A32-8178-41C1-B3B1-B5A6E547515F}.Release-dll|Win32.ActiveCfg = Release|Win32
{46219A32-8178-41C1-B3B1-B5A6E547515F}.Release-dll|Win32.Build.0 = Release|Win32
{46219A32-8178-41C1-B3B1-B5A6E547515F}.Release-dll|x64.ActiveCfg = Release|x64
{46219A32-8178-41C1-B3B1-B5A6E547515F}.Release-dll|x64.Build.0 = Release|x64
{BC090130-2C53-4CF6-8AD4-37BF72B8D01A}.Debug|Win32.ActiveCfg = Debug|Win32
{BC090130-2C53-4CF6-8AD4-37BF72B8D01A}.Debug|Win32.Build.0 = Debug|Win32
{BC090130-2C53-4CF6-8AD4-37BF72B8D01A}.Debug|x64.ActiveCfg = Debug|x64
{BC090130-2C53-4CF6-8AD4-37BF72B8D01A}.Debug|x64.Build.0 = Debug|x64
{BC090130-2C53-4CF6-8AD4-37BF72B8D01A}.Debug-dll|Win32.ActiveCfg = Debug|Win32
{BC090130-2C53-4CF6-8AD4-37BF72B8D01A}.Debug-dll|x64.ActiveCfg = Debug|x64
{BC090130-2C53-4CF6-8AD4-37BF72B8D01A}.Release|Win32.ActiveCfg = Release|Win32
{BC090130-2C53-4CF6-8AD4-37BF72B8D01A}.Release|Win32.Build.0 = Release|Win32
{BC090130-2C53-4CF6-8AD4-37BF72B8D01A}.Release|x64.ActiveCfg = Release|x64
{BC090130-2C53-4CF6-8AD4-37BF72B8D01A}.Release|x64.Build.0 = Release|x64
{BC090130-2C53-4CF6-8AD4-37BF72B8D01A}.Release-dll|Win32.ActiveCfg = Release|Win32
{BC090130-2C53-4CF6-8AD4-37BF72B8D01A}.Release-dll|x64.ActiveCfg = Release|x64
{DE1F395D-4F53-42FB-8AEF-993A4BF7E411}.Debug|Win32.ActiveCfg = Debug|Win32
{DE1F395D-4F53-42FB-8AEF-993A4BF7E411}.Debug|Win32.Build.0 = Debug|Win32
{DE1F395D-4F53-42FB-8AEF-993A4BF7E411}.Debug|x64.ActiveCfg = Debug|x64
{DE1F395D-4F53-42FB-8AEF-993A4BF7E411}.Debug|x64.Build.0 = Debug|x64
{DE1F395D-4F53-42FB-8AEF-993A4BF7E411}.Debug-dll|Win32.ActiveCfg = Debug|Win32
{DE1F395D-4F53-42FB-8AEF-993A4BF7E411}.Debug-dll|x64.ActiveCfg = Debug|x64
{DE1F395D-4F53-42FB-8AEF-993A4BF7E411}.Release|Win32.ActiveCfg = Release|Win32
{DE1F395D-4F53-42FB-8AEF-993A4BF7E411}.Release|Win32.Build.0 = Release|Win32
{DE1F395D-4F53-42FB-8AEF-993A4BF7E411}.Release|x64.ActiveCfg = Release|x64
{DE1F395D-4F53-42FB-8AEF-993A4BF7E411}.Release|x64.Build.0 = Release|x64
{DE1F395D-4F53-42FB-8AEF-993A4BF7E411}.Release-dll|Win32.ActiveCfg = Release|Win32
{DE1F395D-4F53-42FB-8AEF-993A4BF7E411}.Release-dll|x64.ActiveCfg = Release|x64
{18ABC652-AB11-4993-9491-1A7FB7117339}.Debug|Win32.ActiveCfg = Debug|Win32
{18ABC652-AB11-4993-9491-1A7FB7117339}.Debug|Win32.Build.0 = Debug|Win32
{18ABC652-AB11-4993-9491-1A7FB7117339}.Debug|x64.ActiveCfg = Debug|x64
{18ABC652-AB11-4993-9491-1A7FB7117339}.Debug|x64.Build.0 = Debug|x64
{18ABC652-AB11-4993-9491-1A7FB7117339}.Debug-dll|Win32.ActiveCfg = Debug|Win32
{18ABC652-AB11-4993-9491-1A7FB7117339}.Debug-dll|x64.ActiveCfg = Debug|x64
{18ABC652-AB11-4993-9491-1A7FB7117339}.Release|Win32.ActiveCfg = Release|Win32
{18ABC652-AB11-4993-9491-1A7FB7117339}.Release|Win32.Build.0 = Release|Win32
{18ABC652-AB11-4993-9491-1A7FB7117339}.Release|x64.ActiveCfg = Release|x64
{18ABC652-AB11-4993-9491-1A7FB7117339}.Release|x64.Build.0 = Release|x64
{18ABC652-AB11-4993-9491-1A7FB7117339}.Release-dll|Win32.ActiveCfg = Release|Win32
{18ABC652-AB11-4993-9491-1A7FB7117339}.Release-dll|x64.ActiveCfg = Release|x64
{98EE9884-A4EB-4C75-A911-DFEDF992754F}.Debug|Win32.ActiveCfg = Debug|Win32
{98EE9884-A4EB-4C75-A911-DFEDF992754F}.Debug|Win32.Build.0 = Debug|Win32
{98EE9884-A4EB-4C75-A911-DFEDF992754F}.Debug|x64.ActiveCfg = Debug|x64
{98EE9884-A4EB-4C75-A911-DFEDF992754F}.Debug|x64.Build.0 = Debug|x64
{98EE9884-A4EB-4C75-A911-DFEDF992754F}.Debug-dll|Win32.ActiveCfg = Debug|Win32
{98EE9884-A4EB-4C75-A911-DFEDF992754F}.Debug-dll|x64.ActiveCfg = Debug|x64
{98EE9884-A4EB-4C75-A911-DFEDF992754F}.Release|Win32.ActiveCfg = Release|Win32
{98EE9884-A4EB-4C75-A911-DFEDF992754F}.Release|Win32.Build.0 = Release|Win32
{98EE9884-A4EB-4C75-A911-DFEDF992754F}.Release|x64.ActiveCfg = Release|x64
{98EE9884-A4EB-4C75-A911-DFEDF992754F}.Release|x64.Build.0 = Release|x64
{98EE9884-A4EB-4C75-A911-DFEDF992754F}.Release-dll|Win32.ActiveCfg = Release|Win32
{98EE9884-A4EB-4C75-A911-DFEDF992754F}.Release-dll|x64.ActiveCfg = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {8A5D77A4-7683-4395-84D4-9A22BD625E52}
EndGlobalSection
EndGlobal

View File

@ -0,0 +1,462 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug-dll|Win32">
<Configuration>Debug-dll</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug-dll|x64">
<Configuration>Debug-dll</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release-dll|Win32">
<Configuration>Release-dll</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release-dll|x64">
<Configuration>Release-dll</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{7F500891-CC76-405F-933F-F682BC39F923}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>ref_trace_decode_lib</RootNamespace>
<ProjectName>opencsd_lib</ProjectName>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v143</PlatformToolset>
<EnableASAN>true</EnableASAN>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug-dll|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v143</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v143</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug-dll|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v143</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v143</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release-dll|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v143</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v143</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release-dll|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v143</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\opencsd.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug-dll|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\opencsd.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\opencsd.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug-dll|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\opencsd.props" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\opencsd.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release-dll|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\opencsd.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\opencsd.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release-dll|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\opencsd.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<OutDir>..\..\..\lib\win$(PlatformArchitecture)\dbg\</OutDir>
<TargetName>lib$(LIB_BASE_NAME)</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug-dll|x64'">
<OutDir>..\..\..\lib\win$(PlatformArchitecture)\dbg\</OutDir>
<TargetName>lib$(LIB_BASE_NAME)</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<OutDir>..\..\..\lib\win$(PlatformArchitecture)\rel\</OutDir>
<TargetName>lib$(LIB_BASE_NAME)</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release-dll|x64'">
<OutDir>..\..\..\lib\win$(PlatformArchitecture)\rel\</OutDir>
<TargetName>lib$(LIB_BASE_NAME)</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<OutDir>..\..\..\lib\win$(PlatformArchitecture)\rel\</OutDir>
<TargetName>lib$(LIB_BASE_NAME)</TargetName>
<IntDir>$(Platform)\$(Configuration)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release-dll|Win32'">
<OutDir>..\..\..\lib\win$(PlatformArchitecture)\rel\</OutDir>
<TargetName>lib$(LIB_BASE_NAME)</TargetName>
<IntDir>$(Platform)\$(Configuration)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<OutDir>..\..\..\lib\win$(PlatformArchitecture)\dbg\</OutDir>
<IntDir>$(Platform)\$(Configuration)\</IntDir>
<TargetName>lib$(LIB_BASE_NAME)</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug-dll|Win32'">
<OutDir>..\..\..\lib\win$(PlatformArchitecture)\dbg\</OutDir>
<IntDir>$(Platform)\$(Configuration)\</IntDir>
<TargetName>lib$(LIB_BASE_NAME)</TargetName>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<ProgramDataBaseFileName>$(OutDir)$(TargetName)_vc$(PlatformToolsetVersion).pdb</ProgramDataBaseFileName>
<BasicRuntimeChecks>UninitializedLocalUsageCheck</BasicRuntimeChecks>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug-dll|Win32'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<ProgramDataBaseFileName>$(OutDir)$(TargetName)_vc$(PlatformToolsetVersion).pdb</ProgramDataBaseFileName>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions);</PreprocessorDefinitions>
<AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<ProgramDataBaseFileName>$(OutDir)$(TargetName)_vc$(PlatformToolsetVersion).pdb</ProgramDataBaseFileName>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug-dll|x64'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions);</PreprocessorDefinitions>
<AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<ProgramDataBaseFileName>$(OutDir)$(TargetName)_vc$(PlatformToolsetVersion).pdb</ProgramDataBaseFileName>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<ProgramDataBaseFileName>$(OutDir)$(TargetName)_vc$(PlatformToolsetVersion).pdb</ProgramDataBaseFileName>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release-dll|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<ProgramDataBaseFileName>$(OutDir)$(TargetName)_vc$(PlatformToolsetVersion).pdb</ProgramDataBaseFileName>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<ProgramDataBaseFileName>$(OutDir)$(TargetName)_vc$(PlatformToolsetVersion).pdb</ProgramDataBaseFileName>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release-dll|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<ProgramDataBaseFileName>$(OutDir)$(TargetName)_vc$(PlatformToolsetVersion).pdb</ProgramDataBaseFileName>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<None Include="..\..\..\..\HOWTO.md" />
<None Include="..\..\..\..\LICENSE" />
<None Include="..\..\..\..\README.md" />
<None Include="..\..\..\..\TODO" />
<None Include="..\..\..\docs\build_libs.md" />
<None Include="..\..\..\docs\external_custom.md" />
<None Include="..\..\..\docs\man\trc_pkt_lister.1" />
<None Include="..\..\..\docs\test_progs.md" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\..\include\common\comp_attach_notifier_i.h" />
<ClInclude Include="..\..\..\include\common\comp_attach_pt_t.h" />
<ClInclude Include="..\..\..\include\common\ocsd_code_follower.h" />
<ClInclude Include="..\..\..\include\common\ocsd_dcd_mngr.h" />
<ClInclude Include="..\..\..\include\common\ocsd_dcd_mngr_i.h" />
<ClInclude Include="..\..\..\include\common\ocsd_dcd_tree.h" />
<ClInclude Include="..\..\..\include\common\ocsd_dcd_tree_elem.h" />
<ClInclude Include="..\..\..\include\common\ocsd_error.h" />
<ClInclude Include="..\..\..\include\common\ocsd_error_logger.h" />
<ClInclude Include="..\..\..\include\common\ocsd_gen_elem_list.h" />
<ClInclude Include="..\..\..\include\common\ocsd_gen_elem_stack.h" />
<ClInclude Include="..\..\..\include\common\ocsd_lib_dcd_register.h" />
<ClInclude Include="..\..\..\include\common\ocsd_msg_logger.h" />
<ClInclude Include="..\..\..\include\common\ocsd_pe_context.h" />
<ClInclude Include="..\..\..\include\common\ocsd_version.h" />
<ClInclude Include="..\..\..\include\common\trc_component.h" />
<ClInclude Include="..\..\..\include\common\trc_core_arch_map.h" />
<ClInclude Include="..\..\..\include\common\trc_cs_config.h" />
<ClInclude Include="..\..\..\include\common\trc_frame_deformatter.h" />
<ClInclude Include="..\..\..\include\common\trc_gen_elem.h" />
<ClInclude Include="..\..\..\include\common\trc_pkt_decode_base.h" />
<ClInclude Include="..\..\..\include\common\trc_pkt_elem_base.h" />
<ClInclude Include="..\..\..\include\common\trc_pkt_proc_base.h" />
<ClInclude Include="..\..\..\include\common\trc_printable_elem.h" />
<ClInclude Include="..\..\..\include\common\trc_ret_stack.h" />
<ClInclude Include="..\..\..\include\mem_acc\trc_mem_acc_cache.h" />
<ClInclude Include="..\..\..\include\opencsd\ete\ete_decoder.h" />
<ClInclude Include="..\..\..\include\opencsd\ete\trc_cmp_cfg_ete.h" />
<ClInclude Include="..\..\..\include\opencsd\ete\trc_dcd_mngr_ete.h" />
<ClInclude Include="..\..\..\include\opencsd\ete\trc_pkt_types_ete.h" />
<ClInclude Include="..\..\..\include\opencsd\etmv3\etmv3_decoder.h" />
<ClInclude Include="..\..\..\include\opencsd\etmv3\trc_cmp_cfg_etmv3.h" />
<ClInclude Include="..\..\..\include\opencsd\etmv3\trc_dcd_mngr_etmv3.h" />
<ClInclude Include="..\..\..\include\opencsd\etmv3\trc_pkt_decode_etmv3.h" />
<ClInclude Include="..\..\..\include\opencsd\etmv3\trc_pkt_elem_etmv3.h" />
<ClInclude Include="..\..\..\include\opencsd\etmv3\trc_pkt_proc_etmv3.h" />
<ClInclude Include="..\..\..\include\opencsd\etmv3\trc_pkt_types_etmv3.h" />
<ClInclude Include="..\..\..\include\opencsd\etmv4\etmv4_decoder.h" />
<ClInclude Include="..\..\..\include\opencsd\etmv4\trc_cmp_cfg_etmv4.h" />
<ClInclude Include="..\..\..\include\opencsd\etmv4\trc_dcd_mngr_etmv4i.h" />
<ClInclude Include="..\..\..\include\opencsd\etmv4\trc_etmv4_stack_elem.h" />
<ClInclude Include="..\..\..\include\opencsd\etmv4\trc_pkt_decode_etmv4i.h" />
<ClInclude Include="..\..\..\include\opencsd\etmv4\trc_pkt_elem_etmv4d.h" />
<ClInclude Include="..\..\..\include\opencsd\etmv4\trc_pkt_elem_etmv4i.h" />
<ClInclude Include="..\..\..\include\opencsd\etmv4\trc_pkt_proc_etmv4.h" />
<ClInclude Include="..\..\..\include\opencsd\etmv4\trc_pkt_proc_etmv4i.h" />
<ClInclude Include="..\..\..\include\opencsd\etmv4\trc_pkt_types_etmv4.h" />
<ClInclude Include="..\..\..\include\interfaces\trc_abs_typed_base_i.h" />
<ClInclude Include="..\..\..\include\interfaces\trc_data_rawframe_in_i.h" />
<ClInclude Include="..\..\..\include\interfaces\trc_data_raw_in_i.h" />
<ClInclude Include="..\..\..\include\interfaces\trc_error_log_i.h" />
<ClInclude Include="..\..\..\include\interfaces\trc_gen_elem_in_i.h" />
<ClInclude Include="..\..\..\include\interfaces\trc_indexer_pkt_i.h" />
<ClInclude Include="..\..\..\include\interfaces\trc_indexer_src_i.h" />
<ClInclude Include="..\..\..\include\interfaces\trc_instr_decode_i.h" />
<ClInclude Include="..\..\..\include\interfaces\trc_pkt_in_i.h" />
<ClInclude Include="..\..\..\include\interfaces\trc_pkt_raw_in_i.h" />
<ClInclude Include="..\..\..\include\interfaces\trc_tgt_mem_access_i.h" />
<ClInclude Include="..\..\..\include\i_dec\trc_idec_arminst.h" />
<ClInclude Include="..\..\..\include\i_dec\trc_i_decode.h" />
<ClInclude Include="..\..\..\include\mem_acc\trc_mem_acc.h" />
<ClInclude Include="..\..\..\include\mem_acc\trc_mem_acc_base.h" />
<ClInclude Include="..\..\..\include\mem_acc\trc_mem_acc_bufptr.h" />
<ClInclude Include="..\..\..\include\mem_acc\trc_mem_acc_cb.h" />
<ClInclude Include="..\..\..\include\mem_acc\trc_mem_acc_cb_if.h" />
<ClInclude Include="..\..\..\include\mem_acc\trc_mem_acc_file.h" />
<ClInclude Include="..\..\..\include\mem_acc\trc_mem_acc_mapper.h" />
<ClInclude Include="..\..\..\include\opencsd\ocsd_if_types.h" />
<ClInclude Include="..\..\..\include\opencsd.h" />
<ClInclude Include="..\..\..\include\opencsd\ocsd_if_version.h" />
<ClInclude Include="..\..\..\include\pkt_printers\gen_elem_printer.h" />
<ClInclude Include="..\..\..\include\pkt_printers\item_printer.h" />
<ClInclude Include="..\..\..\include\pkt_printers\pkt_printer_t.h" />
<ClInclude Include="..\..\..\include\pkt_printers\raw_frame_printer.h" />
<ClInclude Include="..\..\..\include\pkt_printers\trc_pkt_printers.h" />
<ClInclude Include="..\..\..\include\pkt_printers\trc_print_fact.h" />
<ClInclude Include="..\..\..\include\opencsd\ptm\ptm_decoder.h" />
<ClInclude Include="..\..\..\include\opencsd\ptm\trc_cmp_cfg_ptm.h" />
<ClInclude Include="..\..\..\include\opencsd\ptm\trc_dcd_mngr_ptm.h" />
<ClInclude Include="..\..\..\include\opencsd\ptm\trc_pkt_decode_ptm.h" />
<ClInclude Include="..\..\..\include\opencsd\ptm\trc_pkt_elem_ptm.h" />
<ClInclude Include="..\..\..\include\opencsd\ptm\trc_pkt_proc_ptm.h" />
<ClInclude Include="..\..\..\include\opencsd\ptm\trc_pkt_types_ptm.h" />
<ClInclude Include="..\..\..\include\opencsd\stm\stm_decoder.h" />
<ClInclude Include="..\..\..\include\opencsd\stm\trc_cmp_cfg_stm.h" />
<ClInclude Include="..\..\..\include\opencsd\stm\trc_dcd_mngr_stm.h" />
<ClInclude Include="..\..\..\include\opencsd\stm\trc_pkt_decode_stm.h" />
<ClInclude Include="..\..\..\include\opencsd\stm\trc_pkt_elem_stm.h" />
<ClInclude Include="..\..\..\include\opencsd\stm\trc_pkt_proc_stm.h" />
<ClInclude Include="..\..\..\include\opencsd\stm\trc_pkt_types_stm.h" />
<ClInclude Include="..\..\..\include\opencsd\trc_gen_elem_types.h" />
<ClInclude Include="..\..\..\include\opencsd\trc_pkt_types.h" />
<ClInclude Include="..\..\..\source\etmv3\trc_pkt_proc_etmv3_impl.h" />
<ClInclude Include="..\..\..\source\trc_frame_deformatter_impl.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\..\source\ete\trc_cmp_cfg_ete.cpp" />
<ClCompile Include="..\..\..\source\etmv3\trc_cmp_cfg_etmv3.cpp" />
<ClCompile Include="..\..\..\source\etmv3\trc_pkt_decode_etmv3.cpp" />
<ClCompile Include="..\..\..\source\etmv3\trc_pkt_elem_etmv3.cpp" />
<ClCompile Include="..\..\..\source\etmv3\trc_pkt_proc_etmv3.cpp" />
<ClCompile Include="..\..\..\source\etmv3\trc_pkt_proc_etmv3_impl.cpp" />
<ClCompile Include="..\..\..\source\etmv4\trc_cmp_cfg_etmv4.cpp" />
<ClCompile Include="..\..\..\source\etmv4\trc_etmv4_stack_elem.cpp" />
<ClCompile Include="..\..\..\source\etmv4\trc_pkt_decode_etmv4i.cpp" />
<ClCompile Include="..\..\..\source\etmv4\trc_pkt_elem_etmv4i.cpp" />
<ClCompile Include="..\..\..\source\etmv4\trc_pkt_proc_etmv4i.cpp" />
<ClCompile Include="..\..\..\source\i_dec\trc_idec_arminst.cpp" />
<ClCompile Include="..\..\..\source\i_dec\trc_i_decode.cpp" />
<ClCompile Include="..\..\..\source\mem_acc\trc_mem_acc_base.cpp" />
<ClCompile Include="..\..\..\source\mem_acc\trc_mem_acc_bufptr.cpp" />
<ClCompile Include="..\..\..\source\mem_acc\trc_mem_acc_cache.cpp" />
<ClCompile Include="..\..\..\source\mem_acc\trc_mem_acc_cb.cpp" />
<ClCompile Include="..\..\..\source\mem_acc\trc_mem_acc_file.cpp" />
<ClCompile Include="..\..\..\source\mem_acc\trc_mem_acc_mapper.cpp" />
<ClCompile Include="..\..\..\source\ocsd_code_follower.cpp" />
<ClCompile Include="..\..\..\source\ocsd_dcd_tree.cpp" />
<ClCompile Include="..\..\..\source\ocsd_error.cpp" />
<ClCompile Include="..\..\..\source\ocsd_error_logger.cpp" />
<ClCompile Include="..\..\..\source\ocsd_gen_elem_list.cpp" />
<ClCompile Include="..\..\..\source\ocsd_gen_elem_stack.cpp" />
<ClCompile Include="..\..\..\source\ocsd_lib_dcd_register.cpp" />
<ClCompile Include="..\..\..\source\ocsd_msg_logger.cpp" />
<ClCompile Include="..\..\..\source\ocsd_version.cpp" />
<ClCompile Include="..\..\..\source\pkt_printers\raw_frame_printer.cpp" />
<ClCompile Include="..\..\..\source\pkt_printers\trc_print_fact.cpp" />
<ClCompile Include="..\..\..\source\ptm\trc_cmp_cfg_ptm.cpp" />
<ClCompile Include="..\..\..\source\ptm\trc_pkt_decode_ptm.cpp" />
<ClCompile Include="..\..\..\source\ptm\trc_pkt_elem_ptm.cpp" />
<ClCompile Include="..\..\..\source\ptm\trc_pkt_proc_ptm.cpp" />
<ClCompile Include="..\..\..\source\stm\trc_pkt_decode_stm.cpp" />
<ClCompile Include="..\..\..\source\stm\trc_pkt_elem_stm.cpp" />
<ClCompile Include="..\..\..\source\stm\trc_pkt_proc_stm.cpp" />
<ClCompile Include="..\..\..\source\trc_component.cpp" />
<ClCompile Include="..\..\..\source\trc_core_arch_map.cpp" />
<ClCompile Include="..\..\..\source\trc_frame_deformatter.cpp" />
<ClCompile Include="..\..\..\source\trc_gen_elem.cpp" />
<ClCompile Include="..\..\..\source\trc_printable_elem.cpp" />
<ClCompile Include="..\..\..\source\trc_ret_stack.cpp" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@ -0,0 +1,515 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
<Filter Include="interfaces">
<UniqueIdentifier>{80012968-9f0d-4623-901a-c2fa5f1c0890}</UniqueIdentifier>
</Filter>
<Filter Include="Header Files\etmv3">
<UniqueIdentifier>{98cd2a71-b44f-4884-bb8a-56c851cc8321}</UniqueIdentifier>
</Filter>
<Filter Include="Header Files\etmv4">
<UniqueIdentifier>{dd155712-7990-4cdd-b9b0-299d97f625e4}</UniqueIdentifier>
</Filter>
<Filter Include="Header Files\ptm">
<UniqueIdentifier>{9ec501e2-9ba4-4bad-a3d3-cdb604cc38b4}</UniqueIdentifier>
</Filter>
<Filter Include="Header Files\mem_acc">
<UniqueIdentifier>{23a35c62-e38f-43f6-a03b-6f1287478a69}</UniqueIdentifier>
</Filter>
<Filter Include="Header Files\i_dec">
<UniqueIdentifier>{f550018a-8974-4f8b-975a-bd8b86ae418f}</UniqueIdentifier>
</Filter>
<Filter Include="Header Files\stm">
<UniqueIdentifier>{2c796b59-81f6-49c9-88cf-e90ed2e741a3}</UniqueIdentifier>
</Filter>
<Filter Include="docs-files">
<UniqueIdentifier>{5ea7e02d-0667-4d2d-8c3d-039daf112edc}</UniqueIdentifier>
</Filter>
<Filter Include="Source Files\ptm">
<UniqueIdentifier>{2aa8a97b-13da-4bd1-bdb5-02f3e1cf030b}</UniqueIdentifier>
</Filter>
<Filter Include="Source Files\etmv4">
<UniqueIdentifier>{ff9157b6-ef07-41e4-8ff4-322c50ea6665}</UniqueIdentifier>
</Filter>
<Filter Include="Source Files\etmv3">
<UniqueIdentifier>{0c2ba881-cc82-4567-ab59-d2363b4c3d1b}</UniqueIdentifier>
</Filter>
<Filter Include="Source Files\stm">
<UniqueIdentifier>{73a56760-b7ff-4d56-88f0-13249201081c}</UniqueIdentifier>
</Filter>
<Filter Include="Source Files\i_dec">
<UniqueIdentifier>{cb3682ee-abbd-44c3-a175-4522d76e2d68}</UniqueIdentifier>
</Filter>
<Filter Include="Source Files\mem_acc">
<UniqueIdentifier>{eb9beab1-99c6-4eaa-88c0-893b05b2e673}</UniqueIdentifier>
</Filter>
<Filter Include="Header Files\common">
<UniqueIdentifier>{58d2398e-efdd-45d9-b7be-fc6096f3bec2}</UniqueIdentifier>
</Filter>
<Filter Include="Header Files\pkt_printers">
<UniqueIdentifier>{0e6e1f5d-465e-4f91-88a3-479952bbd316}</UniqueIdentifier>
</Filter>
<Filter Include="Source Files\pkt_printers">
<UniqueIdentifier>{baf047d0-0ff7-4502-b42b-4f1fda94d54b}</UniqueIdentifier>
</Filter>
<Filter Include="Header Files\ete">
<UniqueIdentifier>{3d119e90-c89b-4f27-8163-305924453e1f}</UniqueIdentifier>
</Filter>
<Filter Include="Source Files\ete">
<UniqueIdentifier>{8cfdb19c-28fc-4e79-b8d5-4e54907b1f82}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<None Include="..\..\..\..\LICENSE">
<Filter>docs-files</Filter>
</None>
<None Include="..\..\..\..\README.md">
<Filter>docs-files</Filter>
</None>
<None Include="..\..\..\..\TODO">
<Filter>docs-files</Filter>
</None>
<None Include="..\..\..\docs\build_libs.md">
<Filter>docs-files</Filter>
</None>
<None Include="..\..\..\docs\test_progs.md">
<Filter>docs-files</Filter>
</None>
<None Include="..\..\..\..\HOWTO.md">
<Filter>docs-files</Filter>
</None>
<None Include="..\..\..\docs\external_custom.md">
<Filter>docs-files</Filter>
</None>
<None Include="..\..\..\docs\man\trc_pkt_lister.1">
<Filter>docs-files</Filter>
</None>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\..\source\trc_frame_deformatter_impl.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\interfaces\trc_tgt_mem_access_i.h">
<Filter>interfaces</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\interfaces\trc_pkt_raw_in_i.h">
<Filter>interfaces</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\interfaces\trc_pkt_in_i.h">
<Filter>interfaces</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\interfaces\trc_instr_decode_i.h">
<Filter>interfaces</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\interfaces\trc_indexer_src_i.h">
<Filter>interfaces</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\interfaces\trc_indexer_pkt_i.h">
<Filter>interfaces</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\interfaces\trc_gen_elem_in_i.h">
<Filter>interfaces</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\interfaces\trc_error_log_i.h">
<Filter>interfaces</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\interfaces\trc_data_raw_in_i.h">
<Filter>interfaces</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\interfaces\trc_data_rawframe_in_i.h">
<Filter>interfaces</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd\etmv3\etmv3_decoder.h">
<Filter>Header Files\etmv3</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd\etmv3\trc_pkt_elem_etmv3.h">
<Filter>Header Files\etmv3</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd\etmv3\trc_cmp_cfg_etmv3.h">
<Filter>Header Files\etmv3</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd\etmv3\trc_pkt_proc_etmv3.h">
<Filter>Header Files\etmv3</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd\etmv3\trc_pkt_types_etmv3.h">
<Filter>Header Files\etmv3</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd\etmv4\trc_pkt_proc_etmv4.h">
<Filter>Header Files\etmv4</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd\etmv4\trc_pkt_types_etmv4.h">
<Filter>Header Files\etmv4</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd\etmv4\trc_pkt_elem_etmv4d.h">
<Filter>Header Files\etmv4</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd\etmv4\trc_pkt_elem_etmv4i.h">
<Filter>Header Files\etmv4</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd\etmv4\trc_cmp_cfg_etmv4.h">
<Filter>Header Files\etmv4</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd\etmv4\etmv4_decoder.h">
<Filter>Header Files\etmv4</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd\ptm\trc_pkt_elem_ptm.h">
<Filter>Header Files\ptm</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd\ptm\trc_cmp_cfg_ptm.h">
<Filter>Header Files\ptm</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd\ptm\trc_pkt_types_ptm.h">
<Filter>Header Files\ptm</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd\ptm\trc_pkt_proc_ptm.h">
<Filter>Header Files\ptm</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd\ptm\ptm_decoder.h">
<Filter>Header Files\ptm</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\mem_acc\trc_mem_acc_base.h">
<Filter>Header Files\mem_acc</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\mem_acc\trc_mem_acc_file.h">
<Filter>Header Files\mem_acc</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\mem_acc\trc_mem_acc_bufptr.h">
<Filter>Header Files\mem_acc</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\mem_acc\trc_mem_acc_mapper.h">
<Filter>Header Files\mem_acc</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\i_dec\trc_idec_arminst.h">
<Filter>Header Files\i_dec</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\i_dec\trc_i_decode.h">
<Filter>Header Files\i_dec</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd\etmv4\trc_pkt_decode_etmv4i.h">
<Filter>Header Files\etmv4</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\mem_acc\trc_mem_acc.h">
<Filter>Header Files\mem_acc</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd\stm\stm_decoder.h">
<Filter>Header Files\stm</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd\stm\trc_pkt_elem_stm.h">
<Filter>Header Files\stm</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd\stm\trc_cmp_cfg_stm.h">
<Filter>Header Files\stm</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd\stm\trc_pkt_proc_stm.h">
<Filter>Header Files\stm</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd\stm\trc_pkt_types_stm.h">
<Filter>Header Files\stm</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd\etmv3\trc_pkt_decode_etmv3.h">
<Filter>Header Files\etmv3</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\mem_acc\trc_mem_acc_cb_if.h">
<Filter>Header Files\mem_acc</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\mem_acc\trc_mem_acc_cb.h">
<Filter>Header Files\mem_acc</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd\ptm\trc_pkt_decode_ptm.h">
<Filter>Header Files\ptm</Filter>
</ClInclude>
<ClInclude Include="..\..\..\source\etmv3\trc_pkt_proc_etmv3_impl.h">
<Filter>Source Files\etmv3</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\common\comp_attach_notifier_i.h">
<Filter>Header Files\common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\common\comp_attach_pt_t.h">
<Filter>Header Files\common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\common\ocsd_dcd_tree.h">
<Filter>Header Files\common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\common\ocsd_dcd_tree_elem.h">
<Filter>Header Files\common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\common\ocsd_error.h">
<Filter>Header Files\common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\common\ocsd_error_logger.h">
<Filter>Header Files\common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\common\ocsd_msg_logger.h">
<Filter>Header Files\common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\common\ocsd_version.h">
<Filter>Header Files\common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\common\trc_component.h">
<Filter>Header Files\common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\common\trc_core_arch_map.h">
<Filter>Header Files\common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\common\trc_frame_deformatter.h">
<Filter>Header Files\common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\common\trc_gen_elem.h">
<Filter>Header Files\common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\common\trc_pkt_decode_base.h">
<Filter>Header Files\common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\common\trc_pkt_proc_base.h">
<Filter>Header Files\common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\common\trc_printable_elem.h">
<Filter>Header Files\common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\common\ocsd_pe_context.h">
<Filter>Header Files\common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\common\ocsd_code_follower.h">
<Filter>Header Files\common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\common\ocsd_gen_elem_list.h">
<Filter>Header Files\common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\common\trc_cs_config.h">
<Filter>Header Files\common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\common\ocsd_dcd_mngr.h">
<Filter>Header Files\common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\common\ocsd_dcd_mngr_i.h">
<Filter>Header Files\common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\common\ocsd_lib_dcd_register.h">
<Filter>Header Files\common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\interfaces\trc_abs_typed_base_i.h">
<Filter>interfaces</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd\etmv4\trc_dcd_mngr_etmv4i.h">
<Filter>Header Files\etmv4</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd\etmv3\trc_dcd_mngr_etmv3.h">
<Filter>Source Files\etmv3</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd\ptm\trc_dcd_mngr_ptm.h">
<Filter>Header Files\ptm</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd\stm\trc_dcd_mngr_stm.h">
<Filter>Header Files\stm</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\common\trc_pkt_elem_base.h">
<Filter>Header Files\common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd\stm\trc_pkt_decode_stm.h">
<Filter>Header Files\stm</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\pkt_printers\gen_elem_printer.h">
<Filter>Header Files\pkt_printers</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\pkt_printers\item_printer.h">
<Filter>Header Files\pkt_printers</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\pkt_printers\pkt_printer_t.h">
<Filter>Header Files\pkt_printers</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\pkt_printers\raw_frame_printer.h">
<Filter>Header Files\pkt_printers</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\pkt_printers\trc_pkt_printers.h">
<Filter>Header Files\pkt_printers</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\pkt_printers\trc_print_fact.h">
<Filter>Header Files\pkt_printers</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\common\trc_ret_stack.h">
<Filter>Header Files\common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd\etmv4\trc_etmv4_stack_elem.h">
<Filter>Header Files\etmv4</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd\ocsd_if_types.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd\trc_gen_elem_types.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd\trc_pkt_types.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\mem_acc\trc_mem_acc_cache.h">
<Filter>Header Files\mem_acc</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd\ocsd_if_version.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\common\ocsd_gen_elem_stack.h">
<Filter>Header Files\common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd\ete\trc_pkt_types_ete.h">
<Filter>Header Files\ete</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd\ete\trc_cmp_cfg_ete.h">
<Filter>Header Files\ete</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd\ete\trc_dcd_mngr_ete.h">
<Filter>Header Files\ete</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd\ete\ete_decoder.h">
<Filter>Header Files\ete</Filter>
</ClInclude>
<ClInclude Include="..\..\..\include\opencsd\etmv4\trc_pkt_proc_etmv4i.h">
<Filter>Header Files\etmv4</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\..\source\trc_component.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\trc_frame_deformatter.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\trc_core_arch_map.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\trc_printable_elem.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\trc_gen_elem.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\ptm\trc_pkt_decode_ptm.cpp">
<Filter>Source Files\ptm</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\ptm\trc_pkt_elem_ptm.cpp">
<Filter>Source Files\ptm</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\ptm\trc_pkt_proc_ptm.cpp">
<Filter>Source Files\ptm</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\etmv4\trc_pkt_elem_etmv4i.cpp">
<Filter>Source Files\etmv4</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\etmv4\trc_pkt_decode_etmv4i.cpp">
<Filter>Source Files\etmv4</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\etmv3\trc_pkt_elem_etmv3.cpp">
<Filter>Source Files\etmv3</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\etmv3\trc_pkt_decode_etmv3.cpp">
<Filter>Source Files\etmv3</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\etmv3\trc_cmp_cfg_etmv3.cpp">
<Filter>Source Files\etmv3</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\etmv3\trc_pkt_proc_etmv3.cpp">
<Filter>Source Files\etmv3</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\etmv3\trc_pkt_proc_etmv3_impl.cpp">
<Filter>Source Files\etmv3</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\etmv4\trc_cmp_cfg_etmv4.cpp">
<Filter>Source Files\etmv4</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\ptm\trc_cmp_cfg_ptm.cpp">
<Filter>Source Files\ptm</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\stm\trc_pkt_proc_stm.cpp">
<Filter>Source Files\stm</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\stm\trc_pkt_elem_stm.cpp">
<Filter>Source Files\stm</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\i_dec\trc_i_decode.cpp">
<Filter>Source Files\i_dec</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\i_dec\trc_idec_arminst.cpp">
<Filter>Source Files\i_dec</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\mem_acc\trc_mem_acc_base.cpp">
<Filter>Source Files\mem_acc</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\mem_acc\trc_mem_acc_mapper.cpp">
<Filter>Source Files\mem_acc</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\mem_acc\trc_mem_acc_bufptr.cpp">
<Filter>Source Files\mem_acc</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\mem_acc\trc_mem_acc_cb.cpp">
<Filter>Source Files\mem_acc</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\mem_acc\trc_mem_acc_file.cpp">
<Filter>Source Files\mem_acc</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\ocsd_dcd_tree.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\ocsd_error.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\ocsd_error_logger.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\ocsd_msg_logger.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\ocsd_version.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\ocsd_code_follower.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\ocsd_gen_elem_list.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\ocsd_lib_dcd_register.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\stm\trc_pkt_decode_stm.cpp">
<Filter>Source Files\stm</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\pkt_printers\raw_frame_printer.cpp">
<Filter>Source Files\pkt_printers</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\pkt_printers\trc_print_fact.cpp">
<Filter>Source Files\pkt_printers</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\trc_ret_stack.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\etmv4\trc_etmv4_stack_elem.cpp">
<Filter>Source Files\etmv4</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\mem_acc\trc_mem_acc_cache.cpp">
<Filter>Source Files\mem_acc</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\etmv4\trc_pkt_proc_etmv4i.cpp">
<Filter>Source Files\etmv4</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\ocsd_gen_elem_stack.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\source\ete\trc_cmp_cfg_ete.cpp">
<Filter>Source Files\ete</Filter>
</ClCompile>
</ItemGroup>
</Project>

View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project>
<ProjectOutputs />
<ContentFiles />
<SatelliteDlls />
<NonRecipeFileRefs />
</Project>

174
decoder/docs/build_libs.md Normal file
View File

@ -0,0 +1,174 @@
Building and using the Library {#build_lib}
==============================
@brief How to build the library and test programs and include the library in an application
Platform Support
----------------
The current makefiles and build projects support building the library on:
- Linux and Windows, x86 or x64 hosts.
- ARM linux - AArch32 and AArch64
- ARM aarch32 and aarch64 libs, x-compiled on x86/64 hosts.
In addition to building the library from the project, the library may be installed into the standard
`/usr/lib/` area in Linux, and will soon be available as a package from Linux Distros.
Building the Library
--------------------
The library and test programs are built from the library `./build/<platform>` directory, where
<platform> is either 'linux' or 'win-vs2015' / 'win-vs2022'
See [`./docs/test_progs.md`](@ref test_progs) for further information on use of the test
programs.
### Linux x86/x64/ARM ###
Libraries are built into a <tgt_dir>. This is used as the final output directory for the
libraries in `decoder/lib/<tgt_dir>`, and also as a sub-directory of the build process for
intermediate files - `decoder/build/linux/ref_trace_decode_lib/<tgt_dir>`.
For a standard build, go to the `./build/linux/` and run `make` in that directory.
This will set <tgt_dir> to `builddir` for all build variants of the library. Using this only one variant of the library can be built at any one time.
For development, alternatively use `make -f makefile.dev`
This will set <tgt_dir> to `linux<bit-variant>/<dbg|rel>` and therefore build libraries into the
`decoder/lib/linux<bit-variant>/<dbg|rel>` directories, allowing multiple variants of the library
to be present during development.
e.g.
`./lib/linux64/rel` will contain the linux 64 bit release libraries.
`./lib/linux-arm64/dbg` will contain the linux aarch 64 debug libraries for ARM.
Options to pass to both makefiles are:-
- `DEBUG=1` : build the debug version of the library.
Options to pass to makefile.dev are:-
- ARCH=<arch> : sets the bit variant in the delivery directories. Set if cross compilation for ARCH
other than host. Otherwise ARCH is auto-detected.
<arch> can be x86, x86_64, arm, arm64, aarch64, aarch32
For cross compilation, set the environment variable `CROSS_COMPILE` to the name path/prefix for the
compiler to use. The following would set the environment to cross-compile for ARM
export PATH=$PATH:~/work/gcc-x-aarch64-6.2/bin
export ARCH=arm64
export CROSS_COMPILE=aarch64-linux-gnu-
The makefile will scan the `ocsd_if_version.h` to get the library version numbers and use these
in the form Major.minor.patch when naming the output .so files.
Main C++ library names:
- `libcstraced.so.M.m.p` : shared library containing the main C++ based decoder library
- `libcstrace.so.M` : symbolic link name to library - major version only.
- `libcstrace.so` : symbolic link name to library - no version.
C API wrapper library names:
- `libcstraced_c_api.so.M.m.p` : shared library containing the C-API wrapper library. Dependent on `libcstraced.so.M`
- `libcstraced_c_api.so.M` : symbolic link name to library - major version only.
- `libcstraced_c_api.so` : symbolic link name to library - no version.
Static versions of the libraries:
- `libcstraced.a` : static library containing the main C++ based decoder library.
- `libcstraced_c_api.a` : static library containing the C-API wrapper library.
Test programs are delivered to the `./tests/bin/<tgt_dir>` directories.
The test programs are built to used the .so versions of the libraries.
- `trc_pkt_lister` - dependent on `libcstraced.so`.
- `simple_pkt_print_c_api` - dependent on `libcstraced_c_api.so` & hence `libcstraced.so`.
The test program build for `trc_pkt_lister` also builds an auxiliary library used by this program for test purposes only.
This is the `libsnapshot_parser.a` library, delivered to the `./tests/lib/<tgt_dir>` directories.
**Note on Linux Build Directory Names**
Due to tool limitations, the makefiles will not operate correctly if the path to the opencsd directories contains spaces.
e.g. checking out the project into a directory such as ` /home/name/my opencsd/` will result in build failures.
__Installing on Linux__
The libraries can be installed on linux using the `make install` command. This will usually require root privileges. Installation will be the version in the `./lib/<tgt_dir>` directory, according to options chosen.
e.g. ` make -f makefile.dev DEBUG=1 install`
will install from `./lib/linux64/dbg`
The libraries `libopencsd` and `libopencsd_c_api` are installed to `/usr/lib`.
Sufficient header files to build using the C-API library will be installed to `/usr/include/opencsd`.
The installation can be removed using `make clean_install`. No additional options are necessary.
### Windows (x86/x64) ###
Use the `.\build\win\ref_trace_decode_lib\ref_trace_decode_lib.sln` file to load a solution
which contains all library and test build projects.
Libraries are delivered to the `./lib/win<bitsize>/<dbg\rel>` directories.
e.g. `./lib/win64/rel` will contain the windows 64 bit release libraries.
The solution contains four configurations:-
- *Debug* : builds debug versions of static C++ main library and C-API libraries, test programs linked to the static library.
- *Debug-dll* : builds debug versions of static main library and C-API DLL. C-API statically linked to the main library.
C-API test built as `simple_pkt_print_c_api-dl.exe` and linked against the DLL version of the C-API library.
- *Release* : builds release static library versions, test programs linked to static libraries.
- *Release-dll* : builds release C-API DLL, static main library.
_Note_: Currently there is no Windows DLL version of the main C++ library. This may follow once
the project is nearer completion with further decode protocols, and the classes requiring export are established..
Libraries built are:-
- `libcstraced.lib` : static main C++ decoder library.
- `cstraced_c_api.dll` : C-API DLL library. Statically linked against `libcstraced.lib` at .DLL build time.
- `libcstraced_c_api.lib` : C-API static library.
There is also a project file to build an auxiliary library used `trc_pkt_lister` for test purposes only.
This is the `snapshot_parser_lib.lib` library, delivered to the `./tests/lib/win<bitsize>/<dgb\rel>` directories.
### Additional Build Options ###
__Library Virtual Address Size__
The ocsd_if_types.h file includes a #define that controls the size of the virtual addresses
used within the library. By default this is a 64 bit `uint64_t` value.
When building for ARM architectures that have only a 32 bit Virtual Address, and building on
32 bit ARM architectures it may be desirable to build a library that uses a v-addr size of
32 bits. Define `USE_32BIT_V_ADDR` to enable this option
Including the Library in an Application
---------------------------------------
The user source code includes a header according to the API to be used:-
- Main C++ decoder library - include `opencsd.h`. Link to C++ library.
- C-API library - include `opencsd_c_api.h`. Link to C-API library.
### Linux build ###
By default linux builds will link against the .so versions of the library. Using the C-API library will also
introduce a dependency on the main C++ decoder .so. Ensure that the library paths and link commands are part of the
application makefile.
To use the static versions use appropriate linker options.
### Windows build ###
To link against the C-API DLL, include the .DLL name as a dependency in the application project options.
To link against the C-API static library, include the library name in the dependency list, and define the macro
`OCSD_USE_STATIC_C_API` in the preprocessor definitions. This ensures that the correct static bindings are declared in
the header file. Also link against the main C++ library.
To link against the main C++ library include the library name in the dependency list.

View File

@ -0,0 +1,127 @@
.\" Hey, EMACS: -*- nroff -*-
.TH TRC_PKT_LISTER 1 "2018-03-28"
.SH NAME
trc_pkt_lister \- decodes captured CoreSight\*R trace
.SH SYNOPSIS
.RI trc_pkt_lister
[ \-ss_dir \fI<dir>\fP ]
[ -ss_verbose ]
[ \-id \fI<n>\fP ]
[ \-src_name \fI<name>\fP ]
[ \-decode ]
[ \-decode_only ]
[ \-src_addr_n ]
[ \-o_raw_packed ]
[ \-o_raw_unpacked ]
[ \-logstdout ]
[ \-logstderr ]
[ \-logfile ]
[ \-logfilename \fI<name>\fP ]
.br
.SH DESCRIPTION
.B trc_pkt_lister
is a tool that takes a snapshot directory as an input, and lists and/or
decodes all the trace packets for a single source, for any currently
supported protocol.
.PP
The output will be a list of discrete packets, generic output packets
and any error messages to file and/or screen as selected by the input
command line options.
.PP
By default the program will list packets only (no decode), for the
first discovered trace sink (ETB, ETF, ETR) in the snapshot directory,
with all streams output.
.SH OPTIONS
.SS Snapshot selection
The program defaults to \./ if no \-ss_dir option is given
.TP
.B \-ss\_dir <dir>
Set the directory path to a trace snapshot.
.TP
\fB\fC\-ss\_verbose\fR
Verbose output when reading the snapshot.
.SS Decode options
.TP
.B \-id <n>
Set an ID to list (may be used multiple times) \- default if no id set is for all IDs to be printed.
.TP
.B \-src\_name <name>
List packets from a given snapshot source name (defaults to first source found).
.TP
.B \-decode
Full decode of the packets from the trace snapshot (default is to list undecoded packets only.
.TP
.B \-decode_only
Does not list the undecoded packets, just the trace decode.
.TP
.B \-src\_addr\_n
In ETE protocol, indicate skipped N atoms in source address packet ranges by breaking the decode
range into multiple ranges on N atoms.
.TP
.B \-o\_raw\_packed
Output raw packed trace frames.
.TP
.B \-o\_raw\_unpacked
Output raw unpacked trace data per ID.
.SS Output options
Default is to output to file and stdout. Setting any option overrides and limits to only
the options set.
.TP
.B \-logstdout
output to stdout.
.TP
.B \-logstderr
output to stderr.
.TP
.B \-logfile
output to file using the default log file name.
.TP
.B \-logfilename <name>
change the name of the output log file.
.SH FILES
.B Trace Snapshot directory.
.PP
The \fR./tests/snapshots\fP directory contains a number of trace
snapshots used for testing the library. Trace snapshots are dumps of
captured binary trace data, CoreSight component configurations and
memory dumps to allow trace decode.
.PP
Snapshots are generated on ARM targets and can then be analysed
offline. The snapshot format is available in a separate document.
.SH EXAMPLE
Example command lines with short output excerpts.
.PP
.BI TC2 " ETMv3 packet processor output, raw packet output."
.br
Command line:
.br
.RI "trc\_pkt\_lister -ss\_dir ../../snapshots/TC2 -o_raw_unpacked"
.PP
Output:
.br
Frame Data; Index 17958; ID_DATA[0x11]; 16 04 c0 86 42 97 e1 c4
.br
Idx:17945; ID:11; I_SYNC : Instruction Packet synchronisation.; (Periodic); Addr=0xc00
416e2; S; ISA=Thumb2;
.br
Idx:17961; ID:11; P_HDR : Atom P-header.; WEN; Cycles=1
.br
Frame Data; Index 17968; ID_DATA[0x11]; ce af 90 80 80 00 a4 84 a0 84 a4 88
.br
Idx:17962; ID:11; TIMESTAMP : Timestamp Value.; TS=0x82f9d13097 (562536984727)
.br
Idx:17974; ID:11; P_HDR : Atom P-header.; WW; Cycles=2
.PP
.BI Juno " ETB\_1 selected for STM packet output, raw packet output"
.br
Command line:
.br
.RI "trc\_pkt\_lister -ss\_dir ../../snapshots/juno_r1_1 -o\_raw\_unpacked -src\_name ETB\_1"
.PP
.BI Juno " ETMv4 full trace decode + packet monitor, source trace ID 0x10 only."
.br
Command line:
.br
.RI "trc\_pkt\_lister -ss\_dir ../../snapshots/juno\_r1\_1 -decode -id 0x10"

View File

@ -0,0 +1,469 @@
OpenCSD Library - Generic Trace Packet Descriptions {#generic_pkts}
===================================================
@brief Interpretation of the Generic Trace output packets.
Generic Trace Packets - Collection.
-----------------------------------
### Packet interface ###
The generic trace packets are the fully decoded output from the trace library.
These are delivered to the client application in the form of a callback function. Packets from all trace sources
will use the same single callback function, with the CoreSight Trace ID provided to identify the source.
The callback is in the form of an interface class ITrcGenElemIn, which has a single function:
~~~{.cpp}
virtual ocsd_datapath_resp_t TraceElemIn( const ocsd_trc_index_t index_sop,
const uint8_t trc_chan_id,
const OcsdTraceElement &elem
) = 0;
~~~
The client program will create derived class providing this interface to collect trace packets from the library.
The parameters describe the output packet and source channel:
|Parameter | Description |
|:--------------------------------|:------------------------------------------------------------------------|
| `ocsd_trc_index_t index_sop` | Index of the first byte of the trace packet that generated this output. |
| `uint8_t trc_chan_id` | The source CoreSight Trace ID. |
| `OcsdTraceElement &elem` | The packet class - wraps the `ocsd_generic_trace_elem` structure. |
_Note_ : `index_sop` may be the same for multiple output packets. This is due to an one byte atom packet which
can represent multiple atoms and hence multiple ranges.
The C-API provides a similarly specified callback function definition, with an additional opaque `void *` pointer
that the client application may use.
~~~{.c}
/** function pointer type for decoder outputs. all protocols, generic data element input */
typedef ocsd_datapath_resp_t (* FnTraceElemIn)( const void *p_context,
const ocsd_trc_index_t index_sop,
const uint8_t trc_chan_id,
const ocsd_generic_trace_elem *elem);
~~~
### The Packet Structure ###
~~~{.c}
typedef struct _ocsd_generic_trace_elem {
ocsd_gen_trc_elem_t elem_type; /* Element type - remaining data interpreted according to this value */
ocsd_isa isa; /* instruction set for executed instructions */
ocsd_vaddr_t st_addr; /* start address for instruction execution range / inaccessible code address / data address */
ocsd_vaddr_t en_addr; /* end address (exclusive) for instruction execution range. */
ocsd_pe_context context; /* PE Context */
uint64_t timestamp; /* timestamp value for TS element type */
uint32_t cycle_count; /* cycle count for explicit cycle count element, or count for element with associated cycle count */
ocsd_instr_type last_i_type; /* Last instruction type if instruction execution range */
ocsd_instr_subtype last_i_subtype; /* sub type for last instruction in range */
//! per element flags
union {
struct {
uint32_t last_instr_exec:1; /* 1 if last instruction in range was executed; */
uint32_t last_instr_sz:3; /* size of last instruction in bytes (2/4) */
uint32_t has_cc:1; /* 1 if this packet has a valid cycle count included (e.g. cycle count included as part of instruction range packet, always 1 for pure cycle count packet.*/
uint32_t cpu_freq_change:1; /* 1 if this packet indicates a change in CPU frequency */
uint32_t excep_ret_addr:1; /* 1 if en_addr is the preferred exception return address on exception packet type */
uint32_t excep_data_marker:1; /* 1 if the exception entry packet is a data push marker only, with no address information (used typically in v7M trace for marking data pushed onto stack) */
uint32_t extended_data:1; /* 1 if the packet extended data pointer is valid. Allows packet extensions for custom decoders, or additional data payloads for data trace. */
uint32_t has_ts:1; /* 1 if the packet has an associated timestamp - e.g. SW/STM trace TS+Payload as a single packet */
uint32_t last_instr_cond:1; /* 1 if the last instruction was conditional */
uint32_t excep_ret_addr_br_tgt:1; /* 1 if exception return address (en_addr) is also the target of a taken branch addr from the previous range. */
};
uint32_t flag_bits;
};
//! packet specific payloads
union {
uint32_t exception_number; /* exception number for exception type packets */
trace_event_t trace_event; /* Trace event - trigger etc */
trace_on_reason_t trace_on_reason; /* reason for the trace on packet */
ocsd_swt_info_t sw_trace_info; /* software trace packet info */
uint32_t num_instr_range; /* number of instructions covered by range packet (for T32 this cannot be calculated from en-st/i_size) */
unsync_info_t unsync_eot_info; /* additional information for unsync / end-of-trace packets. */
trace_marker_payload_t sync_marker; /* marker element - sync later element to position in stream */
trace_memtrans_t mem_trans; /* memory transaction packet - transaction event */
trace_sw_ite_t sw_ite; /* PE sw instrumentation using FEAT_ITE */
};
const void *ptr_extended_data; /* pointer to extended data buffer (data trace, sw trace payload) / custom structure */
} ocsd_generic_trace_elem;
~~~
The packet structure contains multiple fields and flag bits. The validity of any of these fields or flags
is dependent on the `elem_type` member. The client program must not assume that field values will persist
between packets, and must process all valid data during the callback function.
The packet reference guide below defines the fields valid for each packet type.
--------------------------------------------------------------------------------------------------
Generic Trace Packets - Packet Reference.
-----------------------------------------
This section contains reference descriptions of each of the generic trace packets types define as part of the
`ocsd_gen_trc_elem_t` enum value that appears as the first `elem_type` field in the packet structure.
The descriptions will include information on which fields in the packets are always valid, optional and any protocol specific information.
The tags used in the reference are:-
- __packet fields valid__ : fields that are always valid and filled for this packet type.
- __packet fields optional__ : fields that _may_ be filled for this packet type.
The form `flag -> field` indicates a flag that may be set and the value that is valid if the flag is true
- __protocol specific__ : indicates type or fields may be source protocol specific.
_Note_: while most of the packets are not protocol specific, there are some protocol differences that mean
certain types and fields will differ slightly across protocols. These differences are highlighted in the
reference.
### OCSD_GEN_TRC_ELEM_NO_SYNC ###
__packet fields valid__: None
Element output before the decoder has synchronised with the input stream, or synchronisation is lost.
### OCSD_GEN_TRC_ELEM_INSTR_RANGE ###
__packet fields valid__: `isa, st_addr, en_addr, last_i_type, last_i_subtype, last_instr_exec, last_instr_sz, num_instr_range, last_instr_cond`
__packet fields optional__: `has_cc -> cycle_count,`
__protocol specific__ : ETMv3, PTM
This should be the most common packet output for full trace decode. Represents a range of instructions of
a single `isa`, executed by the PE. Instruction byte range is from `st_addr` (inclusive) to `en_addr` (exclusive).
The total number of instructions executed for the range is given in `num_instr_range`.
Information on the last instruction in the range is provided. `last_i_type` shows if the last instruction
was a branch or otherwise - which combined with `last_instr_exec` determines if the branch was taken.
The last instruction size in bytes is given, to allow clients to quickly determine the address of the last
instruction by subtraction from `en_addr`. This value can be 2 or 4 bytes in the T32 instruction set.
__ETMv3, PTM__ : These protocols can output a cycle count directly as part of the trace packet that generates
the trace range. In this case `has_cc` will be 1 and `cycle_count` will be valid.
### OCSD_GEN_TRC_ELEM_I_RANGE_NOPATH ###
__packet fields valid__: `isa, st_addr, en_addr, num_instr_range`
`num_instr_range` represents the number of instructions executed in this range, but there is incomplete information
as to program execution path from start to end of range.
If `num_instr` is 0, then an unknown number of instructions were executed between the start and end of the range.
`st_addr` represents the start of execution represented by this packet.
`en_addr` represents the address where execution will continue from after the instructions represented by this packet.
`isa` represents the ISA for the instruction at `en_addr`.
Used when ETMv4 Q elements are being traced.
### OCSD_GEN_TRC_ELEM_ADDR_NACC ###
__packet fields valid__: `st_addr`
Trace decoder found address in trace that cannot be accessed in the mapped memory images.
`st_addr` is the address that cannot be found.
Decoder will wait for new address to appear in trace before attempting to restart decoding.
### OCSD_GEN_TRC_ELEM_UNKNOWN ###
__packet fields valid__: None
Decoder saw invalid packet for protocol being processed. Likely incorrect protocol settings, or corrupted
trace data.
### OCSD_GEN_TRC_ELEM_TRACE_ON ###
__packet fields valid__: trace_on_reason
__packet fields optional__: `has_cc -> cycle_count,`
__protocol specific__ : ETMv3, PTM
Notification that trace has started / is synced after a discontinuity or at start of trace decode.
__ETMv3, PTM__ : These protocols can output a cycle count directly as part of the trace packet that generates
the trace on indicator. In this case `has_cc` will be 1 and `cycle_count` will be valid.
### OCSD_GEN_TRC_ELEM_EO_TRACE ###
__packet fields valid__: None
Marker for end of trace data. Sent once for each CoreSight ID channel.
### OCSD_GEN_TRC_ELEM_PE_CONTEXT ###
__packet fields valid__: context
__packet fields optional__: `has_cc -> cycle_count,`
__protocol specific__ : ETMv3, PTM
This packet indicates an update to the PE context - which may be the initial context in a trace stream, or a
change since the trace started.
The context is contained in a `ocsd_pe_context` structure.
~~~{.c}
typedef struct _ocsd_pe_context {
ocsd_sec_level security_level; /* security state */
ocsd_ex_level exception_level; /* exception level */
uint32_t context_id; /* context ID */
uint32_t vmid; /* VMID */
struct {
uint32_t bits64:1; /* 1 if 64 bit operation */
uint32_t ctxt_id_valid:1; /* 1 if context ID value valid */
uint32_t vmid_valid:1; /* 1 if VMID value is valid */
uint32_t el_valid:1; /* 1 if EL value is valid (ETMv4 traces current EL, other protocols do not) */
};
} ocsd_pe_context;
~~~
__ETMv3, PTM__ : These protocols can output a cycle count directly as part of the trace packet that generates
the PE context. In this case `has_cc` will be 1 and `cycle_count` will be valid.
__ETMv3__ : From ETM 3.5 onwards, exception_level can be set to `ocsd_EL2` when tracing through hypervisor code.
On all other occasions this will be set to `ocsd_EL_unknown`.
### OCSD_GEN_TRC_ELEM_ADDR_UNKNOWN ###
__packet fields optional__: `has_cc -> cycle_count,`
__protocol specific__: ETMv3
This packet will only be seen when decoding an ETMv3 protocol source. This indicates that the decoder
is waiting for a valid address in order to process trace correctly.
The packet can have a cycle count associated with it which the client must account for when tracking cycles used.
The packet will be sent once when unknown address occurs. Further `OCSD_GEN_TRC_ELEM_CYCLE_COUNT` packets may follow
before the decode receives a valid address to continue decode.
### OCSD_GEN_TRC_ELEM_EXCEPTION ###
__packet fields valid__: `exception_number`
__packet fields optional__: `has_cc -> cycle_count, excep_ret_addr -> en_addr, excep_data_marker, excep_ret_addr_br_tgt`
__protocol specific__: ETMv4, ETMv3, PTM
All protocols will include the exception number in the packet.
__ETMv4__ : This protocol may provide the preferred return address for the exception - this is the address of
the instruction that could be executed on exception return. This address appears in `en_addr` if `excep_ret_addr` = 1.
Additionally, this address could also represent the target address of a branch, if the exception occured at the branch target, before any further instructions were execute. If htis is the case then the excep_ret_addr_br_tgt flag will be set. This makes explicit what was previously only implied by teh packet ordered. This information could be used for clients such as perf that branch source/target address pairs.
__ETMv3__ : This can set the `excep_data_marker` flag. This indicates that the exception packet is a marker
to indicate exception entry in a 7M profile core, for the purposes of tracking data. This will __not__ provide
an exception number in this case.
__PTM__ : Can have an associated cycle count (`has_cc == 1`), and may provide preferred return address in `en_addr`
if `excep_ret_addr` = 1.
### OCSD_GEN_TRC_ELEM_EXCEPTION_RET ###
__packet fields valid__: None
Marker that a preceding branch was an exception return.
### OCSD_GEN_TRC_ELEM_TIMESTAMP ###
__packet fields valid__: `timestamp`
__packet fields optional__: `has_cc -> cycle_count,`
__protocol specific__: ETMv4, PTM
The timestamp packet explicitly provides a timestamp value for the trace stream ID in the callback interface.
__PTM__ : This can have an associated cycle count (`has_cc == 1`). For this protocol, the cycle count __is__ part
of the cumulative cycle count for the trace session.
__ETMv4__ : This can have an associated cycle count (`has_cc == 1`). For this protocl, the cycle coun represents
the number of cycles between the previous cycle count packet and this timestamp packet, but __is not__ part of
the cumulative cycle count for the trace session.
### OCSD_GEN_TRC_ELEM_CYCLE_COUNT ###
__packet fields valid__: `has_cc -> cycle_count`
Packet contains a cycle count value. A cycle count value represents the number of cycles passed since the
last cycle count value seen. The cycle count value may be associated with a specific packet or instruction
range preceding the cycle count packet.
Cycle count packets may be added together to build a cumulative count for the trace session.
### OCSD_GEN_TRC_ELEM_EVENT ###
__packet fields valid__: `trace_event`
This is a hardware event injected into the trace by the ETM/PTM hardware resource programming. See the
relevent trace hardware reference manuals for the programming of these events.
The `trace_event` is a `trace_event_t` structure that can have an event type - and an event number.
~~~{.c}
typedef struct _trace_event_t {
uint16_t ev_type; /* event type - unknown (0) trigger (1), numbered event (2)*/
uint16_t ev_number; /* event number if numbered event type */
} trace_event_t;
~~~
The event types depend on the trace hardware:-
__ETMv4__ : produces numbered events. The event number is a bitfield of up to four events that occurred.
Events 0-3 -> bits 0-3. The bitfield allows a single packet to represent multiple different events occurring.
_Note_: The ETMv4 specification has further information on timing of events and event packets. Event 0
is also considered a trigger event in ETMv4 hardware, but is not explicitly represented as such in the OCSD protocol.
__PTM__, __ETMv3__ : produce trigger events. Event number always set to 0.
### OCSD_GEN_TRC_ELEM_SWTRACE ###
__packet fields valid__: `sw_trace_info`
__packet fields optional__: `has_ts -> timestamp`, ` extended_data -> ptr_extended_data`
The Software trace packet always has a filled in `sw_trace_info` field to describe the current master and channel ID,
plus the packet type and size of any payload data.
SW trace packets that have a payload will use the extended_data flag and pointer to deliver this data.
SW trace packets that include timestamp information will us the `has_ts` flag and fill in the timestamp value.
These packets are generated by memory writes to STM / ITM trace hardware.
### OCSD_GEN_TRC_ELEM_SYNC_MARKER ###
__packet fields valid__: `sync_marker`
Synchronisation marker - marks position in stream of an element that is output later.
e.g. a timestamp marker can be output to represent the correct position in the stream for a
timestamp packet the is output later.
The `sync_marker` field has a structure as shown below.
~~~{.c}
typedef enum _trace_sync_marker_t {
ELEM_MARKER_TS, /**< Marker for timestamp element */
} trace_sync_marker_t;
typedef struct _trace_marker_payload_t {
trace_sync_marker_t type; /**< type of sync marker */
uint32_t value; /**< sync marker value - usage depends on type */
} trace_marker_payload_t;
~~~
### OCSD_GEN_TRC_ELEM_MEMTRANS ###
__packet fields valid__: `mem_trans`
Memory transaction elements may appear in the output stream, if they are not otherwise cancelled
by speculative trace packets.
The memory transaction field has values as defined in the enum below:-
~~~{.c}
typedef enum _memtrans_t {
OCSD_MEM_TRANS_TRACE_INIT,/* Trace started while PE in transactional state */
OCSD_MEM_TRANS_START, /* Trace after this packet is part of a transactional memory sequence */
OCSD_MEM_TRANS_COMMIT, /* Transactional memory sequence valid. */
OCSD_MEM_TRANS_FAIL, /* Transactional memory sequence failed - operations since start of transaction have been unwound. */
} trace_memtrans_t;
~~~
### OCSD_GEN_TRC_ELEM_INSTRUMENTATION ###
__packet fields valid__: `sw_ite`
Software instrumentation packets generated by the PE `TRCIT` instruction (on cores with `FEAT_ITE`).
The `sw_ite` structure has the fields defined below:-
~~~{.c}
typedef struct _sw_ite_t {
uint8_t el; /* exception level for PE sw instrumentation instruction */
uint64_t value; /* payload for PE sw instrumentation instruction */
} trace_sw_ite_t;
~~~
### OCSD_GEN_TRC_ELEM_CUSTOM ###
__packet fields optional__: `extended_data -> ptr_extended_data`,_any others_
Custom protocol decoders can use this packet type to provide protocol specific information.
Standard fields may be used for similar purposes as defined above, or the extended data pointer can reference
other data.
--------------------------------------------------------------------------------------------------
Generic Trace Packets - Notes on interpretation.
------------------------------------------------
The interpretation of the trace output should always be done with reference to the underlying protocol
specifications.
While the output packets are in general protocol agnostic, there are some inevitable
differences related to the underlying protocol that stem from the development of the trace hardware over time.
### OCSD ranges and Trace Atom Packets ###
The most common raw trace packet in all the protocols is the Atom packet, and this packet is the basis for most of
the `OCSD_GEN_TRC_ELEM_INSTR_RANGE` packets output from the library. A trace range will be output for each atom
in the raw trace stream - the `last_instr_exec` flag taking the value of the Atom - 1 for E, 0 for N.
`OCSD_GEN_TRC_ELEM_INSTR_RANGE` packets can also be generated for non-atom packets, where flow changes - e.g.
exceptions.
### Multi feature OCSD output packets ###
Where a raw trace packet contains additional information on top of the basic packet data, then this additional
information will be added to the OCSD output packet and flagged accordingly (in the `flag_bits` union in the
packet structure).
Typically this will be atom+cycle count packets in ETMv3 and PTM protocols. For efficiency and to retain
the coupling between the information an `OCSD_GEN_TRC_ELEM_INSTR_RANGE` packet will be output in this case
with a `has_cc` flag set and the `cycle_count` value filled.
ETMv3 and PTM can add a cycle count to a number of packets, or explicitly emit a cycle count only packet. By
contrast ETMv4 only emits cycle count only packets.
Clients processing the library output must be aware of these optional additions to the base packet. The
OCSD packet descriptions above outline where the additional information can occur.
### Cycle counts ###
Cycle counts are cumulative, and represent cycles since the last cycle count output.
Explicit cycle count packets are associated with the previous range event, otherwise where a
packet includes a cycle count as additional information, then the count is associated with that
specific packet - which will often be a range packet.
The only exception to this is where the underlying protocol is ETMv4, and a cycle count is included
in a timestamp packet. Here the cycle count represents that number of cycles since the last cycle count
packet that occurred before the timestamp packet was emitted. This cycle count is not part of the cumulative
count. See the ETMv4 specification for further details.
### Correlation - timestamps and cycle counts ###
Different trace streams can be correlated using either timestamps, or timestamps plus cycle counts.
Both timestamps and cycle counts are enabled by programming ETM control registers, and it is also possible
to control the frequency that timestamps appear, or the threshold at which cycle count packets are emitted by
additional programming.
The output of timestamps and cycle counts increases the amount of trace generated, very significantly when cycle
counts are present, so the choice of generating these elements needs to be balanced against the requirement
for their use.
Decent correlation can be gained by the use of timestamps alone - especially if the source is programmed to
produce them more frequently than the default timestamp events. More precise correllation can be performed if
the 'gaps' between timestamps can be resolved using cycle counts.
Correlation is performed by identifying the same/close timestamp values in two separate trace streams. Cycle counts
if present can then be used to resolve the correlation with additional accuracy.

View File

@ -0,0 +1,611 @@
OpenCSD Library - Programmers Guide {#prog_guide}
===================================
@brief A guide to programming the OpenCSD library.
Introduction and review of Coresight Hardware
---------------------------------------------
The OpenCSD trace decode library is designed to allow programmers to decode ARM CoreSight trace
data. This guide will describe the various stages of configuring and programming a decoder instance
for a given CoreSight system.
The diagram below shows a typical Coresight trace hardware arrangement
![Example CoreSight Trace Capture Hardware](cs_trace_hw.jpg)
The design shown has four Cortex cores, each with an ETM, along with a system STM all of which generate trace into the
trace funnel. The output of the funnel is fed into a trace sink, which might be an ETB or ETR, saving the trace
which is multiplexed into CoreSight trace frames in the trace sink memory. The colours represent the sources
of trace data, each of which will be tagged with a CoreSight Trace ID.
### CoreSight Trace ID ###
The CoreSight Trace ID - also referred to as the Trace Source Channel ID - is a unique 8 bit number programmed
into each trace source in a system (ETM,PTM,STM) which identifies the source to both the hardware components
downstream and the software trace decoders. This ID is used
Overview of Configuration and Decode
------------------------------------
The OpenCSD library will take the trace data from the trace sink, and when correctly configured and programmed, will
demultiplex and decode each of the trace sources.
The library supports ETMV3, PTM, ETMv4 and STM trace protocols. The decode occurs in three stages:
- __Demultiplex__ - the combined trace streams in CoreSight trace frame format are split into their constituent streams according to the CoreSight trace ID.
- __Packet Processing__ - the individual trace ID streams are resolved into discrete trace packets.
- __Packet Decode__ - the trace packets are interpreted to produce a decoded representation of instructions executed.
There are input configuration requirements for each stage of the decode process - these allow the decode process to correctly
interpret the incoming byte stream.
- __Demultiplex__ - Input flags are set to indicate if the frames are 16 byte aligned or if the stream contains alignment
bytes between frames.
- __Packet Processing__ - The hardware configuration of the trace source must be provided. This consists of a sub-set of the
hardware register values for the source. Each protocol has differing requirements, represented by an input structure of the
register values.
- __Packet Decode__ - For ETM/PTM packet decode, this stage requires the memory images of the code executed in order
to determine the path through the code. These are provided either as memory dumps, or as links to binary code files.
_Note_ : STM, being a largely software generated data trace, does not require memory images to recover the data written by the source
processors.
The diagram below shows the basic stages of decode for the library when used in a client application:
![Example Library Usage for Trace Decode](lib_usage.jpg)
The DecodeTree object is a representation of the structure of the CoreSight hardware, but in reverse in that the data is pushed into the
tree, through the demultiplexor and then along the individual trace stream decode paths till the output decode packets are produced.
These outpup packets are referred to as Generic Trace packets, and are at this stage protocol independent. They consist primarily of
PE context information and address ranges representing the instructions processed.
### Decode Tree ###
The DecodeTree is the principal wrapper for all the decoders the library supports. This provides a programming
API which allows the creation of protocol packet processors and decoders.
The API allows the client application to configure the de-multiplexor, create and connect packet processors and
packet decoders to the trace data streams and collect the output generic decoded trace packets. The DecodeTree
provides a built in instruction decoder to allow correct trace decode, and an additional API through a memory
access handler to allow the client applications to provide the images of the traced code in file or memory dump
format.
Once a DecodeTree is configured, then it can be re-used for multiple sets of captured trace data where the same
set of applications has been traced, or by changing only the supplied memory images, different traced applications
on the same hardware configuration.
The process for programming a decode tree for a specific set of trace hardware is as follows;-
1. Create the decode tree and specify the de-multiplexor options.
2. For each trace protocol of interest, use the API to create a decoder, providing the hardware configuration,
including the CoreSight trace ID for that trace stream. Specify packet processing only, or full decode. Client
program must know the correct protocol to use for each trace stream.
3. Attach callback(s) to receive the decoded generic trace output (ITrcGenElemIn).
4. Provide the memory images if using full decode.
The DecodeTree can now be used to process the trace data by pushing the captured trace data through the trace
data input API call (ITrcDataIn) and analyzing as required the resulting decoded trace (ITrcGenElemIn).
The objects and connections used for a single trace stream are shown below.
![Decode Tree objects - single trace stream](dt_components.jpg)
All these components can be created and used outside of a DecodeTree, but that is beyond the scope of this
guide and expected to be used for custom implementations only.
Programming Examples - decoder configuration.
---------------------------------------------
The remainder of this programming guide will provide programming exceprts for each of the required stages
to get a working decode tree, capable of processing trace data.
The guide will be based on an ETMv4 system, similar to the example above, using the C++ interface, but
equivalent calls from the C-API wrapper library will also be provided.
The source code for the two test applications `trc_pkt_lister` and `c_api_pkt_print_test` may be used as
further programming guidance.
### Create the decode tree ###
The first step is to create the decode tree. Key choices here are the flags defining expected trace data
input format and de-mux operations.
~~~{.cpp}
uint32_t formatterCfgFlags = OCSD_DFRMTR_FRAME_MEM_ALIGN; /* basic operational mode for on-chip captured trace */
DecodeTree *pTree = DecodeTree::CreateDecodeTree(OCSD_TRC_SRC_FRAME_FORMATTED, formatterCfgFlags);
~~~
This creates a decode tree that is usable in the majority of cases - that is for trace captured in on chip
RAM via ETB or ETR. Additional flags are available if a TPIU is used that will indicate to the frame de-mux
that additional frame synchronisation data is present.
In limited cases where the hardware has a single trace source, or only a single source is being used, then
it is possible to switch off the hardware frame formatter in the ETB/ETR/TPIU. In this case @ref OCSD_TRC_SRC_SINGLE
(from enum @ref ocsd_dcd_tree_src_t) may be defined as the first parameter to the function.
C-API version of above code:
~~~{.c}
dcd_tree_handle_t dcdtree_handle = ocsd_create_dcd_tree(OCSD_TRC_SRC_FRAME_FORMATTED, OCSD_DFRMTR_FRAME_MEM_ALIGN);
~~~
### Error loggers and printers ###
The library defines a standard error logging interface ITraceErrorLog which many of the key components can register
with to output errors. The process of registering the source means that errors can be tied to a particular component,
or CoreSight Trace ID. The library provides a standard error logger object - ocsdDefaultErrorLogger - which
keeps a copy of the last error logged, plus a copy of the last error logged for each data stream associated
with a CoreSight trace ID.
The error logger can be attached to an output logger - ocsdMsgLogger - which can print text versions of the
error, or other error messages, out to screen or logging file. Errors can be filtered according to a severity rating,
defined by @ref ocsd_err_severity_t.
The DecodeTree can use a default error logger from the library - with a message logger that will output to `stderr`.
Client applications can create and adjust the configuration of this error logger and message logger by getting and intialising
the logger.
~~~{.cpp}
// ** Initialise default error logger.
DecodeTree::getDefaultErrorLogger()->initErrorLogger(verbosity,true);
~~~
Alternatively clients may provide their own configured error logger / message logger pair.
The test program `trc_pkt_lister` provides a customised version of an `ocsdMsgLogger` / `ocsdDefaultErrorLogger` pair
to ensure that messages and errors are logged to the screen and a file of its choice. This logger is eventually
passed through to the decode tree.
Code excerpts below (trc_pkt_lister.cpp):
~~~{.cpp}
static ocsdMsgLogger logger;
static int logOpts = ocsdMsgLogger::OUT_STDOUT | ocsdMsgLogger::OUT_FILE;
static std::string logfileName = "trc_pkt_lister.ppl";
// ** other vars
main() {
// ** some init code
logger.setLogOpts(logOpts);
logger.setLogFileName(logfileName.c_str());
ocsdDefaultErrorLogger err_log;
err_log.initErrorLogger(OCSD_ERR_SEV_INFO);
err_log.setOutputLogger(&logger);
// pass err_log reference into snapshot library code
SnapShotReader ss_reader;
ss_reader.setErrorLogger(&err_log);
// ** rest of program
}
~~~
In the library code for the snapshot reader (ss_to_dcd_tree.cpp):
~~~{.cpp}
bool CreateDcdTreeFromSnapShot::createDecodeTree()
{
// ** create a decode tree
// use our error logger - don't use the tree default.
m_pDecodeTree->setAlternateErrorLogger(m_pErrLogInterface);
}
~~~
__Note__: The Snapshot reader library is test code designed to allow the test application read trace snapshots
which are in the form defined by the open specification in `./decoder/docs/specs/ARM Trace and Debug Snapshot file format 0v2.pdf`
This format is used in ARM's DS-5 debugger, and the open source CoreSight Access Library (CSAL).
### Configuring decoders ###
The next task is to configure the requried decoders. The client program must know the type of ETM/PTM in use
to correctly set the decoder configuration.
Each class of trace source has a specific set of register values that the decoder requires to correctly interpret the
raw trace data and convert it to packets then fully decode.
Configuration of an ETMv4 decoder requires initialisation of the EtmV4Config class, which is achieved by filling in a
@ref ocsd_etmv4_cfg structure:-
~~~{.c}
typedef struct _ocsd_etmv4_cfg
{
uint32_t reg_idr0; /**< ID0 register */
uint32_t reg_idr1; /**< ID1 register */
uint32_t reg_idr2; /**< ID2 register */
uint32_t reg_idr8;
uint32_t reg_idr9;
uint32_t reg_idr10;
uint32_t reg_idr11;
uint32_t reg_idr12;
uint32_t reg_idr13;
uint32_t reg_configr; /**< Config Register */
uint32_t reg_traceidr; /**< Trace Stream ID register */
ocsd_arch_version_t arch_ver; /**< Architecture version */
ocsd_core_profile_t core_prof; /**< Core Profile */
} ocsd_etmv4_cfg;
~~~
The structure contains a number of read-only ID registers, and key programmable control registers that define
the trace output features - such as if the ETM will output timestamps or cycle counts - and the CoreSight Trace ID.
Once this structure is filled in then the decoder can be configured in the decode tree:-
~~~{.cpp}
ocsd_etmv4_cfg config;
// ...
// code to fill in config from programmed registers and id registers
// ...
EtmV4Config configObj(&config); // initialise decoder config class
std::string decoderName(OCSD_BUILTIN_DCD_ETMV4I); // use built in ETMv4 instruction decoder.
int decoderCreateFlags = OCSD_CREATE_FLG_FULL_DECODER; // decoder type to create - OCSD_CREATE_FLG_PACKET_PROC for packet processor only
ocsd_err_t err = pDecodeTree->createDecoder(decoderName, decoderCreateFlags,&configObj);
~~~
This code creates a full trace decoder for an ETMv4 source, which consists of a packet processor and packet decoder pair. The decoder is automatically associated with the
CoreSight Trace ID programmed into the register provided in the `config` structure.
It is also possible to create a packet processor only decoder if the `OCSD_CREATE_FLG_PACKET_PROC` flag is
used instead. These packet only decoders can be used to create a dump of the raw trace as discrete trace packets.
All decoders a registered with the library using a name - the standard ARM protocols are considered built in
decoders and are registered automatically. The library contains defined names for these decoders - `OCSD_BUILTIN_DCD_ETMV4I`
being the name used for ETMv4 protocol.
The C-API uses the call create_generic_decoder() with the same configuration structure:-
~~~{.c}
ocsd_etmv4_cfg config;
// ...
// code to fill in config from programmed registers and id registers
// ...
const char * decoderName = OCSD_BUILTIN_DCD_ETMV4I); // use built in ETMv4 instruction decoder.
int decoderCreateFlags = OCSD_CREATE_FLG_FULL_DECODER; // decoder type to create - OCSD_CREATE_FLG_PACKET_PROC for packet processor only
void *p_context = // <some_client_context>
ocsd_err_t err = create_generic_decoder(dcdtree_handle,decoderName,(void *)&config,p_context);
~~~
The configuration must be completed for each trace source in the decode tree which requires decoding.
The different trace source types have different configuration structures, classes and names
| protocol | config struct | class | name define |
|:----------|:--------------------|:------------|:-----------------------------|
| __ETE__ | @ref ocsd_ete_cfg | ETEConfig | @ref OCSD_BUILTIN_DCD_ETE |
| __ETMv4__ | @ref ocsd_etmv4_cfg | EtmV4Config | @ref OCSD_BUILTIN_DCD_ETMV4I |
| __ETMv3__ | @ref ocsd_etmv3_cfg | EtmV3Config | @ref OCSD_BUILTIN_DCD_ETMV3 |
| __PTM__ | @ref ocsd_ptm_cfg | PtmConfig | @ref OCSD_BUILTIN_DCD_PTM |
| __STM__ | @ref ocsd_stm_cfg | STMConfig | @ref OCSD_BUILTIN_DCD_STM |
### Adding in Memory Images ###
Memory images are needed when a full trace decode is required. Memory images consist of a base address and length, and
contain instruction opcodes that may be executed during the operation of the traced program. The images are used by
the decoder to follow the path of the traced program by interpreting the information contained within the trace that
defines which program branches are taken and the target addresses of those branches.
The library defined memory image accessor objects, which can be simple memory buffers, files containing the binary
code image, or a callback that allows the client to handle memory accesses directly. When files are used, the
object may contain a set of base addresses and lengths, with offsets into the file - allowing the decoder
to directly access multiple code segments in executable image files.
Memory image objects are collated by a memory mapper. This interfaces to the decoder through the ITargetMemAccess interface,
and selects the correct image object for the address requested by the decoder. The memory mapper will also validate image
objects as they are added to the decoder, and will not permit overlapping images.
![Memory Mapper and Memory Images](memacc_objs.jpg)
The client can add memory images to the decoder via API calls to the decode tree. These methods add memory image accessors of various
types to be managed by a memory access mapper:-
~~~{.cpp}
class DecodeTree {
// ...
ocsd_err_t createMemAccMapper(memacc_mapper_t type = MEMACC_MAP_GLOBAL);
// ...
ocsd_err_t addBufferMemAcc(const ocsd_vaddr_t address, const ocsd_mem_space_acc_t mem_space, const uint8_t *p_mem_buffer, const uint32_t mem_length);
ocsd_err_t addBinFileMemAcc(const ocsd_vaddr_t address, const ocsd_mem_space_acc_t mem_space, const std::string &filepath);
ocsd_err_t addBinFileRegionMemAcc(const ocsd_file_mem_region_t *region_array, const int num_regions, const ocsd_mem_space_acc_t mem_space, const std::string &filepath); */
ocsd_err_t addCallbackMemAcc(const ocsd_vaddr_t st_address, const ocsd_vaddr_t en_address, const ocsd_mem_space_acc_t mem_space, Fn_MemAcc_CB p_cb_func, const void *p_context);
// ...
}
~~~
The `createMemAccMapper()` function must be called to create the mapper, before the `add...MemAcc()` calls are used.
It is further possible to differentiate between memory image access objects by the memory space for which they are valid. If it is known that a certain code image
is present in secure EL3, then an image can be associated with the @ref ocsd_mem_space_acc_t type value @ref OCSD_MEM_SPACE_EL3, which will allow another image to be
present at the same address but a different exception level. However, for the majority of systems, such detailed knowledge of the code is not available, or
overlaps across memory spaces do not occur. In these cases, and for general use (including Linux trace decode), @ref OCSD_MEM_SPACE_ANY should be used.
The C-API contains a similar set of calls to set up memory access objects:-
~~~{.c}
OCSD_C_API ocsd_err_t ocsd_dt_add_buffer_mem_acc(const dcd_tree_handle_t handle, const ocsd_vaddr_t address, const ocsd_mem_space_acc_t mem_space, const uint8_t *p_mem_buffer, const uint32_t mem_length);
OCSD_C_API ocsd_err_t ocsd_dt_add_binfile_mem_acc(const dcd_tree_handle_t handle, const ocsd_vaddr_t address, const ocsd_mem_space_acc_t mem_space, const char *filepath);
OCSD_C_API ocsd_err_t ocsd_dt_add_binfile_region_mem_acc(const dcd_tree_handle_t handle, const ocsd_file_mem_region_t *region_array, const int num_regions, const ocsd_mem_space_acc_t mem_space, const char *filepath);
OCSD_C_API ocsd_err_t ocsd_dt_add_callback_mem_acc(const dcd_tree_handle_t handle, const ocsd_vaddr_t st_address, const ocsd_vaddr_t en_address, const ocsd_mem_space_acc_t mem_space, Fn_MemAcc_CB p_cb_func, const void *p_context);
~~~
Note that the C-API will automatically create a default mapper when the first memory access object is added.
### Adding the output callbacks ###
The decoded trace output ia collect by the client application through callback functions registered with the library.
Depending on the decode configuration chosen, this can be in the form of the fully decoded trace output as generic trace
packets, or discrete trace packets for each trace stream ID.
__Full Decode__
When full decode is chosen then all output is via the generic packet interface:
~~~{.cpp}
class ITrcGenElemIn
{
///...
virtual ocsd_datapath_resp_t TraceElemIn(const ocsd_trc_index_t index_sop,
const uint8_t trc_chan_id,
const OcsdTraceElement &el);
}
~~~
The client application registers a callback class or function with this signature.
For each output packet the libary calls the registered function, providing the byte index into the raw trace for the first
byte of the trace protocol packet that resulted in its generation, plus the CoreSight trace ID of the source stream,
#and the output packet itself.
The client callback must process the packet before returning the call - the reference to the packet data is only
valid for the duration of the call. This means that the client will either have to copy and buffer packets for later
processing if required, process immediately, or use an appropriate combination, dependent on the requirements of the
client.
The client callback provides a ocsd_datapath_resp_t response code to indicate to the input side of the library if decoding is to continue.
~~~{.cpp}
DecodeTree *pTree;
TrcGenericElementPrinter genElemPrinter; // derived from ITrcGenElemIn, overrides TraceElemIn() to print incoming packet to logger.
///...
pTree->setGenTraceElemOutI(genElemPrinter);
~~~
Alternatively in C-API, the callback function pointer type is defined:-
~~~{.c}
typedef ocsd_datapath_resp_t (* FnTraceElemIn)( const void *p_context,
const ocsd_trc_index_t index_sop,
const uint8_t trc_chan_id,
const ocsd_generic_trace_elem *elem);
~~~
giving API calls to set up:-
~~~{.c}
FnTraceElemIn gen_pkt_fn = &gen_trace_elem_analyze; // set to function matching signature.
dcd_tree_handle_t dcdtree_handle;
// ...
ret = ocsd_dt_set_gen_elem_outfn(dcdtree_handle, gen_pkt_fn, 0);
~~~
The output packets and their intepretatation are described here [prog_guide_generic_pkts.md](@ref generic_pkts).
__Packet Process only, or Monitor packets in Full Decode__
The client can set up the library for packet processing only, in which case the library output is
the trace packets only, so these packets need a sink callback for each channel being output.
When full decode is in operation, then the principle output is the generic packets that are output for
all channels in operation to the single callback mentioned above. Additional callbacks can be added to
each of the trace channels to monitor the packet processing stage as it happens at point that the packets
are passed to the full decoder.
Both methods of processing the discrete trace packets require callbacks to be registered on a
per Trace ID / channel basis. The specifics of the callback and the resulting packet will vary according to
the protocol of the trace source.
The .cpp interface registers a packet sink / packet monitor object with the relevant decoder object.
This sink object is based on the tempated IPktDataIn interface.
~~~{.cpp}
template<class P> class IPktDataIn : public ITrcTypedBase {
// ...
virtual ocsd_datapath_resp_t PacketDataIn( const ocsd_datapath_op_t op,
const ocsd_trc_index_t index_sop,
const P *p_packet_in) = 0;
}
~~~
The template type parameter will be the protocol type for the trace source in question - e.g. EtmV4ITrcPacket.
This interface contains a method that will be called with trace packets.
The monitor object must be based on the IPktRawDataMon class, with a similarly typed template parameter and callback
function.
~~~{.cpp}
template<class P> class IPktRawDataMon : public ITrcTypedBase {
// ...
virtual void RawPacketDataMon( const ocsd_datapath_op_t op,
const ocsd_trc_index_t index_sop,
const P *pkt,
const uint32_t size,
const uint8_t *p_data) = 0;
}
~~~
Given a suitable callback object the process for attaching to the decode is as follows:-
~~~{.cpp}
// client custom packet sink for ETMv4 - derived from IPktDataIn
class MyTracePacketSinkETMv4 : public IPktDataIn<EtmV4ITrcPacket> {
// ...
};
uint8_t CSID;
DecodeTree *pTree; // pointer to decode tree
MyTracePacketSinkETMv4 *pSink;
// ... obtain CSID and decode tree object
// decode trees manage decode elements using a tree element object, registered against CSID.
DecodeTreeElement *pElement = pTree->getDecoderElement(CSID);
pSink = new MyTracePacketSinkETMv4();
if (pElement && pSink)
err = pElement->getDecoderMngr()->attachPktSink(pElement->getDecoderHandle(), pSink);
~~~
The decode tree object is used to obtain the decode tree element associated with the Coresight trace ID.
The IDecoderMngr interface on this object is used to attach the packet sink object to the required decoder.
For monitor objects use an attachPktMonitor() call with a suitably derived monitor sink object.
The key difference between the packet sink, and the packet monitor is that the monitor is not in the trace decode
data path, so does not return ocsd_datapath_resp_t values. The monitor callback also provides the raw trace byte
data for the packet.
Device tree call for registering a callback in C-API and the function signatures for each type of shown below..
The C-API code contains underlying managment code that connects the callback with the correct packet decoder object.
~~~{.c}
OCSD_C_API ocsd_err_t ocsd_dt_attach_packet_callback( const dcd_tree_handle_t handle, // decode tree handle
const unsigned char CSID, // trace channel ID
const ocsd_c_api_cb_types callback_type, // defines packet only processing sink or monitor function signature.
void *p_fn_callback_data, // pointer to the callback function for the packet data.
const void *p_context); // opaque context to use inside the callback.
~~~
Callback definition for packet only sink callback type:
~~~{.c}
/** function pointer type for packet processor packet output sink, packet analyser/decoder input - generic declaration */
typedef ocsd_datapath_resp_t (* FnDefPktDataIn)(const void *p_context,
const ocsd_datapath_op_t op,
const ocsd_trc_index_t index_sop,
const void *p_packet_in
);
~~~
Callback definition for packet monitor callback type
~~~{.c}
/** function pointer type for packet processor packet monitor sink, raw packet monitor / display input - generic declaration */
typedef void (* FnDefPktDataMon)(const void *p_context,
const ocsd_datapath_op_t op,
const ocsd_trc_index_t index_sop,
const void *p_packet_in,
const uint32_t size,
const uint8_t *p_data
);
~~~
As with the `.cpp` code, the monitor callback does not have a return value, but also has the raw trace bytes for the packet as part of
the monitor.
In both cases in the C-API, the `void *p_packet_in` must be cast to packet structure appropriate to the trace protocol associated with the
CSID value. e.g. for ETMv4 this would be @ref ocsd_etmv4_i_pkt.
Programming Examples - using the configured Decode Tree.
--------------------------------------------------------
Once the decode tree has been configured then data raw trace data can be processed through the decode tree.
The client program will require two functions to use the library. The first is on the input side of the library
which must be driven with raw data, until the data is complete, or an error occurs. This processing routine must
check the library returns and respond appropriately.
The second consists of output callback(s) which process the decoded generic packets, or trace packets.
This routine will return response codes according to the needs of the client.
![Trace Data call and response path](decode_data_path_resp.jpg)
The diagram shows the data input and response path. The data is driven into the decoding library by the client raw data input
routine on the left. Processed packets are received by the client packet callback(s) on the right, and push response codes back
through the library.
The raw data input routine calls the standard ITrcDataIn interface with an operation code, and if appropriate some raw
trace data. The input operation code will define how the library treats the input parameters.
| Operation | Description | Trace Data provided |
|:-------------------|:-----------------------------------------------------------------|:--------------------|
| @ref OCSD_OP_DATA | Process data provided by data pointer parameters. | Yes |
| @ref OCSD_OP_FLUSH | Call after prior wait response - finish processing previous data | No |
| @ref OCSD_OP_EOT | End of trace data. Library will complete any pending decode. | No |
| @ref OCSD_OP_RESET | Hard reset of decoder state - use current config for new data | No |
A set of standard responses is used to indicate to the raw data input whether it should continue to push data through the library,
pause and then flush, or if a fatal processing error has occurred.
The response codes can come from the internal library decoder, or from the part of the client that is handling the processing of the
output packets on the right of the diagram.
_Response Codes_: The are contained in the @ref _ocsd_datapath_resp_t enum.
- __OCSD_RESP_CONT, OCSD_RESP_CONT_xxx__: Indicates that processing is to continue. Generated either internally by the library if more data
is needed to generate an output packet, or by the output packet processors to indicate processing
is to continue.
- __OCSD_RESP_WAIT, OCSD_RESP_WAIT_xxx:__ Sent by the client processors to pause processing. This will freeze the internal state of the library
and cause the WAIT response to be propogated through to the input side, with an indication of the number
of bytes processed. After a WAIT, the input side must respond with flush operations, until a CONT is
seen again and further data can then be input into the library.
- __OCSR_RESP_FATAL_xxx__: Fatal processing error. No further processing can take place. See error response logger for reason.
Normally the result of corrupt or incorrect trace data.
The user should note that the client program controls routines on both the input and output side of the library. The output routine may be buffering
output packets, and when the buffer is full, returns a WAIT ressponse. This will be propgated through to the input routine. This should now terminate
data processing, saving state and the client will run a routine to empty / process the full packet buffer. Once the necessary processing is done,
then the input routine can be restarted, but __must__ follow the FLUSH operational rule described above.
Excerpts from the data input routine used by the `trc_pkt_lister` program are shown below:
~~~{.cpp}
// process the current buffer load until buffer done, or fatal error occurs
while((nBuffProcessed < nBuffRead) && !OCSD_DATA_RESP_IS_FATAL(dataPathResp))
{
if(OCSD_DATA_RESP_IS_CONT(dataPathResp))
{
dataPathResp = dcd_tree->TraceDataIn(
OCSD_OP_DATA,
trace_index,
(uint32_t)(nBuffRead - nBuffProcessed),
&(trace_buffer[0])+nBuffProcessed,
&nUsedThisTime);
nBuffProcessed += nUsedThisTime;
trace_index += nUsedThisTime;
}
else // last response was _WAIT
{
// may need to acknowledge a wait from the gen elem printer
if(genElemPrinter->needAckWait())
genElemPrinter->ackWait();
// dataPathResp not continue or fatal so must be wait...
dataPathResp = dcd_tree->TraceDataIn(OCSD_OP_FLUSH,0,0,0,0);
}
}
~~~
_Note_: in this test program, the WAIT response is an artificial test condition, so the input routine does not terminate on seeing it - it is cleared down
and FLUSH is immediately sent. Normal client routines would most likely drop out of the processing loop, take actions to clear the WAIT condition, then
resume processing with a FLUSH.
See the `trc_pkt_lister` and `c_api_pkt_print_test` test program source code for further examples of driving data through the library.

213
decoder/docs/test_progs.md Normal file
View File

@ -0,0 +1,213 @@
Test Programs {#test_progs}
=============
@brief A description of the test programs used with the library.
The Programs
------------
There are currently two test programs built alongside the library.
1. `trc_pkt_lister` : This test the C++ library by taking a trace "snapshot" directory as an input
and decodes all or a chosen set of trace sources from within the trace data buffers in the library. Command
line parameters allow the test program to be controlled.
2. `c_api_pkt_print_test` : This program tests the "C" API functions, using hardcoded tests
based on the same "snapshots" used for the C++ library. Limited user control for this program.
This can also run tests using the external test decoder to validate the external decoder API.
See [external_custom.md](@ref custom_decoders) for details.
These programs are both built at the same time as the library for the same set of platforms.
See [build_libs.md](@ref build_lib) for build details.
_Note:_ The programs above use the library's [core name mapper helper class] (@ref CoreArchProfileMap) to map
the name of the core into a profile / architecture pair that the library can use.
The snapshot definition must use one of the names recognised by this class or an error will occur.
Trace "Snapshot" directory.
----------------------------
The `.\tests\snapshots` directory contains a number of trace snapshots used for testing the library.
Trace snapshots are dumps of captured binary trace data, CoreSight component configurations and memory
dumps to allow trace decode.
Snapshots are generated on ARM targets and can then be analysed offline. The snapshot format is available
in a separate document.
The `trc_pkt_lister` program.
-----------------------------
This will take a snapshot directory as an input, and list and/or decode all the trace packets for a
single source, for any currently supported protocol.
The output will be a list of discrete packets, generic output packets and any error messages
to file and/or screen as selected by the input command line options.
By default the program will list packets only (no decode), for the first discovered trace sink
(ETB, ETF, ETR) in the snapshot directory, with all streams output.
__Command Line Options__
*Snapshot selection*
- `-ss_dir <dir>` : Set the directory path to a trace snapshot.
- `-ss_verbose` : Verbose output when reading the snapshot.
*Decode options*
- `-id <n>` : Set an ID to list (may be used multiple times) - default if no id set is for all IDs to be printed.
- `-src_name <name>` : List packets from a given snapshot source name (defaults to first source found).
- `-tpiu` : Input data is from a TPIU source that has TPIU FSYNC packets present.
- `-tpiu_hsync` : Input data is from a TPIU source that has both TPIU FSYNC and HSYNC packets present.
- `-decode` : Full decode of the packets from the trace snapshot (default is to list undecoded packets only.
- `-decode_only` : Does not list the undecoded packets, just the trace decode.
- `-src_addr_n` : ETE protocol; Indicate skipped N atoms in source address packet ranges by breaking the decode
range into multiple ranges on N atoms.
- `-o_raw_packed` : Output raw packed trace frames.
- `-o_raw_unpacked` : Output raw unpacked trace data per ID.
*Output options*
Default is to output to file and stdout. Setting any option overrides and limits to only
the options set.
- `-logstdout` : output to stdout.
- `-logstderr` : output to stderr.
- `-logfile` : output to file using the default log file name.
- `-logfilename <name>` : change the name of the output log file.
__Test output examples__
Example command lines with short output excerpts.
*TC2, ETMv3 packet processor output, raw packet output.*
Command line:-
`trc_pkt_lister -ss_dir ..\..\..\snapshots\TC2 -o_raw_unpacked`
~~~~~~~~~~~~~~~~
Frame Data; Index 17958; ID_DATA[0x11]; 16 04 c0 86 42 97 e1 c4
Idx:17945; ID:11; I_SYNC : Instruction Packet synchronisation.; (Periodic); Addr=0xc00416e2; S; ISA=Thumb2;
Idx:17961; ID:11; P_HDR : Atom P-header.; WEN; Cycles=1
Frame Data; Index 17968; ID_DATA[0x11]; ce af 90 80 80 00 a4 84 a0 84 a4 88
Idx:17962; ID:11; TIMESTAMP : Timestamp Value.; TS=0x82f9d13097 (562536984727)
Idx:17974; ID:11; P_HDR : Atom P-header.; WW; Cycles=2
Idx:17975; ID:11; P_HDR : Atom P-header.; WE; Cycles=1
Idx:17976; ID:11; P_HDR : Atom P-header.; W; Cycles=1
Idx:17977; ID:11; P_HDR : Atom P-header.; WE; Cycles=1
Idx:17978; ID:11; P_HDR : Atom P-header.; WW; Cycles=2
Idx:17979; ID:11; P_HDR : Atom P-header.; WEWE; Cycles=2
Frame Data; Index 17980; ID_DATA[0x10]; a0 82
Idx:17980; ID:10; P_HDR : Atom P-header.; W; Cycles=1
Idx:17981; ID:10; P_HDR : Atom P-header.; WEE; Cycles=1
Frame Data; Index 17984; ID_DATA[0x10]; b8 84 a4 88 a0 82
Idx:17984; ID:10; P_HDR : Atom P-header.; WWWWWWW; Cycles=7
Idx:17985; ID:10; P_HDR : Atom P-header.; WE; Cycles=1
Idx:17986; ID:10; P_HDR : Atom P-header.; WW; Cycles=2
Idx:17987; ID:10; P_HDR : Atom P-header.; WEWE; Cycles=2
Idx:17988; ID:10; P_HDR : Atom P-header.; W; Cycles=1
Idx:17989; ID:10; P_HDR : Atom P-header.; WEE; Cycles=1
~~~~~~~~~~~~~~~~
*Juno - ETB_1 selected for STM packet output, raw packet output*
Command line:-
`trc_pkt_lister -ss_dir ..\..\..\snapshots\juno_r1_1 -o_raw_unpacked -src_name ETB_1`
~~~~~~~~~~~~~~~~
Trace Packet Lister: CS Decode library testing
-----------------------------------------------
Trace Packet Lister : reading snapshot from path ..\..\..\snapshots\juno_r1_1
Using ETB_1 as trace source
Trace Packet Lister : STM Protocol on Trace ID 0x20
Frame Data; Index 0; ID_DATA[0x20]; ff ff ff ff ff ff ff ff ff ff 0f 0f 30 41
Idx:0; ID:20; ASYNC:Alignment synchronisation packet.
Idx:11; ID:20; VERSION:Version packet.; Ver=3
Frame Data; Index 16; ID_DATA[0x20]; f1 1a 00 00 00 30 10 af 01 00 00 10 03 f2 1a
Idx:13; ID:20; M8:Set current master.; Master=0x41
Idx:17; ID:20; D32M:32 bit data; with marker.; Data=0x10000000
Idx:22; ID:20; C8:Set current channel.; Chan=0x0001
Idx:23; ID:20; D32M:32 bit data; with marker.; Data=0x10000001
Idx:28; ID:20; C8:Set current channel.; Chan=0x0002
Frame Data; Index 32; ID_DATA[0x20]; 00 00 00 32 30 af 01 00 00 30 03 f4 1a 00 00
Idx:30; ID:20; D32M:32 bit data; with marker.; Data=0x10000002
Idx:36; ID:20; C8:Set current channel.; Chan=0x0003
Idx:37; ID:20; D32M:32 bit data; with marker.; Data=0x10000003
Idx:42; ID:20; C8:Set current channel.; Chan=0x0004
Frame Data; Index 48; ID_DATA[0x20]; 00 f4 ff ff ff ff ff ff ff ff ff ff f0 00 13
Idx:44; ID:20; D32M:32 bit data; with marker.; Data=0x10000004
Idx:50; ID:20; ASYNC:Alignment synchronisation packet.
Idx:61; ID:20; VERSION:Version packet.; Ver=3
~~~~~~~~~~~~~~~~
*Juno - ETMv4 full trace decode + packet monitor, source trace ID 0x10 only.*
Command line:-
`trc_pkt_lister -ss_dir ..\..\..\snapshots\juno_r1_1 -decode -id 0x10`
~~~~~~~~~~~~~~~~
Idx:17204; ID:10; [0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x80 ]; I_ASYNC : Alignment Synchronisation.
Idx:17218; ID:10; [0x01 0x01 0x00 ]; I_TRACE_INFO : Trace Info.; INFO=0x0
Idx:17221; ID:10; [0x9d 0x00 0x35 0x09 0x00 0xc0 0xff 0xff 0xff ]; I_ADDR_L_64IS0 : Address, Long, 64 bit, IS0.; Addr=0xFFFFFFC000096A00;
Idx:17230; ID:10; [0x04 ]; I_TRACE_ON : Trace On.
Idx:17232; ID:10; [0x85 0x00 0x35 0x09 0x00 0xc0 0xff 0xff 0xff 0xf1 0x00 0x00 0x00 0x00 0x00 ]; I_ADDR_CTXT_L_64IS0 : Address & Context, Long, 64 bit, IS0.; Addr=0xFFFFFFC000096A00; Ctxt: AArch64,EL1, NS; CID=0x00000000; VMID=0x0000;
Idx:17248; ID:10; [0xf7 ]; I_ATOM_F1 : Atom format 1.; E
Idx:17230; ID:10; OCSD_GEN_TRC_ELEM_TRACE_ON( [begin or filter])
Idx:17232; ID:10; OCSD_GEN_TRC_ELEM_PE_CONTEXT((ISA=A64) EL1N; 64-bit; VMID=0x0; CTXTID=0x0; )
Idx:17248; ID:10; OCSD_GEN_TRC_ELEM_INSTR_RANGE(exec range=0xffffffc000096a00:[0xffffffc000096a10] num_i(4) last_sz(4) (ISA=A64) E ISB )
Idx:17249; ID:10; [0x9d 0x30 0x25 0x59 0x00 0xc0 0xff 0xff 0xff ]; I_ADDR_L_64IS0 : Address, Long, 64 bit, IS0.; Addr=0xFFFFFFC000594AC0;
Idx:17258; ID:10; [0xf7 ]; I_ATOM_F1 : Atom format 1.; E
Idx:17258; ID:10; OCSD_GEN_TRC_ELEM_ADDR_NACC( 0xffffffc000594ac0 )
Idx:17259; ID:10; [0x95 0xd6 0x95 ]; I_ADDR_S_IS0 : Address, Short, IS0.; Addr=0xFFFFFFC000592B58 ~[0x12B58]
Idx:17262; ID:10; [0xf9 ]; I_ATOM_F3 : Atom format 3.; ENN
Idx:17262; ID:10; OCSD_GEN_TRC_ELEM_ADDR_NACC( 0xffffffc000592b58 )
Idx:17264; ID:10; [0xf7 ]; I_ATOM_F1 : Atom format 1.; E
Idx:17265; ID:10; [0x9a 0x32 0x62 0x5a 0x00 ]; I_ADDR_L_32IS0 : Address, Long, 32 bit, IS0.; Addr=0xFFFFFFC0005AC4C8;
Idx:17270; ID:10; [0xdb ]; I_ATOM_F2 : Atom format 2.; EE
Idx:17270; ID:10; OCSD_GEN_TRC_ELEM_ADDR_NACC( 0xffffffc0005ac4c8 )
Idx:17271; ID:10; [0x9a 0x62 0x52 0x0e 0x00 ]; I_ADDR_L_32IS0 : Address, Long, 32 bit, IS0.; Addr=0xFFFFFFC0000EA588;
Idx:17276; ID:10; [0xfc ]; I_ATOM_F3 : Atom format 3.; NNE
Idx:17276; ID:10; OCSD_GEN_TRC_ELEM_ADDR_NACC( 0xffffffc0000ea588 )
Idx:17277; ID:10; [0x9a 0x58 0x15 0x59 0x00 ]; I_ADDR_L_32IS0 : Address, Long, 32 bit, IS0.; Addr=0xFFFFFFC000592B60;
Idx:17283; ID:10; [0x06 0x1d ]; I_EXCEPT : Exception.; IRQ; Ret Addr Follows;
Idx:17285; ID:10; [0x95 0x59 ]; I_ADDR_S_IS0 : Address, Short, IS0.; Addr=0xFFFFFFC000592B64 ~[0x164]
Idx:17283; ID:10; OCSD_GEN_TRC_ELEM_ADDR_NACC( 0xffffffc000592b60 )
Idx:17283; ID:10; OCSD_GEN_TRC_ELEM_EXCEPTION(pref ret addr:0xffffffc000592b64; excep num (0x0e) )
Idx:17287; ID:10; [0x9a 0x20 0x19 0x08 0x00 ]; I_ADDR_L_32IS0 : Address, Long, 32 bit, IS0.; Addr=0xFFFFFFC000083280;
Idx:17292; ID:10; [0xfd ]; I_ATOM_F3 : Atom format 3.; ENE
Idx:17292; ID:10; OCSD_GEN_TRC_ELEM_INSTR_RANGE(exec range=0xffffffc000083280:[0xffffffc000083284] num_i(1) last_sz(4) (ISA=A64) E BR )
Idx:17292; ID:10; OCSD_GEN_TRC_ELEM_INSTR_RANGE(exec range=0xffffffc000083d40:[0xffffffc000083d9c] num_i(23) last_sz(4) (ISA=A64) N BR <cond>)
Idx:17292; ID:10; OCSD_GEN_TRC_ELEM_INSTR_RANGE(exec range=0xffffffc000083d9c:[0xffffffc000083dac] num_i(4) last_sz(4) (ISA=A64) E iBR b+link )
Idx:17293; ID:10; [0x95 0xf7 0x09 ]; I_ADDR_S_IS0 : Address, Short, IS0.; Addr=0xFFFFFFC0000813DC ~[0x13DC]
Idx:17297; ID:10; [0xdb ]; I_ATOM_F2 : Atom format 2.; EE
Idx:17297; ID:10; OCSD_GEN_TRC_ELEM_INSTR_RANGE(exec range=0xffffffc0000813dc:[0xffffffc0000813f0] num_i(5) last_sz(4) (ISA=A64) E BR b+link )
Idx:17297; ID:10; OCSD_GEN_TRC_ELEM_INSTR_RANGE(exec range=0xffffffc00008f2e0:[0xffffffc00008f2e4] num_i(1) last_sz(4) (ISA=A64) E iBR A64:ret )
Idx:17298; ID:10; [0x95 0x7e ]; I_ADDR_S_IS0 : Address, Short, IS0.; Addr=0xFFFFFFC0000813F8 ~[0x1F8]
Idx:17300; ID:10; [0xe0 ]; I_ATOM_F6 : Atom format 6.; EEEN
Idx:17300; ID:10; OCSD_GEN_TRC_ELEM_INSTR_RANGE(exec range=0xffffffc0000813f8:[0xffffffc00008140c] num_i(5) last_sz(4) (ISA=A64) E BR )
Idx:17300; ID:10; OCSD_GEN_TRC_ELEM_INSTR_RANGE(exec range=0xffffffc00008141c:[0xffffffc000081434] num_i(6) last_sz(4) (ISA=A64) E BR <cond>)
Idx:17300; ID:10; OCSD_GEN_TRC_ELEM_INSTR_RANGE(exec range=0xffffffc00008140c:[0xffffffc000081414] num_i(2) last_sz(4) (ISA=A64) E BR b+link )
Idx:17300; ID:10; OCSD_GEN_TRC_ELEM_ADDR_NACC( 0xffffffc000117cf0 )
~~~~~~~~~~~~~~~~
The `c_api_pkt_print_test` program.
-----------------------------------
Program tests the C-API infrastructure, including as an option the external decoder support.
Limited to decoding trace from a single CoreSight ID. Uses the same "snapshots" as the C++ test program, but using hardcoded path values.
__Command Line Options__
By default the program will run the single CoreSight ID of 0x10 in packet processing output mode using the ETMv4 decoder on the Juno snapshot.
- `-id <n>` : Change the ID used for the test.
- `-etmv3` : Test the ETMv3 decoder - uses the TC2 snapshot.
- `-ptm` : Test the PTM decoder - uses the TC2 snapshot.
- `-stm` : Test the STM decoder - uses juno STM only snapshot.
- `-extern` : Use the 'echo_test' external decoder to test the custom decoder API.
- `-decode` : Output trace protocol packets and full decode generic packets.
- `-decode_only` : Output full decode generic packets only.

View File

@ -0,0 +1,47 @@
/*
* \file ete_decoder.h
* \brief OpenCSD : Top level header file for ETE decoder.
*
* \copyright Copyright (c) 2019, ARM Limited. All Rights Reserved.
*/
/*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its contributors
* may be used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef ARM_ETE_DECODER_H_INCLUDED
#define ARM_ETE_DECODER_H_INCLUDED
// ETE actually uses extended ETMv4 packet processor and decode
// ETE specifics limited to configuration
//
#include "trc_cmp_cfg_ete.h"
#include "trc_pkt_types_ete.h"
#endif // ARM_ETE_DECODER_H_INCLUDED
/* End of File ete_decoder.h */

View File

@ -0,0 +1,81 @@
/*
* \file trc_cmp_cfg_ete.h
* \brief OpenCSD : ETE configuration
*
* \copyright Copyright (c) 2019, ARM Limited. All Rights Reserved.
*/
/*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its contributors
* may be used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef ARM_TRC_CMP_CFG_ETE_H_INCLUDED
#define ARM_TRC_CMP_CFG_ETE_H_INCLUDED
#include "trc_pkt_types_ete.h"
#include "opencsd/etmv4/trc_cmp_cfg_etmv4.h"
/** @addtogroup ocsd_protocol_cfg
@{*/
/** @name ETE configuration
@{*/
/*!
* @class ETEConfig
* @brief Interpreter class for ETE config structure
*
* ETE trace and config are a superset of ETMv4 trace and config - hence
* use the EtmV4Config class as a base.
*/
class ETEConfig : public EtmV4Config
{
public:
ETEConfig();
ETEConfig(const ocsd_ete_cfg *cfg_regs);
~ETEConfig();
//! copy assignment operator for base structure into class.
ETEConfig & operator=(const ocsd_ete_cfg *p_cfg);
//! cast operator returning struct const reference
operator const ocsd_ete_cfg &() const { return m_ete_cfg; };
//! cast operator returning struct const pointer
operator const ocsd_ete_cfg *() const { return &m_ete_cfg; };
private:
void copyV4(); // copy relevent config to underlying structure.
ocsd_ete_cfg m_ete_cfg;
};
/** @}*/
/** @}*/
#endif // ARM_TRC_CMP_CFG_ETE_H_INCLUDED
/* End of File trc_cmp_cfg_ete.h */

View File

@ -0,0 +1,58 @@
/*
* \file trc_dcd_mngr_ete.h
* \brief OpenCSD : ETE decoder creation.
*
* \copyright Copyright (c) 2019, ARM Limited. All Rights Reserved.
*/
/*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its contributors
* may be used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef ARM_TRC_DCD_MNGR_ETE_H_INCLUDED
#define ARM_TRC_DCD_MNGR_ETE_H_INCLUDED
#include "common/ocsd_dcd_mngr.h"
#include "trc_cmp_cfg_ete.h"
#include "opencsd/etmv4/trc_pkt_decode_etmv4i.h"
#include "opencsd/etmv4/trc_pkt_proc_etmv4.h"
class DecoderMngrETE : public DecodeMngrFullDcdExCfg< EtmV4ITrcPacket,
ocsd_etmv4_i_pkt_type,
EtmV4Config,
ETEConfig,
ocsd_ete_cfg,
TrcPktProcEtmV4I,
TrcPktDecodeEtmV4I>
{
public:
DecoderMngrETE(const std::string &name) : DecodeMngrFullDcdExCfg(name, OCSD_PROTOCOL_ETE) {};
virtual ~DecoderMngrETE() {};
};
#endif // ARM_TRC_DCD_MNGR_ETE_H_INCLUDED
/* End of File trc_dcd_mngr_ete.h */

View File

@ -0,0 +1,66 @@
/*
* \file trc_pkt_types_ete.h
* \brief OpenCSD : ETE types
*
* \copyright Copyright (c) 2019, ARM Limited. All Rights Reserved.
*/
/*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its contributors
* may be used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef ARM_TRC_PKT_TYPES_ETE_H_INCLUDED
#define ARM_TRC_PKT_TYPES_ETE_H_INCLUDED
#include "opencsd/trc_pkt_types.h"
#include "opencsd/etmv4/trc_pkt_types_etmv4.h"
/** @addtogroup trc_pkts
@{*/
/** @name ETE config Types
@{*/
typedef struct _ocsd_ete_cfg
{
uint32_t reg_idr0; /**< ID0 register */
uint32_t reg_idr1; /**< ID1 register */
uint32_t reg_idr2; /**< ID2 register */
uint32_t reg_idr8; /**< ID8 - maxspec */
uint32_t reg_devarch; /**< DevArch register */
uint32_t reg_configr; /**< Config Register */
uint32_t reg_traceidr; /**< Trace Stream ID register */
ocsd_arch_version_t arch_ver; /**< Architecture version */
ocsd_core_profile_t core_prof; /**< Core Profile */
} ocsd_ete_cfg;
/** @}*/
/** @}*/
#endif // ARM_TRC_PKT_TYPES_ETE_H_INCLUDED
/* End of File trc_pkt_types_ete.h */

View File

@ -0,0 +1,98 @@
/*
* \file trc_cmp_cfg_ete.cpp
* \brief OpenCSD : ETE config class
*
* \copyright Copyright (c) 2019, ARM Limited. All Rights Reserved.
*/
/*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its contributors
* may be used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "opencsd/ete/trc_cmp_cfg_ete.h"
ETEConfig::ETEConfig() : EtmV4Config()
{
m_ete_cfg.reg_idr0 = 0x28000EA1;
m_ete_cfg.reg_idr1 = 0x4100FFF3;
m_ete_cfg.reg_idr2 = 0x00000488;
m_ete_cfg.reg_idr8 = 0;
m_ete_cfg.reg_configr = 0xC1;
m_ete_cfg.reg_traceidr = 0;
m_ete_cfg.arch_ver = ARCH_AA64;
m_ete_cfg.core_prof = profile_CortexA;
m_ete_cfg.reg_devarch = 0x47705A13;
copyV4();
}
ETEConfig::ETEConfig(const ocsd_ete_cfg *cfg_regs) : EtmV4Config()
{
m_ete_cfg = *cfg_regs;
copyV4();
}
ETEConfig::~ETEConfig()
{
}
//! copy assignment operator for base structure into class.
ETEConfig & ETEConfig::operator=(const ocsd_ete_cfg *p_cfg)
{
m_ete_cfg = *p_cfg;
copyV4();
return *this;
}
//! cast operator returning struct const reference
//operator const ocsd_ete_cfg &() const { return m_ete_cfg; };
//! cast operator returning struct const pointer
//operator const ocsd_ete_cfg *() const { return &m_ete_cfg; };
// ete superset of etmv4 - move info to underlying structure.
void ETEConfig::copyV4()
{
// copy over 1:1 regs
m_cfg.reg_idr0 = m_ete_cfg.reg_idr0;
m_cfg.reg_idr1 = m_ete_cfg.reg_idr1;
m_cfg.reg_idr2 = m_ete_cfg.reg_idr2;
m_cfg.reg_idr8 = m_ete_cfg.reg_idr8;
m_cfg.reg_idr9 = 0;
m_cfg.reg_idr10 = 0;
m_cfg.reg_idr11 = 0;
m_cfg.reg_idr12 = 0;
m_cfg.reg_idr13 = 0;
m_cfg.reg_configr = m_ete_cfg.reg_configr;
m_cfg.reg_traceidr = m_ete_cfg.reg_traceidr;
m_cfg.core_prof = m_ete_cfg.core_prof;
m_cfg.arch_ver = m_ete_cfg.arch_ver;
// override major / minor version as part of devarch
m_MajVer = (uint8_t)((m_ete_cfg.reg_devarch & 0xF000) >> 12);
m_MinVer = (uint8_t)((m_ete_cfg.reg_devarch & 0xF0000) >> 16);
}
/* End of File trc_cmp_cfg_ete.cpp */

View File

@ -0,0 +1,600 @@
AutoFDO and ARM Trace {#AutoFDO}
=====================
@brief Using CoreSight trace and perf with OpenCSD for AutoFDO.
## Introduction
Feedback directed optimization (FDO, also know as profile guided
optimization - PGO) uses a profile of a program's execution to guide the
optmizations performed by the compiler. Traditionally, this involves
building an instrumented version of the program, which records a profile of
execution as it runs. The instrumentation adds significant runtime
overhead, possibly changing the behaviour of the program and it may not be
possible to run the instrumented program in a production environment
(e.g. where performance criteria must be met).
AutoFDO uses facilities in the hardware to sample the behaviour of the
program in the production environment and generate the execution profile.
An improved profile can be obtained by including the branch history
(i.e. a record of the last branches taken) when generating an instruction
samples. On Arm systems, the ETM can be used to generate such records.
The process can be broken down into the following steps:
* Record execution trace of the program
* Convert the execution trace to instruction samples with branch histories
* Convert the instruction samples to source level profiles
* Use the source level profile with the compiler
This article describes how to enable ETM trace on Arm targets running Linux
and use the ETM trace to generate AutoFDO profiles and compile an optimized
program.
## Execution trace on Arm targets
Debug and trace of Arm targets is provided by CoreSight. This consists of
a set of components that allow access to debug logic, record (trace) the
execution of a processor and route this data through the system, collecting
it into a store.
To record the execution of a processor, we require the following
components:
* A trace source. The core contains a trace unit, called an ETM that emits
data describing the instructions executed by the core.
* Trace links. The trace data generated by the ETM must be moved through
the system to the component that collects the data (sink). Links
include:
* Funnels: merge multiple streams of data
* FIFOs: buffer data to smooth out bursts
* Replicators: send a stream of data to multiple components
* Sinks. These receive the trace data and store it or send it to an
external device:
* ETB: A small circular buffer (64-128 kilobytes) that stores the most
recent data
* ETR: A larger (several megabytes) buffer that uses system RAM to
store data
* TPIU: Sends data to an off-chip capture device (e.g. Arm DSTREAM)
Each Arm SoC design may have a different layout (topology) of components.
This topology is described to the OS drivers by the platform's devicetree
or (in future) ACPI firmware.
For application profiling, we need to store several megabytes of data
within the system, so will use ETR with the capture tool (perf)
periodically draining the buffer to a file.
Even though we have a large capture buffer, the ETM can still generate a
lot of data very quickly - typically an ETM will generate ~1 bit of data
per instruction (depending on the workload), which results in 256Mbytes per
second for a core running at 2GHz. This leads to problems storing and
decoding such large volumes of data. AutoFDO uses samples of program
execution, so we can avoid this problem by using the ETM's features to
only record small slices of execution - e.g. collect ~5000 cycles of data
every 50M cycles. This reduces the data rate to a manageable level - a few
megabytes per minute. This technique is known as 'strobing'.
## Enabling trace
### Driver support
To collect ETM trace, the CoreSight drivers must be included in the
kernel. Some of the driver support is not yet included in the mainline
kernel and many targets are using older kernels. To enable CoreSight trace
on these targets, Arm have provided backports of the latest CoreSight
drivers and ETM strobing patch at:
<https://gitlab.arm.com/linux-arm/linux-coresight-backports>
This repository can be cloned with:
```
git clone https://git.gitlab.arm.com/linux-arm/linux-coresight-backports.git
```
You can include these backports in your kernel by either merging the
appropriate branch using git or generating patches (using `git
format-patch`).
For 5.x based kernel onwards, the only patch which needs to be applied is the one enabling strobing - etm4x: `Enable strobing of ETM`.
For 4.9 based kernels, use the `coresight-4.9-etr-etm_strobe` branch:
```
git merge coresight-4.9-etr-etm_strobe
```
or
```
git format-patch --output-directory /output/dir v4.9..coresight-4.9-etr-etm_strobe
cd my_kernel
git am /output/dir/*.patch # or patch -p1 /output/dir/*.patch if not using git
```
For 4.14 based kernels, use the `coresight-4.14-etm_strobe` branch:
```
git merge coresight-4.14-etm_strobe
```
or
```
git format-patch --output-directory /output/dir v4.14..coresight-4.14-etm_strobe
cd my_kernel
git am /output/dir/*.patch # or patch -p1 /output/dir/*.patch if not using git
```
The CoreSight trace drivers must also be enabled in the kernel
configuration. This can be done using the configuration menu (`make
menuconfig`), selecting `Kernel hacking` / `arm64 Debugging` /`CoreSight Tracing Support` and
enabling all options, or by setting the following in the configuration
file:
```
CONFIG_CORESIGHT=y
CONFIG_CORESIGHT_LINK_AND_SINK_TMC=y
CONFIG_CORESIGHT_SINK_TPIU=y
CONFIG_CORESIGHT_SOURCE_ETM4X=y
CONFIG_CORESIGHT_DYNAMIC_REPLICATOR=y
CONFIG_CORESIGHT_STM=y
CONFIG_CORESIGHT_CATU=y
```
Compile the kernel for your target in the usual way, e.g.
```
make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu-
```
Each target may have a different layout of CoreSight components. To
collect trace into a sink, the kernel drivers need to know which other
devices need to be configured to route data from the source to the sink.
This is described in the devicetree (and in future, the ACPI tables). The
device tree will define which CoreSight devices are present in the system,
where they are located and how they are connected together. The devicetree
for some platforms includes a description of the platform's CoreSight
components, but in other cases you may have to ask the platform/SoC vendor
to supply it or create it yourself (see Appendix: Describing CoreSight in
Devicetree).
Once the target has been booted with the devicetree describing the
CoreSight devices, you should find the devices in sysfs:
```
# ls /sys/bus/coresight/devices/
etm0 etm2 etm4 etm6 funnel0 funnel2 funnel4 stm0 tmc_etr0
etm1 etm3 etm5 etm7 funnel1 funnel3 replicator0 tmc_etf0
```
The naming convention for etm devices can be different according to the kernel version you're using.
For more information about the naming scheme, please check out the [Linux Kernel Documentation](https://www.kernel.org/doc/html/latest/trace/coresight/coresight.html#device-naming-scheme)
If `/sys/bus/coresight/devices/` is empty, you may want to check out your Kernel configuration to make sure your .config file is including CoreSight dependencies, such as the clock.
### Perf tools
The perf tool is used to capture execution trace, configuring the trace
sources to generate trace, routing the data to the sink and collecting the
data from the sink.
Arm recommends to use the perf version corresponding to the kernel running
on the target. This can be built from the same kernel sources with
```
make -C tools/perf CORESIGHT=1 VF=1 ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu-
```
When specifying CORESIGHT=1, perf will be built using the installed OpenCSD library.
If you are cross compiling, then additional setup is required to ensure the build process links against the correct version of the library.
If the post-processing (`perf inject`) of the captured data is not being
done on the target, then the OpenCSD library is not required for this build
of perf.
Trace is captured by collecting the `cs_etm` event from perf. The sink
to collect data into is specified as a parameter of this event. Trace can
also be restricted to user space or kernel space with 'u' or 'k'
parameters. For example:
```
perf record -e cs_etm/@tmc_etr0/u --per-thread -- /bin/ls
```
Will record the userspace execution of '/bin/ls' using tmc_etr0 as sink.
## Capturing modes
You can trace a single-threaded program in two different ways:
1. By specifying `--per-thread`, and in this case the CoreSight subsystem will
record only a trace relative to the given program.
2. By NOT specifying `--per-thread`, and in this case CPU-wide tracing will
be enabled. In this scenario the trace will contain both the target program trace
and other workloads that were executing on the same CPU
## Processing trace and profiles
perf is also used to convert the execution trace an instruction profile.
This requires a different build of perf, using the version of perf from
Linux v4.17 or later, as the trace processing code isn't included in the
driver backports. Trace decode is provided by the OpenCSD library
(<https://github.com/Linaro/OpenCSD>), v0.9.1 or later. This is packaged
for debian testing (install the libopencsd0, libopencsd-dev packages) or
can be compiled from source and installed.
The autoFDO tool <https://github.com/google/autofdo> is used to convert the
instruction profiles to source profiles for the GCC and clang/llvm
compilers.
## Recording and profiling
Once trace collection using perf is working, we can now use it to profile
an application.
The application must be compiled to include sufficient debug information to
map instructions back to source lines. For GCC, use the `-g1` or `-gmlt`
options. For clang/llvm, also add the `-fdebug-info-for-profiling` option.
perf identifies the active program or library using the build identifier
stored in the elf file. This should be added at link time with the compiler
flag `-Wl,--build-id=sha1`.
The next step is to record the execution trace of the application using the
perf tool. The ETM strobing should be configured before running the perf
tool. There are two parameters:
* window size: A number of CPU cycles (W)
* period: Trace is enabled for W cycle every _period_ * W cycles.
For example, a typical configuration is to use a window size of 5000 cycles
and a period of 10000 - this will collect 5000 cycles of trace every 50M
cycles. With these proof-of-concept patches, the strobe parameters are
configured via sysfs - each ETM will have `strobe_window` and
`strobe_period` parameters in `/sys/bus/coresight/devices/<sink>` and
these values will have to be written to each (In a future version, this
will be integrated into the drivers and perf tool).
The `set_strobing.sh` script in this directory [`<opencsd>/decoder/tests/auto-fdo`] automates this process.
To collect trace from an application using ETM strobing, run:
```
sudo ./set_strobing.sh 5000 10000
perf record -e cs_etm/@tmc_etr0/u --per-thread -- <your app>"
```
The raw trace can be examined using the `perf report` command:
```
perf report -D -i perf.data --stdio
```
Perf needs to be built from your linux kernel version souce code repository against the OpenCSD library in order to be able to properly read ETM-gathered samples and post-process them.
If running `perf report` produces an error like:
```
0x1f8 [0x268]: failed to process type: 70 [Operation not permitted]
Error:
failed to process sample
```
or
```
"file uses a more recent and unsupported ABI (8 bytes extra). incompatible file format".
```
You are probably using a perf version which is not using this library: please make sure to install this project in your system by either compiling it from [Source Code]( <https://github.com/Linaro/OpenCSD>) from v0.9.1 or later and compile perf using this library.
Otherwise, this project is packaged for debian (install the libopencsd0, libopencsd-dev packages).
For example:
```
0x1d370 [0x30]: PERF_RECORD_AUXTRACE size: 0x2003c0 offset: 0 ref: 0x39ba881d145f8639 idx: 0 tid: 4551 cpu: -1
. ... CoreSight ETM Trace data: size 2098112 bytes
Idx:0; ID:12; I_ASYNC : Alignment Synchronisation.
Idx:12; ID:12; I_TRACE_INFO : Trace Info.; INFO=0x0
Idx:17; ID:12; I_ADDR_L_64IS0 : Address, Long, 64 bit, IS0.; Addr=0xFFFF000008A4991C;
Idx:48; ID:14; I_ASYNC : Alignment Synchronisation.
Idx:60; ID:14; I_TRACE_INFO : Trace Info.; INFO=0x0
Idx:65; ID:14; I_ADDR_L_64IS0 : Address, Long, 64 bit, IS0.; Addr=0xFFFF000008A4991C;
Idx:96; ID:14; I_ASYNC : Alignment Synchronisation.
Idx:108; ID:14; I_TRACE_INFO : Trace Info.; INFO=0x0
Idx:113; ID:14; I_ADDR_L_64IS0 : Address, Long, 64 bit, IS0.; Addr=0xFFFF000008A4991C;
Idx:122; ID:14; I_TRACE_ON : Trace On.
Idx:123; ID:14; I_ADDR_CTXT_L_64IS0 : Address & Context, Long, 64 bit, IS0.; Addr=0x0000000000407B00; Ctxt: AArch64,EL0, NS;
Idx:134; ID:14; I_ATOM_F3 : Atom format 3.; ENN
Idx:135; ID:14; I_ATOM_F5 : Atom format 5.; NENEN
Idx:136; ID:14; I_ATOM_F5 : Atom format 5.; ENENE
Idx:137; ID:14; I_ATOM_F5 : Atom format 5.; NENEN
Idx:138; ID:14; I_ATOM_F3 : Atom format 3.; ENN
Idx:139; ID:14; I_ATOM_F3 : Atom format 3.; NNE
Idx:140; ID:14; I_ATOM_F1 : Atom format 1.; E
.....
```
The execution trace is then converted to an instruction profile using
the perf build with trace decode support. This may be done on a different
machine than that which collected the trace (e.g. when cross compiling for
an embedded target). The `perf inject` command
decodes the execution trace and generates periodic instruction samples,
with branch histories:
!! Careful: if you are using a device different than the one used to collect the profiling data,
you'll need to run `perf buildid-cache` as described below.
```
perf inject -i perf.data -o inj.data --itrace=i100000il
```
The `--itrace` option configures the instruction sample behaviour:
* `i100000i` generates an instruction sample every 100000 instructions
(only instruction count periods are currently supported, future versions
may support time or cycle count periods)
* `l` includes the branch histories on each sample
* `b` generates a sample on each branch (not used here)
Perf requires the original program binaries to decode the execution trace.
If running the `inject` command on a different system than the trace was
captured on, then the binary and any shared libraries must be added to
perf's cache with:
```
perf buildid-cache -a /path/to/binary_or_library
```
`perf report` can also be used to show the instruction samples:
```
perf report -D -i inj.data --stdio
.......
0x1528 [0x630]: PERF_RECORD_SAMPLE(IP, 0x2): 4551/4551: 0x434b98 period: 3093 addr: 0
... branch stack: nr:64
..... 0: 0000000000434b58 -> 0000000000434b68 0 cycles P 0
..... 1: 0000000000436a88 -> 0000000000434b4c 0 cycles P 0
..... 2: 0000000000436a64 -> 0000000000436a78 0 cycles P 0
..... 3: 00000000004369d0 -> 0000000000436a60 0 cycles P 0
..... 4: 000000000043693c -> 00000000004369cc 0 cycles P 0
..... 5: 00000000004368a8 -> 0000000000436928 0 cycles P 0
..... 6: 000000000042d070 -> 00000000004368a8 0 cycles P 0
..... 7: 000000000042d108 -> 000000000042d070 0 cycles P 0
.......
..... 57: 0000000000448ee0 -> 0000000000448f24 0 cycles P 0
..... 58: 0000000000448ea4 -> 0000000000448ebc 0 cycles P 0
..... 59: 0000000000448e20 -> 0000000000448e94 0 cycles P 0
..... 60: 0000000000448da8 -> 0000000000448ddc 0 cycles P 0
..... 61: 00000000004486f4 -> 0000000000448da8 0 cycles P 0
..... 62: 00000000004480fc -> 00000000004486d4 0 cycles P 0
..... 63: 0000000000448658 -> 00000000004480ec 0 cycles P 0
... thread: program1:4551
...... dso: /home/root/program1
.......
```
The instruction samples produced by `perf inject` is then passed to the
autofdo tool to generate source level profiles for the compiler. For
clang/LLVM:
```
create_llvm_prof -binary=/path/to/binary -profile=inj.data -out=program.llvmprof
```
And for GCC:
```
create_gcov -binary=/path/to/binary -profile=inj.data -gcov_version=1 -gcov=program.gcov
```
The profiles can be viewed with:
```
llvm-profdata show -sample program.llvmprof
```
Or, for GCC:
```
dump_gcov -gcov_version=1 program.gcov
```
## Using profile in the compiler
The profile produced by the above steps can then be passed to the compiler
to optimize the next build of the program.
For GCC, use the `-fauto-profile` option:
```
gcc -O2 -fauto-profile=program.gcov -o program program.c
```
For Clang, use the `-fprofile-sample-use` option:
```
clang -O2 -fprofile-sample-use=program.llvmprof -o program program.c
```
## Summary
The basic commands to run an application and create a compiler profile are:
```
sudo ./set_strobing.sh 5000 10000
perf record -e cs_etm/@tmc_etr0/u --per-thread -- <your app>"
perf inject -i perf.data -o inj.data --itrace=i100000il
create_llvm_prof -binary=/path/to/binary -profile=inj.data -out=program.llvmprof
clang -O2 -fprofile-sample-use=program.llvmprof -o program program.c
```
Use `create_gcov` for gcc.
## High Level Summary for recoding on Arm board and decoding on different host
1. (on Arm board)
sudo ./set_strobing.sh 5000 10000
perf record -e cs_etm/@tmc_etr0/u --per-thread -- <your app>.
If you specify `-N, --no-buildid-cache`, perf will just take care of recording the target binary and nothing will be copied.<br> If you don't specify it, any recorded dynamic library will be copied to ~/.debug in the board.
2. (on Arm board) `perf archive` which saves all the found libraries in a tar (internally, it looks into perf.data file and performs a lookup using perf-buildid-list --with-hits)
3. (on host) `scp` to copy perf.data and the .tar file generated from `perf archive`.
4. (on host) Run `tar xvf perf_data.tar.bz2 -C ~/.debug` to populate the buildid-cache
5. (on host) Double check the setup is correct:
a. `perf buildid-list -i perf.data` gives you the list of dynamic libraries buildids whose trace has been recorded and saved in perf.data.
b. `perf buildid-cache --list` lists the dynamic libraries in the buildid cache that will be used by `perf inject`.
Make sure the output of (a) and (b) overlaps as in buildid value for those binaries you are interested into optimizing with afdo.
6. (on host) `perf inject -i perf.data -o inj.data --itrace=i100000il` will check for the dynamic libraries using the buildid inside the buildid-cache and post-process the trace.<br> buildids have to be the same, otherwise it won't be possible to post-process the trace.
7. (on host) `create_llvm_prof -binary=/path/to/binary -profile=inj.data -out=program.llvmprof` takes the output from perf-inject and tranforms it into a format that the compiler can read.
8. (on host) `clang -O2 -fprofile-sample-use=program.llvmprof -o program program.c` to make clang use the produced profile.<br>
If you are confident enough that your profile is accurate, you can add the `-fprofile-sample-accurate` flag, which will penalize all the callsites without corresponding profile, marking them as cold.
If you are using the same host for both building the binary to be traced and re-building it with afdo:
1. You won't need to copy back any dynamic libraries from the board (since you already have them), and can use `--no-buildid-cache` when recording
2. You have to make sure the relevant dynamic libraries to be optimized are present in the buildid-cache.
You can easily add a dynamic library manually into the build-id cache by running:
`perf buildid-cache --add <path/to/library/or/binary> -vvv`
You can easily check what is currently contained in you buildid-cache by running:
`perf buildid-cache --list`
You can check the buildid of a given binary/dynamic library:
`file <path/to/dynamic/library>`
## References
* AutoFDO tool: <https://github.com/google/autofdo>
* GCC's wiki on autofdo: <https://gcc.gnu.org/wiki/AutoFDO>, <https://gcc.gnu.org/wiki/AutoFDO/Tutorial>
* Google paper: <https://ai.google/research/pubs/pub45290>
* CoreSight kernel docs: Documentation/trace/coresight.txt
## Appendix: Describing CoreSight in Devicetree
Each component has an entry in the device tree that describes its:
* type: The `compatible` field defines which driver to use
* location: A `reg` defines the component's address and size on the bus
* clocks: The `clocks` and `clock-names` fields state which clock provides
the `apb_pclk` clock.
* connections to other components: `port` and `ports` field link the
component to ports of other components
To create the device tree, some information about the platform is required:
* The memory address of the CoreSight components. This is the address in
the CPU's address space where the CPU can access each CoreSight
component.
* The connections between the components.
This information can be found in the SoC's reference manual or you may need
to ask the platform/SoC vendor to supply it.
An ETMv4 source is declared with a section like this:
```
etm0: etm@22040000 {
compatible = "arm,coresight-etm4x", "arm,primecell";
reg = <0 0x22040000 0 0x1000>;
cpu = <&A72_0>;
clocks = <&soc_smc50mhz>;
clock-names = "apb_pclk";
port {
cluster0_etm0_out_port: endpoint {
remote-endpoint = <&cluster0_funnel_in_port0>;
};
};
};
```
This describes an ETMv4 attached to core A72_0, located at 0x22040000, with
its output linked to port 0 of a funnel. The funnel is described with:
```
funnel@220c0000 { /* cluster0 funnel */
compatible = "arm,coresight-funnel", "arm,primecell";
reg = <0 0x220c0000 0 0x1000>;
clocks = <&soc_smc50mhz>;
clock-names = "apb_pclk";
power-domains = <&scpi_devpd 0>;
ports {
#address-cells = <1>;
#size-cells = <0>;
port@0 {
reg = <0>;
cluster0_funnel_out_port: endpoint {
remote-endpoint = <&main_funnel_in_port0>;
};
};
port@1 {
reg = <0>;
cluster0_funnel_in_port0: endpoint {
slave-mode;
remote-endpoint = <&cluster0_etm0_out_port>;
};
};
port@2 {
reg = <1>;
cluster0_funnel_in_port1: endpoint {
slave-mode;
remote-endpoint = <&cluster0_etm1_out_port>;
};
};
};
};
```
This describes a funnel located at 0x220c0000, receiving data from 2 ETMs
and sending the merged data to another funnel. We continue describing
components with similar blocks until we reach the sink (an ETR):
```
etr@20070000 {
compatible = "arm,coresight-tmc", "arm,primecell";
reg = <0 0x20070000 0 0x1000>;
iommus = <&smmu_etr 0>;
clocks = <&soc_smc50mhz>;
clock-names = "apb_pclk";
power-domains = <&scpi_devpd 0>;
port {
etr_in_port: endpoint {
slave-mode;
remote-endpoint = <&replicator_out_port1>;
};
};
};
```
Full descriptions of the properties of each component can be found in the
Linux source at Documentation/devicetree/bindings/arm/coresight.txt.
The Arm Juno platform's devicetree (arch/arm64/boot/dts/arm) provides an example
description of CoreSight description.
Many systems include a TPIU for off-chip trace. While this isn't required
for self-hosted trace, it should still be included in the devicetree. This
allows the drivers to access it to ensure it is put into a disabled state,
otherwise it may limit the trace bandwidth causing data loss.

View File

@ -0,0 +1,91 @@
########################################################
# Copyright 2015 ARM Limited. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
#
# 3. Neither the name of the copyright holder nor the names of its contributors
# may be used to endorse or promote products derived from this software without
# specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS' AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
#################################################################################
########
# RCTDL - test makefile for simple c api packet list test.
#
CC := $(MASTER_CC)
LINKER := $(MASTER_LINKER)
PROG = c_api_pkt_print_test
BUILD_DIR=./$(PLAT_DIR)
VPATH = $(OCSD_TESTS)/source
CC_INCLUDES = \
-I$(OCSD_TESTS)/source \
-I$(OCSD_TESTS)/ext_dcd_test_eg/c_api_echo_test \
-I$(OCSD_INCLUDE)
OBJECTS = $(BUILD_DIR)/c_api_pkt_print_test.o
LIBS = -L$(LIB_TARGET_DIR) -l$(LIB_BASE_NAME) -l$(LIB_CAPI_NAME) \
-L$(LIB_TEST_TARGET_DIR) -l_echo_test_dcd
all: copy_libs
test_app: $(BIN_TEST_TARGET_DIR)/$(PROG)
$(BIN_TEST_TARGET_DIR)/$(PROG): $(OBJECTS) | build_dir
mkdir -p $(BIN_TEST_TARGET_DIR)
$(LINKER) $(LDFLAGS) $(OBJECTS) -Wl,--start-group $(LIBS) -Wl,--end-group -o $(BIN_TEST_TARGET_DIR)/$(PROG)
cp $(LIB_TARGET_DIR)/*.so .
build_dir:
mkdir -p $(BUILD_DIR)
.PHONY: copy_libs
copy_libs: $(BIN_TEST_TARGET_DIR)/$(PROG)
cp $(LIB_TARGET_DIR)/*.so $(BIN_TEST_TARGET_DIR)/.
#### build rules
## object dependencies
DEPS := $(OBJECTS:%.o=%.d)
-include $(DEPS)
## object compile
$(BUILD_DIR)/%.o : %.c | build_dir
$(CC) $(CFLAGS) $(CC_INCLUDES) -MMD $< -o $@
#### clean
.PHONY: clean
clean :
-rm $(BIN_TEST_TARGET_DIR)/$(PROG) $(OBJECTS)
-rm $(DEPS)
-rm ./*.so
-rmdir $(BUILD_DIR)
# end of file makefile

View File

@ -0,0 +1,78 @@
########################################################
# Copyright 2016 ARM Limited. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
#
# 3. Neither the name of the copyright holder nor the names of its contributors
# may be used to endorse or promote products derived from this software without
# specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS' AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
#################################################################################
# OpenCSD - makefile for external echo_test decoder.
#
CC := $(MASTER_CC)
LIB := $(MASTER_LIB)
LIB_NAME = lib_echo_test_dcd
BUILD_DIR=./$(PLAT_DIR)
ECHO_TEST_PATH=$(OCSD_TESTS)/ext_dcd_test_eg/c_api_echo_test
VPATH = $(ECHO_TEST_PATH)
CC_INCLUDES = \
-I$(ECHO_TEST_PATH) \
-I$(OCSD_INCLUDE)
OBJECTS = $(BUILD_DIR)/ext_dcd_echo_test.o \
$(BUILD_DIR)/ext_dcd_echo_test_fact.o
all: $(LIB_TEST_TARGET_DIR)/$(LIB_NAME).a
$(LIB_TEST_TARGET_DIR)/$(LIB_NAME).a: $(OBJECTS) | build_dir
mkdir -p $(LIB_TEST_TARGET_DIR)
$(LIB) $(ARFLAGS) $(LIB_TEST_TARGET_DIR)/$(LIB_NAME).a $(OBJECTS)
build_dir:
mkdir -p $(BUILD_DIR)
#### build rules
## object dependencies
DEPS := $(OBJECTS:%.o=%.d)
-include $(DEPS)
## object compile
$(BUILD_DIR)/%.o : %.c | build_dir
$(CC) $(CFLAGS) $(CC_INCLUDES) -MMD $< -o $@
#### clean
.PHONY: clean
clean:
-rm $(OBJECTS)
-rm $(LIB_TEST_TARGET_DIR)/$(LIB_NAME).a
-rm $(DEPS)
-rmdir $(BUILD_DIR) $(LIB_TEST_TARGET_DIR)
# end of file makefile

View File

@ -0,0 +1,88 @@
########################################################
# Copyright 2022 ARM Limited. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
#
# 3. Neither the name of the copyright holder nor the names of its contributors
# may be used to endorse or promote products derived from this software without
# specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS' AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
#################################################################################
########
# opencsd: makefile for the frame demux test program
#
CXX := $(MASTER_CXX)
LINKER := $(MASTER_LINKER)
PROG = frame-demux-test
BUILD_DIR=./$(PLAT_DIR)
VPATH = $(OCSD_TESTS)/source
CXX_INCLUDES = \
-I$(OCSD_TESTS)/source \
-I$(OCSD_INCLUDE)
OBJECTS = $(BUILD_DIR)/frame_demux_test.o
LIBS = -L$(LIB_TEST_TARGET_DIR) -L$(LIB_TARGET_DIR) -l$(LIB_BASE_NAME)
all: copy_libs
test_app: $(BIN_TEST_TARGET_DIR)/$(PROG)
$(BIN_TEST_TARGET_DIR)/$(PROG): $(OBJECTS) | build_dir
mkdir -p $(BIN_TEST_TARGET_DIR)
$(LINKER) $(LDFLAGS) $(OBJECTS) -Wl,--start-group $(LIBS) -Wl,--end-group -o $(BIN_TEST_TARGET_DIR)/$(PROG)
build_dir:
mkdir -p $(BUILD_DIR)
.PHONY: copy_libs
copy_libs: $(BIN_TEST_TARGET_DIR)/$(PROG)
cp $(LIB_TARGET_DIR)/*.so* $(BIN_TEST_TARGET_DIR)/.
#### build rules
## object dependencies
DEPS := $(OBJECTS:%.o=%.d)
-include $(DEPS)
## object compile
$(BUILD_DIR)/%.o : %.cpp | build_dir
$(CXX) $(CXXFLAGS) $(CXX_INCLUDES) -MMD $< -o $@
#### clean
.PHONY: clean
clean :
-rm $(BIN_TEST_TARGET_DIR)/$(PROG) $(OBJECTS)
-rm $(DEPS)
-rm $(BIN_TEST_TARGET_DIR)/*.so*
-rmdir $(BUILD_DIR)
# end of file makefile

View File

@ -0,0 +1,90 @@
########################################################
# Copyright 2019 ARM Limited. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
#
# 3. Neither the name of the copyright holder nor the names of its contributors
# may be used to endorse or promote products derived from this software without
# specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS' AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
#################################################################################
########
# RCTDL - test makefile for snapshot lister test.
#
CXX := $(MASTER_CXX)
LINKER := $(MASTER_LINKER)
PROG = mem-buffer-eg
BUILD_DIR=./$(PLAT_DIR)
VPATH = $(OCSD_TESTS)/source
CXX_INCLUDES = \
-I$(OCSD_TESTS)/source \
-I$(OCSD_INCLUDE) \
-I$(OCSD_TESTS)/snapshot_parser_lib/include
OBJECTS = $(BUILD_DIR)/mem_buff_demo.o
LIBS = -L$(LIB_TEST_TARGET_DIR) -lsnapshot_parser \
-L$(LIB_TARGET_DIR) -l$(LIB_BASE_NAME)
all: copy_libs
test_app: $(BIN_TEST_TARGET_DIR)/$(PROG)
$(BIN_TEST_TARGET_DIR)/$(PROG): $(OBJECTS) | build_dir
mkdir -p $(BIN_TEST_TARGET_DIR)
$(LINKER) $(LDFLAGS) $(OBJECTS) -Wl,--start-group $(LIBS) -Wl,--end-group -o $(BIN_TEST_TARGET_DIR)/$(PROG)
build_dir:
mkdir -p $(BUILD_DIR)
.PHONY: copy_libs
copy_libs: $(BIN_TEST_TARGET_DIR)/$(PROG)
cp $(LIB_TARGET_DIR)/*.so* $(BIN_TEST_TARGET_DIR)/.
#### build rules
## object dependencies
DEPS := $(OBJECTS:%.o=%.d)
-include $(DEPS)
## object compile
$(BUILD_DIR)/%.o : %.cpp | build_dir
$(CXX) $(CXXFLAGS) $(CXX_INCLUDES) -MMD $< -o $@
#### clean
.PHONY: clean
clean :
-rm $(BIN_TEST_TARGET_DIR)/$(PROG) $(OBJECTS)
-rm $(DEPS)
-rm $(BIN_TEST_TARGET_DIR)/*.so*
-rmdir $(BUILD_DIR)
# end of file makefile

View File

@ -0,0 +1,92 @@
########################################################
# Copyright 2015 ARM Limited. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
#
# 3. Neither the name of the copyright holder nor the names of its contributors
# may be used to endorse or promote products derived from this software without
# specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS' AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
########################################################################
#
# Make file for snapshot parser library.
#
########################################################################
CXX := $(MASTER_CXX)
LINKER := $(MASTER_LINKER)
LIB := $(MASTER_LIB)
# avoid build warnings in donated test code
WSUPPRESS= -Wno-deprecated-declarations -Wno-unused-variable -Wno-reorder
CXXFLAGS += $(WSUPPRESS)
LIB_NAME = libsnapshot_parser
BUILD_DIR=./$(PLAT_DIR)
PARSER_ROOT=$(OCSD_TESTS)/snapshot_parser_lib
PARSER_SOURCE=$(PARSER_ROOT)/source
PARSER_INCLUDE=$(PARSER_ROOT)/include
VPATH= $(PARSER_SOURCE)
CXX_INCLUDES= \
-I$(PARSER_INCLUDE) \
-I$(OCSD_INCLUDE)
OBJECTS=$(BUILD_DIR)/device_info.o \
$(BUILD_DIR)/device_parser.o \
$(BUILD_DIR)/snapshot_parser.o \
$(BUILD_DIR)/snapshot_parser_util.o \
$(BUILD_DIR)/snapshot_reader.o \
$(BUILD_DIR)/ss_to_dcdtree.o
all: $(LIB_TEST_TARGET_DIR)/$(LIB_NAME).a
$(LIB_TEST_TARGET_DIR)/$(LIB_NAME).a: $(OBJECTS) | build_dir
mkdir -p $(LIB_TEST_TARGET_DIR)
$(LIB) $(ARFLAGS) $(LIB_TEST_TARGET_DIR)/$(LIB_NAME).a $(OBJECTS)
build_dir:
mkdir -p $(BUILD_DIR)
##### build rules
## object dependencies
DEPS := $(OBJECTS:%.o=%.d)
-include $(DEPS)
## object compile
$(BUILD_DIR)/%.o : %.cpp | build_dir
$(CXX) $(CXXFLAGS) $(CXX_INCLUDES) -MMD $< -o $@
### clean
.PHONY: clean
clean:
-rm $(OBJECTS)
-rm $(DEPS)
-rm $(LIB_TEST_TARGET_DIR)/$(LIB_NAME).a
-rmdir $(BUILD_DIR) $(LIB_TEST_TARGET_DIR)

View File

@ -0,0 +1,103 @@
########################################################
# Copyright 2015 ARM Limited. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
#
# 3. Neither the name of the copyright holder nor the names of its contributors
# may be used to endorse or promote products derived from this software without
# specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS' AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
#################################################################################
########
# RCTDL - test makefile for snapshot lister test.
#
CXX := $(MASTER_CXX)
LINKER := $(MASTER_LINKER)
PROG = trc_pkt_lister
PROG_S = trc_pkt_lister_s
BUILD_DIR=./$(PLAT_DIR)
VPATH = $(OCSD_TESTS)/source
CXX_INCLUDES = \
-I$(OCSD_TESTS)/source \
-I$(OCSD_INCLUDE) \
-I$(OCSD_TESTS)/snapshot_parser_lib/include
OBJECTS = $(BUILD_DIR)/trc_pkt_lister.o
LIBS = -L$(LIB_TEST_TARGET_DIR) -lsnapshot_parser \
-L$(LIB_TARGET_DIR) -l$(LIB_BASE_NAME)
all: copy_libs
test_app: $(BIN_TEST_TARGET_DIR)/$(PROG)
$(BIN_TEST_TARGET_DIR)/$(PROG): $(OBJECTS) | build_dir
mkdir -p $(BIN_TEST_TARGET_DIR)
$(LINKER) $(LDFLAGS) $(OBJECTS) -Wl,--start-group $(LIBS) -Wl,--end-group -o $(BIN_TEST_TARGET_DIR)/$(PROG)
$(BIN_TEST_TARGET_DIR)/$(PROG_S): $(OBJECTS) | build_dir
mkdir -p $(BIN_TEST_TARGET_DIR)
$(LINKER) -static $(LDFLAGS) $(OBJECTS) -Wl,--start-group $(LIBS) -Wl,--end-group -o $(BIN_TEST_TARGET_DIR)/$(PROG_S)
build_dir:
mkdir -p $(BUILD_DIR)
.PHONY: copy_libs
ifdef TEST_STATIC_LINKING
copy_libs: $(BIN_TEST_TARGET_DIR)/$(PROG_S)
endif
copy_libs: $(BIN_TEST_TARGET_DIR)/$(PROG)
cp $(LIB_TARGET_DIR)/*.so* $(BIN_TEST_TARGET_DIR)/.
#### build rules
## object dependencies
DEPS := $(OBJECTS:%.o=%.d)
-include $(DEPS)
## object compile
$(BUILD_DIR)/%.o : %.cpp | build_dir
$(CXX) $(CXXFLAGS) $(CXX_INCLUDES) -MMD $< -o $@
#### clean
.PHONY: clean
clean :
-rm $(BIN_TEST_TARGET_DIR)/$(PROG) $(OBJECTS)
ifdef TEST_STATIC_LINKING
-rm $(BIN_TEST_TARGET_DIR)/$(PROG_S)
endif
-rm $(DEPS)
-rm $(BIN_TEST_TARGET_DIR)/*.so*
-rmdir $(BUILD_DIR)
# end of file makefile

View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<Project>
<ProjectOutputs>
<ProjectOutput>
<FullPath>C:\work\OpenCSD\ocsd-linaro\decoder\tests\bin\win32\rel\c_api_pkt_print_test-dl.exe</FullPath>
</ProjectOutput>
</ProjectOutputs>
<ContentFiles />
<SatelliteDlls />
<NonRecipeFileRefs />
</Project>

View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<Project>
<ProjectOutputs>
<ProjectOutput>
<FullPath>C:\work\OpenCSD\ocsd-linaro\decoder\tests\bin\win32\rel\c_api_pkt_print_test.exe</FullPath>
</ProjectOutput>
</ProjectOutputs>
<ContentFiles />
<SatelliteDlls />
<NonRecipeFileRefs />
</Project>

View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<Project>
<ProjectOutputs>
<ProjectOutput>
<FullPath>C:\work\OpenCSD\ocsd-linaro\decoder\tests\bin\win32\rel\c_api_pkt_print_test_dll.exe</FullPath>
</ProjectOutput>
</ProjectOutputs>
<ContentFiles />
<SatelliteDlls />
<NonRecipeFileRefs />
</Project>

View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<Project>
<ProjectOutputs>
<ProjectOutput>
<FullPath>C:\work\OpenCSD\ocsd-linaro\decoder\tests\bin\win32\rel\c_api_pkt_print_test.exe</FullPath>
</ProjectOutput>
</ProjectOutputs>
<ContentFiles />
<SatelliteDlls />
<NonRecipeFileRefs />
</Project>

View File

@ -0,0 +1,347 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="debug-dll|Win32">
<Configuration>debug-dll</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="debug-dll|x64">
<Configuration>debug-dll</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release-dll|Win32">
<Configuration>Release-dll</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release-dll|x64">
<Configuration>Release-dll</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\..\source\c_api_pkt_print_test.c" />
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{3AC169DA-E156-4D16-95DF-73D7302A5606}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>c_api_pkt_print_test</RootNamespace>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v143</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='debug-dll|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v143</PlatformToolset>
<EnableASAN>true</EnableASAN>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v143</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='debug-dll|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v143</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v143</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release-dll|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v143</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v143</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release-dll|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v143</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\..\..\..\build\win-vs2022\opencsd.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='debug-dll|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\..\..\..\build\win-vs2022\opencsd.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\..\..\..\build\win-vs2022\opencsd.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='debug-dll|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\..\..\..\build\win-vs2022\opencsd.props" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\..\..\..\build\win-vs2022\opencsd.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release-dll|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\..\..\..\build\win-vs2022\opencsd.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\..\..\..\build\win-vs2022\opencsd.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release-dll|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\..\..\..\build\win-vs2022\opencsd.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
<OutDir>..\..\..\bin\win$(PlatformArchitecture)\dbg\</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='debug-dll|Win32'">
<LinkIncremental>true</LinkIncremental>
<OutDir>..\..\..\bin\win$(PlatformArchitecture)\dbg\</OutDir>
<TargetName>$(ProjectName)_dll</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental>
<OutDir>..\..\..\bin\win$(PlatformArchitecture)\dbg\</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='debug-dll|x64'">
<LinkIncremental>true</LinkIncremental>
<OutDir>..\..\..\bin\win$(PlatformArchitecture)\dbg\</OutDir>
<TargetName>$(ProjectName)_dll</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
<OutDir>..\..\..\bin\win$(PlatformArchitecture)\rel\</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release-dll|Win32'">
<LinkIncremental>false</LinkIncremental>
<OutDir>..\..\..\bin\win$(PlatformArchitecture)\rel\</OutDir>
<TargetName>$(ProjectName)_dll</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
<OutDir>..\..\..\bin\win$(PlatformArchitecture)\rel\</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release-dll|x64'">
<LinkIncremental>false</LinkIncremental>
<OutDir>..\..\..\bin\win$(PlatformArchitecture)\rel\</OutDir>
<TargetName>$(ProjectName)_dll</TargetName>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;OCSD_USE_STATIC_C_API;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\tests\ext_dcd_test_eg\c_api_echo_test</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalLibraryDirectories>..\..\..\..\lib\win$(PlatformArchitecture)\dbg\;..\..\..\..\tests\lib\win$(PlatformArchitecture)\dbg\</AdditionalLibraryDirectories>
<AdditionalDependencies>lib$(LIB_CAPI_NAME).lib;lib$(LIB_BASE_NAME).lib;ext_dcd_echo_test.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
<PostBuildEvent>
<Command>
</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='debug-dll|Win32'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\tests\ext_dcd_test_eg\c_api_echo_test</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalLibraryDirectories>..\..\..\..\lib\win$(PlatformArchitecture)\dbg\;..\..\..\..\tests\lib\win$(PlatformArchitecture)\dbg\</AdditionalLibraryDirectories>
<AdditionalDependencies>lib$(LIB_CAPI_NAME).lib;ext_dcd_echo_test.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
<PostBuildEvent>
<Command>copy ..\..\..\..\lib\win32\dbg\*.dll ..\..\..\bin\win32\dbg\.</Command>
</PostBuildEvent>
<ProjectReference>
<LinkLibraryDependencies>false</LinkLibraryDependencies>
</ProjectReference>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;OCSD_USE_STATIC_C_API;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\tests\ext_dcd_test_eg\c_api_echo_test</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>lib$(LIB_CAPI_NAME).lib;lib$(LIB_BASE_NAME).lib;ext_dcd_echo_test.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>..\..\..\..\lib\win$(PlatformArchitecture)\dbg\;..\..\..\..\tests\lib\win$(PlatformArchitecture)\dbg\</AdditionalLibraryDirectories>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='debug-dll|x64'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\tests\ext_dcd_test_eg\c_api_echo_test</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>lib$(LIB_CAPI_NAME).lib;ext_dcd_echo_test.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>..\..\..\..\lib\win$(PlatformArchitecture)\dbg\;..\..\..\..\tests\lib\win$(PlatformArchitecture)\dbg\</AdditionalLibraryDirectories>
</Link>
<ProjectReference>
<LinkLibraryDependencies>false</LinkLibraryDependencies>
</ProjectReference>
<PostBuildEvent>
<Command>copy ..\..\..\..\lib\win64\dbg\*.dll ..\..\..\bin\win64\dbg\.</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;OCSD_USE_STATIC_C_API;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\tests\ext_dcd_test_eg\c_api_echo_test</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<AdditionalLibraryDirectories>..\..\..\..\lib\win$(PlatformArchitecture)\rel\;..\..\..\..\tests\lib\win$(PlatformArchitecture)\rel\</AdditionalLibraryDirectories>
<AdditionalDependencies>lib$(LIB_CAPI_NAME).lib;lib$(LIB_BASE_NAME).lib;ext_dcd_echo_test.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release-dll|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\tests\ext_dcd_test_eg\c_api_echo_test</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<AdditionalLibraryDirectories>..\..\..\..\lib\win$(PlatformArchitecture)\rel\;..\..\..\..\tests\lib\win$(PlatformArchitecture)\rel\</AdditionalLibraryDirectories>
<AdditionalDependencies>lib$(LIB_CAPI_NAME).lib;ext_dcd_echo_test.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
<ProjectReference>
<LinkLibraryDependencies>false</LinkLibraryDependencies>
</ProjectReference>
<PostBuildEvent>
<Command>copy ..\..\..\..\lib\win32\rel\*.dll ..\..\..\bin\win32\rel\.</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;OCSD_USE_STATIC_C_API;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\tests\ext_dcd_test_eg\c_api_echo_test</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<AdditionalLibraryDirectories>..\..\..\..\lib\win$(PlatformArchitecture)\rel\;..\..\..\..\tests\lib\win$(PlatformArchitecture)\rel\</AdditionalLibraryDirectories>
<AdditionalDependencies>lib$(LIB_CAPI_NAME).lib;lib$(LIB_BASE_NAME).lib;ext_dcd_echo_test.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release-dll|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>..\..\..\..\include;..\..\..\..\tests\ext_dcd_test_eg\c_api_echo_test</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<AdditionalLibraryDirectories>..\..\..\..\lib\win$(PlatformArchitecture)\rel\;..\..\..\..\tests\lib\win$(PlatformArchitecture)\rel\</AdditionalLibraryDirectories>
<AdditionalDependencies>lib$(LIB_CAPI_NAME).lib;ext_dcd_echo_test.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
<ProjectReference>
<LinkLibraryDependencies>false</LinkLibraryDependencies>
</ProjectReference>
<PostBuildEvent>
<Command>copy ..\..\..\..\lib\win64\rel\*.dll ..\..\..\bin\win64\rel\.</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\..\source\c_api_pkt_print_test.c">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
</Project>

View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<Project>
<ProjectOutputs>
<ProjectOutput>
<FullPath>C:\work\OpenCSD\ocsd-linaro\decoder\tests\bin\win32\dbg\c_api_pkt_print_test_dll.exe</FullPath>
</ProjectOutput>
</ProjectOutputs>
<ContentFiles />
<SatelliteDlls />
<NonRecipeFileRefs />
</Project>

View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<Project>
<ProjectOutputs>
<ProjectOutput>
<FullPath>C:\work\OpenCSD\ocsd-linaro\decoder\tests\bin\win64\rel\c_api_pkt_print_test_dll.exe</FullPath>
</ProjectOutput>
</ProjectOutputs>
<ContentFiles />
<SatelliteDlls />
<NonRecipeFileRefs />
</Project>

View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<Project>
<ProjectOutputs>
<ProjectOutput>
<FullPath>C:\work\OpenCSD\ocsd-linaro\decoder\tests\bin\win64\rel\c_api_pkt_print_test.exe</FullPath>
</ProjectOutput>
</ProjectOutputs>
<ContentFiles />
<SatelliteDlls />
<NonRecipeFileRefs />
</Project>

View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<Project>
<ProjectOutputs>
<ProjectOutput>
<FullPath>C:\work\OpenCSD\ocsd-linaro\decoder\tests\bin\win64\dbg\c_api_pkt_print_test_dll.exe</FullPath>
</ProjectOutput>
</ProjectOutputs>
<ContentFiles />
<SatelliteDlls />
<NonRecipeFileRefs />
</Project>

View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project>
<ProjectOutputs />
<ContentFiles />
<SatelliteDlls />
<NonRecipeFileRefs />
</Project>

View File

@ -0,0 +1,291 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug-dll|Win32">
<Configuration>Debug-dll</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug-dll|x64">
<Configuration>Debug-dll</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release-dll|Win32">
<Configuration>Release-dll</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release-dll|x64">
<Configuration>Release-dll</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{46219A32-8178-41C1-B3B1-B5A6E547515F}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>ext_dcd_echo_test</RootNamespace>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug-dll|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release-dll|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug-dll|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release-dll|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug-dll|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release-dll|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug-dll|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release-dll|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<OutDir>..\..\..\lib\win$(PlatformArchitecture)\dbg\</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug-dll|Win32'">
<OutDir>..\..\..\lib\win$(PlatformArchitecture)\dbg\</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<OutDir>..\..\..\lib\win$(PlatformArchitecture)\rel\</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release-dll|Win32'">
<OutDir>..\..\..\lib\win$(PlatformArchitecture)\rel\</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<OutDir>..\..\..\lib\win$(PlatformArchitecture)\rel\</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release-dll|x64'">
<OutDir>..\..\..\lib\win$(PlatformArchitecture)\rel\</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<OutDir>..\..\..\lib\win$(PlatformArchitecture)\dbg\</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug-dll|x64'">
<OutDir>..\..\..\lib\win$(PlatformArchitecture)\dbg\</OutDir>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ExceptionHandling>false</ExceptionHandling>
<AdditionalIncludeDirectories>..\..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug-dll|Win32'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ExceptionHandling>false</ExceptionHandling>
<AdditionalIncludeDirectories>..\..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>_DEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>..\..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug-dll|x64'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>..\..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>..\..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release-dll|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>..\..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>NDEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>..\..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release-dll|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>..\..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="..\..\..\ext_dcd_test_eg\c_api_echo_test\ext_dcd_echo_test.h" />
<ClInclude Include="..\..\..\ext_dcd_test_eg\c_api_echo_test\ext_dcd_echo_test_fact.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\..\ext_dcd_test_eg\c_api_echo_test\ext_dcd_echo_test.c" />
<ClCompile Include="..\..\..\ext_dcd_test_eg\c_api_echo_test\ext_dcd_echo_test_fact.c" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@ -0,0 +1,33 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\..\ext_dcd_test_eg\c_api_echo_test\ext_dcd_echo_test_fact.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\ext_dcd_test_eg\c_api_echo_test\ext_dcd_echo_test.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\..\ext_dcd_test_eg\c_api_echo_test\ext_dcd_echo_test_fact.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\ext_dcd_test_eg\c_api_echo_test\ext_dcd_echo_test.c">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
</Project>

View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project>
<ProjectOutputs />
<ContentFiles />
<SatelliteDlls />
<NonRecipeFileRefs />
</Project>

View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<Project>
<ProjectOutputs>
<ProjectOutput>
<FullPath>C:\work\OpenCSD\ocsd-linaro\decoder\tests\bin\win32\rel\frame_demux_test.exe</FullPath>
</ProjectOutput>
</ProjectOutputs>
<ContentFiles />
<SatelliteDlls />
<NonRecipeFileRefs />
</Project>

View File

@ -0,0 +1,172 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>16.0</VCProjectVersion>
<Keyword>Win32Proj</Keyword>
<ProjectGuid>{98ee9884-a4eb-4c75-a911-dfedf992754f}</ProjectGuid>
<RootNamespace>framedemuxtest</RootNamespace>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
<EnableASAN>true</EnableASAN>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\..\..\..\build\win-vs2022\opencsd.props" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\..\..\..\build\win-vs2022\opencsd.props" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\..\..\..\build\win-vs2022\opencsd.props" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\..\..\..\build\win-vs2022\opencsd.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>false</LinkIncremental>
<OutDir>..\..\..\bin\win$(PlatformArchitecture)\dbg\</OutDir>
<IntDir>$(Platform)\$(Configuration)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
<OutDir>..\..\..\bin\win$(PlatformArchitecture)\rel\</OutDir>
<IntDir>$(Platform)\$(Configuration)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
<OutDir>..\..\..\bin\win$(PlatformArchitecture)\rel\</OutDir>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>false</SDLCheck>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<AdditionalIncludeDirectories>..\..\..\..\include</AdditionalIncludeDirectories>
<BasicRuntimeChecks>
</BasicRuntimeChecks>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalLibraryDirectories>..\..\..\..\lib\win$(PlatformArchitecture)\dbg\;..\..\..\..\tests\lib\win$(PlatformArchitecture)\dbg\</AdditionalLibraryDirectories>
<AdditionalDependencies>lib$(LIB_BASE_NAME).lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<AdditionalIncludeDirectories>..\..\..\..\include</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalLibraryDirectories>..\..\..\..\lib\win$(PlatformArchitecture)\rel\;..\..\..\..\tests\lib\win$(PlatformArchitecture)\rel\</AdditionalLibraryDirectories>
<AdditionalDependencies>lib$(LIB_BASE_NAME).lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<AdditionalIncludeDirectories>..\..\..\..\include</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalLibraryDirectories>..\..\..\..\lib\win$(PlatformArchitecture)\dbg\;..\..\..\..\tests\lib\win$(PlatformArchitecture)\dbg\</AdditionalLibraryDirectories>
<AdditionalDependencies>lib$(LIB_BASE_NAME).lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<AdditionalIncludeDirectories>..\..\..\..\include</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalLibraryDirectories>..\..\..\..\lib\win$(PlatformArchitecture)\rel\;..\..\..\..\tests\lib\win$(PlatformArchitecture)\rel\</AdditionalLibraryDirectories>
<AdditionalDependencies>lib$(LIB_BASE_NAME).lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\..\..\source\frame_demux_test.cpp" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\..\source\frame_demux_test.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
</Project>

View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<Project>
<ProjectOutputs>
<ProjectOutput>
<FullPath>C:\work\OpenCSD\ocsd-linaro\decoder\tests\bin\win64\rel\frame_demux_test.exe</FullPath>
</ProjectOutput>
</ProjectOutputs>
<ContentFiles />
<SatelliteDlls />
<NonRecipeFileRefs />
</Project>

View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<Project>
<ProjectOutputs>
<ProjectOutput>
<FullPath>C:\work\OpenCSD\ocsd-linaro\decoder\tests\bin\win32\rel\mem-buffer-eg.exe</FullPath>
</ProjectOutput>
</ProjectOutputs>
<ContentFiles />
<SatelliteDlls />
<NonRecipeFileRefs />
</Project>

View File

@ -0,0 +1,293 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug-dll|Win32">
<Configuration>Debug-dll</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug-dll|x64">
<Configuration>Debug-dll</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release-dll|Win32">
<Configuration>Release-dll</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release-dll|x64">
<Configuration>Release-dll</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\..\source\mem_buff_demo.cpp" />
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{BC090130-2C53-4CF6-8AD4-37BF72B8D01A}</ProjectGuid>
<RootNamespace>membuffereg</RootNamespace>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug-dll|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release-dll|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug-dll|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release-dll|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\..\..\..\build\win-vs2022\opencsd.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug-dll|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\..\..\..\build\win-vs2022\opencsd.props" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\..\..\..\build\win-vs2022\opencsd.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release-dll|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\..\..\..\build\win-vs2022\opencsd.props" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\..\..\..\build\win-vs2022\opencsd.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug-dll|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\..\..\..\build\win-vs2022\opencsd.props" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\..\..\..\build\win-vs2022\opencsd.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release-dll|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\..\..\..\build\win-vs2022\opencsd.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<OutDir>..\..\..\bin\win$(PlatformArchitecture)\dbg\</OutDir>
<IntDir>$(Platform)\$(Configuration)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug-dll|Win32'">
<OutDir>..\..\..\bin\win$(PlatformArchitecture)\dbg\</OutDir>
<IntDir>$(Platform)\$(Configuration)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<OutDir>..\..\..\bin\win$(PlatformArchitecture)\rel\</OutDir>
<IntDir>$(Platform)\$(Configuration)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release-dll|Win32'">
<OutDir>..\..\..\bin\win$(PlatformArchitecture)\rel\</OutDir>
<IntDir>$(Platform)\$(Configuration)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<OutDir>..\..\..\bin\win$(PlatformArchitecture)\rel\</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release-dll|x64'">
<OutDir>..\..\..\bin\win$(PlatformArchitecture)\rel\</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<OutDir>..\..\..\bin\win$(PlatformArchitecture)\dbg\</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug-dll|x64'">
<OutDir>..\..\..\bin\win$(PlatformArchitecture)\dbg\</OutDir>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<SDLCheck>
</SDLCheck>
<AdditionalIncludeDirectories>..\..\..\..\include</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<AdditionalLibraryDirectories>..\..\..\..\lib\win$(PlatformArchitecture)\dbg\;..\..\..\..\tests\lib\win$(PlatformArchitecture)\dbg\</AdditionalLibraryDirectories>
<AdditionalDependencies>lib$(LIB_BASE_NAME).lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug-dll|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<SDLCheck>
</SDLCheck>
<AdditionalIncludeDirectories>..\..\..\..\include</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<AdditionalLibraryDirectories>..\..\..\..\lib\win$(PlatformArchitecture)\dbg\;..\..\..\..\tests\lib\win$(PlatformArchitecture)\dbg\</AdditionalLibraryDirectories>
<AdditionalDependencies>lib$(LIB_BASE_NAME).lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<SDLCheck>false</SDLCheck>
<AdditionalIncludeDirectories>..\..\..\..\include</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<AdditionalLibraryDirectories>..\..\..\..\lib\win$(PlatformArchitecture)\dbg\;..\..\..\..\tests\lib\win$(PlatformArchitecture)\dbg\</AdditionalLibraryDirectories>
<AdditionalDependencies>lib$(LIB_BASE_NAME).lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug-dll|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<SDLCheck>false</SDLCheck>
<AdditionalIncludeDirectories>..\..\..\..\include</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<AdditionalLibraryDirectories>..\..\..\..\lib\win$(PlatformArchitecture)\dbg\;..\..\..\..\tests\lib\win$(PlatformArchitecture)\dbg\</AdditionalLibraryDirectories>
<AdditionalDependencies>lib$(LIB_BASE_NAME).lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>
</SDLCheck>
<AdditionalIncludeDirectories>..\..\..\..\include</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<AdditionalLibraryDirectories>..\..\..\..\lib\win$(PlatformArchitecture)\rel\;..\..\..\..\tests\lib\win$(PlatformArchitecture)\rel\</AdditionalLibraryDirectories>
<AdditionalDependencies>lib$(LIB_BASE_NAME).lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release-dll|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>
</SDLCheck>
<AdditionalIncludeDirectories>..\..\..\..\include</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<AdditionalLibraryDirectories>..\..\..\..\lib\win$(PlatformArchitecture)\rel\;..\..\..\..\tests\lib\win$(PlatformArchitecture)\rel\</AdditionalLibraryDirectories>
<AdditionalDependencies>lib$(LIB_BASE_NAME).lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>false</SDLCheck>
<AdditionalIncludeDirectories>..\..\..\..\include</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<AdditionalLibraryDirectories>..\..\..\..\lib\win$(PlatformArchitecture)\rel\;..\..\..\..\tests\lib\win$(PlatformArchitecture)\rel\</AdditionalLibraryDirectories>
<AdditionalDependencies>lib$(LIB_BASE_NAME).lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release-dll|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>false</SDLCheck>
<AdditionalIncludeDirectories>..\..\..\..\include</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<AdditionalLibraryDirectories>..\..\..\..\lib\win$(PlatformArchitecture)\rel\;..\..\..\..\tests\lib\win$(PlatformArchitecture)\rel\</AdditionalLibraryDirectories>
<AdditionalDependencies>lib$(LIB_BASE_NAME).lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\..\source\mem_buff_demo.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
</Project>

View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<Project>
<ProjectOutputs>
<ProjectOutput>
<FullPath>C:\work\OpenCSD\ocsd-linaro\decoder\tests\bin\win64\rel\mem-buffer-eg.exe</FullPath>
</ProjectOutput>
</ProjectOutputs>
<ContentFiles />
<SatelliteDlls />
<NonRecipeFileRefs />
</Project>

View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project>
<ProjectOutputs />
<ContentFiles />
<SatelliteDlls />
<NonRecipeFileRefs />
</Project>

View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project>
<ProjectOutputs />
<ContentFiles />
<SatelliteDlls />
<NonRecipeFileRefs />
</Project>

Some files were not shown because too many files have changed in this diff Show More