1117N/A/*
1117N/A * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.
1117N/A *
1117N/A * Permission is hereby granted, free of charge, to any person obtaining a
1117N/A * copy of this software and associated documentation files (the "Software"),
1117N/A * to deal in the Software without restriction, including without limitation
1117N/A * the rights to use, copy, modify, merge, publish, distribute, sublicense,
1117N/A * and/or sell copies of the Software, and to permit persons to whom the
1117N/A * Software is furnished to do so, subject to the following conditions:
1117N/A *
1117N/A * The above copyright notice and this permission notice (including the next
1117N/A * paragraph) shall be included in all copies or substantial portions of the
1117N/A * Software.
1117N/A *
1117N/A * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1117N/A * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1117N/A * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
1117N/A * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1117N/A * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
1117N/A * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
1117N/A * DEALINGS IN THE SOFTWARE.
1117N/A */
1117N/A
1117N/A#include <sys/param.h>
1117N/A#include <kvm.h>
1117N/A#include <fcntl.h>
1117N/A#include <stdio.h>
1117N/A#include <sys/types.h>
1117N/A#include <sys/mman.h>
1117N/A#include <sys/time.h>
1117N/A#include <sys/resource.h>
1117N/A
1117N/A#define TEST_ERROR 1 /*A non-zero exit value signals fatal error. */
1117N/A
1117N/Aextern int process_args(); /* These two functions are externs so */
1117N/Aextern int test_usage(); /* that test_init() can use them to */
1117N/Aint runtest();
1117N/A /* initialize the test environment. */
1117N/A
1117N/A#define GRAPHICS_ERROR 1
1117N/A
1117N/A
1117N/A/* define Message IDs */
1117N/A#define TEST_RUN_VMSG 1
1117N/A#define TEST_USAGE_INFOMSG 2000
1117N/A#define GRAPHICS_SUB_TESTS 2001
1117N/A#define GRAPHICS_TEST_INFO_1 2002
1117N/A#define GRAPHICS_TEST_INFO_2 2003
1117N/A
1117N/A#define TEST_ARGUMENT_ERRMSG 6000
1117N/A#define BAD_OPTIONS_ERRMSG 6001
1117N/A#define SUBTEST_ERRMSG 6002
1117N/A#define TEST_SAMPLE_ERRMSG 6003
1117N/A#define TEST_FINAL_ERRMSG 6004
1117N/A
1117N/A
1117N/A#define GRAPHICS_INFO_UNKNOWN_MESSAGE 2114
1117N/A#define GRAPHICS_INFO_MESSAGE_STRING 2115
1117N/A#define GRAPHICS_INFO_ENV_MSG 2116
1117N/A#define GRAPHICS_OPEN_LIBRARY 2117
1117N/A
1117N/A/* standard test messages */
1117N/A#define GRAPHICS_TEST_OPEN_MESG 2900
1117N/A#define GRAPHICS_TEST_DMA_MESG 2901
1117N/A#define GRAPHICS_TEST_MEM_MESG 2902
1117N/A#define GRAPHICS_TEST_CHIP_MESG 2903
1117N/A#define GRAPHICS_TEST_VIDEO_MESG 2904
1117N/A#define GRAPHICS_TEST_EMPTY_MESG 2910
1117N/A
1117N/A#define GRAPHICS_INFO_MEM_TEST_0 3328 /* -------- Random Data Test -------- */
1117N/A#define GRAPHICS_INFO_MEM_TEST_1 3329 /* ---------- Address Test ---------- */
1117N/A#define GRAPHICS_INFO_MEM_TEST_2 3330 /* --------- Increment Test --------- */
1117N/A
1117N/A#define TEST_WARNMSG 4000
1117N/A#define GRAPHICS_WARN_DMA_CMP 4001
1117N/A#define GRAPHICS_WARN_DMA_SAVE 4002
1117N/A#define GRAPHICS_WARN_DMA_REF_OPEN 4003
1117N/A
1117N/A/*
1117N/A * ERRORs
1117N/A */
1117N/A#define GRAPHICS_ERR_RESET 6107
1117N/A#define GRAPHICS_ERR_LOAD 6108
1117N/A#define GRAPHICS_ERR_OPEN_LIBRARY 6109
1117N/A#define GRAPHICS_ERR_NULL_CODES 6110
1117N/A#define GRAPHICS_ERR_NULL_STRING 6111
1117N/A#define GRAPHICS_ERR_MMAP 6112
1117N/A#define GRAPHICS_ERR_DMA_CMP 6204
1117N/A#define GRAPHICS_ERR_OPEN_MSG 6205
1117N/A#define GRAPHICS_ERR_DMA_MSG 6206
1117N/A#define GRAPHICS_ERR_MEMORY_MSG 6207
1117N/A#define GRAPHICS_ERR_CHIP_MSG 6208
1117N/A#define GRAPHICS_ERR_OPEN 6209
1117N/A#define GRAPHICS_ERR_DMA 6210
1117N/A#define GRAPHICS_ERR_MEMORY 6211
1117N/A#define GRAPHICS_ERR_CHIP 6212
1117N/A#define GRAPHICS_ERR_CONNECTIVITY 6213
1117N/A#define GRAPHICS_ERR_CONNECTIVITY_MSG 6214
1117N/A
1117N/A
1117N/A#define GRAPHICS_ERR_1 7681 /* Error: @ x=, y=, expected, read */
1117N/A#define GRAPHICS_ERR_FILE 7682 /* Couldn't open file on host for writing */
1117N/A#define GRAPHICS_ERR_2 7683 /* Error: @ x=, y=, expected, read */
1117N/A#define GRAPHICS_ERR_3 7684 /* More errors!!! */
1117N/A#define GRAPHICS_ERR_BITS_1 7687 /* Bit: Package U / IO / Pin */
1117N/A#define GRAPHICS_ERR_BITS_2 7688 /* Bit: Package U / IO / Pin */
1117N/A#define GRAPHICS_ERR_MALLOC_FAIL 7689 /* !!!! malloc() failed!!!! */
1117N/A#define GRAPHICS_ERR_ABORT 7690 /* Errors detected -- aborting*/
1117N/A
1117N/A
1117N/A