Obtained from: NetBSD
Also add some missing $FreeBSD$ to keep svn happy.
PR: 27078 Obtained from: NetBSD