/*
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*/
#include "libvtsSUNWmga.h" /* Common VTS library definitions */
typedef union MemType {
} MemType;
static const int access_mode[] = {
1, 2, 4, 8, 0
};
/*
* mga_test_memory()
*
* This test will open the device and read and write to all memory
* addresses.
*/
register int const fd)
{
if (gfx_vts_debug_mask & GRAPHICS_VTS_MEM_OFF) {
return (&rp);
}
"mga_test_memory running\n");
"mga_test_memory completed\n");
return (&rp);
}
int
register return_packet *const rp,
register int const fd)
{
register size_t i;
register int signo;
return (-1);
}
return (-1);
}
/*
* Allow a SIGHUP, SIGINT, SIGALRM, or SIGTERM to interrupt our
* memory_test. These signals should already be masked from a
* call to mga_block_signals.
*/
/* Save the current signals. */
/* Setup up new signal action. */
if (!signo) {
/* First time goes here. */
/* Set signal routines. */
/* Unmask SIGHUP, SIGINT, SIGALRM, SIGTERM. */
for (i = 0; access_mode[i] != 0; i++) {
}
/* Mask SIGHUP, SIGINT, SIGALRM, SIGTERM. */
/* Restore the signals. */
}
else {
/* We come here from the siglongjmp in mga_signal_routine. */
/* Mask SIGHUP, SIGINT, SIGALRM, SIGTERM. */
/* Restore the signals. */
/* Cause us to get the signal, when we unmask the signals. */
}
return (-1);
}
"error closing device\n");
return (-1);
}
return (0);
}
void
register int const num_planes,
register int const access_mode,
register int const fb_pitch,
register int const fb_height,
register int const fb_width,
register int const bytepp,
{
register int x;
register int y;
register int complement;
/* Set up raster for this plane group */
/* Cover each 64x64 chunk of screen space */
y = 0;
while (y < fb_height) {
x = 0;
while (x < fb_width) {
/* Do each chunk twice - once normal, once complement */
for (complement = B_FALSE;
complement <= B_TRUE;
complement++) {
write_read(x, y,
base) ||
write_read(x, y,
base);
}
/* Move over one 64x64 chunk */
x += 64;
}
/* Move down one 64x64 chunk */
y += 64;
}
}
void
register int const num_planes)
{
register int i;
register int j;
/* Get memory to store data */
/* Write data to memory */
for (i = 0; i < num_planes * 8; i++) {
for (j = 0; j < 8; j++) {
/* Figure out the value to write */
}
}
}
void)
{
return (ret);
}
register int const xoff,
register int const yoff,
register boolean_t const complement,
register int const access_mode,
register int const fb_pitch,
register int const bytepp,
{
register int x;
register int y;
register int i;
register int subscr = 0;
/* Write Data to Screen */
x += access_mode, i++) {
/* Check which access mode to use for write */
switch (access_mode) {
case 8: /* long long (8-byte) access mode */
break;
case 4: /* word (4-byte) access mode */
break;
case 2: /* short (2-byte) access mode */
break;
default: /* default to byte access */
break;
}
}
subscr++;
}
/* Read the Data From the Screen */
x += access_mode, i++) {
switch (access_mode) {
case 8: /* long long (8-byte) access mode */
break;
case 4: /* word (4-byte) access mode */
break;
case 2: /* short (2-byte) access mode */
break;
default: /* default to byte access */
break;
}
}
/* TODO: verification */
switch (access_mode) {
case 8: /* long long (8-byte) access mode */
for (i = 0; i < (8 * bytepp); i++) {
return (B_FALSE);
}
}
break;
case 4: /* word (4-byte) access mode */
for (i = 0; i < (16 * bytepp); i++) {
return (B_FALSE);
}
}
break;
case 2: /* short (2-byte) access mode */
for (i = 0; i < (32 * bytepp); i++) {
return (B_FALSE);
}
}
break;
default: /* default to byte access */
for (i = 0; i < (64 * bytepp); i++) {
return (B_FALSE);
}
}
break;
}
}
subscr++;
}
return (B_TRUE);
}