Hallo, dies ist ein Test.
PWD: /www/data-lst1/unixsoft/unixsoft/kaempfer/.public_html
Running in File Mode
Relative path: ./../../.././../../../usr/man/man3c/adi.3c
Real path: /usr/share/man/man3c/adi.3c
Zurück
'\" te .\" Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved. .TH adi 3C "2 Feb 2019" "Oracle Solaris 11.4" "Standard C Library Functions" .SH NAME adi, adi_clr_version, adi_get_version, adi_set_version, adi_memset, adi_get_precise, adi_set_precise \- Application Data Integrity operations .SH SYNOPSIS .LP .nf #include <sys/types.h> #include <adi.h> caddr_t adi_clr_version(caddr_t addr, size_t size); int adi_get_version(caddr_t addr); caddr_t adi_set_version(caddr_t addr, size_t size, int version); caddr_t adi_memset(caddr_t addr, int c, size_t size, int version); int adi_get_precise(void); int adi_set_precise(int mode); .fi .SH OVERVIEW .sp .LP \fIApplication Data Integrity\fR (\fBADI\fR) is a \fBSPARC\fR hardware feature that detects invalid memory accesses in 64-bit software. See the \fBadi\fR(7) man page for additional information on the ADI feature. .SH DESCRIPTION .sp .LP The following C Library functions provide the ADI API to 64-bit applications: .RS +4 .TP .ie t \(bu .el o The \fBadi_clr_version()\fR function clears (sets to \fB0\fR) all ADI version tags for the specified range of ADI-enabled memory. \fBLoad\fR and \fBstore\fR instructions that reference a memory location with a clear ADI version will not cause a mismatch exception. .RE .RS +4 .TP .ie t \(bu .el o The \fBadi_get_version()\fR function returns the ADI version for a memory address assigned to a region of ADI-enabled memory. .RE .RS +4 .TP .ie t \(bu .el o The \fBadi_set_version()\fR function sets the ADI version tags to a specified version for a specified range of ADI-enabled memory. .RE .RS +4 .TP .ie t \(bu .el o The \fBadi_memset()\fR function sets the bytes in an ADI-enabled memory range to the value of \fBc\fR (converted to an unsigned \fBchar\fR) and sets the ADI version tags of the memory range to the specified version number. Calling the \fBadi_memset()\fR function is more efficient than calling the \fBmemset()\fR and the \fBadi_set_version()\fR functions separately. .RE .RS +4 .TP .ie t \(bu .el o The \fBadi_get_precise()\fR function returns the current state of the ADI precise exception mode for the calling thread. .RE .RS +4 .TP .ie t \(bu .el o The \fBadi_set_precise()\fR function sets the current state of the ADI precise exception mode for the calling thread. The value of mode can either be \fBADI_PRECISE_ENABLE\fR or \fBADI_PRECISE_DISABLE\fR. .RE .SH RETURN VALUES .sp .LP On success, the \fBadi_clr_version()\fR function returns a non-versioned address pointer to the specified memory. Otherwise, the function returns the value \fB(caddr_t)-1\fR and sets \fBerrno\fR to indicate the error. .sp .LP On success, the \fBadi_get_version()\fR function returns the ADI version tag value for the specified address. Otherwise, the function returns the value \fB-1\fR and sets \fBerrno\fR to indicate the error. .sp .LP On success, the \fBadi_set_version()\fR and the \fBadi_memset()\fR functions return a versioned address pointer to the specified memory. Otherwise, the functions return the value \fB(caddr_t)-1\fR and set \fBerrno\fR to indicate the error. .sp .LP On success, the \fBadi_get_precise()\fR function returns the value \fBADI_PRECISE_DISABLE\fR or \fBADI_PRECISE_ENABLE\fR, to indicate the current state of ADI \fBprecise exception mode\fR. Otherwise, the function returns the value \fB-1\fR and sets \fBerrno\fR to indicate the error. .sp .LP On success, the \fBadi_set_precise()\fR function returns the value \fBADI_PRECISE_DISABLE\fR or \fBADI_PRECISE_ENABLE\fR, to indicate the previous state of ADI \fBprecise exception mode\fR. Otherwise, the function returns the value \fB-1\fR and sets \fBerrno\fR to indicate the error. .SH ERRORS .sp .LP The ADI \fBlibc\fR library calls will fail if: .sp .ne 2 .mk .na \fB\fBENOTSUP\fR\fR .ad .RS 11n .rt .RS +4 .TP .ie t \(bu .el o ADI is not supported by the platform. .RE .RS +4 .TP .ie t \(bu .el o ADI is not supported for 32-bit processes. .RE .RE .sp .ne 2 .mk .na \fB\fBEINVAL\fR\fR .ad .RS 11n .rt The version argument is greater than the \fBmaximum version\fR value returned by the \fBadi_version_max\fR(2) function. .sp The \fBprecise exception mode\fR value specified is not \fBADI_PRECISE_ENABLE\fR or \fBADI_PRECISE_DISABLE\fR. .RE .SH ATTRIBUTES .sp .LP See \fBattributes\fR(7) for descriptions of the following attributes: .sp .TS tab( ) box; cw(2.75i) |cw(2.75i) lw(2.75i) |lw(2.75i) . ATTRIBUTE TYPE ATTRIBUTE VALUE _ Interface Stability Volatile _ MT-Level MT-Safe .TE .sp .SH SEE ALSO .sp .LP \fBadi\fR(2), \fBsiginfo.h\fR(3HEAD), \fBattributes\fR(7), \fBstandards\fR(7) .SH WARNINGS .sp .LP If you try to set or clear versions on memory that are not ADI-enabled, you may receive a \fBSIGSEGV\fR signal with an \fBsi_code\fR equal to \fBSEGV_ACCADI\fR. .sp .LP You can set or clear versions on memory more efficiently if you align the \fIaddress\fR and \fIsize\fR arguments to the ADI \fBversioning block size\fR as returned by \fBadi_blksz\fR(2). .sp .LP Do not attempt pointer arithmetic between versioned data pointers that might have different versions. .sp .LP Use only non-versioned addresses when providing user addresses to the kernel as data not intended to be used for kernel \fBcopyin()\fR/\fBcopyout()\fR or I/O. .sp .LP A thread that explicitly disables ADI by calling the \fBadi_set_enabled()\fR function must access ADI-enabled memory using normalized addresses. .sp .LP Be careful when you write to ADI-enabled memory from a thread that is not ADI-enabled. When \fBADI checking\fR is disabled, executing \fBblock store\fR and \fBblock initializing store\fR instructions might clear the version assigned to the target memory address. Library functions such as, but not limited to \fBbzero\fR(3C), \fBmemset\fR(3C), and \fBmemcpy\fR(3C) may use \fBblock initializing store\fR instructions. .sp .LP Under certain conditions, a \fBread()\fR operation that uses direct I/O enabled through the \fBdirectio\fR(3C) function might reset the versions in the buffer to zero. In such cases, the application software should check the version at the beginning of the buffer, and if the version is zero, the software should restore the version of the entire buffer. .sp .LP On some processors, the way version bits are implemented does not guarantee the preservation of the version bits when certain processor-specific RAS (reliability, availability, and serviceability) features are invoked. If the version bits are corrupted, a subsequent \fBload\fR or \fBstore\fR of the affected cacheline generates a version mismatch. If the version mismatch results in a \fBSIGSEGV\fR signal with an \fBsi_code\fR equal to \fBSEGV_ADIPERR\fR, then the \fBsi_adivers\fR value will be set to \fB-1\fR to indicate that the original version is lost. .SH NOTES .sp .LP When a versioned data pointer is provided to the kernel as a target for a \fBcopyin()\fR or \fBcopyout()\fR function or to an I/O operation such as an operation through a \fBread\fR(2) or \fBwrite\fR(2) function, the kernel will assume that the version applies to the whole buffer. If there is an ADI mismatch exception while the kernel is executing the operation, the operation will fail gracefully and where possible \fBerrno\fR will be set to \fBEADI\fR. Because the \fBcopyin\fR(9F)/\fBddi_copyin\fR(9F) and \fBcopyout\fR(9F)/\fBddi_copyout\fR(9F) functions return \fB-1\fR on all kinds of failure, system calls that fail due to an ADI mismatch exception during calls to these functions cannot differentiate the failure from the other ways in which these functions can fail. In such cases \fBerrno\fR will be set to \fBEFAULT\fR.