//branches/snapshot/uspace/srv/fb/ppm.c |
---|
0,0 → 1,130 |
/* |
* Copyright (c) 2006 Ondrej Palkovsky |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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 <sys/types.h> |
#include <errno.h> |
#include "ppm.h" |
static void skip_whitespace(unsigned char **data) |
{ |
retry: |
while (**data == ' ' || **data == '\t' || **data == '\n' || |
**data == '\r') |
(*data)++; |
if (**data == '#') { |
while (1) { |
if (**data == '\n' || **data == '\r') |
break; |
(*data)++; |
} |
goto retry; |
} |
} |
static void read_num(unsigned char **data, unsigned int *num) |
{ |
*num = 0; |
while (**data >= '0' && **data <= '9') { |
*num *= 10; |
*num += **data - '0'; |
(*data)++; |
} |
} |
int ppm_get_data(unsigned char *data, size_t dtsz, unsigned int *width, |
unsigned int *height) |
{ |
/* Read magic */ |
if (data[0] != 'P' || data[1] != '6') |
return EINVAL; |
data+=2; |
skip_whitespace(&data); |
read_num(&data, width); |
skip_whitespace(&data); |
read_num(&data,height); |
return 0; |
} |
/** Draw PPM pixmap |
* |
* @param data Pointer to PPM data |
* @param datasz Maximum data size |
* @param sx Coordinate of upper left corner |
* @param sy Coordinate of upper left corner |
* @param maxwidth Maximum allowed width for picture |
* @param maxheight Maximum allowed height for picture |
* @param putpixel Putpixel function used to print bitmap |
*/ |
int ppm_draw(unsigned char *data, size_t datasz, unsigned int sx, |
unsigned int sy, unsigned int maxwidth, unsigned int maxheight, |
putpixel_cb_t putpixel, void *vport) |
{ |
unsigned int width, height; |
unsigned int maxcolor; |
unsigned int i; |
unsigned int color; |
unsigned int coef; |
/* Read magic */ |
if ((data[0] != 'P') || (data[1] != '6')) |
return EINVAL; |
data += 2; |
skip_whitespace(&data); |
read_num(&data, &width); |
skip_whitespace(&data); |
read_num(&data, &height); |
skip_whitespace(&data); |
read_num(&data, &maxcolor); |
data++; |
if ((maxcolor == 0) || (maxcolor > 255) || (width * height > datasz)) |
return EINVAL; |
coef = 255 / maxcolor; |
if (coef * maxcolor > 255) |
coef -= 1; |
for (i = 0; i < width * height; i++) { |
/* Crop picture if we don't fit into region */ |
if (i % width > maxwidth || i / width > maxheight) { |
data += 3; |
continue; |
} |
color = ((data[0] * coef) << 16) + ((data[1] * coef) << 8) + |
data[2] * coef; |
(*putpixel)(vport, sx + (i % width), sy + (i / width), color); |
data += 3; |
} |
return 0; |
} |
//branches/snapshot/uspace/srv/fb/fb.c |
---|
0,0 → 1,1760 |
/* |
* Copyright (c) 2008 Martin Decky |
* Copyright (c) 2006 Jakub Vana |
* Copyright (c) 2006 Ondrej Palkovsky |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** |
* @defgroup fb Graphical framebuffer |
* @brief HelenOS graphical framebuffer. |
* @ingroup fbs |
* @{ |
*/ |
/** @file |
*/ |
#include <stdlib.h> |
#include <unistd.h> |
#include <string.h> |
#include <ddi.h> |
#include <sysinfo.h> |
#include <align.h> |
#include <as.h> |
#include <ipc/fb.h> |
#include <ipc/ipc.h> |
#include <ipc/ns.h> |
#include <ipc/services.h> |
#include <kernel/errno.h> |
#include <kernel/genarch/fb/visuals.h> |
#include <io/color.h> |
#include <io/style.h> |
#include <async.h> |
#include <fibril.h> |
#include <bool.h> |
#include <stdio.h> |
#include "font-8x16.h" |
#include "fb.h" |
#include "main.h" |
#include "../console/screenbuffer.h" |
#include "ppm.h" |
#include "pointer.xbm" |
#include "pointer_mask.xbm" |
#define DEFAULT_BGCOLOR 0xf0f0f0 |
#define DEFAULT_FGCOLOR 0x000000 |
#define GLYPH_UNAVAIL '?' |
#define MAX_ANIM_LEN 8 |
#define MAX_ANIMATIONS 4 |
#define MAX_PIXMAPS 256 /**< Maximum number of saved pixmaps */ |
#define MAX_VIEWPORTS 128 /**< Viewport is a rectangular area on the screen */ |
/** Function to render a pixel from a RGB value. */ |
typedef void (*rgb_conv_t)(void *, uint32_t); |
/** Function to render a bit mask. */ |
typedef void (*mask_conv_t)(void *, bool); |
/** Function to draw a glyph. */ |
typedef void (*dg_t)(unsigned int x, unsigned int y, bool cursor, |
uint8_t *glyphs, uint32_t glyph, uint32_t fg_color, uint32_t bg_color); |
struct { |
uint8_t *fb_addr; |
unsigned int xres; |
unsigned int yres; |
unsigned int scanline; |
unsigned int glyphscanline; |
unsigned int pixelbytes; |
unsigned int glyphbytes; |
/** Pre-rendered mask for rendering glyphs. Specific for the visual. */ |
uint8_t *glyphs; |
rgb_conv_t rgb_conv; |
mask_conv_t mask_conv; |
} screen; |
/** Backbuffer character cell. */ |
typedef struct { |
uint32_t glyph; |
uint32_t fg_color; |
uint32_t bg_color; |
} bb_cell_t; |
typedef struct { |
bool initialized; |
unsigned int x; |
unsigned int y; |
unsigned int width; |
unsigned int height; |
/* Text support in window */ |
unsigned int cols; |
unsigned int rows; |
/* |
* Style and glyphs for text printing |
*/ |
/** Current attributes. */ |
attr_rgb_t attr; |
uint8_t *bgpixel; |
/** |
* Glyph drawing function for this viewport. Different viewports |
* might use different drawing functions depending on whether their |
* scanlines are aligned on a word boundary. |
*/ |
dg_t dglyph; |
/* Auto-cursor position */ |
bool cursor_active; |
unsigned int cur_col; |
unsigned int cur_row; |
bool cursor_shown; |
/* Back buffer */ |
bb_cell_t *backbuf; |
unsigned int bbsize; |
} viewport_t; |
typedef struct { |
bool initialized; |
bool enabled; |
unsigned int vp; |
unsigned int pos; |
unsigned int animlen; |
unsigned int pixmaps[MAX_ANIM_LEN]; |
} animation_t; |
static animation_t animations[MAX_ANIMATIONS]; |
static bool anims_enabled; |
typedef struct { |
unsigned int width; |
unsigned int height; |
uint8_t *data; |
} pixmap_t; |
static pixmap_t pixmaps[MAX_PIXMAPS]; |
static viewport_t viewports[128]; |
static bool client_connected = false; /**< Allow only 1 connection */ |
static uint32_t color_table[16] = { |
[COLOR_BLACK] = 0x000000, |
[COLOR_BLUE] = 0x0000f0, |
[COLOR_GREEN] = 0x00f000, |
[COLOR_CYAN] = 0x00f0f0, |
[COLOR_RED] = 0xf00000, |
[COLOR_MAGENTA] = 0xf000f0, |
[COLOR_YELLOW] = 0xf0f000, |
[COLOR_WHITE] = 0xf0f0f0, |
[8 + COLOR_BLACK] = 0x000000, |
[8 + COLOR_BLUE] = 0x0000ff, |
[8 + COLOR_GREEN] = 0x00ff00, |
[8 + COLOR_CYAN] = 0x00ffff, |
[8 + COLOR_RED] = 0xff0000, |
[8 + COLOR_MAGENTA] = 0xff00ff, |
[8 + COLOR_YELLOW] = 0xffff00, |
[8 + COLOR_WHITE] = 0xffffff, |
}; |
static int rgb_from_attr(attr_rgb_t *rgb, const attrs_t *a); |
static int rgb_from_style(attr_rgb_t *rgb, int style); |
static int rgb_from_idx(attr_rgb_t *rgb, ipcarg_t fg_color, |
ipcarg_t bg_color, ipcarg_t flags); |
static int fb_set_color(viewport_t *vport, ipcarg_t fg_color, |
ipcarg_t bg_color, ipcarg_t attr); |
static void draw_glyph_aligned(unsigned int x, unsigned int y, bool cursor, |
uint8_t *glyphs, uint32_t glyph, uint32_t fg_color, uint32_t bg_color); |
static void draw_glyph_fallback(unsigned int x, unsigned int y, bool cursor, |
uint8_t *glyphs, uint32_t glyph, uint32_t fg_color, uint32_t bg_color); |
static void draw_vp_glyph(viewport_t *vport, bool cursor, unsigned int col, |
unsigned int row); |
#define RED(x, bits) ((x >> (8 + 8 + 8 - bits)) & ((1 << bits) - 1)) |
#define GREEN(x, bits) ((x >> (8 + 8 - bits)) & ((1 << bits) - 1)) |
#define BLUE(x, bits) ((x >> (8 - bits)) & ((1 << bits) - 1)) |
#define COL2X(col) ((col) * FONT_WIDTH) |
#define ROW2Y(row) ((row) * FONT_SCANLINES) |
#define X2COL(x) ((x) / FONT_WIDTH) |
#define Y2ROW(y) ((y) / FONT_SCANLINES) |
#define FB_POS(x, y) ((y) * screen.scanline + (x) * screen.pixelbytes) |
#define BB_POS(vport, col, row) ((row) * vport->cols + (col)) |
#define GLYPH_POS(glyph, y, cursor) (((glyph) + (cursor) * FONT_GLYPHS) * screen.glyphbytes + (y) * screen.glyphscanline) |
/** ARGB 8:8:8:8 conversion |
* |
*/ |
static void rgb_0888(void *dst, uint32_t rgb) |
{ |
*((uint32_t *) dst) = rgb & 0x00ffffff; |
} |
static void mask_0888(void *dst, bool mask) |
{ |
*((uint32_t *) dst) = (mask ? 0x00ffffff : 0); |
} |
/** ABGR 8:8:8:8 conversion |
* |
*/ |
static void bgr_0888(void *dst, uint32_t rgb) |
{ |
*((uint32_t *) dst) |
= (BLUE(rgb, 8) << 16) | (GREEN(rgb, 8) << 8) | RED(rgb, 8); |
} |
/** RGB 8:8:8 conversion |
* |
*/ |
static void rgb_888(void *dst, uint32_t rgb) |
{ |
((uint8_t *) dst)[0] = BLUE(rgb, 8); |
((uint8_t *) dst)[1] = GREEN(rgb, 8); |
((uint8_t *) dst)[2] = RED(rgb, 8); |
} |
static void mask_888(void *dst, bool mask) |
{ |
if (mask) { |
((uint8_t *) dst)[0] = 0xff; |
((uint8_t *) dst)[1] = 0xff; |
((uint8_t *) dst)[2] = 0xff; |
} else { |
((uint8_t *) dst)[0] = 0; |
((uint8_t *) dst)[1] = 0; |
((uint8_t *) dst)[2] = 0; |
} |
} |
/** BGR 8:8:8 conversion |
* |
*/ |
static void bgr_888(void *dst, uint32_t rgb) |
{ |
((uint8_t *) dst)[0] = RED(rgb, 8); |
((uint8_t *) dst)[1] = GREEN(rgb, 8); |
((uint8_t *) dst)[2] = BLUE(rgb, 8); |
} |
/** RGB 5:5:5 conversion |
* |
*/ |
static void rgb_555(void *dst, uint32_t rgb) |
{ |
*((uint16_t *) dst) |
= (RED(rgb, 5) << 10) | (GREEN(rgb, 5) << 5) | BLUE(rgb, 5); |
} |
static void mask_555(void *dst, bool mask) |
{ |
*((uint16_t *) dst) = (mask ? 0x7fff : 0); |
} |
/** RGB 5:6:5 conversion |
* |
*/ |
static void rgb_565(void *dst, uint32_t rgb) |
{ |
*((uint16_t *) dst) |
= (RED(rgb, 5) << 11) | (GREEN(rgb, 6) << 5) | BLUE(rgb, 5); |
} |
static void mask_565(void *dst, bool mask) |
{ |
*((uint16_t *) dst) = (mask ? 0xffff : 0); |
} |
/** RGB 3:2:3 |
* |
*/ |
static void rgb_323(void *dst, uint32_t rgb) |
{ |
*((uint8_t *) dst) |
= ~((RED(rgb, 3) << 5) | (GREEN(rgb, 2) << 3) | BLUE(rgb, 3)); |
} |
static void mask_323(void *dst, bool mask) |
{ |
*((uint8_t *) dst) = (mask ? 0xff : 0); |
} |
/** Draw a filled rectangle. |
* |
* @note Need real implementation that does not access VRAM twice. |
* |
*/ |
static void draw_filled_rect(unsigned int x0, unsigned int y0, unsigned int x1, |
unsigned int y1, uint32_t color) |
{ |
unsigned int x; |
unsigned int y; |
unsigned int copy_bytes; |
uint8_t *sp; |
uint8_t *dp; |
uint8_t cbuf[4]; |
if ((y0 >= y1) || (x0 >= x1)) |
return; |
screen.rgb_conv(cbuf, color); |
sp = &screen.fb_addr[FB_POS(x0, y0)]; |
dp = sp; |
/* Draw the first line. */ |
for (x = x0; x < x1; x++) { |
memcpy(dp, cbuf, screen.pixelbytes); |
dp += screen.pixelbytes; |
} |
dp = sp + screen.scanline; |
copy_bytes = (x1 - x0) * screen.pixelbytes; |
/* Draw the remaining lines by copying. */ |
for (y = y0 + 1; y < y1; y++) { |
memcpy(dp, sp, copy_bytes); |
dp += screen.scanline; |
} |
} |
/** Redraw viewport. |
* |
* @param vport Viewport to redraw |
* |
*/ |
static void vport_redraw(viewport_t *vport) |
{ |
unsigned int col; |
unsigned int row; |
for (row = 0; row < vport->rows; row++) { |
for (col = 0; col < vport->cols; col++) { |
draw_vp_glyph(vport, false, col, row); |
} |
} |
if (COL2X(vport->cols) < vport->width) { |
draw_filled_rect( |
vport->x + COL2X(vport->cols), vport->y, |
vport->x + vport->width, vport->y + vport->height, |
vport->attr.bg_color); |
} |
if (ROW2Y(vport->rows) < vport->height) { |
draw_filled_rect( |
vport->x, vport->y + ROW2Y(vport->rows), |
vport->x + vport->width, vport->y + vport->height, |
vport->attr.bg_color); |
} |
} |
static void backbuf_clear(bb_cell_t *backbuf, size_t len, uint32_t fg_color, |
uint32_t bg_color) |
{ |
size_t i; |
for (i = 0; i < len; i++) { |
backbuf[i].glyph = 0; |
backbuf[i].fg_color = fg_color; |
backbuf[i].bg_color = bg_color; |
} |
} |
/** Clear viewport. |
* |
* @param vport Viewport to clear |
* |
*/ |
static void vport_clear(viewport_t *vport) |
{ |
backbuf_clear(vport->backbuf, vport->cols * vport->rows, |
vport->attr.fg_color, vport->attr.bg_color); |
vport_redraw(vport); |
} |
/** Scroll viewport by the specified number of lines. |
* |
* @param vport Viewport to scroll |
* @param lines Number of lines to scroll |
* |
*/ |
static void vport_scroll(viewport_t *vport, int lines) |
{ |
unsigned int col; |
unsigned int row; |
unsigned int x; |
unsigned int y; |
uint32_t glyph; |
uint32_t fg_color; |
uint32_t bg_color; |
bb_cell_t *bbp; |
bb_cell_t *xbp; |
/* |
* Redraw. |
*/ |
y = vport->y; |
for (row = 0; row < vport->rows; row++) { |
x = vport->x; |
for (col = 0; col < vport->cols; col++) { |
if (((int) row + lines >= 0) && |
((int) row + lines < (int) vport->rows)) { |
xbp = &vport->backbuf[BB_POS(vport, col, row + lines)]; |
bbp = &vport->backbuf[BB_POS(vport, col, row)]; |
glyph = xbp->glyph; |
fg_color = xbp->fg_color; |
bg_color = xbp->bg_color; |
if ((bbp->glyph == glyph) |
&& (bbp->fg_color == xbp->fg_color) |
&& (bbp->bg_color == xbp->bg_color)) { |
x += FONT_WIDTH; |
continue; |
} |
} else { |
glyph = 0; |
fg_color = vport->attr.fg_color; |
bg_color = vport->attr.bg_color; |
} |
(*vport->dglyph)(x, y, false, screen.glyphs, glyph, |
fg_color, bg_color); |
x += FONT_WIDTH; |
} |
y += FONT_SCANLINES; |
} |
/* |
* Scroll backbuffer. |
*/ |
if (lines > 0) { |
memmove(vport->backbuf, vport->backbuf + vport->cols * lines, |
vport->cols * (vport->rows - lines) * sizeof(bb_cell_t)); |
backbuf_clear(&vport->backbuf[BB_POS(vport, 0, vport->rows - lines)], |
vport->cols * lines, vport->attr.fg_color, vport->attr.bg_color); |
} else { |
memmove(vport->backbuf - vport->cols * lines, vport->backbuf, |
vport->cols * (vport->rows + lines) * sizeof(bb_cell_t)); |
backbuf_clear(vport->backbuf, - vport->cols * lines, |
vport->attr.fg_color, vport->attr.bg_color); |
} |
} |
/** Render glyphs |
* |
* Convert glyphs from device independent font |
* description to current visual representation. |
* |
*/ |
static void render_glyphs(void) |
{ |
unsigned int glyph; |
for (glyph = 0; glyph < FONT_GLYPHS; glyph++) { |
unsigned int y; |
for (y = 0; y < FONT_SCANLINES; y++) { |
unsigned int x; |
for (x = 0; x < FONT_WIDTH; x++) { |
screen.mask_conv(&screen.glyphs[GLYPH_POS(glyph, y, false) + x * screen.pixelbytes], |
(fb_font[glyph][y] & (1 << (7 - x))) ? true : false); |
screen.mask_conv(&screen.glyphs[GLYPH_POS(glyph, y, true) + x * screen.pixelbytes], |
(fb_font[glyph][y] & (1 << (7 - x))) ? false : true); |
} |
} |
} |
} |
/** Create new viewport |
* |
* @param x Origin of the viewport (x). |
* @param y Origin of the viewport (y). |
* @param width Width of the viewport. |
* @param height Height of the viewport. |
* |
* @return New viewport number. |
* |
*/ |
static int vport_create(unsigned int x, unsigned int y, |
unsigned int width, unsigned int height) |
{ |
unsigned int i; |
for (i = 0; i < MAX_VIEWPORTS; i++) { |
if (!viewports[i].initialized) |
break; |
} |
if (i == MAX_VIEWPORTS) |
return ELIMIT; |
unsigned int cols = width / FONT_WIDTH; |
unsigned int rows = height / FONT_SCANLINES; |
unsigned int bbsize = cols * rows * sizeof(bb_cell_t); |
unsigned int word_size = sizeof(unsigned long); |
bb_cell_t *backbuf = (bb_cell_t *) malloc(bbsize); |
if (!backbuf) |
return ENOMEM; |
uint8_t *bgpixel = (uint8_t *) malloc(screen.pixelbytes); |
if (!bgpixel) { |
free(backbuf); |
return ENOMEM; |
} |
backbuf_clear(backbuf, cols * rows, DEFAULT_FGCOLOR, DEFAULT_BGCOLOR); |
memset(bgpixel, 0, screen.pixelbytes); |
viewports[i].x = x; |
viewports[i].y = y; |
viewports[i].width = width; |
viewports[i].height = height; |
viewports[i].cols = cols; |
viewports[i].rows = rows; |
viewports[i].attr.bg_color = DEFAULT_BGCOLOR; |
viewports[i].attr.fg_color = DEFAULT_FGCOLOR; |
viewports[i].bgpixel = bgpixel; |
/* |
* Conditions necessary to select aligned version: |
* - word size is divisible by pixelbytes |
* - cell scanline size is divisible by word size |
* - cell scanlines are word-aligned |
* |
*/ |
if (((word_size % screen.pixelbytes) == 0) |
&& ((FONT_WIDTH * screen.pixelbytes) % word_size == 0) |
&& ((x * screen.pixelbytes) % word_size == 0) |
&& (screen.scanline % word_size == 0)) { |
viewports[i].dglyph = draw_glyph_aligned; |
} else { |
viewports[i].dglyph = draw_glyph_fallback; |
} |
viewports[i].cur_col = 0; |
viewports[i].cur_row = 0; |
viewports[i].cursor_active = false; |
viewports[i].cursor_shown = false; |
viewports[i].bbsize = bbsize; |
viewports[i].backbuf = backbuf; |
viewports[i].initialized = true; |
screen.rgb_conv(viewports[i].bgpixel, viewports[i].attr.bg_color); |
return i; |
} |
/** Initialize framebuffer as a chardev output device |
* |
* @param addr Address of the framebuffer |
* @param xres Screen width in pixels |
* @param yres Screen height in pixels |
* @param visual Bits per pixel (8, 16, 24, 32) |
* @param scan Bytes per one scanline |
* |
*/ |
static bool screen_init(void *addr, unsigned int xres, unsigned int yres, |
unsigned int scan, unsigned int visual) |
{ |
switch (visual) { |
case VISUAL_INDIRECT_8: |
screen.rgb_conv = rgb_323; |
screen.mask_conv = mask_323; |
screen.pixelbytes = 1; |
break; |
case VISUAL_RGB_5_5_5: |
screen.rgb_conv = rgb_555; |
screen.mask_conv = mask_555; |
screen.pixelbytes = 2; |
break; |
case VISUAL_RGB_5_6_5: |
screen.rgb_conv = rgb_565; |
screen.mask_conv = mask_565; |
screen.pixelbytes = 2; |
break; |
case VISUAL_RGB_8_8_8: |
screen.rgb_conv = rgb_888; |
screen.mask_conv = mask_888; |
screen.pixelbytes = 3; |
break; |
case VISUAL_BGR_8_8_8: |
screen.rgb_conv = bgr_888; |
screen.mask_conv = mask_888; |
screen.pixelbytes = 3; |
break; |
case VISUAL_RGB_8_8_8_0: |
screen.rgb_conv = rgb_888; |
screen.mask_conv = mask_888; |
screen.pixelbytes = 4; |
break; |
case VISUAL_RGB_0_8_8_8: |
screen.rgb_conv = rgb_0888; |
screen.mask_conv = mask_0888; |
screen.pixelbytes = 4; |
break; |
case VISUAL_BGR_0_8_8_8: |
screen.rgb_conv = bgr_0888; |
screen.mask_conv = mask_0888; |
screen.pixelbytes = 4; |
break; |
default: |
return false; |
} |
screen.fb_addr = (unsigned char *) addr; |
screen.xres = xres; |
screen.yres = yres; |
screen.scanline = scan; |
screen.glyphscanline = FONT_WIDTH * screen.pixelbytes; |
screen.glyphbytes = screen.glyphscanline * FONT_SCANLINES; |
size_t glyphsize = 2 * FONT_GLYPHS * screen.glyphbytes; |
uint8_t *glyphs = (uint8_t *) malloc(glyphsize); |
if (!glyphs) |
return false; |
memset(glyphs, 0, glyphsize); |
screen.glyphs = glyphs; |
render_glyphs(); |
/* Create first viewport */ |
vport_create(0, 0, xres, yres); |
return true; |
} |
/** Draw a glyph, takes advantage of alignment. |
* |
* This version can only be used if the following conditions are met: |
* |
* - word size is divisible by pixelbytes |
* - cell scanline size is divisible by word size |
* - cell scanlines are word-aligned |
* |
* It makes use of the pre-rendered mask to process (possibly) several |
* pixels at once (word size / pixelbytes pixels at a time are processed) |
* making it very fast. Most notably this version is not applicable at 24 bits |
* per pixel. |
* |
* @param x x coordinate of top-left corner on screen. |
* @param y y coordinate of top-left corner on screen. |
* @param cursor Draw glyph with cursor |
* @param glyphs Pointer to font bitmap. |
* @param glyph Code of the glyph to draw. |
* @param fg_color Foreground color. |
* @param bg_color Backgroudn color. |
* |
*/ |
static void draw_glyph_aligned(unsigned int x, unsigned int y, bool cursor, |
uint8_t *glyphs, uint32_t glyph, uint32_t fg_color, uint32_t bg_color) |
{ |
unsigned int i; |
unsigned int yd; |
unsigned long fg_buf; |
unsigned long bg_buf; |
unsigned long mask; |
/* |
* Prepare a pair of words, one filled with foreground-color |
* pattern and the other filled with background-color pattern. |
*/ |
for (i = 0; i < sizeof(unsigned long) / screen.pixelbytes; i++) { |
screen.rgb_conv(&((uint8_t *) &fg_buf)[i * screen.pixelbytes], |
fg_color); |
screen.rgb_conv(&((uint8_t *) &bg_buf)[i * screen.pixelbytes], |
bg_color); |
} |
/* Pointer to the current position in the mask. */ |
unsigned long *maskp = (unsigned long *) &glyphs[GLYPH_POS(glyph, 0, cursor)]; |
/* Pointer to the current position on the screen. */ |
unsigned long *dp = (unsigned long *) &screen.fb_addr[FB_POS(x, y)]; |
/* Width of the character cell in words. */ |
unsigned int ww = FONT_WIDTH * screen.pixelbytes / sizeof(unsigned long); |
/* Offset to add when moving to another screen scanline. */ |
unsigned int d_add = screen.scanline - FONT_WIDTH * screen.pixelbytes; |
for (yd = 0; yd < FONT_SCANLINES; yd++) { |
/* |
* Now process the cell scanline, combining foreground |
* and background color patters using the pre-rendered mask. |
*/ |
for (i = 0; i < ww; i++) { |
mask = *maskp++; |
*dp++ = (fg_buf & mask) | (bg_buf & ~mask); |
} |
/* Move to the beginning of the next scanline of the cell. */ |
dp = (unsigned long *) ((uint8_t *) dp + d_add); |
} |
} |
/** Draw a glyph, fallback version. |
* |
* This version does not make use of the pre-rendered mask, it uses |
* the font bitmap directly. It works always, but it is slower. |
* |
* @param x x coordinate of top-left corner on screen. |
* @param y y coordinate of top-left corner on screen. |
* @param cursor Draw glyph with cursor |
* @param glyphs Pointer to font bitmap. |
* @param glyph Code of the glyph to draw. |
* @param fg_color Foreground color. |
* @param bg_color Backgroudn color. |
* |
*/ |
void draw_glyph_fallback(unsigned int x, unsigned int y, bool cursor, |
uint8_t *glyphs, uint32_t glyph, uint32_t fg_color, uint32_t bg_color) |
{ |
unsigned int i; |
unsigned int j; |
unsigned int yd; |
uint8_t fg_buf[4]; |
uint8_t bg_buf[4]; |
uint8_t *sp; |
uint8_t b; |
/* Pre-render 1x the foreground and background color pixels. */ |
if (cursor) { |
screen.rgb_conv(fg_buf, bg_color); |
screen.rgb_conv(bg_buf, fg_color); |
} else { |
screen.rgb_conv(fg_buf, fg_color); |
screen.rgb_conv(bg_buf, bg_color); |
} |
/* Pointer to the current position on the screen. */ |
uint8_t *dp = (uint8_t *) &screen.fb_addr[FB_POS(x, y)]; |
/* Offset to add when moving to another screen scanline. */ |
unsigned int d_add = screen.scanline - FONT_WIDTH * screen.pixelbytes; |
for (yd = 0; yd < FONT_SCANLINES; yd++) { |
/* Byte containing bits of the glyph scanline. */ |
b = fb_font[glyph][yd]; |
for (i = 0; i < FONT_WIDTH; i++) { |
/* Choose color based on the current bit. */ |
sp = (b & 0x80) ? fg_buf : bg_buf; |
/* Copy the pixel. */ |
for (j = 0; j < screen.pixelbytes; j++) { |
*dp++ = *sp++; |
} |
/* Move to the next bit. */ |
b = b << 1; |
} |
/* Move to the beginning of the next scanline of the cell. */ |
dp += d_add; |
} |
} |
/** Draw glyph at specified position in viewport. |
* |
* @param vport Viewport identification |
* @param cursor Draw glyph with cursor |
* @param col Screen position relative to viewport |
* @param row Screen position relative to viewport |
* |
*/ |
static void draw_vp_glyph(viewport_t *vport, bool cursor, unsigned int col, |
unsigned int row) |
{ |
unsigned int x = vport->x + COL2X(col); |
unsigned int y = vport->y + ROW2Y(row); |
uint32_t glyph = vport->backbuf[BB_POS(vport, col, row)].glyph; |
uint32_t fg_color = vport->backbuf[BB_POS(vport, col, row)].fg_color; |
uint32_t bg_color = vport->backbuf[BB_POS(vport, col, row)].bg_color; |
(*vport->dglyph)(x, y, cursor, screen.glyphs, glyph, |
fg_color, bg_color); |
} |
/** Hide cursor if it is shown |
* |
*/ |
static void cursor_hide(viewport_t *vport) |
{ |
if ((vport->cursor_active) && (vport->cursor_shown)) { |
draw_vp_glyph(vport, false, vport->cur_col, vport->cur_row); |
vport->cursor_shown = false; |
} |
} |
/** Show cursor if cursor showing is enabled |
* |
*/ |
static void cursor_show(viewport_t *vport) |
{ |
/* Do not check for cursor_shown */ |
if (vport->cursor_active) { |
draw_vp_glyph(vport, true, vport->cur_col, vport->cur_row); |
vport->cursor_shown = true; |
} |
} |
/** Invert cursor, if it is enabled |
* |
*/ |
static void cursor_blink(viewport_t *vport) |
{ |
if (vport->cursor_shown) |
cursor_hide(vport); |
else |
cursor_show(vport); |
} |
/** Draw character at given position relative to viewport |
* |
* @param vport Viewport identification |
* @param c Character to draw |
* @param col Screen position relative to viewport |
* @param row Screen position relative to viewport |
* |
*/ |
static void draw_char(viewport_t *vport, wchar_t c, unsigned int col, unsigned int row) |
{ |
bb_cell_t *bbp; |
/* Do not hide cursor if we are going to overwrite it */ |
if ((vport->cursor_active) && (vport->cursor_shown) && |
((vport->cur_col != col) || (vport->cur_row != row))) |
cursor_hide(vport); |
bbp = &vport->backbuf[BB_POS(vport, col, row)]; |
bbp->glyph = fb_font_glyph(c); |
bbp->fg_color = vport->attr.fg_color; |
bbp->bg_color = vport->attr.bg_color; |
draw_vp_glyph(vport, false, col, row); |
vport->cur_col = col; |
vport->cur_row = row; |
vport->cur_col++; |
if (vport->cur_col >= vport->cols) { |
vport->cur_col = 0; |
vport->cur_row++; |
if (vport->cur_row >= vport->rows) |
vport->cur_row--; |
} |
cursor_show(vport); |
} |
/** Draw text data to viewport. |
* |
* @param vport Viewport id |
* @param data Text data. |
* @param x Leftmost column of the area. |
* @param y Topmost row of the area. |
* @param w Number of rows. |
* @param h Number of columns. |
* |
*/ |
static void draw_text_data(viewport_t *vport, keyfield_t *data, unsigned int x, |
unsigned int y, unsigned int w, unsigned int h) |
{ |
unsigned int i; |
unsigned int j; |
bb_cell_t *bbp; |
attrs_t *a; |
attr_rgb_t rgb; |
for (j = 0; j < h; j++) { |
for (i = 0; i < w; i++) { |
unsigned int col = x + i; |
unsigned int row = y + j; |
bbp = &vport->backbuf[BB_POS(vport, col, row)]; |
a = &data[j * w + i].attrs; |
rgb_from_attr(&rgb, a); |
bbp->glyph = fb_font_glyph(data[j * w + i].character); |
bbp->fg_color = rgb.fg_color; |
bbp->bg_color = rgb.bg_color; |
draw_vp_glyph(vport, false, col, row); |
} |
} |
cursor_show(vport); |
} |
static void putpixel_pixmap(void *data, unsigned int x, unsigned int y, uint32_t color) |
{ |
int pm = *((int *) data); |
pixmap_t *pmap = &pixmaps[pm]; |
unsigned int pos = (y * pmap->width + x) * screen.pixelbytes; |
screen.rgb_conv(&pmap->data[pos], color); |
} |
static void putpixel(void *data, unsigned int x, unsigned int y, uint32_t color) |
{ |
viewport_t *vport = (viewport_t *) data; |
unsigned int dx = vport->x + x; |
unsigned int dy = vport->y + y; |
screen.rgb_conv(&screen.fb_addr[FB_POS(dx, dy)], color); |
} |
/** Return first free pixmap |
* |
*/ |
static int find_free_pixmap(void) |
{ |
unsigned int i; |
for (i = 0; i < MAX_PIXMAPS; i++) |
if (!pixmaps[i].data) |
return i; |
return -1; |
} |
/** Create a new pixmap and return appropriate ID |
* |
*/ |
static int shm2pixmap(unsigned char *shm, size_t size) |
{ |
int pm; |
pixmap_t *pmap; |
pm = find_free_pixmap(); |
if (pm == -1) |
return ELIMIT; |
pmap = &pixmaps[pm]; |
if (ppm_get_data(shm, size, &pmap->width, &pmap->height)) |
return EINVAL; |
pmap->data = malloc(pmap->width * pmap->height * screen.pixelbytes); |
if (!pmap->data) |
return ENOMEM; |
ppm_draw(shm, size, 0, 0, pmap->width, pmap->height, putpixel_pixmap, (void *) &pm); |
return pm; |
} |
/** Handle shared memory communication calls |
* |
* Protocol for drawing pixmaps: |
* - FB_PREPARE_SHM(client shm identification) |
* - IPC_M_AS_AREA_SEND |
* - FB_DRAW_PPM(startx, starty) |
* - FB_DROP_SHM |
* |
* Protocol for text drawing |
* - IPC_M_AS_AREA_SEND |
* - FB_DRAW_TEXT_DATA |
* |
* @param callid Callid of the current call |
* @param call Current call data |
* @param vp Active viewport |
* |
* @return false if the call was not handled byt this function, true otherwise |
* |
* Note: this function is not thread-safe, you would have |
* to redefine static variables with fibril_local. |
* |
*/ |
static bool shm_handle(ipc_callid_t callid, ipc_call_t *call, int vp) |
{ |
static keyfield_t *interbuffer = NULL; |
static size_t intersize = 0; |
static unsigned char *shm = NULL; |
static ipcarg_t shm_id = 0; |
static size_t shm_size; |
bool handled = true; |
int retval = EOK; |
viewport_t *vport = &viewports[vp]; |
unsigned int x; |
unsigned int y; |
unsigned int w; |
unsigned int h; |
switch (IPC_GET_METHOD(*call)) { |
case IPC_M_SHARE_OUT: |
/* We accept one area for data interchange */ |
if (IPC_GET_ARG1(*call) == shm_id) { |
void *dest = as_get_mappable_page(IPC_GET_ARG2(*call)); |
shm_size = IPC_GET_ARG2(*call); |
if (ipc_answer_1(callid, EOK, (sysarg_t) dest)) { |
shm_id = 0; |
return false; |
} |
shm = dest; |
if (shm[0] != 'P') |
return false; |
return true; |
} else { |
intersize = IPC_GET_ARG2(*call); |
receive_comm_area(callid, call, (void *) &interbuffer); |
} |
return true; |
case FB_PREPARE_SHM: |
if (shm_id) |
retval = EBUSY; |
else |
shm_id = IPC_GET_ARG1(*call); |
break; |
case FB_DROP_SHM: |
if (shm) { |
as_area_destroy(shm); |
shm = NULL; |
} |
shm_id = 0; |
break; |
case FB_SHM2PIXMAP: |
if (!shm) { |
retval = EINVAL; |
break; |
} |
retval = shm2pixmap(shm, shm_size); |
break; |
case FB_DRAW_PPM: |
if (!shm) { |
retval = EINVAL; |
break; |
} |
x = IPC_GET_ARG1(*call); |
y = IPC_GET_ARG2(*call); |
if ((x > vport->width) || (y > vport->height)) { |
retval = EINVAL; |
break; |
} |
ppm_draw(shm, shm_size, IPC_GET_ARG1(*call), |
IPC_GET_ARG2(*call), vport->width - x, vport->height - y, putpixel, (void *) vport); |
break; |
case FB_DRAW_TEXT_DATA: |
x = IPC_GET_ARG1(*call); |
y = IPC_GET_ARG2(*call); |
w = IPC_GET_ARG3(*call); |
h = IPC_GET_ARG4(*call); |
if (!interbuffer) { |
retval = EINVAL; |
break; |
} |
if (x + w > vport->cols || y + h > vport->rows) { |
retval = EINVAL; |
break; |
} |
if (intersize < w * h * sizeof(*interbuffer)) { |
retval = EINVAL; |
break; |
} |
draw_text_data(vport, interbuffer, x, y, w, h); |
break; |
default: |
handled = false; |
} |
if (handled) |
ipc_answer_0(callid, retval); |
return handled; |
} |
static void copy_vp_to_pixmap(viewport_t *vport, pixmap_t *pmap) |
{ |
unsigned int width = vport->width; |
unsigned int height = vport->height; |
if (width + vport->x > screen.xres) |
width = screen.xres - vport->x; |
if (height + vport->y > screen.yres) |
height = screen.yres - vport->y; |
unsigned int realwidth = pmap->width <= width ? pmap->width : width; |
unsigned int realheight = pmap->height <= height ? pmap->height : height; |
unsigned int srcrowsize = vport->width * screen.pixelbytes; |
unsigned int realrowsize = realwidth * screen.pixelbytes; |
unsigned int y; |
for (y = 0; y < realheight; y++) { |
unsigned int tmp = (vport->y + y) * screen.scanline + vport->x * screen.pixelbytes; |
memcpy(pmap->data + srcrowsize * y, screen.fb_addr + tmp, realrowsize); |
} |
} |
/** Save viewport to pixmap |
* |
*/ |
static int save_vp_to_pixmap(viewport_t *vport) |
{ |
int pm; |
pixmap_t *pmap; |
pm = find_free_pixmap(); |
if (pm == -1) |
return ELIMIT; |
pmap = &pixmaps[pm]; |
pmap->data = malloc(screen.pixelbytes * vport->width * vport->height); |
if (!pmap->data) |
return ENOMEM; |
pmap->width = vport->width; |
pmap->height = vport->height; |
copy_vp_to_pixmap(vport, pmap); |
return pm; |
} |
/** Draw pixmap on screen |
* |
* @param vp Viewport to draw on |
* @param pm Pixmap identifier |
* |
*/ |
static int draw_pixmap(int vp, int pm) |
{ |
pixmap_t *pmap = &pixmaps[pm]; |
viewport_t *vport = &viewports[vp]; |
unsigned int width = vport->width; |
unsigned int height = vport->height; |
if (width + vport->x > screen.xres) |
width = screen.xres - vport->x; |
if (height + vport->y > screen.yres) |
height = screen.yres - vport->y; |
if (!pmap->data) |
return EINVAL; |
unsigned int realwidth = pmap->width <= width ? pmap->width : width; |
unsigned int realheight = pmap->height <= height ? pmap->height : height; |
unsigned int srcrowsize = vport->width * screen.pixelbytes; |
unsigned int realrowsize = realwidth * screen.pixelbytes; |
unsigned int y; |
for (y = 0; y < realheight; y++) { |
unsigned int tmp = (vport->y + y) * screen.scanline + vport->x * screen.pixelbytes; |
memcpy(screen.fb_addr + tmp, pmap->data + y * srcrowsize, realrowsize); |
} |
return EOK; |
} |
/** Tick animation one step forward |
* |
*/ |
static void anims_tick(void) |
{ |
unsigned int i; |
static int counts = 0; |
/* Limit redrawing */ |
counts = (counts + 1) % 8; |
if (counts) |
return; |
for (i = 0; i < MAX_ANIMATIONS; i++) { |
if ((!animations[i].animlen) || (!animations[i].initialized) || |
(!animations[i].enabled)) |
continue; |
draw_pixmap(animations[i].vp, animations[i].pixmaps[animations[i].pos]); |
animations[i].pos = (animations[i].pos + 1) % animations[i].animlen; |
} |
} |
static unsigned int pointer_x; |
static unsigned int pointer_y; |
static bool pointer_shown, pointer_enabled; |
static int pointer_vport = -1; |
static int pointer_pixmap = -1; |
static void mouse_show(void) |
{ |
int i, j; |
int visibility; |
int color; |
int bytepos; |
if ((pointer_shown) || (!pointer_enabled)) |
return; |
/* Save image under the pointer. */ |
if (pointer_vport == -1) { |
pointer_vport = vport_create(pointer_x, pointer_y, pointer_width, pointer_height); |
if (pointer_vport < 0) |
return; |
} else { |
viewports[pointer_vport].x = pointer_x; |
viewports[pointer_vport].y = pointer_y; |
} |
if (pointer_pixmap == -1) |
pointer_pixmap = save_vp_to_pixmap(&viewports[pointer_vport]); |
else |
copy_vp_to_pixmap(&viewports[pointer_vport], &pixmaps[pointer_pixmap]); |
/* Draw mouse pointer. */ |
for (i = 0; i < pointer_height; i++) |
for (j = 0; j < pointer_width; j++) { |
bytepos = i * ((pointer_width - 1) / 8 + 1) + j / 8; |
visibility = pointer_mask_bits[bytepos] & |
(1 << (j % 8)); |
if (visibility) { |
color = pointer_bits[bytepos] & |
(1 << (j % 8)) ? 0 : 0xffffff; |
if (pointer_x + j < screen.xres && pointer_y + |
i < screen.yres) |
putpixel(&viewports[0], pointer_x + j, |
pointer_y + i, color); |
} |
} |
pointer_shown = 1; |
} |
static void mouse_hide(void) |
{ |
/* Restore image under the pointer. */ |
if (pointer_shown) { |
draw_pixmap(pointer_vport, pointer_pixmap); |
pointer_shown = 0; |
} |
} |
static void mouse_move(unsigned int x, unsigned int y) |
{ |
mouse_hide(); |
pointer_x = x; |
pointer_y = y; |
mouse_show(); |
} |
static int anim_handle(ipc_callid_t callid, ipc_call_t *call, int vp) |
{ |
bool handled = true; |
int retval = EOK; |
int i, nvp; |
int newval; |
switch (IPC_GET_METHOD(*call)) { |
case FB_ANIM_CREATE: |
nvp = IPC_GET_ARG1(*call); |
if (nvp == -1) |
nvp = vp; |
if (nvp >= MAX_VIEWPORTS || nvp < 0 || |
!viewports[nvp].initialized) { |
retval = EINVAL; |
break; |
} |
for (i = 0; i < MAX_ANIMATIONS; i++) { |
if (!animations[i].initialized) |
break; |
} |
if (i == MAX_ANIMATIONS) { |
retval = ELIMIT; |
break; |
} |
animations[i].initialized = 1; |
animations[i].animlen = 0; |
animations[i].pos = 0; |
animations[i].enabled = 0; |
animations[i].vp = nvp; |
retval = i; |
break; |
case FB_ANIM_DROP: |
i = IPC_GET_ARG1(*call); |
if (i >= MAX_ANIMATIONS || i < 0) { |
retval = EINVAL; |
break; |
} |
animations[i].initialized = 0; |
break; |
case FB_ANIM_ADDPIXMAP: |
i = IPC_GET_ARG1(*call); |
if (i >= MAX_ANIMATIONS || i < 0 || |
!animations[i].initialized) { |
retval = EINVAL; |
break; |
} |
if (animations[i].animlen == MAX_ANIM_LEN) { |
retval = ELIMIT; |
break; |
} |
newval = IPC_GET_ARG2(*call); |
if (newval < 0 || newval > MAX_PIXMAPS || |
!pixmaps[newval].data) { |
retval = EINVAL; |
break; |
} |
animations[i].pixmaps[animations[i].animlen++] = newval; |
break; |
case FB_ANIM_CHGVP: |
i = IPC_GET_ARG1(*call); |
if (i >= MAX_ANIMATIONS || i < 0) { |
retval = EINVAL; |
break; |
} |
nvp = IPC_GET_ARG2(*call); |
if (nvp == -1) |
nvp = vp; |
if (nvp >= MAX_VIEWPORTS || nvp < 0 || |
!viewports[nvp].initialized) { |
retval = EINVAL; |
break; |
} |
animations[i].vp = nvp; |
break; |
case FB_ANIM_START: |
case FB_ANIM_STOP: |
i = IPC_GET_ARG1(*call); |
if (i >= MAX_ANIMATIONS || i < 0) { |
retval = EINVAL; |
break; |
} |
newval = (IPC_GET_METHOD(*call) == FB_ANIM_START); |
if (newval ^ animations[i].enabled) { |
animations[i].enabled = newval; |
anims_enabled += newval ? 1 : -1; |
} |
break; |
default: |
handled = 0; |
} |
if (handled) |
ipc_answer_0(callid, retval); |
return handled; |
} |
/** Handler for messages concerning pixmap handling |
* |
*/ |
static int pixmap_handle(ipc_callid_t callid, ipc_call_t *call, int vp) |
{ |
bool handled = true; |
int retval = EOK; |
int i, nvp; |
switch (IPC_GET_METHOD(*call)) { |
case FB_VP_DRAW_PIXMAP: |
nvp = IPC_GET_ARG1(*call); |
if (nvp == -1) |
nvp = vp; |
if (nvp < 0 || nvp >= MAX_VIEWPORTS || |
!viewports[nvp].initialized) { |
retval = EINVAL; |
break; |
} |
i = IPC_GET_ARG2(*call); |
retval = draw_pixmap(nvp, i); |
break; |
case FB_VP2PIXMAP: |
nvp = IPC_GET_ARG1(*call); |
if (nvp == -1) |
nvp = vp; |
if (nvp < 0 || nvp >= MAX_VIEWPORTS || |
!viewports[nvp].initialized) |
retval = EINVAL; |
else |
retval = save_vp_to_pixmap(&viewports[nvp]); |
break; |
case FB_DROP_PIXMAP: |
i = IPC_GET_ARG1(*call); |
if (i >= MAX_PIXMAPS) { |
retval = EINVAL; |
break; |
} |
if (pixmaps[i].data) { |
free(pixmaps[i].data); |
pixmaps[i].data = NULL; |
} |
break; |
default: |
handled = 0; |
} |
if (handled) |
ipc_answer_0(callid, retval); |
return handled; |
} |
static int rgb_from_style(attr_rgb_t *rgb, int style) |
{ |
switch (style) { |
case STYLE_NORMAL: |
rgb->fg_color = color_table[COLOR_BLACK]; |
rgb->bg_color = color_table[COLOR_WHITE]; |
break; |
case STYLE_EMPHASIS: |
rgb->fg_color = color_table[COLOR_RED]; |
rgb->bg_color = color_table[COLOR_WHITE]; |
break; |
default: |
return EINVAL; |
} |
return EOK; |
} |
static int rgb_from_idx(attr_rgb_t *rgb, ipcarg_t fg_color, |
ipcarg_t bg_color, ipcarg_t flags) |
{ |
fg_color = (fg_color & 7) | ((flags & CATTR_BRIGHT) ? 8 : 0); |
bg_color = (bg_color & 7) | ((flags & CATTR_BRIGHT) ? 8 : 0); |
rgb->fg_color = color_table[fg_color]; |
rgb->bg_color = color_table[bg_color]; |
return EOK; |
} |
static int rgb_from_attr(attr_rgb_t *rgb, const attrs_t *a) |
{ |
int rc; |
switch (a->t) { |
case at_style: |
rc = rgb_from_style(rgb, a->a.s.style); |
break; |
case at_idx: |
rc = rgb_from_idx(rgb, a->a.i.fg_color, |
a->a.i.bg_color, a->a.i.flags); |
break; |
case at_rgb: |
*rgb = a->a.r; |
rc = EOK; |
break; |
} |
return rc; |
} |
static int fb_set_style(viewport_t *vport, ipcarg_t style) |
{ |
return rgb_from_style(&vport->attr, (int) style); |
} |
static int fb_set_color(viewport_t *vport, ipcarg_t fg_color, |
ipcarg_t bg_color, ipcarg_t flags) |
{ |
return rgb_from_idx(&vport->attr, fg_color, bg_color, flags); |
} |
/** Function for handling connections to FB |
* |
*/ |
static void fb_client_connection(ipc_callid_t iid, ipc_call_t *icall) |
{ |
unsigned int vp = 0; |
viewport_t *vport = &viewports[vp]; |
if (client_connected) { |
ipc_answer_0(iid, ELIMIT); |
return; |
} |
/* Accept connection */ |
client_connected = true; |
ipc_answer_0(iid, EOK); |
while (true) { |
ipc_callid_t callid; |
ipc_call_t call; |
int retval; |
unsigned int i; |
int scroll; |
wchar_t ch; |
unsigned int col, row; |
if ((vport->cursor_active) || (anims_enabled)) |
callid = async_get_call_timeout(&call, 250000); |
else |
callid = async_get_call(&call); |
mouse_hide(); |
if (!callid) { |
cursor_blink(vport); |
anims_tick(); |
mouse_show(); |
continue; |
} |
if (shm_handle(callid, &call, vp)) |
continue; |
if (pixmap_handle(callid, &call, vp)) |
continue; |
if (anim_handle(callid, &call, vp)) |
continue; |
switch (IPC_GET_METHOD(call)) { |
case IPC_M_PHONE_HUNGUP: |
client_connected = false; |
/* Cleanup other viewports */ |
for (i = 1; i < MAX_VIEWPORTS; i++) |
vport->initialized = false; |
/* Exit thread */ |
return; |
case FB_PUTCHAR: |
ch = IPC_GET_ARG1(call); |
col = IPC_GET_ARG2(call); |
row = IPC_GET_ARG3(call); |
if ((col >= vport->cols) || (row >= vport->rows)) { |
retval = EINVAL; |
break; |
} |
ipc_answer_0(callid, EOK); |
draw_char(vport, ch, col, row); |
/* Message already answered */ |
continue; |
case FB_CLEAR: |
vport_clear(vport); |
cursor_show(vport); |
retval = EOK; |
break; |
case FB_CURSOR_GOTO: |
col = IPC_GET_ARG1(call); |
row = IPC_GET_ARG2(call); |
if ((col >= vport->cols) || (row >= vport->rows)) { |
retval = EINVAL; |
break; |
} |
retval = EOK; |
cursor_hide(vport); |
vport->cur_col = col; |
vport->cur_row = row; |
cursor_show(vport); |
break; |
case FB_CURSOR_VISIBILITY: |
cursor_hide(vport); |
vport->cursor_active = IPC_GET_ARG1(call); |
cursor_show(vport); |
retval = EOK; |
break; |
case FB_GET_CSIZE: |
ipc_answer_2(callid, EOK, vport->cols, vport->rows); |
continue; |
case FB_SCROLL: |
scroll = IPC_GET_ARG1(call); |
if ((scroll > (int) vport->rows) || (scroll < (-(int) vport->rows))) { |
retval = EINVAL; |
break; |
} |
cursor_hide(vport); |
vport_scroll(vport, scroll); |
cursor_show(vport); |
retval = EOK; |
break; |
case FB_VIEWPORT_SWITCH: |
i = IPC_GET_ARG1(call); |
if (i >= MAX_VIEWPORTS) { |
retval = EINVAL; |
break; |
} |
if (!viewports[i].initialized) { |
retval = EADDRNOTAVAIL; |
break; |
} |
cursor_hide(vport); |
vp = i; |
vport = &viewports[vp]; |
cursor_show(vport); |
retval = EOK; |
break; |
case FB_VIEWPORT_CREATE: |
retval = vport_create(IPC_GET_ARG1(call) >> 16, |
IPC_GET_ARG1(call) & 0xffff, |
IPC_GET_ARG2(call) >> 16, |
IPC_GET_ARG2(call) & 0xffff); |
break; |
case FB_VIEWPORT_DELETE: |
i = IPC_GET_ARG1(call); |
if (i >= MAX_VIEWPORTS) { |
retval = EINVAL; |
break; |
} |
if (!viewports[i].initialized) { |
retval = EADDRNOTAVAIL; |
break; |
} |
viewports[i].initialized = false; |
if (viewports[i].bgpixel) |
free(viewports[i].bgpixel); |
if (viewports[i].backbuf) |
free(viewports[i].backbuf); |
retval = EOK; |
break; |
case FB_SET_STYLE: |
retval = fb_set_style(vport, IPC_GET_ARG1(call)); |
break; |
case FB_SET_COLOR: |
retval = fb_set_color(vport, IPC_GET_ARG1(call), |
IPC_GET_ARG2(call), IPC_GET_ARG3(call)); |
break; |
case FB_SET_RGB_COLOR: |
vport->attr.fg_color = IPC_GET_ARG1(call); |
vport->attr.bg_color = IPC_GET_ARG2(call); |
retval = EOK; |
break; |
case FB_GET_RESOLUTION: |
ipc_answer_2(callid, EOK, screen.xres, screen.yres); |
continue; |
case FB_POINTER_MOVE: |
pointer_enabled = true; |
mouse_move(IPC_GET_ARG1(call), IPC_GET_ARG2(call)); |
retval = EOK; |
break; |
case FB_SCREEN_YIELD: |
case FB_SCREEN_RECLAIM: |
retval = EOK; |
break; |
default: |
retval = ENOENT; |
} |
ipc_answer_0(callid, retval); |
} |
} |
/** Initialization of framebuffer |
* |
*/ |
int fb_init(void) |
{ |
async_set_client_connection(fb_client_connection); |
void *fb_ph_addr = (void *) sysinfo_value("fb.address.physical"); |
unsigned int fb_offset = sysinfo_value("fb.offset"); |
unsigned int fb_width = sysinfo_value("fb.width"); |
unsigned int fb_height = sysinfo_value("fb.height"); |
unsigned int fb_scanline = sysinfo_value("fb.scanline"); |
unsigned int fb_visual = sysinfo_value("fb.visual"); |
unsigned int fbsize = fb_scanline * fb_height; |
void *fb_addr = as_get_mappable_page(fbsize); |
if (physmem_map(fb_ph_addr + fb_offset, fb_addr, |
ALIGN_UP(fbsize, PAGE_SIZE) >> PAGE_WIDTH, AS_AREA_READ | AS_AREA_WRITE) != 0) |
return -1; |
if (screen_init(fb_addr, fb_width, fb_height, fb_scanline, fb_visual)) |
return 0; |
return -1; |
} |
/** |
* @} |
*/ |
//branches/snapshot/uspace/srv/fb/ega.c |
---|
0,0 → 1,443 |
/* |
* Copyright (c) 2006 Ondrej Palkovsky |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @defgroup egafb EGA framebuffer |
* @brief HelenOS EGA framebuffer. |
* @ingroup fbs |
* @{ |
*/ |
/** @file |
*/ |
#include <stdlib.h> |
#include <unistd.h> |
#include <align.h> |
#include <async.h> |
#include <ipc/ipc.h> |
#include <errno.h> |
#include <stdio.h> |
#include <ddi.h> |
#include <sysinfo.h> |
#include <as.h> |
#include <ipc/fb.h> |
#include <ipc/ipc.h> |
#include <ipc/ns.h> |
#include <ipc/services.h> |
#include <libarch/ddi.h> |
#include <io/style.h> |
#include <io/color.h> |
#include <sys/types.h> |
#include "ega.h" |
#include "../console/screenbuffer.h" |
#include "main.h" |
#define MAX_SAVED_SCREENS 256 |
typedef struct saved_screen { |
short *data; |
} saved_screen; |
saved_screen saved_screens[MAX_SAVED_SCREENS]; |
#define EGA_IO_BASE ((ioport8_t *) 0x3d4) |
#define EGA_IO_SIZE 2 |
int ega_normal_color = 0x0f; |
int ega_inverted_color = 0xf0; |
#define NORMAL_COLOR ega_normal_color |
#define INVERTED_COLOR ega_inverted_color |
/* Allow only 1 connection */ |
static int client_connected = 0; |
static unsigned int scr_width; |
static unsigned int scr_height; |
static uint8_t *scr_addr; |
static unsigned int style; |
static unsigned attr_to_ega_style(const attrs_t *a); |
static uint8_t ega_glyph(wchar_t ch); |
static void clrscr(void) |
{ |
unsigned i; |
for (i = 0; i < scr_width * scr_height; i++) { |
scr_addr[i * 2] = ' '; |
scr_addr[i * 2 + 1] = style; |
} |
} |
static void cursor_goto(unsigned int col, unsigned int row) |
{ |
int ega_cursor; |
ega_cursor = col + scr_width * row; |
pio_write_8(EGA_IO_BASE, 0xe); |
pio_write_8(EGA_IO_BASE + 1, (ega_cursor >> 8) & 0xff); |
pio_write_8(EGA_IO_BASE, 0xf); |
pio_write_8(EGA_IO_BASE + 1, ega_cursor & 0xff); |
} |
static void cursor_disable(void) |
{ |
uint8_t stat; |
pio_write_8(EGA_IO_BASE, 0xa); |
stat = pio_read_8(EGA_IO_BASE + 1); |
pio_write_8(EGA_IO_BASE, 0xa); |
pio_write_8(EGA_IO_BASE + 1, stat | (1 << 5)); |
} |
static void cursor_enable(void) |
{ |
uint8_t stat; |
pio_write_8(EGA_IO_BASE, 0xa); |
stat = pio_read_8(EGA_IO_BASE + 1); |
pio_write_8(EGA_IO_BASE, 0xa); |
pio_write_8(EGA_IO_BASE + 1, stat & (~(1 << 5))); |
} |
static void scroll(int rows) |
{ |
unsigned i; |
if (rows > 0) { |
memmove(scr_addr, ((char *) scr_addr) + rows * scr_width * 2, |
scr_width * scr_height * 2 - rows * scr_width * 2); |
for (i = 0; i < rows * scr_width; i++) |
(((short *) scr_addr) + scr_width * scr_height - rows * |
scr_width)[i] = ((style << 8) + ' '); |
} else if (rows < 0) { |
memmove(((char *)scr_addr) - rows * scr_width * 2, scr_addr, |
scr_width * scr_height * 2 + rows * scr_width * 2); |
for (i = 0; i < -rows * scr_width; i++) |
((short *)scr_addr)[i] = ((style << 8 ) + ' '); |
} |
} |
static void printchar(wchar_t c, unsigned int col, unsigned int row) |
{ |
scr_addr[(row * scr_width + col) * 2] = ega_glyph(c); |
scr_addr[(row * scr_width + col) * 2 + 1] = style; |
cursor_goto(col + 1, row); |
} |
/** Draw text data to viewport. |
* |
* @param vport Viewport id |
* @param data Text data. |
* @param x Leftmost column of the area. |
* @param y Topmost row of the area. |
* @param w Number of rows. |
* @param h Number of columns. |
*/ |
static void draw_text_data(keyfield_t *data, unsigned int x, |
unsigned int y, unsigned int w, unsigned int h) |
{ |
unsigned int i, j; |
keyfield_t *field; |
uint8_t *dp; |
for (j = 0; j < h; j++) { |
for (i = 0; i < w; i++) { |
field = &data[j * w + i]; |
dp = &scr_addr[2 * ((y + j) * scr_width + (x + i))]; |
dp[0] = ega_glyph(field->character); |
dp[1] = attr_to_ega_style(&field->attrs); |
} |
} |
} |
static int save_screen(void) |
{ |
int i; |
for (i = 0; (i < MAX_SAVED_SCREENS) && (saved_screens[i].data); i++) |
; |
if (i == MAX_SAVED_SCREENS) |
return EINVAL; |
if (!(saved_screens[i].data = malloc(2 * scr_width * scr_height))) |
return ENOMEM; |
memcpy(saved_screens[i].data, scr_addr, 2 * scr_width * scr_height); |
return i; |
} |
static int print_screen(int i) |
{ |
if (saved_screens[i].data) |
memcpy(scr_addr, saved_screens[i].data, 2 * scr_width * |
scr_height); |
else |
return EINVAL; |
return i; |
} |
static int style_to_ega_style(int style) |
{ |
unsigned int ega_style; |
switch (style) { |
case STYLE_NORMAL: |
ega_style = INVERTED_COLOR; |
break; |
case STYLE_EMPHASIS: |
ega_style = INVERTED_COLOR | 4; |
break; |
default: |
return INVERTED_COLOR; |
} |
return ega_style; |
} |
static unsigned int color_to_ega_style(int fg_color, int bg_color, int attr) |
{ |
unsigned int style; |
style = (fg_color & 7) | ((bg_color & 7) << 4); |
if (attr & CATTR_BRIGHT) |
style = style | 0x08; |
return style; |
} |
static unsigned int rgb_to_ega_style(uint32_t fg, uint32_t bg) |
{ |
return (fg > bg) ? NORMAL_COLOR : INVERTED_COLOR; |
} |
static unsigned attr_to_ega_style(const attrs_t *a) |
{ |
switch (a->t) { |
case at_style: |
return style_to_ega_style(a->a.s.style); |
case at_rgb: |
return rgb_to_ega_style(a->a.r.fg_color, a->a.r.bg_color); |
case at_idx: |
return color_to_ega_style(a->a.i.fg_color, |
a->a.i.bg_color, a->a.i.flags); |
default: |
return INVERTED_COLOR; |
} |
} |
static uint8_t ega_glyph(wchar_t ch) |
{ |
if (ch >= 0 && ch < 128) |
return ch; |
return '?'; |
} |
static void ega_client_connection(ipc_callid_t iid, ipc_call_t *icall) |
{ |
int retval; |
ipc_callid_t callid; |
ipc_call_t call; |
wchar_t c; |
unsigned int row, col, w, h; |
int bg_color, fg_color, attr; |
uint32_t bg_rgb, fg_rgb; |
keyfield_t *interbuf = NULL; |
size_t intersize = 0; |
int i; |
if (client_connected) { |
ipc_answer_0(iid, ELIMIT); |
return; |
} |
client_connected = 1; |
ipc_answer_0(iid, EOK); /* Accept connection */ |
while (1) { |
callid = async_get_call(&call); |
switch (IPC_GET_METHOD(call)) { |
case IPC_M_PHONE_HUNGUP: |
client_connected = 0; |
ipc_answer_0(callid, EOK); |
return; /* Exit thread */ |
case IPC_M_SHARE_OUT: |
/* We accept one area for data interchange */ |
intersize = IPC_GET_ARG2(call); |
if (intersize >= scr_width * scr_height * |
sizeof(*interbuf)) { |
receive_comm_area(callid, &call, |
(void *) &interbuf); |
continue; |
} |
retval = EINVAL; |
break; |
case FB_DRAW_TEXT_DATA: |
col = IPC_GET_ARG1(call); |
row = IPC_GET_ARG2(call); |
w = IPC_GET_ARG3(call); |
h = IPC_GET_ARG4(call); |
if (!interbuf) { |
retval = EINVAL; |
break; |
} |
if (col + w > scr_width || row + h > scr_height) { |
retval = EINVAL; |
break; |
} |
draw_text_data(interbuf, col, row, w, h); |
retval = 0; |
break; |
case FB_GET_CSIZE: |
ipc_answer_2(callid, EOK, scr_width, scr_height); |
continue; |
case FB_CLEAR: |
clrscr(); |
retval = 0; |
break; |
case FB_PUTCHAR: |
c = IPC_GET_ARG1(call); |
col = IPC_GET_ARG2(call); |
row = IPC_GET_ARG3(call); |
if (col >= scr_width || row >= scr_height) { |
retval = EINVAL; |
break; |
} |
printchar(c, col, row); |
retval = 0; |
break; |
case FB_CURSOR_GOTO: |
col = IPC_GET_ARG1(call); |
row = IPC_GET_ARG2(call); |
if (row >= scr_height || col >= scr_width) { |
retval = EINVAL; |
break; |
} |
cursor_goto(col, row); |
retval = 0; |
break; |
case FB_SCROLL: |
i = IPC_GET_ARG1(call); |
if (i > (int) scr_height || i < -((int) scr_height)) { |
retval = EINVAL; |
break; |
} |
scroll(i); |
retval = 0; |
break; |
case FB_CURSOR_VISIBILITY: |
if (IPC_GET_ARG1(call)) |
cursor_enable(); |
else |
cursor_disable(); |
retval = 0; |
break; |
case FB_SET_STYLE: |
style = style_to_ega_style(IPC_GET_ARG1(call)); |
retval = 0; |
break; |
case FB_SET_COLOR: |
fg_color = IPC_GET_ARG1(call); |
bg_color = IPC_GET_ARG2(call); |
attr = IPC_GET_ARG3(call); |
style = color_to_ega_style(fg_color, bg_color, attr); |
retval = 0; |
break; |
case FB_SET_RGB_COLOR: |
fg_rgb = IPC_GET_ARG1(call); |
bg_rgb = IPC_GET_ARG2(call); |
style = rgb_to_ega_style(fg_rgb, bg_rgb); |
retval = 0; |
break; |
case FB_VP_DRAW_PIXMAP: |
i = IPC_GET_ARG2(call); |
retval = print_screen(i); |
break; |
case FB_VP2PIXMAP: |
retval = save_screen(); |
break; |
case FB_DROP_PIXMAP: |
i = IPC_GET_ARG1(call); |
if (i >= MAX_SAVED_SCREENS) { |
retval = EINVAL; |
break; |
} |
if (saved_screens[i].data) { |
free(saved_screens[i].data); |
saved_screens[i].data = NULL; |
} |
retval = 0; |
break; |
case FB_SCREEN_YIELD: |
case FB_SCREEN_RECLAIM: |
retval = EOK; |
break; |
default: |
retval = EINVAL; |
} |
ipc_answer_0(callid, retval); |
} |
} |
int ega_init(void) |
{ |
void *ega_ph_addr; |
size_t sz; |
ega_ph_addr = (void *) sysinfo_value("fb.address.physical"); |
scr_width = sysinfo_value("fb.width"); |
scr_height = sysinfo_value("fb.height"); |
if (sysinfo_value("fb.blinking")) { |
ega_normal_color &= 0x77; |
ega_inverted_color &= 0x77; |
} |
style = NORMAL_COLOR; |
iospace_enable(task_get_id(), (void *) EGA_IO_BASE, 2); |
sz = scr_width * scr_height * 2; |
scr_addr = as_get_mappable_page(sz); |
if (physmem_map(ega_ph_addr, scr_addr, ALIGN_UP(sz, PAGE_SIZE) >> |
PAGE_WIDTH, AS_AREA_READ | AS_AREA_WRITE) != 0) |
return -1; |
async_set_client_connection(ega_client_connection); |
return 0; |
} |
/** |
* @} |
*/ |
//branches/snapshot/uspace/srv/fb/ega.h |
---|
0,0 → 1,45 |
/* |
* Copyright (c) 2006 Ondrej Palkovsky |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup egafb |
* @brief HelenOS EGA framebuffer. |
* @ingroup fbs |
* @{ |
*/ |
/** @file |
*/ |
#ifndef FB_EGA_H_ |
#define FB_EGA_H_ |
extern int ega_init(void); |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/srv/fb/serial_console.c |
---|
0,0 → 1,458 |
/* |
* Copyright (c) 2006 Ondrej Palkovsky |
* Copyright (c) 2008 Martin Decky |
* Copyright (c) 2008 Pavel Rimsky |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** |
* @defgroup serial Serial console |
* @brief Serial console services (putc, puts, clear screen, cursor goto,...) |
* @{ |
*/ |
/** @file |
*/ |
#include <stdio.h> |
#include <ipc/ipc.h> |
#include <async.h> |
#include <ipc/fb.h> |
#include <bool.h> |
#include <errno.h> |
#include <io/color.h> |
#include <io/style.h> |
#include <string.h> |
#include "../console/screenbuffer.h" |
#include "main.h" |
#include "serial_console.h" |
#define MAX_CONTROL 20 |
static void serial_sgr(const unsigned int mode); |
void serial_putchar(wchar_t ch); |
static int scr_width; |
static int scr_height; |
static bool color = true; /** True if producing color output. */ |
static bool utf8 = false; /** True if producing UTF8 output. */ |
static putc_function_t putc_function; |
/* Allow only 1 connection */ |
static int client_connected = 0; |
enum sgr_color_index { |
CI_BLACK = 0, |
CI_RED = 1, |
CI_GREEN = 2, |
CI_BROWN = 3, |
CI_BLUE = 4, |
CI_MAGENTA = 5, |
CI_CYAN = 6, |
CI_WHITE = 7, |
}; |
enum sgr_command { |
SGR_RESET = 0, |
SGR_BOLD = 1, |
SGR_BLINK = 5, |
SGR_REVERSE = 7, |
SGR_NORMAL_INT = 22, |
SGR_BLINK_OFF = 25, |
SGR_REVERSE_OFF = 27, |
SGR_FGCOLOR = 30, |
SGR_BGCOLOR = 40 |
}; |
static int color_map[] = { |
[COLOR_BLACK] = CI_BLACK, |
[COLOR_BLUE] = CI_RED, |
[COLOR_GREEN] = CI_GREEN, |
[COLOR_CYAN] = CI_CYAN, |
[COLOR_RED] = CI_RED, |
[COLOR_MAGENTA] = CI_MAGENTA, |
[COLOR_YELLOW] = CI_BROWN, |
[COLOR_WHITE] = CI_WHITE |
}; |
void serial_puts(char *str) |
{ |
while (*str) |
putc_function(*(str++)); |
} |
void serial_putchar(wchar_t ch) |
{ |
uint8_t buf[STR_BOUNDS(1)]; |
size_t offs; |
size_t i; |
if (utf8 != true) { |
if (ch >= 0 && ch < 128) |
(*putc_function)((uint8_t) ch); |
else |
(*putc_function)('?'); |
return; |
} |
offs = 0; |
if (chr_encode(ch, buf, &offs, STR_BOUNDS(1)) == EOK) { |
for (i = 0; i < offs; i++) |
(*putc_function)(buf[i]); |
} else { |
(*putc_function)('?'); |
} |
} |
void serial_goto(const unsigned int col, const unsigned int row) |
{ |
if ((col > scr_width) || (row > scr_height)) |
return; |
char control[MAX_CONTROL]; |
snprintf(control, MAX_CONTROL, "\033[%u;%uf", row + 1, col + 1); |
serial_puts(control); |
} |
void serial_clrscr(void) |
{ |
/* Initialize graphic rendition attributes. */ |
serial_sgr(SGR_RESET); |
if (color) { |
serial_sgr(SGR_FGCOLOR + CI_BLACK); |
serial_sgr(SGR_BGCOLOR + CI_WHITE); |
} |
serial_puts("\033[2J"); |
} |
void serial_scroll(int i) |
{ |
if (i > 0) { |
serial_goto(0, scr_height - 1); |
while (i--) |
serial_puts("\033D"); |
} else if (i < 0) { |
serial_goto(0, 0); |
while (i++) |
serial_puts("\033M"); |
} |
} |
/** ECMA-48 Set Graphics Rendition. */ |
static void serial_sgr(const unsigned int mode) |
{ |
char control[MAX_CONTROL]; |
snprintf(control, MAX_CONTROL, "\033[%um", mode); |
serial_puts(control); |
} |
/** Set scrolling region. */ |
void serial_set_scroll_region(unsigned last_row) |
{ |
char control[MAX_CONTROL]; |
snprintf(control, MAX_CONTROL, "\033[0;%ur", last_row); |
serial_puts(control); |
} |
void serial_cursor_disable(void) |
{ |
serial_puts("\033[?25l"); |
} |
void serial_cursor_enable(void) |
{ |
serial_puts("\033[?25h"); |
} |
void serial_console_init(putc_function_t putc_fn, uint32_t w, uint32_t h) |
{ |
scr_width = w; |
scr_height = h; |
putc_function = putc_fn; |
} |
static void serial_set_style(int style) |
{ |
if (style == STYLE_EMPHASIS) { |
if (color) { |
serial_sgr(SGR_RESET); |
serial_sgr(SGR_FGCOLOR + CI_RED); |
serial_sgr(SGR_BGCOLOR + CI_WHITE); |
} |
serial_sgr(SGR_BOLD); |
} else { |
if (color) { |
serial_sgr(SGR_RESET); |
serial_sgr(SGR_FGCOLOR + CI_BLACK); |
serial_sgr(SGR_BGCOLOR + CI_WHITE); |
} |
serial_sgr(SGR_NORMAL_INT); |
} |
} |
static void serial_set_idx(unsigned fgcolor, unsigned bgcolor, |
unsigned flags) |
{ |
if (color) { |
serial_sgr(SGR_RESET); |
serial_sgr(SGR_FGCOLOR + color_map[fgcolor]); |
serial_sgr(SGR_BGCOLOR + color_map[bgcolor]); |
} else { |
if (fgcolor < bgcolor) |
serial_sgr(SGR_RESET); |
else |
serial_sgr(SGR_REVERSE); |
} |
} |
static void serial_set_rgb(uint32_t fgcolor, uint32_t bgcolor) |
{ |
if (fgcolor < bgcolor) |
serial_sgr(SGR_REVERSE_OFF); |
else |
serial_sgr(SGR_REVERSE); |
} |
static void serial_set_attrs(const attrs_t *a) |
{ |
switch (a->t) { |
case at_style: |
serial_set_style(a->a.s.style); |
break; |
case at_rgb: |
serial_set_rgb(a->a.r.fg_color, a->a.r.bg_color); |
break; |
case at_idx: |
serial_set_idx(a->a.i.fg_color, |
a->a.i.bg_color, a->a.i.flags); |
break; |
default: |
break; |
} |
} |
/** Draw text data to viewport. |
* |
* @param vport Viewport id |
* @param data Text data. |
* @param x Leftmost column of the area. |
* @param y Topmost row of the area. |
* @param w Number of rows. |
* @param h Number of columns. |
*/ |
static void draw_text_data(keyfield_t *data, unsigned int x, |
unsigned int y, unsigned int w, unsigned int h) |
{ |
unsigned int i, j; |
keyfield_t *field; |
attrs_t *a0, *a1; |
serial_goto(x, y); |
a0 = &data[0].attrs; |
serial_set_attrs(a0); |
for (j = 0; j < h; j++) { |
if (j > 0 && w != scr_width) |
serial_goto(x, j); |
for (i = 0; i < w; i++) { |
field = &data[j * w + i]; |
a1 = &field->attrs; |
if (!attrs_same(*a0, *a1)) |
serial_set_attrs(a1); |
serial_putchar(field->character); |
a0 = a1; |
} |
} |
} |
int lastcol = 0; |
int lastrow = 0; |
/** |
* Main function of the thread serving client connections. |
*/ |
void serial_client_connection(ipc_callid_t iid, ipc_call_t *icall) |
{ |
int retval; |
ipc_callid_t callid; |
ipc_call_t call; |
keyfield_t *interbuf = NULL; |
size_t intersize = 0; |
wchar_t c; |
int col, row, w, h; |
int i; |
attrs_t cur_attr; |
if (client_connected) { |
ipc_answer_0(iid, ELIMIT); |
return; |
} |
client_connected = 1; |
ipc_answer_0(iid, EOK); |
cur_attr.t = at_style; |
cur_attr.a.s.style = STYLE_NORMAL; |
/* Clear the terminal, set scrolling region |
to 0 - height rows. */ |
serial_clrscr(); |
serial_goto(0, 0); |
serial_set_scroll_region(scr_height); |
while (true) { |
callid = async_get_call(&call); |
switch (IPC_GET_METHOD(call)) { |
case IPC_M_PHONE_HUNGUP: |
client_connected = 0; |
ipc_answer_0(callid, EOK); |
return; |
case IPC_M_SHARE_OUT: |
/* We accept one area for data interchange */ |
intersize = IPC_GET_ARG2(call); |
if (intersize >= scr_width * scr_height * |
sizeof(*interbuf)) { |
receive_comm_area(callid, &call, |
(void *) &interbuf); |
continue; |
} |
retval = EINVAL; |
break; |
case FB_DRAW_TEXT_DATA: |
col = IPC_GET_ARG1(call); |
row = IPC_GET_ARG2(call); |
w = IPC_GET_ARG3(call); |
h = IPC_GET_ARG4(call); |
if (!interbuf) { |
retval = EINVAL; |
break; |
} |
if (col + w > scr_width || row + h > scr_height) { |
retval = EINVAL; |
break; |
} |
draw_text_data(interbuf, col, row, w, h); |
lastcol = col + w; |
lastrow = row + h - 1; |
retval = 0; |
break; |
case FB_PUTCHAR: |
c = IPC_GET_ARG1(call); |
col = IPC_GET_ARG2(call); |
row = IPC_GET_ARG3(call); |
if ((lastcol != col) || (lastrow != row)) |
serial_goto(col, row); |
lastcol = col + 1; |
lastrow = row; |
serial_putchar(c); |
retval = 0; |
break; |
case FB_CURSOR_GOTO: |
col = IPC_GET_ARG1(call); |
row = IPC_GET_ARG2(call); |
serial_goto(col, row); |
lastcol = col; |
lastrow = row; |
retval = 0; |
break; |
case FB_GET_CSIZE: |
ipc_answer_2(callid, EOK, scr_width, scr_height); |
continue; |
case FB_CLEAR: |
serial_clrscr(); |
retval = 0; |
break; |
case FB_SET_STYLE: |
cur_attr.t = at_style; |
cur_attr.a.s.style = IPC_GET_ARG1(call); |
cur_attr.a.i.bg_color = IPC_GET_ARG2(call); |
serial_set_attrs(&cur_attr); |
retval = 0; |
break; |
case FB_SET_COLOR: |
cur_attr.t = at_idx; |
cur_attr.a.i.fg_color = IPC_GET_ARG1(call); |
cur_attr.a.i.bg_color = IPC_GET_ARG2(call); |
cur_attr.a.i.flags = IPC_GET_ARG3(call); |
serial_set_attrs(&cur_attr); |
retval = 0; |
break; |
case FB_SET_RGB_COLOR: |
cur_attr.t = at_rgb; |
cur_attr.a.i.fg_color = IPC_GET_ARG1(call); |
cur_attr.a.i.bg_color = IPC_GET_ARG2(call); |
serial_set_attrs(&cur_attr); |
retval = 0; |
break; |
case FB_SCROLL: |
i = IPC_GET_ARG1(call); |
if ((i > scr_height) || (i < -scr_height)) { |
retval = EINVAL; |
break; |
} |
serial_scroll(i); |
serial_goto(lastcol, lastrow); |
retval = 0; |
break; |
case FB_CURSOR_VISIBILITY: |
if(IPC_GET_ARG1(call)) |
serial_cursor_enable(); |
else |
serial_cursor_disable(); |
retval = 0; |
break; |
case FB_SCREEN_YIELD: |
serial_sgr(SGR_RESET); |
serial_puts("\033[2J"); |
serial_goto(0, 0); |
serial_cursor_enable(); |
retval = 0; |
break; |
case FB_SCREEN_RECLAIM: |
serial_clrscr(); |
serial_set_attrs(&cur_attr); |
retval = 0; |
break; |
default: |
retval = ENOENT; |
} |
ipc_answer_0(callid, retval); |
} |
} |
/** |
* @} |
*/ |
//branches/snapshot/uspace/srv/fb/serial_console.h |
---|
0,0 → 1,56 |
/* |
* Copyright (c) 2008 Pavel Rimsky |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** |
* @defgroup serial Serial console |
* @brief Serial console services (putc, puts, clear screen, cursor goto,...) |
* @{ |
*/ |
/** @file |
*/ |
#ifndef FB_SERIAL_CONSOLE_H_ |
#define FB_SERIAL_CONSOLE_H_ |
#include <ipc/ipc.h> |
typedef void (*putc_function_t)(char); |
void serial_puts(char *str); |
void serial_goto(const unsigned int col, const unsigned int row); |
void serial_clrscr(void); |
void serial_scroll(int i); |
void serial_cursor_disable(void); |
void serial_cursor_enable(void); |
void serial_set_scroll_region(unsigned height); |
void serial_console_init(putc_function_t putc_fn, uint32_t w, uint32_t h); |
void serial_client_connection(ipc_callid_t iid, ipc_call_t *icall); |
#endif |
//branches/snapshot/uspace/srv/fb/Makefile |
---|
0,0 → 1,115 |
# |
# Copyright (c) 2005 Martin Decky |
# All rights reserved. |
# |
# Redistribution and use in source and binary forms, with or without |
# modification, are permitted provided that the following conditions |
# are met: |
# |
# - Redistributions of source code must retain the above copyright |
# notice, this list of conditions and the following disclaimer. |
# - 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. |
# - The name of the author may not be used to endorse or promote products |
# derived from this software without specific prior written permission. |
# |
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
# |
## Setup toolchain |
# |
LIBC_PREFIX = ../../lib/libc |
SOFTINT_PREFIX = ../../lib/softint |
include $(LIBC_PREFIX)/Makefile.toolchain |
LIBS = $(LIBC_PREFIX)/libc.a |
## Sources |
# |
OUTPUT = fb |
SOURCES = \ |
main.c \ |
ppm.c |
ifneq ($(UARCH),ia64) |
SOURCES += fb.c \ |
font-8x16.c |
CFLAGS += -DFB_ENABLED |
endif |
ifeq ($(UARCH),ia32) |
SOURCES += ega.c |
CFLAGS += -DEGA_ENABLED |
endif |
ifeq ($(UARCH),ia64) |
SOURCES += ega.c \ |
ski.c \ |
serial_console.c |
CFLAGS += -DSKI_ENABLED |
CFLAGS += -DEGA_ENABLED |
endif |
ifeq ($(UARCH),amd64) |
SOURCES += ega.c |
CFLAGS += -DEGA_ENABLED |
endif |
ifeq ($(UARCH),mips32) |
SOURCES += msim.c \ |
serial_console.c |
CFLAGS += -DMSIM_ENABLED |
endif |
ifeq ($(UARCH),sparc64) |
SOURCES += sgcn.c \ |
serial_console.c |
CFLAGS += -DSGCN_ENABLED |
endif |
CFLAGS += -D$(UARCH) |
OBJECTS := $(addsuffix .o,$(basename $(SOURCES))) |
.PHONY: all clean depend disasm |
all: $(OUTPUT) $(OUTPUT).disasm |
-include Makefile.depend |
clean: |
-rm -f $(OUTPUT) $(OUTPUT).map $(OUTPUT).disasm Makefile.depend $(OBJECTS) |
depend: |
$(CC) $(DEFS) $(CFLAGS) -M $(SOURCES) > Makefile.depend |
$(OUTPUT): $(OBJECTS) $(LIBS) |
$(LD) -T $(LIBC_PREFIX)/arch/$(UARCH)/_link.ld $(OBJECTS) $(LIBS) $(LFLAGS) -o $@ -Map $(OUTPUT).map |
disasm: $(OUTPUT).disasm |
$(OUTPUT).disasm: $(OUTPUT) |
$(OBJDUMP) -d $< > $@ |
%.o: %.S |
$(CC) $(DEFS) $(AFLAGS) $(CFLAGS) -D__ASM__ -c $< -o $@ |
%.o: %.s |
$(AS) $(AFLAGS) $< -o $@ |
%.o: %.c |
$(CC) $(DEFS) $(CFLAGS) -c $< -o $@ |
//branches/snapshot/uspace/srv/fb/font-8x16.c |
---|
0,0 → 1,3271 |
/* |
* Copyright (c) 2000 Dmitry Bolkhovityanov |
* Copyright (c) 2009 Martin Decky |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup genarch |
* @{ |
*/ |
/** @file |
*/ |
#include <sys/types.h> |
#include "font-8x16.h" |
/** Convert character to font glyph index |
* |
* The font does not cover all Unicode characters. |
* This function converts the character to an appropriate |
* glyph in the font or returns an index to the question |
* mark glyph if no specific glyph exists. |
*/ |
uint16_t fb_font_glyph(const wchar_t ch) |
{ |
if (ch == 0x0000) |
return 0; |
if ((ch >= 0x0020) && (ch <= 0x007f)) |
return (ch - 32); |
if ((ch >= 0x00a0) && (ch <= 0x021f)) |
return (ch - 64); |
if ((ch >= 0x0222) && (ch <= 0x0233)) |
return (ch - 66); |
if ((ch >= 0x0250) && (ch <= 0x02ad)) |
return (ch - 94); |
if ((ch >= 0x02b0) && (ch <= 0x02cf)) |
return (ch - 96); |
if ((ch >= 0x02d8) && (ch <= 0x02dd)) |
return (ch - 104); |
if (ch == 0x02ee) |
return 630; |
if ((ch >= 0x0300) && (ch <= 0x0301)) |
return (ch - 137); |
if (ch == 0x0303) |
return 633; |
if (ch == 0x0309) |
return 634; |
if ((ch >= 0x0312) && (ch <= 0x0314)) |
return (ch - 151); |
if (ch == 0x0323) |
return 638; |
if ((ch >= 0x0340) && (ch <= 0x0341)) |
return (ch - 193); |
if ((ch >= 0x0374) && (ch <= 0x0375)) |
return (ch - 243); |
if (ch == 0x037a) |
return 643; |
if (ch == 0x037e) |
return 644; |
if ((ch >= 0x0384) && (ch <= 0x038a)) |
return (ch - 255); |
if (ch == 0x038c) |
return 652; |
if ((ch >= 0x038e) && (ch <= 0x03a1)) |
return (ch - 257); |
if ((ch >= 0x03a3) && (ch <= 0x03ce)) |
return (ch - 258); |
if ((ch >= 0x03d0) && (ch <= 0x03d7)) |
return (ch - 259); |
if ((ch >= 0x03da) && (ch <= 0x03f3)) |
return (ch - 261); |
if ((ch >= 0x0400) && (ch <= 0x0486)) |
return (ch - 273); |
if ((ch >= 0x0488) && (ch <= 0x04ce)) |
return (ch - 274); |
if ((ch >= 0x04d0) && (ch <= 0x04f5)) |
return (ch - 275); |
if ((ch >= 0x04f8) && (ch <= 0x04f9)) |
return (ch - 277); |
if ((ch >= 0x0500) && (ch <= 0x050f)) |
return (ch - 283); |
if ((ch >= 0x0530) && (ch <= 0x0556)) |
return (ch - 315); |
if ((ch >= 0x0559) && (ch <= 0x055f)) |
return (ch - 317); |
if ((ch >= 0x0561) && (ch <= 0x0587)) |
return (ch - 318); |
if ((ch >= 0x0589) && (ch <= 0x058a)) |
return (ch - 319); |
if ((ch >= 0x0591) && (ch <= 0x05a1)) |
return (ch - 325); |
if ((ch >= 0x05a3) && (ch <= 0x05b9)) |
return (ch - 326); |
if ((ch >= 0x05bb) && (ch <= 0x05c4)) |
return (ch - 327); |
if ((ch >= 0x05d0) && (ch <= 0x05ea)) |
return (ch - 338); |
if ((ch >= 0x05f0) && (ch <= 0x05f4)) |
return (ch - 343); |
if (ch == 0x060c) |
return 1182; |
if (ch == 0x061b) |
return 1183; |
if (ch == 0x061f) |
return 1184; |
if ((ch >= 0x0621) && (ch <= 0x063a)) |
return (ch - 384); |
if ((ch >= 0x0640) && (ch <= 0x0655)) |
return (ch - 389); |
if ((ch >= 0x0660) && (ch <= 0x066d)) |
return (ch - 399); |
if ((ch >= 0x0670) && (ch <= 0x06ed)) |
return (ch - 401); |
if ((ch >= 0x06f0) && (ch <= 0x06fe)) |
return (ch - 403); |
if (ch == 0x10d3) |
return 1388; |
if (ch == 0x10d7) |
return 1389; |
if (ch == 0x10da) |
return 1390; |
if (ch == 0x10dd) |
return 1391; |
if (ch == 0x10e6) |
return 1392; |
if ((ch >= 0x1e00) && (ch <= 0x1e9b)) |
return (ch - 6287); |
if ((ch >= 0x1ea0) && (ch <= 0x1ef9)) |
return (ch - 6291); |
if ((ch >= 0x1f00) && (ch <= 0x1f07)) |
return (ch - 6297); |
if ((ch >= 0x2000) && (ch <= 0x2027)) |
return (ch - 6545); |
if ((ch >= 0x2030) && (ch <= 0x2046)) |
return (ch - 6553); |
if ((ch >= 0x2048) && (ch <= 0x204d)) |
return (ch - 6554); |
if (ch == 0x2070) |
return 1716; |
if ((ch >= 0x2074) && (ch <= 0x208f)) |
return (ch - 6591); |
if ((ch >= 0x20a0) && (ch <= 0x20af)) |
return (ch - 6607); |
if ((ch >= 0x2100) && (ch <= 0x213a)) |
return (ch - 6687); |
if ((ch >= 0x2153) && (ch <= 0x2183)) |
return (ch - 6711); |
if ((ch >= 0x2190) && (ch <= 0x21f3)) |
return (ch - 6723); |
if ((ch >= 0x2200) && (ch <= 0x22f1)) |
return (ch - 6735); |
if (ch == 0x2300) |
return 2211; |
if (ch == 0x2302) |
return 2212; |
if ((ch >= 0x2308) && (ch <= 0x230b)) |
return (ch - 6755); |
if (ch == 0x2310) |
return 2217; |
if (ch == 0x2318) |
return 2218; |
if ((ch >= 0x231a) && (ch <= 0x231b)) |
return (ch - 6767); |
if ((ch >= 0x2320) && (ch <= 0x2321)) |
return (ch - 6771); |
if ((ch >= 0x2329) && (ch <= 0x232a)) |
return (ch - 6778); |
if ((ch >= 0x239b) && (ch <= 0x23bd)) |
return (ch - 6890); |
if (ch == 0x23ce) |
return 2260; |
if ((ch >= 0x2409) && (ch <= 0x240d)) |
return (ch - 6964); |
if ((ch >= 0x2423) && (ch <= 0x2424)) |
return (ch - 6985); |
if (ch == 0x2426) |
return 2268; |
if ((ch >= 0x2500) && (ch <= 0x2595)) |
return (ch - 7203); |
if ((ch >= 0x25a0) && (ch <= 0x25f7)) |
return (ch - 7213); |
if ((ch >= 0x2600) && (ch <= 0x2602)) |
return (ch - 7221); |
if ((ch >= 0x2605) && (ch <= 0x260d)) |
return (ch - 7223); |
if ((ch >= 0x2610) && (ch <= 0x2613)) |
return (ch - 7225); |
if (ch == 0x2620) |
return 2523; |
if (ch == 0x2622) |
return 2524; |
if (ch == 0x2626) |
return 2525; |
if ((ch >= 0x2628) && (ch <= 0x262b)) |
return (ch - 7242); |
if ((ch >= 0x262e) && (ch <= 0x2637)) |
return (ch - 7244); |
if ((ch >= 0x2639) && (ch <= 0x2653)) |
return (ch - 7245); |
if ((ch >= 0x2660) && (ch <= 0x2667)) |
return (ch - 7257); |
if ((ch >= 0x2669) && (ch <= 0x266f)) |
return (ch - 7258); |
if ((ch >= 0xfb00) && (ch <= 0xfb05)) |
return (ch - 61674); |
if ((ch >= 0xfb50) && (ch <= 0xfbb1)) |
return (ch - 61748); |
if ((ch >= 0xfbd3) && (ch <= 0xfbe9)) |
return (ch - 61781); |
if ((ch >= 0xfbfc) && (ch <= 0xfbff)) |
return (ch - 61799); |
if ((ch >= 0xfc5b) && (ch <= 0xfc63)) |
return (ch - 61890); |
if (ch == 0xfc90) |
return 2722; |
if ((ch >= 0xfcf2) && (ch <= 0xfcf4)) |
return (ch - 62031); |
if ((ch >= 0xfd3c) && (ch <= 0xfd3f)) |
return (ch - 62102); |
if (ch == 0xfdf2) |
return 2730; |
if ((ch >= 0xfe50) && (ch <= 0xfe52)) |
return (ch - 62373); |
if ((ch >= 0xfe54) && (ch <= 0xfe66)) |
return (ch - 62374); |
if ((ch >= 0xfe68) && (ch <= 0xfe6b)) |
return (ch - 62375); |
if ((ch >= 0xfe70) && (ch <= 0xfe72)) |
return (ch - 62379); |
if (ch == 0xfe74) |
return 2760; |
if ((ch >= 0xfe76) && (ch <= 0xfefc)) |
return (ch - 62381); |
if (ch == 0xfeff) |
return 2896; |
return 2898; |
} |
uint8_t fb_font[FONT_GLYPHS][FONT_SCANLINES] = { |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x18, 0x3c, 0x3c, 0x3c, 0x18, 0x18, 0x18, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x66, 0x66, 0x66, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x6c, 0x6c, 0xfe, 0x6c, 0x6c, 0x6c, 0xfe, 0x6c, 0x6c, 0x00, 0x00, 0x00, 0x00}, |
{0x18, 0x18, 0x7c, 0xc6, 0xc2, 0xc0, 0x7c, 0x06, 0x06, 0x86, 0xc6, 0x7c, 0x18, 0x18, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0xc2, 0xc6, 0x0c, 0x18, 0x30, 0x60, 0xc6, 0x86, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x38, 0x6c, 0x6c, 0x38, 0x76, 0xdc, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x30, 0x30, 0x30, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x0c, 0x18, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x18, 0x0c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x30, 0x18, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x18, 0x30, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x66, 0x3c, 0xff, 0x3c, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x7e, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x30, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x02, 0x06, 0x0c, 0x18, 0x30, 0x60, 0xc0, 0x80, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x38, 0x6c, 0xc6, 0xc6, 0xd6, 0xd6, 0xc6, 0xc6, 0x6c, 0x38, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x18, 0x38, 0x78, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x7e, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x7c, 0xc6, 0x06, 0x0c, 0x18, 0x30, 0x60, 0xc0, 0xc6, 0xfe, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x7c, 0xc6, 0x06, 0x06, 0x3c, 0x06, 0x06, 0x06, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x0c, 0x1c, 0x3c, 0x6c, 0xcc, 0xfe, 0x0c, 0x0c, 0x0c, 0x1e, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xfe, 0xc0, 0xc0, 0xc0, 0xfc, 0x06, 0x06, 0x06, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x38, 0x60, 0xc0, 0xc0, 0xfc, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xfe, 0xc6, 0x06, 0x06, 0x0c, 0x18, 0x30, 0x30, 0x30, 0x30, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0x7e, 0x06, 0x06, 0x06, 0x0c, 0x78, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x18, 0x18, 0x30, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x06, 0x0c, 0x18, 0x30, 0x60, 0x30, 0x18, 0x0c, 0x06, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x00, 0x00, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x60, 0x30, 0x18, 0x0c, 0x06, 0x0c, 0x18, 0x30, 0x60, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x7c, 0xc6, 0xc6, 0x0c, 0x18, 0x18, 0x18, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x7c, 0xc6, 0xc6, 0xde, 0xde, 0xde, 0xdc, 0xc0, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x10, 0x38, 0x6c, 0xc6, 0xc6, 0xfe, 0xc6, 0xc6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xfc, 0x66, 0x66, 0x66, 0x7c, 0x66, 0x66, 0x66, 0x66, 0xfc, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x3c, 0x66, 0xc2, 0xc0, 0xc0, 0xc0, 0xc0, 0xc2, 0x66, 0x3c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xf8, 0x6c, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x6c, 0xf8, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xfe, 0x66, 0x62, 0x68, 0x78, 0x68, 0x60, 0x62, 0x66, 0xfe, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xfe, 0x66, 0x62, 0x68, 0x78, 0x68, 0x60, 0x60, 0x60, 0xf0, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x3c, 0x66, 0xc2, 0xc0, 0xc0, 0xde, 0xc6, 0xc6, 0x66, 0x3a, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0xfe, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x3c, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x1e, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0xcc, 0xcc, 0xcc, 0x78, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xe6, 0x66, 0x66, 0x6c, 0x78, 0x78, 0x6c, 0x66, 0x66, 0xe6, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xf0, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x62, 0x66, 0xfe, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xc6, 0xee, 0xfe, 0xfe, 0xd6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xc6, 0xe6, 0xf6, 0xfe, 0xde, 0xce, 0xc6, 0xc6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xfc, 0x66, 0x66, 0x66, 0x7c, 0x60, 0x60, 0x60, 0x60, 0xf0, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xd6, 0xde, 0x7c, 0x0c, 0x0e, 0x00, 0x00}, |
{0x00, 0x00, 0xfc, 0x66, 0x66, 0x66, 0x7c, 0x6c, 0x66, 0x66, 0x66, 0xe6, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x7c, 0xc6, 0xc6, 0x60, 0x38, 0x0c, 0x06, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x7e, 0x7e, 0x5a, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x6c, 0x38, 0x10, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0xd6, 0xd6, 0xd6, 0xfe, 0xee, 0x6c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xc6, 0xc6, 0x6c, 0x7c, 0x38, 0x38, 0x7c, 0x6c, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x66, 0x66, 0x66, 0x66, 0x3c, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xfe, 0xc6, 0x86, 0x0c, 0x18, 0x30, 0x60, 0xc2, 0xc6, 0xfe, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x3c, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x3c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x80, 0xc0, 0xe0, 0x70, 0x38, 0x1c, 0x0e, 0x06, 0x02, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x3c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x3c, 0x00, 0x00, 0x00, 0x00}, |
{0x10, 0x38, 0x6c, 0xc6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00}, |
{0x30, 0x30, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x0c, 0x7c, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xe0, 0x60, 0x60, 0x78, 0x6c, 0x66, 0x66, 0x66, 0x66, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, 0xc0, 0xc0, 0xc0, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x1c, 0x0c, 0x0c, 0x3c, 0x6c, 0xcc, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, 0xfe, 0xc0, 0xc0, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x38, 0x6c, 0x64, 0x60, 0xf0, 0x60, 0x60, 0x60, 0x60, 0xf0, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x7c, 0x0c, 0xcc, 0x78, 0x00}, |
{0x00, 0x00, 0xe0, 0x60, 0x60, 0x6c, 0x76, 0x66, 0x66, 0x66, 0x66, 0xe6, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x18, 0x18, 0x00, 0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x06, 0x06, 0x00, 0x0e, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x66, 0x66, 0x3c, 0x00}, |
{0x00, 0x00, 0xe0, 0x60, 0x60, 0x66, 0x6c, 0x78, 0x78, 0x6c, 0x66, 0xe6, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0xec, 0xfe, 0xd6, 0xd6, 0xd6, 0xd6, 0xc6, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0xdc, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0xdc, 0x66, 0x66, 0x66, 0x66, 0x66, 0x7c, 0x60, 0x60, 0xf0, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x7c, 0x0c, 0x0c, 0x1e, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0xdc, 0x76, 0x66, 0x60, 0x60, 0x60, 0xf0, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, 0x60, 0x38, 0x0c, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x10, 0x30, 0x30, 0xfc, 0x30, 0x30, 0x30, 0x30, 0x36, 0x1c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x66, 0x66, 0x66, 0x66, 0x66, 0x3c, 0x18, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0xc6, 0xc6, 0xd6, 0xd6, 0xd6, 0xfe, 0x6c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0xc6, 0x6c, 0x38, 0x38, 0x38, 0x6c, 0xc6, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7e, 0x06, 0x0c, 0xf8, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xcc, 0x18, 0x30, 0x60, 0xc6, 0xfe, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x0e, 0x18, 0x18, 0x18, 0x70, 0x18, 0x18, 0x18, 0x18, 0x0e, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0x00, 0x18, 0x18, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x70, 0x18, 0x18, 0x18, 0x0e, 0x18, 0x18, 0x18, 0x18, 0x70, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x76, 0xdc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x10, 0x38, 0x6c, 0xc6, 0xc6, 0xc6, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x18, 0x18, 0x00, 0x18, 0x18, 0x18, 0x3c, 0x3c, 0x3c, 0x18, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x18, 0x18, 0x3c, 0x66, 0x60, 0x60, 0x60, 0x66, 0x3c, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x38, 0x6c, 0x64, 0x60, 0xf0, 0x60, 0x60, 0x60, 0x60, 0xe6, 0xfc, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x66, 0x3c, 0x66, 0x66, 0x66, 0x3c, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x66, 0x66, 0x3c, 0x18, 0x7e, 0x18, 0x7e, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0x00, 0x18, 0x18, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x7c, 0xc6, 0x60, 0x38, 0x6c, 0xc6, 0xc6, 0x6c, 0x38, 0x0c, 0xc6, 0x7c, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x6c, 0x6c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x3c, 0x42, 0x99, 0xa5, 0xa1, 0xa1, 0xa5, 0x99, 0x42, 0x3c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x3c, 0x6c, 0x6c, 0x3e, 0x00, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x6c, 0xd8, 0x6c, 0x36, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x06, 0x06, 0x06, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x38, 0x44, 0xba, 0xb2, 0xaa, 0x44, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x38, 0x6c, 0x6c, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x7e, 0x18, 0x18, 0x00, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x70, 0xd8, 0x30, 0x60, 0xc8, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x70, 0xd8, 0x30, 0x18, 0xd8, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x0c, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xf6, 0xc0, 0xc0, 0xc0, 0x00}, |
{0x00, 0x00, 0x7f, 0xdb, 0xdb, 0xdb, 0x7b, 0x1b, 0x1b, 0x1b, 0x1b, 0x1b, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x0c, 0x38, 0x00}, |
{0x00, 0x30, 0x70, 0x30, 0x30, 0x30, 0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x38, 0x6c, 0x6c, 0x38, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0xd8, 0x6c, 0x36, 0x6c, 0xd8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0xc0, 0xc0, 0xc2, 0xc6, 0xcc, 0x18, 0x30, 0x66, 0xce, 0x9e, 0x3e, 0x06, 0x06, 0x00, 0x00}, |
{0x00, 0xc0, 0xc0, 0xc2, 0xc6, 0xcc, 0x18, 0x30, 0x60, 0xdc, 0x86, 0x0c, 0x18, 0x3e, 0x00, 0x00}, |
{0x00, 0xe0, 0x30, 0x62, 0x36, 0xec, 0x18, 0x30, 0x66, 0xce, 0x9e, 0x3e, 0x06, 0x06, 0x00, 0x00}, |
{0x00, 0x00, 0x30, 0x30, 0x00, 0x30, 0x30, 0x60, 0xc0, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x60, 0x30, 0x00, 0x10, 0x38, 0x6c, 0xc6, 0xc6, 0xfe, 0xc6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00}, |
{0x0c, 0x18, 0x00, 0x10, 0x38, 0x6c, 0xc6, 0xc6, 0xfe, 0xc6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00}, |
{0x10, 0x38, 0x6c, 0x10, 0x38, 0x6c, 0xc6, 0xc6, 0xfe, 0xc6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00}, |
{0x76, 0xdc, 0x00, 0x10, 0x38, 0x6c, 0xc6, 0xc6, 0xfe, 0xc6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00}, |
{0x6c, 0x6c, 0x00, 0x10, 0x38, 0x6c, 0xc6, 0xc6, 0xfe, 0xc6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00}, |
{0x38, 0x6c, 0x38, 0x10, 0x38, 0x6c, 0xc6, 0xc6, 0xfe, 0xc6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x3e, 0x6c, 0xcc, 0xcc, 0xfe, 0xcc, 0xcc, 0xcc, 0xcc, 0xce, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x3c, 0x66, 0xc2, 0xc0, 0xc0, 0xc0, 0xc0, 0xc2, 0x66, 0x3c, 0x18, 0x0c, 0x38, 0x00}, |
{0x30, 0x18, 0x00, 0xfe, 0x66, 0x62, 0x68, 0x78, 0x68, 0x62, 0x66, 0xfe, 0x00, 0x00, 0x00, 0x00}, |
{0x0c, 0x18, 0x00, 0xfe, 0x66, 0x62, 0x68, 0x78, 0x68, 0x62, 0x66, 0xfe, 0x00, 0x00, 0x00, 0x00}, |
{0x10, 0x38, 0x44, 0xfe, 0x66, 0x62, 0x68, 0x78, 0x68, 0x62, 0x66, 0xfe, 0x00, 0x00, 0x00, 0x00}, |
{0x6c, 0x6c, 0x00, 0xfe, 0x66, 0x62, 0x68, 0x78, 0x68, 0x62, 0x66, 0xfe, 0x00, 0x00, 0x00, 0x00}, |
{0x30, 0x18, 0x00, 0x3c, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00}, |
{0x0c, 0x18, 0x00, 0x3c, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00}, |
{0x18, 0x3c, 0x42, 0x3c, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00}, |
{0x66, 0x66, 0x00, 0x3c, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xf8, 0x6c, 0x66, 0x66, 0xf6, 0x66, 0x66, 0x66, 0x6c, 0xf8, 0x00, 0x00, 0x00, 0x00}, |
{0x76, 0xdc, 0x00, 0xc6, 0xe6, 0xf6, 0xfe, 0xde, 0xce, 0xc6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00}, |
{0x60, 0x30, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x0c, 0x18, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x10, 0x38, 0x44, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x76, 0xdc, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x6c, 0x6c, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x66, 0x3c, 0x18, 0x3c, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x7a, 0xc4, 0xce, 0xce, 0xd6, 0xd6, 0xe6, 0xe6, 0x46, 0xbc, 0x00, 0x00, 0x00, 0x00}, |
{0x60, 0x30, 0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x0c, 0x18, 0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x10, 0x38, 0x44, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x6c, 0x6c, 0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x0c, 0x18, 0x00, 0x66, 0x66, 0x66, 0x3c, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xf0, 0x60, 0x7c, 0x66, 0x66, 0x66, 0x66, 0x7c, 0x60, 0xf0, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x3c, 0x66, 0x66, 0x66, 0x6c, 0x66, 0x66, 0x66, 0x66, 0xec, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x60, 0x30, 0x00, 0x78, 0x0c, 0x7c, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x18, 0x30, 0x00, 0x78, 0x0c, 0x7c, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x10, 0x38, 0x6c, 0x00, 0x78, 0x0c, 0x7c, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x76, 0xdc, 0x00, 0x78, 0x0c, 0x7c, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x6c, 0x6c, 0x00, 0x78, 0x0c, 0x7c, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x38, 0x6c, 0x38, 0x00, 0x78, 0x0c, 0x7c, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0xcc, 0x76, 0x36, 0x7e, 0xd8, 0xd8, 0x6e, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, 0xc0, 0xc0, 0xc0, 0xc6, 0x7c, 0x18, 0x0c, 0x38, 0x00}, |
{0x00, 0x00, 0x60, 0x30, 0x00, 0x7c, 0xc6, 0xfe, 0xc0, 0xc0, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x0c, 0x18, 0x00, 0x7c, 0xc6, 0xfe, 0xc0, 0xc0, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x10, 0x38, 0x6c, 0x00, 0x7c, 0xc6, 0xfe, 0xc0, 0xc0, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x6c, 0x6c, 0x00, 0x7c, 0xc6, 0xfe, 0xc0, 0xc0, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x30, 0x18, 0x00, 0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x0c, 0x18, 0x00, 0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x10, 0x38, 0x6c, 0x00, 0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x66, 0x66, 0x00, 0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x76, 0x1c, 0x3c, 0x06, 0x7e, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x76, 0xdc, 0x00, 0xdc, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x60, 0x30, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x0c, 0x18, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x10, 0x38, 0x6c, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x76, 0xdc, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x6c, 0x6c, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x7e, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x7a, 0xc4, 0xce, 0xd6, 0xe6, 0x46, 0xbc, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x60, 0x30, 0x00, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x18, 0x30, 0x00, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x10, 0x38, 0x6c, 0x00, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xcc, 0xcc, 0x00, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x0c, 0x18, 0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7e, 0x06, 0x0c, 0xf8, 0x00}, |
{0x00, 0x00, 0xe0, 0x60, 0x60, 0x7c, 0x66, 0x66, 0x66, 0x66, 0x66, 0x7c, 0x60, 0x60, 0xf0, 0x00}, |
{0x00, 0x00, 0x6c, 0x6c, 0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7e, 0x06, 0x0c, 0xf8, 0x00}, |
{0x00, 0x7c, 0x00, 0x10, 0x38, 0x6c, 0xc6, 0xc6, 0xfe, 0xc6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x7c, 0x00, 0x78, 0x0c, 0x7c, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00}, |
{0x6c, 0x38, 0x00, 0x10, 0x38, 0x6c, 0xc6, 0xc6, 0xfe, 0xc6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x6c, 0x38, 0x00, 0x78, 0x0c, 0x7c, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x10, 0x38, 0x6c, 0xc6, 0xc6, 0xfe, 0xc6, 0xc6, 0xc6, 0xc6, 0x0c, 0x18, 0x0e, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x0c, 0x7c, 0xcc, 0xcc, 0xcc, 0x76, 0x0c, 0x18, 0x0e, 0x00}, |
{0x0c, 0x18, 0x00, 0x3c, 0x66, 0xc2, 0xc0, 0xc0, 0xc0, 0xc2, 0x66, 0x3c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x0c, 0x18, 0x00, 0x7c, 0xc6, 0xc0, 0xc0, 0xc0, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x10, 0x38, 0x44, 0x3c, 0x66, 0xc2, 0xc0, 0xc0, 0xc0, 0xc2, 0x66, 0x3c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x10, 0x38, 0x6c, 0x00, 0x7c, 0xc6, 0xc0, 0xc0, 0xc0, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x18, 0x18, 0x00, 0x3c, 0x66, 0xc2, 0xc0, 0xc0, 0xc0, 0xc2, 0x66, 0x3c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x30, 0x30, 0x00, 0x7c, 0xc6, 0xc0, 0xc0, 0xc0, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x6c, 0x38, 0x10, 0x3c, 0x66, 0xc2, 0xc0, 0xc0, 0xc0, 0xc2, 0x66, 0x3c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x6c, 0x38, 0x10, 0x00, 0x7c, 0xc6, 0xc0, 0xc0, 0xc0, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x6c, 0x38, 0x10, 0xf8, 0x6c, 0x66, 0x66, 0x66, 0x66, 0x66, 0x6c, 0xf8, 0x00, 0x00, 0x00, 0x00}, |
{0x6c, 0x38, 0x10, 0x0c, 0x0c, 0x3c, 0x6c, 0xcc, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xf8, 0x6c, 0x66, 0x66, 0xf6, 0x66, 0x66, 0x66, 0x6c, 0xf8, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x0c, 0x3e, 0x0c, 0x3c, 0x6c, 0xcc, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x7c, 0x00, 0xfe, 0x66, 0x62, 0x68, 0x78, 0x68, 0x62, 0x66, 0xfe, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x7c, 0x00, 0x7c, 0xc6, 0xfe, 0xc0, 0xc0, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x6c, 0x38, 0x00, 0xfe, 0x66, 0x62, 0x68, 0x78, 0x68, 0x62, 0x66, 0xfe, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x6c, 0x38, 0x00, 0x7c, 0xc6, 0xfe, 0xc0, 0xc0, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x18, 0x18, 0x00, 0xfe, 0x66, 0x62, 0x68, 0x78, 0x68, 0x62, 0x66, 0xfe, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x30, 0x30, 0x00, 0x7c, 0xc6, 0xfe, 0xc0, 0xc0, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0xfe, 0x66, 0x62, 0x68, 0x78, 0x68, 0x62, 0x66, 0xfe, 0x18, 0x30, 0x1c, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, 0xfe, 0xc0, 0xc0, 0xc6, 0x7c, 0x30, 0x60, 0x38, 0x00}, |
{0x6c, 0x38, 0x10, 0xfe, 0x66, 0x62, 0x68, 0x78, 0x68, 0x62, 0x66, 0xfe, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x6c, 0x38, 0x10, 0x00, 0x7c, 0xc6, 0xfe, 0xc0, 0xc0, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x10, 0x38, 0x44, 0x3c, 0x66, 0xc2, 0xc0, 0xde, 0xc6, 0xc6, 0x66, 0x3a, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x10, 0x38, 0x6c, 0x00, 0x76, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x7c, 0x0c, 0xcc, 0x78, 0x00}, |
{0x6c, 0x38, 0x00, 0x3c, 0x66, 0xc2, 0xc0, 0xde, 0xc6, 0xc6, 0x66, 0x3a, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x6c, 0x38, 0x00, 0x76, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x7c, 0x0c, 0xcc, 0x78, 0x00}, |
{0x18, 0x18, 0x00, 0x3c, 0x66, 0xc2, 0xc0, 0xde, 0xc6, 0xc6, 0x66, 0x3a, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x30, 0x30, 0x00, 0x76, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x7c, 0x0c, 0xcc, 0x78, 0x00}, |
{0x00, 0x00, 0x3c, 0x66, 0xc2, 0xc0, 0xc0, 0xde, 0xc6, 0xc6, 0x66, 0x3a, 0x00, 0x18, 0x18, 0x30}, |
{0x00, 0x18, 0x30, 0x30, 0x00, 0x76, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x7c, 0x0c, 0xcc, 0x78, 0x00}, |
{0x10, 0x38, 0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0xfe, 0xc6, 0xc6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00}, |
{0x10, 0x38, 0x44, 0xe0, 0x60, 0x6c, 0x76, 0x66, 0x66, 0x66, 0x66, 0xe6, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x66, 0xff, 0x66, 0x66, 0x7e, 0x66, 0x66, 0x66, 0x66, 0x66, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x60, 0xf8, 0x60, 0x6c, 0x76, 0x66, 0x66, 0x66, 0x66, 0xe6, 0x00, 0x00, 0x00, 0x00}, |
{0x76, 0xdc, 0x00, 0x3c, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x76, 0xdc, 0x00, 0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x7e, 0x00, 0x3c, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x7e, 0x00, 0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00}, |
{0x66, 0x3c, 0x00, 0x3c, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x66, 0x3c, 0x00, 0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x3c, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x18, 0x30, 0x1c, 0x00}, |
{0x00, 0x00, 0x18, 0x18, 0x00, 0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x18, 0x30, 0x1c, 0x00}, |
{0x18, 0x18, 0x00, 0x3c, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xf7, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x7b, 0x7b, 0xee, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x66, 0x66, 0x00, 0xee, 0x66, 0x66, 0x66, 0x66, 0x66, 0xf6, 0x06, 0x66, 0x3c, 0x00}, |
{0x08, 0x1c, 0x22, 0x1e, 0x0c, 0x0c, 0x0c, 0x0c, 0xcc, 0xcc, 0xcc, 0x78, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x04, 0x0e, 0x1b, 0x00, 0x0e, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x66, 0x66, 0x3c, 0x00}, |
{0x00, 0x00, 0xe6, 0x66, 0x66, 0x6c, 0x78, 0x78, 0x6c, 0x66, 0x66, 0xe6, 0x00, 0x18, 0x18, 0x30}, |
{0x00, 0x00, 0xe0, 0x60, 0x60, 0x66, 0x6c, 0x78, 0x78, 0x6c, 0x66, 0xe6, 0x00, 0x18, 0x18, 0x30}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0xe6, 0x6c, 0x78, 0x78, 0x6c, 0x66, 0xe6, 0x00, 0x00, 0x00, 0x00}, |
{0x18, 0x30, 0x00, 0xf0, 0x60, 0x60, 0x60, 0x60, 0x60, 0x62, 0x66, 0xfe, 0x00, 0x00, 0x00, 0x00}, |
{0x0c, 0x18, 0x00, 0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xf0, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x62, 0x66, 0xfe, 0x00, 0x18, 0x18, 0x30}, |
{0x00, 0x00, 0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x18, 0x18, 0x30}, |
{0x6c, 0x38, 0x10, 0xf0, 0x60, 0x60, 0x60, 0x60, 0x60, 0x62, 0x66, 0xfe, 0x00, 0x00, 0x00, 0x00}, |
{0x6c, 0x38, 0x10, 0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xf0, 0x60, 0x60, 0x60, 0x66, 0x66, 0x60, 0x62, 0x66, 0xfe, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x70, 0x30, 0x30, 0x30, 0x36, 0x36, 0x30, 0x30, 0x30, 0x78, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xf0, 0x60, 0x60, 0x60, 0x78, 0xe0, 0x60, 0x62, 0x66, 0xfe, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x38, 0x18, 0x18, 0x18, 0x1e, 0x78, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00}, |
{0x0c, 0x18, 0x00, 0xc6, 0xe6, 0xf6, 0xfe, 0xde, 0xce, 0xc6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x0c, 0x18, 0x00, 0xdc, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xc6, 0xe6, 0xf6, 0xfe, 0xde, 0xce, 0xc6, 0xc6, 0xc6, 0xc6, 0x00, 0x18, 0x18, 0x30}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0xdc, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x00, 0x18, 0x18, 0x30}, |
{0x6c, 0x38, 0x10, 0xc6, 0xe6, 0xf6, 0xfe, 0xde, 0xce, 0xc6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x6c, 0x38, 0x10, 0x00, 0xdc, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x60, 0x60, 0xc0, 0x00, 0xdc, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xc6, 0xe6, 0xf6, 0xfe, 0xde, 0xce, 0xc6, 0xc6, 0xc6, 0xc6, 0x06, 0x06, 0x1c, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0xdc, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x06, 0x06, 0x1c, 0x00}, |
{0x00, 0x7c, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x7c, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x6c, 0x38, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x6c, 0x38, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x66, 0xcc, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x66, 0xcc, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x6e, 0xd8, 0xd8, 0xd8, 0xde, 0xd8, 0xd8, 0xd8, 0xd8, 0x6e, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x6c, 0xd6, 0xd6, 0xde, 0xd8, 0xd8, 0x6e, 0x00, 0x00, 0x00, 0x00}, |
{0x0c, 0x18, 0x00, 0xfc, 0x66, 0x66, 0x66, 0x7c, 0x6c, 0x66, 0x66, 0xe6, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x0c, 0x18, 0x00, 0xdc, 0x76, 0x66, 0x60, 0x60, 0x60, 0xf0, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xfc, 0x66, 0x66, 0x66, 0x7c, 0x6c, 0x66, 0x66, 0x66, 0xe6, 0x00, 0x18, 0x18, 0x30}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0xdc, 0x76, 0x66, 0x60, 0x60, 0x60, 0xf0, 0x00, 0x18, 0x18, 0x30}, |
{0x6c, 0x38, 0x10, 0xfc, 0x66, 0x66, 0x66, 0x7c, 0x6c, 0x66, 0x66, 0xe6, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x6c, 0x38, 0x10, 0x00, 0xdc, 0x76, 0x66, 0x60, 0x60, 0x60, 0xf0, 0x00, 0x00, 0x00, 0x00}, |
{0x0c, 0x18, 0x00, 0x7c, 0xc6, 0xc6, 0x60, 0x38, 0x0c, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x0c, 0x18, 0x00, 0x7c, 0xc6, 0x60, 0x38, 0x0c, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x10, 0x38, 0x44, 0x7c, 0xc6, 0xc6, 0x60, 0x38, 0x0c, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x10, 0x38, 0x6c, 0x00, 0x7c, 0xc6, 0x60, 0x38, 0x0c, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x7c, 0xc6, 0xc6, 0x60, 0x38, 0x0c, 0xc6, 0xc6, 0x7c, 0x18, 0x0c, 0x38, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, 0x60, 0x38, 0x0c, 0xc6, 0x7c, 0x18, 0x0c, 0x38, 0x00}, |
{0x6c, 0x38, 0x10, 0x7c, 0xc6, 0xc6, 0x60, 0x38, 0x0c, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x6c, 0x38, 0x10, 0x00, 0x7c, 0xc6, 0x60, 0x38, 0x0c, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x7e, 0x7e, 0x5a, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x18, 0x0c, 0x38, 0x00}, |
{0x00, 0x00, 0x10, 0x30, 0x30, 0xfc, 0x30, 0x30, 0x30, 0x30, 0x36, 0x1c, 0x18, 0x0c, 0x38, 0x00}, |
{0x6c, 0x38, 0x10, 0x7e, 0x7e, 0x5a, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00}, |
{0x6c, 0x38, 0x10, 0x10, 0x30, 0xfc, 0x30, 0x30, 0x30, 0x30, 0x36, 0x1c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x7e, 0x7e, 0x5a, 0x18, 0x18, 0x3c, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x10, 0x30, 0x30, 0xfc, 0x30, 0xfc, 0x30, 0x30, 0x36, 0x1c, 0x00, 0x00, 0x00, 0x00}, |
{0x76, 0xdc, 0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x76, 0xdc, 0x00, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x7c, 0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x78, 0x00, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00}, |
{0x6c, 0x38, 0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xcc, 0x78, 0x00, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00}, |
{0x38, 0x6c, 0x38, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x38, 0x6c, 0x38, 0x00, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00}, |
{0x66, 0xcc, 0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x66, 0xcc, 0x00, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x30, 0x60, 0x38, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x76, 0x30, 0x60, 0x38, 0x00}, |
{0x10, 0x38, 0x44, 0xc6, 0xc6, 0xc6, 0xd6, 0xd6, 0xd6, 0xfe, 0xee, 0x6c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x10, 0x38, 0x6c, 0x00, 0xc6, 0xc6, 0xd6, 0xd6, 0xd6, 0xfe, 0x6c, 0x00, 0x00, 0x00, 0x00}, |
{0x10, 0x38, 0x44, 0x66, 0x66, 0x66, 0x3c, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x10, 0x38, 0x6c, 0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7e, 0x06, 0x0c, 0xf8, 0x00}, |
{0x66, 0x66, 0x00, 0x66, 0x66, 0x66, 0x3c, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00}, |
{0x0c, 0x18, 0x00, 0xfe, 0xc6, 0x8c, 0x18, 0x30, 0x60, 0xc2, 0xc6, 0xfe, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x0c, 0x18, 0x00, 0xfe, 0xcc, 0x18, 0x30, 0x60, 0xc6, 0xfe, 0x00, 0x00, 0x00, 0x00}, |
{0x18, 0x18, 0x00, 0xfe, 0xc6, 0x8c, 0x18, 0x30, 0x60, 0xc2, 0xc6, 0xfe, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x18, 0x18, 0x00, 0xfe, 0xcc, 0x18, 0x30, 0x60, 0xc6, 0xfe, 0x00, 0x00, 0x00, 0x00}, |
{0x6c, 0x38, 0x10, 0xfe, 0xc6, 0x8c, 0x18, 0x30, 0x60, 0xc2, 0xc6, 0xfe, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x6c, 0x38, 0x10, 0x00, 0xfe, 0xcc, 0x18, 0x30, 0x60, 0xc6, 0xfe, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x38, 0x6c, 0x64, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0xf0, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x60, 0xf8, 0x60, 0x78, 0x6c, 0x66, 0x66, 0x66, 0x66, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x7e, 0xb3, 0xb3, 0x33, 0x3e, 0x33, 0x33, 0x33, 0x33, 0x7e, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xfc, 0x64, 0x60, 0x60, 0x7c, 0x66, 0x66, 0x66, 0x66, 0xfc, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x7e, 0x62, 0x60, 0x78, 0x6c, 0x66, 0x66, 0x66, 0x66, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x7c, 0xe6, 0xe6, 0x66, 0x7c, 0x66, 0x66, 0x66, 0x66, 0xfc, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x60, 0xe0, 0xe0, 0x78, 0x6c, 0x66, 0x66, 0x66, 0x66, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x78, 0xcc, 0x86, 0x06, 0x06, 0x06, 0x06, 0x86, 0xcc, 0x78, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x03, 0x3e, 0x66, 0xc2, 0xc0, 0xc0, 0xc0, 0xc0, 0xc2, 0x66, 0x3c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x03, 0x7e, 0xc6, 0xc0, 0xc0, 0xc0, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xf8, 0x6c, 0x66, 0x66, 0xf6, 0x66, 0x66, 0x66, 0x6c, 0xf8, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x7c, 0xb6, 0xb3, 0x33, 0x33, 0x33, 0x33, 0x33, 0x36, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x7e, 0x4c, 0x0c, 0x0c, 0x7c, 0xcc, 0xcc, 0xcc, 0xcc, 0x7e, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x7c, 0x4c, 0x0c, 0x3c, 0x6c, 0xcc, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x30, 0x18, 0xcc, 0x78, 0x00}, |
{0x00, 0x00, 0xfe, 0xcc, 0x8c, 0x2c, 0x3c, 0x2c, 0x0c, 0x8c, 0xcc, 0xfe, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x7c, 0xc6, 0x06, 0x06, 0x06, 0xfe, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x7c, 0xc6, 0xc2, 0xc0, 0x78, 0xc0, 0xc0, 0xc2, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xfe, 0x66, 0x62, 0x68, 0x78, 0x68, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0xc0, 0x00}, |
{0x00, 0x00, 0x1c, 0x36, 0x32, 0x30, 0x78, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0xe0, 0x00}, |
{0x00, 0x03, 0x3e, 0x66, 0xc2, 0xc0, 0xc0, 0xde, 0xc6, 0xc6, 0x66, 0x3a, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xc6, 0xc6, 0xc6, 0x6c, 0x6c, 0x6c, 0x38, 0x38, 0x10, 0x38, 0x6c, 0x38, 0x00, 0x00}, |
{0x00, 0x00, 0xc0, 0xc0, 0xc0, 0xf3, 0xdb, 0xdb, 0xdb, 0xdb, 0xdb, 0xce, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x70, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x36, 0x1c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x3c, 0x18, 0x18, 0x18, 0x3c, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xe6, 0x6d, 0x6c, 0x78, 0x70, 0x78, 0x6c, 0x66, 0x66, 0xe6, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x38, 0x6c, 0x60, 0x66, 0x6c, 0x78, 0x78, 0x6c, 0x66, 0xe6, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x38, 0x18, 0x18, 0x18, 0x3c, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xc8, 0x38, 0x70, 0xd0, 0x38, 0x38, 0x6c, 0x64, 0xc6, 0xc2, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xd6, 0xd6, 0xd6, 0xd6, 0xd6, 0xd6, 0xd6, 0xd6, 0xfe, 0xec, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x66, 0x66, 0x76, 0x7e, 0x7e, 0x6e, 0x66, 0x66, 0x66, 0x66, 0x60, 0x60, 0xc0, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0xdc, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x06, 0x06, 0x06, 0x00}, |
{0x00, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xfe, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x03, 0x03, 0x7a, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x78, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x03, 0x03, 0x06, 0x78, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x78, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x73, 0xdf, 0xdb, 0xdb, 0xdb, 0xdb, 0xdb, 0xdb, 0xdb, 0x73, 0x03, 0x03, 0x03, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x73, 0xdf, 0xdb, 0xdb, 0xdb, 0xdb, 0x73, 0x03, 0x03, 0x03, 0x00}, |
{0x00, 0x00, 0x7e, 0xb3, 0xb3, 0x33, 0x3e, 0x30, 0x30, 0x30, 0x30, 0x78, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x38, 0x6c, 0x60, 0x7c, 0x66, 0x66, 0x66, 0x66, 0x66, 0x7c, 0x60, 0x60, 0xf0, 0x00}, |
{0x00, 0x00, 0xf0, 0x60, 0x7c, 0x66, 0x66, 0x7c, 0x78, 0x6c, 0x6c, 0xe6, 0x06, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x7c, 0xc6, 0xc6, 0x0c, 0x38, 0x60, 0xc0, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, 0x0c, 0x38, 0x60, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xfe, 0xc6, 0x62, 0x30, 0x18, 0x18, 0x30, 0x62, 0xc6, 0xfe, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x70, 0xd8, 0x78, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x1b, 0x0e, 0x00}, |
{0x00, 0x00, 0x10, 0x30, 0x30, 0xfc, 0x30, 0x30, 0x30, 0x30, 0x36, 0x1c, 0x0c, 0x6c, 0x38, 0x00}, |
{0x00, 0x00, 0x7e, 0xfe, 0x9a, 0x58, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x1c, 0x36, 0x30, 0xfc, 0x30, 0x30, 0x30, 0x30, 0x36, 0x1c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x7e, 0x7e, 0x5a, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x0e, 0x00}, |
{0x03, 0x03, 0xce, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x78, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x03, 0x03, 0x06, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xee, 0x6c, 0x6c, 0x6c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xcc, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xcc, 0x78, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x63, 0xb3, 0xb3, 0x33, 0x1e, 0x0c, 0x0c, 0x0c, 0x0c, 0x1e, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x06, 0x0d, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x7c, 0x0c, 0x18, 0xf0, 0x00}, |
{0x00, 0x00, 0xfe, 0xc6, 0x86, 0x0c, 0x7e, 0x30, 0x60, 0xc2, 0xc6, 0xfe, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xcc, 0x18, 0xfc, 0x60, 0xc6, 0xfe, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xfe, 0x06, 0x0c, 0x18, 0x30, 0x7c, 0x06, 0x06, 0x06, 0x06, 0xc6, 0x7c, 0x00, 0x00}, |
{0x00, 0x00, 0xfe, 0xc0, 0x60, 0x30, 0x18, 0x7c, 0xc0, 0xc0, 0xc0, 0xc0, 0xc6, 0x7c, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xc0, 0x60, 0x30, 0x78, 0xc0, 0xc0, 0xc0, 0xc6, 0x7c, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x06, 0x0c, 0x18, 0x3c, 0x06, 0x7c, 0xc0, 0xc6, 0x7c, 0x00}, |
{0x00, 0x00, 0x7c, 0xc6, 0x06, 0x0c, 0x7e, 0x30, 0x60, 0xc0, 0xc6, 0xfe, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xfe, 0x60, 0x60, 0x78, 0x0c, 0x06, 0x06, 0x06, 0x66, 0x3c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x60, 0x78, 0x0c, 0x06, 0x66, 0x3c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x10, 0x30, 0x30, 0xfc, 0x30, 0x30, 0x18, 0x4c, 0x6c, 0x38, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0xdc, 0x66, 0x66, 0x66, 0x6c, 0x78, 0x70, 0x60, 0x60, 0xf0, 0x00}, |
{0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x6c, 0x6c, 0x6c, 0x6c, 0x6c, 0x6c, 0x6c, 0x6c, 0x6c, 0x6c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x18, 0x18, 0x18, 0x7e, 0x18, 0x7e, 0x18, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x18, 0x3c, 0x3c, 0x3c, 0x18, 0x18, 0x18, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00}, |
{0x1b, 0x0e, 0x04, 0xf7, 0xd9, 0xd9, 0xda, 0xda, 0xda, 0xdc, 0xdc, 0xf7, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xf5, 0xda, 0xd8, 0xdf, 0xd9, 0xda, 0xda, 0xda, 0xdc, 0xf7, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x3d, 0x1a, 0x18, 0x7f, 0xd9, 0xda, 0xda, 0xda, 0xdc, 0x6f, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xc7, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xcb, 0xf6, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xf3, 0x63, 0x60, 0x67, 0x63, 0x63, 0x63, 0x67, 0x6f, 0xff, 0x03, 0x1b, 0x0e, 0x00}, |
{0x00, 0x00, 0xe3, 0x63, 0x60, 0x67, 0x63, 0x63, 0x63, 0x63, 0x63, 0xf3, 0x03, 0x33, 0x1e, 0x00}, |
{0x00, 0x00, 0xdb, 0xdb, 0xfb, 0xfb, 0xfb, 0xdb, 0xdb, 0xdb, 0xdb, 0xde, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xdb, 0xdb, 0xf8, 0xff, 0xfb, 0xfb, 0xdb, 0xdb, 0xdb, 0xdb, 0x03, 0x33, 0x1e, 0x00}, |
{0x00, 0x00, 0x03, 0x03, 0x00, 0xb7, 0xdb, 0xdb, 0xdb, 0xdb, 0xdb, 0xdb, 0x03, 0x33, 0x1e, 0x00}, |
{0x6c, 0x38, 0x10, 0x10, 0x38, 0x6c, 0xc6, 0xc6, 0xfe, 0xc6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x6c, 0x38, 0x10, 0x00, 0x78, 0x0c, 0x7c, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00}, |
{0x6c, 0x38, 0x10, 0x3c, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x6c, 0x38, 0x10, 0x00, 0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00}, |
{0x6c, 0x38, 0x10, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x6c, 0x38, 0x10, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x6c, 0x38, 0x10, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x6c, 0x38, 0x10, 0x00, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00}, |
{0x7c, 0x00, 0x6c, 0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x78, 0x00, 0xcc, 0x00, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00}, |
{0x08, 0x10, 0x6c, 0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x18, 0x30, 0x00, 0xcc, 0x00, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00}, |
{0x28, 0x10, 0x6c, 0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x78, 0x30, 0x00, 0xcc, 0x00, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00}, |
{0x20, 0x10, 0x6c, 0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x60, 0x30, 0x00, 0xcc, 0x00, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, 0x06, 0x06, 0xfe, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x7c, 0x00, 0x6c, 0x10, 0x38, 0x6c, 0xc6, 0xc6, 0xfe, 0xc6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x7c, 0x00, 0x6c, 0x00, 0x78, 0x0c, 0x7c, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00}, |
{0x7c, 0x30, 0x30, 0x10, 0x38, 0x6c, 0xc6, 0xc6, 0xfe, 0xc6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x7c, 0x00, 0x30, 0x00, 0x78, 0x0c, 0x7c, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x7c, 0x00, 0x3e, 0x6c, 0xcc, 0xcc, 0xfe, 0xcc, 0xcc, 0xcc, 0xce, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x7c, 0x00, 0xcc, 0x76, 0x36, 0x7e, 0xd8, 0xd8, 0x6e, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x3c, 0x66, 0xc2, 0xc0, 0xc0, 0xde, 0xc6, 0xdf, 0x66, 0x3a, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0xcc, 0xcc, 0xcc, 0xcc, 0x7c, 0x0c, 0x3e, 0xcc, 0x78, 0x00}, |
{0x6c, 0x38, 0x10, 0x3c, 0x66, 0xc2, 0xc0, 0xde, 0xc6, 0xc6, 0x66, 0x3a, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x6c, 0x38, 0x10, 0x00, 0x76, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x7c, 0x0c, 0xcc, 0x78, 0x00}, |
{0x6c, 0x38, 0x10, 0xe6, 0x66, 0x66, 0x6c, 0x78, 0x6c, 0x66, 0x66, 0xe6, 0x00, 0x00, 0x00, 0x00}, |
{0x6c, 0x38, 0x10, 0xe0, 0x60, 0x66, 0x6c, 0x78, 0x78, 0x6c, 0x66, 0xe6, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x30, 0x60, 0x38, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x30, 0x60, 0x38, 0x00}, |
{0x00, 0x7c, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x30, 0x60, 0x38, 0x00}, |
{0x00, 0x00, 0x00, 0x7c, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x30, 0x60, 0x38, 0x00}, |
{0x6c, 0x38, 0x10, 0xfe, 0x0c, 0x18, 0x30, 0x7c, 0x06, 0x06, 0x06, 0x06, 0xc6, 0x7c, 0x00, 0x00}, |
{0x00, 0x6c, 0x38, 0x10, 0x00, 0xfe, 0x06, 0x0c, 0x18, 0x3c, 0x06, 0x06, 0x06, 0xc6, 0x7c, 0x00}, |
{0x00, 0x1b, 0x0e, 0x04, 0x00, 0x0e, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x66, 0x66, 0x3c, 0x00}, |
{0x00, 0x00, 0xf7, 0xd9, 0xd9, 0xda, 0xda, 0xda, 0xda, 0xdc, 0xdc, 0xf7, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xf0, 0xd8, 0xd8, 0xdf, 0xd9, 0xda, 0xda, 0xda, 0xdc, 0xf7, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x38, 0x18, 0x18, 0x7f, 0xd9, 0xda, 0xda, 0xda, 0xdc, 0x6f, 0x00, 0x00, 0x00, 0x00}, |
{0x0c, 0x18, 0x00, 0x3c, 0x66, 0xc2, 0xc0, 0xde, 0xc6, 0xc6, 0x66, 0x3a, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x18, 0x30, 0x00, 0x76, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x7c, 0x0c, 0xcc, 0x78, 0x00}, |
{0x00, 0x00, 0xd8, 0xd8, 0xd8, 0xdb, 0xfb, 0xdb, 0xdb, 0xdb, 0xdb, 0xce, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xfc, 0x66, 0x66, 0x66, 0x66, 0x6c, 0x78, 0x70, 0x60, 0x60, 0x60, 0x60, 0xe0, 0x00}, |
{0x60, 0x30, 0x00, 0xc6, 0xe6, 0xf6, 0xfe, 0xde, 0xce, 0xc6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x30, 0x18, 0x00, 0xdc, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x00, 0x00, 0x00, 0x00}, |
{0x0c, 0x18, 0x38, 0x6c, 0x38, 0x38, 0x6c, 0xc6, 0xc6, 0xfe, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00}, |
{0x0c, 0x18, 0x38, 0x6c, 0x38, 0x78, 0x0c, 0x7c, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00}, |
{0x0c, 0x18, 0x00, 0x3e, 0x6c, 0xcc, 0xcc, 0xfe, 0xcc, 0xcc, 0xcc, 0xce, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x0c, 0x18, 0x00, 0xcc, 0x76, 0x36, 0x7e, 0xd8, 0xd8, 0x6e, 0x00, 0x00, 0x00, 0x00}, |
{0x0c, 0x18, 0x00, 0x7a, 0xc4, 0xce, 0xce, 0xd6, 0xe6, 0xe6, 0x46, 0xbc, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x0c, 0x18, 0x00, 0x7a, 0xc4, 0xce, 0xd6, 0xe6, 0x46, 0xbc, 0x00, 0x00, 0x00, 0x00}, |
{0xcc, 0x66, 0x00, 0x10, 0x38, 0x6c, 0xc6, 0xc6, 0xfe, 0xc6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xcc, 0x66, 0x00, 0x78, 0x0c, 0x7c, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00}, |
{0x38, 0x6c, 0x00, 0x10, 0x38, 0x6c, 0xc6, 0xc6, 0xfe, 0xc6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x38, 0x6c, 0x00, 0x78, 0x0c, 0x7c, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00}, |
{0xcc, 0x66, 0x00, 0xfe, 0x66, 0x62, 0x68, 0x78, 0x68, 0x62, 0x66, 0xfe, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xcc, 0x66, 0x00, 0x7c, 0xc6, 0xfe, 0xc0, 0xc0, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x38, 0x6c, 0x00, 0xfe, 0x66, 0x62, 0x68, 0x78, 0x68, 0x62, 0x66, 0xfe, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x38, 0x6c, 0x00, 0x7c, 0xc6, 0xfe, 0xc0, 0xc0, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0xcc, 0x66, 0x00, 0x3c, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xcc, 0x66, 0x00, 0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00}, |
{0x3c, 0x66, 0x00, 0x3c, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x3c, 0x66, 0x00, 0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00}, |
{0xcc, 0x66, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xcc, 0x66, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x38, 0x6c, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x38, 0x6c, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0xcc, 0x66, 0x00, 0xfc, 0x66, 0x66, 0x66, 0x7c, 0x6c, 0x66, 0x66, 0xe6, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xcc, 0x66, 0x00, 0xdc, 0x76, 0x66, 0x60, 0x60, 0x60, 0xf0, 0x00, 0x00, 0x00, 0x00}, |
{0x38, 0x6c, 0x00, 0xfc, 0x66, 0x66, 0x66, 0x7c, 0x6c, 0x66, 0x66, 0xe6, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x38, 0x6c, 0x00, 0xdc, 0x76, 0x66, 0x60, 0x60, 0x60, 0xf0, 0x00, 0x00, 0x00, 0x00}, |
{0xcc, 0x66, 0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xcc, 0x66, 0x00, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00}, |
{0x38, 0x6c, 0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x78, 0xcc, 0x00, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x7c, 0xc6, 0xc6, 0x60, 0x38, 0x0c, 0x06, 0xc6, 0xc6, 0x7c, 0x00, 0x18, 0x18, 0x30}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, 0x60, 0x38, 0x0c, 0xc6, 0x7c, 0x00, 0x18, 0x18, 0x30}, |
{0x00, 0x00, 0x7e, 0x7e, 0x5a, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x18, 0x18, 0x30}, |
{0x00, 0x00, 0x10, 0x30, 0x30, 0xfc, 0x30, 0x30, 0x30, 0x30, 0x36, 0x1c, 0x00, 0x18, 0x18, 0x30}, |
{0x00, 0x00, 0x7c, 0xc6, 0x86, 0x06, 0x1c, 0x74, 0x06, 0x06, 0x06, 0x06, 0x1c, 0xf0, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, 0x06, 0x0e, 0x3c, 0x06, 0x06, 0x1c, 0xf0, 0x00, 0x00}, |
{0x6c, 0x38, 0x10, 0xc6, 0xc6, 0xc6, 0xc6, 0xfe, 0xc6, 0xc6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00}, |
{0x6c, 0x38, 0x10, 0xe0, 0x60, 0x6c, 0x76, 0x66, 0x66, 0x66, 0x66, 0xe6, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x6c, 0xc6, 0xc6, 0xc6, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x24, 0x66, 0x66, 0x66, 0x3c, 0x66, 0x66, 0x66, 0x66, 0x3c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xfe, 0xc6, 0x86, 0x0c, 0x18, 0x30, 0x60, 0xc0, 0xc0, 0xfc, 0x06, 0x0c, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xcc, 0x18, 0x30, 0x60, 0xc0, 0xfc, 0x06, 0x0c, 0x00, 0x00}, |
{0x30, 0x30, 0x00, 0x10, 0x38, 0x6c, 0xc6, 0xc6, 0xfe, 0xc6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x30, 0x30, 0x00, 0x78, 0x0c, 0x7c, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xfe, 0x66, 0x62, 0x68, 0x78, 0x68, 0x60, 0x62, 0x66, 0xfe, 0x18, 0x0c, 0x38, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, 0xfe, 0xc0, 0xc0, 0xc6, 0x7c, 0x18, 0x0c, 0x38, 0x00}, |
{0x7c, 0x00, 0x6c, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x7c, 0x00, 0x6c, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x7c, 0x00, 0x72, 0x9c, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x7c, 0x00, 0x76, 0xdc, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x30, 0x30, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x30, 0x30, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x7c, 0x00, 0x30, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x7c, 0x00, 0x30, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x3c, 0x00, 0x66, 0x66, 0x66, 0x3c, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x7c, 0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7e, 0x06, 0x0c, 0xf8, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0xdc, 0x66, 0x66, 0x66, 0x7c, 0x60, 0x3c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x74, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0xdc, 0x66, 0x66, 0x66, 0x66, 0x66, 0x5c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x38, 0x6c, 0x60, 0x78, 0x6c, 0x66, 0x66, 0x66, 0x66, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, 0x06, 0x06, 0x06, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, 0xc0, 0xc0, 0xdc, 0xe6, 0x7c, 0x80, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x1c, 0x0c, 0x0c, 0x3c, 0x6c, 0xcc, 0xcc, 0xcc, 0xcc, 0x7c, 0x0c, 0x0d, 0x06, 0x00}, |
{0x00, 0x00, 0x06, 0x0d, 0x0c, 0x3c, 0x6c, 0xcc, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, 0xfe, 0x06, 0x06, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, 0x06, 0x06, 0xfe, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x3b, 0x6c, 0x8e, 0x16, 0x26, 0x6c, 0x38, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, 0xc0, 0x78, 0xc0, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, 0x06, 0x3c, 0x06, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x7a, 0xcd, 0x0d, 0x38, 0x0c, 0xcc, 0x78, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, 0xc6, 0xdc, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x06, 0x06, 0x1f, 0x06, 0x06, 0x06, 0x66, 0x66, 0x3c, 0x00}, |
{0x00, 0x00, 0x00, 0x06, 0x0d, 0x7c, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x7c, 0x0c, 0xcc, 0x78, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x7c, 0x0c, 0xcc, 0x78, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, 0xc0, 0xce, 0xc6, 0xc6, 0x7a, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0xc6, 0x46, 0x6c, 0x2c, 0x2c, 0x38, 0x18, 0x18, 0x18, 0x18, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0xc2, 0x64, 0x28, 0x38, 0x38, 0x6c, 0x38, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0xce, 0xcc, 0xcc, 0xcc, 0xcc, 0xdc, 0x6c, 0x0c, 0x0c, 0x0e, 0x00}, |
{0x00, 0x00, 0x38, 0x6c, 0x60, 0x6c, 0x76, 0x66, 0x66, 0x66, 0x66, 0xe6, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x38, 0x6c, 0x60, 0x6c, 0x76, 0x66, 0x66, 0x66, 0x66, 0xe6, 0x06, 0x06, 0x1c, 0x00}, |
{0x00, 0x00, 0x18, 0x18, 0x00, 0x38, 0x18, 0x18, 0x3c, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x0e, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x38, 0x18, 0x18, 0x18, 0x7b, 0xde, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x38, 0x18, 0x18, 0x18, 0x78, 0x58, 0x3e, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x1b, 0x0e, 0x00}, |
{0x00, 0x00, 0xe0, 0x60, 0x60, 0x7f, 0x63, 0x66, 0x6c, 0x7e, 0x63, 0xf3, 0x03, 0x33, 0x1e, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0xc6, 0xd6, 0xd6, 0xd6, 0xd6, 0xfe, 0x6e, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0xc6, 0xd6, 0xd6, 0xd6, 0xd6, 0xfe, 0x6e, 0x06, 0x06, 0x06, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0xec, 0xfe, 0xd6, 0xd6, 0xd6, 0xd6, 0xc6, 0x06, 0x06, 0x1c, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0xdc, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x60, 0x60, 0xc0, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0xdc, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x06, 0x06, 0x03, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0xc6, 0xe6, 0xf6, 0xfe, 0xde, 0xce, 0xc6, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, 0xc6, 0xfe, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x6e, 0xd8, 0xd8, 0xde, 0xd8, 0xd8, 0x6e, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x6c, 0xc6, 0xd6, 0xd6, 0xd6, 0xd6, 0x6c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x10, 0x10, 0x10, 0x7c, 0xd6, 0xd6, 0xd6, 0xd6, 0xd6, 0x7c, 0x10, 0x10, 0x10, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x0c, 0x0c, 0x0c, 0xcc, 0xdc, 0x76, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x1e, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0xcc, 0xdc, 0x76, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x0c, 0x0c, 0x0c, 0xcc, 0xdc, 0x6c, 0x0c, 0x0d, 0x06, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0xdc, 0x76, 0x66, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0xf0, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0xdc, 0x76, 0x66, 0x60, 0x60, 0x60, 0x60, 0x60, 0x6c, 0x38, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x66, 0x66, 0x60, 0x60, 0x60, 0xf0, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0xcc, 0xcc, 0x0c, 0x0c, 0x0c, 0x1e, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x66, 0x66, 0x7c, 0x6c, 0x66, 0xe6, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0xe6, 0x66, 0x6c, 0x7c, 0x66, 0x66, 0xfc, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, 0x60, 0x38, 0x0c, 0xc6, 0xfc, 0xc0, 0xd8, 0x70, 0x00}, |
{0x00, 0x00, 0x0e, 0x1b, 0x19, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x98, 0xd8, 0x70, 0x00}, |
{0x00, 0x00, 0x0e, 0x1b, 0x19, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x98, 0xd8, 0x70, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x70, 0xd8, 0x18, 0x18, 0x18, 0x18, 0x1b, 0x0e, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x0e, 0x1b, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x7e, 0xd8, 0x70, 0x00}, |
{0x00, 0x00, 0x70, 0xd8, 0x18, 0x18, 0x18, 0x18, 0x7e, 0x18, 0x18, 0x10, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x10, 0x30, 0x30, 0xfc, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x36, 0x1c, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x66, 0x66, 0x66, 0xff, 0x66, 0x66, 0x3b, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0xee, 0x6c, 0x6c, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0xcc, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x3c, 0x66, 0x66, 0x66, 0x66, 0x66, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x6c, 0xfe, 0xd6, 0xd6, 0xd6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x3e, 0x60, 0xc0, 0xfc, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x66, 0x66, 0x66, 0x3c, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xcc, 0x18, 0x30, 0x60, 0xc6, 0xfe, 0x06, 0x06, 0x03, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xcc, 0x18, 0x30, 0x66, 0xcb, 0xfe, 0x10, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x06, 0x0c, 0x18, 0x3c, 0x06, 0x06, 0x06, 0xc6, 0x7c, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x06, 0x0c, 0x18, 0x3c, 0x06, 0x06, 0x7e, 0xc7, 0x7c, 0x00}, |
{0x00, 0x00, 0x7c, 0xc6, 0xc6, 0x06, 0x1c, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x7c, 0xc6, 0xc6, 0xc0, 0x70, 0x30, 0x30, 0x30, 0x30, 0x78, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x3c, 0x18, 0x18, 0x18, 0x18, 0x1c, 0x06, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc6, 0x7c, 0x00}, |
{0x00, 0x00, 0x3c, 0x66, 0xc3, 0xc3, 0xdb, 0xdb, 0xc3, 0xc3, 0x66, 0x3c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x66, 0x66, 0x7c, 0x66, 0x66, 0xfc, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, 0xc6, 0x76, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x03, 0x7e, 0xc6, 0xc0, 0xce, 0xc6, 0xc6, 0x7a, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0xc6, 0xc6, 0xc6, 0xfe, 0xc6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x0c, 0x0c, 0x00, 0x1c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x7e, 0xcc, 0x78, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0xce, 0xcc, 0x6c, 0x3c, 0x3c, 0x6c, 0xcc, 0x0c, 0x0c, 0x0e, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x60, 0x60, 0x60, 0x62, 0x66, 0xfe, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x06, 0x0d, 0x7c, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x7c, 0x0c, 0x0c, 0x1e, 0x00}, |
{0x00, 0x00, 0x7c, 0xc6, 0xc6, 0x06, 0x1c, 0x18, 0x7e, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x7c, 0xc6, 0xc6, 0xc0, 0x70, 0x30, 0xfc, 0x30, 0x30, 0x78, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x38, 0x18, 0x18, 0x7f, 0xd9, 0xda, 0xda, 0xda, 0xdc, 0x6f, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x38, 0x18, 0x18, 0x7f, 0xdb, 0xdb, 0xde, 0xde, 0xdb, 0x6b, 0x03, 0x1b, 0x0e, 0x00}, |
{0x00, 0x00, 0x38, 0x18, 0x18, 0x7f, 0xd9, 0xda, 0xda, 0xdb, 0xdd, 0x6f, 0x04, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x20, 0x60, 0x60, 0xf6, 0x6d, 0x6c, 0x66, 0x63, 0x6b, 0x36, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x26, 0x6d, 0x6c, 0xfc, 0x6c, 0x6c, 0x6c, 0x6c, 0x6c, 0x3c, 0x0c, 0x2c, 0x18, 0x00}, |
{0x00, 0x00, 0x20, 0x60, 0x60, 0xf6, 0x6d, 0x6c, 0x6c, 0x6e, 0x6d, 0x36, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x70, 0xd8, 0xc0, 0xfe, 0xdb, 0xdb, 0xdb, 0xdb, 0xdb, 0xdb, 0x03, 0x03, 0x0e, 0x00}, |
{0x00, 0x00, 0xe0, 0x60, 0x60, 0x66, 0x6d, 0x6c, 0x66, 0x63, 0x6b, 0xf6, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xe0, 0x60, 0x60, 0x6f, 0x6b, 0x63, 0x66, 0x6c, 0x6d, 0xff, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xc6, 0xd6, 0x7c, 0x6c, 0x28, 0xc6, 0xd6, 0x7c, 0x6c, 0x28, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xfe, 0xc6, 0xc6, 0xc6, 0x00, 0x00, 0xfe, 0xc6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0xc0, 0xc0, 0xf0, 0xd8, 0xd8, 0xd8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x70, 0xc0, 0xf0, 0xd8, 0xd8, 0xd8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x18, 0x00, 0x38, 0x18, 0x18, 0xd8, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0xb0, 0xd8, 0xc0, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x18, 0x18, 0xd8, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x18, 0x18, 0xd8, 0x68, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0xd8, 0xd8, 0xf0, 0xd8, 0xd8, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0xc6, 0xd6, 0x7c, 0x6c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0xd8, 0xd8, 0x78, 0x18, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x18, 0x30, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x36, 0x6c, 0xd8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x18, 0x30, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x18, 0x18, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x30, 0x30, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x18, 0x0c, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x30, 0x60, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x70, 0xd8, 0x18, 0x30, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x70, 0xd8, 0xc0, 0x60, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x18, 0x70, 0xc0, 0x70, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xc0, 0x70, 0x18, 0x70, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x20, 0x20, 0x70, 0x70, 0xd8, 0xd8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0xd8, 0xd8, 0x70, 0x70, 0x20, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x10, 0x38, 0x6c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x6c, 0x38, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x0c, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x60, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x0c, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x60, 0x00}, |
{0x00, 0x00, 0x6c, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x38, 0x6c, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x30, 0x1c, 0x00}, |
{0x00, 0x00, 0x76, 0xdc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x66, 0xcc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x6c, 0x6c, 0x6c, 0x48, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x60, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x0c, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x34, 0x58, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x70, 0x18, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x18, 0x30, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x18, 0x18, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x30, 0x30, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00}, |
{0xc0, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x03, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x30, 0x20, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x20, 0x60, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x34, 0x18, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x18, 0x18, 0x30, 0x00, 0x00, 0x00, 0x00}, |
{0x60, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x0c, 0x18, 0x00, 0x6c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x60, 0xc0, 0x10, 0x38, 0x6c, 0xc6, 0xc6, 0xfe, 0xc6, 0xc6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x60, 0xc0, 0x3e, 0x32, 0x30, 0x34, 0x3c, 0x34, 0x30, 0x30, 0x32, 0x3e, 0x00, 0x00, 0x00, 0x00}, |
{0x60, 0xc0, 0x33, 0x33, 0x33, 0x33, 0x3f, 0x33, 0x33, 0x33, 0x33, 0x33, 0x00, 0x00, 0x00, 0x00}, |
{0x60, 0xc0, 0x3c, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00}, |
{0x60, 0xc0, 0x3c, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x3c, 0x00, 0x00, 0x00, 0x00}, |
{0x60, 0xc0, 0x66, 0x66, 0x66, 0x66, 0x3c, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00}, |
{0x60, 0xc0, 0x3e, 0x63, 0x63, 0x63, 0x63, 0x63, 0x36, 0x36, 0x36, 0x77, 0x00, 0x00, 0x00, 0x00}, |
{0x0c, 0x18, 0x00, 0x6c, 0x00, 0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x0e, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x10, 0x38, 0x6c, 0xc6, 0xc6, 0xfe, 0xc6, 0xc6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xfc, 0x66, 0x66, 0x66, 0x7c, 0x66, 0x66, 0x66, 0x66, 0xfc, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xfe, 0x66, 0x62, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0xf0, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x10, 0x10, 0x38, 0x38, 0x6c, 0x6c, 0xc6, 0xc6, 0xc6, 0xfe, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xfe, 0x66, 0x62, 0x68, 0x78, 0x68, 0x60, 0x62, 0x66, 0xfe, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xfe, 0xc6, 0x86, 0x0c, 0x18, 0x30, 0x60, 0xc2, 0xc6, 0xfe, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0xfe, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xfe, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x3c, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xe6, 0x66, 0x66, 0x6c, 0x78, 0x78, 0x6c, 0x66, 0x66, 0xe6, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x10, 0x10, 0x38, 0x38, 0x6c, 0x6c, 0xc6, 0xc6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xc6, 0xee, 0xfe, 0xfe, 0xd6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xc6, 0xe6, 0xf6, 0xfe, 0xde, 0xce, 0xc6, 0xc6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xfe, 0xc6, 0x82, 0x44, 0x7c, 0x44, 0x00, 0x82, 0xc6, 0xfe, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xfe, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xfc, 0x66, 0x66, 0x66, 0x7c, 0x60, 0x60, 0x60, 0x60, 0xf0, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xfe, 0xc6, 0x62, 0x30, 0x18, 0x18, 0x30, 0x62, 0xc6, 0xfe, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x7e, 0x7e, 0x5a, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x66, 0x66, 0x66, 0x66, 0x3c, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x10, 0x7c, 0xd6, 0xd6, 0xd6, 0xd6, 0xd6, 0x7c, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xc6, 0xc6, 0x6c, 0x7c, 0x38, 0x38, 0x7c, 0x6c, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x10, 0x92, 0xd6, 0xd6, 0xd6, 0xd6, 0xd6, 0x7c, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x6c, 0x6c, 0x6c, 0xee, 0x00, 0x00, 0x00, 0x00}, |
{0x66, 0x66, 0x00, 0x3c, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00}, |
{0x66, 0x66, 0x00, 0x66, 0x66, 0x66, 0x3c, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x0c, 0x18, 0x00, 0x76, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x0c, 0x18, 0x00, 0x7c, 0xc6, 0xc0, 0x78, 0xc0, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x0c, 0x18, 0x00, 0xdc, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x06, 0x06, 0x06, 0x00}, |
{0x00, 0x00, 0x0c, 0x18, 0x00, 0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x0e, 0x00, 0x00, 0x00, 0x00}, |
{0x0c, 0x18, 0x00, 0x6c, 0x00, 0xcc, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x3c, 0x66, 0x66, 0x66, 0x6c, 0x66, 0x66, 0x66, 0x66, 0x6c, 0x60, 0x60, 0x60, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0xc6, 0x46, 0x6c, 0x2c, 0x2c, 0x38, 0x18, 0x18, 0x18, 0x18, 0x00}, |
{0x00, 0x00, 0x3c, 0x66, 0x30, 0x18, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, 0xc0, 0x78, 0xc0, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x46, 0x7c, 0x18, 0x30, 0x60, 0x60, 0xc0, 0xc0, 0xc0, 0x7c, 0x06, 0x06, 0x1c, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0xdc, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x06, 0x06, 0x06, 0x00}, |
{0x00, 0x00, 0x3c, 0x66, 0x66, 0x66, 0x7e, 0x66, 0x66, 0x66, 0x66, 0x3c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x0e, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0xe6, 0x6c, 0x78, 0x78, 0x6c, 0x66, 0xe6, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xc0, 0x20, 0x30, 0x10, 0x38, 0x38, 0x6c, 0x64, 0xc6, 0xc2, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xf6, 0xc0, 0xc0, 0xc0, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0xc6, 0xc6, 0x66, 0x6c, 0x3c, 0x38, 0x10, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x66, 0x3c, 0x30, 0x60, 0x3c, 0x60, 0xc0, 0xc0, 0xc0, 0x7c, 0x06, 0x06, 0x1c, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x6c, 0x6c, 0x6c, 0x6c, 0x6c, 0x66, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x66, 0x66, 0x66, 0x66, 0x66, 0x7c, 0x60, 0x60, 0x60, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, 0xc0, 0xc0, 0xc0, 0x7c, 0x06, 0x06, 0x1c, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x78, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x18, 0x18, 0x18, 0x18, 0x18, 0x0e, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0xcc, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x6c, 0xd6, 0xd6, 0xd6, 0xd6, 0xd6, 0x7c, 0x10, 0x10, 0x10, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x86, 0x46, 0x2c, 0x2c, 0x18, 0x30, 0x68, 0x68, 0xc4, 0xc2, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x92, 0xd6, 0xd6, 0xd6, 0xd6, 0xd6, 0x7c, 0x10, 0x10, 0x10, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x6c, 0xc6, 0xd6, 0xd6, 0xd6, 0xd6, 0x6c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x66, 0x66, 0x00, 0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x0e, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x6c, 0x6c, 0x00, 0xcc, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x0c, 0x18, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x0c, 0x18, 0x00, 0xcc, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x0c, 0x18, 0x00, 0x6c, 0xc6, 0xd6, 0xd6, 0xd6, 0xd6, 0x6c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x3c, 0x66, 0x66, 0x6c, 0x7c, 0x66, 0x66, 0x66, 0x66, 0x3c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x3c, 0x66, 0x66, 0x36, 0x1e, 0xc6, 0x66, 0x66, 0x66, 0x3c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xc2, 0x65, 0x24, 0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00}, |
{0x60, 0xc0, 0x21, 0x32, 0x12, 0x1c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x1e, 0x00, 0x00, 0x00, 0x00}, |
{0x6c, 0x6c, 0x00, 0xc2, 0x65, 0x24, 0x38, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x10, 0x10, 0x10, 0x7c, 0xd6, 0xd6, 0xd6, 0xd6, 0xd6, 0x7c, 0x10, 0x10, 0x10, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x6c, 0xc6, 0xd6, 0xd6, 0xd6, 0x6c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0xa6, 0x2c, 0x38, 0x68, 0xca, 0xc4, 0x0c, 0x18, 0x00, 0x00}, |
{0x00, 0x00, 0x3c, 0x66, 0xc2, 0xc0, 0xc0, 0xc0, 0xc0, 0x60, 0x3c, 0x06, 0x06, 0x1c, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0x7c, 0x06, 0x06, 0x1c, 0x00}, |
{0x00, 0x00, 0xfe, 0x66, 0x62, 0x60, 0x78, 0x68, 0x60, 0x60, 0x60, 0xf0, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x32, 0x30, 0x30, 0x3c, 0x34, 0x30, 0x30, 0x30, 0x30, 0x00}, |
{0x00, 0x60, 0x30, 0x30, 0x60, 0x63, 0xff, 0xc6, 0x06, 0x0c, 0x0c, 0x06, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x30, 0x30, 0x60, 0x60, 0xfe, 0xfe, 0x0c, 0x0c, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x78, 0xac, 0x26, 0x26, 0x0b, 0x0b, 0x1b, 0x1b, 0x1b, 0x1b, 0x03, 0x02, 0x04, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0xc0, 0x60, 0x30, 0x18, 0x28, 0x4c, 0x14, 0x24, 0x06, 0x02, 0x02, 0x00}, |
{0x00, 0x00, 0xdb, 0xdb, 0xdb, 0xdb, 0xdb, 0xdb, 0xdb, 0xdb, 0xdb, 0x6d, 0x03, 0x3e, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0xdb, 0xdb, 0xdb, 0xdb, 0xdb, 0xdb, 0x6d, 0x03, 0x7e, 0x00, 0x00}, |
{0x00, 0x00, 0x76, 0xd6, 0xc6, 0xc6, 0xc6, 0x7e, 0x06, 0x06, 0x06, 0x06, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x36, 0x66, 0x66, 0x66, 0x66, 0x3e, 0x06, 0x06, 0x06, 0x06, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xc0, 0xc0, 0xc0, 0xc0, 0xfc, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x06, 0x76, 0x9c, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x08, 0x7c, 0xd6, 0x66, 0x06, 0x06, 0x66, 0xbc, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x7c, 0xc6, 0xc6, 0x06, 0x3c, 0x60, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x3c, 0x66, 0x66, 0x26, 0x1c, 0x70, 0xc0, 0xc2, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xc6, 0x68, 0x38, 0x30, 0x38, 0x38, 0x4c, 0x4c, 0x86, 0xfe, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x64, 0xba, 0x30, 0x38, 0x28, 0x4c, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x7e, 0xc0, 0xcc, 0xd6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0xc0, 0xdc, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x3c, 0x18, 0x7e, 0x99, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x18, 0x1c, 0x18, 0x7e, 0x58, 0x18, 0x18, 0x18, 0x38, 0x18, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0xa6, 0x2c, 0x38, 0x68, 0xca, 0xc4, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xfc, 0xc0, 0x60, 0x3c, 0x06, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, 0xc0, 0xc0, 0xc0, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x06, 0x06, 0x00, 0x0e, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x66, 0x66, 0x3c, 0x00}, |
{0x30, 0x18, 0x00, 0xfe, 0x66, 0x62, 0x68, 0x78, 0x68, 0x62, 0x66, 0xfe, 0x00, 0x00, 0x00, 0x00}, |
{0x6c, 0x6c, 0x00, 0xfe, 0x66, 0x62, 0x68, 0x78, 0x68, 0x62, 0x66, 0xfe, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xfe, 0xb2, 0x30, 0x3e, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x03, 0x06, 0x00, 0x00}, |
{0x0c, 0x18, 0x00, 0xfe, 0x66, 0x62, 0x60, 0x60, 0x60, 0x60, 0x60, 0xf0, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x3c, 0x66, 0xc2, 0xc0, 0xf8, 0xc0, 0xc0, 0xc2, 0x66, 0x3c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x7c, 0xc6, 0xc6, 0x60, 0x38, 0x0c, 0x06, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x3c, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00}, |
{0x66, 0x66, 0x00, 0x3c, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x1e, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0xcc, 0xcc, 0xcc, 0x78, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x78, 0xd8, 0xd8, 0xd8, 0xde, 0xdb, 0xdb, 0xdb, 0xdb, 0xde, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xd8, 0xd8, 0xd8, 0xd8, 0xfe, 0xdb, 0xdb, 0xdb, 0xdb, 0xde, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xfe, 0xb2, 0x30, 0x3e, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x00, 0x00, 0x00, 0x00}, |
{0x0c, 0x18, 0x00, 0xe6, 0x66, 0x66, 0x6c, 0x78, 0x6c, 0x66, 0x66, 0xe6, 0x00, 0x00, 0x00, 0x00}, |
{0x30, 0x18, 0x00, 0xc6, 0xc6, 0xce, 0xde, 0xfe, 0xf6, 0xe6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00}, |
{0x6c, 0x38, 0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0x7e, 0x06, 0x06, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xfe, 0x38, 0x10, 0x10, 0x00}, |
{0x00, 0x00, 0x10, 0x38, 0x6c, 0xc6, 0xc6, 0xfe, 0xc6, 0xc6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xfe, 0x66, 0x62, 0x60, 0x7c, 0x66, 0x66, 0x66, 0x66, 0xfc, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xfc, 0x66, 0x66, 0x66, 0x7c, 0x66, 0x66, 0x66, 0x66, 0xfc, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xfe, 0x66, 0x62, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0xf0, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x3c, 0x6c, 0x6c, 0x6c, 0x6c, 0x6c, 0x6c, 0x6c, 0x6c, 0xfe, 0xc6, 0x82, 0x00, 0x00}, |
{0x00, 0x00, 0xfe, 0x66, 0x62, 0x68, 0x78, 0x68, 0x60, 0x62, 0x66, 0xfe, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xd6, 0xd6, 0xd6, 0x7c, 0x38, 0x7c, 0xd6, 0xd6, 0xd6, 0xd6, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x7c, 0xc6, 0x86, 0x06, 0x3c, 0x06, 0x06, 0x86, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xc6, 0xc6, 0xc6, 0xce, 0xde, 0xfe, 0xf6, 0xe6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00}, |
{0x6c, 0x38, 0xc6, 0xc6, 0xc6, 0xce, 0xde, 0xfe, 0xf6, 0xe6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xe6, 0x66, 0x66, 0x6c, 0x78, 0x78, 0x6c, 0x66, 0x66, 0xe6, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x3e, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0xc6, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xc6, 0xee, 0xfe, 0xfe, 0xd6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0xfe, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xfe, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xfc, 0x66, 0x66, 0x66, 0x7c, 0x60, 0x60, 0x60, 0x60, 0xf0, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x3c, 0x66, 0xc2, 0xc0, 0xc0, 0xc0, 0xc0, 0xc2, 0x66, 0x3c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x7e, 0x7e, 0x5a, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7e, 0x06, 0x06, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x10, 0x7c, 0xd6, 0xd6, 0xd6, 0xd6, 0xd6, 0x7c, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xc6, 0xc6, 0x6c, 0x7c, 0x38, 0x38, 0x7c, 0x6c, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xfe, 0x06, 0x02, 0x00, 0x00}, |
{0x00, 0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7e, 0x06, 0x06, 0x06, 0x06, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xc6, 0xd6, 0xd6, 0xd6, 0xd6, 0xd6, 0xd6, 0xd6, 0xd6, 0xfe, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xc6, 0xd6, 0xd6, 0xd6, 0xd6, 0xd6, 0xd6, 0xd6, 0xd6, 0xff, 0x03, 0x01, 0x00, 0x00}, |
{0x00, 0x00, 0xf8, 0xb0, 0xb0, 0x30, 0x3c, 0x36, 0x36, 0x36, 0x36, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xc3, 0xc3, 0xc3, 0xc3, 0xf3, 0xdb, 0xdb, 0xdb, 0xdb, 0xf3, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xf0, 0x60, 0x60, 0x60, 0x7c, 0x66, 0x66, 0x66, 0x66, 0xfc, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x78, 0xcc, 0x86, 0x06, 0x3e, 0x06, 0x06, 0x86, 0xcc, 0x78, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x9c, 0xb6, 0xb6, 0xb6, 0xf6, 0xb6, 0xb6, 0xb6, 0xb6, 0x9c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x7e, 0xcc, 0xcc, 0xcc, 0x7c, 0x6c, 0x6c, 0x6c, 0x6c, 0xce, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x0c, 0x7c, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x06, 0x7c, 0xc0, 0xc0, 0xfc, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x66, 0x66, 0x7c, 0x66, 0x66, 0xfc, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x66, 0x62, 0x60, 0x60, 0x60, 0xf0, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x6c, 0x6c, 0x6c, 0x6c, 0x6c, 0xfe, 0xc6, 0x82, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, 0xfe, 0xc0, 0xc0, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0xd6, 0xd6, 0xd6, 0x7c, 0xd6, 0xd6, 0xd6, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, 0x06, 0x3c, 0x06, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0xc6, 0xce, 0xde, 0xfe, 0xf6, 0xe6, 0xc6, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x6c, 0x38, 0x00, 0xc6, 0xce, 0xde, 0xfe, 0xf6, 0xe6, 0xc6, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0xe6, 0x6c, 0x78, 0x78, 0x6c, 0x66, 0xe6, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x66, 0x66, 0x66, 0x66, 0x66, 0xc6, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0xc6, 0xee, 0xfe, 0xfe, 0xd6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0xc6, 0xc6, 0xc6, 0xfe, 0xc6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0xdc, 0x66, 0x66, 0x66, 0x66, 0x66, 0x7c, 0x60, 0x60, 0xf0, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, 0xc0, 0xc0, 0xc0, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x5a, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7e, 0x06, 0x0c, 0xf8, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x10, 0x7c, 0xd6, 0xd6, 0xd6, 0xd6, 0xd6, 0x7c, 0x10, 0x10, 0x10, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0xc6, 0x6c, 0x38, 0x38, 0x38, 0x6c, 0xc6, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xfe, 0x06, 0x02, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0xc6, 0xc6, 0xc6, 0x7e, 0x06, 0x06, 0x06, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0xc6, 0xd6, 0xd6, 0xd6, 0xd6, 0xd6, 0xfe, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0xc6, 0xd6, 0xd6, 0xd6, 0xd6, 0xd6, 0xff, 0x03, 0x01, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xb0, 0x30, 0x3c, 0x36, 0x36, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0xc3, 0xc3, 0xc3, 0xf3, 0xdb, 0xdb, 0xf3, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x60, 0x60, 0x7c, 0x66, 0x66, 0xfc, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, 0x06, 0x3e, 0x06, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x9c, 0xb6, 0xb6, 0xf6, 0xb6, 0xb6, 0x9c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0xcc, 0xcc, 0x7c, 0x6c, 0x6c, 0xce, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x60, 0x30, 0x00, 0x7c, 0xc6, 0xfe, 0xc0, 0xc0, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x6c, 0x6c, 0x00, 0x7c, 0xc6, 0xfe, 0xc0, 0xc0, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x60, 0xf8, 0x60, 0x6c, 0x76, 0x66, 0x66, 0x66, 0x66, 0xe6, 0x06, 0x06, 0x1c, 0x00}, |
{0x00, 0x00, 0x0c, 0x18, 0x00, 0xfe, 0x66, 0x62, 0x60, 0x60, 0x60, 0xf0, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, 0xc0, 0xf8, 0xc0, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, 0x60, 0x38, 0x0c, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x18, 0x18, 0x00, 0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x66, 0x66, 0x00, 0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x06, 0x06, 0x00, 0x0e, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x66, 0x66, 0x3c, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0xd8, 0xd8, 0xde, 0xdb, 0xdb, 0xde, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0xd8, 0xd8, 0xd8, 0xfe, 0xdb, 0xdb, 0xde, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x60, 0xf8, 0x60, 0x6c, 0x76, 0x66, 0x66, 0x66, 0x66, 0xe6, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x0c, 0x18, 0x00, 0xe6, 0x6c, 0x78, 0x78, 0x6c, 0x66, 0xe6, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x60, 0x30, 0x00, 0xc6, 0xce, 0xde, 0xfe, 0xf6, 0xe6, 0xc6, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x6c, 0x38, 0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7e, 0x06, 0x0c, 0xf8, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xfe, 0x38, 0x10, 0x10, 0x00}, |
{0x00, 0x00, 0x6c, 0xc6, 0xc6, 0xd6, 0xd6, 0xd6, 0xd6, 0xd6, 0xfe, 0x6c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x6c, 0xc6, 0xd6, 0xd6, 0xd6, 0xfe, 0x6c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x30, 0xfc, 0xb4, 0x30, 0x3c, 0x36, 0x36, 0x36, 0x36, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x30, 0x30, 0x30, 0xfc, 0xb4, 0x30, 0x3c, 0x36, 0x36, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xce, 0xdb, 0xd9, 0xd8, 0xfe, 0xd8, 0xd8, 0xd9, 0xdb, 0xce, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0xce, 0xdb, 0xd8, 0xfe, 0xd8, 0xdb, 0xce, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x10, 0x38, 0x38, 0x6c, 0x6c, 0x6c, 0xfe, 0xd6, 0xd6, 0xd6, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x38, 0x38, 0x6c, 0x7c, 0xd6, 0xd6, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x88, 0x8c, 0x9c, 0x96, 0xf6, 0xb6, 0xbf, 0xab, 0xeb, 0xeb, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x88, 0x8c, 0x9c, 0xf6, 0xbe, 0xab, 0xeb, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xfe, 0xc6, 0x6c, 0x6c, 0x38, 0x7c, 0xd6, 0xd6, 0xd6, 0xd6, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xc6, 0x6c, 0x7c, 0xd6, 0xd6, 0xd6, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xff, 0xa3, 0xb2, 0x96, 0xfc, 0x9c, 0xbe, 0xaa, 0xab, 0xeb, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0xbf, 0xa3, 0x96, 0xfe, 0xab, 0xab, 0xeb, 0x00, 0x00, 0x00, 0x00}, |
{0x6c, 0x38, 0x10, 0x7c, 0xc6, 0x06, 0x06, 0x7c, 0x06, 0x06, 0x06, 0x7c, 0xc0, 0x7c, 0x00, 0x00}, |
{0x00, 0x6c, 0x38, 0x10, 0x00, 0x7c, 0x86, 0x06, 0x7c, 0x06, 0x06, 0x7c, 0xc0, 0x7c, 0x00, 0x00}, |
{0x00, 0x00, 0x10, 0x96, 0xd6, 0xd6, 0xd6, 0xd6, 0xd6, 0x7c, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x10, 0x10, 0x10, 0x96, 0xd6, 0xd6, 0xd6, 0xd6, 0xd6, 0x7c, 0x10, 0x10, 0x10, 0x00}, |
{0x00, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xfe, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, 0xc6, 0xfe, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xc2, 0xc6, 0xc6, 0xc4, 0xcc, 0x6c, 0x68, 0x78, 0x38, 0x30, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0xc2, 0xc6, 0x64, 0x6c, 0x38, 0x38, 0x10, 0x00, 0x00, 0x00, 0x00}, |
{0xcc, 0x66, 0x00, 0xc2, 0xc6, 0xc4, 0xc4, 0x6c, 0x68, 0x78, 0x38, 0x30, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xcc, 0x66, 0x00, 0xc2, 0xc6, 0x64, 0x6c, 0x38, 0x38, 0x10, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x70, 0xd8, 0xd8, 0xdb, 0xdb, 0xdb, 0xdb, 0xdb, 0xdb, 0x6f, 0x03, 0x06, 0x1c, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x73, 0xdb, 0xdb, 0xdb, 0xdb, 0xdb, 0x6f, 0x03, 0x06, 0x1c, 0x00}, |
{0x00, 0x10, 0x7c, 0xd6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xd6, 0x7c, 0x10, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x10, 0x7c, 0xd6, 0xc6, 0xc6, 0xc6, 0xd6, 0x7c, 0x10, 0x00, 0x00, 0x00}, |
{0x04, 0x7c, 0x40, 0x6c, 0xc6, 0xc6, 0xd6, 0xd6, 0xd6, 0xd6, 0xfe, 0x6c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x04, 0x7c, 0x40, 0x00, 0x6c, 0xc6, 0xd6, 0xd6, 0xd6, 0xfe, 0x6c, 0x00, 0x00, 0x00, 0x00}, |
{0x7c, 0x54, 0x00, 0x6c, 0xc6, 0xc6, 0xd6, 0xd6, 0xd6, 0xd6, 0xfe, 0x6c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x7c, 0x54, 0x00, 0x6c, 0xc6, 0xd6, 0xd6, 0xd6, 0xfe, 0x6c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x3c, 0x66, 0xc2, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0x60, 0x3c, 0x0c, 0x0c, 0x0c, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, 0xc0, 0xc0, 0xc0, 0xc0, 0x78, 0x18, 0x18, 0x00, 0x00}, |
{0x00, 0x00, 0x06, 0x06, 0x3c, 0x0f, 0x18, 0x18, 0xf0, 0x3c, 0x60, 0x60, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x04, 0x7c, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x18, 0x24, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x40, 0x7c, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x04, 0x7c, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x18, 0x66, 0x00, 0xc3, 0x00, 0x66, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x08, 0x50, 0x46, 0x00, 0x82, 0x41, 0x00, 0x62, 0x0a, 0x10, 0x00, 0x00, 0x00, 0x00}, |
{0x6c, 0x38, 0xc6, 0xc6, 0xc6, 0xce, 0xde, 0xfe, 0xf6, 0xe6, 0xc6, 0xc7, 0x03, 0x01, 0x00, 0x00}, |
{0x00, 0x00, 0x6c, 0x38, 0x00, 0xc6, 0xce, 0xde, 0xfe, 0xf6, 0xe6, 0xc7, 0x03, 0x01, 0x00, 0x00}, |
{0x00, 0x60, 0xf0, 0x60, 0x60, 0x60, 0x7c, 0x66, 0x66, 0x66, 0x66, 0xfc, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x60, 0xf0, 0x60, 0x60, 0x7c, 0x66, 0x66, 0xfc, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xfc, 0x66, 0x6e, 0x64, 0x7a, 0x60, 0x60, 0x60, 0x60, 0xf0, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0xdc, 0x66, 0x66, 0x66, 0x6e, 0x64, 0x7a, 0x60, 0x60, 0xf0, 0x00}, |
{0x02, 0x06, 0xfe, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0xf0, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x02, 0x06, 0xfe, 0x60, 0x60, 0x60, 0x60, 0x60, 0xf0, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xfe, 0x66, 0x62, 0x60, 0xf8, 0x60, 0x60, 0x60, 0x60, 0xf0, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x66, 0x62, 0xf8, 0x60, 0x60, 0xf0, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xfe, 0x66, 0x62, 0x60, 0x7c, 0x66, 0x66, 0x66, 0x66, 0xf6, 0x06, 0x16, 0x0c, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x66, 0x62, 0x78, 0x6c, 0x66, 0xf6, 0x06, 0x16, 0x0c, 0x00}, |
{0x00, 0x00, 0xd6, 0xd6, 0xd6, 0x7c, 0x38, 0x7c, 0xd6, 0xd6, 0xd6, 0xd7, 0x03, 0x01, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0xd6, 0xd6, 0xd6, 0x7c, 0xd6, 0xd6, 0xd7, 0x03, 0x01, 0x00, 0x00}, |
{0x00, 0x00, 0x7c, 0xc6, 0x86, 0x06, 0x3c, 0x06, 0x06, 0x86, 0xc6, 0x7c, 0x30, 0x60, 0x38, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, 0x06, 0x3c, 0x06, 0xc6, 0x7c, 0x30, 0x60, 0x38, 0x00}, |
{0x00, 0x00, 0xe6, 0x66, 0x66, 0x6c, 0x78, 0x78, 0x6c, 0x66, 0x66, 0xe7, 0x03, 0x01, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0xe6, 0x6c, 0x78, 0x78, 0x6c, 0x66, 0xe7, 0x03, 0x01, 0x00, 0x00}, |
{0x00, 0x00, 0xc6, 0xd6, 0xd6, 0xdc, 0xf8, 0xdc, 0xd6, 0xd6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0xc6, 0xd6, 0xdc, 0xf8, 0xdc, 0xd6, 0xc6, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xe6, 0x66, 0xf6, 0x6c, 0x78, 0x78, 0x6c, 0x66, 0x66, 0xe6, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xe0, 0x60, 0xf0, 0x66, 0x6c, 0x78, 0x78, 0x6c, 0x66, 0xe6, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xf3, 0xb3, 0xb3, 0x36, 0x3c, 0x3c, 0x36, 0x33, 0x33, 0x73, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0xf3, 0xb6, 0xbc, 0x3c, 0x36, 0x33, 0x73, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0xfe, 0xc6, 0xc6, 0xc6, 0xc6, 0xc7, 0x03, 0x01, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0xc6, 0xc6, 0xc6, 0xfe, 0xc6, 0xc6, 0xc7, 0x03, 0x01, 0x00, 0x00}, |
{0x00, 0x00, 0xdf, 0xdb, 0xd9, 0xd8, 0xf8, 0xd8, 0xd8, 0xd8, 0xd8, 0xd8, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0xdf, 0xdb, 0xd9, 0xf8, 0xd8, 0xd8, 0xd8, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xf8, 0xd8, 0xd8, 0xd8, 0xde, 0xdb, 0xdb, 0xdb, 0xdb, 0xdb, 0x03, 0x0b, 0x06, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0xd8, 0xd8, 0xd8, 0xfe, 0xdb, 0xdb, 0xdb, 0x03, 0x0b, 0x06, 0x00}, |
{0x00, 0x00, 0x7c, 0xc2, 0xcc, 0xd6, 0xd6, 0xd6, 0xd6, 0xd6, 0xcc, 0x7a, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc2, 0xcc, 0xd6, 0xd6, 0xcc, 0x7a, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x3c, 0x66, 0xc2, 0xc0, 0xc0, 0xc0, 0xc0, 0xc2, 0x66, 0x3c, 0x18, 0x0c, 0x38, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, 0xc0, 0xc0, 0xc0, 0xc6, 0x7c, 0x18, 0x0c, 0x38, 0x00}, |
{0x00, 0x00, 0x7e, 0x7e, 0x5a, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x0c, 0x04, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x5a, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x0c, 0x04, 0x00, 0x00}, |
{0x00, 0x00, 0x66, 0x66, 0x66, 0x66, 0x3c, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x66, 0x66, 0x66, 0x66, 0x66, 0x3c, 0x18, 0x18, 0x18, 0x3c, 0x00}, |
{0x00, 0x00, 0x66, 0x66, 0x66, 0x66, 0x3c, 0x18, 0x7e, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x66, 0x66, 0x66, 0x66, 0x66, 0x3c, 0x18, 0x7e, 0x18, 0x3c, 0x00}, |
{0x00, 0x00, 0xc6, 0xc6, 0x6c, 0x7c, 0x38, 0x38, 0x7c, 0x6c, 0xc6, 0xc7, 0x03, 0x01, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0xc6, 0x6c, 0x38, 0x38, 0x38, 0x6c, 0xc7, 0x03, 0x01, 0x00, 0x00}, |
{0x00, 0x00, 0xf6, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x7f, 0x03, 0x01, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0xf6, 0x66, 0x66, 0x66, 0x66, 0x66, 0x7f, 0x03, 0x01, 0x00, 0x00}, |
{0x00, 0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7e, 0x06, 0x06, 0x06, 0x07, 0x03, 0x01, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0xc6, 0xc6, 0xc6, 0x7e, 0x06, 0x06, 0x07, 0x03, 0x01, 0x00, 0x00}, |
{0x00, 0x00, 0xc6, 0xc6, 0xc6, 0xd6, 0xd6, 0x7e, 0x16, 0x16, 0x06, 0x06, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0xc6, 0xd6, 0xd6, 0x7e, 0x16, 0x16, 0x06, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xc0, 0xc0, 0xc0, 0xc0, 0xfc, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0xc0, 0xfc, 0xc6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x1e, 0x33, 0xb3, 0xb3, 0x7f, 0x30, 0x30, 0x30, 0x33, 0x1e, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x9e, 0xb3, 0x7f, 0x30, 0x30, 0x33, 0x1e, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x1e, 0x33, 0xb3, 0xb3, 0x7f, 0x30, 0x30, 0x30, 0x33, 0x1e, 0x0c, 0x18, 0x0e, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x9e, 0xb3, 0x7f, 0x30, 0x30, 0x33, 0x1e, 0x0c, 0x18, 0x0e, 0x00}, |
{0x00, 0x00, 0x3c, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00}, |
{0x6c, 0x38, 0xd6, 0xd6, 0xd6, 0x7c, 0x38, 0x7c, 0xd6, 0xd6, 0xd6, 0xd6, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x6c, 0x38, 0x00, 0xd6, 0xd6, 0xd6, 0x7c, 0xd6, 0xd6, 0xd6, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xe6, 0x66, 0x66, 0x6c, 0x78, 0x78, 0x6c, 0x66, 0x66, 0xe6, 0x06, 0x16, 0x0c, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0xe6, 0x6c, 0x78, 0x78, 0x6c, 0x66, 0xe6, 0x06, 0x16, 0x0c, 0x00}, |
{0x00, 0x00, 0x3e, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0xc7, 0x03, 0x01, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x66, 0x66, 0x66, 0x66, 0x66, 0xc7, 0x03, 0x01, 0x00, 0x00}, |
{0x00, 0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0xfe, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x06, 0x16, 0x0c, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0xc6, 0xc6, 0xc6, 0xfe, 0xc6, 0xc6, 0xc6, 0x06, 0x16, 0x0c, 0x00}, |
{0x00, 0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0xfe, 0xc6, 0xc6, 0xc6, 0xc6, 0xc7, 0x03, 0x01, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0xc6, 0xc6, 0xc6, 0xfe, 0xc6, 0xc6, 0xc7, 0x03, 0x01, 0x00, 0x00}, |
{0x00, 0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7e, 0x06, 0x06, 0x06, 0x0e, 0x0c, 0x08, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0xc6, 0xc6, 0xc6, 0x7e, 0x06, 0x06, 0x0e, 0x0c, 0x08, 0x00, 0x00}, |
{0x00, 0x00, 0xc6, 0xee, 0xfe, 0xfe, 0xd6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc7, 0x03, 0x01, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0xc6, 0xee, 0xfe, 0xfe, 0xd6, 0xc6, 0xc7, 0x03, 0x01, 0x00, 0x00}, |
{0x6c, 0x38, 0x00, 0x10, 0x38, 0x6c, 0xc6, 0xc6, 0xfe, 0xc6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x6c, 0x38, 0x00, 0x78, 0x0c, 0x7c, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00}, |
{0x6c, 0x6c, 0x00, 0x10, 0x38, 0x6c, 0xc6, 0xc6, 0xfe, 0xc6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x6c, 0x6c, 0x00, 0x78, 0x0c, 0x7c, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x3e, 0x6c, 0xcc, 0xcc, 0xfe, 0xcc, 0xcc, 0xcc, 0xcc, 0xce, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0xcc, 0x76, 0x36, 0x7e, 0xd8, 0xd8, 0x6e, 0x00, 0x00, 0x00, 0x00}, |
{0x6c, 0x38, 0x00, 0xfe, 0x66, 0x62, 0x68, 0x78, 0x68, 0x62, 0x66, 0xfe, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x6c, 0x38, 0x00, 0x7c, 0xc6, 0xfe, 0xc0, 0xc0, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x7c, 0xc6, 0x06, 0x06, 0x06, 0xfe, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, 0x06, 0x06, 0xfe, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x6c, 0x6c, 0x00, 0x7c, 0xc6, 0x06, 0x06, 0xfe, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x6c, 0x6c, 0x00, 0x7c, 0xc6, 0x06, 0x06, 0xfe, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x6c, 0x6c, 0x00, 0xd6, 0xd6, 0xd6, 0x7c, 0x38, 0x7c, 0xd6, 0xd6, 0xd6, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x6c, 0x6c, 0x00, 0xd6, 0xd6, 0xd6, 0x7c, 0xd6, 0xd6, 0xd6, 0x00, 0x00, 0x00, 0x00}, |
{0x6c, 0x6c, 0x00, 0x7c, 0xc6, 0x86, 0x06, 0x3c, 0x06, 0x86, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x6c, 0x6c, 0x00, 0x7c, 0xc6, 0x06, 0x3c, 0x06, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xfe, 0x06, 0x0c, 0x18, 0x3c, 0x06, 0x06, 0x86, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x06, 0x0c, 0x18, 0x3c, 0x06, 0x06, 0x06, 0xc6, 0x7c, 0x00}, |
{0x00, 0x7c, 0x00, 0xc6, 0xc6, 0xce, 0xde, 0xfe, 0xf6, 0xe6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x7c, 0x00, 0xc6, 0xce, 0xde, 0xfe, 0xf6, 0xe6, 0xc6, 0x00, 0x00, 0x00, 0x00}, |
{0x6c, 0x6c, 0x00, 0xc6, 0xc6, 0xce, 0xde, 0xfe, 0xf6, 0xe6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x6c, 0x6c, 0x00, 0xc6, 0xce, 0xde, 0xfe, 0xf6, 0xe6, 0xc6, 0x00, 0x00, 0x00, 0x00}, |
{0x6c, 0x6c, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x6c, 0x6c, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xfe, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, 0xc6, 0xfe, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x6c, 0x6c, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xfe, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x6c, 0x6c, 0x00, 0x7c, 0xc6, 0xc6, 0xfe, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x6c, 0x6c, 0x00, 0x78, 0xcc, 0x86, 0x06, 0x3e, 0x06, 0x86, 0xcc, 0x78, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x6c, 0x6c, 0x00, 0x7c, 0xc6, 0x06, 0x3e, 0x06, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x7c, 0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0x7e, 0x06, 0x06, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x7c, 0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7e, 0x06, 0x0c, 0xf8, 0x00}, |
{0x6c, 0x6c, 0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0x7e, 0x06, 0x06, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x6c, 0x6c, 0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7e, 0x06, 0x0c, 0xf8, 0x00}, |
{0x66, 0xcc, 0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0x7e, 0x06, 0x06, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x66, 0xcc, 0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7e, 0x06, 0x0c, 0xf8, 0x00}, |
{0x6c, 0x6c, 0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0x7e, 0x06, 0x06, 0x06, 0x06, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x6c, 0x6c, 0x00, 0xc6, 0xc6, 0xc6, 0x7e, 0x06, 0x06, 0x06, 0x00, 0x00, 0x00, 0x00}, |
{0x6c, 0x6c, 0x00, 0xc3, 0xc3, 0xc3, 0xf3, 0xdb, 0xdb, 0xdb, 0xdb, 0xf3, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x6c, 0x6c, 0x00, 0xc3, 0xc3, 0xc3, 0xf3, 0xdb, 0xdb, 0xf3, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x1e, 0x0c, 0x0c, 0x0c, 0x7c, 0xcc, 0xcc, 0xcc, 0xcc, 0x7e, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x1c, 0x0c, 0x0c, 0x3c, 0x6c, 0xcc, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x1e, 0x0c, 0x0c, 0x0c, 0x7c, 0xcd, 0xcd, 0xcd, 0xcd, 0x76, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x1c, 0x0c, 0x0c, 0x3c, 0x6c, 0xcc, 0xcd, 0xcd, 0xcd, 0x76, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x78, 0xcc, 0x8c, 0x0c, 0x38, 0x0d, 0x0d, 0x0d, 0x0d, 0x06, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0xcc, 0x0c, 0x39, 0x0d, 0x0d, 0x06, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x7c, 0xc6, 0x86, 0x06, 0x3c, 0x06, 0x06, 0x06, 0x06, 0x07, 0x03, 0x01, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, 0x06, 0x3c, 0x06, 0x06, 0x07, 0x03, 0x01, 0x00, 0x00}, |
{0x00, 0x00, 0x3c, 0x6c, 0x6c, 0x6c, 0x6c, 0x6d, 0x6d, 0x6d, 0x6d, 0xc6, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x6c, 0x6c, 0x6d, 0x6d, 0x6d, 0xc6, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xcc, 0xcc, 0xcc, 0xcc, 0xfc, 0xcd, 0xcd, 0xcd, 0xcd, 0xc6, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0xcc, 0xcc, 0xcc, 0xfd, 0xcd, 0xcd, 0xc6, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x3c, 0x66, 0xc2, 0xc0, 0xc0, 0xce, 0xc6, 0xc6, 0x66, 0x3c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, 0xc0, 0xce, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x7e, 0x7e, 0x5a, 0x18, 0x18, 0x1b, 0x1b, 0x1b, 0x1b, 0x0e, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x5a, 0x18, 0x1b, 0x1b, 0x1b, 0x0e, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x18, 0x64, 0x94, 0xba, 0x52, 0x4c, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcf, 0x7b, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x3c, 0x66, 0x66, 0x66, 0x66, 0x60, 0x60, 0x7e, 0x60, 0x60, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x78, 0xcc, 0xcc, 0xcc, 0xcc, 0x7f, 0x0c, 0x0c, 0x0c, 0x0c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x78, 0xcc, 0xcc, 0xcc, 0xcc, 0xcf, 0x0c, 0x0c, 0x0c, 0x0c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x60, 0x7e, 0x60, 0x60, 0x66, 0x66, 0x66, 0x66, 0x66, 0x3c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x3c, 0x66, 0x66, 0x66, 0x66, 0x3e, 0x06, 0x0c, 0xd8, 0xfe, 0xc3, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x60, 0x60, 0x7e, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x7c, 0x06, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x3c, 0x66, 0x66, 0x66, 0x66, 0x66, 0x60, 0x60, 0x60, 0x7e, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x7c, 0xc6, 0xcf, 0xd6, 0xd6, 0xd6, 0xd6, 0xcc, 0xc0, 0xc0, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x0c, 0x0c, 0x0c, 0x0c, 0x7f, 0xcc, 0xcc, 0xcc, 0xcc, 0x78, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x60, 0x60, 0x7c, 0x66, 0x66, 0x66, 0x66, 0x66, 0x60, 0x60, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x7c, 0x06, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xc0, 0xc0, 0xf6, 0xd6, 0xd6, 0xd6, 0xd6, 0xcc, 0xc0, 0xc0, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xc0, 0x7f, 0x24, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x3c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x60, 0x60, 0x66, 0x66, 0x66, 0x66, 0x66, 0x3e, 0x06, 0x06, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x18, 0x30, 0x18, 0x0c, 0x18, 0x30, 0x60, 0xf0, 0x3c, 0x0e, 0x04, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x3c, 0x66, 0x66, 0x66, 0x06, 0x06, 0x06, 0x6c, 0xd8, 0x6e, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x78, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x0c, 0x0c, 0x0c, 0x0f, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x1e, 0x30, 0x60, 0xf8, 0x6c, 0x66, 0x66, 0x66, 0x66, 0x7e, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xcf, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x78, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x3c, 0x66, 0x06, 0x06, 0x7c, 0x06, 0x06, 0x66, 0x66, 0x3c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xe0, 0x60, 0x60, 0x60, 0x66, 0x66, 0x66, 0x66, 0x66, 0x3c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x3c, 0x06, 0x3e, 0x66, 0x60, 0x60, 0x60, 0x66, 0x66, 0x3c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x3c, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x3c, 0x66, 0x66, 0x66, 0x06, 0x06, 0x06, 0x6c, 0x38, 0x0e, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x7c, 0xd6, 0xd6, 0xd6, 0xd6, 0xd6, 0x16, 0x16, 0x06, 0x06, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x3c, 0x66, 0x66, 0x66, 0x76, 0x1e, 0x0e, 0x0c, 0xd8, 0xfe, 0xc3, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x78, 0xcc, 0xcc, 0xcc, 0xcc, 0xcf, 0xcc, 0xcc, 0xcc, 0xcc, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x3c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x0c, 0x0c, 0xcc, 0xcc, 0xcc, 0xcc, 0x7c, 0x0c, 0x0c, 0x0f, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x7c, 0xc6, 0xc6, 0x60, 0x30, 0x18, 0x0c, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x3c, 0x66, 0x66, 0x66, 0x66, 0x66, 0x60, 0x60, 0x60, 0x60, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x3c, 0x66, 0x66, 0x66, 0x3c, 0x66, 0x06, 0x06, 0x66, 0x3c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x60, 0x60, 0x7c, 0x66, 0x66, 0x66, 0x66, 0x63, 0x60, 0x60, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x10, 0x7c, 0xd6, 0xd6, 0xd6, 0xd6, 0xd6, 0xd6, 0x7c, 0x10, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x3c, 0x66, 0x66, 0x66, 0x7c, 0x60, 0x60, 0xfe, 0x60, 0x60, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x3c, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x3c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x70, 0xd0, 0xd0, 0xd0, 0x7c, 0x16, 0x16, 0x16, 0xd6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x18, 0x30, 0x30, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x30, 0x18, 0x18, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x18, 0x30, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x06, 0x3c, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x30, 0x18, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x1c, 0x36, 0x6c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x70, 0x60, 0x3e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0xd6, 0xd6, 0xd6, 0xd6, 0xd6, 0xd6, 0x6a, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0x66, 0x66, 0x66, 0x60, 0x60, 0x7e, 0x60, 0x60, 0x60, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x7f, 0x0c, 0x0c, 0x0c, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcf, 0x0c, 0x0c, 0x0c, 0x00}, |
{0x00, 0x00, 0x60, 0x60, 0x7e, 0x60, 0x60, 0x66, 0x66, 0x66, 0x66, 0x3e, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x7c, 0x0c, 0x0c, 0x0f, 0x00}, |
{0x00, 0x00, 0x60, 0x60, 0x60, 0x7c, 0x60, 0x60, 0x60, 0x60, 0x60, 0x78, 0x0c, 0x18, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x60, 0x60, 0x7e, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xc6, 0xc6, 0xcf, 0xd6, 0xd6, 0xcc, 0xc0, 0xc0, 0xc0, 0x00}, |
{0x00, 0x00, 0x0c, 0x0c, 0x0c, 0x7f, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x60, 0x60, 0x60, 0x7c, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x60, 0x60, 0x60, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x3e, 0x00}, |
{0x00, 0x00, 0xc0, 0xc0, 0xc0, 0xf6, 0xd6, 0xd6, 0xd6, 0xd6, 0xd6, 0xca, 0xc0, 0xc0, 0xc0, 0x00}, |
{0x00, 0x00, 0x60, 0x38, 0x0c, 0x7f, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x78, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x60, 0x60, 0x60, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x3e, 0x06, 0x06, 0x06, 0x00}, |
{0x00, 0x00, 0x60, 0x60, 0x60, 0x7c, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x30, 0x1c, 0x0c, 0x18, 0x3c, 0x64, 0x66, 0x62, 0x63, 0x3d, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x0c, 0x0c, 0x0f, 0x00}, |
{0x00, 0x00, 0x0e, 0x18, 0x30, 0xf8, 0x6c, 0x66, 0x66, 0x66, 0x66, 0x3e, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x0f, 0x0c, 0x0c, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x6c, 0x38, 0x00}, |
{0x00, 0x00, 0xe0, 0x60, 0x60, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x3e, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x66, 0x66, 0x66, 0x06, 0x0c, 0x18, 0x30, 0x60, 0x3e, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x18, 0x18, 0x0c, 0x06, 0x0c, 0x18, 0x30, 0x60, 0x3e, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0xd6, 0xd6, 0xd6, 0xd6, 0xd6, 0xd6, 0x7e, 0x06, 0x06, 0x06, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x66, 0x66, 0x66, 0x76, 0x1c, 0x18, 0x30, 0x60, 0x3e, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcf, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x3e, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x0c, 0x0c, 0x0c, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x7c, 0x0c, 0x0c, 0x0f, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0xdc, 0xd6, 0xd6, 0xd6, 0xd6, 0xd6, 0x76, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x60, 0x60, 0x60, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x66, 0x66, 0x66, 0x66, 0x66, 0x3e, 0x06, 0x66, 0x3c, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x3e, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x10, 0x10, 0x10, 0xdc, 0xd6, 0xd6, 0xd6, 0xd6, 0xd6, 0x76, 0x10, 0x10, 0x10, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0x66, 0x66, 0x66, 0x66, 0x7c, 0x60, 0xfe, 0x60, 0x60, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x66, 0x66, 0x66, 0x66, 0x66, 0x3c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x70, 0xd0, 0xd0, 0x7c, 0x16, 0x16, 0x16, 0x16, 0xd6, 0x7c, 0x10, 0x10, 0x10, 0x00}, |
{0x00, 0x00, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xcc, 0xcc, 0xcc, 0xcc, 0x77, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x10, 0x38, 0x6c}, |
{0x18, 0x00, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x08, 0x38, 0x10, 0x38, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x18, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x6c, 0x60, 0x6c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x18, 0x0c, 0x00}, |
{0x10, 0x38, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x74, 0xd6, 0x5c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0xc0, 0x60, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x06, 0x03, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x18, 0x30, 0x00}, |
{0x0c, 0x18, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x03, 0x06, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x1b, 0x36, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x44, 0xaa, 0x6c, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x04, 0x0a, 0x0c, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x40, 0x50, 0xe0, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x0c, 0x3c, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x30, 0x18, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x30, 0x60, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x24, 0x6c, 0xd8, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x30, 0x08, 0x30}, |
{0x60, 0x30, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x40, 0xa0, 0x60, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6c, 0x38, 0x10, 0x10}, |
{0x18, 0x30, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x0c, 0x0c, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x06, 0x03, 0x00}, |
{0x48, 0xa8, 0x90, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x38, 0x6c, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x18, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xdb, 0x00, 0x33, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf6, 0x00, 0x06, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf6, 0x60, 0x66, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x66, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x66, 0x00, 0x18, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x18, 0x18}, |
{0x00, 0x60, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x18, 0x03, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18}, |
{0x00, 0x00, 0x00, 0x7e, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x06, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0xc0, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0xc6, 0xc6, 0x66, 0x76, 0xdc, 0xcc, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0xf8, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0xfe, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x38, 0x0c, 0x0c, 0x0c, 0x0c, 0x1c, 0x36, 0xe6, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0xfe, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0xfc, 0x06, 0x06, 0x06, 0xc6, 0xc6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x70, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x7e, 0x18, 0x18, 0x18, 0x0c, 0x0c, 0x18, 0x30, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0xfc, 0x66, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0xcc, 0xd6, 0xd6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x70, 0x18, 0x18, 0x18, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0xfc, 0x06, 0x06, 0x06, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0e, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0xfc, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0xfc, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xc0, 0xc0, 0xfc, 0x06, 0x06, 0x06, 0x06, 0x0c, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0xfc, 0x66, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xfe, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0xdc, 0x76, 0x66, 0xc6, 0xc6, 0xc6, 0xc6, 0xde, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x38, 0x0c, 0x0c, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x1c, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x38, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0xfc, 0x66, 0xc6, 0xc6, 0xc6, 0xc6, 0xcc, 0x78, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0xee, 0x66, 0x66, 0x66, 0x66, 0x66, 0x2c, 0xf8, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0xf8, 0x4c, 0xcc, 0xcc, 0xec, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0e, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0xfc, 0x46, 0xc6, 0xc6, 0xe6, 0x06, 0x06, 0xfe, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0xee, 0x66, 0x66, 0x6c, 0x78, 0x60, 0x60, 0x60, 0x60, 0x60, 0x70, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0xee, 0x66, 0x66, 0x34, 0x18, 0x0c, 0x06, 0xfe, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0xfc, 0x06, 0x06, 0x66, 0x64, 0x6c, 0x6e, 0x60, 0x60, 0x60, 0x60, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0xfc, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0xd6, 0xd6, 0xd6, 0xd6, 0xd6, 0xf6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0xfc, 0x66, 0x66, 0x66, 0x66, 0x66, 0xe6, 0xe6, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0xcc, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0xcc, 0x66, 0x66, 0x66, 0xc6, 0x06, 0x06, 0x06, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0xcc, 0x66, 0x66, 0x66, 0xcc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x0c, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x66, 0xcc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x10, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x0c, 0x18, 0x18, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x1c, 0x22, 0x20, 0x10, 0x08, 0x08, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x18, 0x24, 0x20, 0x1e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x02, 0x3c, 0x40, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x18, 0x20, 0x1c, 0x20, 0x08, 0x08, 0x08, 0x08, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x1c, 0x20, 0x1c, 0x20, 0x0c, 0x12, 0x0e, 0x02, 0x04, 0x18, 0x60, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x00, 0x18, 0x20, 0x1c, 0x20, 0x00, 0x00}, |
{0x00, 0x30, 0x40, 0x38, 0x40, 0x07, 0x08, 0x88, 0x86, 0x81, 0x82, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x81, 0x81, 0x7e, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x28, 0x00, 0x00, 0x18, 0x24, 0x22, 0x22, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x14, 0x40, 0x81, 0x81, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x08, 0x00, 0x14, 0x00, 0x40, 0x81, 0x81, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x70, 0x8f, 0x30, 0x40, 0x80, 0x88, 0x80, 0x41, 0x3e, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x70, 0x8f, 0x30, 0x40, 0x80, 0x80, 0x80, 0x41, 0x3e, 0x00, 0x00, 0x00}, |
{0x00, 0x20, 0x00, 0x00, 0x70, 0x8f, 0x30, 0x40, 0x80, 0x80, 0x80, 0x41, 0x3e, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x08, 0x04, 0x02, 0x42, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x10, 0x00, 0x08, 0x04, 0x02, 0x42, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x02, 0x02, 0x04, 0x18, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x08, 0x00, 0x00, 0x04, 0x02, 0x02, 0x04, 0x18, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x15, 0x88, 0x84, 0x84, 0x78, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x08, 0x00, 0x14, 0x00, 0x01, 0x15, 0x88, 0x84, 0x84, 0x78, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x06, 0x09, 0x31, 0x9e, 0x88, 0x88, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x04, 0x00, 0x06, 0x09, 0x31, 0x9e, 0x88, 0x88, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x20, 0x20, 0x20, 0x2c, 0x32, 0xa2, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x24, 0x20, 0x20, 0x2c, 0x32, 0xa2, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x70, 0x80, 0x8c, 0x70, 0x40, 0x80, 0x80, 0x80, 0x41, 0x3e, 0x00, 0x00}, |
{0x00, 0x40, 0x00, 0x00, 0x70, 0x80, 0x8c, 0x70, 0x40, 0x80, 0x80, 0x80, 0x41, 0x3e, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x04, 0x00, 0x06, 0x49, 0x85, 0x83, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x0a, 0x00, 0x06, 0x09, 0x09, 0x47, 0x81, 0x81, 0x81, 0x42, 0x3c, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x19, 0x21, 0x19, 0x21, 0x01, 0x81, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0x42, 0x82, 0x82, 0x84, 0x78, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x0c, 0x12, 0x12, 0x3c, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x00, 0x00}, |
{0x00, 0x00, 0x08, 0x00, 0x00, 0x41, 0x81, 0x81, 0x81, 0x42, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x40, 0x30, 0x4e, 0x49, 0x39, 0xe6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x12, 0x0e, 0x02, 0x04, 0x18, 0x60, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x08, 0x88, 0x86, 0x81, 0x81, 0x7e, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x08, 0x88, 0x86, 0x81, 0x81, 0x7e, 0x00, 0x00, 0x24, 0x00}, |
{0x0c, 0x30, 0x0c, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x0c, 0x12, 0xca, 0x2c, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x30, 0x0c, 0x30, 0x00, 0x00}, |
{0x0c, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x08, 0x14, 0x0c, 0x08, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x30, 0x00, 0x00}, |
{0x0a, 0x2a, 0x2c, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x18, 0x24, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x01, 0x7e, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x0c, 0x10, 0x0c, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x10, 0x0c, 0x10}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x78, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x20, 0x70, 0x70, 0x38, 0x18, 0x18, 0x08, 0x08, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x44, 0xfc, 0xf8, 0x60, 0x30, 0x30, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x4a, 0xfe, 0xf4, 0x60, 0x30, 0x30, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x10, 0x20, 0x40, 0x30, 0x10, 0x20, 0x42, 0x7c, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x10, 0x38, 0x2c, 0x44, 0x42, 0x82, 0x82, 0xfe, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x80, 0xf8, 0x78, 0x08, 0x08, 0x08, 0x0c, 0x0e, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x82, 0xc6, 0xc6, 0x6c, 0x28, 0x38, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x10, 0x10, 0x10, 0x38, 0x28, 0x6c, 0xc6, 0xc6, 0x82, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x70, 0xf8, 0x88, 0xf8, 0x78, 0x08, 0x0c, 0x0e, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x60, 0x91, 0x92, 0x64, 0x08, 0x10, 0x26, 0x49, 0x89, 0x06, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x30, 0x30, 0x60, 0x60, 0x00, 0x00}, |
{0x00, 0x10, 0x38, 0x18, 0x10, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x10, 0x10, 0x38, 0xfe, 0x7c, 0x38, 0x6c, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x10, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x06, 0x29, 0x5e, 0x00, 0x04, 0x04, 0x04, 0x04, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x06, 0x28, 0x5e, 0x00, 0x04, 0x04, 0x04, 0x04, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x00, 0x06, 0x28, 0x5e, 0x00, 0x00, 0x00}, |
{0x00, 0x07, 0x08, 0x07, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x03, 0x04, 0x03, 0x14, 0x10, 0x10, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x03, 0x04, 0x03, 0x04, 0x00, 0x0c, 0x12, 0x0e, 0x02, 0x04, 0x18, 0x60, 0x00, 0x00, 0x00, 0x00}, |
{0x23, 0x54, 0x33, 0x24, 0x40, 0x0c, 0x12, 0x0e, 0x02, 0x04, 0x18, 0x60, 0x00, 0x00, 0x00, 0x00}, |
{0x03, 0x04, 0x03, 0x04, 0x00, 0x07, 0x08, 0x88, 0x86, 0x81, 0x81, 0x7e, 0x00, 0x00, 0x00, 0x00}, |
{0x10, 0x1c, 0x14, 0x38, 0x00, 0x40, 0x81, 0x81, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x08, 0x00, 0x08, 0x00, 0x40, 0x81, 0x81, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x81, 0x81, 0x7e, 0x00, 0x08, 0x00, 0x08, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x14, 0x40, 0x81, 0x81, 0x7e, 0x08, 0x14, 0x08, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x14, 0x00, 0x08, 0x00, 0x40, 0x81, 0x81, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x81, 0x81, 0x7e, 0x00, 0x00, 0x14, 0x00, 0x08, 0x00, 0x00}, |
{0x00, 0x14, 0x00, 0x14, 0x00, 0x40, 0x81, 0x81, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x81, 0x81, 0x7e, 0x00, 0x00, 0x14, 0x00, 0x14, 0x00, 0x00}, |
{0x06, 0x08, 0x06, 0x08, 0x70, 0x8f, 0x30, 0x40, 0x80, 0x80, 0x80, 0x41, 0x3e, 0x00, 0x00, 0x00}, |
{0x08, 0x00, 0x08, 0x00, 0x70, 0x8f, 0x30, 0x40, 0x80, 0x80, 0x80, 0x41, 0x3e, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x70, 0x8f, 0x30, 0x40, 0x80, 0x94, 0x80, 0x41, 0x3e, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x70, 0x8f, 0x30, 0x40, 0x88, 0x80, 0x88, 0x41, 0x3e, 0x00, 0x00, 0x00}, |
{0x08, 0x00, 0x14, 0x00, 0x70, 0x8f, 0x30, 0x40, 0x80, 0x80, 0x80, 0x41, 0x3e, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x70, 0x8f, 0x30, 0x40, 0x94, 0x80, 0x88, 0x41, 0x3e, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x70, 0x8f, 0x30, 0x40, 0x94, 0x80, 0x94, 0x41, 0x3e, 0x00, 0x00, 0x00}, |
{0x20, 0x38, 0x28, 0x70, 0x08, 0x04, 0x02, 0x42, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x08, 0x04, 0x02, 0x42, 0x3c, 0x08, 0x14, 0x08, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x08, 0x04, 0x02, 0x42, 0x3c, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00}, |
{0x20, 0x38, 0x28, 0x70, 0x08, 0x04, 0x02, 0x42, 0x3c, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x14, 0x00, 0x00, 0x08, 0x04, 0x02, 0x42, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x08, 0x04, 0x02, 0x42, 0x3c, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00}, |
{0x08, 0x00, 0x14, 0x00, 0x08, 0x04, 0x02, 0x42, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x14, 0x00, 0x08, 0x00, 0x08, 0x04, 0x02, 0x42, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x14, 0x00, 0x14, 0x00, 0x08, 0x04, 0x02, 0x42, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x10, 0x1c, 0x14, 0x38, 0x00, 0x04, 0x02, 0x02, 0x04, 0x18, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x14, 0x08, 0x00, 0x00, 0x04, 0x02, 0x02, 0x04, 0x18, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x02, 0x02, 0x04, 0x1c, 0x6a, 0x04, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x02, 0x02, 0x04, 0x18, 0x62, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x02, 0x02, 0x04, 0x18, 0x60, 0x00, 0x14, 0x08, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x02, 0x12, 0x04, 0x18, 0x62, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x14, 0x00, 0x00, 0x04, 0x02, 0x02, 0x04, 0x18, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x08, 0x00, 0x14, 0x00, 0x00, 0x04, 0x02, 0x02, 0x04, 0x18, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x14, 0x00, 0x14, 0x00, 0x00, 0x04, 0x02, 0x02, 0x04, 0x18, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x04, 0x00, 0x01, 0x15, 0x88, 0x88, 0x8a, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x15, 0x88, 0x88, 0x90, 0x65, 0x00, 0x02, 0x00, 0x00, 0x00}, |
{0x00, 0x04, 0x00, 0x0a, 0x00, 0x01, 0x15, 0x88, 0x88, 0x90, 0x65, 0x00, 0x02, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x06, 0x09, 0x31, 0x9e, 0x88, 0x90, 0x65, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x04, 0x00, 0x0a, 0x00, 0x06, 0x09, 0x31, 0x9e, 0x88, 0x88, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x04, 0x00, 0x2a, 0x20, 0x20, 0x2c, 0x32, 0xa2, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x20, 0x00, 0x50, 0x00, 0x70, 0x80, 0x8c, 0x70, 0x40, 0x80, 0x80, 0x80, 0x41, 0x3e, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x06, 0x49, 0x85, 0x83, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x06, 0x49, 0x85, 0x83, 0x7e, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x04, 0x00, 0x06, 0x49, 0x85, 0x83, 0x7e, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x04, 0x00, 0x0a, 0x00, 0x06, 0x49, 0x85, 0x83, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x06, 0x49, 0x85, 0x83, 0x7e, 0x00, 0x0a, 0x00, 0x04, 0x00, 0x00, 0x00}, |
{0x0a, 0x00, 0x0a, 0x00, 0x06, 0x49, 0x85, 0x83, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x04, 0x00, 0x06, 0x09, 0x09, 0x47, 0x81, 0x81, 0x81, 0x42, 0x3c, 0x00, 0x00, 0x00}, |
{0x04, 0x00, 0x0a, 0x00, 0x06, 0x09, 0x09, 0x47, 0x81, 0x81, 0x81, 0x42, 0x3c, 0x00, 0x00, 0x00}, |
{0x00, 0x01, 0x02, 0x04, 0x08, 0x44, 0x82, 0x82, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x18, 0x20, 0x40, 0x3e, 0x01, 0x81, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x01, 0x02, 0x05, 0x0b, 0x48, 0x84, 0x82, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x04, 0x00, 0x19, 0x21, 0x19, 0x21, 0x01, 0x81, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x10, 0x00, 0x29, 0x01, 0x19, 0x21, 0x19, 0xa1, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x19, 0x21, 0x19, 0x21, 0x01, 0x81, 0x7e, 0x00, 0x14, 0x00, 0x08, 0x00, 0x00, 0x00}, |
{0x04, 0x09, 0x12, 0x04, 0x08, 0x44, 0x82, 0x82, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x04, 0x09, 0x12, 0x05, 0x0b, 0x48, 0x84, 0x82, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0xa4, 0x09, 0x12, 0x04, 0x08, 0x44, 0x82, 0x82, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x04, 0x09, 0x12, 0x04, 0x08, 0x44, 0x82, 0x82, 0x7c, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x04, 0x09, 0x12, 0x04, 0x08, 0x44, 0x82, 0x82, 0x7c, 0x00, 0x08, 0x00, 0x08, 0x00, 0x00, 0x00}, |
{0x44, 0x09, 0xa2, 0x04, 0x08, 0x44, 0x82, 0x82, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x14, 0x08, 0x02, 0x02, 0x02, 0x02, 0x42, 0x82, 0x82, 0x84, 0x78, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x08, 0x02, 0x02, 0x02, 0x02, 0x02, 0x42, 0x82, 0x82, 0x84, 0x78, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x10, 0x02, 0x2a, 0x02, 0x02, 0x02, 0x42, 0x82, 0x82, 0x84, 0x78, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0x42, 0x82, 0x82, 0x84, 0x78, 0x00, 0x14, 0x00, 0x08, 0x00}, |
{0x00, 0x08, 0x00, 0x00, 0x00, 0x41, 0x81, 0x81, 0x81, 0x42, 0x3c, 0x00, 0x00, 0x04, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x41, 0x81, 0x81, 0x81, 0x42, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x10, 0x1c, 0x14, 0x38, 0x00, 0x41, 0x81, 0x81, 0x81, 0x42, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x08, 0x00, 0x00, 0x41, 0x81, 0x81, 0x81, 0x42, 0x3c, 0x08, 0x14, 0x08, 0x00, 0x00}, |
{0x08, 0x00, 0x14, 0x00, 0x00, 0x41, 0x81, 0x81, 0x81, 0x42, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x10, 0x38, 0x4c, 0x52, 0x32, 0x3c, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x10, 0x00, 0x70, 0x8f, 0x30, 0x40, 0x94, 0x80, 0x88, 0x41, 0x3e, 0x00, 0x00, 0x00}, |
{0x38, 0x40, 0x38, 0x40, 0x18, 0x24, 0x22, 0x22, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x38, 0x40, 0x38, 0x40, 0x00, 0x0c, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x0c, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x12, 0x0e, 0x12, 0x2c, 0x18, 0x60, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x12, 0x0e, 0x02, 0x3c, 0x18, 0x60, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x14, 0x08, 0x00, 0x00, 0x0c, 0x12, 0x0e, 0x02, 0x04, 0x18, 0x60, 0x00, 0x00, 0x00, 0x00}, |
{0x10, 0x28, 0x18, 0x10, 0x20, 0x0c, 0x12, 0x0e, 0x02, 0x04, 0x18, 0x60, 0x00, 0x00, 0x00, 0x00}, |
{0x08, 0x08, 0x08, 0x08, 0x00, 0x0c, 0x12, 0x0e, 0x02, 0x04, 0x18, 0x60, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x08, 0x14, 0x00, 0x00, 0x0c, 0x12, 0x0e, 0x02, 0x04, 0x18, 0x60, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x14, 0x00, 0x00, 0x0c, 0x12, 0x0e, 0x02, 0x04, 0x18, 0x60, 0x00, 0x00, 0x00, 0x00}, |
{0x08, 0x00, 0x14, 0x00, 0x00, 0x0c, 0x12, 0x0e, 0x02, 0x04, 0x18, 0x60, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x08, 0x88, 0x86, 0x81, 0x81, 0x7e, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x20, 0x47, 0x88, 0x08, 0x86, 0x81, 0x81, 0x7e, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x50, 0x20, 0x07, 0x08, 0x88, 0x86, 0x81, 0x81, 0x7e, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x08, 0x00, 0x00, 0x0c, 0x12, 0x0e, 0x02, 0x04, 0x18, 0x60, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x08, 0x88, 0x86, 0x81, 0x82, 0x7c, 0x00, 0x08, 0x00, 0x08}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x08, 0x88, 0x86, 0x81, 0x82, 0x7c, 0x00, 0x14, 0x00, 0x08}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x14, 0x60, 0x80, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x60, 0x80, 0x60, 0x80, 0x08, 0x14, 0x60, 0x80, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x18, 0x24, 0x22, 0x22, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x40, 0x40, 0x43, 0x55, 0x7e, 0x80, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x2a, 0x20, 0x26, 0x2a, 0x7c, 0x80, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x0c, 0x0e, 0x1c, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x14, 0x14, 0x08, 0x14, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x18, 0x2c, 0x10, 0x28, 0x22, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x08, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x15, 0x8a, 0x90, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x5a, 0xa5, 0x66, 0x5b, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x5a, 0x66, 0xa5, 0x5a, 0x00}, |
{0x00, 0x00, 0x18, 0x66, 0x42, 0x42, 0x81, 0x99, 0x99, 0x81, 0x42, 0x42, 0x66, 0x18, 0x00, 0x00}, |
{0x08, 0x1c, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x18, 0x26, 0x08, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x0c, 0x0c, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x15, 0x8a, 0x90, 0x60}, |
{0x32, 0x2c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x14, 0x0c, 0x04, 0x08, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x30, 0x40, 0x3e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x10, 0x30, 0x40, 0x3e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x08, 0x22, 0x22, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x10, 0x28, 0x54, 0xaa, 0x92, 0x54, 0x54, 0x54, 0x54, 0x54, 0x54, 0x54, 0x82, 0xfe, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x14, 0x22, 0x14, 0x08}, |
{0x08, 0x14, 0x22, 0x14, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x18, 0x3c, 0x3c, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x0c, 0x10, 0x10, 0x10}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x44, 0x44, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x20, 0x70, 0x70, 0x38, 0x18, 0x18, 0x08, 0x08, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x44, 0xfc, 0xf8, 0x60, 0x30, 0x30, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x4a, 0xfe, 0xf4, 0x60, 0x30, 0x30, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x4e, 0xf0, 0xfe, 0x7c, 0x30, 0x30, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x30, 0x38, 0x2c, 0x44, 0x42, 0x82, 0x92, 0xfe, 0x6c, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x18, 0x3c, 0x60, 0x7e, 0x3c, 0x30, 0x60, 0x40, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x82, 0xc6, 0xc6, 0x6c, 0x28, 0x38, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x10, 0x10, 0x10, 0x38, 0x28, 0x6c, 0xc6, 0xc6, 0x82, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x70, 0xf8, 0x88, 0xf8, 0x78, 0x08, 0x0c, 0x0e, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x08, 0x00, 0x14, 0x00, 0x01, 0x15, 0x88, 0x88, 0x88, 0x72, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x04, 0x00, 0x06, 0x09, 0x31, 0x9e, 0x88, 0x88, 0x72, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x40, 0x00, 0x00, 0x70, 0x80, 0x8c, 0x70, 0x40, 0x80, 0x88, 0x80, 0x41, 0x3e, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x18, 0x24, 0x20, 0x1e, 0x20, 0x00, 0x14, 0x14, 0x14, 0x14, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x0c, 0x12, 0x12, 0x3c, 0x40, 0x54, 0x54, 0x54, 0x54, 0x40, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x6c, 0x92, 0x92, 0x92, 0x92, 0x92, 0x4c, 0x30, 0x4c, 0x02, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x6c, 0x92, 0x92, 0x92, 0x92, 0x92, 0x64, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x54, 0xaa, 0xaa, 0xaa, 0x82, 0x82, 0x40, 0x30, 0x4c, 0x02, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x6c, 0x92, 0x92, 0x92, 0x82, 0x82, 0x44, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x6c, 0x92, 0x92, 0x92, 0x82, 0x82, 0x40, 0x30, 0x4c, 0x02, 0x00}, |
{0x00, 0x00, 0x10, 0x38, 0x6c, 0xc6, 0xc6, 0xfe, 0xc6, 0xc6, 0xc6, 0xc6, 0x00, 0x38, 0x6c, 0x38}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x0c, 0x7c, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x38, 0x6c, 0x38}, |
{0x18, 0x18, 0x00, 0xfc, 0x66, 0x66, 0x66, 0x7c, 0x66, 0x66, 0x66, 0xfc, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x0c, 0xec, 0x60, 0x60, 0x78, 0x6c, 0x66, 0x66, 0x66, 0x66, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xfc, 0x66, 0x66, 0x66, 0x7c, 0x66, 0x66, 0x66, 0x66, 0xfc, 0x00, 0x18, 0x18, 0x00}, |
{0x00, 0x00, 0xe0, 0x60, 0x60, 0x78, 0x6c, 0x66, 0x66, 0x66, 0x66, 0x7c, 0x00, 0x18, 0x18, 0x00}, |
{0x00, 0x00, 0xfc, 0x66, 0x66, 0x66, 0x7c, 0x66, 0x66, 0x66, 0x66, 0xfc, 0x00, 0x7c, 0x00, 0x00}, |
{0x00, 0x00, 0xe0, 0x60, 0x60, 0x78, 0x6c, 0x66, 0x66, 0x66, 0x66, 0x7c, 0x00, 0x7c, 0x00, 0x00}, |
{0x0c, 0x18, 0x00, 0x3c, 0x66, 0xc2, 0xc0, 0xc0, 0xc0, 0xc2, 0x66, 0x3c, 0x18, 0x0c, 0x38, 0x00}, |
{0x00, 0x00, 0x0c, 0x18, 0x00, 0x7c, 0xc6, 0xc0, 0xc0, 0xc0, 0xc6, 0x7c, 0x18, 0x0c, 0x38, 0x00}, |
{0x30, 0x30, 0x00, 0xf8, 0x6c, 0x66, 0x66, 0x66, 0x66, 0x66, 0x6c, 0xf8, 0x00, 0x00, 0x00, 0x00}, |
{0x60, 0x60, 0x0c, 0x0c, 0x0c, 0x3c, 0x6c, 0xcc, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xf8, 0x6c, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x6c, 0xf8, 0x00, 0x30, 0x30, 0x00}, |
{0x00, 0x00, 0x1c, 0x0c, 0x0c, 0x3c, 0x6c, 0xcc, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x30, 0x30, 0x00}, |
{0x00, 0x00, 0xf8, 0x6c, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x6c, 0xf8, 0x00, 0x7c, 0x00, 0x00}, |
{0x00, 0x00, 0x1c, 0x0c, 0x0c, 0x3c, 0x6c, 0xcc, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x7c, 0x00, 0x00}, |
{0x00, 0x00, 0xf8, 0x6c, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x6c, 0xf8, 0x30, 0x18, 0x70, 0x00}, |
{0x00, 0x00, 0x1c, 0x0c, 0x0c, 0x3c, 0x6c, 0xcc, 0xcc, 0xcc, 0xcc, 0x76, 0x30, 0x18, 0x70, 0x00}, |
{0x00, 0x00, 0xf8, 0x6c, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x6c, 0xf8, 0x10, 0x38, 0x6c, 0x00}, |
{0x00, 0x00, 0x1c, 0x0c, 0x0c, 0x3c, 0x6c, 0xcc, 0xcc, 0xcc, 0xcc, 0x76, 0x10, 0x38, 0x6c, 0x00}, |
{0x60, 0x30, 0x00, 0x7c, 0x00, 0xfe, 0x62, 0x68, 0x78, 0x68, 0x62, 0xfe, 0x00, 0x00, 0x00, 0x00}, |
{0x60, 0x30, 0x00, 0x7c, 0x00, 0x7c, 0xc6, 0xfe, 0xc0, 0xc0, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x0c, 0x18, 0x00, 0x7c, 0x00, 0xfe, 0x62, 0x68, 0x78, 0x68, 0x62, 0xfe, 0x00, 0x00, 0x00, 0x00}, |
{0x0c, 0x18, 0x00, 0x7c, 0x00, 0x7c, 0xc6, 0xfe, 0xc0, 0xc0, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xfe, 0x66, 0x62, 0x68, 0x78, 0x68, 0x60, 0x62, 0x66, 0xfe, 0x10, 0x38, 0x6c, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, 0xfe, 0xc0, 0xc0, 0xc6, 0x7c, 0x10, 0x38, 0x6c, 0x00}, |
{0x00, 0x00, 0xfe, 0x66, 0x62, 0x68, 0x78, 0x68, 0x60, 0x62, 0x66, 0xfe, 0x00, 0x76, 0xdc, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, 0xfe, 0xc0, 0xc0, 0xc6, 0x7c, 0x00, 0x76, 0xdc, 0x00}, |
{0x6c, 0x38, 0x00, 0xfe, 0x66, 0x62, 0x68, 0x78, 0x68, 0x62, 0x66, 0xfe, 0x18, 0x0c, 0x38, 0x00}, |
{0x00, 0x00, 0x6c, 0x38, 0x00, 0x7c, 0xc6, 0xfe, 0xc0, 0xc0, 0xc6, 0x7c, 0x18, 0x0c, 0x38, 0x00}, |
{0x18, 0x18, 0x00, 0xfe, 0x66, 0x62, 0x68, 0x78, 0x68, 0x60, 0x60, 0xf0, 0x00, 0x00, 0x00, 0x00}, |
{0x30, 0x30, 0x00, 0x38, 0x6c, 0x64, 0xf0, 0x60, 0x60, 0x60, 0x60, 0xf0, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x7c, 0x00, 0x3c, 0x66, 0xc2, 0xc0, 0xde, 0xc6, 0xc6, 0x66, 0x3a, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x7c, 0x00, 0x76, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x7c, 0x0c, 0xcc, 0x78, 0x00}, |
{0x30, 0x30, 0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0xfe, 0xc6, 0xc6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00}, |
{0x0c, 0x0c, 0xe0, 0x60, 0x60, 0x6c, 0x76, 0x66, 0x66, 0x66, 0x66, 0xe6, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0xfe, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x00, 0x30, 0x30, 0x00}, |
{0x00, 0x00, 0xe0, 0x60, 0x60, 0x6c, 0x76, 0x66, 0x66, 0x66, 0x66, 0xe6, 0x00, 0x18, 0x18, 0x00}, |
{0x6c, 0x6c, 0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0xfe, 0xc6, 0xc6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00}, |
{0x6c, 0x6c, 0x00, 0xe0, 0x60, 0x6c, 0x76, 0x66, 0x66, 0x66, 0x66, 0xe6, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0xfe, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x60, 0x30, 0xe0, 0x00}, |
{0x00, 0x00, 0xe0, 0x60, 0x60, 0x6c, 0x76, 0x66, 0x66, 0x66, 0x66, 0xe6, 0x30, 0x18, 0x70, 0x00}, |
{0x00, 0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0xfe, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x00, 0x6c, 0x38, 0x00}, |
{0x00, 0x00, 0xe0, 0x60, 0x60, 0x6c, 0x76, 0x66, 0x66, 0x66, 0x66, 0xe6, 0x00, 0x6c, 0x38, 0x00}, |
{0x00, 0x00, 0x3c, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x76, 0xdc, 0x00}, |
{0x00, 0x00, 0x18, 0x18, 0x00, 0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x76, 0xdc, 0x00}, |
{0x0c, 0x18, 0x66, 0x00, 0x3c, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00}, |
{0x0c, 0x18, 0x66, 0x66, 0x00, 0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00}, |
{0x18, 0x18, 0x00, 0xe6, 0x66, 0x66, 0x6c, 0x78, 0x6c, 0x66, 0x66, 0xe6, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x0c, 0xec, 0x60, 0x60, 0x66, 0x6c, 0x78, 0x78, 0x6c, 0x66, 0xe6, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xe6, 0x66, 0x66, 0x6c, 0x78, 0x78, 0x6c, 0x66, 0x66, 0xe6, 0x00, 0x18, 0x18, 0x00}, |
{0x00, 0x00, 0xe0, 0x60, 0x60, 0x66, 0x6c, 0x78, 0x78, 0x6c, 0x66, 0xe6, 0x00, 0x18, 0x18, 0x00}, |
{0x00, 0x00, 0xe6, 0x66, 0x66, 0x6c, 0x78, 0x78, 0x6c, 0x66, 0x66, 0xe6, 0x00, 0x7c, 0x00, 0x00}, |
{0x00, 0x00, 0xe0, 0x60, 0x60, 0x66, 0x6c, 0x78, 0x78, 0x6c, 0x66, 0xe6, 0x00, 0x7c, 0x00, 0x00}, |
{0x00, 0x00, 0xf0, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x62, 0x66, 0xfe, 0x00, 0x18, 0x18, 0x00}, |
{0x00, 0x00, 0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x18, 0x18, 0x00}, |
{0x00, 0x7c, 0x00, 0xf0, 0x60, 0x60, 0x60, 0x60, 0x60, 0x62, 0x66, 0xfe, 0x00, 0x18, 0x18, 0x00}, |
{0x00, 0x7c, 0x00, 0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x18, 0x18, 0x00}, |
{0x00, 0x00, 0xf0, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x62, 0x66, 0xfe, 0x00, 0x7c, 0x00, 0x00}, |
{0x00, 0x00, 0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x7e, 0x00, 0x00}, |
{0x00, 0x00, 0xf0, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x62, 0x66, 0xfe, 0x10, 0x38, 0x6c, 0x00}, |
{0x00, 0x00, 0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x10, 0x38, 0x6c, 0x00}, |
{0x0c, 0x18, 0x00, 0xc6, 0xee, 0xfe, 0xfe, 0xd6, 0xc6, 0xc6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x0c, 0x18, 0x00, 0xec, 0xfe, 0xd6, 0xd6, 0xd6, 0xd6, 0xc6, 0x00, 0x00, 0x00, 0x00}, |
{0x30, 0x30, 0x00, 0xc6, 0xee, 0xfe, 0xfe, 0xd6, 0xc6, 0xc6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x30, 0x30, 0x00, 0xec, 0xfe, 0xd6, 0xd6, 0xd6, 0xd6, 0xc6, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xc6, 0xee, 0xfe, 0xfe, 0xd6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x00, 0x30, 0x30, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0xec, 0xfe, 0xd6, 0xd6, 0xd6, 0xd6, 0xc6, 0x00, 0x30, 0x30, 0x00}, |
{0x30, 0x30, 0x00, 0xc6, 0xe6, 0xf6, 0xfe, 0xde, 0xce, 0xc6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x18, 0x18, 0x00, 0xdc, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xc6, 0xe6, 0xf6, 0xfe, 0xde, 0xce, 0xc6, 0xc6, 0xc6, 0xc6, 0x00, 0x30, 0x30, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0xdc, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x00, 0x18, 0x18, 0x00}, |
{0x00, 0x00, 0xc6, 0xe6, 0xf6, 0xfe, 0xde, 0xce, 0xc6, 0xc6, 0xc6, 0xc6, 0x00, 0x7c, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0xdc, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x00, 0x7c, 0x00, 0x00}, |
{0x00, 0x00, 0xc6, 0xe6, 0xf6, 0xfe, 0xde, 0xce, 0xc6, 0xc6, 0xc6, 0xc6, 0x10, 0x38, 0x6c, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0xdc, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x10, 0x38, 0x6c, 0x00}, |
{0x0c, 0x18, 0x72, 0x9c, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x0c, 0x18, 0x76, 0xdc, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x6c, 0x00, 0x72, 0x9c, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x6c, 0x00, 0x76, 0xdc, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x60, 0x30, 0x7c, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x60, 0x30, 0x00, 0x7c, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x0c, 0x18, 0x7c, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x0c, 0x18, 0x00, 0x7c, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x0c, 0x18, 0x00, 0xfc, 0x66, 0x66, 0x66, 0x7c, 0x60, 0x60, 0x60, 0xf0, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x0c, 0x18, 0x00, 0xdc, 0x66, 0x66, 0x66, 0x66, 0x66, 0x7c, 0x60, 0x60, 0xf0, 0x00}, |
{0x18, 0x18, 0x00, 0xfc, 0x66, 0x66, 0x66, 0x7c, 0x60, 0x60, 0x60, 0xf0, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x18, 0x18, 0x00, 0xdc, 0x66, 0x66, 0x66, 0x66, 0x66, 0x7c, 0x60, 0x60, 0xf0, 0x00}, |
{0x18, 0x18, 0x00, 0xfc, 0x66, 0x66, 0x66, 0x7c, 0x6c, 0x66, 0x66, 0xe6, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x18, 0x18, 0x00, 0xdc, 0x76, 0x66, 0x60, 0x60, 0x60, 0xf0, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xfc, 0x66, 0x66, 0x66, 0x7c, 0x6c, 0x66, 0x66, 0x66, 0xe6, 0x00, 0x18, 0x18, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0xdc, 0x76, 0x66, 0x60, 0x60, 0x60, 0xf0, 0x00, 0x18, 0x18, 0x00}, |
{0x00, 0x7c, 0x00, 0xfc, 0x66, 0x66, 0x66, 0x7c, 0x6c, 0x66, 0x66, 0xe6, 0x00, 0x18, 0x18, 0x00}, |
{0x00, 0x00, 0x00, 0x7c, 0x00, 0xdc, 0x76, 0x66, 0x60, 0x60, 0x60, 0xf0, 0x00, 0x18, 0x18, 0x00}, |
{0x00, 0x00, 0xfc, 0x66, 0x66, 0x66, 0x7c, 0x6c, 0x66, 0x66, 0x66, 0xe6, 0x00, 0x7c, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0xdc, 0x76, 0x66, 0x60, 0x60, 0x60, 0xf0, 0x00, 0x7c, 0x00, 0x00}, |
{0x30, 0x30, 0x00, 0x7c, 0xc6, 0xc6, 0x60, 0x38, 0x0c, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x30, 0x30, 0x00, 0x7c, 0xc6, 0x60, 0x38, 0x0c, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x7c, 0xc6, 0xc6, 0x60, 0x38, 0x0c, 0x06, 0xc6, 0xc6, 0x7c, 0x00, 0x30, 0x30, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, 0x60, 0x38, 0x0c, 0xc6, 0x7c, 0x00, 0x30, 0x30, 0x00}, |
{0x60, 0x6c, 0x18, 0x00, 0x7c, 0xc6, 0xc6, 0x70, 0x1c, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x60, 0x60, 0x0c, 0x18, 0x00, 0x7c, 0xc6, 0x60, 0x38, 0x0c, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x30, 0x44, 0x38, 0x10, 0x7c, 0xc6, 0xc6, 0x70, 0x1c, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x30, 0x30, 0x44, 0x38, 0x10, 0x7c, 0xc6, 0x60, 0x38, 0x0c, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x30, 0x30, 0x00, 0x7c, 0xc6, 0xc6, 0x60, 0x38, 0x0c, 0xc6, 0xc6, 0x7c, 0x00, 0x30, 0x30, 0x00}, |
{0x00, 0x00, 0x30, 0x30, 0x00, 0x7c, 0xc6, 0x60, 0x38, 0x0c, 0xc6, 0x7c, 0x00, 0x30, 0x30, 0x00}, |
{0x18, 0x18, 0x00, 0x7e, 0x7e, 0x5a, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x06, 0x16, 0x30, 0x30, 0xfc, 0x30, 0x30, 0x30, 0x30, 0x36, 0x1c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x7e, 0x7e, 0x5a, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x18, 0x18, 0x00}, |
{0x00, 0x00, 0x10, 0x30, 0x30, 0xfc, 0x30, 0x30, 0x30, 0x30, 0x36, 0x1c, 0x00, 0x18, 0x18, 0x00}, |
{0x00, 0x00, 0x7e, 0x7e, 0x5a, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x7e, 0x00, 0x00}, |
{0x00, 0x00, 0x10, 0x30, 0x30, 0xfc, 0x30, 0x30, 0x30, 0x30, 0x36, 0x1c, 0x00, 0x7e, 0x00, 0x00}, |
{0x00, 0x00, 0x7e, 0x7e, 0x5a, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x10, 0x38, 0x6c, 0x00}, |
{0x00, 0x00, 0x10, 0x30, 0x30, 0xfc, 0x30, 0x30, 0x30, 0x30, 0x36, 0x1c, 0x08, 0x1c, 0x36, 0x00}, |
{0x00, 0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x6c, 0x6c, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x6c, 0x6c, 0x00}, |
{0x00, 0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x76, 0xdc, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x76, 0xdc, 0x00}, |
{0x00, 0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x10, 0x38, 0x6c, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x76, 0x10, 0x38, 0x6c, 0x00}, |
{0x0c, 0x18, 0x72, 0x9c, 0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x0c, 0x18, 0x76, 0xdc, 0x00, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00}, |
{0x6c, 0x00, 0x7c, 0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0xcc, 0xcc, 0x00, 0xfc, 0x00, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00}, |
{0x76, 0xdc, 0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x6c, 0x38, 0x10, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x76, 0xdc, 0x00, 0x66, 0x66, 0x66, 0x66, 0x66, 0x3c, 0x18, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x6c, 0x38, 0x10, 0x00, 0x30, 0x30, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x66, 0x66, 0x66, 0x66, 0x66, 0x3c, 0x18, 0x00, 0x18, 0x18, 0x00}, |
{0x60, 0x30, 0x00, 0xc6, 0xc6, 0xc6, 0xd6, 0xd6, 0xd6, 0xfe, 0xee, 0x6c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x60, 0x30, 0x00, 0xc6, 0xc6, 0xd6, 0xd6, 0xd6, 0xfe, 0x6c, 0x00, 0x00, 0x00, 0x00}, |
{0x0c, 0x18, 0x00, 0xc6, 0xc6, 0xc6, 0xd6, 0xd6, 0xd6, 0xfe, 0xee, 0x6c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x0c, 0x18, 0x00, 0xc6, 0xc6, 0xd6, 0xd6, 0xd6, 0xfe, 0x6c, 0x00, 0x00, 0x00, 0x00}, |
{0x6c, 0x6c, 0x00, 0xc6, 0xc6, 0xc6, 0xd6, 0xd6, 0xd6, 0xfe, 0xee, 0x6c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x6c, 0x6c, 0x00, 0xc6, 0xc6, 0xd6, 0xd6, 0xd6, 0xfe, 0x6c, 0x00, 0x00, 0x00, 0x00}, |
{0x30, 0x30, 0x00, 0xc6, 0xc6, 0xc6, 0xd6, 0xd6, 0xd6, 0xfe, 0xee, 0x6c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x30, 0x30, 0x00, 0xc6, 0xc6, 0xd6, 0xd6, 0xd6, 0xfe, 0x6c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0xd6, 0xd6, 0xd6, 0xfe, 0xee, 0x6c, 0x00, 0x30, 0x30, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0xc6, 0xc6, 0xd6, 0xd6, 0xd6, 0xfe, 0x6c, 0x00, 0x30, 0x30, 0x00}, |
{0x30, 0x30, 0x00, 0xc6, 0xc6, 0x6c, 0x7c, 0x38, 0x7c, 0x6c, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x30, 0x30, 0x00, 0xc6, 0x6c, 0x38, 0x38, 0x38, 0x6c, 0xc6, 0x00, 0x00, 0x00, 0x00}, |
{0x6c, 0x6c, 0x00, 0xc6, 0xc6, 0x6c, 0x7c, 0x38, 0x7c, 0x6c, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x6c, 0x6c, 0x00, 0xc6, 0x6c, 0x38, 0x38, 0x38, 0x6c, 0xc6, 0x00, 0x00, 0x00, 0x00}, |
{0x18, 0x18, 0x00, 0x66, 0x66, 0x66, 0x3c, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x30, 0x30, 0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7e, 0x06, 0x0c, 0xf8, 0x00}, |
{0x10, 0x38, 0x44, 0xfe, 0xc6, 0x8c, 0x18, 0x30, 0x60, 0xc2, 0xc6, 0xfe, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x10, 0x38, 0x6c, 0x00, 0xfe, 0xcc, 0x18, 0x30, 0x60, 0xc6, 0xfe, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xfe, 0xc6, 0x86, 0x0c, 0x18, 0x30, 0x60, 0xc2, 0xc6, 0xfe, 0x00, 0x30, 0x30, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xcc, 0x18, 0x30, 0x60, 0xc6, 0xfe, 0x00, 0x30, 0x30, 0x00}, |
{0x00, 0x00, 0xfe, 0xc6, 0x86, 0x0c, 0x18, 0x30, 0x60, 0xc2, 0xc6, 0xfe, 0x00, 0x7c, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xcc, 0x18, 0x30, 0x60, 0xc6, 0xfe, 0x00, 0x7c, 0x00, 0x00}, |
{0x00, 0x00, 0xe0, 0x60, 0x60, 0x6c, 0x76, 0x66, 0x66, 0x66, 0x66, 0xe6, 0x00, 0x7c, 0x00, 0x00}, |
{0x6c, 0x6c, 0x00, 0x10, 0x30, 0xfc, 0x30, 0x30, 0x30, 0x30, 0x36, 0x1c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x38, 0x6c, 0x38, 0x00, 0xc6, 0xc6, 0xd6, 0xd6, 0xd6, 0xfe, 0x6c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x38, 0x6c, 0x38, 0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7e, 0x06, 0x0c, 0xf8, 0x00}, |
{0x00, 0x18, 0x0c, 0x18, 0x00, 0x78, 0x0c, 0x7c, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00}, |
{0x30, 0x30, 0x00, 0x38, 0x6c, 0x64, 0x60, 0x60, 0x60, 0x60, 0x60, 0xf0, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x10, 0x38, 0x6c, 0xc6, 0xc6, 0xfe, 0xc6, 0xc6, 0xc6, 0xc6, 0x00, 0x30, 0x30, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x0c, 0x7c, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x30, 0x30, 0x00}, |
{0x38, 0x0c, 0x18, 0x10, 0x38, 0x6c, 0xc6, 0xc6, 0xfe, 0xc6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x38, 0x0c, 0x18, 0x00, 0x78, 0x0c, 0x7c, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00}, |
{0x03, 0x16, 0x38, 0x6c, 0x10, 0x38, 0x6c, 0xc6, 0xc6, 0xfe, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00}, |
{0x03, 0x16, 0x38, 0x6c, 0x00, 0x78, 0x0c, 0x7c, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00}, |
{0xc0, 0x68, 0x1c, 0x36, 0x10, 0x38, 0x6c, 0xc6, 0xc6, 0xfe, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00}, |
{0xc0, 0x68, 0x1c, 0x36, 0x00, 0x78, 0x0c, 0x7c, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00}, |
{0x0e, 0x13, 0x3a, 0x6c, 0x10, 0x38, 0x6c, 0xc6, 0xc6, 0xfe, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00}, |
{0x0e, 0x13, 0x3a, 0x6c, 0x00, 0x78, 0x0c, 0x7c, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00}, |
{0x76, 0xdc, 0x10, 0x28, 0x54, 0x38, 0x6c, 0xc6, 0xc6, 0xfe, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00}, |
{0x76, 0xdc, 0x10, 0x38, 0x44, 0x78, 0x0c, 0x7c, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00}, |
{0x10, 0x38, 0x6c, 0x10, 0x38, 0x6c, 0xc6, 0xc6, 0xfe, 0xc6, 0xc6, 0xc6, 0x00, 0x30, 0x30, 0x00}, |
{0x00, 0x10, 0x38, 0x6c, 0x00, 0x78, 0x0c, 0x7c, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x30, 0x30, 0x00}, |
{0x0c, 0x18, 0x44, 0x38, 0x10, 0x38, 0x6c, 0xc6, 0xc6, 0xfe, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00}, |
{0x0c, 0x18, 0x44, 0x38, 0x00, 0x78, 0x0c, 0x7c, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00}, |
{0x60, 0x30, 0x44, 0x38, 0x10, 0x38, 0x6c, 0xc6, 0xc6, 0xfe, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00}, |
{0x60, 0x30, 0x44, 0x38, 0x00, 0x78, 0x0c, 0x7c, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00}, |
{0x30, 0x08, 0x54, 0x38, 0x10, 0x38, 0x6c, 0xc6, 0xc6, 0xfe, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00}, |
{0x30, 0x08, 0x54, 0x38, 0x00, 0x78, 0x0c, 0x7c, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00}, |
{0x72, 0x9c, 0x44, 0x38, 0x10, 0x38, 0x6c, 0xc6, 0xc6, 0xfe, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00}, |
{0x72, 0x9c, 0x44, 0x38, 0x00, 0x78, 0x0c, 0x7c, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00}, |
{0x6c, 0x38, 0x00, 0x10, 0x38, 0x6c, 0xc6, 0xc6, 0xfe, 0xc6, 0xc6, 0xc6, 0x00, 0x30, 0x30, 0x00}, |
{0x00, 0x00, 0x6c, 0x38, 0x00, 0x78, 0x0c, 0x7c, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x30, 0x30, 0x00}, |
{0x00, 0x00, 0xfe, 0x66, 0x62, 0x68, 0x78, 0x68, 0x60, 0x62, 0x66, 0xfe, 0x00, 0x18, 0x18, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, 0xfe, 0xc0, 0xc0, 0xc6, 0x7c, 0x00, 0x30, 0x30, 0x00}, |
{0x38, 0x0c, 0x18, 0xfe, 0x66, 0x62, 0x68, 0x78, 0x68, 0x62, 0x66, 0xfe, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x38, 0x0c, 0x18, 0x00, 0x7c, 0xc6, 0xfe, 0xc0, 0xc0, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x76, 0xdc, 0x00, 0xfe, 0x66, 0x62, 0x68, 0x78, 0x68, 0x62, 0x66, 0xfe, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x76, 0xdc, 0x00, 0x7c, 0xc6, 0xfe, 0xc0, 0xc0, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x23, 0x76, 0x88, 0xfe, 0x66, 0x62, 0x68, 0x78, 0x68, 0x62, 0x66, 0xfe, 0x00, 0x00, 0x00, 0x00}, |
{0x03, 0x26, 0x70, 0xd8, 0x00, 0x7c, 0xc6, 0xfe, 0xc0, 0xc0, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0xc4, 0x6e, 0x11, 0xfe, 0x66, 0x62, 0x68, 0x78, 0x68, 0x62, 0x66, 0xfe, 0x00, 0x00, 0x00, 0x00}, |
{0xc0, 0x64, 0x0e, 0x1b, 0x00, 0x7c, 0xc6, 0xfe, 0xc0, 0xc0, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x0e, 0x13, 0x3a, 0x6c, 0x00, 0xfe, 0x62, 0x68, 0x78, 0x68, 0x62, 0xfe, 0x00, 0x00, 0x00, 0x00}, |
{0x0e, 0x13, 0x3a, 0x6c, 0x00, 0x7c, 0xc6, 0xfe, 0xc0, 0xc0, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x76, 0xdc, 0x10, 0x38, 0x44, 0xfe, 0x62, 0x68, 0x78, 0x68, 0x62, 0xfe, 0x00, 0x00, 0x00, 0x00}, |
{0x76, 0xdc, 0x10, 0x38, 0x44, 0x7c, 0xc6, 0xfe, 0xc0, 0xc0, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x10, 0x38, 0x44, 0xfe, 0x66, 0x62, 0x68, 0x78, 0x68, 0x62, 0x66, 0xfe, 0x00, 0x18, 0x18, 0x00}, |
{0x00, 0x10, 0x38, 0x6c, 0x00, 0x7c, 0xc6, 0xfe, 0xc0, 0xc0, 0xc6, 0x7c, 0x00, 0x30, 0x30, 0x00}, |
{0x38, 0x0c, 0x18, 0x3c, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x38, 0x0c, 0x18, 0x00, 0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x3c, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x18, 0x18, 0x00}, |
{0x00, 0x00, 0x18, 0x18, 0x00, 0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x18, 0x18, 0x00}, |
{0x00, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x30, 0x30, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x30, 0x30, 0x00}, |
{0x38, 0x0c, 0x18, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x38, 0x0c, 0x18, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x23, 0x76, 0x88, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x03, 0x26, 0x70, 0xd8, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0xc4, 0x6e, 0x11, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0xc0, 0x64, 0x0e, 0x1b, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x0e, 0x13, 0x3a, 0x44, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x0e, 0x13, 0x3a, 0x6c, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x76, 0xdc, 0x10, 0x28, 0x44, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x76, 0xdc, 0x10, 0x38, 0x44, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x10, 0x38, 0x44, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x30, 0x30, 0x00}, |
{0x00, 0x10, 0x38, 0x6c, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x30, 0x30, 0x00}, |
{0x18, 0x33, 0x03, 0x7a, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x78, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x1b, 0x33, 0x06, 0x78, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x78, 0x00, 0x00, 0x00, 0x00}, |
{0x60, 0x33, 0x03, 0x7a, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x78, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x63, 0x33, 0x06, 0x78, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x78, 0x00, 0x00, 0x00, 0x00}, |
{0x70, 0x1b, 0x33, 0x7a, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x78, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x70, 0x1b, 0x33, 0x06, 0x78, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x78, 0x00, 0x00, 0x00, 0x00}, |
{0x68, 0xb3, 0x03, 0x7a, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x78, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x68, 0xb3, 0x03, 0x06, 0x78, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x78, 0x00, 0x00, 0x00, 0x00}, |
{0x03, 0x03, 0x7a, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x78, 0x00, 0x30, 0x30, 0x00}, |
{0x00, 0x00, 0x03, 0x03, 0x06, 0x78, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x78, 0x00, 0x30, 0x30, 0x00}, |
{0x00, 0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x30, 0x30, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x30, 0x30, 0x00}, |
{0x38, 0x0c, 0x18, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x70, 0x18, 0x30, 0x00, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00}, |
{0x18, 0x33, 0x03, 0xce, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x78, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x1b, 0x33, 0x06, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00}, |
{0x60, 0x33, 0x03, 0xce, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x78, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x63, 0x33, 0x06, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00}, |
{0x70, 0x1b, 0x33, 0xce, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x78, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x70, 0x1b, 0x33, 0x06, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00}, |
{0x68, 0xb3, 0x03, 0xce, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x78, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x68, 0xb3, 0x03, 0x06, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00}, |
{0x03, 0x03, 0xce, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x78, 0x00, 0x30, 0x30, 0x00}, |
{0x00, 0x00, 0x03, 0x03, 0x06, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x30, 0x30, 0x00}, |
{0x30, 0x18, 0x00, 0x66, 0x66, 0x66, 0x3c, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x60, 0x30, 0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7e, 0x06, 0x0c, 0xf8, 0x00}, |
{0x00, 0x00, 0x66, 0x66, 0x66, 0x66, 0x3c, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x18, 0x18, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7e, 0x0c, 0x18, 0xf6, 0x06, 0x00}, |
{0x38, 0x0c, 0x18, 0x66, 0x66, 0x66, 0x3c, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x38, 0x0c, 0x18, 0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7e, 0x06, 0x0c, 0xf8, 0x00}, |
{0x3a, 0x5c, 0x00, 0x66, 0x66, 0x66, 0x3c, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x76, 0xdc, 0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7e, 0x06, 0x0c, 0xf8, 0x00}, |
{0x00, 0x18, 0x18, 0x30, 0x00, 0x76, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x30, 0x30, 0x18, 0x00, 0x76, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x60, 0x6c, 0xc6, 0x00, 0x76, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0xc0, 0xcc, 0x66, 0x00, 0x76, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x60, 0x66, 0xcc, 0x00, 0x76, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0xc0, 0xc6, 0x6c, 0x00, 0x76, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00}, |
{0x34, 0x58, 0x0c, 0x18, 0x00, 0x76, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00}, |
{0x34, 0x58, 0x30, 0x18, 0x00, 0x76, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00}, |
{0xfe, 0x00, 0xa4, 0xaa, 0xea, 0xea, 0xa6, 0x00, 0x6c, 0x8a, 0x4c, 0x28, 0xc8, 0x00, 0xfe, 0x00}, |
{0xfe, 0x00, 0xa4, 0xea, 0xaa, 0xaa, 0xa6, 0x00, 0x6c, 0x8a, 0x4c, 0x28, 0xc8, 0x00, 0xfe, 0x00}, |
{0xfe, 0x00, 0xea, 0x8a, 0xce, 0x8e, 0xea, 0x00, 0x6c, 0x8a, 0x4c, 0x28, 0xc8, 0x00, 0xfe, 0x00}, |
{0xfe, 0x00, 0xea, 0x8e, 0xca, 0x8a, 0xea, 0x00, 0x6c, 0x8a, 0x4c, 0x28, 0xc8, 0x00, 0xfe, 0x00}, |
{0xfe, 0x00, 0xca, 0x2e, 0x4a, 0x2a, 0xca, 0x00, 0x6c, 0x8a, 0x4c, 0x28, 0xc8, 0x00, 0xfe, 0x00}, |
{0xfe, 0x00, 0xaa, 0xae, 0xea, 0x2a, 0x2a, 0x00, 0x6c, 0x8a, 0x4c, 0x28, 0xc8, 0x00, 0xfe, 0x00}, |
{0xfe, 0x00, 0x6a, 0x8e, 0xca, 0xaa, 0x4a, 0x00, 0x6c, 0x8a, 0x4c, 0x28, 0xc8, 0x00, 0xfe, 0x00}, |
{0xfe, 0x00, 0x38, 0x20, 0x30, 0x20, 0x20, 0x00, 0x6c, 0x8a, 0x4c, 0x28, 0xc8, 0x00, 0xfe, 0x00}, |
{0xfe, 0x00, 0x30, 0x28, 0x30, 0x20, 0x20, 0x00, 0x6c, 0x8a, 0x4c, 0x28, 0xc8, 0x00, 0xfe, 0x00}, |
{0xfe, 0x00, 0xea, 0x4a, 0x4e, 0x4a, 0x4a, 0x00, 0x6c, 0x8a, 0x4c, 0x28, 0xc8, 0x00, 0xfe, 0x00}, |
{0xfe, 0x00, 0x28, 0x28, 0x38, 0x28, 0x28, 0x00, 0x6c, 0x8a, 0x4c, 0x28, 0xc8, 0x00, 0xfe, 0x00}, |
{0xfe, 0x00, 0xea, 0x2a, 0x4e, 0x8e, 0xee, 0x00, 0x6c, 0x8a, 0x4c, 0x28, 0xc8, 0x00, 0xfe, 0x00}, |
{0xfe, 0x00, 0xea, 0x2a, 0x4e, 0x8e, 0xee, 0x00, 0xa2, 0xa2, 0xe2, 0xea, 0xa4, 0x00, 0xfe, 0x00}, |
{0xfe, 0x00, 0xea, 0x2a, 0x4e, 0x8e, 0xee, 0x00, 0x08, 0x08, 0x08, 0x28, 0x10, 0x00, 0xfe, 0x00}, |
{0xfe, 0x00, 0x80, 0x80, 0x80, 0xf0, 0x28, 0x30, 0x28, 0x0a, 0x0e, 0x0e, 0x0a, 0x00, 0xfe, 0x00}, |
{0xfe, 0x00, 0xc0, 0xa0, 0xc0, 0xa0, 0x20, 0x20, 0x38, 0x0a, 0x0e, 0x0e, 0x0a, 0x00, 0xfe, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x9c, 0xd2, 0xbc, 0x92, 0x9c, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x6c, 0x6c, 0x6c, 0x6c, 0x6c, 0x6c, 0x6c, 0x6c, 0x6c, 0x6c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x00, 0xfe, 0x00}, |
{0x00, 0x18, 0x30, 0x30, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x18, 0x18, 0x18, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x30, 0x00, 0x00}, |
{0x00, 0x30, 0x30, 0x30, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x66, 0xcc, 0xcc, 0xcc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x66, 0x66, 0x66, 0xcc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x66, 0x66, 0x66, 0xcc, 0x00, 0x00}, |
{0x00, 0xcc, 0xcc, 0xcc, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x18, 0x18, 0x18, 0x7e, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x18, 0x18, 0x18, 0x7e, 0x18, 0x18, 0x7e, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x3c, 0x3c, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x20, 0x30, 0x38, 0x3c, 0x38, 0x30, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x66, 0x66, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xdb, 0xdb, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0xc0, 0xc6, 0x0c, 0x18, 0x30, 0x60, 0xc0, 0x36, 0x36, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0xc0, 0xc6, 0x0c, 0x18, 0x30, 0x60, 0xc0, 0x6b, 0x6b, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x18, 0x18, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x6c, 0x6c, 0x48, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xdb, 0xdb, 0x92, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x18, 0x18, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x6c, 0x6c, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xdb, 0xdb, 0x49, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x38, 0x6c, 0xc6, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x0c, 0x18, 0x30, 0x60, 0x30, 0x18, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x60, 0x30, 0x18, 0x0c, 0x18, 0x30, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x92, 0x44, 0x28, 0x92, 0x28, 0x44, 0x92, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x00, 0x66, 0x66, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x7e, 0xc3, 0xdb, 0x1b, 0x1e, 0x1c, 0x18, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x82, 0x7c, 0x00, 0x00}, |
{0x7c, 0x82, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x0c, 0x18, 0x38, 0x6c, 0x00}, |
{0x00, 0x00, 0x00, 0x10, 0x38, 0x28, 0x00, 0x00, 0x44, 0xee, 0xaa, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x06, 0x06, 0x0c, 0x0c, 0x18, 0x18, 0x30, 0x30, 0x60, 0x60, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x3c, 0x30, 0x30, 0x30, 0x3c, 0x30, 0x30, 0x30, 0x30, 0x3c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x3c, 0x0c, 0x0c, 0x0c, 0x3c, 0x0c, 0x0c, 0x0c, 0x0c, 0x3c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x7b, 0xcf, 0xcf, 0x1b, 0x33, 0x33, 0x33, 0x00, 0x33, 0x33, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xde, 0xf3, 0xf3, 0xc6, 0xcc, 0xcc, 0xcc, 0x00, 0xcc, 0xcc, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x7e, 0x06, 0x06, 0x0c, 0x0c, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xfe, 0xdb, 0xdb, 0xdb, 0xde, 0xd8, 0xd8, 0xd8, 0xd8, 0xd8, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x3e, 0x72, 0xf2, 0xf2, 0xf2, 0x72, 0x3e, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0xf8, 0x9c, 0x9e, 0x9e, 0x9e, 0x9c, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x70, 0xd8, 0xd8, 0xd8, 0xd8, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x18, 0x38, 0x78, 0xd8, 0xfc, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0xf8, 0xc0, 0xf0, 0x18, 0xd8, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x78, 0xc0, 0xf0, 0xd8, 0xd8, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0xf8, 0xd8, 0x30, 0x30, 0x60, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x70, 0xd8, 0x70, 0xd8, 0xd8, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x70, 0xd8, 0xd8, 0x78, 0x18, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x30, 0x30, 0xfc, 0x30, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xfc, 0x00, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x30, 0x60, 0x60, 0x60, 0x60, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x60, 0x30, 0x30, 0x30, 0x30, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xb0, 0xd8, 0xd8, 0xd8, 0xd8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0xd8, 0xd8, 0xd8, 0xd8, 0x70, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x70, 0x30, 0x30, 0x30, 0x78, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0xd8, 0x30, 0x60, 0xc8, 0xf8, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0xd8, 0x30, 0x18, 0xd8, 0x70, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x38, 0x78, 0xd8, 0xfc, 0x18, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xc0, 0xf0, 0x18, 0xd8, 0x70, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0xc0, 0xf0, 0xd8, 0xd8, 0x70, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xd8, 0x30, 0x30, 0x60, 0x60, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0xd8, 0x70, 0xd8, 0xd8, 0x70, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0xd8, 0xd8, 0x78, 0x18, 0xf0, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x30, 0xfc, 0x30, 0x30, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x00, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x60, 0x60, 0x60, 0x60, 0x30, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x30, 0x30, 0x30, 0x30, 0x60, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb0, 0xd8, 0xd8, 0xd8, 0xd8, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x78, 0xcc, 0xc0, 0xcf, 0xcc, 0xcc, 0x7f, 0x0c, 0x0c, 0x0f, 0x00, 0x00, 0x00, 0x00}, |
{0x04, 0x04, 0x7c, 0xce, 0xc8, 0xc8, 0xd0, 0xd0, 0xd0, 0xe0, 0xe6, 0x7c, 0x40, 0x40, 0x00, 0x00}, |
{0x00, 0x00, 0x7c, 0xc6, 0xc0, 0xc0, 0xd6, 0xd8, 0xd8, 0xd8, 0xde, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xf8, 0xc0, 0xc0, 0xc0, 0xf0, 0xcd, 0xce, 0xcc, 0xcc, 0xcc, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x38, 0x6c, 0x60, 0xf8, 0x60, 0xf8, 0x60, 0x60, 0xe6, 0xfc, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x02, 0xec, 0xd6, 0xde, 0xd6, 0xd6, 0xf6, 0xd6, 0x40, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x66, 0x66, 0x76, 0xff, 0x76, 0x6e, 0xff, 0x6e, 0x66, 0x66, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xfc, 0x66, 0x66, 0x7c, 0x62, 0x66, 0x6f, 0x66, 0x66, 0xf3, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xf8, 0xcc, 0xcc, 0xcc, 0xf8, 0xe0, 0xf3, 0xd6, 0xdb, 0xce, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x81, 0x81, 0x81, 0x5a, 0xff, 0x5a, 0xff, 0x24, 0x24, 0x24, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0xf2, 0x8a, 0xaa, 0xaa, 0xaa, 0xaa, 0xa2, 0xbc, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x0c, 0x3e, 0x0c, 0x3c, 0x6c, 0xcc, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x7c, 0x00, 0x00}, |
{0x00, 0x00, 0x1c, 0x36, 0x60, 0xfc, 0x60, 0xf8, 0x60, 0x60, 0x36, 0x1c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xe6, 0x66, 0x6c, 0x78, 0xfe, 0x78, 0x6c, 0x66, 0x66, 0xe6, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x7e, 0x7e, 0x5a, 0x18, 0x1e, 0x78, 0x1e, 0x78, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x10, 0x7c, 0xb6, 0x36, 0x33, 0x33, 0x33, 0x63, 0x66, 0xf6, 0xdc, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x70, 0xd0, 0xd2, 0xd6, 0x7c, 0x18, 0x30, 0x6e, 0xd8, 0x98, 0x18, 0x0e, 0x00, 0x00, 0x00}, |
{0x00, 0x70, 0xd0, 0xd2, 0xd6, 0x7c, 0x18, 0x30, 0x6e, 0xd8, 0x8c, 0x06, 0x1c, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x3c, 0x62, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0xa0, 0x62, 0x3c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x4e, 0xb9, 0x58, 0x18, 0x18, 0x18, 0x18, 0x18, 0x19, 0x0e, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x3c, 0x18, 0x7c, 0xda, 0xd8, 0xd8, 0xda, 0x7c, 0x19, 0x3f, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x70, 0xc0, 0xc2, 0xc6, 0x7c, 0x18, 0x30, 0x6e, 0xdb, 0x9b, 0x1b, 0x0e, 0x00, 0x00, 0x00}, |
{0x00, 0x70, 0xc0, 0xc2, 0xc6, 0x7c, 0x18, 0x30, 0x7b, 0xdb, 0x9b, 0x1b, 0x0d, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x7c, 0xc6, 0xc2, 0xc0, 0x78, 0xc0, 0xc0, 0xc2, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x78, 0xcc, 0x86, 0x26, 0x3e, 0x26, 0x06, 0x86, 0xcc, 0x78, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x7f, 0xb9, 0x58, 0x1a, 0x1e, 0x1a, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x66, 0x46, 0x87, 0x8c, 0x8c, 0x7c, 0x98, 0x98, 0x70, 0x00}, |
{0x00, 0x00, 0x52, 0xb5, 0x15, 0x16, 0x2c, 0x34, 0x68, 0xa9, 0xaa, 0x4c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x48, 0xb0, 0x80, 0x48, 0x7c, 0x66, 0x26, 0x26, 0xa6, 0x46, 0x06, 0x34, 0x48, 0x00}, |
{0x00, 0x00, 0xe2, 0xa2, 0xa2, 0xa2, 0xbe, 0xa2, 0xa2, 0xa2, 0xa2, 0xe2, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x38, 0x18, 0x18, 0x36, 0x3b, 0x3b, 0x33, 0x66, 0x66, 0xe6, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x38, 0x1e, 0x18, 0x76, 0x3b, 0x3b, 0x33, 0x66, 0x66, 0xe6, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x33, 0x4e, 0x06, 0x06, 0x0c, 0x0c, 0x1f, 0x6c, 0x88, 0x70, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x71, 0x8e, 0x04, 0x0c, 0x06, 0x03, 0x63, 0xc3, 0x42, 0x3c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x46, 0x49, 0x39, 0x1e, 0x18, 0x30, 0x70, 0xb1, 0xba, 0x6c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x0e, 0x19, 0x31, 0x32, 0x64, 0x68, 0x70, 0xe1, 0x66, 0x38, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xd8, 0xff, 0xd8, 0xde, 0xdb, 0xdb, 0xdb, 0xdb, 0xdb, 0xde, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xe2, 0xa2, 0xb2, 0xb2, 0xaa, 0xaa, 0xa6, 0xa6, 0xa2, 0xe2, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xcc, 0xcf, 0xed, 0xff, 0xfc, 0xdf, 0xcc, 0xcc, 0xcc, 0xcc, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x3c, 0x42, 0xb9, 0xa5, 0xa5, 0xb9, 0xa1, 0xa1, 0x42, 0x3c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x40, 0x8e, 0x93, 0xa3, 0x63, 0x4b, 0x6a, 0xa4, 0xb0, 0xb0, 0x60, 0x00}, |
{0x00, 0x00, 0xfc, 0xa2, 0xa2, 0xa2, 0xa2, 0xbc, 0xa0, 0xa0, 0xa0, 0xe0, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x7c, 0xa2, 0xa2, 0xa2, 0xa2, 0xa2, 0xa2, 0xaa, 0xa6, 0x7e, 0x01, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x3e, 0x4d, 0x4d, 0x19, 0x1e, 0x1c, 0x34, 0x34, 0xb5, 0x62, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x58, 0xa6, 0xa3, 0x6c, 0xb8, 0x26, 0x26, 0x26, 0xa7, 0xc2, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xfc, 0xa2, 0xa2, 0xa2, 0xa2, 0xbc, 0xb0, 0xa8, 0xa4, 0xe2, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xfc, 0x66, 0x66, 0x66, 0x7c, 0x6c, 0x6d, 0x67, 0x66, 0xee, 0x08, 0x00, 0x00, 0x00}, |
{0x30, 0x0c, 0xfc, 0xc6, 0xc6, 0xc6, 0xfc, 0xd8, 0xdc, 0xdc, 0xe6, 0xe6, 0x20, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x71, 0xdb, 0x35, 0xd1, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x52, 0x5a, 0x52, 0x5f, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xf1, 0x5b, 0x55, 0x51, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x60, 0x18, 0xce, 0xd6, 0xd6, 0xd6, 0xd6, 0xd6, 0xe6, 0x6c, 0x38, 0x50, 0x40, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xfe, 0x0a, 0x14, 0x14, 0x28, 0x28, 0x50, 0x50, 0xa0, 0xfe, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xfe, 0x9c, 0x30, 0xfe, 0x0c, 0x18, 0x38, 0x0c, 0x06, 0x06, 0xc6, 0xc6, 0x7c, 0x00}, |
{0x00, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x6c, 0x6c, 0x6c, 0xee, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xee, 0x6c, 0x6c, 0x6c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x18, 0x26, 0x03, 0x13, 0x0c, 0x13, 0x03, 0x03, 0x66, 0x98, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x18, 0x18, 0x18, 0x18, 0x1c, 0x18, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xe6, 0x66, 0x66, 0x6c, 0x78, 0x78, 0x6c, 0x66, 0x66, 0xe6, 0x00, 0x00, 0x00, 0x00}, |
{0x38, 0x6c, 0x38, 0x10, 0x38, 0x38, 0x6c, 0x6c, 0xc6, 0xfe, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x1e, 0x2d, 0x2d, 0x1a, 0x1e, 0x1b, 0x31, 0x31, 0xb2, 0x6c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x14, 0x6b, 0xc8, 0xcc, 0xc6, 0xc6, 0xcc, 0xc0, 0x63, 0x1c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x66, 0xe7, 0xff, 0xe0, 0x67, 0x3e, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x26, 0x44, 0xf8, 0xc0, 0xc8, 0x70, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x4c, 0x52, 0x3c, 0x10, 0x3c, 0x60, 0xc0, 0xc3, 0xcc, 0x78, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x73, 0xce, 0x18, 0x3a, 0x5c, 0x18, 0x30, 0x30, 0xb0, 0x60, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x1e, 0x0c, 0x0c, 0x0c, 0x2c, 0x3c, 0x2c, 0x8c, 0xcc, 0xfe, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x12, 0x12, 0x12, 0x16, 0x36, 0x3e, 0x3a, 0x5a, 0x52, 0x91, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x26, 0x46, 0xc6, 0xc4, 0xc8, 0x70, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x42, 0xc6, 0xe7, 0x7a, 0x38, 0x5c, 0xce, 0xe7, 0x63, 0xe2, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x80, 0xfc, 0x7e, 0x06, 0x06, 0x06, 0x06, 0x0c, 0x7e, 0xfe, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x40, 0x78, 0x3c, 0x0c, 0x0c, 0x0c, 0x0c, 0x1e, 0x7e, 0xf2, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x80, 0xfe, 0x7e, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x1c, 0x18, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x38, 0x38, 0x00, 0x78, 0x38, 0x38, 0x38, 0x38, 0x38, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x7d, 0xff, 0x83, 0x86, 0x82, 0xfe, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0xc0, 0xc0, 0xc2, 0xc6, 0xcc, 0x18, 0x30, 0x60, 0xdc, 0x86, 0x1c, 0x06, 0x1c, 0x00, 0x00}, |
{0x00, 0xe0, 0x30, 0x62, 0xc6, 0xfc, 0x18, 0x30, 0x60, 0xdc, 0x86, 0x1c, 0x06, 0x1c, 0x00, 0x00}, |
{0x00, 0xc0, 0xc0, 0xc2, 0xc6, 0xcc, 0x18, 0x30, 0x60, 0xde, 0x98, 0x1c, 0x06, 0x1c, 0x00, 0x00}, |
{0x00, 0xe0, 0x30, 0x62, 0xc6, 0xfc, 0x18, 0x30, 0x60, 0xde, 0x98, 0x1c, 0x06, 0x1c, 0x00, 0x00}, |
{0x00, 0xe0, 0x30, 0x62, 0x36, 0xec, 0x18, 0x30, 0x60, 0xde, 0x98, 0x1c, 0x06, 0x1c, 0x00, 0x00}, |
{0x00, 0x30, 0x70, 0xb2, 0xf6, 0x3c, 0x18, 0x30, 0x60, 0xde, 0x98, 0x1c, 0x06, 0x1c, 0x00, 0x00}, |
{0x00, 0xc0, 0xc0, 0xc2, 0xc6, 0xcc, 0x18, 0x30, 0x60, 0xdc, 0xb0, 0x3c, 0x36, 0x1c, 0x00, 0x00}, |
{0x00, 0xf0, 0xc0, 0xe2, 0x36, 0xec, 0x18, 0x30, 0x60, 0xdc, 0xb0, 0x3c, 0x36, 0x1c, 0x00, 0x00}, |
{0x00, 0xc0, 0xc0, 0xc2, 0xc6, 0xcc, 0x18, 0x30, 0x60, 0xdc, 0xb6, 0x1c, 0x36, 0x1c, 0x00, 0x00}, |
{0x00, 0xe0, 0x30, 0x62, 0x36, 0xec, 0x18, 0x30, 0x60, 0xdc, 0xb6, 0x1c, 0x36, 0x1c, 0x00, 0x00}, |
{0x00, 0xf0, 0x80, 0xe2, 0x36, 0xec, 0x18, 0x30, 0x60, 0xdc, 0xb6, 0x1c, 0x36, 0x1c, 0x00, 0x00}, |
{0x00, 0xf0, 0x30, 0x62, 0x66, 0x6c, 0x18, 0x30, 0x60, 0xdc, 0xb6, 0x1c, 0x36, 0x1c, 0x00, 0x00}, |
{0x00, 0xc0, 0xc0, 0xc2, 0xc6, 0xcc, 0x18, 0x30, 0x60, 0xc0, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x3c, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xfe, 0x6c, 0x6c, 0x6c, 0x6c, 0x6c, 0x6c, 0x6c, 0x6c, 0xfe, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xff, 0xdb, 0xdb, 0xdb, 0xdb, 0xdb, 0xdb, 0xdb, 0xdb, 0xff, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xdb, 0xdb, 0xdb, 0xdb, 0xdb, 0xdb, 0xdb, 0xce, 0xce, 0xc4, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x6c, 0x38, 0x10, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xdb, 0xdb, 0xdb, 0xdb, 0xdb, 0xdb, 0xdb, 0x73, 0x73, 0x23, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x95, 0x65, 0x65, 0x65, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xb5, 0xb5, 0xb5, 0xb5, 0xb5, 0xb5, 0x55, 0x55, 0x55, 0x55, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xdb, 0xdb, 0xdb, 0xce, 0xce, 0xce, 0xdb, 0xdb, 0xdb, 0xdb, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xc6, 0xc6, 0x6c, 0x7c, 0x38, 0x38, 0x7c, 0x6c, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xdb, 0xdb, 0xdb, 0x73, 0x73, 0x73, 0xdb, 0xdb, 0xdb, 0xdb, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x95, 0x95, 0x95, 0x65, 0x65, 0x65, 0x95, 0x95, 0x95, 0x95, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xf0, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x62, 0x66, 0xfe, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x3c, 0x66, 0xc2, 0xc0, 0xc0, 0xc0, 0xc0, 0xc2, 0x66, 0x3c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xf8, 0x6c, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x6c, 0xf8, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xc6, 0xee, 0xfe, 0xfe, 0xd6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x18, 0x18, 0x00, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x6c, 0x6c, 0x00, 0x6c, 0x6c, 0x6c, 0x6c, 0x6c, 0x6c, 0x6c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xdb, 0xdb, 0x00, 0xdb, 0xdb, 0xdb, 0xdb, 0xdb, 0xdb, 0xdb, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xc0, 0xc0, 0x00, 0xdb, 0xdb, 0xdb, 0xdb, 0xdb, 0xce, 0xc4, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x66, 0x66, 0x66, 0x66, 0x66, 0x3c, 0x18, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x03, 0x03, 0x00, 0xdb, 0xdb, 0xdb, 0xdb, 0xdb, 0x73, 0x23, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x05, 0x05, 0x00, 0x95, 0x95, 0x95, 0x95, 0x95, 0x65, 0x65, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x15, 0x15, 0x00, 0xb5, 0xb5, 0xb5, 0xb5, 0x55, 0x55, 0x55, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xc0, 0xc0, 0x00, 0xdb, 0xdb, 0xce, 0xce, 0xce, 0xdb, 0xdb, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0xc6, 0x6c, 0x38, 0x38, 0x38, 0x6c, 0xc6, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x03, 0x03, 0x00, 0xdb, 0xdb, 0x73, 0x73, 0x73, 0xdb, 0xdb, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x05, 0x05, 0x00, 0x95, 0x95, 0x65, 0x65, 0x95, 0x95, 0x95, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, 0xc0, 0xc0, 0xc0, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x1c, 0x0c, 0x0c, 0x3c, 0x6c, 0xcc, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0xec, 0xfe, 0xd6, 0xd6, 0xd6, 0xd6, 0xc6, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x3c, 0x5a, 0xdb, 0xdb, 0xdb, 0xdb, 0xdb, 0xdb, 0x5a, 0x3c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xf8, 0xcc, 0xe6, 0xd6, 0xd6, 0xd6, 0xd6, 0xe6, 0xcc, 0xf8, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x3c, 0x5a, 0x99, 0xbd, 0xdb, 0xdb, 0xbd, 0x99, 0x5a, 0x3c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x78, 0xcc, 0x86, 0x06, 0x06, 0x06, 0x06, 0x86, 0xcc, 0x78, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x60, 0xff, 0x60, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x18, 0x3c, 0x7e, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x06, 0xff, 0x06, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x7e, 0x3c, 0x18, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x24, 0x66, 0xff, 0x66, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x18, 0x3c, 0x7e, 0x18, 0x18, 0x18, 0x7e, 0x3c, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0xf0, 0xe0, 0xb0, 0x18, 0x0c, 0x06, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x0f, 0x07, 0x0d, 0x18, 0x30, 0x60, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0xc0, 0x60, 0x30, 0x18, 0x0d, 0x07, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x03, 0x06, 0x0c, 0x18, 0xb0, 0xe0, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x62, 0xff, 0x64, 0x34, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x2c, 0x26, 0xff, 0x46, 0x4c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xce, 0xbb, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x73, 0xdd, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x6c, 0xff, 0x6c, 0x36, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x18, 0x3c, 0x7e, 0x18, 0x3c, 0x7e, 0x18, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x6c, 0x36, 0xff, 0x36, 0x6c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0x7e, 0x3c, 0x18, 0x7e, 0x3c, 0x18, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x33, 0x66, 0xfc, 0x66, 0x33, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0xcc, 0x66, 0x3f, 0x66, 0xcc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x33, 0x63, 0xff, 0x63, 0x33, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x18, 0x3c, 0x7e, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x7e, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0xcc, 0xc6, 0xff, 0xc6, 0xcc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x7e, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x7e, 0x3c, 0x18, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x18, 0x3c, 0x7e, 0x18, 0x18, 0x18, 0x7e, 0x3c, 0x18, 0x7e, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x06, 0x33, 0x63, 0xfe, 0x60, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x60, 0xcc, 0xc6, 0x7f, 0x06, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x06, 0x3b, 0x6b, 0xfe, 0x68, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x60, 0xdc, 0xd6, 0x7f, 0x16, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x24, 0x5a, 0xff, 0x66, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x2c, 0x6e, 0xff, 0x76, 0x34, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x30, 0x30, 0x60, 0x63, 0xff, 0xc6, 0x16, 0x1c, 0x1c, 0x1e, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x30, 0x60, 0xfe, 0x66, 0x36, 0x06, 0x06, 0x06, 0x06, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x18, 0x0c, 0xfe, 0xcc, 0xd8, 0xc0, 0xc0, 0xc0, 0xc0, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x06, 0x06, 0x06, 0x06, 0x36, 0x66, 0xfe, 0x60, 0x30, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0xc0, 0xc0, 0xc0, 0xc0, 0xd8, 0xcc, 0xfe, 0x0c, 0x18, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x0c, 0x0c, 0x3f, 0x1e, 0x0c, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x36, 0x66, 0xfe, 0x60, 0x30, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x1e, 0x33, 0x33, 0x33, 0x30, 0xfc, 0x78, 0x30, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x78, 0xcc, 0xcc, 0xcc, 0x0c, 0x3f, 0x1e, 0x0c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xff, 0x00, 0xf0, 0xe0, 0xb0, 0x18, 0x0c, 0x06, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x98, 0xb0, 0xff, 0xb0, 0x98, 0x19, 0x0d, 0xff, 0x0d, 0x19, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x1e, 0x1c, 0x16, 0x03, 0xc3, 0xc3, 0xc3, 0x66, 0x3c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x78, 0x38, 0x68, 0xc0, 0xc3, 0xc3, 0xc3, 0x66, 0x3c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x60, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x60, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x18, 0x1c, 0x1e, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x18, 0x38, 0x78, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x06, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x06, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x1e, 0x1c, 0x18, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x78, 0x38, 0x18, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x0c, 0x06, 0xff, 0x06, 0x0c, 0x30, 0x60, 0xff, 0x60, 0x30, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x24, 0x2e, 0x3f, 0x24, 0x24, 0x24, 0x24, 0xfc, 0x74, 0x24, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x30, 0x60, 0xff, 0x60, 0x30, 0x0c, 0x06, 0xff, 0x06, 0x0c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x30, 0x60, 0xfe, 0x60, 0x30, 0x00, 0x30, 0x60, 0xfe, 0x60, 0x30, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x24, 0x7e, 0xff, 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x18, 0x0c, 0xfe, 0x0c, 0x18, 0x00, 0x18, 0x0c, 0xfe, 0x0c, 0x18, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, 0x24, 0xff, 0x7e, 0x24, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x30, 0x60, 0xff, 0x00, 0xff, 0x06, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x0c, 0x06, 0xff, 0x00, 0xff, 0x60, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x22, 0x7f, 0xc4, 0x7f, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x2c, 0x7e, 0xcb, 0x7e, 0x34, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x24, 0xfe, 0x23, 0xfe, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x7f, 0xc0, 0x7f, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x38, 0x7c, 0xee, 0x6c, 0x6c, 0x6c, 0x6c, 0x6c, 0x6c, 0x6c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0xfe, 0x03, 0xfe, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x6c, 0x6c, 0x6c, 0x6c, 0x6c, 0x6c, 0x6c, 0xee, 0x7c, 0x38, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x24, 0x7e, 0xc3, 0x7e, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x38, 0x7c, 0xee, 0x6c, 0x6c, 0x6c, 0x6c, 0xee, 0x7c, 0x38, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0xf0, 0xe0, 0xb0, 0xd8, 0xec, 0xb6, 0x1b, 0x0c, 0x04, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x0f, 0x07, 0x0d, 0x1b, 0x37, 0x6d, 0xd8, 0x30, 0x20, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x20, 0x30, 0xd8, 0x6d, 0x37, 0x1b, 0x0d, 0x07, 0x0f, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x04, 0x0c, 0x1b, 0xb6, 0xec, 0xd8, 0xb0, 0xe0, 0xf0, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x10, 0x3f, 0x60, 0xff, 0x60, 0x3f, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x08, 0xfc, 0x06, 0xff, 0x06, 0xfc, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x6a, 0xff, 0x65, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0xa6, 0xff, 0x56, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x18, 0x3c, 0x7e, 0x18, 0x18, 0x3c, 0x18, 0x3c, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x18, 0x18, 0x3c, 0x18, 0x3c, 0x18, 0x18, 0x7e, 0x3c, 0x18, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x60, 0xd5, 0x60, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x18, 0x3c, 0x66, 0x18, 0x00, 0x18, 0x00, 0x18, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x06, 0xab, 0x06, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x18, 0x00, 0x18, 0x00, 0x18, 0x00, 0x18, 0x66, 0x3c, 0x18, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x98, 0xb0, 0xff, 0xb0, 0x98, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x19, 0x0d, 0xff, 0x0d, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x10, 0x3f, 0x41, 0x81, 0x41, 0x3f, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x10, 0x28, 0x44, 0xc6, 0x44, 0x44, 0x44, 0x44, 0x44, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x08, 0xfc, 0x82, 0x81, 0x82, 0xfc, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x7c, 0x44, 0x44, 0x44, 0x44, 0x44, 0xc6, 0x44, 0x28, 0x10, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x10, 0x28, 0x44, 0xc6, 0x44, 0x44, 0x7c, 0x00, 0x7c, 0x44, 0x7c, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x10, 0x28, 0x44, 0xc6, 0x44, 0x44, 0x44, 0xc6, 0x82, 0xfe, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x10, 0x28, 0x7c, 0xc6, 0x44, 0x44, 0x44, 0xc6, 0x82, 0xfe, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x10, 0x38, 0x54, 0xd6, 0x54, 0x54, 0x54, 0xd6, 0x92, 0xfe, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x10, 0x28, 0x54, 0xee, 0x44, 0xc6, 0x44, 0x44, 0x44, 0x44, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x10, 0x28, 0x54, 0xee, 0x44, 0xc6, 0x44, 0x44, 0xc6, 0x82, 0xfe, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0xe8, 0xbc, 0x82, 0x81, 0x82, 0xbc, 0xe8, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xff, 0x80, 0xbc, 0xb8, 0xac, 0x86, 0x83, 0x81, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x01, 0x81, 0xc1, 0x61, 0x35, 0x1d, 0x3d, 0x01, 0xff, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x10, 0x28, 0x44, 0xc6, 0x44, 0x44, 0x44, 0xc6, 0x44, 0x28, 0x10, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xc6, 0xc6, 0xfe, 0xc6, 0x6c, 0x6c, 0x38, 0x38, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x66, 0x60, 0x60, 0x60, 0x60, 0x60, 0x66, 0x3c, 0x00, 0x00}, |
{0x00, 0x00, 0x38, 0x6c, 0x06, 0x06, 0x3e, 0x66, 0xc6, 0xc6, 0xcc, 0x78, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xfe, 0x06, 0x06, 0x06, 0x7e, 0x06, 0x06, 0x06, 0x06, 0xfe, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x08, 0xfe, 0x16, 0x16, 0x16, 0x7e, 0x16, 0x26, 0x26, 0x26, 0xfe, 0x40, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x03, 0x3e, 0x66, 0xcf, 0xdb, 0xdb, 0xf3, 0x66, 0x7c, 0xc0, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x10, 0x10, 0x38, 0x38, 0x6c, 0x6c, 0xc6, 0xc6, 0xc6, 0xfe, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xfe, 0xc6, 0xc6, 0xc6, 0x6c, 0x6c, 0x38, 0x38, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x3e, 0x60, 0xc0, 0xc0, 0xfe, 0xc0, 0xc0, 0x60, 0x3e, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x04, 0x3e, 0x64, 0xc8, 0xc8, 0xfe, 0xc8, 0xd0, 0x70, 0x3e, 0x20, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x3e, 0x60, 0xc0, 0xfe, 0xc0, 0x60, 0x3e, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0xf8, 0x0c, 0x06, 0x06, 0xfe, 0x06, 0x06, 0x0c, 0xf8, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x08, 0xf8, 0x1c, 0x16, 0x26, 0xfe, 0x26, 0x26, 0x4c, 0xf8, 0x40, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0xf8, 0x0c, 0x06, 0xfe, 0x06, 0x0c, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x7e, 0x7e, 0x7e, 0x7e, 0x7e, 0x7e, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xff, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0xe7, 0x00, 0x00}, |
{0x00, 0x00, 0xe7, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0xff, 0x00, 0x00}, |
{0x00, 0x00, 0xff, 0xc1, 0x60, 0x30, 0x18, 0x0c, 0x0c, 0x18, 0x30, 0x60, 0xc1, 0xff, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x7e, 0x00, 0x18, 0x18, 0x7e, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x18, 0x18, 0x7e, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x06, 0x06, 0x0c, 0x0c, 0x18, 0x18, 0x30, 0x30, 0x60, 0x60, 0xc0, 0xc0, 0x00, 0x00, 0x00}, |
{0x00, 0xc0, 0xc0, 0x60, 0x60, 0x30, 0x30, 0x18, 0x18, 0x0c, 0x0c, 0x06, 0x06, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x24, 0x18, 0x7e, 0x18, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x24, 0x24, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x3c, 0x3c, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x03, 0x03, 0x06, 0x06, 0x06, 0x0c, 0xcc, 0x6c, 0x38, 0x18, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xe3, 0x33, 0x66, 0x36, 0xe6, 0x0c, 0xcc, 0x6c, 0x38, 0x18, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x33, 0x73, 0xb6, 0xf6, 0x36, 0x0c, 0xcc, 0x6c, 0x38, 0x18, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0xd8, 0xd8, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0xdb, 0xdb, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xfe, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x06, 0x0c, 0x18, 0x30, 0x60, 0xff, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x16, 0x0c, 0x1c, 0x34, 0x62, 0xff, 0x02, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x10, 0x0e, 0x38, 0xe8, 0x38, 0x0e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x18, 0x18, 0x18, 0x1a, 0x1c, 0x38, 0x58, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x6c, 0x6c, 0x6c, 0x6c, 0x6c, 0x6c, 0x6c, 0x6c, 0x6c, 0x6c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x6c, 0x6c, 0x6c, 0x6e, 0x7c, 0xec, 0x6c, 0x6c, 0x6c, 0x6c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x10, 0x10, 0x38, 0x38, 0x6c, 0x6c, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0xc6, 0xc6, 0x6c, 0x6c, 0x38, 0x38, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x0c, 0x1a, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x58, 0x30, 0x00, 0x00}, |
{0x33, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0xcc, 0x00, 0x00}, |
{0x2a, 0x54, 0x54, 0x54, 0x54, 0x54, 0x54, 0x54, 0x54, 0x54, 0x54, 0x54, 0x54, 0xa8, 0x00, 0x00}, |
{0x0c, 0x1a, 0x18, 0x18, 0x3c, 0x5a, 0x99, 0x99, 0x5a, 0x3c, 0x18, 0x18, 0x58, 0x30, 0x00, 0x00}, |
{0x33, 0x66, 0x66, 0x66, 0x7e, 0xe7, 0xe7, 0xe7, 0xe7, 0x7e, 0x66, 0x66, 0x66, 0xcc, 0x00, 0x00}, |
{0x2a, 0x54, 0x54, 0x54, 0x7c, 0xd6, 0xd6, 0xd6, 0xd6, 0x7c, 0x54, 0x54, 0x54, 0xa8, 0x00, 0x00}, |
{0x18, 0x34, 0x30, 0x30, 0x38, 0x35, 0x33, 0x37, 0x30, 0x30, 0x30, 0x30, 0xb0, 0x60, 0x00, 0x00}, |
{0x0c, 0x1a, 0x18, 0x18, 0x3c, 0x5a, 0xfa, 0x5a, 0x5a, 0x3c, 0x18, 0x18, 0x58, 0x30, 0x00, 0x00}, |
{0x0c, 0x1a, 0x18, 0x18, 0x3c, 0x5a, 0x5f, 0x5a, 0x5a, 0x3c, 0x18, 0x18, 0x58, 0x30, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x66, 0x66, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x66, 0x66, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x66, 0x66, 0x00, 0x00, 0x00, 0x66, 0x66, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x03, 0x03, 0x00, 0xfc, 0x00, 0x03, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x66, 0x66, 0x00, 0x7e, 0x00, 0x66, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x76, 0xdc, 0x00, 0x30, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0xdc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xdc, 0x76, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x72, 0xdb, 0xdb, 0x4e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x70, 0xd8, 0xdb, 0xdb, 0x1b, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x1c, 0x30, 0x30, 0x30, 0x18, 0x0c, 0x0c, 0x0c, 0x38, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x08, 0x08, 0x10, 0x76, 0xdc, 0x10, 0x20, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x00, 0x76, 0xdc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0xdc, 0x00, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x08, 0x08, 0x76, 0xdc, 0x10, 0xfe, 0x20, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x76, 0xdc, 0x00, 0xfe, 0x00, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x76, 0xdc, 0x08, 0xfe, 0x10, 0xfe, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x08, 0x08, 0x76, 0xdc, 0x10, 0xfe, 0x20, 0xfe, 0x40, 0x40, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0xdc, 0x00, 0x76, 0xdc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x08, 0x08, 0x76, 0xdc, 0x10, 0x76, 0xdc, 0x20, 0x20, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x76, 0xdc, 0x00, 0x76, 0xdc, 0x00, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x76, 0xdc, 0x00, 0x76, 0xdc, 0x00, 0x76, 0xdc, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0xdc, 0x76, 0x00, 0xfe, 0x00, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0xc6, 0x7c, 0x00, 0x7c, 0xc6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x18, 0x66, 0x00, 0x00, 0x66, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x18, 0x66, 0x00, 0x00, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x18, 0x18, 0x00, 0x7e, 0x00, 0x00, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x18, 0x18, 0x00, 0x7e, 0x00, 0x00, 0x7e, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x60, 0x60, 0x00, 0x7e, 0x00, 0x00, 0x7e, 0x00, 0x06, 0x06, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x06, 0x06, 0x00, 0x7e, 0x00, 0x00, 0x7e, 0x00, 0x60, 0x60, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0xc0, 0xdf, 0x00, 0x00, 0xdf, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x03, 0xfb, 0x00, 0x00, 0xfb, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x28, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x10, 0x28, 0x10, 0x00, 0xfe, 0x00, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x38, 0x44, 0x00, 0xfe, 0x00, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x10, 0x28, 0x44, 0x00, 0xfe, 0x00, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x44, 0x28, 0x10, 0x00, 0xfe, 0x00, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x10, 0x10, 0x7c, 0x28, 0x00, 0xfe, 0x00, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x10, 0x28, 0x44, 0x7c, 0x00, 0xfe, 0x00, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x26, 0x7c, 0xb4, 0x6c, 0x00, 0xfe, 0x00, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x68, 0x54, 0x54, 0x00, 0xfe, 0x00, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x30, 0x08, 0x10, 0x00, 0x10, 0xfe, 0x00, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x04, 0x08, 0x7e, 0x08, 0x10, 0x7e, 0x10, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0xfe, 0x00, 0x00, 0xfe, 0x00, 0x00, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x04, 0x08, 0xfe, 0x08, 0x10, 0xfe, 0x10, 0x20, 0xfe, 0x20, 0x40, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xfe, 0x00, 0x00, 0xfe, 0x00, 0x00, 0xfe, 0x00, 0x00, 0xfe, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x0e, 0x38, 0xe0, 0x38, 0x0e, 0x00, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0xe0, 0x38, 0x0e, 0x38, 0xe0, 0x00, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x0e, 0x38, 0xe0, 0x38, 0x0e, 0x00, 0xfe, 0x00, 0xfe, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0xe0, 0x38, 0x0e, 0x38, 0xe0, 0x00, 0xfe, 0x00, 0xfe, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x0e, 0x38, 0xe0, 0x38, 0x0e, 0x08, 0xfe, 0x10, 0xfe, 0x20, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0xe0, 0x38, 0x0e, 0x38, 0xe0, 0x08, 0xfe, 0x10, 0xfe, 0x20, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x1b, 0x36, 0x6c, 0xd8, 0x6c, 0x36, 0x1b, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0xd8, 0x6c, 0x36, 0x1b, 0x36, 0x6c, 0xd8, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x66, 0x18, 0x3c, 0x66, 0x66, 0x66, 0x66, 0x3c, 0x18, 0x66, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x08, 0xce, 0x7c, 0x10, 0x7c, 0xe6, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x04, 0x04, 0x0e, 0x38, 0xe8, 0x38, 0x0e, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x10, 0x10, 0xe0, 0x38, 0x2e, 0x38, 0xe0, 0x40, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x04, 0x04, 0x0e, 0x38, 0xe8, 0x38, 0x0e, 0x10, 0xfe, 0x10, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x10, 0x10, 0xe0, 0x38, 0x2e, 0x38, 0xe0, 0x40, 0xfe, 0x40, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x0e, 0x38, 0xe0, 0x38, 0x0e, 0x00, 0x76, 0xdc, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0xe0, 0x38, 0x0e, 0x38, 0xe0, 0x00, 0x76, 0xdc, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x04, 0x04, 0x0e, 0x38, 0xe8, 0x38, 0x0e, 0x10, 0x76, 0xdc, 0x20, 0x20, 0x00, 0x00}, |
{0x00, 0x00, 0x10, 0x10, 0xe0, 0x38, 0x2e, 0x38, 0xe0, 0x40, 0x76, 0xdc, 0x80, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x0e, 0x38, 0xe0, 0x38, 0x0e, 0xe0, 0x38, 0x0e, 0x38, 0xe0, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xe0, 0x38, 0x0e, 0x38, 0xe0, 0x0e, 0x38, 0xe0, 0x38, 0x0e, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x08, 0x0e, 0x38, 0xe8, 0x38, 0x1e, 0xf0, 0x38, 0x2e, 0x38, 0xe0, 0x20, 0x00, 0x00, 0x00}, |
{0x00, 0x08, 0xe8, 0x38, 0x0e, 0x38, 0xf0, 0x1e, 0x38, 0xe0, 0x38, 0x2e, 0x20, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x02, 0x06, 0x1c, 0xf0, 0x1c, 0x06, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x80, 0xc0, 0x70, 0x1e, 0x70, 0xc0, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x02, 0x06, 0x1c, 0xf0, 0x1c, 0x06, 0xf2, 0x1c, 0x06, 0x02, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x80, 0xc0, 0x70, 0x1e, 0x70, 0xc0, 0x9e, 0x70, 0xc0, 0x80, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x02, 0x06, 0x1c, 0xf0, 0x1c, 0x06, 0x02, 0x00, 0x76, 0xdc, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x80, 0xc0, 0x70, 0x1e, 0x70, 0xc0, 0x80, 0x00, 0x76, 0xdc, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x04, 0x06, 0x0c, 0x38, 0xe8, 0x38, 0x1c, 0x16, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x10, 0xd0, 0x70, 0x38, 0x2e, 0x38, 0x60, 0xc0, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x7e, 0xc0, 0xc0, 0xc0, 0xc0, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0xfc, 0x06, 0x06, 0x06, 0x06, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x04, 0x7e, 0xc8, 0xc8, 0xd0, 0xd0, 0x7e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x08, 0xfc, 0x16, 0x16, 0x26, 0x26, 0xfc, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x7e, 0xc0, 0xc0, 0xc0, 0xc0, 0x7e, 0x00, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0xfc, 0x06, 0x06, 0x06, 0x06, 0xfc, 0x00, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x04, 0x7e, 0xc8, 0xc8, 0xd0, 0xd0, 0x7e, 0x20, 0xfe, 0x40, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x08, 0xfc, 0x16, 0x16, 0x26, 0x26, 0xfc, 0x40, 0xfe, 0x80, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x7e, 0xc0, 0xc0, 0xc0, 0xc0, 0x7e, 0x08, 0xfe, 0x10, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0xfc, 0x06, 0x06, 0x06, 0x06, 0xfc, 0x10, 0xfe, 0x20, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x82, 0x92, 0xa2, 0xfa, 0xa2, 0x92, 0x44, 0x38, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x82, 0x82, 0x92, 0xba, 0xba, 0x92, 0x44, 0x38, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x82, 0x82, 0x92, 0xba, 0x92, 0x82, 0x44, 0x38, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0xfe, 0xc0, 0xc0, 0xc0, 0xc0, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0xfe, 0x06, 0x06, 0x06, 0x06, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0xfe, 0xc0, 0xc0, 0xc0, 0xc0, 0xfe, 0x00, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0xfe, 0x06, 0x06, 0x06, 0x06, 0xfe, 0x00, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0xfe, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xfe, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x38, 0x54, 0x92, 0xfe, 0x92, 0x54, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x38, 0x44, 0x82, 0xfe, 0x82, 0x44, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x38, 0x44, 0xaa, 0x92, 0xaa, 0x44, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x38, 0x44, 0x8a, 0x92, 0xa2, 0x44, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x38, 0x44, 0x92, 0xba, 0x92, 0x44, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x38, 0x44, 0x92, 0xaa, 0x92, 0x44, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x38, 0x54, 0xd6, 0xba, 0xd6, 0x54, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x38, 0x44, 0xba, 0x82, 0xba, 0x44, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x38, 0x44, 0x82, 0xba, 0x82, 0x44, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0xfe, 0x92, 0x92, 0xfe, 0x92, 0x92, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0xfe, 0x82, 0x82, 0xfe, 0x82, 0x82, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0xfe, 0xc6, 0xaa, 0x92, 0xaa, 0xc6, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0xfe, 0x82, 0x92, 0xba, 0x92, 0x82, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0xc0, 0xc0, 0xc0, 0xc0, 0xff, 0xc0, 0xc0, 0xc0, 0xc0, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x03, 0x03, 0x03, 0x03, 0xff, 0x03, 0x03, 0x03, 0x03, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xff, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xff, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x60, 0x60, 0x60, 0x60, 0x7e, 0x60, 0x60, 0x60, 0x60, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x60, 0x60, 0x60, 0x7e, 0x60, 0x7e, 0x60, 0x60, 0x60, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0xc0, 0xc0, 0xc0, 0xff, 0xc0, 0xff, 0xc0, 0xc0, 0xc0, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0xd8, 0xd8, 0xd8, 0xd8, 0xdf, 0xd8, 0xd8, 0xd8, 0xd8, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0xa8, 0xa8, 0xa8, 0xa8, 0xaf, 0xa8, 0xa8, 0xa8, 0xa8, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0xd8, 0xd8, 0xd8, 0xdf, 0xd8, 0xdf, 0xd8, 0xd8, 0xd8, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0xc0, 0xc2, 0xc4, 0xc4, 0xff, 0xc8, 0xc8, 0xd0, 0xc0, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0xc0, 0xc4, 0xc4, 0xff, 0xc8, 0xff, 0xd0, 0xd0, 0xc0, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0xd8, 0xd9, 0xda, 0xda, 0xdf, 0xda, 0xda, 0xdc, 0xd8, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0xd8, 0xd9, 0xda, 0xdf, 0xda, 0xdf, 0xda, 0xdc, 0xd8, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x0c, 0x06, 0x1c, 0xf0, 0x1c, 0x06, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x60, 0xc0, 0x70, 0x1e, 0x70, 0xc0, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x06, 0x1e, 0x76, 0xc6, 0x76, 0x1e, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0xc0, 0xf0, 0xdc, 0xc6, 0xdc, 0xf0, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x06, 0x1e, 0x76, 0xc6, 0x76, 0x1e, 0x06, 0x00, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xc0, 0xf0, 0xdc, 0xc6, 0xdc, 0xf0, 0xc0, 0x00, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x42, 0xbf, 0x42, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x42, 0xfd, 0x42, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x7d, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x10, 0x10, 0x00, 0xc6, 0x00, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x7e, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xc6, 0xc6, 0x6c, 0x6c, 0x38, 0x38, 0x10, 0x10, 0x00, 0xfe, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xfe, 0x00, 0x10, 0x10, 0x38, 0x38, 0x6c, 0x6c, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xfe, 0x00, 0xc6, 0xc6, 0x6c, 0x6c, 0x38, 0x38, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0xc0, 0xf0, 0xc8, 0xc4, 0xc4, 0xff, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x03, 0x07, 0x0b, 0x13, 0x23, 0x43, 0x83, 0xff, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x10, 0x10, 0x38, 0x38, 0x6c, 0x6c, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0xc6, 0xc6, 0x6c, 0x6c, 0x38, 0x38, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x38, 0x6c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x6c, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x38, 0x6c, 0x38, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x10, 0x7c, 0x38, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x92, 0x44, 0x28, 0x92, 0x28, 0x44, 0x92, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x82, 0xc6, 0xaa, 0x92, 0xaa, 0xc6, 0x82, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x82, 0xc4, 0xa8, 0x90, 0xa8, 0xc4, 0x82, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x82, 0x46, 0x2a, 0x12, 0x2a, 0x46, 0x82, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x80, 0x40, 0x20, 0x10, 0x28, 0x44, 0x82, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x02, 0x04, 0x08, 0x10, 0x28, 0x44, 0x82, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0xdc, 0x76, 0x00, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x10, 0x10, 0x10, 0x38, 0x38, 0x6c, 0x6c, 0xc6, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0xc6, 0x6c, 0x6c, 0x38, 0x38, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x3e, 0x60, 0xce, 0xd8, 0xd8, 0xce, 0x60, 0x3e, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0xf8, 0x0c, 0xe6, 0x36, 0x36, 0xe6, 0x0c, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x38, 0x44, 0x92, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0x92, 0x44, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x10, 0x10, 0x38, 0x54, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x18, 0x18, 0x18, 0x7e, 0x18, 0x18, 0x7e, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x18, 0x30, 0x64, 0xce, 0x64, 0x30, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x30, 0x18, 0x4c, 0xe6, 0x4c, 0x18, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x15, 0x2a, 0x54, 0xa8, 0x54, 0x2a, 0x15, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0xa8, 0x54, 0x2a, 0x15, 0x2a, 0x54, 0xa8, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x0e, 0x38, 0xe0, 0x38, 0x0e, 0x00, 0xfe, 0x00, 0xe0, 0x38, 0x0e, 0x38, 0xe0, 0x00, 0x00}, |
{0x00, 0xe0, 0x38, 0x0e, 0x38, 0xe0, 0x00, 0xfe, 0x00, 0x0e, 0x38, 0xe0, 0x38, 0x0e, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0xfe, 0x00, 0x0e, 0x38, 0xe0, 0x38, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0xfe, 0x00, 0xe0, 0x38, 0x0e, 0x38, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x02, 0x06, 0x1c, 0xf2, 0x06, 0x1c, 0xf0, 0x1c, 0x06, 0x02, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x80, 0xc0, 0x70, 0x9e, 0xc0, 0x70, 0x1e, 0x70, 0xc0, 0x80, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x0a, 0x0e, 0x1c, 0xf0, 0x1c, 0x16, 0xf2, 0x1c, 0x26, 0x22, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x88, 0xc8, 0x70, 0x1e, 0x70, 0xd0, 0x9e, 0x70, 0xe0, 0xa0, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x04, 0xfe, 0xc8, 0xc8, 0xd0, 0xd0, 0xfe, 0x20, 0xfe, 0x40, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x08, 0xfe, 0x16, 0x16, 0x26, 0x26, 0xfe, 0x40, 0xfe, 0x80, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0xfe, 0xc0, 0xc0, 0xc0, 0xc0, 0xfe, 0x08, 0xfe, 0x10, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0xfe, 0x06, 0x06, 0x06, 0x06, 0xfe, 0x10, 0xfe, 0x20, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x0e, 0x38, 0xe0, 0x38, 0x0e, 0x10, 0x76, 0xdc, 0x10, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0xe0, 0x38, 0x0e, 0x38, 0xe0, 0x10, 0x76, 0xdc, 0x10, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x02, 0x06, 0x1c, 0xf0, 0x1c, 0x06, 0x02, 0x10, 0x76, 0xdc, 0x10, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x80, 0xc0, 0x70, 0x1e, 0x70, 0xc0, 0x80, 0x10, 0x76, 0xdc, 0x10, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x08, 0x0e, 0x1e, 0x76, 0xd6, 0x76, 0x1e, 0x26, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x08, 0xc8, 0xf0, 0xdc, 0xd6, 0xdc, 0xf0, 0xe0, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x08, 0x0e, 0x1e, 0x76, 0xd6, 0x76, 0x1e, 0x26, 0x20, 0xfe, 0x40, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x08, 0xc8, 0xf0, 0xdc, 0xd6, 0xdc, 0xf0, 0xe0, 0x20, 0xfe, 0x40, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xdb, 0xdb, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x03, 0x03, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0xc0, 0xc0, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xc0, 0xc0, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x03, 0x03, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x3d, 0x66, 0xc7, 0xcb, 0xd3, 0xe3, 0x66, 0xbc, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x10, 0x38, 0x6c, 0xc6, 0xc6, 0xc6, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x1e, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18}, |
{0x00, 0x00, 0x78, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18}, |
{0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x1e, 0x00, 0x00, 0x00, 0x00}, |
{0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x78, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xc0, 0xc0, 0xc0, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x42, 0xa5, 0x7e, 0x24, 0x24, 0x7e, 0xa5, 0x42, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x38, 0x38, 0x54, 0x8a, 0xf6, 0x82, 0x54, 0x38, 0x38, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0xfe, 0xfe, 0x44, 0x44, 0x28, 0x10, 0x28, 0x44, 0x44, 0xfe, 0xfe, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x0e, 0x1b, 0x1b, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18}, |
{0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xd8, 0xd8, 0xd8, 0x70, 0x00, 0x00, 0x00, 0x00}, |
{0x0c, 0x0c, 0x18, 0x18, 0x30, 0x30, 0x60, 0x60, 0x30, 0x30, 0x18, 0x18, 0x0c, 0x0c, 0x00, 0x00}, |
{0x60, 0x60, 0x30, 0x30, 0x18, 0x18, 0x0c, 0x0c, 0x18, 0x18, 0x30, 0x30, 0x60, 0x60, 0x00, 0x00}, |
{0x00, 0x03, 0x06, 0x0c, 0x0c, 0x18, 0x18, 0x18, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30}, |
{0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30}, |
{0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x18, 0x18, 0x18, 0x0c, 0x0c, 0x06, 0x03, 0x00, 0x00}, |
{0x00, 0xc0, 0x60, 0x30, 0x30, 0x18, 0x18, 0x18, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c}, |
{0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c}, |
{0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x18, 0x18, 0x18, 0x30, 0x30, 0x60, 0xc0, 0x00, 0x00}, |
{0x00, 0x3f, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30}, |
{0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30}, |
{0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x3f, 0x00, 0x00}, |
{0x00, 0xfc, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c}, |
{0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c}, |
{0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0xfc, 0x00, 0x00}, |
{0x00, 0x07, 0x0c, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18}, |
{0x18, 0x18, 0x18, 0x18, 0x18, 0x30, 0xe0, 0x30, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18}, |
{0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x0c, 0x07, 0x00, 0x00}, |
{0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18}, |
{0x00, 0xe0, 0x30, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18}, |
{0x18, 0x18, 0x18, 0x18, 0x18, 0x0c, 0x07, 0x0c, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18}, |
{0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x30, 0xe0, 0x00, 0x00}, |
{0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x07, 0x0c, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x30, 0xe0}, |
{0xe0, 0x30, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x0c, 0x07}, |
{0x00, 0x00, 0xff, 0xc1, 0xc0, 0x60, 0x60, 0x60, 0x60, 0x30, 0x30, 0x30, 0x30, 0x18, 0x18, 0x18}, |
{0x18, 0x18, 0x18, 0x30, 0x30, 0x30, 0x30, 0x60, 0x60, 0x60, 0x60, 0xc0, 0xc1, 0xff, 0x00, 0x00}, |
{0x00, 0x00, 0xff, 0xc3, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc3, 0xff, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0xc3, 0xff, 0x00, 0xff, 0xc3, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xd8, 0xd8, 0x78, 0x78, 0x38, 0x38, 0x18, 0x18, 0x00, 0x00}, |
{0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0}, |
{0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03}, |
{0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x07, 0x05, 0x05, 0x05, 0x05, 0x25, 0x79, 0xc2, 0x7c, 0x20, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xd8, 0xd8, 0xf8, 0xd8, 0xd8, 0x0f, 0x06, 0x06, 0x06, 0x06, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xc0, 0xc0, 0xc0, 0xc0, 0xf0, 0x0f, 0x0c, 0x0e, 0x0c, 0x0c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xd8, 0xd8, 0xf8, 0x70, 0x20, 0x0f, 0x06, 0x06, 0x06, 0x06, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xf0, 0xc0, 0xe0, 0xc0, 0xc0, 0x0f, 0x0c, 0x0e, 0x0c, 0x0c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x70, 0xc0, 0xc0, 0xc0, 0x70, 0x1e, 0x1b, 0x1e, 0x1b, 0x1b, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x82, 0xfe, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x98, 0xd8, 0xf8, 0xd8, 0xd8, 0x0c, 0x0c, 0x0c, 0x0c, 0x0f, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x7c, 0xfe, 0xc6, 0xc6, 0x60, 0x30, 0x30, 0x00, 0x30, 0x30, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18}, |
{0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6d, 0x6d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x18, 0x18, 0x18, 0x18, 0x00, 0x18, 0x18, 0x18, 0x18, 0x18, 0x00, 0x18, 0x18, 0x18, 0x18, 0x00}, |
{0x1c, 0x1c, 0x1c, 0x1c, 0x00, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x00, 0x1c, 0x1c, 0x1c, 0x1c, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xaa, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xaa, 0xaa, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x18, 0x18, 0x18, 0x00, 0x18, 0x18, 0x18, 0x00, 0x18, 0x18, 0x18, 0x00, 0x18, 0x18, 0x18, 0x00}, |
{0x1c, 0x1c, 0x1c, 0x00, 0x1c, 0x1c, 0x1c, 0x00, 0x1c, 0x1c, 0x1c, 0x00, 0x1c, 0x1c, 0x1c, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x1f, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x1f, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xf8, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xfc, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c}, |
{0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x1f, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1f, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xf8, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0xfc, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x1f, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18}, |
{0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x1f, 0x1f, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18}, |
{0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1f, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18}, |
{0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x1f, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c}, |
{0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1f, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c}, |
{0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1f, 0x1f, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18}, |
{0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x1f, 0x1f, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c}, |
{0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1f, 0x1f, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c}, |
{0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xf8, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18}, |
{0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xf8, 0xf8, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18}, |
{0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0xfc, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18}, |
{0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xfc, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c}, |
{0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0xfc, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c}, |
{0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0xfc, 0xfc, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18}, |
{0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xfc, 0xfc, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c}, |
{0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0xfc, 0xfc, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xf8, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x1f, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xfc, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x1f, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c}, |
{0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xff, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0xff, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xff, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18}, |
{0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xff, 0xf8, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18}, |
{0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xff, 0x1f, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18}, |
{0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xff, 0xff, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18}, |
{0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0xff, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18}, |
{0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xff, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c}, |
{0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0xff, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c}, |
{0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0xff, 0xfc, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18}, |
{0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0xff, 0x1f, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18}, |
{0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xff, 0xfc, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c}, |
{0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xff, 0x1f, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c}, |
{0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0xff, 0xff, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18}, |
{0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xff, 0xff, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c}, |
{0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0xff, 0xfc, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c}, |
{0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0xff, 0x1f, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c}, |
{0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0xff, 0xff, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xee, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xee, 0xee, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x00, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x00}, |
{0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x00, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x18, 0x1f, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x30, 0x37, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x18, 0xf8, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x06, 0xf6, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36}, |
{0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x1f, 0x18, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x37, 0x30, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xf8, 0x18, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0xf6, 0x06, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x1f, 0x18, 0x1f, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18}, |
{0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x37, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36}, |
{0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x37, 0x30, 0x37, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36}, |
{0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xf8, 0x18, 0xf8, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18}, |
{0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0xf6, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36}, |
{0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0xf6, 0x06, 0xf6, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0xf7, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36}, |
{0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xff, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0xf7, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xff, 0x18, 0xff, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18}, |
{0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0xff, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36}, |
{0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0xf7, 0x00, 0xf7, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x0e, 0x0c, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x70, 0x30, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18}, |
{0x18, 0x18, 0x18, 0x18, 0x18, 0x30, 0x70, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x18, 0x18, 0x18, 0x18, 0x18, 0x0c, 0x0e, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x01, 0x01, 0x02, 0x02, 0x04, 0x04, 0x08, 0x08, 0x10, 0x10, 0x20, 0x20, 0x40, 0x40, 0x80, 0x80}, |
{0x80, 0x80, 0x40, 0x40, 0x20, 0x20, 0x10, 0x10, 0x08, 0x08, 0x04, 0x04, 0x02, 0x02, 0x01, 0x01}, |
{0x81, 0x81, 0x42, 0x42, 0x24, 0x24, 0x18, 0x18, 0x18, 0x18, 0x24, 0x24, 0x42, 0x42, 0x81, 0x81}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18}, |
{0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff}, |
{0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff}, |
{0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff}, |
{0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff}, |
{0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe}, |
{0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc}, |
{0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8}, |
{0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0}, |
{0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0}, |
{0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0}, |
{0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80}, |
{0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f}, |
{0x11, 0x44, 0x11, 0x44, 0x11, 0x44, 0x11, 0x44, 0x11, 0x44, 0x11, 0x44, 0x11, 0x44, 0x11, 0x44}, |
{0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa}, |
{0xdd, 0x77, 0xdd, 0x77, 0xdd, 0x77, 0xdd, 0x77, 0xdd, 0x77, 0xdd, 0x77, 0xdd, 0x77, 0xdd, 0x77}, |
{0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01}, |
{0x00, 0x00, 0x00, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0xfe, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0xfe, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x7c, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0xfe, 0x82, 0xba, 0xba, 0xba, 0xba, 0xba, 0x82, 0xfe, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0xfe, 0x82, 0xfe, 0x82, 0xfe, 0x82, 0xfe, 0x82, 0xfe, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0xfe, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xfe, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0xfe, 0xaa, 0xfe, 0xaa, 0xfe, 0xaa, 0xfe, 0xaa, 0xfe, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0xfe, 0x8a, 0xc6, 0xa2, 0x92, 0x8a, 0xc6, 0xa2, 0xfe, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0xfe, 0xa2, 0xc6, 0x8a, 0x92, 0xa2, 0xc6, 0x8a, 0xfe, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0xfe, 0xaa, 0xc6, 0xaa, 0x92, 0xaa, 0xc6, 0xaa, 0xfe, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0x7c, 0x7c, 0x7c, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0x44, 0x44, 0x44, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x82, 0x82, 0x82, 0xfe, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0x00, 0x00}, |
{0x00, 0x00, 0xfe, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0xfe, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x7e, 0x7e, 0xfc, 0xfc, 0xfc, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x42, 0x42, 0x84, 0x84, 0xfc, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x38, 0x38, 0x7c, 0x7c, 0xfe, 0xfe, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x28, 0x28, 0x44, 0x44, 0x82, 0xfe, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x38, 0x38, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x28, 0x28, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x80, 0xc0, 0xe0, 0xf0, 0xf8, 0xfc, 0xf8, 0xf0, 0xe0, 0xc0, 0x80, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x80, 0xc0, 0xa0, 0x90, 0x88, 0x84, 0x88, 0x90, 0xa0, 0xc0, 0x80, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x70, 0x78, 0x70, 0x40, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x70, 0x48, 0x70, 0x40, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x80, 0xe0, 0xf8, 0xfe, 0xf8, 0xe0, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x80, 0xe0, 0x98, 0x86, 0x98, 0xe0, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xfe, 0xfe, 0x7c, 0x7c, 0x38, 0x38, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xfe, 0x82, 0x44, 0x44, 0x28, 0x28, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0x38, 0x38, 0x10, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0x28, 0x28, 0x10, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x02, 0x06, 0x0e, 0x1e, 0x3e, 0x7e, 0x3e, 0x1e, 0x0e, 0x06, 0x02, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x02, 0x06, 0x0a, 0x12, 0x22, 0x42, 0x22, 0x12, 0x0a, 0x06, 0x02, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x38, 0x78, 0x38, 0x08, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x38, 0x48, 0x38, 0x08, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x02, 0x0e, 0x3e, 0xfe, 0x3e, 0x0e, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x02, 0x0e, 0x32, 0xc2, 0x32, 0x0e, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x10, 0x38, 0x7c, 0x7c, 0xfe, 0xfe, 0x7c, 0x7c, 0x38, 0x10, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x10, 0x28, 0x44, 0x44, 0x82, 0x82, 0x44, 0x44, 0x28, 0x10, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x10, 0x28, 0x44, 0x54, 0xba, 0xba, 0x54, 0x44, 0x28, 0x10, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x3c, 0x42, 0x99, 0xbd, 0xbd, 0xbd, 0xbd, 0x99, 0x42, 0x3c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x10, 0x28, 0x28, 0x44, 0x82, 0x82, 0x44, 0x28, 0x28, 0x10, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x3c, 0x42, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x42, 0x3c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x14, 0x40, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x02, 0x28, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x3c, 0x66, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0xa5, 0x66, 0x3c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x3c, 0x42, 0x99, 0xa5, 0xa5, 0xa5, 0xa5, 0x99, 0x42, 0x3c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x3c, 0x7e, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7e, 0x3c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x3c, 0x72, 0xf1, 0xf1, 0xf1, 0xf1, 0xf1, 0xf1, 0x72, 0x3c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x3c, 0x4e, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x4e, 0x3c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x3c, 0x42, 0x81, 0x81, 0x81, 0xff, 0xff, 0xff, 0x7e, 0x3c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x3c, 0x7e, 0xff, 0xff, 0xff, 0x81, 0x81, 0x81, 0x42, 0x3c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x3c, 0x4e, 0x8f, 0x8f, 0x8f, 0x81, 0x81, 0x81, 0x42, 0x3c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x3c, 0x4e, 0x8f, 0x8f, 0x8f, 0xff, 0xff, 0xff, 0x7e, 0x3c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x30, 0x70, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0x70, 0x30, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x0c, 0x0e, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0e, 0x0c, 0x00, 0x00, 0x00, 0x00}, |
{0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe7, 0xc3, 0xc3, 0xe7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff}, |
{0xff, 0xff, 0xc3, 0xbd, 0x7e, 0x7e, 0x7e, 0x7e, 0x7e, 0x7e, 0xbd, 0xc3, 0xff, 0xff, 0xff, 0xff}, |
{0xff, 0xff, 0xc3, 0xbd, 0x7e, 0x7e, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x7e, 0x7e, 0xbd, 0xc3, 0xff, 0xff, 0xff, 0xff}, |
{0x00, 0x00, 0x30, 0x40, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x0c, 0x02, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x02, 0x0c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x40, 0x30, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x3c, 0x42, 0x81, 0x81, 0x81, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x81, 0x81, 0x81, 0x42, 0x3c, 0x00, 0x00, 0x00, 0x00}, |
{0x01, 0x01, 0x03, 0x03, 0x07, 0x07, 0x0f, 0x0f, 0x1f, 0x1f, 0x3f, 0x3f, 0x7f, 0x7f, 0xff, 0xff}, |
{0x80, 0x80, 0xc0, 0xc0, 0xe0, 0xe0, 0xf0, 0xf0, 0xf8, 0xf8, 0xfc, 0xfc, 0xfe, 0xfe, 0xff, 0xff}, |
{0xff, 0xff, 0xfe, 0xfe, 0xfc, 0xfc, 0xf8, 0xf8, 0xf0, 0xf0, 0xe0, 0xe0, 0xc0, 0xc0, 0x80, 0x80}, |
{0xff, 0xff, 0x7f, 0x7f, 0x3f, 0x3f, 0x1f, 0x1f, 0x0f, 0x0f, 0x07, 0x07, 0x03, 0x03, 0x01, 0x01}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x66, 0x42, 0x42, 0x66, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xff, 0xf1, 0xf1, 0xf1, 0xf1, 0xf1, 0xf1, 0xf1, 0xf1, 0xff, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xff, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0x8f, 0xff, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xff, 0xff, 0xfd, 0xf9, 0xf1, 0xf1, 0xe1, 0xc1, 0x81, 0xff, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xff, 0x81, 0x83, 0x87, 0x8f, 0x8f, 0x9f, 0xbf, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xff, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0xff, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x10, 0x10, 0x28, 0x28, 0x44, 0x44, 0x92, 0x82, 0xfe, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x10, 0x10, 0x38, 0x38, 0x74, 0x74, 0xf2, 0xf2, 0xfe, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x10, 0x10, 0x38, 0x38, 0x5c, 0x5c, 0x9e, 0x9e, 0xfe, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x3c, 0x42, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x42, 0x3c, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0xfe, 0x92, 0x92, 0x92, 0xf2, 0x82, 0x82, 0x82, 0xfe, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0xfe, 0x82, 0x82, 0x82, 0xf2, 0x92, 0x92, 0x92, 0xfe, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0xfe, 0x82, 0x82, 0x82, 0x9e, 0x92, 0x92, 0x92, 0xfe, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0xfe, 0x92, 0x92, 0x92, 0x9e, 0x82, 0x82, 0x82, 0xfe, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x3c, 0x4a, 0x89, 0x89, 0x89, 0xf9, 0x81, 0x81, 0x42, 0x3c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x3c, 0x42, 0x81, 0x81, 0xf9, 0x89, 0x89, 0x89, 0x4a, 0x3c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x3c, 0x42, 0x81, 0x81, 0x9f, 0x91, 0x91, 0x91, 0x52, 0x3c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x3c, 0x52, 0x91, 0x91, 0x91, 0x9f, 0x81, 0x81, 0x42, 0x3c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x10, 0x10, 0x54, 0x38, 0xfe, 0x38, 0x54, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x30, 0x7c, 0xfe, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x38, 0x7c, 0xfe, 0x10, 0x10, 0x10, 0x10, 0x14, 0x08, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x10, 0x10, 0x38, 0xfe, 0x7c, 0x38, 0x6c, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x10, 0x10, 0x28, 0xee, 0x44, 0x54, 0x6c, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x08, 0x18, 0x30, 0x60, 0xc0, 0x60, 0x34, 0x1c, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xfe, 0xc6, 0xcc, 0xd8, 0xf0, 0xd8, 0xcd, 0xc7, 0xcf, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x38, 0x44, 0x82, 0x92, 0x82, 0x44, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x18, 0x24, 0x42, 0x42, 0x42, 0xa5, 0xa5, 0x42, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x42, 0xa5, 0xa5, 0x42, 0x42, 0x42, 0x24, 0x18, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x0c, 0x78, 0xcc, 0xcc, 0xcc, 0x78, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x1c, 0x36, 0x36, 0x1c, 0x18, 0x30, 0x70, 0xd8, 0xd8, 0x70, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0xfe, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0xfe, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0xfe, 0x82, 0x86, 0x8a, 0xba, 0x92, 0x82, 0xfe, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0xfe, 0x82, 0xee, 0xba, 0xba, 0xee, 0x82, 0xfe, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x82, 0xc6, 0x6c, 0x7c, 0x38, 0x7c, 0x6c, 0xc6, 0x82, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x7c, 0x82, 0xaa, 0x82, 0x44, 0x7c, 0x44, 0x38, 0x00, 0x44, 0xc6, 0x38, 0xc6, 0x44, 0x00}, |
{0x00, 0x00, 0x00, 0x38, 0x44, 0xee, 0xfe, 0x92, 0xba, 0x7c, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x18, 0x7e, 0x18, 0x18, 0xff, 0x18, 0x1e, 0x78, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x18, 0x7e, 0x18, 0x18, 0xff, 0x18, 0x18, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x38, 0x10, 0x10, 0x92, 0xfe, 0x92, 0x10, 0x10, 0x38, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x3c, 0x72, 0xe0, 0xc4, 0xdf, 0xce, 0xca, 0xe0, 0x72, 0x3c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x54, 0x28, 0x54, 0xaa, 0xaa, 0xaa, 0xaa, 0x54, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x3c, 0x5a, 0x99, 0x99, 0x99, 0xbd, 0xff, 0xdb, 0x5a, 0x3c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x3c, 0x42, 0x81, 0x85, 0xb1, 0xf9, 0xff, 0xdf, 0x7e, 0x3c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xfe, 0xfe, 0x00, 0x00, 0xfe, 0xfe, 0x00, 0x00, 0xfe, 0xfe, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xee, 0xee, 0x00, 0x00, 0xfe, 0xfe, 0x00, 0x00, 0xfe, 0xfe, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xfe, 0xfe, 0x00, 0x00, 0xee, 0xee, 0x00, 0x00, 0xfe, 0xfe, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xee, 0xee, 0x00, 0x00, 0xee, 0xee, 0x00, 0x00, 0xfe, 0xfe, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xfe, 0xfe, 0x00, 0x00, 0xfe, 0xfe, 0x00, 0x00, 0xee, 0xee, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xee, 0xee, 0x00, 0x00, 0xfe, 0xfe, 0x00, 0x00, 0xee, 0xee, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xfe, 0xfe, 0x00, 0x00, 0xee, 0xee, 0x00, 0x00, 0xee, 0xee, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xee, 0xee, 0x00, 0x00, 0xee, 0xee, 0x00, 0x00, 0xee, 0xee, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x7e, 0x81, 0xa5, 0x81, 0x81, 0x81, 0x99, 0xa5, 0x81, 0x7e, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x7e, 0x81, 0xa5, 0x81, 0x81, 0xa5, 0x99, 0x81, 0x81, 0x7e, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x7e, 0xff, 0xdb, 0xff, 0xff, 0xdb, 0xe7, 0xff, 0xff, 0x7e, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x10, 0x10, 0x54, 0x28, 0xc6, 0x28, 0x54, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x78, 0x14, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x14, 0x78, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x1e, 0x28, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x28, 0x1e, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x66, 0x66, 0x3c, 0x66, 0x66, 0x66, 0x66, 0x3c, 0x18, 0x7e, 0x18, 0x18, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x3c, 0x66, 0x66, 0x66, 0x66, 0x3c, 0x18, 0x7e, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x18, 0x18, 0x7e, 0x18, 0x3c, 0x66, 0x66, 0x66, 0x66, 0x3c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x1e, 0x06, 0x0e, 0x1a, 0x78, 0xcc, 0xcc, 0xcc, 0xcc, 0x78, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x03, 0x03, 0x7b, 0xcf, 0xcf, 0xcf, 0x0f, 0x1b, 0x33, 0xff, 0x03, 0x03, 0x03, 0x00, 0x00}, |
{0x00, 0x00, 0x60, 0xf0, 0x60, 0x6e, 0x73, 0x63, 0x63, 0x66, 0x66, 0x63, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xd6, 0x54, 0x54, 0x7c, 0x54, 0x54, 0xd6, 0x38, 0x44, 0x44, 0x38, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x18, 0x3c, 0xdb, 0xdb, 0xdb, 0xdb, 0x7e, 0x3c, 0x18, 0x3c, 0x18, 0x18, 0x00, 0x00}, |
{0x00, 0x00, 0xf8, 0xcc, 0xcc, 0xcc, 0xcc, 0xf8, 0xc0, 0xc0, 0xc0, 0xc0, 0xfe, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x42, 0xa5, 0xa5, 0x3c, 0x3c, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0xc3, 0x66, 0x66, 0x66, 0x66, 0x3c, 0x66, 0x66, 0x66, 0x66, 0x3c, 0x00, 0x00}, |
{0x00, 0x00, 0xc3, 0x7e, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x7e, 0xc3, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x7e, 0xdb, 0xd8, 0x70, 0x00, 0x00, 0x0e, 0x1b, 0xdb, 0x7e, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x1e, 0x33, 0x33, 0x33, 0x33, 0x1b, 0x7b, 0xdb, 0xdb, 0x73, 0x03, 0x01, 0x00, 0x00}, |
{0x00, 0x00, 0x94, 0x7c, 0x55, 0x57, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x06, 0x0b, 0x00, 0x00}, |
{0x00, 0x00, 0x3c, 0x66, 0x66, 0x66, 0x66, 0x24, 0xe7, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x94, 0x7c, 0x54, 0x54, 0x54, 0x54, 0x54, 0x54, 0x54, 0x54, 0x04, 0x03, 0x00, 0x00}, |
{0x00, 0x00, 0x1f, 0x07, 0x8f, 0xdb, 0x73, 0x70, 0xd8, 0x88, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x90, 0x50, 0x70, 0x68, 0x48, 0x48, 0x4e, 0x49, 0x09, 0x0e, 0x10, 0x20, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x2a, 0x7e, 0xaa, 0x00, 0x00, 0x2a, 0x7e, 0xaa, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xc3, 0x66, 0x66, 0x66, 0x66, 0xff, 0x66, 0x66, 0x66, 0x66, 0xc3, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x18, 0x3c, 0x7e, 0xff, 0xff, 0x7e, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x6c, 0x92, 0x82, 0x82, 0x82, 0x44, 0x28, 0x10, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x10, 0x28, 0x44, 0x82, 0x44, 0x28, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x18, 0x3c, 0x3c, 0xe7, 0xe7, 0xe7, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x18, 0x24, 0x42, 0x81, 0x81, 0x66, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x6c, 0xfe, 0xfe, 0xfe, 0xfe, 0x7c, 0x38, 0x10, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x10, 0x38, 0x7c, 0xfe, 0x7c, 0x38, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x18, 0x24, 0x3c, 0xe7, 0xa5, 0xe7, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x38, 0x78, 0x70, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x30, 0x3c, 0x3e, 0x32, 0x30, 0x30, 0x30, 0x70, 0xf0, 0xe0, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x70, 0x7f, 0x6f, 0x63, 0x63, 0x63, 0x63, 0xe3, 0xe7, 0xc7, 0x06, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x7f, 0x63, 0x7f, 0x63, 0x63, 0x63, 0x63, 0x63, 0xe7, 0xe7, 0xc6, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0xc0, 0xc0, 0xc0, 0xc0, 0xcc, 0xde, 0xe6, 0xc4, 0xd8, 0xe0, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x40, 0x40, 0x44, 0x5c, 0x74, 0x44, 0x44, 0x5c, 0x74, 0x44, 0x04, 0x04, 0x00, 0x00}, |
{0x00, 0x00, 0x04, 0x04, 0x46, 0x5c, 0x74, 0xc4, 0x46, 0x5c, 0x74, 0xc4, 0x40, 0x40, 0x00, 0x00}, |
{0x00, 0x00, 0x3b, 0x66, 0x66, 0x66, 0xff, 0x66, 0x66, 0x66, 0x66, 0xff, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x3c, 0x6e, 0x66, 0x60, 0xfe, 0x66, 0x66, 0x66, 0x66, 0xff, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x3e, 0x6e, 0x66, 0x66, 0xfe, 0x66, 0x66, 0x66, 0x66, 0xff, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x6e, 0xdb, 0xdb, 0xd8, 0xff, 0xdb, 0xdb, 0xdb, 0xdb, 0xff, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x6f, 0xdb, 0xdb, 0xdb, 0xff, 0xdb, 0xdb, 0xdb, 0xdb, 0xff, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x38, 0x6c, 0x6c, 0x6f, 0x6c, 0x6c, 0x6c, 0x6c, 0x6d, 0xf6, 0x00, 0x00, 0x00, 0x00}, |
{0x06, 0x29, 0x5e, 0x00, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x06, 0x29, 0x5e, 0x00, 0x04, 0x04, 0x04, 0x04, 0x04, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x81, 0x81, 0x7e, 0x00, 0x08, 0x00, 0x08, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x80, 0x81, 0x7e, 0x00, 0x08, 0x00, 0x08, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x04, 0x04, 0xf8, 0x00, 0x08, 0x00, 0x08, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x08, 0xf7, 0x00, 0x08, 0x00, 0x08, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x81, 0x81, 0x7e, 0x00, 0x14, 0x00, 0x08, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x80, 0x81, 0x7e, 0x00, 0x14, 0x00, 0x08, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x04, 0x04, 0xf8, 0x00, 0x14, 0x00, 0x08, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x08, 0xf7, 0x00, 0x14, 0x00, 0x08, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x81, 0x81, 0x7e, 0x00, 0x14, 0x00, 0x14, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x80, 0x81, 0x7e, 0x00, 0x14, 0x00, 0x14, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x04, 0x04, 0xf8, 0x00, 0x14, 0x00, 0x14, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x08, 0xf7, 0x00, 0x14, 0x00, 0x14, 0x00, 0x00, 0x00}, |
{0x00, 0x08, 0x00, 0x08, 0x00, 0x40, 0x81, 0x81, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x08, 0x00, 0x08, 0x00, 0x40, 0x80, 0x81, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x08, 0x00, 0x08, 0x00, 0x08, 0x04, 0x04, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x08, 0x00, 0x08, 0x00, 0x00, 0x08, 0x08, 0xf7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x14, 0x00, 0x14, 0x00, 0x40, 0x81, 0x81, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x14, 0x00, 0x14, 0x00, 0x40, 0x80, 0x81, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x14, 0x00, 0x14, 0x00, 0x08, 0x04, 0x04, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x14, 0x00, 0x14, 0x00, 0x00, 0x08, 0x08, 0xf7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x10, 0x1c, 0x14, 0x38, 0x00, 0x40, 0x81, 0x81, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x10, 0x1c, 0x14, 0x38, 0x00, 0x40, 0x80, 0x81, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x10, 0x1c, 0x14, 0x38, 0x00, 0x08, 0x04, 0x04, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x10, 0x1c, 0x14, 0x38, 0x00, 0x00, 0x08, 0x08, 0xf7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x04, 0x00, 0x0a, 0x00, 0x06, 0x49, 0x85, 0x83, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x04, 0x00, 0x0a, 0x00, 0x06, 0x49, 0x89, 0x86, 0x7d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x08, 0x00, 0x14, 0x00, 0x0c, 0x12, 0x0a, 0x06, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x08, 0x00, 0x14, 0x00, 0x0c, 0x12, 0x12, 0x0c, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x0a, 0x00, 0x0a, 0x00, 0x06, 0x49, 0x85, 0x83, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x0a, 0x00, 0x0a, 0x00, 0x06, 0x49, 0x89, 0x86, 0x7d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x14, 0x00, 0x14, 0x00, 0x0c, 0x12, 0x0a, 0x06, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x14, 0x00, 0x14, 0x00, 0x0c, 0x12, 0x12, 0x0c, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x70, 0x8f, 0x30, 0x40, 0x88, 0x80, 0x88, 0x41, 0x3e, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x8f, 0x32, 0x41, 0x88, 0x80, 0x88, 0x40, 0x3e, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x47, 0x18, 0xe0, 0x00, 0x04, 0x00, 0x04, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x8f, 0x32, 0xc1, 0x00, 0x08, 0x00, 0x08, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x70, 0x8f, 0x30, 0x40, 0x80, 0x94, 0x80, 0x41, 0x3e, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x8f, 0x32, 0x41, 0x80, 0x94, 0x80, 0x40, 0x3e, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x47, 0x18, 0xe0, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x8f, 0x32, 0xc1, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x70, 0x8f, 0x30, 0x40, 0x94, 0x80, 0x88, 0x41, 0x3e, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x8f, 0x32, 0x41, 0x94, 0x80, 0x88, 0x40, 0x3e, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x47, 0x18, 0xe0, 0x00, 0x0a, 0x00, 0x04, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x8f, 0x32, 0xc1, 0x00, 0x14, 0x00, 0x08, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x70, 0x8f, 0x30, 0x40, 0x94, 0x80, 0x94, 0x41, 0x3e, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x8f, 0x32, 0x41, 0x94, 0x80, 0x94, 0x40, 0x3e, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x47, 0x18, 0xe0, 0x00, 0x0a, 0x00, 0x0a, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x8f, 0x32, 0xc1, 0x00, 0x14, 0x00, 0x14, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x08, 0x04, 0x02, 0x42, 0x3c, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x08, 0x08, 0x04, 0x46, 0x39, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x28, 0x00, 0x08, 0x04, 0x02, 0x42, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x28, 0x00, 0x08, 0x08, 0x04, 0x46, 0x39, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x10, 0x00, 0x28, 0x00, 0x08, 0x04, 0x02, 0x42, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x10, 0x00, 0x28, 0x00, 0x08, 0x08, 0x04, 0x46, 0x39, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x20, 0x38, 0x28, 0x70, 0x08, 0x04, 0x02, 0x42, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x20, 0x38, 0x28, 0x70, 0x08, 0x08, 0x04, 0x46, 0x39, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x08, 0x00, 0x14, 0x00, 0x00, 0x04, 0x02, 0x02, 0x04, 0x18, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x08, 0x00, 0x14, 0x00, 0x00, 0x04, 0x07, 0x04, 0x18, 0x60, 0x00, 0x00, 0x00, 0x00}, |
{0x10, 0x1c, 0x14, 0x38, 0x00, 0x04, 0x02, 0x02, 0x04, 0x18, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x10, 0x1c, 0x14, 0x38, 0x00, 0x00, 0x00, 0x04, 0x07, 0x04, 0x18, 0x60, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x01, 0x02, 0x04, 0x08, 0x44, 0x82, 0x82, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x01, 0x02, 0x04, 0x08, 0x48, 0x84, 0x82, 0x7d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x06, 0x18, 0x20, 0x10, 0x08, 0x08, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x06, 0x18, 0x20, 0x20, 0x10, 0x08, 0xf7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x04, 0x09, 0x12, 0x04, 0x08, 0x44, 0x82, 0x82, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x04, 0x09, 0x12, 0x04, 0x08, 0x48, 0x84, 0x82, 0x7d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x0c, 0x30, 0x46, 0x18, 0x20, 0x10, 0x08, 0x08, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x0c, 0x30, 0x46, 0x18, 0x20, 0x20, 0x10, 0x08, 0xf7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x04, 0x09, 0x12, 0x04, 0x08, 0x44, 0x82, 0x82, 0x7c, 0x00, 0x10, 0x00, 0x10, 0x00, 0x00, 0x00}, |
{0x04, 0x09, 0x12, 0x04, 0x08, 0x48, 0x84, 0x82, 0x7d, 0x00, 0x10, 0x00, 0x10, 0x00, 0x00, 0x00}, |
{0x0c, 0x30, 0x46, 0x18, 0x20, 0x10, 0x08, 0x08, 0xf0, 0x00, 0x10, 0x00, 0x10, 0x00, 0x00, 0x00}, |
{0x0c, 0x30, 0x46, 0x18, 0x20, 0x20, 0x10, 0x08, 0xf7, 0x00, 0x08, 0x00, 0x08, 0x00, 0x00, 0x00}, |
{0xa4, 0x09, 0x12, 0x04, 0x08, 0x44, 0x82, 0x82, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0xa4, 0x09, 0x12, 0x04, 0x08, 0x48, 0x84, 0x82, 0x7d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0xa2, 0x0c, 0x13, 0x0c, 0x10, 0x08, 0x04, 0x04, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0xa2, 0x0c, 0x13, 0x0c, 0x10, 0x10, 0x08, 0x04, 0xfb, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x41, 0x81, 0x81, 0x81, 0x42, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x41, 0x81, 0x81, 0x42, 0x3c, 0x00, 0x00, 0x00}, |
{0x10, 0x1c, 0x14, 0x38, 0x00, 0x41, 0x81, 0x81, 0x81, 0x42, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x10, 0x1c, 0x14, 0x38, 0x00, 0x00, 0x00, 0x01, 0x41, 0x81, 0x81, 0x42, 0x3c, 0x00, 0x00, 0x00}, |
{0x10, 0x1c, 0x14, 0x38, 0x00, 0x08, 0x04, 0x04, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x10, 0x1c, 0x14, 0x38, 0x00, 0x00, 0x08, 0x08, 0xf7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x38, 0x40, 0x38, 0x40, 0x18, 0x24, 0x22, 0x22, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x70, 0x80, 0x70, 0x80, 0x10, 0x68, 0x88, 0x74, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x18, 0x24, 0x22, 0x22, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0xf0, 0x10, 0x14, 0x08, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0xf7, 0x08, 0x08, 0x08, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x10, 0x38, 0x4c, 0x52, 0x32, 0x3d, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x10, 0x38, 0x4c, 0x52, 0x32, 0x3d, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x10, 0x38, 0x4c, 0x52, 0x32, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x10, 0x38, 0x4c, 0x52, 0x32, 0xfd, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x14, 0x60, 0x80, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x18, 0x20, 0x3f, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x70, 0x80, 0x70, 0x80, 0x08, 0x14, 0x60, 0x80, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x1c, 0x20, 0x1c, 0x20, 0x00, 0x00, 0x07, 0x18, 0x20, 0x3f, 0x00, 0x00, 0x00, 0x00}, |
{0x10, 0x00, 0x29, 0x01, 0x19, 0x21, 0x19, 0xa1, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x10, 0x00, 0x2a, 0x02, 0x32, 0x42, 0x32, 0xc6, 0x79, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x40, 0x00, 0xa3, 0x0c, 0x10, 0x08, 0x04, 0x04, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x40, 0x00, 0xa3, 0x0c, 0x10, 0x10, 0x08, 0x04, 0xfb, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x10, 0x28, 0x18, 0x10, 0x20, 0x0c, 0x12, 0x0e, 0x02, 0x04, 0x18, 0x60, 0x00, 0x00, 0x00, 0x00}, |
{0x10, 0x28, 0x18, 0x10, 0x20, 0x00, 0x0c, 0x12, 0x0f, 0x02, 0x04, 0x18, 0x60, 0x00, 0x00, 0x00}, |
{0x00, 0x14, 0x08, 0x00, 0x00, 0x0c, 0x12, 0x0e, 0x02, 0x04, 0x18, 0x60, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x14, 0x08, 0x00, 0x00, 0x00, 0x0c, 0x12, 0x0f, 0x02, 0x04, 0x18, 0x60, 0x00, 0x00, 0x00}, |
{0x08, 0x08, 0x08, 0x08, 0x00, 0x0c, 0x12, 0x0e, 0x02, 0x04, 0x18, 0x60, 0x00, 0x00, 0x00, 0x00}, |
{0x08, 0x08, 0x08, 0x08, 0x00, 0x00, 0x0c, 0x12, 0x0f, 0x02, 0x04, 0x18, 0x60, 0x00, 0x00, 0x00}, |
{0x23, 0x54, 0x33, 0x24, 0x40, 0x0c, 0x12, 0x0e, 0x02, 0x04, 0x18, 0x60, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x08, 0x00, 0x14, 0x00, 0x0c, 0x12, 0x0e, 0x02, 0x04, 0x18, 0x60, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x08, 0x00, 0x14, 0x00, 0x0c, 0x12, 0x0f, 0x02, 0x04, 0x18, 0x60, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x12, 0x0e, 0x02, 0x3c, 0x18, 0x60, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x14, 0x08, 0x00, 0x00, 0x00, 0x0c, 0x12, 0x0f, 0x02, 0x3c, 0x18, 0x60, 0x00, 0x00, 0x00}, |
{0x00, 0x08, 0x14, 0x00, 0x00, 0x0c, 0x12, 0x0e, 0x02, 0x04, 0x18, 0x60, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x08, 0x14, 0x00, 0x00, 0x00, 0x0c, 0x12, 0x0f, 0x02, 0x04, 0x18, 0x60, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x08, 0x88, 0x86, 0x81, 0x81, 0x7e, 0x00, 0x10, 0x00, 0x10}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x88, 0x87, 0x81, 0x7e, 0x10, 0x00, 0x10}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x04, 0x04, 0xf8, 0x00, 0x08, 0x00, 0x08, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x08, 0xf7, 0x00, 0x08, 0x00, 0x08, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x04, 0x04, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x08, 0xf7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x08, 0x88, 0x86, 0x81, 0x82, 0x7c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x88, 0x87, 0x81, 0x7e, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x04, 0x04, 0xf8, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x08, 0xf7, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00}, |
{0x20, 0x20, 0x20, 0x20, 0x08, 0x04, 0x02, 0x42, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x10, 0x10, 0x10, 0x10, 0x00, 0x04, 0x02, 0x02, 0x04, 0x18, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x10, 0x10, 0x10, 0x10, 0x00, 0x07, 0x08, 0x88, 0x86, 0x81, 0x81, 0x7e, 0x00, 0x00, 0x00, 0x00}, |
{0x18, 0x24, 0x98, 0x60, 0xc2, 0x12, 0x92, 0x9c, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x02, 0x92, 0x9c, 0x60, 0x0e, 0x70, 0x0e, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x18, 0x60, 0x04, 0x54, 0x58, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x10, 0x28, 0x10, 0x60, 0x04, 0x54, 0x58, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x04, 0x54, 0x58, 0x20, 0x0c, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x10, 0x10, 0x04, 0x54, 0x58, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x10, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x07, 0x88, 0x87, 0x81, 0x7e, 0x00, 0x00, 0x00}, |
{0x0e, 0xf0, 0x02, 0x92, 0x9c, 0x60, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x18, 0x24, 0x18, 0x60, 0x02, 0x92, 0x9c, 0x60, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x02, 0x12, 0x9c, 0x60, 0x0e, 0x70, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x10, 0x28, 0x50, 0x28, 0x08, 0x08, 0x08, 0x08, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x08, 0x14, 0x28, 0x14, 0x04, 0x04, 0x04, 0x04, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x04, 0x08, 0x10, 0x54, 0x38, 0x54, 0x10, 0x08, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x20, 0x10, 0x08, 0x2a, 0x1c, 0x2a, 0x08, 0x10, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x2a, 0x14, 0x00, 0x21, 0x69, 0xa9, 0x69, 0x16, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x08, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x24, 0x08, 0x10, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x10, 0x10, 0x10, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x10, 0x10, 0x10, 0x10, 0x10, 0x08, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x08, 0x08, 0x08, 0x08, 0x08, 0x10, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x10, 0x10, 0x20, 0x10, 0x10, 0x18, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x08, 0x08, 0x04, 0x08, 0x08, 0x18, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x10, 0x10, 0x10, 0x10, 0x10, 0x18, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x08, 0x08, 0x08, 0x08, 0x08, 0x18, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x7c, 0x28, 0x7c, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x28, 0x28, 0x10, 0x2a, 0x24, 0x1a, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x10, 0x7c, 0x38, 0x38, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x10, 0x7c, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x10, 0x20, 0x10, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x10, 0x08, 0x10, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x10, 0x10, 0x08, 0x08, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x10, 0x38, 0x54, 0x30, 0x18, 0x54, 0x38, 0x10, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x24, 0x08, 0x08, 0x10, 0x10, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x44, 0x54, 0x58, 0x40, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x0c, 0x30, 0x0c, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x06, 0x18, 0x60, 0x06, 0x18, 0x60, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x0c, 0x12, 0xca, 0x2c, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x30, 0x0c, 0x30, 0x00, 0x00}, |
{0x0c, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x06, 0x18, 0x60, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x08, 0x14, 0x0c, 0x08, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x18, 0x24, 0x14, 0x18, 0x60, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x30, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x06, 0x18, 0x60, 0x00, 0x00}, |
{0x0a, 0x2a, 0x2c, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x02, 0x12, 0x92, 0x9c, 0x60, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x18, 0x24, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x18, 0x24, 0x24, 0x18, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x18, 0x24, 0x20, 0x1e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x02, 0x3c, 0x40, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x01, 0x3e, 0x40, 0x08, 0x08, 0x08, 0x08, 0x08, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x18, 0x20, 0x1c, 0x20, 0x08, 0x08, 0x08, 0x08, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x0c, 0x10, 0x0e, 0x10, 0x04, 0x04, 0x04, 0x04, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x1c, 0x20, 0x1c, 0x20, 0x0c, 0x12, 0x0e, 0x02, 0x04, 0x18, 0x60, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x1c, 0x20, 0x1c, 0x20, 0x00, 0x0c, 0x12, 0x0f, 0x02, 0x04, 0x18, 0x60, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x00, 0x0c, 0x10, 0x0e, 0x10, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x04, 0x04, 0x04, 0x04, 0x04, 0x03, 0x00, 0x0c, 0x10, 0x0e, 0x10, 0x00, 0x00}, |
{0x00, 0x30, 0x40, 0x38, 0x40, 0x07, 0x08, 0x88, 0x86, 0x81, 0x81, 0x7e, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x30, 0x40, 0x38, 0x40, 0x00, 0x00, 0x00, 0x07, 0x88, 0x87, 0x81, 0x7e, 0x00, 0x00, 0x00}, |
{0x00, 0x1c, 0x20, 0x1c, 0x20, 0x08, 0x04, 0x04, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x1c, 0x20, 0x1c, 0x20, 0x00, 0x08, 0x08, 0xf7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x08, 0x08, 0x08, 0x08, 0x08, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x81, 0x81, 0x7e, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x80, 0x81, 0x7e, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x04, 0x04, 0xf8, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x08, 0xf7, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x28, 0x00, 0x00, 0x18, 0x24, 0x22, 0x22, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x50, 0x00, 0x10, 0x10, 0x68, 0x88, 0x74, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x14, 0x40, 0x81, 0x81, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x14, 0x00, 0x40, 0x80, 0x81, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x14, 0x00, 0x08, 0x04, 0x04, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x08, 0x08, 0xf7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x08, 0x00, 0x14, 0x00, 0x40, 0x81, 0x81, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x08, 0x00, 0x14, 0x00, 0x40, 0x80, 0x81, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x08, 0x00, 0x14, 0x00, 0x08, 0x04, 0x04, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x08, 0x00, 0x14, 0x00, 0x00, 0x08, 0x08, 0xf7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x70, 0x8f, 0x30, 0x40, 0x80, 0x88, 0x80, 0x41, 0x3e, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x8f, 0x32, 0x41, 0x80, 0x88, 0x80, 0x40, 0x3e, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x47, 0x18, 0xe0, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x8f, 0x32, 0xc1, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x70, 0x8f, 0x30, 0x40, 0x80, 0x80, 0x80, 0x41, 0x3e, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x8f, 0x32, 0x41, 0x80, 0x80, 0x80, 0x40, 0x3e, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x47, 0x18, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x8f, 0x32, 0xc1, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x20, 0x00, 0x00, 0x70, 0x8f, 0x30, 0x40, 0x80, 0x80, 0x80, 0x41, 0x3e, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x20, 0x00, 0x00, 0x70, 0x8f, 0x32, 0x41, 0x80, 0x80, 0x80, 0x40, 0x3e, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x10, 0x00, 0x38, 0x47, 0x18, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x10, 0x00, 0x00, 0x70, 0x8f, 0x32, 0xc1, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x08, 0x04, 0x02, 0x42, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x08, 0x08, 0x04, 0x46, 0x39, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x10, 0x00, 0x08, 0x04, 0x02, 0x42, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x10, 0x00, 0x08, 0x08, 0x04, 0x46, 0x39, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x02, 0x02, 0x04, 0x18, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x07, 0x04, 0x18, 0x60, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x08, 0x00, 0x00, 0x04, 0x02, 0x02, 0x04, 0x18, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x04, 0x07, 0x04, 0x18, 0x60, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x15, 0x88, 0x84, 0x84, 0x78, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x15, 0x88, 0x84, 0x84, 0x78, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x15, 0xea, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, 0xd5, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x08, 0x00, 0x14, 0x00, 0x01, 0x15, 0x88, 0x84, 0x84, 0x78, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x08, 0x00, 0x14, 0x00, 0x01, 0x15, 0x88, 0x84, 0x84, 0x78, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x04, 0x00, 0x0a, 0x00, 0x00, 0x01, 0x15, 0xea, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x08, 0x00, 0x14, 0x00, 0x00, 0x00, 0x2a, 0xd5, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x06, 0x09, 0x31, 0x9e, 0x88, 0x88, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x09, 0x31, 0x9e, 0x88, 0x88, 0x70, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x29, 0x31, 0xde, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x29, 0x31, 0xde, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x04, 0x00, 0x06, 0x09, 0x31, 0x9e, 0x88, 0x88, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x04, 0x00, 0x06, 0x09, 0x31, 0x9e, 0x88, 0x88, 0x70, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x04, 0x00, 0x00, 0x06, 0x29, 0x31, 0xde, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x04, 0x00, 0x00, 0x06, 0x29, 0x31, 0xde, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x20, 0x20, 0x20, 0x2c, 0x32, 0xa2, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x20, 0x20, 0x20, 0x2c, 0x32, 0xa2, 0x7d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x20, 0x20, 0x20, 0x2c, 0x32, 0x22, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x20, 0x20, 0x20, 0x2c, 0x32, 0x22, 0xfd, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x24, 0x20, 0x20, 0x2c, 0x32, 0xa2, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x24, 0x20, 0x20, 0x2c, 0x32, 0xa2, 0x7d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x24, 0x20, 0x20, 0x2c, 0x32, 0x22, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x24, 0x20, 0x20, 0x2c, 0x32, 0x22, 0xfd, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x70, 0x80, 0x8c, 0x70, 0x40, 0x80, 0x80, 0x80, 0x41, 0x3e, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x1e, 0x22, 0x1c, 0x22, 0x41, 0x80, 0x80, 0x80, 0x41, 0x3e, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x10, 0x10, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x22, 0x1c, 0xe3, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x40, 0x00, 0x00, 0x70, 0x80, 0x8c, 0x70, 0x40, 0x80, 0x80, 0x80, 0x41, 0x3e, 0x00, 0x00}, |
{0x00, 0x08, 0x00, 0x00, 0x1e, 0x22, 0x1c, 0x22, 0x41, 0x80, 0x80, 0x80, 0x41, 0x3e, 0x00, 0x00}, |
{0x00, 0x00, 0x10, 0x00, 0x00, 0x0e, 0x10, 0x10, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x08, 0x00, 0x00, 0x1e, 0x22, 0x1c, 0xe3, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x04, 0x00, 0x06, 0x49, 0x85, 0x83, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x04, 0x00, 0x06, 0x49, 0x89, 0x86, 0x7d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x08, 0x00, 0x0c, 0x12, 0x0a, 0x06, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x08, 0x00, 0x0c, 0x12, 0x12, 0x0c, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x0a, 0x00, 0x06, 0x09, 0x09, 0x47, 0x81, 0x81, 0x81, 0x42, 0x3c, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x0a, 0x00, 0x00, 0x06, 0x09, 0x49, 0x87, 0x81, 0x81, 0x42, 0x3c, 0x00, 0x00, 0x00}, |
{0x00, 0x14, 0x00, 0x00, 0x0c, 0x12, 0x0a, 0x06, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x14, 0x00, 0x00, 0x0c, 0x12, 0x12, 0x0c, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x19, 0x21, 0x19, 0x21, 0x01, 0x81, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x32, 0x42, 0x32, 0x42, 0x02, 0x86, 0x79, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x06, 0x18, 0x20, 0x10, 0x08, 0x08, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x06, 0x18, 0x20, 0x20, 0x10, 0x08, 0xf7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0x42, 0x82, 0x82, 0x84, 0x78, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 0x42, 0x82, 0x82, 0x84, 0x78, 0x00, 0x00}, |
{0x00, 0x00, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0xf7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x0c, 0x12, 0x12, 0x3c, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x3c, 0x4b, 0x4a, 0x44, 0x40, 0x40, 0x40, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x12, 0x32, 0xcc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x12, 0x32, 0xcd, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x08, 0x00, 0x00, 0x41, 0x81, 0x81, 0x81, 0x42, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x01, 0x41, 0x81, 0x81, 0x42, 0x3c, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x10, 0x00, 0x08, 0x04, 0x04, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x08, 0x08, 0xf7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x18, 0x24, 0x22, 0x22, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x10, 0x10, 0x68, 0x88, 0x74, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x40, 0x30, 0x4e, 0x49, 0x39, 0xe6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x08, 0x14, 0x24, 0x28, 0xf3, 0x24, 0x18, 0x0c, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x12, 0x0e, 0x02, 0x04, 0x18, 0x60, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x12, 0x0f, 0x02, 0x04, 0x18, 0x60, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x08, 0x88, 0x86, 0x81, 0x81, 0x7e, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x88, 0x87, 0x81, 0x7e, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x08, 0x88, 0x86, 0x81, 0x81, 0x7e, 0x00, 0x00, 0x24, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x88, 0x87, 0x81, 0x7e, 0x00, 0x24, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x04, 0x04, 0xf8, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x08, 0xf7, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00}, |
{0x68, 0x90, 0x02, 0x22, 0x12, 0x0a, 0x04, 0x0c, 0x12, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x68, 0x90, 0x02, 0x32, 0x12, 0x0a, 0x0a, 0x0e, 0x3d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x60, 0x80, 0x72, 0xa2, 0x12, 0x0a, 0x04, 0x0c, 0x12, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x30, 0x40, 0x3a, 0x52, 0x12, 0x0a, 0x0a, 0x0e, 0x3d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x42, 0x22, 0x12, 0x0a, 0x04, 0x0c, 0x12, 0x3c, 0x00, 0x18, 0x20, 0x1c, 0x20, 0x00}, |
{0x00, 0x00, 0x22, 0x12, 0x12, 0x0a, 0x0a, 0x0e, 0x3d, 0x00, 0x00, 0x18, 0x20, 0x1c, 0x20, 0x00}, |
{0x00, 0x00, 0x42, 0x22, 0x12, 0x0a, 0x04, 0x0c, 0x12, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0x00, 0x00, 0x22, 0x12, 0x12, 0x0a, 0x0a, 0x0e, 0x3d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, |
{0xf1, 0x35, 0x55, 0x8a, 0xe0, 0x06, 0x95, 0xd6, 0xb5, 0x97, 0x00, 0xee, 0x8a, 0xee, 0x28, 0xe8}, |
{0x00, 0x38, 0x7c, 0x7c, 0xc6, 0x92, 0xf2, 0xe6, 0xfe, 0xe6, 0x7c, 0x7c, 0x38, 0x00, 0x00, 0x00}, |
/* Special glyph for unknown character */ |
{0x00, 0x00, 0x7c, 0xc6, 0xc6, 0x0c, 0x18, 0x18, 0x18, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00} |
}; |
/** @} |
*/ |
//branches/snapshot/uspace/srv/fb/font-8x16.h |
---|
0,0 → 1,50 |
/* |
* Copyright (c) 2005 Martin Decky |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup genarch |
* @{ |
*/ |
/** @file |
*/ |
#ifndef FONT_8X16_H_ |
#define FONT_8X16_H_ |
#define FONT_GLYPHS 2899 |
#define FONT_WIDTH 8 |
#define FONT_SCANLINES 16 |
#include <sys/types.h> |
extern uint16_t fb_font_glyph(const wchar_t ch); |
extern uint8_t fb_font[FONT_GLYPHS][FONT_SCANLINES]; |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/srv/fb/msim.c |
---|
0,0 → 1,73 |
/* |
* Copyright (c) 2006 Ondrej Palkovsky |
* Copyright (c) 2008 Martin Decky |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @defgroup msimfb MSIM text console |
* @brief HelenOS MSIM text console. |
* @ingroup fbs |
* @{ |
*/ |
/** @file |
*/ |
#include <async.h> |
#include <libc.h> |
#include <sysinfo.h> |
#include <as.h> |
#include <ddi.h> |
#include "serial_console.h" |
#include "msim.h" |
#define WIDTH 80 |
#define HEIGHT 24 |
static char *virt_addr; |
static void msim_putc(const char c) |
{ |
*virt_addr = c; |
} |
int msim_init(void) |
{ |
void *phys_addr = (void *) sysinfo_value("fb.address.physical"); |
virt_addr = (char *) as_get_mappable_page(1); |
if (physmem_map(phys_addr, virt_addr, 1, AS_AREA_READ | AS_AREA_WRITE) != 0) |
return -1; |
serial_console_init(msim_putc, WIDTH, HEIGHT); |
async_set_client_connection(serial_client_connection); |
return 0; |
} |
/** |
* @} |
*/ |
//branches/snapshot/uspace/srv/fb/ski.c |
---|
0,0 → 1,84 |
/* |
* Copyright (c) 2005 Jakub Jermar |
* Copyright (c) 2008 Jiri Svoboda |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @defgroup msimfb MSIM text console |
* @brief HelenOS MSIM text console. |
* @ingroup fbs |
* @{ |
*/ |
/** @file |
*/ |
#include <async.h> |
#include <libc.h> |
#include <sysinfo.h> |
#include <as.h> |
#include <ddi.h> |
#include "serial_console.h" |
#include "ski.h" |
#define SKI_PUTCHAR 31 |
#define WIDTH 80 |
#define HEIGHT 24 |
/** Display character on ski debug console |
* |
* Use SSC (Simulator System Call) to |
* display character on debug console. |
* |
* @param ch Character to be printed. |
*/ |
static void ski_putc(const char ch) |
{ |
asm volatile ( |
"mov r15 = %0\n" |
"mov r32 = %1\n" /* r32 is in0 */ |
"break 0x80000\n" /* modifies r8 */ |
: |
: "i" (SKI_PUTCHAR), "r" (ch) |
: "r15", "in0", "r8" |
); |
if (ch == '\n') |
ski_putc('\r'); |
} |
int ski_init(void) |
{ |
serial_console_init(ski_putc, WIDTH, HEIGHT); |
async_set_client_connection(serial_client_connection); |
return 0; |
} |
/** |
* @} |
*/ |
//branches/snapshot/uspace/srv/fb/sgcn.c |
---|
0,0 → 1,142 |
/* |
* Copyright (c) 2006 Ondrej Palkovsky |
* Copyright (c) 2008 Martin Decky |
* Copyright (c) 2008 Pavel Rimsky |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @defgroup sgcnfb SGCN |
* @brief userland driver of the Serengeti console output |
* @{ |
*/ |
/** @file |
*/ |
#include <async.h> |
#include <sysinfo.h> |
#include <as.h> |
#include <errno.h> |
#include <stdio.h> |
#include <ddi.h> |
#include "serial_console.h" |
#include "sgcn.h" |
#define WIDTH 80 |
#define HEIGHT 24 |
/** |
* Virtual address mapped to SRAM. |
*/ |
static uintptr_t sram_virt_addr; |
/** |
* SGCN buffer offset within SGCN. |
*/ |
static uintptr_t sram_buffer_offset; |
/** |
* SGCN buffer header. It is placed at the very beginning of the SGCN |
* buffer. |
*/ |
typedef struct { |
/** hard-wired to "CON" */ |
char magic[4]; |
/** we don't need this */ |
char unused[24]; |
/** offset within the SGCN buffer of the output buffer start */ |
uint32_t out_begin; |
/** offset within the SGCN buffer of the output buffer end */ |
uint32_t out_end; |
/** offset within the SGCN buffer of the output buffer read pointer */ |
uint32_t out_rdptr; |
/** offset within the SGCN buffer of the output buffer write pointer */ |
uint32_t out_wrptr; |
} __attribute__ ((packed)) sgcn_buffer_header_t; |
/* |
* Returns a pointer to the object of a given type which is placed at the given |
* offset from the console buffer beginning. |
*/ |
#define SGCN_BUFFER(type, offset) \ |
((type *) (sram_virt_addr + sram_buffer_offset + (offset))) |
/** Returns a pointer to the console buffer header. */ |
#define SGCN_BUFFER_HEADER (SGCN_BUFFER(sgcn_buffer_header_t, 0)) |
/** |
* Pushes the character to the SGCN serial. |
* @param c character to be pushed |
*/ |
static void sgcn_putc(char c) |
{ |
uint32_t begin = SGCN_BUFFER_HEADER->out_begin; |
uint32_t end = SGCN_BUFFER_HEADER->out_end; |
uint32_t size = end - begin; |
/* we need pointers to volatile variables */ |
volatile char *buf_ptr = (volatile char *) |
SGCN_BUFFER(char, SGCN_BUFFER_HEADER->out_wrptr); |
volatile uint32_t *out_wrptr_ptr = &(SGCN_BUFFER_HEADER->out_wrptr); |
volatile uint32_t *out_rdptr_ptr = &(SGCN_BUFFER_HEADER->out_rdptr); |
uint32_t new_wrptr = (((*out_wrptr_ptr) - begin + 1) % size) + begin; |
while (*out_rdptr_ptr == new_wrptr) |
; |
*buf_ptr = c; |
*out_wrptr_ptr = new_wrptr; |
} |
/** |
* Initializes the SGCN serial driver. |
*/ |
int sgcn_init(void) |
{ |
sram_virt_addr = (uintptr_t) as_get_mappable_page(sysinfo_value("sram.area.size")); |
if (physmem_map((void *) sysinfo_value("sram.address.physical"), |
(void *) sram_virt_addr, sysinfo_value("sram.area.size") / PAGE_SIZE, |
AS_AREA_READ | AS_AREA_WRITE) != 0) |
return -1; |
serial_console_init(sgcn_putc, WIDTH, HEIGHT); |
sram_buffer_offset = sysinfo_value("sram.buffer.offset"); |
async_set_client_connection(serial_client_connection); |
return 0; |
} |
/** |
* @} |
*/ |
//branches/snapshot/uspace/srv/fb/ski.h |
---|
0,0 → 1,46 |
/* |
* Copyright (c) 2008 Jiri Svoboda |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup skifb |
* @brief HelenOS ski text console. |
* @ingroup fbs |
* @{ |
*/ |
/** @file |
*/ |
#ifndef FB_SKI_H_ |
#define FB_SKI_H_ |
extern int ski_init(void); |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/srv/fb/main.c |
---|
0,0 → 1,108 |
/* |
* Copyright (c) 2006 Ondrej Palkovsky |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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 <ipc/ipc.h> |
#include <ipc/services.h> |
#include <sysinfo.h> |
#include <async.h> |
#include <as.h> |
#include <align.h> |
#include <errno.h> |
#include <stdio.h> |
#include "fb.h" |
#include "ega.h" |
#include "msim.h" |
#include "ski.h" |
#include "sgcn.h" |
#include "main.h" |
#define NAME "fb" |
void receive_comm_area(ipc_callid_t callid, ipc_call_t *call, void **area) |
{ |
void *dest; |
dest = as_get_mappable_page(IPC_GET_ARG2(*call)); |
if (ipc_answer_1(callid, EOK, (sysarg_t) dest) == 0) { |
if (*area) |
as_area_destroy(*area); |
*area = dest; |
} |
} |
int main(int argc, char *argv[]) |
{ |
printf(NAME ": HelenOS Framebuffer service\n"); |
ipcarg_t phonead; |
bool initialized = false; |
#ifdef FB_ENABLED |
if (sysinfo_value("fb.kind") == 1) { |
if (fb_init() == 0) |
initialized = true; |
} |
#endif |
#ifdef EGA_ENABLED |
if ((!initialized) && (sysinfo_value("fb.kind") == 2)) { |
if (ega_init() == 0) |
initialized = true; |
} |
#endif |
#ifdef MSIM_ENABLED |
if ((!initialized) && (sysinfo_value("fb.kind") == 3)) { |
if (msim_init() == 0) |
initialized = true; |
} |
#endif |
#ifdef SGCN_ENABLED |
if ((!initialized) && (sysinfo_value("fb.kind") == 4)) { |
if (sgcn_init() == 0) |
initialized = true; |
} |
#endif |
#ifdef SKI_ENABLED |
if ((!initialized) && (sysinfo_value("fb") != true)) { |
if (ski_init() == 0) |
initialized = true; |
} |
#endif |
if (!initialized) |
return -1; |
if (ipc_connect_to_me(PHONE_NS, SERVICE_VIDEO, 0, 0, &phonead) != 0) |
return -1; |
printf(NAME ": Accepting connections\n"); |
async_manager(); |
/* Never reached */ |
return 0; |
} |
//branches/snapshot/uspace/srv/fb/fb.h |
---|
0,0 → 1,48 |
/* |
* Copyright (c) 2006 Ondrej Palkovsky |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup fb |
* @ingroup fbs |
* @{ |
*/ |
/** @file |
*/ |
#ifndef FB_FB_H_ |
#define FB_FB_H_ |
#include <stdint.h> |
typedef void (* putpixel_cb_t)(void *, unsigned int, unsigned int, uint32_t); |
extern int fb_init(void); |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/srv/fb/sgcn.h |
---|
0,0 → 1,46 |
/* |
* Copyright (c) 2008 Pavel Rimsky |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @defgroup sgcnfb SGCN |
* @brief userland driver of the Serengeti console output |
* @{ |
*/ |
/** @file |
*/ |
#ifndef FB_SGCN_H_ |
#define FB_SGCN_H_ |
int sgcn_init(void); |
#endif |
/** |
* @} |
*/ |
//branches/snapshot/uspace/srv/fb/msim.h |
---|
0,0 → 1,47 |
/* |
* Copyright (c) 2006 Ondrej Palkovsky |
* Copyright (c) 2008 Martin Decky |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup msimfb |
* @brief HelenOS MSIM text console. |
* @ingroup fbs |
* @{ |
*/ |
/** @file |
*/ |
#ifndef FB_MSIM_H_ |
#define FB_MSIM_H_ |
extern int msim_init(void); |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/srv/fb/ppm.h |
---|
0,0 → 1,39 |
/* |
* Copyright (c) 2006 Ondrej Palkovsky |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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 FB_PPM_H_ |
#define FB_PPM_H_ |
#include "fb.h" |
#include <sys/types.h> |
extern int ppm_draw(unsigned char *, size_t, unsigned int, unsigned int, |
unsigned int, unsigned int, putpixel_cb_t, void *); |
extern int ppm_get_data(unsigned char *, size_t, unsigned int *, unsigned int *); |
#endif |
//branches/snapshot/uspace/srv/fb/main.h |
---|
0,0 → 1,34 |
/* |
* Copyright (c) 2006 Ondrej Palkovsky |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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 FB_MAIN_H_ |
#define FB_MAIN_H_ |
extern void receive_comm_area(ipc_callid_t, ipc_call_t *, void **); |
#endif |
//branches/snapshot/uspace/srv/fb/pointer_mask.xbm |
---|
0,0 → 1,6 |
#define pointer_mask_width 11 |
#define pointer_mask_height 18 |
static unsigned char pointer_mask_bits[] = { |
0x01, 0x00, 0x03, 0x00, 0x07, 0x00, 0x0f, 0x00, 0x1f, 0x00, 0x3f, 0x00, |
0x7f, 0x00, 0xff, 0x00, 0xff, 0x01, 0xff, 0x03, 0xff, 0x07, 0xff, 0x03, |
0xff, 0x00, 0xff, 0x00, 0xf7, 0x01, 0xe3, 0x01, 0xe1, 0x01, 0xc0, 0x00 }; |
//branches/snapshot/uspace/srv/fb/pointer.xbm |
---|
0,0 → 1,6 |
#define pointer_width 11 |
#define pointer_height 18 |
static unsigned char pointer_bits[] = { |
0x01, 0x00, 0x03, 0x00, 0x05, 0x00, 0x09, 0x00, 0x11, 0x00, 0x21, 0x00, |
0x41, 0x00, 0x81, 0x00, 0x01, 0x01, 0x01, 0x02, 0x01, 0x04, 0x01, 0x03, |
0x81, 0x00, 0x89, 0x00, 0x15, 0x01, 0x23, 0x01, 0x21, 0x01, 0xc0, 0x00 }; |
//branches/snapshot/uspace/srv/kbd/ctl/pc.c |
---|
0,0 → 1,234 |
/* |
* Copyright (c) 2009 Jiri Svoboda |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup kbd_ctl |
* @ingroup kbd |
* @{ |
*/ |
/** |
* @file |
* @brief PC keyboard controller driver. |
*/ |
#include <kbd.h> |
#include <io/console.h> |
#include <io/keycode.h> |
#include <kbd_ctl.h> |
#include <gsp.h> |
enum dec_state { |
ds_s, |
ds_e |
}; |
static enum dec_state ds; |
static int scanmap_simple[] = { |
[0x29] = KC_BACKTICK, |
[0x02] = KC_1, |
[0x03] = KC_2, |
[0x04] = KC_3, |
[0x05] = KC_4, |
[0x06] = KC_5, |
[0x07] = KC_6, |
[0x08] = KC_7, |
[0x09] = KC_8, |
[0x0a] = KC_9, |
[0x0b] = KC_0, |
[0x0c] = KC_MINUS, |
[0x0d] = KC_EQUALS, |
[0x0e] = KC_BACKSPACE, |
[0x0f] = KC_TAB, |
[0x10] = KC_Q, |
[0x11] = KC_W, |
[0x12] = KC_E, |
[0x13] = KC_R, |
[0x14] = KC_T, |
[0x15] = KC_Y, |
[0x16] = KC_U, |
[0x17] = KC_I, |
[0x18] = KC_O, |
[0x19] = KC_P, |
[0x1a] = KC_LBRACKET, |
[0x1b] = KC_RBRACKET, |
[0x3a] = KC_CAPS_LOCK, |
[0x1e] = KC_A, |
[0x1f] = KC_S, |
[0x20] = KC_D, |
[0x21] = KC_F, |
[0x22] = KC_G, |
[0x23] = KC_H, |
[0x24] = KC_J, |
[0x25] = KC_K, |
[0x26] = KC_L, |
[0x27] = KC_SEMICOLON, |
[0x28] = KC_QUOTE, |
[0x2b] = KC_BACKSLASH, |
[0x2a] = KC_LSHIFT, |
[0x2c] = KC_Z, |
[0x2d] = KC_X, |
[0x2e] = KC_C, |
[0x2f] = KC_V, |
[0x30] = KC_B, |
[0x31] = KC_N, |
[0x32] = KC_M, |
[0x33] = KC_COMMA, |
[0x34] = KC_PERIOD, |
[0x35] = KC_SLASH, |
[0x36] = KC_RSHIFT, |
[0x1d] = KC_LCTRL, |
[0x38] = KC_LALT, |
[0x39] = KC_SPACE, |
[0x01] = KC_ESCAPE, |
[0x3b] = KC_F1, |
[0x3c] = KC_F2, |
[0x3d] = KC_F3, |
[0x3e] = KC_F4, |
[0x3f] = KC_F5, |
[0x40] = KC_F6, |
[0x41] = KC_F7, |
[0x42] = KC_F8, |
[0x43] = KC_F9, |
[0x44] = KC_F10, |
[0x57] = KC_F11, |
[0x58] = KC_F12, |
[0x46] = KC_SCROLL_LOCK, |
[0x1c] = KC_ENTER, |
[0x45] = KC_NUM_LOCK, |
[0x37] = KC_NTIMES, |
[0x4a] = KC_NMINUS, |
[0x4e] = KC_NPLUS, |
[0x47] = KC_N7, |
[0x48] = KC_N8, |
[0x49] = KC_N9, |
[0x4b] = KC_N4, |
[0x4c] = KC_N5, |
[0x4d] = KC_N6, |
[0x4f] = KC_N1, |
[0x50] = KC_N2, |
[0x51] = KC_N3, |
[0x52] = KC_N0, |
[0x53] = KC_NPERIOD |
}; |
static int scanmap_e0[] = { |
[0x38] = KC_RALT, |
[0x1d] = KC_RSHIFT, |
[0x37] = KC_PRTSCR, |
[0x52] = KC_INSERT, |
[0x47] = KC_HOME, |
[0x49] = KC_PAGE_UP, |
[0x53] = KC_DELETE, |
[0x4f] = KC_END, |
[0x51] = KC_PAGE_DOWN, |
[0x48] = KC_UP, |
[0x4b] = KC_LEFT, |
[0x50] = KC_DOWN, |
[0x4d] = KC_RIGHT, |
[0x35] = KC_NSLASH, |
[0x1c] = KC_NENTER |
}; |
int kbd_ctl_init(void) |
{ |
ds = ds_s; |
return 0; |
} |
void kbd_ctl_parse_scancode(int scancode) |
{ |
console_ev_type_t type; |
unsigned int key; |
int *map; |
size_t map_length; |
if (scancode == 0xe0) { |
ds = ds_e; |
return; |
} |
switch (ds) { |
case ds_s: |
map = scanmap_simple; |
map_length = sizeof(scanmap_simple) / sizeof(int); |
break; |
case ds_e: |
map = scanmap_e0; |
map_length = sizeof(scanmap_e0) / sizeof(int); |
break; |
default: |
map = NULL; |
map_length = 0; |
} |
ds = ds_s; |
if (scancode & 0x80) { |
scancode &= ~0x80; |
type = KEY_RELEASE; |
} else { |
type = KEY_PRESS; |
} |
if ((scancode < 0) || ((size_t) scancode >= map_length)) |
return; |
key = map[scancode]; |
if (key != 0) |
kbd_push_ev(type, key); |
} |
/** |
* @} |
*/ |
//branches/snapshot/uspace/srv/kbd/ctl/stty.c |
---|
0,0 → 1,228 |
/* |
* Copyright (c) 2009 Jiri Svoboda |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup kbd_ctl |
* @ingroup kbd |
* @{ |
*/ |
/** |
* @file |
* @brief Serial TTY-like keyboard controller driver. |
*/ |
#include <kbd.h> |
#include <io/keycode.h> |
#include <kbd_ctl.h> |
#include <gsp.h> |
#include <stroke.h> |
/** Scancode parser */ |
static gsp_t sp; |
/** Current parser state */ |
static int ds; |
#include <stdio.h> |
int seq_defs[] = { |
/* Not shifted */ |
0, KC_BACKTICK, 0x60, GSP_END, |
0, KC_1, 0x31, GSP_END, |
0, KC_2, 0x32, GSP_END, |
0, KC_3, 0x33, GSP_END, |
0, KC_4, 0x34, GSP_END, |
0, KC_5, 0x35, GSP_END, |
0, KC_6, 0x36, GSP_END, |
0, KC_7, 0x37, GSP_END, |
0, KC_8, 0x38, GSP_END, |
0, KC_9, 0x39, GSP_END, |
0, KC_0, 0x30, GSP_END, |
0, KC_MINUS, 0x2d, GSP_END, |
0, KC_EQUALS, 0x3d, GSP_END, |
0, KC_BACKSPACE, 0x08, GSP_END, |
0, KC_TAB, 0x09, GSP_END, |
0, KC_Q, 0x71, GSP_END, |
0, KC_W, 0x77, GSP_END, |
0, KC_E, 0x65, GSP_END, |
0, KC_R, 0x72, GSP_END, |
0, KC_T, 0x74, GSP_END, |
0, KC_Y, 0x79, GSP_END, |
0, KC_U, 0x75, GSP_END, |
0, KC_I, 0x69, GSP_END, |
0, KC_O, 0x6f, GSP_END, |
0, KC_P, 0x70, GSP_END, |
0, KC_LBRACKET, 0x5b, GSP_END, |
0, KC_RBRACKET, 0x5d, GSP_END, |
0, KC_A, 0x61, GSP_END, |
0, KC_S, 0x73, GSP_END, |
0, KC_D, 0x64, GSP_END, |
0, KC_F, 0x66, GSP_END, |
0, KC_G, 0x67, GSP_END, |
0, KC_H, 0x68, GSP_END, |
0, KC_J, 0x6a, GSP_END, |
0, KC_K, 0x6b, GSP_END, |
0, KC_L, 0x6c, GSP_END, |
0, KC_SEMICOLON, 0x3b, GSP_END, |
0, KC_QUOTE, 0x27, GSP_END, |
0, KC_BACKSLASH, 0x5c, GSP_END, |
0, KC_Z, 0x7a, GSP_END, |
0, KC_X, 0x78, GSP_END, |
0, KC_C, 0x63, GSP_END, |
0, KC_V, 0x76, GSP_END, |
0, KC_B, 0x62, GSP_END, |
0, KC_N, 0x6e, GSP_END, |
0, KC_M, 0x6d, GSP_END, |
0, KC_COMMA, 0x2c, GSP_END, |
0, KC_PERIOD, 0x2e, GSP_END, |
0, KC_SLASH, 0x2f, GSP_END, |
/* Shifted */ |
KM_SHIFT, KC_BACKTICK, 0x7e, GSP_END, |
KM_SHIFT, KC_1, 0x21, GSP_END, |
KM_SHIFT, KC_2, 0x40, GSP_END, |
KM_SHIFT, KC_3, 0x23, GSP_END, |
KM_SHIFT, KC_4, 0x24, GSP_END, |
KM_SHIFT, KC_5, 0x25, GSP_END, |
KM_SHIFT, KC_6, 0x5e, GSP_END, |
KM_SHIFT, KC_7, 0x26, GSP_END, |
KM_SHIFT, KC_8, 0x2a, GSP_END, |
KM_SHIFT, KC_9, 0x28, GSP_END, |
KM_SHIFT, KC_0, 0x29, GSP_END, |
KM_SHIFT, KC_MINUS, 0x5f, GSP_END, |
KM_SHIFT, KC_EQUALS, 0x2b, GSP_END, |
KM_SHIFT, KC_Q, 0x51, GSP_END, |
KM_SHIFT, KC_W, 0x57, GSP_END, |
KM_SHIFT, KC_E, 0x45, GSP_END, |
KM_SHIFT, KC_R, 0x52, GSP_END, |
KM_SHIFT, KC_T, 0x54, GSP_END, |
KM_SHIFT, KC_Y, 0x59, GSP_END, |
KM_SHIFT, KC_U, 0x55, GSP_END, |
KM_SHIFT, KC_I, 0x49, GSP_END, |
KM_SHIFT, KC_O, 0x4f, GSP_END, |
KM_SHIFT, KC_P, 0x50, GSP_END, |
KM_SHIFT, KC_LBRACKET, 0x7b, GSP_END, |
KM_SHIFT, KC_RBRACKET, 0x7d, GSP_END, |
KM_SHIFT, KC_A, 0x41, GSP_END, |
KM_SHIFT, KC_S, 0x53, GSP_END, |
KM_SHIFT, KC_D, 0x44, GSP_END, |
KM_SHIFT, KC_F, 0x46, GSP_END, |
KM_SHIFT, KC_G, 0x47, GSP_END, |
KM_SHIFT, KC_H, 0x48, GSP_END, |
KM_SHIFT, KC_J, 0x4a, GSP_END, |
KM_SHIFT, KC_K, 0x4b, GSP_END, |
KM_SHIFT, KC_L, 0x4c, GSP_END, |
KM_SHIFT, KC_SEMICOLON, 0x3a, GSP_END, |
KM_SHIFT, KC_QUOTE, 0x22, GSP_END, |
KM_SHIFT, KC_BACKSLASH, 0x7c, GSP_END, |
KM_SHIFT, KC_Z, 0x5a, GSP_END, |
KM_SHIFT, KC_X, 0x58, GSP_END, |
KM_SHIFT, KC_C, 0x43, GSP_END, |
KM_SHIFT, KC_V, 0x56, GSP_END, |
KM_SHIFT, KC_B, 0x42, GSP_END, |
KM_SHIFT, KC_N, 0x4e, GSP_END, |
KM_SHIFT, KC_M, 0x4d, GSP_END, |
KM_SHIFT, KC_COMMA, 0x3c, GSP_END, |
KM_SHIFT, KC_PERIOD, 0x3e, GSP_END, |
KM_SHIFT, KC_SLASH, 0x3f, GSP_END, |
/* ... */ |
0, KC_SPACE, 0x20, GSP_END, |
0, KC_ENTER, 0x0a, GSP_END, |
0, KC_ENTER, 0x0d, GSP_END, |
0, KC_ESCAPE, 0x1b, 0x1b, GSP_END, |
0, KC_F1, 0x1b, 0x4f, 0x50, GSP_END, |
0, KC_F2, 0x1b, 0x4f, 0x51, GSP_END, |
0, KC_F3, 0x1b, 0x4f, 0x52, GSP_END, |
0, KC_F4, 0x1b, 0x4f, 0x53, GSP_END, |
0, KC_F5, 0x1b, 0x5b, 0x31, 0x35, 0x7e, GSP_END, |
0, KC_F6, 0x1b, 0x5b, 0x31, 0x37, 0x7e, GSP_END, |
0, KC_F7, 0x1b, 0x5b, 0x31, 0x38, 0x7e, GSP_END, |
0, KC_F8, 0x1b, 0x5b, 0x31, 0x39, 0x7e, GSP_END, |
0, KC_F9, 0x1b, 0x5b, 0x32, 0x30, 0x7e, GSP_END, |
0, KC_F10, 0x1b, 0x5b, 0x32, 0x31, 0x7e, GSP_END, |
0, KC_F11, 0x1b, 0x5b, 0x32, 0x33, 0x7e, GSP_END, |
0, KC_F12, 0x1b, 0x5b, 0x32, 0x34, 0x7e, GSP_END, |
0, KC_INSERT, 0x1b, 0x5b, 0x32, 0x7e, GSP_END, |
0, KC_HOME, 0x1b, 0x5b, 0x48, GSP_END, |
0, KC_PAGE_UP, 0x1b, 0x5b, 0x35, 0x7e, GSP_END, |
0, KC_DELETE, 0x1b, 0x5b, 0x33, 0x7e, GSP_END, |
0, KC_END, 0x1b, 0x5b, 0x46, GSP_END, |
0, KC_PAGE_DOWN, 0x1b, 0x5b, 0x36, 0x7e, GSP_END, |
0, KC_UP, 0x1b, 0x5b, 0x41, GSP_END, |
0, KC_LEFT, 0x1b, 0x5b, 0x44, GSP_END, |
0, KC_DOWN, 0x1b, 0x5b, 0x42, GSP_END, |
0, KC_RIGHT, 0x1b, 0x5b, 0x43, GSP_END, |
0, 0 |
}; |
int kbd_ctl_init(void) |
{ |
ds = 0; |
gsp_init(&sp); |
return gsp_insert_defs(&sp, seq_defs); |
} |
void kbd_ctl_parse_scancode(int scancode) |
{ |
unsigned mods, key; |
ds = gsp_step(&sp, ds, scancode, &mods, &key); |
if (key != 0) { |
stroke_sim(mods, key); |
} |
} |
/** |
* @} |
*/ |
//branches/snapshot/uspace/srv/kbd/ctl/sun.c |
---|
0,0 → 1,209 |
/* |
* Copyright (c) 2006 Jakub Jermar |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup kbd_ctl |
* @ingroup kbd |
* @{ |
*/ |
/** |
* @file |
* @brief Sun keyboard controller driver. |
*/ |
#include <kbd.h> |
#include <io/console.h> |
#include <io/keycode.h> |
#include <kbd_ctl.h> |
#define KBD_KEY_RELEASE 0x80 |
#define KBD_ALL_KEYS_UP 0x7f |
static int scanmap_simple[]; |
int kbd_ctl_init(void) |
{ |
return 0; |
} |
void kbd_ctl_parse_scancode(int scancode) |
{ |
console_ev_type_t type; |
unsigned int key; |
if (scancode < 0 || scancode >= 0x100) |
return; |
if (scancode == KBD_ALL_KEYS_UP) |
return; |
if (scancode & KBD_KEY_RELEASE) { |
scancode &= ~KBD_KEY_RELEASE; |
type = KEY_RELEASE; |
} else { |
type = KEY_PRESS; |
} |
key = scanmap_simple[scancode]; |
if (key != 0) |
kbd_push_ev(type, key); |
} |
/** Primary meaning of scancodes. */ |
static int scanmap_simple[] = { |
[0x00] = 0, |
[0x01] = 0, |
[0x02] = 0, |
[0x03] = 0, |
[0x04] = 0, |
[0x05] = KC_F1, |
[0x06] = KC_F2, |
[0x07] = KC_F10, |
[0x08] = KC_F3, |
[0x09] = KC_F11, |
[0x0a] = KC_F4, |
[0x0b] = KC_F12, |
[0x0c] = KC_F5, |
[0x0d] = KC_RALT, |
[0x0e] = KC_F6, |
[0x0f] = 0, |
[0x10] = KC_F7, |
[0x11] = KC_F8, |
[0x12] = KC_F9, |
[0x13] = KC_LALT, |
[0x14] = KC_UP, |
[0x15] = KC_PAUSE, |
[0x16] = 0, |
[0x17] = KC_SCROLL_LOCK, |
[0x18] = KC_LEFT, |
[0x19] = 0, |
[0x1a] = 0, |
[0x1b] = KC_DOWN, |
[0x1c] = KC_RIGHT, |
[0x1d] = KC_ESCAPE, |
[0x1e] = KC_1, |
[0x1f] = KC_2, |
[0x20] = KC_3, |
[0x21] = KC_4, |
[0x22] = KC_5, |
[0x23] = KC_6, |
[0x24] = KC_7, |
[0x25] = KC_8, |
[0x26] = KC_9, |
[0x27] = KC_0, |
[0x28] = KC_MINUS, |
[0x29] = KC_EQUALS, |
[0x2a] = KC_BACKTICK, |
[0x2b] = KC_BACKSPACE, |
[0x2c] = KC_INSERT, |
[0x2d] = 0, |
[0x2e] = KC_NSLASH, |
[0x2f] = KC_NTIMES, |
[0x30] = 0, |
[0x31] = 0, |
[0x32] = KC_NPERIOD, |
[0x33] = 0, |
[0x34] = KC_HOME, |
[0x35] = KC_TAB, |
[0x36] = KC_Q, |
[0x37] = KC_W, |
[0x38] = KC_E, |
[0x39] = KC_R, |
[0x3a] = KC_T, |
[0x3b] = KC_Y, |
[0x3c] = KC_U, |
[0x3d] = KC_I, |
[0x3e] = KC_O, |
[0x3f] = KC_P, |
[0x40] = KC_LBRACKET, |
[0x41] = KC_RBRACKET, |
[0x42] = KC_DELETE, |
[0x43] = 0, |
[0x44] = KC_N7, |
[0x45] = KC_N8, |
[0x46] = KC_N9, |
[0x47] = KC_NMINUS, |
[0x48] = 0, |
[0x49] = 0, |
[0x4a] = KC_END, |
[0x4b] = 0, |
[0x4c] = KC_LCTRL, |
[0x4d] = KC_A, |
[0x4e] = KC_S, |
[0x4f] = KC_D, |
[0x50] = KC_F, |
[0x51] = KC_G, |
[0x52] = KC_H, |
[0x53] = KC_J, |
[0x54] = KC_K, |
[0x55] = KC_L, |
[0x56] = KC_SEMICOLON, |
[0x57] = KC_QUOTE, |
[0x58] = KC_BACKSLASH, |
[0x59] = KC_ENTER, |
[0x5a] = KC_NENTER, |
[0x5b] = KC_N4, |
[0x5c] = KC_N5, |
[0x5d] = KC_N6, |
[0x5e] = KC_N0, |
[0x5f] = 0, |
[0x60] = KC_PAGE_UP, |
[0x61] = 0, |
[0x62] = KC_NUM_LOCK, |
[0x63] = KC_LSHIFT, |
[0x64] = KC_Z, |
[0x65] = KC_X, |
[0x66] = KC_C, |
[0x67] = KC_V, |
[0x68] = KC_B, |
[0x69] = KC_N, |
[0x6a] = KC_M, |
[0x6b] = KC_COMMA, |
[0x6c] = KC_PERIOD, |
[0x6d] = KC_SLASH, |
[0x6e] = KC_RSHIFT, |
[0x6f] = 0, |
[0x70] = KC_N1, |
[0x71] = KC_N2, |
[0x72] = KC_N3, |
[0x73] = 0, |
[0x74] = 0, |
[0x75] = 0, |
[0x76] = 0, |
[0x77] = KC_CAPS_LOCK, |
[0x78] = 0, |
[0x79] = KC_SPACE, |
[0x7a] = 0, |
[0x7b] = KC_PAGE_DOWN, |
[0x7c] = 0, |
[0x7d] = KC_NPLUS, |
[0x7e] = 0, |
[0x7f] = 0 |
}; |
/** @} |
*/ |
//branches/snapshot/uspace/srv/kbd/ctl/gxe_fb.c |
---|
0,0 → 1,229 |
/* |
* Copyright (c) 2009 Jiri Svoboda |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup kbd_ctl |
* @ingroup kbd |
* @{ |
*/ |
/** |
* @file |
* @brief GXEmul framebuffer-mode keyboard controller driver. |
*/ |
#include <kbd.h> |
#include <io/console.h> |
#include <io/keycode.h> |
#include <kbd_ctl.h> |
#include <gsp.h> |
#include <stroke.h> |
/** Scancode parser */ |
static gsp_t sp; |
/** Current parser state */ |
static int ds; |
#include <stdio.h> |
int seq_defs[] = { |
/* Not shifted */ |
0, KC_BACKTICK, 0x60, GSP_END, |
0, KC_1, 0x31, GSP_END, |
0, KC_2, 0x32, GSP_END, |
0, KC_3, 0x33, GSP_END, |
0, KC_4, 0x34, GSP_END, |
0, KC_5, 0x35, GSP_END, |
0, KC_6, 0x36, GSP_END, |
0, KC_7, 0x37, GSP_END, |
0, KC_8, 0x38, GSP_END, |
0, KC_9, 0x39, GSP_END, |
0, KC_0, 0x30, GSP_END, |
0, KC_MINUS, 0x2d, GSP_END, |
0, KC_EQUALS, 0x3d, GSP_END, |
0, KC_BACKSPACE, 0x08, GSP_END, |
0, KC_TAB, 0x09, GSP_END, |
0, KC_Q, 0x71, GSP_END, |
0, KC_W, 0x77, GSP_END, |
0, KC_E, 0x65, GSP_END, |
0, KC_R, 0x72, GSP_END, |
0, KC_T, 0x74, GSP_END, |
0, KC_Y, 0x79, GSP_END, |
0, KC_U, 0x75, GSP_END, |
0, KC_I, 0x69, GSP_END, |
0, KC_O, 0x6f, GSP_END, |
0, KC_P, 0x70, GSP_END, |
0, KC_LBRACKET, 0x5b, GSP_END, |
0, KC_RBRACKET, 0x5d, GSP_END, |
0, KC_A, 0x61, GSP_END, |
0, KC_S, 0x73, GSP_END, |
0, KC_D, 0x64, GSP_END, |
0, KC_F, 0x66, GSP_END, |
0, KC_G, 0x67, GSP_END, |
0, KC_H, 0x68, GSP_END, |
0, KC_J, 0x6a, GSP_END, |
0, KC_K, 0x6b, GSP_END, |
0, KC_L, 0x6c, GSP_END, |
0, KC_SEMICOLON, 0x3b, GSP_END, |
0, KC_QUOTE, 0x27, GSP_END, |
0, KC_BACKSLASH, 0x5c, GSP_END, |
0, KC_Z, 0x7a, GSP_END, |
0, KC_X, 0x78, GSP_END, |
0, KC_C, 0x63, GSP_END, |
0, KC_V, 0x76, GSP_END, |
0, KC_B, 0x62, GSP_END, |
0, KC_N, 0x6e, GSP_END, |
0, KC_M, 0x6d, GSP_END, |
0, KC_COMMA, 0x2c, GSP_END, |
0, KC_PERIOD, 0x2e, GSP_END, |
0, KC_SLASH, 0x2f, GSP_END, |
/* Shifted */ |
KM_SHIFT, KC_BACKTICK, 0x7e, GSP_END, |
KM_SHIFT, KC_1, 0x21, GSP_END, |
KM_SHIFT, KC_2, 0x40, GSP_END, |
KM_SHIFT, KC_3, 0x23, GSP_END, |
KM_SHIFT, KC_4, 0x24, GSP_END, |
KM_SHIFT, KC_5, 0x25, GSP_END, |
KM_SHIFT, KC_6, 0x5e, GSP_END, |
KM_SHIFT, KC_7, 0x26, GSP_END, |
KM_SHIFT, KC_8, 0x2a, GSP_END, |
KM_SHIFT, KC_9, 0x28, GSP_END, |
KM_SHIFT, KC_0, 0x29, GSP_END, |
KM_SHIFT, KC_MINUS, 0x5f, GSP_END, |
KM_SHIFT, KC_EQUALS, 0x2b, GSP_END, |
KM_SHIFT, KC_Q, 0x51, GSP_END, |
KM_SHIFT, KC_W, 0x57, GSP_END, |
KM_SHIFT, KC_E, 0x45, GSP_END, |
KM_SHIFT, KC_R, 0x52, GSP_END, |
KM_SHIFT, KC_T, 0x54, GSP_END, |
KM_SHIFT, KC_Y, 0x59, GSP_END, |
KM_SHIFT, KC_U, 0x55, GSP_END, |
KM_SHIFT, KC_I, 0x49, GSP_END, |
KM_SHIFT, KC_O, 0x4f, GSP_END, |
KM_SHIFT, KC_P, 0x50, GSP_END, |
KM_SHIFT, KC_LBRACKET, 0x7b, GSP_END, |
KM_SHIFT, KC_RBRACKET, 0x7d, GSP_END, |
KM_SHIFT, KC_A, 0x41, GSP_END, |
KM_SHIFT, KC_S, 0x53, GSP_END, |
KM_SHIFT, KC_D, 0x44, GSP_END, |
KM_SHIFT, KC_F, 0x46, GSP_END, |
KM_SHIFT, KC_G, 0x47, GSP_END, |
KM_SHIFT, KC_H, 0x48, GSP_END, |
KM_SHIFT, KC_J, 0x4a, GSP_END, |
KM_SHIFT, KC_K, 0x4b, GSP_END, |
KM_SHIFT, KC_L, 0x4c, GSP_END, |
KM_SHIFT, KC_SEMICOLON, 0x3a, GSP_END, |
KM_SHIFT, KC_QUOTE, 0x22, GSP_END, |
KM_SHIFT, KC_BACKSLASH, 0x7c, GSP_END, |
KM_SHIFT, KC_Z, 0x5a, GSP_END, |
KM_SHIFT, KC_X, 0x58, GSP_END, |
KM_SHIFT, KC_C, 0x43, GSP_END, |
KM_SHIFT, KC_V, 0x56, GSP_END, |
KM_SHIFT, KC_B, 0x42, GSP_END, |
KM_SHIFT, KC_N, 0x4e, GSP_END, |
KM_SHIFT, KC_M, 0x4d, GSP_END, |
KM_SHIFT, KC_COMMA, 0x3c, GSP_END, |
KM_SHIFT, KC_PERIOD, 0x3e, GSP_END, |
KM_SHIFT, KC_SLASH, 0x3f, GSP_END, |
/* ... */ |
0, KC_SPACE, 0x20, GSP_END, |
0, KC_ENTER, 0x0a, GSP_END, |
0, KC_ENTER, 0x0d, GSP_END, |
0, KC_ESCAPE, 0x1b, 0x1b, GSP_END, |
0, KC_F1, 0x1b, 0x5b, 0x4f, 0x50, GSP_END, |
0, KC_F2, 0x1b, 0x5b, 0x4f, 0x51, GSP_END, |
0, KC_F3, 0x1b, 0x5b, 0x4f, 0x52, GSP_END, |
0, KC_F4, 0x1b, 0x5b, 0x4f, 0x53, GSP_END, |
0, KC_F5, 0x1b, 0x5b, 0x31, 0x35, GSP_END, |
0, KC_F6, 0x1b, 0x5b, 0x31, 0x37, GSP_END, |
0, KC_F7, 0x1b, 0x5b, 0x31, 0x38, GSP_END, |
0, KC_F8, 0x1b, 0x5b, 0x31, 0x39, GSP_END, |
0, KC_F9, 0x1b, 0x5b, 0x32, 0x38, GSP_END, |
0, KC_F10, 0x1b, 0x5b, 0x32, 0x39, GSP_END, |
0, KC_F11, 0x1b, 0x5b, 0x32, 0x33, GSP_END, |
0, KC_F12, 0x1b, 0x5b, 0x32, 0x34, GSP_END, |
0, KC_INSERT, 0x1b, 0x5b, 0x32, 0x7e, GSP_END, |
0, KC_HOME, 0x1b, 0x5b, 0x48, GSP_END, |
0, KC_PAGE_UP, 0x1b, 0x5b, 0x35, 0x7e, GSP_END, |
0, KC_DELETE, 0x1b, 0x5b, 0x33, 0x7e, GSP_END, |
0, KC_END, 0x1b, 0x5b, 0x46, GSP_END, |
0, KC_PAGE_DOWN, 0x1b, 0x5b, 0x36, 0x7e, GSP_END, |
0, KC_UP, 0x1b, 0x5b, 0x41, GSP_END, |
0, KC_LEFT, 0x1b, 0x5b, 0x44, GSP_END, |
0, KC_DOWN, 0x1b, 0x5b, 0x42, GSP_END, |
0, KC_RIGHT, 0x1b, 0x5b, 0x43, GSP_END, |
0, 0 |
}; |
int kbd_ctl_init(void) |
{ |
ds = 0; |
gsp_init(&sp); |
return gsp_insert_defs(&sp, seq_defs); |
} |
void kbd_ctl_parse_scancode(int scancode) |
{ |
unsigned mods, key; |
ds = gsp_step(&sp, ds, scancode, &mods, &key); |
if (key != 0) { |
stroke_sim(mods, key); |
} |
} |
/** |
* @} |
*/ |
//branches/snapshot/uspace/srv/kbd/port/i8042.c |
---|
0,0 → 1,177 |
/* |
* Copyright (c) 2001-2004 Jakub Jermar |
* Copyright (c) 2006 Josef Cejka |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup kbd_port |
* @ingroup kbd |
* @{ |
*/ |
/** @file |
* @brief i8042 port driver. |
*/ |
#include <ddi.h> |
#include <libarch/ddi.h> |
#include <ipc/ipc.h> |
#include <async.h> |
#include <unistd.h> |
#include <sysinfo.h> |
#include <kbd_port.h> |
#include <kbd.h> |
#include <ddi.h> |
#include "i8042.h" |
/* Interesting bits for status register */ |
#define i8042_OUTPUT_FULL 0x1 |
#define i8042_INPUT_FULL 0x2 |
#define i8042_MOUSE_DATA 0x20 |
/* Command constants */ |
#define i8042_CMD_KBD 0x60 |
#define i8042_CMD_MOUSE 0xd4 |
/* Keyboard cmd byte */ |
#define i8042_KBD_IE 0x1 |
#define i8042_MOUSE_IE 0x2 |
#define i8042_KBD_DISABLE 0x10 |
#define i8042_MOUSE_DISABLE 0x20 |
#define i8042_KBD_TRANSLATE 0x40 |
/* Mouse constants */ |
#define MOUSE_OUT_INIT 0xf4 |
#define MOUSE_ACK 0xfa |
static irq_cmd_t i8042_cmds[] = { |
{ |
.cmd = CMD_PIO_READ_8, |
.addr = NULL, /* will be patched in run-time */ |
.dstarg = 1 |
}, |
{ |
.cmd = CMD_BTEST, |
.value = i8042_OUTPUT_FULL, |
.srcarg = 1, |
.dstarg = 3 |
}, |
{ |
.cmd = CMD_PREDICATE, |
.value = 2, |
.srcarg = 3 |
}, |
{ |
.cmd = CMD_PIO_READ_8, |
.addr = NULL, /* will be patched in run-time */ |
.dstarg = 2 |
}, |
{ |
.cmd = CMD_ACCEPT |
} |
}; |
static irq_code_t i8042_kbd = { |
sizeof(i8042_cmds) / sizeof(irq_cmd_t), |
i8042_cmds |
}; |
static uintptr_t i8042_physical; |
static uintptr_t i8042_kernel; |
static i8042_t * i8042; |
static void wait_ready(void) { |
while (pio_read_8(&i8042->status) & i8042_INPUT_FULL) |
; |
} |
static void i8042_irq_handler(ipc_callid_t iid, ipc_call_t *call); |
int kbd_port_init(void) |
{ |
int mouseenabled = 0; |
void *vaddr; |
i8042_physical = sysinfo_value("kbd.address.physical"); |
i8042_kernel = sysinfo_value("kbd.address.kernel"); |
if (pio_enable((void *) i8042_physical, sizeof(i8042_t), &vaddr) != 0) |
return -1; |
i8042 = vaddr; |
async_set_interrupt_received(i8042_irq_handler); |
/* Disable kbd, enable mouse */ |
pio_write_8(&i8042->status, i8042_CMD_KBD); |
wait_ready(); |
pio_write_8(&i8042->status, i8042_CMD_KBD); |
wait_ready(); |
pio_write_8(&i8042->data, i8042_KBD_DISABLE); |
wait_ready(); |
/* Flush all current IO */ |
while (pio_read_8(&i8042->status) & i8042_OUTPUT_FULL) |
(void) pio_read_8(&i8042->data); |
/* Enable kbd */ |
i8042_kbd.cmds[0].addr = (void *) &((i8042_t *) i8042_kernel)->status; |
i8042_kbd.cmds[3].addr = (void *) &((i8042_t *) i8042_kernel)->data; |
ipc_register_irq(sysinfo_value("kbd.inr"), device_assign_devno(), 0, &i8042_kbd); |
int newcontrol = i8042_KBD_IE | i8042_KBD_TRANSLATE; |
if (mouseenabled) |
newcontrol |= i8042_MOUSE_IE; |
pio_write_8(&i8042->status, i8042_CMD_KBD); |
wait_ready(); |
pio_write_8(&i8042->data, newcontrol); |
wait_ready(); |
return 0; |
} |
void kbd_port_yield(void) |
{ |
} |
void kbd_port_reclaim(void) |
{ |
} |
static void i8042_irq_handler(ipc_callid_t iid, ipc_call_t *call) |
{ |
int status = IPC_GET_ARG1(*call); |
if ((status & i8042_MOUSE_DATA)) |
return; |
int scan_code = IPC_GET_ARG2(*call); |
kbd_push_scancode(scan_code); |
return; |
} |
/** |
* @} |
*/ |
//branches/snapshot/uspace/srv/kbd/port/sgcn.c |
---|
0,0 → 1,176 |
/* |
* Copyright (c) 2008 Pavel Rimsky |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup kbd_port |
* @ingroup kbd |
* @{ |
*/ |
/** @file |
* @brief SGCN (Serengeti Console) keyboard port driver. |
*/ |
#include <as.h> |
#include <ddi.h> |
#include <async.h> |
#include <kbd.h> |
#include <kbd_port.h> |
#include <sysinfo.h> |
#include <stdio.h> |
#include <thread.h> |
#include <bool.h> |
#define POLL_INTERVAL 10000 |
/** |
* SGCN buffer header. It is placed at the very beginning of the SGCN |
* buffer. |
*/ |
typedef struct { |
/** hard-wired to "CON" */ |
char magic[4]; |
/** we don't need this */ |
char unused[8]; |
/** offset within the SGCN buffer of the input buffer start */ |
uint32_t in_begin; |
/** offset within the SGCN buffer of the input buffer end */ |
uint32_t in_end; |
/** offset within the SGCN buffer of the input buffer read pointer */ |
uint32_t in_rdptr; |
/** offset within the SGCN buffer of the input buffer write pointer */ |
uint32_t in_wrptr; |
} __attribute__ ((packed)) sgcn_buffer_header_t; |
/* |
* Returns a pointer to the object of a given type which is placed at the given |
* offset from the console buffer beginning. |
*/ |
#define SGCN_BUFFER(type, offset) \ |
((type *) (sram_virt_addr + sram_buffer_offset + (offset))) |
/** Returns a pointer to the console buffer header. */ |
#define SGCN_BUFFER_HEADER (SGCN_BUFFER(sgcn_buffer_header_t, 0)) |
/** |
* Virtual address mapped to SRAM. |
*/ |
static uintptr_t sram_virt_addr; |
/** |
* SGCN buffer offset within SGCN. |
*/ |
static uintptr_t sram_buffer_offset; |
/* polling thread */ |
static void *sgcn_thread_impl(void *arg); |
static volatile bool polling_disabled = false; |
/** |
* Initializes the SGCN driver. |
* Maps the physical memory (SRAM) and creates the polling thread. |
*/ |
int kbd_port_init(void) |
{ |
sram_virt_addr = (uintptr_t) as_get_mappable_page(sysinfo_value("sram.area.size")); |
if (physmem_map((void *) sysinfo_value("sram.address.physical"), |
(void *) sram_virt_addr, sysinfo_value("sram.area.size") / PAGE_SIZE, |
AS_AREA_READ | AS_AREA_WRITE) != 0) { |
printf("SGCN: uspace driver could not map physical memory."); |
return -1; |
} |
sram_buffer_offset = sysinfo_value("sram.buffer.offset"); |
thread_id_t tid; |
int rc; |
rc = thread_create(sgcn_thread_impl, NULL, "kbd_poll", &tid); |
if (rc != 0) { |
return rc; |
} |
return 0; |
} |
void kbd_port_yield(void) |
{ |
polling_disabled = true; |
} |
void kbd_port_reclaim(void) |
{ |
polling_disabled = false; |
} |
/** |
* Handler of the "key pressed" event. Reads codes of all the pressed keys from |
* the buffer. |
*/ |
static void sgcn_key_pressed(void) |
{ |
char c; |
uint32_t begin = SGCN_BUFFER_HEADER->in_begin; |
uint32_t end = SGCN_BUFFER_HEADER->in_end; |
uint32_t size = end - begin; |
volatile char *buf_ptr = (volatile char *) |
SGCN_BUFFER(char, SGCN_BUFFER_HEADER->in_rdptr); |
volatile uint32_t *in_wrptr_ptr = &(SGCN_BUFFER_HEADER->in_wrptr); |
volatile uint32_t *in_rdptr_ptr = &(SGCN_BUFFER_HEADER->in_rdptr); |
while (*in_rdptr_ptr != *in_wrptr_ptr) { |
c = *buf_ptr; |
*in_rdptr_ptr = (((*in_rdptr_ptr) - begin + 1) % size) + begin; |
buf_ptr = (volatile char *) |
SGCN_BUFFER(char, SGCN_BUFFER_HEADER->in_rdptr); |
kbd_push_scancode(c); |
} |
} |
/** |
* Thread to poll SGCN for keypresses. |
*/ |
static void *sgcn_thread_impl(void *arg) |
{ |
(void) arg; |
while (1) { |
if (polling_disabled == false) |
sgcn_key_pressed(); |
usleep(POLL_INTERVAL); |
} |
} |
/** @} |
*/ |
//branches/snapshot/uspace/srv/kbd/port/gxemul.c |
---|
0,0 → 1,95 |
/* |
* Copyright (c) 2007 Michal Kebrt |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup kbd_port |
* @{ |
* @ingroup kbd |
*/ |
/** @file |
* @brief GXEmul keyboard port driver. |
*/ |
#include <ipc/ipc.h> |
#include <async.h> |
#include <sysinfo.h> |
#include <kbd_port.h> |
#include <kbd.h> |
#include <ddi.h> |
static irq_cmd_t gxemul_cmds[] = { |
{ |
.cmd = CMD_PIO_READ_8, |
.addr = (void *) 0, /* will be patched in run-time */ |
.dstarg = 2, |
}, |
{ |
.cmd = CMD_ACCEPT |
} |
}; |
static irq_code_t gxemul_kbd = { |
sizeof(gxemul_cmds) / sizeof(irq_cmd_t), |
gxemul_cmds |
}; |
static void gxemul_irq_handler(ipc_callid_t iid, ipc_call_t *call); |
/** Initializes keyboard handler. */ |
int kbd_port_init(void) |
{ |
async_set_interrupt_received(gxemul_irq_handler); |
gxemul_cmds[0].addr = (void *) sysinfo_value("kbd.address.virtual"); |
ipc_register_irq(sysinfo_value("kbd.inr"), device_assign_devno(), |
0, &gxemul_kbd); |
return 0; |
} |
void kbd_port_yield(void) |
{ |
} |
void kbd_port_reclaim(void) |
{ |
} |
/** Process data sent when a key is pressed. |
* |
* @param keybuffer Buffer of pressed keys. |
* @param call IPC call. |
* |
* @return Always 1. |
*/ |
static void gxemul_irq_handler(ipc_callid_t iid, ipc_call_t *call) |
{ |
int scan_code = IPC_GET_ARG2(*call); |
kbd_push_scancode(scan_code); |
} |
/** @} |
*/ |
//branches/snapshot/uspace/srv/kbd/port/ns16550.c |
---|
0,0 → 1,129 |
/* |
* Copyright (c) 2006 Josef Cejka |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup kbd_port |
* @ingroup kbd |
* @{ |
*/ |
/** @file |
* @brief NS16550 port driver. |
*/ |
#include <ipc/ipc.h> |
#include <ipc/bus.h> |
#include <async.h> |
#include <sysinfo.h> |
#include <kbd.h> |
#include <kbd_port.h> |
#include <sun.h> |
#include <ddi.h> |
/* NS16550 registers */ |
#define RBR_REG 0 /** Receiver Buffer Register. */ |
#define IER_REG 1 /** Interrupt Enable Register. */ |
#define IIR_REG 2 /** Interrupt Ident Register (read). */ |
#define FCR_REG 2 /** FIFO control register (write). */ |
#define LCR_REG 3 /** Line Control register. */ |
#define MCR_REG 4 /** Modem Control Register. */ |
#define LSR_REG 5 /** Line Status Register. */ |
#define LSR_DATA_READY 0x01 |
static irq_cmd_t ns16550_cmds[] = { |
{ |
.cmd = CMD_PIO_READ_8, |
.addr = (void *) 0, /* will be patched in run-time */ |
.dstarg = 1 |
}, |
{ |
.cmd = CMD_BTEST, |
.value = LSR_DATA_READY, |
.srcarg = 1, |
.dstarg = 3 |
}, |
{ |
.cmd = CMD_PREDICATE, |
.value = 2, |
.srcarg = 3 |
}, |
{ |
.cmd = CMD_PIO_READ_8, |
.addr = (void *) 0, /* will be patched in run-time */ |
.dstarg = 2 |
}, |
{ |
.cmd = CMD_ACCEPT |
} |
}; |
irq_code_t ns16550_kbd = { |
sizeof(ns16550_cmds) / sizeof(irq_cmd_t), |
ns16550_cmds |
}; |
static void ns16550_irq_handler(ipc_callid_t iid, ipc_call_t *call); |
static uintptr_t ns16550_physical; |
static uintptr_t ns16550_kernel; |
int ns16550_port_init(void) |
{ |
void *vaddr; |
async_set_interrupt_received(ns16550_irq_handler); |
ns16550_physical = sysinfo_value("kbd.address.physical"); |
ns16550_kernel = sysinfo_value("kbd.address.kernel"); |
ns16550_kbd.cmds[0].addr = (void *) (ns16550_kernel + LSR_REG); |
ns16550_kbd.cmds[3].addr = (void *) (ns16550_kernel + RBR_REG); |
ipc_register_irq(sysinfo_value("kbd.inr"), device_assign_devno(), |
sysinfo_value("kbd.inr"), &ns16550_kbd); |
return pio_enable((void *) ns16550_physical, 8, &vaddr); |
} |
void ns16550_port_yield(void) |
{ |
} |
void ns16550_port_reclaim(void) |
{ |
} |
static void ns16550_irq_handler(ipc_callid_t iid, ipc_call_t *call) |
{ |
int scan_code = IPC_GET_ARG2(*call); |
kbd_push_scancode(scan_code); |
if (cir_service) |
async_msg_1(cir_phone, BUS_CLEAR_INTERRUPT, |
IPC_GET_METHOD(*call)); |
} |
/** |
* @} |
*/ |
//branches/snapshot/uspace/srv/kbd/port/msim.c |
---|
0,0 → 1,87 |
/* |
* Copyright (c) 2006 Josef Cejka |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup kbd_port |
* @ingroup kbd |
* @{ |
*/ |
/** @file |
* @brief Msim keyboard port driver. |
*/ |
#include <ipc/ipc.h> |
#include <async.h> |
#include <sysinfo.h> |
#include <kbd_port.h> |
#include <kbd.h> |
#include <ddi.h> |
irq_cmd_t msim_cmds[] = { |
{ |
.cmd = CMD_PIO_READ_8, |
.addr = (void *) 0, /* will be patched in run-time */ |
.dstarg = 2 |
}, |
{ |
.cmd = CMD_ACCEPT |
} |
}; |
irq_code_t msim_kbd = { |
sizeof(msim_cmds) / sizeof(irq_cmd_t), |
msim_cmds |
}; |
static void msim_irq_handler(ipc_callid_t iid, ipc_call_t *call); |
int kbd_port_init(void) |
{ |
async_set_interrupt_received(msim_irq_handler); |
msim_cmds[0].addr = sysinfo_value("kbd.address.virtual"); |
ipc_register_irq(sysinfo_value("kbd.inr"), device_assign_devno(), |
0, &msim_kbd); |
return 0; |
} |
void kbd_port_yield(void) |
{ |
} |
void kbd_port_reclaim(void) |
{ |
} |
static void msim_irq_handler(ipc_callid_t iid, ipc_call_t *call) |
{ |
int scan_code = IPC_GET_ARG2(*call); |
kbd_push_scancode(scan_code); |
} |
/** @} |
*/ |
//branches/snapshot/uspace/srv/kbd/port/sun.c |
---|
0,0 → 1,74 |
/* |
* Copyright (c) 2009 Martin Decky |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup kbd_port |
* @ingroup kbd |
* @{ |
*/ |
/** @file |
* @brief Sun keyboard virtual port driver. |
*/ |
#include <kbd.h> |
#include <kbd_port.h> |
#include <sun.h> |
#include <sysinfo.h> |
/** Sun keyboard virtual port driver. |
* |
* This is a virtual port driver which can use |
* both ns16550_port_init and z8530_port_init |
* according to the information passed from the |
* kernel. This is just a temporal hack. |
* |
*/ |
int kbd_port_init(void) |
{ |
if (sysinfo_value("kbd.type.z8530")) { |
if (z8530_port_init() == 0) |
return 0; |
} |
if (sysinfo_value("kbd.type.ns16550")) { |
if (ns16550_port_init() == 0) |
return 0; |
} |
return -1; |
} |
void kbd_port_yield(void) |
{ |
} |
void kbd_port_reclaim(void) |
{ |
} |
/** @} |
*/ |
//branches/snapshot/uspace/srv/kbd/port/ski.c |
---|
0,0 → 1,123 |
/* |
* Copyright (c) 2005 Jakub Jermar |
* Copyright (c) 2009 Jiri Svoboda |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup kbd_port |
* @ingroup kbd |
* @{ |
*/ |
/** @file |
* @brief Ski console keyboard port driver. |
*/ |
#include <stdlib.h> |
#include <unistd.h> |
#include <kbd.h> |
#include <kbd_port.h> |
#include <sys/types.h> |
#include <thread.h> |
#include <bool.h> |
#define SKI_GETCHAR 21 |
#define POLL_INTERVAL 10000 |
static void *ski_thread_impl(void *arg); |
static int32_t ski_getchar(void); |
static volatile bool polling_disabled = false; |
/** Initialize Ski port driver. */ |
int kbd_port_init(void) |
{ |
thread_id_t tid; |
int rc; |
rc = thread_create(ski_thread_impl, NULL, "kbd_poll", &tid); |
if (rc != 0) { |
return rc; |
} |
return 0; |
} |
void kbd_port_yield(void) |
{ |
polling_disabled = true; |
} |
void kbd_port_reclaim(void) |
{ |
polling_disabled = false; |
} |
/** Thread to poll Ski for keypresses. */ |
static void *ski_thread_impl(void *arg) |
{ |
int32_t c; |
(void) arg; |
while (1) { |
while (polling_disabled == false) { |
c = ski_getchar(); |
if (c == 0) |
break; |
kbd_push_scancode(c); |
} |
usleep(POLL_INTERVAL); |
} |
} |
/** Ask Ski if a key was pressed. |
* |
* Use SSC (Simulator System Call) to get character from the debug console. |
* This call is non-blocking. |
* |
* @return ASCII code of pressed key or 0 if no key pressed. |
*/ |
static int32_t ski_getchar(void) |
{ |
uint64_t ch; |
asm volatile ( |
"mov r15 = %1\n" |
"break 0x80000;;\n" /* modifies r8 */ |
"mov %0 = r8;;\n" |
: "=r" (ch) |
: "i" (SKI_GETCHAR) |
: "r15", "r8" |
); |
return (int32_t) ch; |
} |
/** @} |
*/ |
//branches/snapshot/uspace/srv/kbd/port/z8530.c |
---|
0,0 → 1,117 |
/* |
* Copyright (c) 2006 Martin Decky |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup kbd_port |
* @ingroup kbd |
* @{ |
*/ |
/** @file |
* @brief Z8530 keyboard port driver. |
*/ |
#include <ipc/ipc.h> |
#include <ipc/bus.h> |
#include <async.h> |
#include <sysinfo.h> |
#include <kbd.h> |
#include <kbd_port.h> |
#include <sun.h> |
#include <sys/types.h> |
#include <ddi.h> |
#define CHAN_A_STATUS 4 |
#define CHAN_A_DATA 6 |
#define RR0_RCA 1 |
static irq_cmd_t z8530_cmds[] = { |
{ |
.cmd = CMD_PIO_READ_8, |
.addr = (void *) 0, /* will be patched in run-time */ |
.dstarg = 1 |
}, |
{ |
.cmd = CMD_BTEST, |
.value = RR0_RCA, |
.srcarg = 1, |
.dstarg = 3 |
}, |
{ |
.cmd = CMD_PREDICATE, |
.value = 2, |
.srcarg = 3 |
}, |
{ |
.cmd = CMD_PIO_READ_8, |
.addr = (void *) 0, /* will be patched in run-time */ |
.dstarg = 2 |
}, |
{ |
.cmd = CMD_ACCEPT |
} |
}; |
irq_code_t z8530_kbd = { |
sizeof(z8530_cmds) / sizeof(irq_cmd_t), |
z8530_cmds |
}; |
static void z8530_irq_handler(ipc_callid_t iid, ipc_call_t *call); |
int z8530_port_init(void) |
{ |
async_set_interrupt_received(z8530_irq_handler); |
z8530_cmds[0].addr = (void *) sysinfo_value("kbd.address.kernel") + |
CHAN_A_STATUS; |
z8530_cmds[3].addr = (void *) sysinfo_value("kbd.address.kernel") + |
CHAN_A_DATA; |
ipc_register_irq(sysinfo_value("kbd.inr"), device_assign_devno(), |
sysinfo_value("kbd.inr"), &z8530_kbd); |
return 0; |
} |
void z8530_port_yield(void) |
{ |
} |
void z8530_port_reclaim(void) |
{ |
} |
static void z8530_irq_handler(ipc_callid_t iid, ipc_call_t *call) |
{ |
int scan_code = IPC_GET_ARG2(*call); |
kbd_push_scancode(scan_code); |
if (cir_service) |
async_msg_1(cir_phone, BUS_CLEAR_INTERRUPT, |
IPC_GET_METHOD(*call)); |
} |
/** @} |
*/ |
//branches/snapshot/uspace/srv/kbd/port/dummy.c |
---|
0,0 → 1,54 |
/* |
* Copyright (c) 2009 Jiri Svoboda |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup kbd_port |
* @brief Dummy keyboard port driver. |
* @ingroup kbd |
* @{ |
*/ |
/** @file |
*/ |
#include <kbd_port.h> |
#include <kbd.h> |
int kbd_port_init(void) |
{ |
return 0; |
} |
void kbd_port_yield(void) |
{ |
} |
void kbd_port_reclaim(void) |
{ |
} |
/** @} |
*/ |
//branches/snapshot/uspace/srv/kbd/port/i8042.h |
---|
0,0 → 1,55 |
/* |
* Copyright (c) 2006 Josef Cejka |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup kbd_port |
* @ingroup kbd |
* @{ |
*/ |
/** @file |
* @brief i8042 port driver. |
*/ |
#ifndef KBD_PORT_i8042_H_ |
#define KBD_PORT_i8042_H_ |
#include <libarch/ddi.h> |
#include <libarch/types.h> |
struct i8042 { |
ioport8_t data; |
uint8_t pad[3]; |
ioport8_t status; |
} __attribute__ ((packed)); |
typedef struct i8042 i8042_t; |
#endif |
/** |
* @} |
*/ |
//branches/snapshot/uspace/srv/kbd/genarch/gsp.c |
---|
0,0 → 1,289 |
/* |
* Copyright (c) 2009 Jiri Svoboda |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** |
* @addtogroup kbdgen generic |
* @ingroup kbd |
* @{ |
*/ |
/** @file |
* @brief Generic scancode parser. |
* |
* The scancode parser is a simple finite state machine. It is described |
* using sequences of input symbols (scancodes) and the corresponding output |
* value (mods, key pair). When the parser recognizes a sequence, |
* it outputs the value and restarts. If a transition is undefined, |
* the parser restarts, too. |
* |
* Apart from precise values, GSP_DEFAULT allows to catch general cases. |
* I.e. if we knew that after 0x1b 0x4f there always follow two more |
* scancodes, we can define (0x1b, 0x4f, GSP_DEFAULT, GSP_DEFAULT, GSP_END) |
* with null output. This will force the parser to read the entire sequence, |
* not leaving garbage on the input if it does not recognize the specific |
* sequence. |
*/ |
#include <gsp.h> |
#include <adt/hash_table.h> |
#include <stdlib.h> |
#include <stdio.h> |
#define TRANS_TABLE_CHAINS 256 |
/* |
* Hash table operations for the transition function. |
*/ |
static hash_index_t trans_op_hash(unsigned long key[]); |
static int trans_op_compare(unsigned long key[], hash_count_t keys, |
link_t *item); |
static void trans_op_remove_callback(link_t *item); |
static hash_table_operations_t trans_ops = { |
.hash = trans_op_hash, |
.compare = trans_op_compare, |
.remove_callback = trans_op_remove_callback |
}; |
static gsp_trans_t *trans_lookup(gsp_t *p, int state, int input); |
static void trans_insert(gsp_t *p, gsp_trans_t *t); |
static gsp_trans_t *trans_new(void); |
/** Initialise scancode parser. */ |
void gsp_init(gsp_t *p) |
{ |
p->states = 1; |
hash_table_create(&p->trans, TRANS_TABLE_CHAINS, 2, &trans_ops); |
} |
/** Insert a series of definitions into the parser. |
* |
* @param p The parser. |
* @param defs Definition list. Each definition starts with two output values |
* (mods, key) and continues with a sequence of input values |
* terminated with GSP_END. The definition list is terminated |
* with two zeroes (0, 0) for output values. |
*/ |
int gsp_insert_defs(gsp_t *p, const int *defs) |
{ |
unsigned mods, key; |
const int *dp; |
int rc; |
dp = defs; |
while (1) { |
/* Read the output values. */ |
mods = *dp++; |
key = *dp++; |
if (key == 0) break; |
/* Insert one sequence. */ |
rc = gsp_insert_seq(p, dp, mods, key); |
if (rc != 0) |
return rc; |
/* Skip to the next definition. */ |
while (*dp != GSP_END) |
++dp; |
++dp; |
} |
return 0; |
} |
/** Insert one sequence into the parser. |
* |
* @param p The parser. |
* @param seq Sequence of input values terminated with GSP_END. |
* @param mods Corresponsing output value. |
* @param key Corresponsing output value. |
*/ |
int gsp_insert_seq(gsp_t *p, const int *seq, unsigned mods, unsigned key) |
{ |
int state; |
gsp_trans_t *t; |
state = 0; |
t = NULL; |
/* Input sequence must be non-empty. */ |
if (*seq == GSP_END) |
return -1; |
while (*(seq + 1) != GSP_END) { |
t = trans_lookup(p, state, *seq); |
if (t == NULL) { |
/* Create new state. */ |
t = trans_new(); |
t->old_state = state; |
t->input = *seq; |
t->new_state = p->states++; |
t->out_mods = 0; |
t->out_key = 0; |
trans_insert(p, t); |
} |
state = t->new_state; |
++seq; |
} |
/* Process the last transition. */ |
t = trans_lookup(p, state, *seq); |
if (t != NULL) { |
exit(1); |
return -1; /* Conflicting definition. */ |
} |
t = trans_new(); |
t->old_state = state; |
t->input = *seq; |
t->new_state = 0; |
t->out_mods = mods; |
t->out_key = key; |
trans_insert(p, t); |
return 0; |
} |
/** Compute one parser step. |
* |
* Computes the next state and output values for a given state and input. |
* This handles everything including restarts and default branches. |
* |
* @param p The parser. |
* @param state Old state. |
* @param input Input symbol (scancode). |
* @param mods Output value (modifier). |
* @param key Output value (key). |
* @return New state. |
*/ |
int gsp_step(gsp_t *p, int state, int input, unsigned *mods, unsigned *key) |
{ |
gsp_trans_t *t; |
t = trans_lookup(p, state, input); |
if (t == NULL) { |
t = trans_lookup(p, state, GSP_DEFAULT); |
} |
if (t == NULL) { |
printf("gsp_step: not found\n"); |
*mods = NULL; |
*key = NULL; |
return 0; |
} |
*mods = t->out_mods; |
*key = t->out_key; |
return t->new_state; |
} |
/** Transition function lookup. |
* |
* Returns the value of the transition function for the given state |
* and input. Note that the transition must be specified precisely, |
* to obtain the default branch use input = GSP_DEFAULT. |
* |
* @param p Parser. |
* @param state Current state. |
* @param input Input value. |
* @return The transition or @c NULL if not defined. |
*/ |
static gsp_trans_t *trans_lookup(gsp_t *p, int state, int input) |
{ |
link_t *item; |
unsigned long key[2]; |
key[0] = state; |
key[1] = input; |
item = hash_table_find(&p->trans, key); |
if (item == NULL) return NULL; |
return hash_table_get_instance(item, gsp_trans_t, link); |
} |
/** Define a new transition. |
* |
* @param p The parser. |
* @param t Transition with all fields defined. |
*/ |
static void trans_insert(gsp_t *p, gsp_trans_t *t) |
{ |
unsigned long key[2]; |
key[0] = t->old_state; |
key[1] = t->input; |
hash_table_insert(&p->trans, key, &t->link); |
} |
/** Allocate transition structure. */ |
static gsp_trans_t *trans_new(void) |
{ |
gsp_trans_t *t; |
t = malloc(sizeof(gsp_trans_t)); |
if (t == NULL) { |
printf("Memory allocation failed.\n"); |
exit(1); |
} |
return t; |
} |
/* |
* Transition function hash table operations. |
*/ |
static hash_index_t trans_op_hash(unsigned long key[]) |
{ |
return (key[0] * 17 + key[1]) % TRANS_TABLE_CHAINS; |
} |
static int trans_op_compare(unsigned long key[], hash_count_t keys, |
link_t *item) |
{ |
gsp_trans_t *t; |
t = hash_table_get_instance(item, gsp_trans_t, link); |
return ((key[0] == (unsigned long) t->old_state) |
&& (key[1] == (unsigned long) t->input)); |
} |
static void trans_op_remove_callback(link_t *item) |
{ |
} |
/** |
* @} |
*/ |
//branches/snapshot/uspace/srv/kbd/genarch/stroke.c |
---|
0,0 → 1,85 |
/* |
* Copyright (c) 2009 Jiri Svoboda |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup kbd |
* @{ |
*/ |
/** |
* @file |
* @brief Stroke simulator. |
* |
* When simulating a keyboard using a serial TTY we need to convert the |
* recognized strokes (such as Shift-A) to sequences of key presses and |
* releases (such as 'press Shift, press A, release A, release Shift'). |
* |
*/ |
#include <stroke.h> |
#include <kbd.h> |
#include <io/console.h> |
#include <io/keycode.h> |
/** Correspondence between modifers and the modifier keycodes. */ |
static unsigned int mods_keys[][2] = { |
{ KM_LSHIFT, KC_LSHIFT }, |
{ 0, 0 } |
}; |
/** Simulate keystroke using sequences of key presses and releases. */ |
void stroke_sim(unsigned mod, unsigned key) |
{ |
int i; |
/* Simulate modifier presses. */ |
i = 0; |
while (mods_keys[i][0] != 0) { |
if (mod & mods_keys[i][0]) { |
kbd_push_ev(KEY_PRESS, mods_keys[i][1]); |
} |
++i; |
} |
/* Simulate key press and release. */ |
if (key != 0) { |
kbd_push_ev(KEY_PRESS, key); |
kbd_push_ev(KEY_RELEASE, key); |
} |
/* Simulate modifier releases. */ |
i = 0; |
while (mods_keys[i][0] != 0) { |
if (mod & mods_keys[i][0]) { |
kbd_push_ev(KEY_RELEASE, mods_keys[i][1]); |
} |
++i; |
} |
} |
/** |
* @} |
*/ |
//branches/snapshot/uspace/srv/kbd/layout/cz.c |
---|
0,0 → 1,408 |
/* |
* Copyright (c) 2009 Jiri Svoboda |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup kbd |
* @brief US QWERTY leyout. |
* @{ |
*/ |
#include <kbd.h> |
#include <io/console.h> |
#include <io/keycode.h> |
#include <bool.h> |
#include <layout.h> |
static void layout_reset(void); |
static wchar_t layout_parse_ev(console_event_t *ev); |
enum m_state { |
ms_start, |
ms_hacek, |
ms_carka |
}; |
static enum m_state mstate; |
layout_op_t cz_op = { |
layout_reset, |
layout_parse_ev |
}; |
static wchar_t map_lcase[] = { |
[KC_Q] = 'q', |
[KC_W] = 'w', |
[KC_E] = 'e', |
[KC_R] = 'r', |
[KC_T] = 't', |
[KC_Y] = 'z', |
[KC_U] = 'u', |
[KC_I] = 'i', |
[KC_O] = 'o', |
[KC_P] = 'p', |
[KC_A] = 'a', |
[KC_S] = 's', |
[KC_D] = 'd', |
[KC_F] = 'f', |
[KC_G] = 'g', |
[KC_H] = 'h', |
[KC_J] = 'j', |
[KC_K] = 'k', |
[KC_L] = 'l', |
[KC_Z] = 'y', |
[KC_X] = 'x', |
[KC_C] = 'c', |
[KC_V] = 'v', |
[KC_B] = 'b', |
[KC_N] = 'n', |
[KC_M] = 'm', |
}; |
static wchar_t map_ucase[] = { |
[KC_Q] = 'Q', |
[KC_W] = 'W', |
[KC_E] = 'E', |
[KC_R] = 'R', |
[KC_T] = 'T', |
[KC_Y] = 'Z', |
[KC_U] = 'U', |
[KC_I] = 'I', |
[KC_O] = 'O', |
[KC_P] = 'P', |
[KC_A] = 'A', |
[KC_S] = 'S', |
[KC_D] = 'D', |
[KC_F] = 'F', |
[KC_G] = 'G', |
[KC_H] = 'H', |
[KC_J] = 'J', |
[KC_K] = 'K', |
[KC_L] = 'L', |
[KC_Z] = 'Y', |
[KC_X] = 'X', |
[KC_C] = 'C', |
[KC_V] = 'V', |
[KC_B] = 'B', |
[KC_N] = 'N', |
[KC_M] = 'M', |
}; |
static wchar_t map_not_shifted[] = { |
[KC_BACKTICK] = ';', |
[KC_1] = '+', |
[KC_MINUS] = '=', |
[KC_RBRACKET] = ')', |
[KC_QUOTE] = L'§', |
[KC_COMMA] = ',', |
[KC_PERIOD] = '.', |
[KC_SLASH] = '-', |
}; |
static wchar_t map_shifted[] = { |
[KC_1] = '1', |
[KC_2] = '2', |
[KC_3] = '3', |
[KC_4] = '4', |
[KC_5] = '5', |
[KC_6] = '6', |
[KC_7] = '7', |
[KC_8] = '8', |
[KC_9] = '9', |
[KC_0] = '0', |
[KC_MINUS] = '%', |
[KC_LBRACKET] = '/', |
[KC_RBRACKET] = '(', |
[KC_SEMICOLON] = '"', |
[KC_QUOTE] = '!', |
[KC_BACKSLASH] = '\'', |
[KC_COMMA] = '?', |
[KC_PERIOD] = ':', |
[KC_SLASH] = '_', |
}; |
static wchar_t map_ns_nocaps[] = { |
[KC_2] = L'ě', |
[KC_3] = L'š', |
[KC_4] = L'č', |
[KC_5] = L'ř', |
[KC_6] = L'ž', |
[KC_7] = L'ý', |
[KC_8] = L'á', |
[KC_9] = L'í', |
[KC_0] = L'é', |
[KC_LBRACKET] = L'ú', |
[KC_SEMICOLON] = L'ů' |
}; |
static wchar_t map_ns_caps[] = { |
[KC_2] = L'Ě', |
[KC_3] = L'Š', |
[KC_4] = L'Č', |
[KC_5] = L'Ř', |
[KC_6] = L'Ž', |
[KC_7] = L'Ý', |
[KC_8] = L'Á', |
[KC_9] = L'Í', |
[KC_0] = L'É', |
[KC_LBRACKET] = L'Ú', |
[KC_SEMICOLON] = L'Ů' |
}; |
static wchar_t map_neutral[] = { |
[KC_BACKSPACE] = '\b', |
[KC_TAB] = '\t', |
[KC_ENTER] = '\n', |
[KC_SPACE] = ' ', |
[KC_NSLASH] = '/', |
[KC_NTIMES] = '*', |
[KC_NMINUS] = '-', |
[KC_NPLUS] = '+', |
[KC_NENTER] = '\n' |
}; |
static wchar_t map_numeric[] = { |
[KC_N7] = '7', |
[KC_N8] = '8', |
[KC_N9] = '9', |
[KC_N4] = '4', |
[KC_N5] = '5', |
[KC_N6] = '6', |
[KC_N1] = '1', |
[KC_N2] = '2', |
[KC_N3] = '3', |
[KC_N0] = '0', |
[KC_NPERIOD] = '.' |
}; |
static wchar_t map_hacek_lcase[] = { |
[KC_E] = L'ě', |
[KC_R] = L'ř', |
[KC_T] = L'ť', |
[KC_Y] = L'ž', |
[KC_U] = L'ů', |
[KC_S] = L'š', |
[KC_D] = L'ď', |
[KC_C] = L'č', |
[KC_N] = L'ň' |
}; |
static wchar_t map_hacek_ucase[] = { |
[KC_E] = L'Ě', |
[KC_R] = L'Ř', |
[KC_T] = L'Ť', |
[KC_Y] = L'Ž', |
[KC_U] = L'Ů', |
[KC_S] = L'Š', |
[KC_D] = L'Ď', |
[KC_C] = L'Č', |
[KC_N] = L'Ň' |
}; |
static wchar_t map_carka_lcase[] = { |
[KC_E] = L'é', |
[KC_U] = L'ú', |
[KC_I] = L'í', |
[KC_O] = L'ó', |
[KC_A] = L'á', |
[KC_Z] = L'ý', |
}; |
static wchar_t map_carka_ucase[] = { |
[KC_E] = L'É', |
[KC_U] = L'Ú', |
[KC_I] = L'Í', |
[KC_O] = L'Ó', |
[KC_A] = L'Á', |
[KC_Z] = L'Ý', |
}; |
static wchar_t translate(unsigned int key, wchar_t *map, size_t map_length) |
{ |
if (key >= map_length) |
return 0; |
return map[key]; |
} |
static wchar_t parse_ms_hacek(console_event_t *ev) |
{ |
wchar_t c; |
mstate = ms_start; |
/* Produce no characters when Ctrl or Alt is pressed. */ |
if ((ev->mods & (KM_CTRL | KM_ALT)) != 0) |
return 0; |
if (((ev->mods & KM_SHIFT) != 0) ^ ((ev->mods & KM_CAPS_LOCK) != 0)) |
c = translate(ev->key, map_hacek_ucase, sizeof(map_hacek_ucase) / sizeof(wchar_t)); |
else |
c = translate(ev->key, map_hacek_lcase, sizeof(map_hacek_lcase) / sizeof(wchar_t)); |
return c; |
} |
static wchar_t parse_ms_carka(console_event_t *ev) |
{ |
wchar_t c; |
mstate = ms_start; |
/* Produce no characters when Ctrl or Alt is pressed. */ |
if ((ev->mods & (KM_CTRL | KM_ALT)) != 0) |
return 0; |
if (((ev->mods & KM_SHIFT) != 0) ^ ((ev->mods & KM_CAPS_LOCK) != 0)) |
c = translate(ev->key, map_carka_ucase, sizeof(map_carka_ucase) / sizeof(wchar_t)); |
else |
c = translate(ev->key, map_carka_lcase, sizeof(map_carka_lcase) / sizeof(wchar_t)); |
return c; |
} |
static wchar_t parse_ms_start(console_event_t *ev) |
{ |
wchar_t c; |
/* Produce no characters when Ctrl or Alt is pressed. */ |
if ((ev->mods & (KM_CTRL | KM_ALT)) != 0) |
return 0; |
if (ev->key == KC_EQUALS) { |
if ((ev->mods & KM_SHIFT) != 0) |
mstate = ms_hacek; |
else |
mstate = ms_carka; |
return 0; |
} |
c = translate(ev->key, map_neutral, sizeof(map_neutral) / sizeof(wchar_t)); |
if (c != 0) |
return c; |
if ((ev->mods & KM_SHIFT) == 0) { |
if ((ev->mods & KM_CAPS_LOCK) != 0) |
c = translate(ev->key, map_ns_caps, sizeof(map_ns_caps) / sizeof(wchar_t)); |
else |
c = translate(ev->key, map_ns_nocaps, sizeof(map_ns_nocaps) / sizeof(wchar_t)); |
if (c != 0) |
return c; |
} |
if (((ev->mods & KM_SHIFT) != 0) ^ ((ev->mods & KM_CAPS_LOCK) != 0)) |
c = translate(ev->key, map_ucase, sizeof(map_ucase) / sizeof(wchar_t)); |
else |
c = translate(ev->key, map_lcase, sizeof(map_lcase) / sizeof(wchar_t)); |
if (c != 0) |
return c; |
if ((ev->mods & KM_SHIFT) != 0) |
c = translate(ev->key, map_shifted, sizeof(map_shifted) / sizeof(wchar_t)); |
else |
c = translate(ev->key, map_not_shifted, sizeof(map_not_shifted) / sizeof(wchar_t)); |
if (c != 0) |
return c; |
if ((ev->mods & KM_NUM_LOCK) != 0) |
c = translate(ev->key, map_numeric, sizeof(map_numeric) / sizeof(wchar_t)); |
else |
c = 0; |
return c; |
} |
static bool key_is_mod(unsigned key) |
{ |
switch (key) { |
case KC_LSHIFT: |
case KC_RSHIFT: |
case KC_LALT: |
case KC_RALT: |
case KC_LCTRL: |
case KC_RCTRL: |
return true; |
default: |
return false; |
} |
} |
static void layout_reset(void) |
{ |
mstate = ms_start; |
} |
static wchar_t layout_parse_ev(console_event_t *ev) |
{ |
if (ev->type != KEY_PRESS) |
return 0; |
if (key_is_mod(ev->key)) |
return 0; |
switch (mstate) { |
case ms_start: |
return parse_ms_start(ev); |
case ms_hacek: |
return parse_ms_hacek(ev); |
case ms_carka: |
return parse_ms_carka(ev); |
} |
return 0; |
} |
/** |
* @} |
*/ |
//branches/snapshot/uspace/srv/kbd/layout/us_qwerty.c |
---|
0,0 → 1,244 |
/* |
* Copyright (c) 2009 Jiri Svoboda |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup kbd |
* @brief US QWERTY leyout. |
* @{ |
*/ |
#include <kbd.h> |
#include <io/console.h> |
#include <io/keycode.h> |
#include <layout.h> |
static void layout_reset(void); |
static wchar_t layout_parse_ev(console_event_t *ev); |
layout_op_t us_qwerty_op = { |
layout_reset, |
layout_parse_ev |
}; |
static wchar_t map_lcase[] = { |
[KC_Q] = 'q', |
[KC_W] = 'w', |
[KC_E] = 'e', |
[KC_R] = 'r', |
[KC_T] = 't', |
[KC_Y] = 'y', |
[KC_U] = 'u', |
[KC_I] = 'i', |
[KC_O] = 'o', |
[KC_P] = 'p', |
[KC_A] = 'a', |
[KC_S] = 's', |
[KC_D] = 'd', |
[KC_F] = 'f', |
[KC_G] = 'g', |
[KC_H] = 'h', |
[KC_J] = 'j', |
[KC_K] = 'k', |
[KC_L] = 'l', |
[KC_Z] = 'z', |
[KC_X] = 'x', |
[KC_C] = 'c', |
[KC_V] = 'v', |
[KC_B] = 'b', |
[KC_N] = 'n', |
[KC_M] = 'm', |
}; |
static wchar_t map_ucase[] = { |
[KC_Q] = 'Q', |
[KC_W] = 'W', |
[KC_E] = 'E', |
[KC_R] = 'R', |
[KC_T] = 'T', |
[KC_Y] = 'Y', |
[KC_U] = 'U', |
[KC_I] = 'I', |
[KC_O] = 'O', |
[KC_P] = 'P', |
[KC_A] = 'A', |
[KC_S] = 'S', |
[KC_D] = 'D', |
[KC_F] = 'F', |
[KC_G] = 'G', |
[KC_H] = 'H', |
[KC_J] = 'J', |
[KC_K] = 'K', |
[KC_L] = 'L', |
[KC_Z] = 'Z', |
[KC_X] = 'X', |
[KC_C] = 'C', |
[KC_V] = 'V', |
[KC_B] = 'B', |
[KC_N] = 'N', |
[KC_M] = 'M', |
}; |
static wchar_t map_not_shifted[] = { |
[KC_BACKTICK] = '`', |
[KC_1] = '1', |
[KC_2] = '2', |
[KC_3] = '3', |
[KC_4] = '4', |
[KC_5] = '5', |
[KC_6] = '6', |
[KC_7] = '7', |
[KC_8] = '8', |
[KC_9] = '9', |
[KC_0] = '0', |
[KC_MINUS] = '-', |
[KC_EQUALS] = '=', |
[KC_LBRACKET] = '[', |
[KC_RBRACKET] = ']', |
[KC_SEMICOLON] = ';', |
[KC_QUOTE] = '\'', |
[KC_BACKSLASH] = '\\', |
[KC_COMMA] = ',', |
[KC_PERIOD] = '.', |
[KC_SLASH] = '/', |
}; |
static wchar_t map_shifted[] = { |
[KC_BACKTICK] = '~', |
[KC_1] = '!', |
[KC_2] = '@', |
[KC_3] = '#', |
[KC_4] = '$', |
[KC_5] = '%', |
[KC_6] = '^', |
[KC_7] = '&', |
[KC_8] = '*', |
[KC_9] = '(', |
[KC_0] = ')', |
[KC_MINUS] = '_', |
[KC_EQUALS] = '+', |
[KC_LBRACKET] = '{', |
[KC_RBRACKET] = '}', |
[KC_SEMICOLON] = ':', |
[KC_QUOTE] = '"', |
[KC_BACKSLASH] = '|', |
[KC_COMMA] = '<', |
[KC_PERIOD] = '>', |
[KC_SLASH] = '?', |
}; |
static wchar_t map_neutral[] = { |
[KC_BACKSPACE] = '\b', |
[KC_TAB] = '\t', |
[KC_ENTER] = '\n', |
[KC_SPACE] = ' ', |
[KC_NSLASH] = '/', |
[KC_NTIMES] = '*', |
[KC_NMINUS] = '-', |
[KC_NPLUS] = '+', |
[KC_NENTER] = '\n' |
}; |
static wchar_t map_numeric[] = { |
[KC_N7] = '7', |
[KC_N8] = '8', |
[KC_N9] = '9', |
[KC_N4] = '4', |
[KC_N5] = '5', |
[KC_N6] = '6', |
[KC_N1] = '1', |
[KC_N2] = '2', |
[KC_N3] = '3', |
[KC_N0] = '0', |
[KC_NPERIOD] = '.' |
}; |
static wchar_t translate(unsigned int key, wchar_t *map, size_t map_length) |
{ |
if (key >= map_length) |
return 0; |
return map[key]; |
} |
static void layout_reset(void) |
{ |
} |
static wchar_t layout_parse_ev(console_event_t *ev) |
{ |
wchar_t c; |
/* Produce no characters when Ctrl or Alt is pressed. */ |
if ((ev->mods & (KM_CTRL | KM_ALT)) != 0) |
return 0; |
c = translate(ev->key, map_neutral, sizeof(map_neutral) / sizeof(wchar_t)); |
if (c != 0) |
return c; |
if (((ev->mods & KM_SHIFT) != 0) ^ ((ev->mods & KM_CAPS_LOCK) != 0)) |
c = translate(ev->key, map_ucase, sizeof(map_ucase) / sizeof(wchar_t)); |
else |
c = translate(ev->key, map_lcase, sizeof(map_lcase) / sizeof(wchar_t)); |
if (c != 0) |
return c; |
if ((ev->mods & KM_SHIFT) != 0) |
c = translate(ev->key, map_shifted, sizeof(map_shifted) / sizeof(wchar_t)); |
else |
c = translate(ev->key, map_not_shifted, sizeof(map_not_shifted) / sizeof(wchar_t)); |
if (c != 0) |
return c; |
if ((ev->mods & KM_NUM_LOCK) != 0) |
c = translate(ev->key, map_numeric, sizeof(map_numeric) / sizeof(wchar_t)); |
else |
c = 0; |
return c; |
} |
/** |
* @} |
*/ |
//branches/snapshot/uspace/srv/kbd/layout/us_dvorak.c |
---|
0,0 → 1,250 |
/* |
* Copyright (c) 2009 Jiri Svoboda |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup kbd |
* @brief US Dvorak Simplified Keyboard layout. |
* @{ |
*/ |
#include <kbd.h> |
#include <io/console.h> |
#include <io/keycode.h> |
#include <layout.h> |
static void layout_reset(void); |
static wchar_t layout_parse_ev(console_event_t *ev); |
layout_op_t us_dvorak_op = { |
layout_reset, |
layout_parse_ev |
}; |
static wchar_t map_lcase[] = { |
[KC_R] = 'p', |
[KC_T] = 'y', |
[KC_Y] = 'f', |
[KC_U] = 'g', |
[KC_I] = 'c', |
[KC_O] = 'r', |
[KC_P] = 'l', |
[KC_A] = 'a', |
[KC_S] = 'o', |
[KC_D] = 'e', |
[KC_F] = 'u', |
[KC_G] = 'i', |
[KC_H] = 'd', |
[KC_J] = 'h', |
[KC_K] = 't', |
[KC_L] = 'n', |
[KC_SEMICOLON] = 's', |
[KC_X] = 'q', |
[KC_C] = 'j', |
[KC_V] = 'k', |
[KC_B] = 'x', |
[KC_N] = 'b', |
[KC_M] = 'm', |
[KC_COMMA] = 'w', |
[KC_PERIOD] = 'v', |
[KC_SLASH] = 'z', |
}; |
static wchar_t map_ucase[] = { |
[KC_R] = 'P', |
[KC_T] = 'Y', |
[KC_Y] = 'F', |
[KC_U] = 'G', |
[KC_I] = 'C', |
[KC_O] = 'R', |
[KC_P] = 'L', |
[KC_A] = 'A', |
[KC_S] = 'O', |
[KC_D] = 'E', |
[KC_F] = 'U', |
[KC_G] = 'I', |
[KC_H] = 'D', |
[KC_J] = 'H', |
[KC_K] = 'T', |
[KC_L] = 'N', |
[KC_SEMICOLON] = 'S', |
[KC_X] = 'Q', |
[KC_C] = 'J', |
[KC_V] = 'K', |
[KC_B] = 'X', |
[KC_N] = 'B', |
[KC_M] = 'M', |
[KC_COMMA] = 'W', |
[KC_PERIOD] = 'V', |
[KC_SLASH] = 'Z', |
}; |
static wchar_t map_not_shifted[] = { |
[KC_BACKTICK] = '`', |
[KC_1] = '1', |
[KC_2] = '2', |
[KC_3] = '3', |
[KC_4] = '4', |
[KC_5] = '5', |
[KC_6] = '6', |
[KC_7] = '7', |
[KC_8] = '8', |
[KC_9] = '9', |
[KC_0] = '0', |
[KC_MINUS] = '[', |
[KC_EQUALS] = ']', |
[KC_Q] = '\'', |
[KC_W] = ',', |
[KC_E] = '.', |
[KC_LBRACKET] = '/', |
[KC_RBRACKET] = '=', |
[KC_QUOTE] = '-', |
[KC_BACKSLASH] = '\\', |
[KC_Z] = ';', |
}; |
static wchar_t map_shifted[] = { |
[KC_BACKTICK] = '~', |
[KC_1] = '!', |
[KC_2] = '@', |
[KC_3] = '#', |
[KC_4] = '$', |
[KC_5] = '%', |
[KC_6] = '^', |
[KC_7] = '&', |
[KC_8] = '*', |
[KC_9] = '(', |
[KC_0] = ')', |
[KC_MINUS] = '{', |
[KC_EQUALS] = '}', |
[KC_Q] = '"', |
[KC_W] = '<', |
[KC_E] = '>', |
[KC_LBRACKET] = '?', |
[KC_RBRACKET] = '+', |
[KC_QUOTE] = '_', |
[KC_BACKSLASH] = '|', |
[KC_Z] = ':', |
}; |
static wchar_t map_neutral[] = { |
[KC_BACKSPACE] = '\b', |
[KC_TAB] = '\t', |
[KC_ENTER] = '\n', |
[KC_SPACE] = ' ', |
[KC_NSLASH] = '/', |
[KC_NTIMES] = '*', |
[KC_NMINUS] = '-', |
[KC_NPLUS] = '+', |
[KC_NENTER] = '\n' |
}; |
static wchar_t map_numeric[] = { |
[KC_N7] = '7', |
[KC_N8] = '8', |
[KC_N9] = '9', |
[KC_N4] = '4', |
[KC_N5] = '5', |
[KC_N6] = '6', |
[KC_N1] = '1', |
[KC_N2] = '2', |
[KC_N3] = '3', |
[KC_N0] = '0', |
[KC_NPERIOD] = '.' |
}; |
static wchar_t translate(unsigned int key, wchar_t *map, size_t map_length) |
{ |
if (key >= map_length) |
return 0; |
return map[key]; |
} |
static void layout_reset(void) |
{ |
} |
static wchar_t layout_parse_ev(console_event_t *ev) |
{ |
wchar_t c; |
/* Produce no characters when Ctrl or Alt is pressed. */ |
if ((ev->mods & (KM_CTRL | KM_ALT)) != 0) |
return 0; |
c = translate(ev->key, map_neutral, sizeof(map_neutral) / sizeof(wchar_t)); |
if (c != 0) |
return c; |
if (((ev->mods & KM_SHIFT) != 0) ^ ((ev->mods & KM_CAPS_LOCK) != 0)) |
c = translate(ev->key, map_ucase, sizeof(map_ucase) / sizeof(wchar_t)); |
else |
c = translate(ev->key, map_lcase, sizeof(map_lcase) / sizeof(wchar_t)); |
if (c != 0) |
return c; |
if ((ev->mods & KM_SHIFT) != 0) |
c = translate(ev->key, map_shifted, sizeof(map_shifted) / sizeof(wchar_t)); |
else |
c = translate(ev->key, map_not_shifted, sizeof(map_not_shifted) / sizeof(wchar_t)); |
if (c != 0) |
return c; |
if ((ev->mods & KM_NUM_LOCK) != 0) |
c = translate(ev->key, map_numeric, sizeof(map_numeric) / sizeof(wchar_t)); |
else |
c = 0; |
return c; |
} |
/** |
* @} |
*/ |
//branches/snapshot/uspace/srv/kbd/include/gsp.h |
---|
0,0 → 1,84 |
/* |
* Copyright (c) 2009 Jiri Svoboda |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup kbdgen generic |
* @brief Generic scancode parser. |
* @ingroup kbd |
* @{ |
*/ |
/** @file |
*/ |
#ifndef KBD_GSP_H_ |
#define KBD_GSP_H_ |
#include <adt/hash_table.h> |
enum { |
GSP_END = -1, /**< Terminates a sequence. */ |
GSP_DEFAULT = -2 /**< Wildcard, catches unhandled cases. */ |
}; |
/** Scancode parser description */ |
typedef struct { |
/** Transition table, (state, input) -> (state, output) */ |
hash_table_t trans; |
/** Number of states */ |
int states; |
} gsp_t; |
/** Scancode parser transition. */ |
typedef struct { |
link_t link; /**< Link to hash table in @c gsp_t */ |
/* Preconditions */ |
int old_state; /**< State before transition */ |
int input; /**< Input symbol (scancode) */ |
/* Effects */ |
int new_state; /**< State after transition */ |
/* Output emitted during transition */ |
unsigned out_mods; /**< Modifier to emit */ |
unsigned out_key; /**< Keycode to emit */ |
} gsp_trans_t; |
extern void gsp_init(gsp_t *); |
extern int gsp_insert_defs(gsp_t *, const int *); |
extern int gsp_insert_seq(gsp_t *, const int *, unsigned, unsigned); |
extern int gsp_step(gsp_t *, int, int, unsigned *, unsigned *); |
#endif |
/** |
* @} |
*/ |
//branches/snapshot/uspace/srv/kbd/include/layout.h |
---|
0,0 → 1,56 |
/* |
* Copyright (c) 2009 Jiri Svoboda |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup kbdgen generic |
* @brief HelenOS generic uspace keyboard handler. |
* @ingroup kbd |
* @{ |
*/ |
/** @file |
*/ |
#ifndef KBD_LAYOUT_H_ |
#define KBD_LAYOUT_H_ |
#include <sys/types.h> |
#include <io/console.h> |
typedef struct { |
void (*reset)(void); |
wchar_t (*parse_ev)(console_event_t *); |
} layout_op_t; |
extern layout_op_t us_qwerty_op; |
extern layout_op_t us_dvorak_op; |
extern layout_op_t cz_op; |
#endif |
/** |
* @} |
*/ |
//branches/snapshot/uspace/srv/kbd/include/kbd.h |
---|
0,0 → 1,64 |
/* |
* Copyright (c) 2006 Josef Cejka |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup kbdgen generic |
* @brief HelenOS generic uspace keyboard handler. |
* @ingroup kbd |
* @{ |
*/ |
/** @file |
*/ |
#ifndef KBD_KBD_H_ |
#define KBD_KBD_H_ |
#include <keybuffer.h> |
#include <ipc/ipc.h> |
#define KBD_EVENT 1024 |
#define KBD_MS_LEFT 1025 |
#define KBD_MS_RIGHT 1026 |
#define KBD_MS_MIDDLE 1027 |
#define KBD_MS_MOVE 1028 |
typedef enum { |
KBD_YIELD = IPC_FIRST_USER_METHOD, |
KBD_RECLAIM |
} kbd_request_t; |
extern int cir_service; |
extern int cir_phone; |
extern void kbd_push_scancode(int); |
extern void kbd_push_ev(int, unsigned int); |
#endif |
/** |
* @} |
*/ |
//branches/snapshot/uspace/srv/kbd/include/keybuffer.h |
---|
0,0 → 1,65 |
/* |
* Copyright (c) 2006 Josef Cejka |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup kbdgen |
* @brief HelenOS generic uspace keyboard handler. |
* @ingroup kbd |
* @{ |
*/ |
/** @file |
*/ |
#ifndef __KEYBUFFER_H__ |
#define __KEYBUFFER_H__ |
#include <sys/types.h> |
#include <io/console.h> |
#include <bool.h> |
/** Size of buffer for pressed keys */ |
#define KEYBUFFER_SIZE 128 |
typedef struct { |
console_event_t fifo[KEYBUFFER_SIZE]; |
unsigned long head; |
unsigned long tail; |
unsigned long items; |
} keybuffer_t; |
extern void keybuffer_free(keybuffer_t *); |
extern void keybuffer_init(keybuffer_t *); |
extern size_t keybuffer_available(keybuffer_t *); |
extern bool keybuffer_empty(keybuffer_t *); |
extern void keybuffer_push(keybuffer_t *, const console_event_t *); |
extern bool keybuffer_pop(keybuffer_t *, console_event_t *); |
#endif |
/** |
* @} |
*/ |
//branches/snapshot/uspace/srv/kbd/include/kbd_port.h |
---|
0,0 → 1,49 |
/* |
* Copyright (c) 2009 Jiri Svoboda |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup kbdgen generic |
* @brief HelenOS generic uspace keyboard handler. |
* @ingroup kbd |
* @{ |
*/ |
/** @file |
*/ |
#ifndef KBD_PORT_H_ |
#define KBD_PORT_H_ |
extern int kbd_port_init(void); |
extern void kbd_port_yield(void); |
extern void kbd_port_reclaim(void); |
#endif |
/** |
* @} |
*/ |
//branches/snapshot/uspace/srv/kbd/include/sun.h |
---|
0,0 → 1,47 |
/* |
* Copyright (c) 2009 Martin Decky |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup kbdgen generic |
* @brief Sun keyboard virtual port driver. |
* @ingroup kbd |
* @{ |
*/ |
/** @file |
*/ |
#ifndef KBD_SUN_H_ |
#define KBD_SUN_H_ |
extern int ns16550_port_init(void); |
extern int z8530_port_init(void); |
#endif |
/** |
* @} |
*/ |
//branches/snapshot/uspace/srv/kbd/include/kbd_ctl.h |
---|
0,0 → 1,49 |
/* |
* Copyright (c) 2009 Jiri Svoboda |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup kbdgen generic |
* @brief HelenOS generic uspace keyboard handler. |
* @ingroup kbd |
* @{ |
*/ |
/** @file |
*/ |
#ifndef KBD_CTL_H_ |
#define KBD_CTL_H_ |
extern void kbd_ctl_parse_scancode(int); |
extern int kbd_ctl_init(void); |
#endif |
/** |
* @} |
*/ |
//branches/snapshot/uspace/srv/kbd/include/stroke.h |
---|
0,0 → 1,47 |
/* |
* Copyright (c) 2009 Jiri Svoboda |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup kbdgen generic |
* @brief Generic scancode parser. |
* @ingroup kbd |
* @{ |
*/ |
/** @file |
*/ |
#ifndef KBD_STROKE_H_ |
#define KBD_STROKE_H_ |
extern void stroke_sim(unsigned, unsigned); |
#endif |
/** |
* @} |
*/ |
//branches/snapshot/uspace/srv/kbd/generic/kbd.c |
---|
0,0 → 1,259 |
/* |
* Copyright (c) 2006 Josef Cejka |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** |
* @addtogroup kbdgen generic |
* @brief HelenOS generic uspace keyboard handler. |
* @ingroup kbd |
* @{ |
*/ |
/** @file |
*/ |
#include <ipc/ipc.h> |
#include <ipc/services.h> |
#include <sysinfo.h> |
#include <stdio.h> |
#include <unistd.h> |
#include <stdlib.h> |
#include <stdio.h> |
#include <ipc/ns.h> |
#include <async.h> |
#include <errno.h> |
#include <adt/fifo.h> |
#include <io/console.h> |
#include <io/keycode.h> |
#include <kbd.h> |
#include <keybuffer.h> |
#include <kbd_port.h> |
#include <kbd_ctl.h> |
#include <layout.h> |
#define NAME "kbd" |
int cons_connected = 0; |
int phone2cons = -1; |
keybuffer_t keybuffer; |
/** Currently active modifiers. */ |
static unsigned mods = KM_NUM_LOCK; |
/** Currently pressed lock keys. We track these to tackle autorepeat. */ |
static unsigned lock_keys; |
int cir_service = 0; |
int cir_phone = -1; |
#define NUM_LAYOUTS 3 |
static layout_op_t *layout[NUM_LAYOUTS] = { |
&us_qwerty_op, |
&us_dvorak_op, |
&cz_op |
}; |
static int active_layout = 0; |
void kbd_push_scancode(int scancode) |
{ |
/* printf("scancode: 0x%x\n", scancode);*/ |
kbd_ctl_parse_scancode(scancode); |
} |
void kbd_push_ev(int type, unsigned int key) |
{ |
console_event_t ev; |
unsigned mod_mask; |
switch (key) { |
case KC_LCTRL: mod_mask = KM_LCTRL; break; |
case KC_RCTRL: mod_mask = KM_RCTRL; break; |
case KC_LSHIFT: mod_mask = KM_LSHIFT; break; |
case KC_RSHIFT: mod_mask = KM_RSHIFT; break; |
case KC_LALT: mod_mask = KM_LALT; break; |
case KC_RALT: mod_mask = KM_RALT; break; |
default: mod_mask = 0; break; |
} |
if (mod_mask != 0) { |
if (type == KEY_PRESS) |
mods = mods | mod_mask; |
else |
mods = mods & ~mod_mask; |
} |
switch (key) { |
case KC_CAPS_LOCK: mod_mask = KM_CAPS_LOCK; break; |
case KC_NUM_LOCK: mod_mask = KM_NUM_LOCK; break; |
case KC_SCROLL_LOCK: mod_mask = KM_SCROLL_LOCK; break; |
default: mod_mask = 0; break; |
} |
if (mod_mask != 0) { |
if (type == KEY_PRESS) { |
/* |
* Only change lock state on transition from released |
* to pressed. This prevents autorepeat from messing |
* up the lock state. |
*/ |
mods = mods ^ (mod_mask & ~lock_keys); |
lock_keys = lock_keys | mod_mask; |
} else { |
lock_keys = lock_keys & ~mod_mask; |
} |
} |
/* |
printf("type: %d\n", type); |
printf("mods: 0x%x\n", mods); |
printf("keycode: %u\n", key); |
*/ |
if (type == KEY_PRESS && (mods & KM_LCTRL) && |
key == KC_F1) { |
active_layout = 0; |
layout[active_layout]->reset(); |
return; |
} |
if (type == KEY_PRESS && (mods & KM_LCTRL) && |
key == KC_F2) { |
active_layout = 1; |
layout[active_layout]->reset(); |
return; |
} |
if (type == KEY_PRESS && (mods & KM_LCTRL) && |
key == KC_F3) { |
active_layout = 2; |
layout[active_layout]->reset(); |
return; |
} |
ev.type = type; |
ev.key = key; |
ev.mods = mods; |
ev.c = layout[active_layout]->parse_ev(&ev); |
async_msg_4(phone2cons, KBD_EVENT, ev.type, ev.key, ev.mods, ev.c); |
} |
static void console_connection(ipc_callid_t iid, ipc_call_t *icall) |
{ |
ipc_callid_t callid; |
ipc_call_t call; |
int retval; |
if (cons_connected) { |
ipc_answer_0(iid, ELIMIT); |
return; |
} |
cons_connected = 1; |
ipc_answer_0(iid, EOK); |
while (1) { |
callid = async_get_call(&call); |
switch (IPC_GET_METHOD(call)) { |
case IPC_M_PHONE_HUNGUP: |
cons_connected = 0; |
ipc_hangup(phone2cons); |
phone2cons = -1; |
ipc_answer_0(callid, EOK); |
return; |
case IPC_M_CONNECT_TO_ME: |
if (phone2cons != -1) { |
retval = ELIMIT; |
break; |
} |
phone2cons = IPC_GET_ARG5(call); |
retval = 0; |
break; |
case KBD_YIELD: |
kbd_port_yield(); |
retval = 0; |
break; |
case KBD_RECLAIM: |
kbd_port_reclaim(); |
retval = 0; |
break; |
default: |
retval = EINVAL; |
} |
ipc_answer_0(callid, retval); |
} |
} |
int main(int argc, char **argv) |
{ |
printf(NAME ": HelenOS Keyboard service\n"); |
ipcarg_t phonead; |
if (sysinfo_value("kbd.cir.fhc") == 1) |
cir_service = SERVICE_FHC; |
else if (sysinfo_value("kbd.cir.obio") == 1) |
cir_service = SERVICE_OBIO; |
if (cir_service) { |
while (cir_phone < 0) { |
cir_phone = ipc_connect_me_to_blocking(PHONE_NS, cir_service, |
0, 0); |
} |
} |
/* Initialize port driver. */ |
if (kbd_port_init() != 0) |
return -1; |
/* Initialize controller driver. */ |
if (kbd_ctl_init() != 0) |
return -1; |
/* Initialize (reset) layout. */ |
layout[active_layout]->reset(); |
/* Initialize key buffer */ |
keybuffer_init(&keybuffer); |
async_set_client_connection(console_connection); |
/* Register service at nameserver. */ |
if (ipc_connect_to_me(PHONE_NS, SERVICE_KEYBOARD, 0, 0, &phonead) != 0) |
return -1; |
printf(NAME ": Accepting connections\n"); |
async_manager(); |
/* Not reached. */ |
return 0; |
} |
/** |
* @} |
*/ |
//branches/snapshot/uspace/srv/kbd/generic/keybuffer.c |
---|
0,0 → 1,132 |
/* |
* Copyright (c) 2006 Josef Cejka |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup kbdgen |
* @brief HelenOS generic uspace keyboard handler. |
* @ingroup kbd |
* @{ |
*/ |
/** @file |
*/ |
#include <keybuffer.h> |
#include <futex.h> |
atomic_t keybuffer_futex = FUTEX_INITIALIZER; |
/** Clear key buffer. |
*/ |
void keybuffer_free(keybuffer_t *keybuffer) |
{ |
futex_down(&keybuffer_futex); |
keybuffer->head = 0; |
keybuffer->tail = 0; |
keybuffer->items = 0; |
futex_up(&keybuffer_futex); |
} |
/** Key buffer initialization. |
* |
*/ |
void keybuffer_init(keybuffer_t *keybuffer) |
{ |
keybuffer_free(keybuffer); |
} |
/** Get free space in buffer. |
* |
* This function is useful for processing some scancodes that are translated |
* to more than one character. |
* |
* @return empty buffer space |
* |
*/ |
size_t keybuffer_available(keybuffer_t *keybuffer) |
{ |
return KEYBUFFER_SIZE - keybuffer->items; |
} |
/** |
* |
* @return nonzero, if buffer is not empty. |
* |
*/ |
bool keybuffer_empty(keybuffer_t *keybuffer) |
{ |
return (keybuffer->items == 0); |
} |
/** Push key event to key buffer. |
* |
* If the buffer is full, the event is ignored. |
* |
* @param keybuffer The keybuffer. |
* @param ev The event to push. |
* |
*/ |
void keybuffer_push(keybuffer_t *keybuffer, const console_event_t *ev) |
{ |
futex_down(&keybuffer_futex); |
if (keybuffer->items < KEYBUFFER_SIZE) { |
keybuffer->fifo[keybuffer->tail] = *ev; |
keybuffer->tail = (keybuffer->tail + 1) % KEYBUFFER_SIZE; |
keybuffer->items++; |
} |
futex_up(&keybuffer_futex); |
} |
/** Pop event from buffer. |
* |
* @param edst Pointer to where the event should be saved. |
* |
* @return True if an event was popped. |
* |
*/ |
bool keybuffer_pop(keybuffer_t *keybuffer, console_event_t *edst) |
{ |
futex_down(&keybuffer_futex); |
if (keybuffer->items > 0) { |
keybuffer->items--; |
*edst = (keybuffer->fifo[keybuffer->head]); |
keybuffer->head = (keybuffer->head + 1) % KEYBUFFER_SIZE; |
futex_up(&keybuffer_futex); |
return true; |
} |
futex_up(&keybuffer_futex); |
return false; |
} |
/** |
* @} |
*/ |
//branches/snapshot/uspace/srv/kbd/Makefile |
---|
0,0 → 1,179 |
# |
# Copyright (c) 2005 Martin Decky |
# All rights reserved. |
# |
# Redistribution and use in source and binary forms, with or without |
# modification, are permitted provided that the following conditions |
# are met: |
# |
# - Redistributions of source code must retain the above copyright |
# notice, this list of conditions and the following disclaimer. |
# - 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. |
# - The name of the author may not be used to endorse or promote products |
# derived from this software without specific prior written permission. |
# |
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
# |
## Setup toolchain |
# |
LIBC_PREFIX = ../../lib/libc |
SOFTINT_PREFIX = ../../lib/softint |
include $(LIBC_PREFIX)/Makefile.toolchain |
CFLAGS += -Iinclude |
LIBS = $(LIBC_PREFIX)/libc.a |
## Sources |
# |
OUTPUT = kbd |
GENERIC_SOURCES = \ |
generic/kbd.c \ |
genarch/gsp.c \ |
genarch/stroke.c \ |
generic/keybuffer.c |
ARCH_SOURCES = |
GENARCH_SOURCES = \ |
layout/cz.c \ |
layout/us_qwerty.c \ |
layout/us_dvorak.c |
ifeq ($(UARCH), amd64) |
GENARCH_SOURCES += \ |
port/i8042.c \ |
ctl/pc.c |
endif |
ifeq ($(UARCH), arm32) |
GENARCH_SOURCES += \ |
port/gxemul.c |
ifeq ($(CONFIG_FB), y) |
GENARCH_SOURCES += \ |
ctl/gxe_fb.c |
else |
GENARCH_SOURCES += \ |
ctl/stty.c |
endif |
endif |
ifeq ($(UARCH), ia32) |
GENARCH_SOURCES += \ |
port/i8042.c \ |
ctl/pc.c |
endif |
ifeq ($(MACHINE), i460GX) |
GENARCH_SOURCES += \ |
port/i8042.c \ |
ctl/pc.c |
endif |
ifeq ($(MACHINE), ski) |
GENARCH_SOURCES += \ |
port/ski.c \ |
ctl/stty.c |
endif |
ifeq ($(MACHINE), msim) |
GENARCH_SOURCES += \ |
port/msim.c \ |
ctl/stty.c |
endif |
ifeq ($(MACHINE), lgxemul) |
GENARCH_SOURCES += \ |
port/gxemul.c |
ifeq ($(CONFIG_FB), y) |
GENARCH_SOURCES += \ |
ctl/gxe_fb.c |
else |
GENARCH_SOURCES += \ |
ctl/stty.c |
endif |
endif |
ifeq ($(MACHINE), bgxemul) |
GENARCH_SOURCES += \ |
port/gxemul.c |
ifeq ($(CONFIG_FB), y) |
GENARCH_SOURCES += \ |
ctl/gxe_fb.c |
else |
GENARCH_SOURCES += \ |
ctl/stty.c |
endif |
endif |
ifeq ($(UARCH), ppc32) |
GENARCH_SOURCES += \ |
port/dummy.c \ |
ctl/stty.c |
endif |
ifeq ($(UARCH), sparc64) |
ifeq ($(MACHINE),serengeti) |
GENARCH_SOURCES += \ |
port/sgcn.c \ |
ctl/stty.c |
else |
GENARCH_SOURCES += \ |
port/sun.c \ |
port/z8530.c \ |
port/ns16550.c \ |
ctl/sun.c |
endif |
endif |
GENERIC_OBJECTS := $(addsuffix .o,$(basename $(GENERIC_SOURCES))) |
ARCH_OBJECTS := $(addsuffix .o,$(basename $(ARCH_SOURCES))) |
GENARCH_OBJECTS := $(addsuffix .o,$(basename $(GENARCH_SOURCES))) |
OBJECTS := $(ARCH_OBJECTS) $(GENERIC_OBJECTS) $(GENARCH_OBJECTS) |
.PHONY: all clean depend disasm links |
all: $(OUTPUT) $(OUTPUT).disasm |
-include Makefile.depend |
clean: |
-rm -f $(OUTPUT) $(OUTPUT).map $(OUTPUT).disasm Makefile.depend $(OBJECTS) |
depend: |
$(CC) $(DEFS) $(CFLAGS) -M $(SOURCES) > Makefile.depend |
$(OUTPUT): $(OBJECTS) $(LIBS) |
$(LD) -T $(LIBC_PREFIX)/arch/$(UARCH)/_link.ld $(OBJECTS) $(LIBS) $(LFLAGS) -o $@ -Map $(OUTPUT).map |
disasm: $(OUTPUT).disasm |
$(OUTPUT).disasm: $(OUTPUT) |
$(OBJDUMP) -d $< > $@ |
%.o: %.S |
$(CC) $(DEFS) $(AFLAGS) $(CFLAGS) -D__ASM__ -c $< -o $@ |
%.o: %.s |
$(AS) $(AFLAGS) $< -o $@ |
%.o: %.c |
$(CC) $(DEFS) $(CFLAGS) -c $< -o $@ |
//branches/snapshot/uspace/srv/console/screenbuffer.h |
---|
0,0 → 1,159 |
/* |
* Copyright (c) 2006 Josef Cejka |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup console |
* @{ |
*/ |
/** @file |
*/ |
#ifndef SCREENBUFFER_H__ |
#define SCREENBUFFER_H__ |
#include <stdint.h> |
#include <sys/types.h> |
#include <bool.h> |
#define DEFAULT_FOREGROUND 0x0 /**< default console foreground color */ |
#define DEFAULT_BACKGROUND 0xf0f0f0 /**< default console background color */ |
typedef struct { |
uint8_t style; |
} attr_style_t; |
typedef struct { |
uint8_t fg_color; |
uint8_t bg_color; |
uint8_t flags; |
} attr_idx_t; |
typedef struct { |
uint32_t bg_color; /**< background color */ |
uint32_t fg_color; /**< foreground color */ |
} attr_rgb_t; |
typedef struct { |
enum { |
at_style, |
at_idx, |
at_rgb |
} t; |
union { |
attr_style_t s; |
attr_idx_t i; |
attr_rgb_t r; |
} a; |
} attrs_t; |
/** One field on screen. It contain one character and its attributes. */ |
typedef struct { |
wchar_t character; /**< Character itself */ |
attrs_t attrs; /**< Character attributes */ |
} keyfield_t; |
/** Structure for buffering state of one virtual console. |
*/ |
typedef struct { |
keyfield_t *buffer; /**< Screen content - characters and |
their attributes (used as a circular buffer) */ |
size_t size_x; /**< Number of columns */ |
size_t size_y; /**< Number of rows */ |
/** Coordinates of last printed character for determining cursor position */ |
size_t position_x; |
size_t position_y; |
attrs_t attrs; /**< Current attributes. */ |
size_t top_line; /**< Points to buffer[][] line that will |
be printed at screen as the first line */ |
bool is_cursor_visible; /**< Cursor state - default is visible */ |
} screenbuffer_t; |
/** Returns keyfield for position on screen |
* |
* Screenbuffer->buffer is cyclic buffer so we |
* must couted in index of the topmost line. |
* |
* @param scr Screenbuffer |
* @param x Position on screen |
* @param y Position on screen |
* |
* @return Keyfield structure with character and its attributes on x, y |
* |
*/ |
static inline keyfield_t *get_field_at(screenbuffer_t *scr, size_t x, size_t y) |
{ |
return scr->buffer + x + ((y + scr->top_line) % scr->size_y) * scr->size_x; |
} |
/** Compares two sets of attributes. |
* |
* @param s1 First style |
* @param s2 Second style |
* |
* @return Nonzero on equality |
* |
*/ |
static inline int attrs_same(attrs_t a1, attrs_t a2) |
{ |
if (a1.t != a2.t) |
return 0; |
switch (a1.t) { |
case at_style: |
return (a1.a.s.style == a2.a.s.style); |
case at_idx: |
return (a1.a.i.fg_color == a2.a.i.fg_color) |
&& (a1.a.i.bg_color == a2.a.i.bg_color) |
&& (a1.a.i.flags == a2.a.i.flags); |
case at_rgb: |
return (a1.a.r.fg_color == a2.a.r.fg_color) |
&& (a1.a.r.bg_color == a2.a.r.bg_color); |
} |
return 0; |
} |
void screenbuffer_putchar(screenbuffer_t *scr, wchar_t c); |
screenbuffer_t *screenbuffer_init(screenbuffer_t *scr, size_t size_x, size_t size_y); |
void screenbuffer_clear(screenbuffer_t *scr); |
void screenbuffer_clear_line(screenbuffer_t *scr, size_t line); |
void screenbuffer_copy_buffer(screenbuffer_t *scr, keyfield_t *dest); |
void screenbuffer_goto(screenbuffer_t *scr, size_t x, size_t y); |
void screenbuffer_set_style(screenbuffer_t *scr, uint8_t style); |
void screenbuffer_set_color(screenbuffer_t *scr, uint8_t fg_color, |
uint8_t bg_color, uint8_t attr); |
void screenbuffer_set_rgb_color(screenbuffer_t *scr, uint32_t fg_color, |
uint32_t bg_color); |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/srv/console/console.c |
---|
0,0 → 1,756 |
/* |
* Copyright (c) 2006 Josef Cejka |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup console |
* @{ |
*/ |
/** @file |
*/ |
#include <libc.h> |
#include <fb.h> |
#include <ipc/ipc.h> |
#include <kbd.h> |
#include <io/keycode.h> |
#include <ipc/fb.h> |
#include <ipc/services.h> |
#include <errno.h> |
#include <keybuffer.h> |
#include <ipc/console.h> |
#include <unistd.h> |
#include <async.h> |
#include <adt/fifo.h> |
#include <sys/mman.h> |
#include <stdio.h> |
#include <string.h> |
#include <sysinfo.h> |
#include <event.h> |
#include <devmap.h> |
#include <fibril_sync.h> |
#include "console.h" |
#include "gcons.h" |
#include "screenbuffer.h" |
#define NAME "console" |
#define MAX_DEVICE_NAME 32 |
/** Phone to the keyboard driver. */ |
static int kbd_phone; |
/** Information about framebuffer */ |
struct { |
int phone; /**< Framebuffer phone */ |
ipcarg_t cols; /**< Framebuffer columns */ |
ipcarg_t rows; /**< Framebuffer rows */ |
} fb_info; |
typedef struct { |
size_t index; /**< Console index */ |
size_t refcount; /**< Connection reference count */ |
dev_handle_t dev_handle; /**< Device handle */ |
keybuffer_t keybuffer; /**< Buffer for incoming keys. */ |
screenbuffer_t scr; /**< Screenbuffer for saving screen |
contents and related settings. */ |
} console_t; |
/** Array of data for virtual consoles */ |
static console_t consoles[CONSOLE_COUNT]; |
static console_t *active_console = &consoles[0]; |
static console_t *prev_console = &consoles[0]; |
static console_t *kernel_console = &consoles[KERNEL_CONSOLE]; |
/** Pointer to memory shared with framebufer used for |
faster virtual console switching */ |
static keyfield_t *interbuffer = NULL; |
/** Information on row-span yet unsent to FB driver. */ |
struct { |
size_t col; /**< Leftmost column of the span. */ |
size_t row; /**< Row where the span lies. */ |
size_t cnt; /**< Width of the span. */ |
} fb_pending; |
static FIBRIL_MUTEX_INITIALIZE(input_mutex); |
static FIBRIL_CONDVAR_INITIALIZE(input_cv); |
static void curs_visibility(bool visible) |
{ |
async_msg_1(fb_info.phone, FB_CURSOR_VISIBILITY, visible); |
} |
static void curs_hide_sync(void) |
{ |
ipc_call_sync_1_0(fb_info.phone, FB_CURSOR_VISIBILITY, false); |
} |
static void curs_goto(size_t x, size_t y) |
{ |
async_msg_2(fb_info.phone, FB_CURSOR_GOTO, x, y); |
} |
static void screen_clear(void) |
{ |
async_msg_0(fb_info.phone, FB_CLEAR); |
} |
static void screen_yield(void) |
{ |
ipc_call_sync_0_0(fb_info.phone, FB_SCREEN_YIELD); |
} |
static void screen_reclaim(void) |
{ |
ipc_call_sync_0_0(fb_info.phone, FB_SCREEN_RECLAIM); |
} |
static void kbd_yield(void) |
{ |
ipc_call_sync_0_0(kbd_phone, KBD_YIELD); |
} |
static void kbd_reclaim(void) |
{ |
ipc_call_sync_0_0(kbd_phone, KBD_RECLAIM); |
} |
static void set_style(int style) |
{ |
async_msg_1(fb_info.phone, FB_SET_STYLE, style); |
} |
static void set_color(int fgcolor, int bgcolor, int flags) |
{ |
async_msg_3(fb_info.phone, FB_SET_COLOR, fgcolor, bgcolor, flags); |
} |
static void set_rgb_color(int fgcolor, int bgcolor) |
{ |
async_msg_2(fb_info.phone, FB_SET_RGB_COLOR, fgcolor, bgcolor); |
} |
static void set_attrs(attrs_t *attrs) |
{ |
switch (attrs->t) { |
case at_style: |
set_style(attrs->a.s.style); |
break; |
case at_idx: |
set_color(attrs->a.i.fg_color, attrs->a.i.bg_color, |
attrs->a.i.flags); |
break; |
case at_rgb: |
set_rgb_color(attrs->a.r.fg_color, attrs->a.r.bg_color); |
break; |
} |
} |
/** Send an area of screenbuffer to the FB driver. */ |
static void fb_update_area(console_t *cons, ipcarg_t x0, ipcarg_t y0, ipcarg_t width, ipcarg_t height) |
{ |
if (interbuffer) { |
ipcarg_t x; |
ipcarg_t y; |
for (y = 0; y < height; y++) { |
for (x = 0; x < width; x++) { |
interbuffer[y * width + x] = |
*get_field_at(&cons->scr, x0 + x, y0 + y); |
} |
} |
async_req_4_0(fb_info.phone, FB_DRAW_TEXT_DATA, |
x0, y0, width, height); |
} |
} |
/** Flush pending cells to FB. */ |
static void fb_pending_flush(void) |
{ |
if (fb_pending.cnt > 0) { |
fb_update_area(active_console, fb_pending.col, |
fb_pending.row, fb_pending.cnt, 1); |
fb_pending.cnt = 0; |
} |
} |
/** Mark a character cell as changed. |
* |
* This adds the cell to the pending rowspan if possible. Otherwise |
* the old span is flushed first. |
* |
*/ |
static void cell_mark_changed(size_t col, size_t row) |
{ |
if (fb_pending.cnt != 0) { |
if ((col != fb_pending.col + fb_pending.cnt) |
|| (row != fb_pending.row)) { |
fb_pending_flush(); |
} |
} |
if (fb_pending.cnt == 0) { |
fb_pending.col = col; |
fb_pending.row = row; |
} |
fb_pending.cnt++; |
} |
/** Print a character to the active VC with buffering. */ |
static void fb_putchar(wchar_t c, ipcarg_t col, ipcarg_t row) |
{ |
async_msg_3(fb_info.phone, FB_PUTCHAR, c, col, row); |
} |
/** Process a character from the client (TTY emulation). */ |
static void write_char(console_t *cons, wchar_t ch) |
{ |
bool flush_cursor = false; |
switch (ch) { |
case '\n': |
fb_pending_flush(); |
flush_cursor = true; |
cons->scr.position_y++; |
cons->scr.position_x = 0; |
break; |
case '\r': |
break; |
case '\t': |
cons->scr.position_x += 8; |
cons->scr.position_x -= cons->scr.position_x % 8; |
break; |
case '\b': |
if (cons->scr.position_x == 0) |
break; |
cons->scr.position_x--; |
if (cons == active_console) |
cell_mark_changed(cons->scr.position_x, cons->scr.position_y); |
screenbuffer_putchar(&cons->scr, ' '); |
break; |
default: |
if (cons == active_console) |
cell_mark_changed(cons->scr.position_x, cons->scr.position_y); |
screenbuffer_putchar(&cons->scr, ch); |
cons->scr.position_x++; |
} |
if (cons->scr.position_x >= cons->scr.size_x) { |
flush_cursor = true; |
cons->scr.position_y++; |
} |
if (cons->scr.position_y >= cons->scr.size_y) { |
fb_pending_flush(); |
cons->scr.position_y = cons->scr.size_y - 1; |
screenbuffer_clear_line(&cons->scr, cons->scr.top_line); |
cons->scr.top_line = (cons->scr.top_line + 1) % cons->scr.size_y; |
if (cons == active_console) |
async_msg_1(fb_info.phone, FB_SCROLL, 1); |
} |
if (cons == active_console && flush_cursor) |
curs_goto(cons->scr.position_x, cons->scr.position_y); |
cons->scr.position_x = cons->scr.position_x % cons->scr.size_x; |
} |
/** Switch to new console */ |
static void change_console(console_t *cons) |
{ |
if (cons == active_console) |
return; |
fb_pending_flush(); |
if (cons == kernel_console) { |
async_serialize_start(); |
curs_hide_sync(); |
gcons_in_kernel(); |
screen_yield(); |
kbd_yield(); |
async_serialize_end(); |
if (__SYSCALL0(SYS_DEBUG_ENABLE_CONSOLE)) { |
prev_console = active_console; |
active_console = kernel_console; |
} else |
cons = active_console; |
} |
if (cons != kernel_console) { |
size_t x; |
size_t y; |
int rc = 0; |
async_serialize_start(); |
if (active_console == kernel_console) { |
screen_reclaim(); |
kbd_reclaim(); |
gcons_redraw_console(); |
} |
active_console = cons; |
gcons_change_console(cons->index); |
set_attrs(&cons->scr.attrs); |
curs_visibility(false); |
if (interbuffer) { |
for (y = 0; y < cons->scr.size_y; y++) { |
for (x = 0; x < cons->scr.size_x; x++) { |
interbuffer[y * cons->scr.size_x + x] = |
*get_field_at(&cons->scr, x, y); |
} |
} |
/* This call can preempt, but we are already at the end */ |
rc = async_req_4_0(fb_info.phone, FB_DRAW_TEXT_DATA, |
0, 0, cons->scr.size_x, |
cons->scr.size_y); |
} |
if ((!interbuffer) || (rc != 0)) { |
set_attrs(&cons->scr.attrs); |
screen_clear(); |
for (y = 0; y < cons->scr.size_y; y++) |
for (x = 0; x < cons->scr.size_x; x++) { |
keyfield_t *field = get_field_at(&cons->scr, x, y); |
if (!attrs_same(cons->scr.attrs, field->attrs)) |
set_attrs(&field->attrs); |
cons->scr.attrs = field->attrs; |
if ((field->character == ' ') && |
(attrs_same(field->attrs, cons->scr.attrs))) |
continue; |
fb_putchar(field->character, x, y); |
} |
} |
curs_goto(cons->scr.position_x, cons->scr.position_y); |
curs_visibility(cons->scr.is_cursor_visible); |
async_serialize_end(); |
} |
} |
/** Handler for keyboard */ |
static void keyboard_events(ipc_callid_t iid, ipc_call_t *icall) |
{ |
/* Ignore parameters, the connection is already opened */ |
while (true) { |
ipc_call_t call; |
ipc_callid_t callid = async_get_call(&call); |
int retval; |
console_event_t ev; |
switch (IPC_GET_METHOD(call)) { |
case IPC_M_PHONE_HUNGUP: |
/* TODO: Handle hangup */ |
return; |
case KBD_EVENT: |
/* Got event from keyboard driver. */ |
retval = 0; |
ev.type = IPC_GET_ARG1(call); |
ev.key = IPC_GET_ARG2(call); |
ev.mods = IPC_GET_ARG3(call); |
ev.c = IPC_GET_ARG4(call); |
if ((ev.key >= KC_F1) && (ev.key < KC_F1 + |
CONSOLE_COUNT) && ((ev.mods & KM_CTRL) == 0)) { |
if (ev.key == KC_F1 + KERNEL_CONSOLE) |
change_console(kernel_console); |
else |
change_console(&consoles[ev.key - KC_F1]); |
break; |
} |
fibril_mutex_lock(&input_mutex); |
keybuffer_push(&active_console->keybuffer, &ev); |
fibril_condvar_broadcast(&input_cv); |
fibril_mutex_unlock(&input_mutex); |
break; |
default: |
retval = ENOENT; |
} |
ipc_answer_0(callid, retval); |
} |
} |
static void cons_write(console_t *cons, ipc_callid_t rid, ipc_call_t *request) |
{ |
ipc_callid_t callid; |
size_t size; |
if (!ipc_data_write_receive(&callid, &size)) { |
ipc_answer_0(callid, EINVAL); |
ipc_answer_0(rid, EINVAL); |
return; |
} |
char *buf = (char *) malloc(size); |
if (buf == NULL) { |
ipc_answer_0(callid, ENOMEM); |
ipc_answer_0(rid, ENOMEM); |
return; |
} |
(void) ipc_data_write_finalize(callid, buf, size); |
async_serialize_start(); |
size_t off = 0; |
while (off < size) { |
wchar_t ch = str_decode(buf, &off, size); |
write_char(cons, ch); |
} |
async_serialize_end(); |
gcons_notify_char(cons->index); |
ipc_answer_1(rid, EOK, size); |
free(buf); |
} |
static void cons_read(console_t *cons, ipc_callid_t rid, ipc_call_t *request) |
{ |
ipc_callid_t callid; |
size_t size; |
if (!ipc_data_read_receive(&callid, &size)) { |
ipc_answer_0(callid, EINVAL); |
ipc_answer_0(rid, EINVAL); |
return; |
} |
char *buf = (char *) malloc(size); |
if (buf == NULL) { |
ipc_answer_0(callid, ENOMEM); |
ipc_answer_0(rid, ENOMEM); |
return; |
} |
size_t pos = 0; |
console_event_t ev; |
fibril_mutex_lock(&input_mutex); |
recheck: |
while ((keybuffer_pop(&cons->keybuffer, &ev)) && (pos < size)) { |
if (ev.type == KEY_PRESS) { |
buf[pos] = ev.c; |
pos++; |
} |
} |
if (pos == size) { |
(void) ipc_data_read_finalize(callid, buf, size); |
ipc_answer_1(rid, EOK, size); |
free(buf); |
} else { |
fibril_condvar_wait(&input_cv, &input_mutex); |
goto recheck; |
} |
fibril_mutex_unlock(&input_mutex); |
} |
static void cons_get_event(console_t *cons, ipc_callid_t rid, ipc_call_t *request) |
{ |
console_event_t ev; |
fibril_mutex_lock(&input_mutex); |
recheck: |
if (keybuffer_pop(&cons->keybuffer, &ev)) { |
ipc_answer_4(rid, EOK, ev.type, ev.key, ev.mods, ev.c); |
} else { |
fibril_condvar_wait(&input_cv, &input_mutex); |
goto recheck; |
} |
fibril_mutex_unlock(&input_mutex); |
} |
/** Default thread for new connections */ |
static void client_connection(ipc_callid_t iid, ipc_call_t *icall) |
{ |
console_t *cons = NULL; |
size_t i; |
for (i = 0; i < CONSOLE_COUNT; i++) { |
if (i == KERNEL_CONSOLE) |
continue; |
if (consoles[i].dev_handle == (dev_handle_t) IPC_GET_ARG1(*icall)) { |
cons = &consoles[i]; |
break; |
} |
} |
if (cons == NULL) { |
ipc_answer_0(iid, ENOENT); |
return; |
} |
ipc_callid_t callid; |
ipc_call_t call; |
ipcarg_t arg1; |
ipcarg_t arg2; |
ipcarg_t arg3; |
async_serialize_start(); |
if (cons->refcount == 0) |
gcons_notify_connect(cons->index); |
cons->refcount++; |
/* Accept the connection */ |
ipc_answer_0(iid, EOK); |
while (true) { |
async_serialize_end(); |
callid = async_get_call(&call); |
async_serialize_start(); |
arg1 = 0; |
arg2 = 0; |
arg3 = 0; |
switch (IPC_GET_METHOD(call)) { |
case IPC_M_PHONE_HUNGUP: |
cons->refcount--; |
if (cons->refcount == 0) |
gcons_notify_disconnect(cons->index); |
return; |
case VFS_OUT_READ: |
async_serialize_end(); |
cons_read(cons, callid, &call); |
async_serialize_start(); |
continue; |
case VFS_OUT_WRITE: |
async_serialize_end(); |
cons_write(cons, callid, &call); |
async_serialize_start(); |
continue; |
case VFS_OUT_SYNC: |
fb_pending_flush(); |
if (cons == active_console) { |
async_req_0_0(fb_info.phone, FB_FLUSH); |
curs_goto(cons->scr.position_x, cons->scr.position_y); |
} |
break; |
case CONSOLE_CLEAR: |
/* Send message to fb */ |
if (cons == active_console) |
async_msg_0(fb_info.phone, FB_CLEAR); |
screenbuffer_clear(&cons->scr); |
break; |
case CONSOLE_GOTO: |
screenbuffer_goto(&cons->scr, |
IPC_GET_ARG1(call), IPC_GET_ARG2(call)); |
if (cons == active_console) |
curs_goto(IPC_GET_ARG1(call), |
IPC_GET_ARG2(call)); |
break; |
case CONSOLE_GET_SIZE: |
arg1 = fb_info.cols; |
arg2 = fb_info.rows; |
break; |
case CONSOLE_SET_STYLE: |
fb_pending_flush(); |
arg1 = IPC_GET_ARG1(call); |
screenbuffer_set_style(&cons->scr, arg1); |
if (cons == active_console) |
set_style(arg1); |
break; |
case CONSOLE_SET_COLOR: |
fb_pending_flush(); |
arg1 = IPC_GET_ARG1(call); |
arg2 = IPC_GET_ARG2(call); |
arg3 = IPC_GET_ARG3(call); |
screenbuffer_set_color(&cons->scr, arg1, arg2, arg3); |
if (cons == active_console) |
set_color(arg1, arg2, arg3); |
break; |
case CONSOLE_SET_RGB_COLOR: |
fb_pending_flush(); |
arg1 = IPC_GET_ARG1(call); |
arg2 = IPC_GET_ARG2(call); |
screenbuffer_set_rgb_color(&cons->scr, arg1, arg2); |
if (cons == active_console) |
set_rgb_color(arg1, arg2); |
break; |
case CONSOLE_CURSOR_VISIBILITY: |
fb_pending_flush(); |
arg1 = IPC_GET_ARG1(call); |
cons->scr.is_cursor_visible = arg1; |
if (cons == active_console) |
curs_visibility(arg1); |
break; |
case CONSOLE_GET_EVENT: |
async_serialize_end(); |
cons_get_event(cons, callid, &call); |
async_serialize_start(); |
continue; |
case CONSOLE_KCON_ENABLE: |
change_console(kernel_console); |
break; |
} |
ipc_answer_3(callid, EOK, arg1, arg2, arg3); |
} |
} |
static void interrupt_received(ipc_callid_t callid, ipc_call_t *call) |
{ |
change_console(prev_console); |
} |
static bool console_init(void) |
{ |
/* Connect to keyboard driver */ |
kbd_phone = ipc_connect_me_to_blocking(PHONE_NS, SERVICE_KEYBOARD, 0, 0); |
if (kbd_phone < 0) { |
printf(NAME ": Failed to connect to keyboard service\n"); |
return false; |
} |
ipcarg_t phonehash; |
if (ipc_connect_to_me(kbd_phone, SERVICE_CONSOLE, 0, 0, &phonehash) != 0) { |
printf(NAME ": Failed to create callback from keyboard service\n"); |
return false; |
} |
async_new_connection(phonehash, 0, NULL, keyboard_events); |
/* Connect to framebuffer driver */ |
fb_info.phone = ipc_connect_me_to_blocking(PHONE_NS, SERVICE_VIDEO, 0, 0); |
if (fb_info.phone < 0) { |
printf(NAME ": Failed to connect to video service\n"); |
return -1; |
} |
/* Register driver */ |
int rc = devmap_driver_register(NAME, client_connection); |
if (rc < 0) { |
printf(NAME ": Unable to register driver (%d)\n", rc); |
return false; |
} |
/* Initialize gcons */ |
gcons_init(fb_info.phone); |
/* Synchronize, the gcons could put something in queue */ |
async_req_0_0(fb_info.phone, FB_FLUSH); |
async_req_0_2(fb_info.phone, FB_GET_CSIZE, &fb_info.cols, &fb_info.rows); |
/* Set up shared memory buffer. */ |
size_t ib_size = sizeof(keyfield_t) * fb_info.cols * fb_info.rows; |
interbuffer = as_get_mappable_page(ib_size); |
if (as_area_create(interbuffer, ib_size, AS_AREA_READ | |
AS_AREA_WRITE | AS_AREA_CACHEABLE) != interbuffer) |
interbuffer = NULL; |
if (interbuffer) { |
if (ipc_share_out_start(fb_info.phone, interbuffer, |
AS_AREA_READ) != EOK) { |
as_area_destroy(interbuffer); |
interbuffer = NULL; |
} |
} |
fb_pending.cnt = 0; |
/* Inititalize consoles */ |
size_t i; |
for (i = 0; i < CONSOLE_COUNT; i++) { |
if (i != KERNEL_CONSOLE) { |
if (screenbuffer_init(&consoles[i].scr, |
fb_info.cols, fb_info.rows) == NULL) { |
printf(NAME ": Unable to allocate screen buffer %u\n", i); |
return false; |
} |
screenbuffer_clear(&consoles[i].scr); |
keybuffer_init(&consoles[i].keybuffer); |
consoles[i].index = i; |
consoles[i].refcount = 0; |
char vc[MAX_DEVICE_NAME]; |
snprintf(vc, MAX_DEVICE_NAME, "vc%u", i); |
if (devmap_device_register(vc, &consoles[i].dev_handle) != EOK) { |
devmap_hangup_phone(DEVMAP_DRIVER); |
printf(NAME ": Unable to register device %s\n", vc); |
return false; |
} |
} |
} |
/* Disable kernel output to the console */ |
__SYSCALL0(SYS_DEBUG_DISABLE_CONSOLE); |
/* Initialize the screen */ |
async_serialize_start(); |
gcons_redraw_console(); |
set_rgb_color(DEFAULT_FOREGROUND, DEFAULT_BACKGROUND); |
screen_clear(); |
curs_goto(0, 0); |
curs_visibility(active_console->scr.is_cursor_visible); |
async_serialize_end(); |
/* Receive kernel notifications */ |
if (event_subscribe(EVENT_KCONSOLE, 0) != EOK) |
printf(NAME ": Error registering kconsole notifications\n"); |
async_set_interrupt_received(interrupt_received); |
return true; |
} |
int main(int argc, char *argv[]) |
{ |
printf(NAME ": HelenOS Console service\n"); |
if (!console_init()) |
return -1; |
printf(NAME ": Accepting connections\n"); |
async_manager(); |
return 0; |
} |
/** @} |
*/ |
//branches/snapshot/uspace/srv/console/gcons.c |
---|
0,0 → 1,543 |
/* |
* Copyright (c) 2006 Ondrej Palkovsky |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup console |
* @{ |
*/ |
/** @file |
*/ |
#include <ipc/fb.h> |
#include <ipc/ipc.h> |
#include <async.h> |
#include <stdio.h> |
#include <sys/mman.h> |
#include <string.h> |
#include <align.h> |
#include <bool.h> |
#include "console.h" |
#include "gcons.h" |
#define CONSOLE_TOP 66 |
#define CONSOLE_MARGIN 6 |
#define STATUS_START 110 |
#define STATUS_TOP 8 |
#define STATUS_SPACE 4 |
#define STATUS_WIDTH 48 |
#define STATUS_HEIGHT 48 |
#define MAIN_COLOR 0xffffff |
static bool use_gcons = false; |
static ipcarg_t xres; |
static ipcarg_t yres; |
enum butstate { |
CONS_DISCONNECTED = 0, |
CONS_SELECTED, |
CONS_IDLE, |
CONS_HAS_DATA, |
CONS_KERNEL, |
CONS_DISCONNECTED_SEL, |
CONS_LAST |
}; |
static int console_vp; |
static int cstatus_vp[CONSOLE_COUNT]; |
static enum butstate console_state[CONSOLE_COUNT]; |
static int fbphone; |
/** List of pixmaps identifying these icons */ |
static int ic_pixmaps[CONS_LAST] = {-1, -1, -1, -1, -1, -1}; |
static int animation = -1; |
static size_t active_console = 0; |
size_t mouse_x; |
size_t mouse_y; |
bool btn_pressed; |
size_t btn_x; |
size_t btn_y; |
static void vp_switch(int vp) |
{ |
async_msg_1(fbphone, FB_VIEWPORT_SWITCH, vp); |
} |
/** Create view port */ |
static int vp_create(size_t x, size_t y, size_t width, size_t height) |
{ |
return async_req_2_0(fbphone, FB_VIEWPORT_CREATE, (x << 16) | y, |
(width << 16) | height); |
} |
static void clear(void) |
{ |
async_msg_0(fbphone, FB_CLEAR); |
} |
static void set_rgb_color(uint32_t fgcolor, uint32_t bgcolor) |
{ |
async_msg_2(fbphone, FB_SET_RGB_COLOR, fgcolor, bgcolor); |
} |
/** Transparent putchar */ |
static void tran_putch(wchar_t ch, size_t col, size_t row) |
{ |
async_msg_3(fbphone, FB_PUTCHAR, ch, col, row); |
} |
/** Redraw the button showing state of a given console */ |
static void redraw_state(size_t index) |
{ |
vp_switch(cstatus_vp[index]); |
enum butstate state = console_state[index]; |
if (ic_pixmaps[state] != -1) |
async_msg_2(fbphone, FB_VP_DRAW_PIXMAP, cstatus_vp[index], |
ic_pixmaps[state]); |
if ((state != CONS_DISCONNECTED) && (state != CONS_KERNEL) |
&& (state != CONS_DISCONNECTED_SEL)) { |
char data[5]; |
snprintf(data, 5, "%u", index + 1); |
size_t i; |
for (i = 0; data[i] != 0; i++) |
tran_putch(data[i], 2 + i, 1); |
} |
} |
/** Notification run on changing console (except kernel console) */ |
void gcons_change_console(size_t index) |
{ |
if (!use_gcons) |
return; |
if (active_console == KERNEL_CONSOLE) { |
size_t i; |
for (i = 0; i < CONSOLE_COUNT; i++) |
redraw_state(i); |
if (animation != -1) |
async_msg_1(fbphone, FB_ANIM_START, animation); |
} else { |
if (console_state[active_console] == CONS_DISCONNECTED_SEL) |
console_state[active_console] = CONS_DISCONNECTED; |
else |
console_state[active_console] = CONS_IDLE; |
redraw_state(active_console); |
} |
active_console = index; |
if ((console_state[index] == CONS_DISCONNECTED) |
|| (console_state[index] == CONS_DISCONNECTED_SEL)) |
console_state[index] = CONS_DISCONNECTED_SEL; |
else |
console_state[index] = CONS_SELECTED; |
redraw_state(index); |
vp_switch(console_vp); |
} |
/** Notification function that gets called on new output to virtual console */ |
void gcons_notify_char(size_t index) |
{ |
if (!use_gcons) |
return; |
if ((index == active_console) |
|| (console_state[index] == CONS_HAS_DATA)) |
return; |
console_state[index] = CONS_HAS_DATA; |
if (active_console == KERNEL_CONSOLE) |
return; |
redraw_state(index); |
vp_switch(console_vp); |
} |
/** Notification function called on service disconnect from console */ |
void gcons_notify_disconnect(size_t index) |
{ |
if (!use_gcons) |
return; |
if (index == active_console) |
console_state[index] = CONS_DISCONNECTED_SEL; |
else |
console_state[index] = CONS_DISCONNECTED; |
if (active_console == KERNEL_CONSOLE) |
return; |
redraw_state(index); |
vp_switch(console_vp); |
} |
/** Notification function called on console connect */ |
void gcons_notify_connect(size_t index) |
{ |
if (!use_gcons) |
return; |
if (index == active_console) |
console_state[index] = CONS_SELECTED; |
else |
console_state[index] = CONS_IDLE; |
if (active_console == KERNEL_CONSOLE) |
return; |
redraw_state(index); |
vp_switch(console_vp); |
} |
/** Change to kernel console */ |
void gcons_in_kernel(void) |
{ |
if (animation != -1) |
async_msg_1(fbphone, FB_ANIM_STOP, animation); |
active_console = KERNEL_CONSOLE; |
vp_switch(0); |
} |
/** Return x, where left <= x <= right && |a-x| == min(|a-x|) is smallest */ |
static inline int limit(size_t a, size_t left, size_t right) |
{ |
if (a < left) |
a = left; |
if (a >= right) |
a = right - 1; |
return a; |
} |
/** Handle mouse move |
* |
* @param dx Delta X of mouse move |
* @param dy Delta Y of mouse move |
*/ |
void gcons_mouse_move(ssize_t dx, ssize_t dy) |
{ |
mouse_x = limit(mouse_x + dx, 0, xres); |
mouse_y = limit(mouse_y + dy, 0, yres); |
async_msg_2(fbphone, FB_POINTER_MOVE, mouse_x, mouse_y); |
} |
static int gcons_find_conbut(int x, int y) |
{ |
int status_start = STATUS_START + (xres - 800) / 2; |
if ((y < STATUS_TOP) || (y >= STATUS_TOP + STATUS_HEIGHT)) |
return -1; |
if (x < status_start) |
return -1; |
if (x >= status_start + (STATUS_WIDTH + STATUS_SPACE) * CONSOLE_COUNT) |
return -1; |
if (((x - status_start) % (STATUS_WIDTH + STATUS_SPACE)) < STATUS_SPACE) |
return -1; |
return (x - status_start) / (STATUS_WIDTH + STATUS_SPACE); |
} |
/** Handle mouse click |
* |
* @param state New state (true - pressed, false - depressed) |
*/ |
int gcons_mouse_btn(bool state) |
{ |
int conbut; |
if (state) { |
conbut = gcons_find_conbut(mouse_x, mouse_y); |
if (conbut != -1) { |
btn_pressed = true; |
btn_x = mouse_x; |
btn_y = mouse_y; |
} |
return -1; |
} |
if ((!state) && (!btn_pressed)) |
return -1; |
btn_pressed = false; |
conbut = gcons_find_conbut(mouse_x, mouse_y); |
if (conbut == gcons_find_conbut(btn_x, btn_y)) |
return conbut; |
return -1; |
} |
/** Draw a PPM pixmap to framebuffer |
* |
* @param logo Pointer to PPM data |
* @param size Size of PPM data |
* @param x Coordinate of upper left corner |
* @param y Coordinate of upper left corner |
*/ |
static void draw_pixmap(char *logo, size_t size, int x, int y) |
{ |
char *shm; |
int rc; |
/* Create area */ |
shm = mmap(NULL, size, PROTO_READ | PROTO_WRITE, MAP_SHARED | |
MAP_ANONYMOUS, 0, 0); |
if (shm == MAP_FAILED) |
return; |
memcpy(shm, logo, size); |
/* Send area */ |
rc = async_req_1_0(fbphone, FB_PREPARE_SHM, (ipcarg_t) shm); |
if (rc) |
goto exit; |
rc = ipc_share_out_start(fbphone, shm, PROTO_READ); |
if (rc) |
goto drop; |
/* Draw logo */ |
async_msg_2(fbphone, FB_DRAW_PPM, x, y); |
drop: |
/* Drop area */ |
async_msg_0(fbphone, FB_DROP_SHM); |
exit: |
/* Remove area */ |
munmap(shm, size); |
} |
extern char _binary_gfx_helenos_ppm_start[0]; |
extern int _binary_gfx_helenos_ppm_size; |
extern char _binary_gfx_nameic_ppm_start[0]; |
extern int _binary_gfx_nameic_ppm_size; |
/** Redraws console graphics */ |
void gcons_redraw_console(void) |
{ |
int i; |
if (!use_gcons) |
return; |
vp_switch(0); |
set_rgb_color(MAIN_COLOR, MAIN_COLOR); |
clear(); |
draw_pixmap(_binary_gfx_helenos_ppm_start, |
(size_t) &_binary_gfx_helenos_ppm_size, xres - 66, 2); |
draw_pixmap(_binary_gfx_nameic_ppm_start, |
(size_t) &_binary_gfx_nameic_ppm_size, 5, 17); |
for (i = 0; i < CONSOLE_COUNT; i++) |
redraw_state(i); |
vp_switch(console_vp); |
} |
/** Creates a pixmap on framebuffer |
* |
* @param data PPM data |
* @param size PPM data size |
* |
* @return Pixmap identification |
* |
*/ |
static int make_pixmap(char *data, size_t size) |
{ |
char *shm; |
int rc; |
int pxid = -1; |
/* Create area */ |
shm = mmap(NULL, size, PROTO_READ | PROTO_WRITE, MAP_SHARED | |
MAP_ANONYMOUS, 0, 0); |
if (shm == MAP_FAILED) |
return -1; |
memcpy(shm, data, size); |
/* Send area */ |
rc = async_req_1_0(fbphone, FB_PREPARE_SHM, (ipcarg_t) shm); |
if (rc) |
goto exit; |
rc = ipc_share_out_start(fbphone, shm, PROTO_READ); |
if (rc) |
goto drop; |
/* Obtain pixmap */ |
rc = async_req_0_0(fbphone, FB_SHM2PIXMAP); |
if (rc < 0) |
goto drop; |
pxid = rc; |
drop: |
/* Drop area */ |
async_msg_0(fbphone, FB_DROP_SHM); |
exit: |
/* Remove area */ |
munmap(shm, size); |
return pxid; |
} |
extern char _binary_gfx_anim_1_ppm_start[0]; |
extern int _binary_gfx_anim_1_ppm_size; |
extern char _binary_gfx_anim_2_ppm_start[0]; |
extern int _binary_gfx_anim_2_ppm_size; |
extern char _binary_gfx_anim_3_ppm_start[0]; |
extern int _binary_gfx_anim_3_ppm_size; |
extern char _binary_gfx_anim_4_ppm_start[0]; |
extern int _binary_gfx_anim_4_ppm_size; |
static void make_anim(void) |
{ |
int an = async_req_1_0(fbphone, FB_ANIM_CREATE, cstatus_vp[KERNEL_CONSOLE]); |
if (an < 0) |
return; |
int pm = make_pixmap(_binary_gfx_anim_1_ppm_start, |
(int) &_binary_gfx_anim_1_ppm_size); |
async_msg_2(fbphone, FB_ANIM_ADDPIXMAP, an, pm); |
pm = make_pixmap(_binary_gfx_anim_2_ppm_start, |
(int) &_binary_gfx_anim_2_ppm_size); |
async_msg_2(fbphone, FB_ANIM_ADDPIXMAP, an, pm); |
pm = make_pixmap(_binary_gfx_anim_3_ppm_start, |
(int) &_binary_gfx_anim_3_ppm_size); |
async_msg_2(fbphone, FB_ANIM_ADDPIXMAP, an, pm); |
pm = make_pixmap(_binary_gfx_anim_4_ppm_start, |
(int) &_binary_gfx_anim_4_ppm_size); |
async_msg_2(fbphone, FB_ANIM_ADDPIXMAP, an, pm); |
async_msg_1(fbphone, FB_ANIM_START, an); |
animation = an; |
} |
extern char _binary_gfx_cons_selected_ppm_start[0]; |
extern int _binary_gfx_cons_selected_ppm_size; |
extern char _binary_gfx_cons_idle_ppm_start[0]; |
extern int _binary_gfx_cons_idle_ppm_size; |
extern char _binary_gfx_cons_has_data_ppm_start[0]; |
extern int _binary_gfx_cons_has_data_ppm_size; |
extern char _binary_gfx_cons_kernel_ppm_start[0]; |
extern int _binary_gfx_cons_kernel_ppm_size; |
/** Initialize nice graphical console environment */ |
void gcons_init(int phone) |
{ |
fbphone = phone; |
int rc = async_req_0_2(phone, FB_GET_RESOLUTION, &xres, &yres); |
if (rc) |
return; |
if ((xres < 800) || (yres < 600)) |
return; |
/* Create console viewport */ |
/* Align width & height to character size */ |
console_vp = vp_create(CONSOLE_MARGIN, CONSOLE_TOP, |
ALIGN_DOWN(xres - 2 * CONSOLE_MARGIN, 8), |
ALIGN_DOWN(yres - (CONSOLE_TOP + CONSOLE_MARGIN), 16)); |
if (console_vp < 0) |
return; |
/* Create status buttons */ |
size_t status_start = STATUS_START + (xres - 800) / 2; |
size_t i; |
for (i = 0; i < CONSOLE_COUNT; i++) { |
cstatus_vp[i] = vp_create(status_start + CONSOLE_MARGIN + |
i * (STATUS_WIDTH + STATUS_SPACE), STATUS_TOP, |
STATUS_WIDTH, STATUS_HEIGHT); |
if (cstatus_vp[i] < 0) |
return; |
vp_switch(cstatus_vp[i]); |
set_rgb_color(0x202020, 0xffffff); |
} |
/* Initialize icons */ |
ic_pixmaps[CONS_SELECTED] = |
make_pixmap(_binary_gfx_cons_selected_ppm_start, |
(size_t) &_binary_gfx_cons_selected_ppm_size); |
ic_pixmaps[CONS_IDLE] = |
make_pixmap(_binary_gfx_cons_idle_ppm_start, |
(size_t) &_binary_gfx_cons_idle_ppm_size); |
ic_pixmaps[CONS_HAS_DATA] = |
make_pixmap(_binary_gfx_cons_has_data_ppm_start, |
(size_t) &_binary_gfx_cons_has_data_ppm_size); |
ic_pixmaps[CONS_DISCONNECTED] = |
make_pixmap(_binary_gfx_cons_idle_ppm_start, |
(size_t) &_binary_gfx_cons_idle_ppm_size); |
ic_pixmaps[CONS_KERNEL] = |
make_pixmap(_binary_gfx_cons_kernel_ppm_start, |
(size_t) &_binary_gfx_cons_kernel_ppm_size); |
ic_pixmaps[CONS_DISCONNECTED_SEL] = ic_pixmaps[CONS_SELECTED]; |
make_anim(); |
use_gcons = true; |
console_state[0] = CONS_DISCONNECTED_SEL; |
console_state[KERNEL_CONSOLE] = CONS_KERNEL; |
vp_switch(console_vp); |
} |
/** @} |
*/ |
//branches/snapshot/uspace/srv/console/gcons.h |
---|
0,0 → 1,56 |
/* |
* Copyright (c) 2006 Ondrej Palkovsky |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup console |
* @{ |
*/ |
/** @file |
*/ |
#ifndef GCONS_H_ |
#define GCONS_H_ |
#include <sys/types.h> |
void gcons_init(int phone); |
void gcons_redraw_console(void); |
void gcons_change_console(size_t index); |
void gcons_notify_char(size_t index); |
void gcons_in_kernel(void); |
void gcons_notify_connect(size_t index); |
void gcons_notify_disconnect(size_t index); |
void gcons_mouse_move(ssize_t dx, ssize_t dy); |
int gcons_mouse_btn(bool state); |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/srv/console/screenbuffer.c |
---|
0,0 → 1,191 |
/* |
* Copyright (c) 2006 Josef Cejka |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup console |
* @{ |
*/ |
/** @file |
*/ |
#include <screenbuffer.h> |
#include <io/style.h> |
#include <malloc.h> |
#include <unistd.h> |
/** Store one character to screenbuffer. |
* |
* Its position is determined by scr->position_x |
* and scr->position_y. |
* |
* @param scr Screenbuffer |
* @param c Stored character |
* |
*/ |
void screenbuffer_putchar(screenbuffer_t *scr, wchar_t ch) |
{ |
keyfield_t *field = |
get_field_at(scr, scr->position_x, scr->position_y); |
field->character = ch; |
field->attrs = scr->attrs; |
} |
/** Initilize screenbuffer. |
* |
* Allocate space for screen content in accordance to given size. |
* |
* @param scr Initialized screenbuffer |
* @param size_x Width in characters |
* @param size_y Height in characters |
* |
* @return Pointer to screenbuffer (same as scr parameter) or NULL |
* |
*/ |
screenbuffer_t *screenbuffer_init(screenbuffer_t *scr, size_t size_x, size_t size_y) |
{ |
scr->buffer = (keyfield_t *) malloc(sizeof(keyfield_t) * size_x * size_y); |
if (!scr->buffer) |
return NULL; |
scr->size_x = size_x; |
scr->size_y = size_y; |
scr->attrs.t = at_style; |
scr->attrs.a.s.style = STYLE_NORMAL; |
scr->is_cursor_visible = 1; |
screenbuffer_clear(scr); |
return scr; |
} |
/** Clear screenbuffer. |
* |
* @param scr Screenbuffer |
* |
*/ |
void screenbuffer_clear(screenbuffer_t *scr) |
{ |
size_t i; |
for (i = 0; i < (scr->size_x * scr->size_y); i++) { |
scr->buffer[i].character = ' '; |
scr->buffer[i].attrs = scr->attrs; |
} |
scr->top_line = 0; |
scr->position_x = 0; |
scr->position_y = 0; |
} |
/** Clear one buffer line. |
* |
* @param scr |
* @param line One buffer line (not a screen line!) |
* |
*/ |
void screenbuffer_clear_line(screenbuffer_t *scr, size_t line) |
{ |
size_t x; |
for (x = 0; x < scr->size_x; x++) { |
scr->buffer[x + line * scr->size_x].character = ' '; |
scr->buffer[x + line * scr->size_x].attrs = scr->attrs; |
} |
} |
/** Copy content buffer from screenbuffer to given memory. |
* |
* @param scr Source screenbuffer |
* @param dest Destination |
* |
*/ |
void screenbuffer_copy_buffer(screenbuffer_t *scr, keyfield_t *dest) |
{ |
size_t i; |
for (i = 0; i < (scr->size_x * scr->size_y); i++) |
dest[i] = scr->buffer[i]; |
} |
/** Set new cursor position in screenbuffer. |
* |
* @param scr |
* @param x |
* @param y |
* |
*/ |
void screenbuffer_goto(screenbuffer_t *scr, size_t x, size_t y) |
{ |
scr->position_x = x % scr->size_x; |
scr->position_y = y % scr->size_y; |
} |
/** Set new style. |
* |
* @param scr |
* @param fg_color |
* @param bg_color |
* |
*/ |
void screenbuffer_set_style(screenbuffer_t *scr, uint8_t style) |
{ |
scr->attrs.t = at_style; |
scr->attrs.a.s.style = style; |
} |
/** Set new color. |
* |
* @param scr |
* @param fg_color |
* @param bg_color |
* |
*/ |
void screenbuffer_set_color(screenbuffer_t *scr, uint8_t fg_color, uint8_t bg_color, uint8_t flags) |
{ |
scr->attrs.t = at_idx; |
scr->attrs.a.i.fg_color = fg_color; |
scr->attrs.a.i.bg_color = bg_color; |
scr->attrs.a.i.flags = flags; |
} |
/** Set new RGB color. |
* |
* @param scr |
* @param fg_color |
* @param bg_color |
* |
*/ |
void screenbuffer_set_rgb_color(screenbuffer_t *scr, uint32_t fg_color, uint32_t bg_color) |
{ |
scr->attrs.t = at_rgb; |
scr->attrs.a.r.fg_color = fg_color; |
scr->attrs.a.r.bg_color = bg_color; |
} |
/** @} |
*/ |
//branches/snapshot/uspace/srv/console/Makefile |
---|
0,0 → 1,99 |
# |
# Copyright (c) 2005 Martin Decky |
# All rights reserved. |
# |
# Redistribution and use in source and binary forms, with or without |
# modification, are permitted provided that the following conditions |
# are met: |
# |
# - Redistributions of source code must retain the above copyright |
# notice, this list of conditions and the following disclaimer. |
# - 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. |
# - The name of the author may not be used to endorse or promote products |
# derived from this software without specific prior written permission. |
# |
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
# |
## Setup toolchain |
# |
LIBC_PREFIX = ../../lib/libc |
SOFTINT_PREFIX = ../../lib/softint |
include $(LIBC_PREFIX)/Makefile.toolchain |
CFLAGS += -I. -I../kbd/include -I../fb |
LIBS = $(LIBC_PREFIX)/libc.a |
## Sources |
# |
OUTPUT = console |
GENERIC_SOURCES = \ |
console.c \ |
screenbuffer.c \ |
../kbd/generic/keybuffer.c \ |
gcons.c |
IMAGES = \ |
gfx/helenos.ppm \ |
gfx/nameic.ppm \ |
gfx/cons_selected.ppm \ |
gfx/cons_idle.ppm \ |
gfx/cons_has_data.ppm \ |
gfx/cons_kernel.ppm \ |
gfx/anim_1.ppm \ |
gfx/anim_2.ppm \ |
gfx/anim_3.ppm \ |
gfx/anim_4.ppm |
GENERIC_OBJECTS := $(addsuffix .o,$(basename $(GENERIC_SOURCES))) \ |
$(addsuffix .o,$(basename $(IMAGES))) |
OBJECTS := $(GENERIC_OBJECTS) |
.PHONY: all clean depend disasm |
all: $(OUTPUT) $(OUTPUT).disasm |
-include Makefile.depend |
clean: |
-rm -f $(OUTPUT) $(OUTPUT).map $(OUTPUT).disasm Makefile.depend $(OBJECTS) |
depend: |
$(CC) $(DEFS) $(CFLAGS) -M $(SOURCES) > Makefile.depend |
$(OUTPUT): $(OBJECTS) $(LIBS) |
$(LD) -T $(LIBC_PREFIX)/arch/$(UARCH)/_link.ld $(OBJECTS) $(LIBS) $(LFLAGS) -o $@ -Map $(OUTPUT).map |
disasm: $(OUTPUT).disasm |
$(OUTPUT).disasm: $(OUTPUT) |
$(OBJDUMP) -d $< > $@ |
%.o: %.S |
$(CC) $(DEFS) $(AFLAGS) $(CFLAGS) -D__ASM__ -c $< -o $@ |
%.o: %.s |
$(AS) $(AFLAGS) $< -o $@ |
%.o: %.c |
$(CC) $(DEFS) $(CFLAGS) -c $< -o $@ |
%.o: %.ppm |
$(OBJCOPY) -I binary -O $(BFD_NAME) -B $(BFD_ARCH) $< $@ |
//branches/snapshot/uspace/srv/console/gfx/anim_1.ppm |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
//branches/snapshot/uspace/srv/console/gfx/anim_2.ppm |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
//branches/snapshot/uspace/srv/console/gfx/anim_3.ppm |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
//branches/snapshot/uspace/srv/console/gfx/cons_has_data.ppm |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
//branches/snapshot/uspace/srv/console/gfx/anim_4.ppm |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
//branches/snapshot/uspace/srv/console/gfx/cons_selected.ppm |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
//branches/snapshot/uspace/srv/console/gfx/nameic.ppm |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
//branches/snapshot/uspace/srv/console/gfx/helenos.ppm |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
//branches/snapshot/uspace/srv/console/gfx/cons_idle.ppm |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
//branches/snapshot/uspace/srv/console/gfx/cons_kernel.ppm |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
//branches/snapshot/uspace/srv/console/console.h |
---|
0,0 → 1,44 |
/* |
* Copyright (c) 2006 Josef Cejka |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup console |
* @{ |
*/ |
/** @file |
*/ |
#ifndef __CONSOLE_H__ |
#define __CONSOLE_H__ |
#define CONSOLE_COUNT 12 |
#define KERNEL_CONSOLE 11 |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/srv/vfs/vfs_ops.c |
---|
0,0 → 1,1309 |
/* |
* Copyright (c) 2008 Jakub Jermar |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup fs |
* @{ |
*/ |
/** |
* @file vfs_ops.c |
* @brief Operations that VFS offers to its clients. |
*/ |
#include "vfs.h" |
#include <ipc/ipc.h> |
#include <async.h> |
#include <errno.h> |
#include <stdio.h> |
#include <stdlib.h> |
#include <string.h> |
#include <bool.h> |
#include <fibril_sync.h> |
#include <adt/list.h> |
#include <unistd.h> |
#include <ctype.h> |
#include <fcntl.h> |
#include <assert.h> |
#include <vfs/canonify.h> |
/* Forward declarations of static functions. */ |
static int vfs_truncate_internal(fs_handle_t, dev_handle_t, fs_index_t, size_t); |
/** |
* This rwlock prevents the race between a triplet-to-VFS-node resolution and a |
* concurrent VFS operation which modifies the file system namespace. |
*/ |
FIBRIL_RWLOCK_INITIALIZE(namespace_rwlock); |
vfs_pair_t rootfs = { |
.fs_handle = 0, |
.dev_handle = 0 |
}; |
static void vfs_mount_internal(ipc_callid_t rid, dev_handle_t dev_handle, |
fs_handle_t fs_handle, char *mp, char *opts) |
{ |
vfs_lookup_res_t mp_res; |
vfs_lookup_res_t mr_res; |
vfs_node_t *mp_node = NULL; |
vfs_node_t *mr_node; |
fs_index_t rindex; |
size_t rsize; |
unsigned rlnkcnt; |
ipcarg_t rc; |
int phone; |
aid_t msg; |
ipc_call_t answer; |
/* Resolve the path to the mountpoint. */ |
fibril_rwlock_write_lock(&namespace_rwlock); |
if (rootfs.fs_handle) { |
/* We already have the root FS. */ |
if (str_cmp(mp, "/") == 0) { |
/* Trying to mount root FS over root FS */ |
fibril_rwlock_write_unlock(&namespace_rwlock); |
ipc_answer_0(rid, EBUSY); |
return; |
} |
rc = vfs_lookup_internal(mp, L_DIRECTORY, &mp_res, NULL); |
if (rc != EOK) { |
/* The lookup failed for some reason. */ |
fibril_rwlock_write_unlock(&namespace_rwlock); |
ipc_answer_0(rid, rc); |
return; |
} |
mp_node = vfs_node_get(&mp_res); |
if (!mp_node) { |
fibril_rwlock_write_unlock(&namespace_rwlock); |
ipc_answer_0(rid, ENOMEM); |
return; |
} |
/* |
* Now we hold a reference to mp_node. |
* It will be dropped upon the corresponding VFS_IN_UNMOUNT. |
* This prevents the mount point from being deleted. |
*/ |
} else { |
/* We still don't have the root file system mounted. */ |
if (str_cmp(mp, "/") == 0) { |
/* |
* For this simple, but important case, |
* we are almost done. |
*/ |
/* Tell the mountee that it is being mounted. */ |
phone = vfs_grab_phone(fs_handle); |
msg = async_send_1(phone, VFS_OUT_MOUNTED, |
(ipcarg_t) dev_handle, &answer); |
/* send the mount options */ |
rc = ipc_data_write_start(phone, (void *)opts, |
str_size(opts)); |
if (rc != EOK) { |
async_wait_for(msg, NULL); |
vfs_release_phone(phone); |
fibril_rwlock_write_unlock(&namespace_rwlock); |
ipc_answer_0(rid, rc); |
return; |
} |
async_wait_for(msg, &rc); |
vfs_release_phone(phone); |
if (rc != EOK) { |
fibril_rwlock_write_unlock(&namespace_rwlock); |
ipc_answer_0(rid, rc); |
return; |
} |
rindex = (fs_index_t) IPC_GET_ARG1(answer); |
rsize = (size_t) IPC_GET_ARG2(answer); |
rlnkcnt = (unsigned) IPC_GET_ARG3(answer); |
mr_res.triplet.fs_handle = fs_handle; |
mr_res.triplet.dev_handle = dev_handle; |
mr_res.triplet.index = rindex; |
mr_res.size = rsize; |
mr_res.lnkcnt = rlnkcnt; |
mr_res.type = VFS_NODE_DIRECTORY; |
rootfs.fs_handle = fs_handle; |
rootfs.dev_handle = dev_handle; |
/* Add reference to the mounted root. */ |
mr_node = vfs_node_get(&mr_res); |
assert(mr_node); |
fibril_rwlock_write_unlock(&namespace_rwlock); |
ipc_answer_0(rid, rc); |
return; |
} else { |
/* |
* We can't resolve this without the root filesystem |
* being mounted first. |
*/ |
fibril_rwlock_write_unlock(&namespace_rwlock); |
ipc_answer_0(rid, ENOENT); |
return; |
} |
} |
/* |
* At this point, we have all necessary pieces: file system and device |
* handles, and we know the mount point VFS node. |
*/ |
int mountee_phone = vfs_grab_phone(fs_handle); |
assert(mountee_phone >= 0); |
phone = vfs_grab_phone(mp_res.triplet.fs_handle); |
msg = async_send_4(phone, VFS_OUT_MOUNT, |
(ipcarg_t) mp_res.triplet.dev_handle, |
(ipcarg_t) mp_res.triplet.index, |
(ipcarg_t) fs_handle, |
(ipcarg_t) dev_handle, &answer); |
/* send connection */ |
rc = async_req_1_0(phone, IPC_M_CONNECTION_CLONE, mountee_phone); |
if (rc != EOK) { |
async_wait_for(msg, NULL); |
vfs_release_phone(mountee_phone); |
vfs_release_phone(phone); |
/* Mount failed, drop reference to mp_node. */ |
if (mp_node) |
vfs_node_put(mp_node); |
ipc_answer_0(rid, rc); |
fibril_rwlock_write_unlock(&namespace_rwlock); |
return; |
} |
vfs_release_phone(mountee_phone); |
/* send the mount options */ |
rc = ipc_data_write_start(phone, (void *)opts, str_size(opts)); |
if (rc != EOK) { |
async_wait_for(msg, NULL); |
vfs_release_phone(phone); |
/* Mount failed, drop reference to mp_node. */ |
if (mp_node) |
vfs_node_put(mp_node); |
fibril_rwlock_write_unlock(&namespace_rwlock); |
ipc_answer_0(rid, rc); |
return; |
} |
async_wait_for(msg, &rc); |
vfs_release_phone(phone); |
if (rc == EOK) { |
rindex = (fs_index_t) IPC_GET_ARG1(answer); |
rsize = (size_t) IPC_GET_ARG2(answer); |
rlnkcnt = (unsigned) IPC_GET_ARG3(answer); |
mr_res.triplet.fs_handle = fs_handle; |
mr_res.triplet.dev_handle = dev_handle; |
mr_res.triplet.index = rindex; |
mr_res.size = rsize; |
mr_res.lnkcnt = rlnkcnt; |
mr_res.type = VFS_NODE_DIRECTORY; |
/* Add reference to the mounted root. */ |
mr_node = vfs_node_get(&mr_res); |
assert(mr_node); |
} else { |
/* Mount failed, drop reference to mp_node. */ |
if (mp_node) |
vfs_node_put(mp_node); |
} |
ipc_answer_0(rid, rc); |
fibril_rwlock_write_unlock(&namespace_rwlock); |
} |
void vfs_mount(ipc_callid_t rid, ipc_call_t *request) |
{ |
/* |
* We expect the library to do the device-name to device-handle |
* translation for us, thus the device handle will arrive as ARG1 |
* in the request. |
*/ |
dev_handle_t dev_handle = (dev_handle_t) IPC_GET_ARG1(*request); |
/* |
* Mount flags are passed as ARG2. |
*/ |
unsigned int flags = (unsigned int) IPC_GET_ARG2(*request); |
/* |
* For now, don't make use of ARG3, but it can be used to |
* carry mount options in the future. |
*/ |
/* We want the client to send us the mount point. */ |
ipc_callid_t callid; |
size_t size; |
if (!ipc_data_write_receive(&callid, &size)) { |
ipc_answer_0(callid, EINVAL); |
ipc_answer_0(rid, EINVAL); |
return; |
} |
/* Check whether size is reasonable wrt. the mount point. */ |
if ((size < 1) || (size > MAX_PATH_LEN)) { |
ipc_answer_0(callid, EINVAL); |
ipc_answer_0(rid, EINVAL); |
return; |
} |
/* Allocate buffer for the mount point data being received. */ |
char *mp = malloc(size + 1); |
if (!mp) { |
ipc_answer_0(callid, ENOMEM); |
ipc_answer_0(rid, ENOMEM); |
return; |
} |
/* Deliver the mount point. */ |
ipcarg_t retval = ipc_data_write_finalize(callid, mp, size); |
if (retval != EOK) { |
ipc_answer_0(rid, retval); |
free(mp); |
return; |
} |
mp[size] = '\0'; |
/* Now we expect to receive the mount options. */ |
if (!ipc_data_write_receive(&callid, &size)) { |
ipc_answer_0(callid, EINVAL); |
ipc_answer_0(rid, EINVAL); |
free(mp); |
return; |
} |
/* Check the offered options size. */ |
if (size < 0 || size > MAX_MNTOPTS_LEN) { |
ipc_answer_0(callid, EINVAL); |
ipc_answer_0(rid, EINVAL); |
free(mp); |
return; |
} |
/* Allocate buffer for the mount options. */ |
char *opts = (char *) malloc(size + 1); |
if (!opts) { |
ipc_answer_0(callid, ENOMEM); |
ipc_answer_0(rid, ENOMEM); |
free(mp); |
return; |
} |
/* Deliver the mount options. */ |
retval = ipc_data_write_finalize(callid, opts, size); |
if (retval != EOK) { |
ipc_answer_0(rid, retval); |
free(mp); |
free(opts); |
return; |
} |
opts[size] = '\0'; |
/* |
* Now, we expect the client to send us data with the name of the file |
* system. |
*/ |
if (!ipc_data_write_receive(&callid, &size)) { |
ipc_answer_0(callid, EINVAL); |
ipc_answer_0(rid, EINVAL); |
free(mp); |
free(opts); |
return; |
} |
/* |
* Don't receive more than is necessary for storing a full file system |
* name. |
*/ |
if ((size < 1) || (size > FS_NAME_MAXLEN)) { |
ipc_answer_0(callid, EINVAL); |
ipc_answer_0(rid, EINVAL); |
free(mp); |
free(opts); |
return; |
} |
/* |
* Allocate buffer for file system name. |
*/ |
char *fs_name = (char *) malloc(size + 1); |
if (fs_name == NULL) { |
ipc_answer_0(callid, ENOMEM); |
ipc_answer_0(rid, ENOMEM); |
free(mp); |
free(opts); |
return; |
} |
/* Deliver the file system name. */ |
retval = ipc_data_write_finalize(callid, fs_name, size); |
if (retval != EOK) { |
ipc_answer_0(rid, retval); |
free(mp); |
free(opts); |
free(fs_name); |
return; |
} |
fs_name[size] = '\0'; |
/* |
* Wait for IPC_M_PING so that we can return an error if we don't know |
* fs_name. |
*/ |
ipc_call_t data; |
callid = async_get_call(&data); |
if (IPC_GET_METHOD(data) != IPC_M_PING) { |
ipc_answer_0(callid, ENOTSUP); |
ipc_answer_0(rid, ENOTSUP); |
free(mp); |
free(opts); |
free(fs_name); |
return; |
} |
/* |
* Check if we know a file system with the same name as is in fs_name. |
* This will also give us its file system handle. |
*/ |
fibril_mutex_lock(&fs_head_lock); |
fs_handle_t fs_handle; |
recheck: |
fs_handle = fs_name_to_handle(fs_name, false); |
if (!fs_handle) { |
if (flags & IPC_FLAG_BLOCKING) { |
fibril_condvar_wait(&fs_head_cv, &fs_head_lock); |
goto recheck; |
} |
fibril_mutex_unlock(&fs_head_lock); |
ipc_answer_0(callid, ENOENT); |
ipc_answer_0(rid, ENOENT); |
free(mp); |
free(fs_name); |
free(opts); |
return; |
} |
fibril_mutex_unlock(&fs_head_lock); |
/* Acknowledge that we know fs_name. */ |
ipc_answer_0(callid, EOK); |
/* Do the mount */ |
vfs_mount_internal(rid, dev_handle, fs_handle, mp, opts); |
free(mp); |
free(fs_name); |
free(opts); |
} |
void vfs_open(ipc_callid_t rid, ipc_call_t *request) |
{ |
if (!vfs_files_init()) { |
ipc_answer_0(rid, ENOMEM); |
return; |
} |
/* |
* The POSIX interface is open(path, oflag, mode). |
* We can receive oflags and mode along with the VFS_IN_OPEN call; |
* the path will need to arrive in another call. |
* |
* We also receive one private, non-POSIX set of flags called lflag |
* used to pass information to vfs_lookup_internal(). |
*/ |
int lflag = IPC_GET_ARG1(*request); |
int oflag = IPC_GET_ARG2(*request); |
int mode = IPC_GET_ARG3(*request); |
size_t len; |
/* |
* Make sure that we are called with exactly one of L_FILE and |
* L_DIRECTORY. Make sure that the user does not pass L_OPEN. |
*/ |
if (((lflag & (L_FILE | L_DIRECTORY)) == 0) || |
((lflag & (L_FILE | L_DIRECTORY)) == (L_FILE | L_DIRECTORY)) || |
((lflag & L_OPEN) != 0)) { |
ipc_answer_0(rid, EINVAL); |
return; |
} |
if (oflag & O_CREAT) |
lflag |= L_CREATE; |
if (oflag & O_EXCL) |
lflag |= L_EXCLUSIVE; |
ipc_callid_t callid; |
if (!ipc_data_write_receive(&callid, &len)) { |
ipc_answer_0(callid, EINVAL); |
ipc_answer_0(rid, EINVAL); |
return; |
} |
char *path = malloc(len + 1); |
if (!path) { |
ipc_answer_0(callid, ENOMEM); |
ipc_answer_0(rid, ENOMEM); |
return; |
} |
int rc; |
if ((rc = ipc_data_write_finalize(callid, path, len))) { |
ipc_answer_0(rid, rc); |
free(path); |
return; |
} |
path[len] = '\0'; |
/* |
* Avoid the race condition in which the file can be deleted before we |
* find/create-and-lock the VFS node corresponding to the looked-up |
* triplet. |
*/ |
if (lflag & L_CREATE) |
fibril_rwlock_write_lock(&namespace_rwlock); |
else |
fibril_rwlock_read_lock(&namespace_rwlock); |
/* The path is now populated and we can call vfs_lookup_internal(). */ |
vfs_lookup_res_t lr; |
rc = vfs_lookup_internal(path, lflag | L_OPEN, &lr, NULL); |
if (rc != EOK) { |
if (lflag & L_CREATE) |
fibril_rwlock_write_unlock(&namespace_rwlock); |
else |
fibril_rwlock_read_unlock(&namespace_rwlock); |
ipc_answer_0(rid, rc); |
free(path); |
return; |
} |
/* Path is no longer needed. */ |
free(path); |
vfs_node_t *node = vfs_node_get(&lr); |
if (lflag & L_CREATE) |
fibril_rwlock_write_unlock(&namespace_rwlock); |
else |
fibril_rwlock_read_unlock(&namespace_rwlock); |
/* Truncate the file if requested and if necessary. */ |
if (oflag & O_TRUNC) { |
fibril_rwlock_write_lock(&node->contents_rwlock); |
if (node->size) { |
rc = vfs_truncate_internal(node->fs_handle, |
node->dev_handle, node->index, 0); |
if (rc) { |
fibril_rwlock_write_unlock(&node->contents_rwlock); |
vfs_node_put(node); |
ipc_answer_0(rid, rc); |
return; |
} |
node->size = 0; |
} |
fibril_rwlock_write_unlock(&node->contents_rwlock); |
} |
/* |
* Get ourselves a file descriptor and the corresponding vfs_file_t |
* structure. |
*/ |
int fd = vfs_fd_alloc(); |
if (fd < 0) { |
vfs_node_put(node); |
ipc_answer_0(rid, fd); |
return; |
} |
vfs_file_t *file = vfs_file_get(fd); |
file->node = node; |
if (oflag & O_APPEND) |
file->append = true; |
/* |
* The following increase in reference count is for the fact that the |
* file is being opened and that a file structure is pointing to it. |
* It is necessary so that the file will not disappear when |
* vfs_node_put() is called. The reference will be dropped by the |
* respective VFS_IN_CLOSE. |
*/ |
vfs_node_addref(node); |
vfs_node_put(node); |
/* Success! Return the new file descriptor to the client. */ |
ipc_answer_1(rid, EOK, fd); |
} |
void vfs_open_node(ipc_callid_t rid, ipc_call_t *request) |
{ |
// FIXME: check for sanity of the supplied fs, dev and index |
if (!vfs_files_init()) { |
ipc_answer_0(rid, ENOMEM); |
return; |
} |
/* |
* The interface is open_node(fs, dev, index, oflag). |
*/ |
vfs_lookup_res_t lr; |
lr.triplet.fs_handle = IPC_GET_ARG1(*request); |
lr.triplet.dev_handle = IPC_GET_ARG2(*request); |
lr.triplet.index = IPC_GET_ARG3(*request); |
int oflag = IPC_GET_ARG4(*request); |
fibril_rwlock_read_lock(&namespace_rwlock); |
int rc = vfs_open_node_internal(&lr); |
if (rc != EOK) { |
fibril_rwlock_read_unlock(&namespace_rwlock); |
ipc_answer_0(rid, rc); |
return; |
} |
vfs_node_t *node = vfs_node_get(&lr); |
fibril_rwlock_read_unlock(&namespace_rwlock); |
/* Truncate the file if requested and if necessary. */ |
if (oflag & O_TRUNC) { |
fibril_rwlock_write_lock(&node->contents_rwlock); |
if (node->size) { |
rc = vfs_truncate_internal(node->fs_handle, |
node->dev_handle, node->index, 0); |
if (rc) { |
fibril_rwlock_write_unlock(&node->contents_rwlock); |
vfs_node_put(node); |
ipc_answer_0(rid, rc); |
return; |
} |
node->size = 0; |
} |
fibril_rwlock_write_unlock(&node->contents_rwlock); |
} |
/* |
* Get ourselves a file descriptor and the corresponding vfs_file_t |
* structure. |
*/ |
int fd = vfs_fd_alloc(); |
if (fd < 0) { |
vfs_node_put(node); |
ipc_answer_0(rid, fd); |
return; |
} |
vfs_file_t *file = vfs_file_get(fd); |
file->node = node; |
if (oflag & O_APPEND) |
file->append = true; |
/* |
* The following increase in reference count is for the fact that the |
* file is being opened and that a file structure is pointing to it. |
* It is necessary so that the file will not disappear when |
* vfs_node_put() is called. The reference will be dropped by the |
* respective VFS_IN_CLOSE. |
*/ |
vfs_node_addref(node); |
vfs_node_put(node); |
/* Success! Return the new file descriptor to the client. */ |
ipc_answer_1(rid, EOK, fd); |
} |
void vfs_sync(ipc_callid_t rid, ipc_call_t *request) |
{ |
int fd = IPC_GET_ARG1(*request); |
/* Lookup the file structure corresponding to the file descriptor. */ |
vfs_file_t *file = vfs_file_get(fd); |
if (!file) { |
ipc_answer_0(rid, ENOENT); |
return; |
} |
/* |
* Lock the open file structure so that no other thread can manipulate |
* the same open file at a time. |
*/ |
fibril_mutex_lock(&file->lock); |
int fs_phone = vfs_grab_phone(file->node->fs_handle); |
/* Make a VFS_OUT_SYMC request at the destination FS server. */ |
aid_t msg; |
ipc_call_t answer; |
msg = async_send_2(fs_phone, VFS_OUT_SYNC, file->node->dev_handle, |
file->node->index, &answer); |
/* Wait for reply from the FS server. */ |
ipcarg_t rc; |
async_wait_for(msg, &rc); |
vfs_release_phone(fs_phone); |
fibril_mutex_unlock(&file->lock); |
ipc_answer_0(rid, rc); |
} |
void vfs_close(ipc_callid_t rid, ipc_call_t *request) |
{ |
int fd = IPC_GET_ARG1(*request); |
/* Lookup the file structure corresponding to the file descriptor. */ |
vfs_file_t *file = vfs_file_get(fd); |
if (!file) { |
ipc_answer_0(rid, ENOENT); |
return; |
} |
/* |
* Lock the open file structure so that no other thread can manipulate |
* the same open file at a time. |
*/ |
fibril_mutex_lock(&file->lock); |
int fs_phone = vfs_grab_phone(file->node->fs_handle); |
/* Make a VFS_OUT_CLOSE request at the destination FS server. */ |
aid_t msg; |
ipc_call_t answer; |
msg = async_send_2(fs_phone, VFS_OUT_CLOSE, file->node->dev_handle, |
file->node->index, &answer); |
/* Wait for reply from the FS server. */ |
ipcarg_t rc; |
async_wait_for(msg, &rc); |
vfs_release_phone(fs_phone); |
fibril_mutex_unlock(&file->lock); |
int retval = IPC_GET_ARG1(answer); |
if (retval != EOK) |
ipc_answer_0(rid, retval); |
retval = vfs_fd_free(fd); |
ipc_answer_0(rid, retval); |
} |
static void vfs_rdwr(ipc_callid_t rid, ipc_call_t *request, bool read) |
{ |
/* |
* The following code strongly depends on the fact that the files data |
* structure can be only accessed by a single fibril and all file |
* operations are serialized (i.e. the reads and writes cannot |
* interleave and a file cannot be closed while it is being read). |
* |
* Additional synchronization needs to be added once the table of |
* open files supports parallel access! |
*/ |
int fd = IPC_GET_ARG1(*request); |
/* Lookup the file structure corresponding to the file descriptor. */ |
vfs_file_t *file = vfs_file_get(fd); |
if (!file) { |
ipc_answer_0(rid, ENOENT); |
return; |
} |
/* |
* Now we need to receive a call with client's |
* IPC_M_DATA_READ/IPC_M_DATA_WRITE request. |
*/ |
ipc_callid_t callid; |
int res; |
if (read) |
res = ipc_data_read_receive(&callid, NULL); |
else |
res = ipc_data_write_receive(&callid, NULL); |
if (!res) { |
ipc_answer_0(callid, EINVAL); |
ipc_answer_0(rid, EINVAL); |
return; |
} |
/* |
* Lock the open file structure so that no other thread can manipulate |
* the same open file at a time. |
*/ |
fibril_mutex_lock(&file->lock); |
/* |
* Lock the file's node so that no other client can read/write to it at |
* the same time. |
*/ |
if (read) |
fibril_rwlock_read_lock(&file->node->contents_rwlock); |
else |
fibril_rwlock_write_lock(&file->node->contents_rwlock); |
if (file->node->type == VFS_NODE_DIRECTORY) { |
/* |
* Make sure that no one is modifying the namespace |
* while we are in readdir(). |
*/ |
assert(read); |
fibril_rwlock_read_lock(&namespace_rwlock); |
} |
int fs_phone = vfs_grab_phone(file->node->fs_handle); |
/* Make a VFS_READ/VFS_WRITE request at the destination FS server. */ |
aid_t msg; |
ipc_call_t answer; |
if (!read && file->append) |
file->pos = file->node->size; |
msg = async_send_3(fs_phone, read ? VFS_OUT_READ : VFS_OUT_WRITE, |
file->node->dev_handle, file->node->index, file->pos, &answer); |
/* |
* Forward the IPC_M_DATA_READ/IPC_M_DATA_WRITE request to the |
* destination FS server. The call will be routed as if sent by |
* ourselves. Note that call arguments are immutable in this case so we |
* don't have to bother. |
*/ |
ipc_forward_fast(callid, fs_phone, 0, 0, 0, IPC_FF_ROUTE_FROM_ME); |
/* Wait for reply from the FS server. */ |
ipcarg_t rc; |
async_wait_for(msg, &rc); |
vfs_release_phone(fs_phone); |
size_t bytes = IPC_GET_ARG1(answer); |
if (file->node->type == VFS_NODE_DIRECTORY) |
fibril_rwlock_read_unlock(&namespace_rwlock); |
/* Unlock the VFS node. */ |
if (read) |
fibril_rwlock_read_unlock(&file->node->contents_rwlock); |
else { |
/* Update the cached version of node's size. */ |
if (rc == EOK) |
file->node->size = IPC_GET_ARG2(answer); |
fibril_rwlock_write_unlock(&file->node->contents_rwlock); |
} |
/* Update the position pointer and unlock the open file. */ |
if (rc == EOK) |
file->pos += bytes; |
fibril_mutex_unlock(&file->lock); |
/* |
* FS server's reply is the final result of the whole operation we |
* return to the client. |
*/ |
ipc_answer_1(rid, rc, bytes); |
} |
void vfs_read(ipc_callid_t rid, ipc_call_t *request) |
{ |
vfs_rdwr(rid, request, true); |
} |
void vfs_write(ipc_callid_t rid, ipc_call_t *request) |
{ |
vfs_rdwr(rid, request, false); |
} |
void vfs_seek(ipc_callid_t rid, ipc_call_t *request) |
{ |
int fd = (int) IPC_GET_ARG1(*request); |
off_t off = (off_t) IPC_GET_ARG2(*request); |
int whence = (int) IPC_GET_ARG3(*request); |
/* Lookup the file structure corresponding to the file descriptor. */ |
vfs_file_t *file = vfs_file_get(fd); |
if (!file) { |
ipc_answer_0(rid, ENOENT); |
return; |
} |
off_t newpos; |
fibril_mutex_lock(&file->lock); |
if (whence == SEEK_SET) { |
file->pos = off; |
fibril_mutex_unlock(&file->lock); |
ipc_answer_1(rid, EOK, off); |
return; |
} |
if (whence == SEEK_CUR) { |
if (file->pos + off < file->pos) { |
fibril_mutex_unlock(&file->lock); |
ipc_answer_0(rid, EOVERFLOW); |
return; |
} |
file->pos += off; |
newpos = file->pos; |
fibril_mutex_unlock(&file->lock); |
ipc_answer_1(rid, EOK, newpos); |
return; |
} |
if (whence == SEEK_END) { |
fibril_rwlock_read_lock(&file->node->contents_rwlock); |
size_t size = file->node->size; |
fibril_rwlock_read_unlock(&file->node->contents_rwlock); |
if (size + off < size) { |
fibril_mutex_unlock(&file->lock); |
ipc_answer_0(rid, EOVERFLOW); |
return; |
} |
newpos = size + off; |
fibril_mutex_unlock(&file->lock); |
ipc_answer_1(rid, EOK, newpos); |
return; |
} |
fibril_mutex_unlock(&file->lock); |
ipc_answer_0(rid, EINVAL); |
} |
int |
vfs_truncate_internal(fs_handle_t fs_handle, dev_handle_t dev_handle, |
fs_index_t index, size_t size) |
{ |
ipcarg_t rc; |
int fs_phone; |
fs_phone = vfs_grab_phone(fs_handle); |
rc = async_req_3_0(fs_phone, VFS_OUT_TRUNCATE, (ipcarg_t)dev_handle, |
(ipcarg_t)index, (ipcarg_t)size); |
vfs_release_phone(fs_phone); |
return (int)rc; |
} |
void vfs_truncate(ipc_callid_t rid, ipc_call_t *request) |
{ |
int fd = IPC_GET_ARG1(*request); |
size_t size = IPC_GET_ARG2(*request); |
int rc; |
vfs_file_t *file = vfs_file_get(fd); |
if (!file) { |
ipc_answer_0(rid, ENOENT); |
return; |
} |
fibril_mutex_lock(&file->lock); |
fibril_rwlock_write_lock(&file->node->contents_rwlock); |
rc = vfs_truncate_internal(file->node->fs_handle, |
file->node->dev_handle, file->node->index, size); |
if (rc == EOK) |
file->node->size = size; |
fibril_rwlock_write_unlock(&file->node->contents_rwlock); |
fibril_mutex_unlock(&file->lock); |
ipc_answer_0(rid, (ipcarg_t)rc); |
} |
void vfs_fstat(ipc_callid_t rid, ipc_call_t *request) |
{ |
int fd = IPC_GET_ARG1(*request); |
size_t size = IPC_GET_ARG2(*request); |
ipcarg_t rc; |
vfs_file_t *file = vfs_file_get(fd); |
if (!file) { |
ipc_answer_0(rid, ENOENT); |
return; |
} |
ipc_callid_t callid; |
if (!ipc_data_read_receive(&callid, NULL)) { |
ipc_answer_0(callid, EINVAL); |
ipc_answer_0(rid, EINVAL); |
return; |
} |
fibril_mutex_lock(&file->lock); |
int fs_phone = vfs_grab_phone(file->node->fs_handle); |
aid_t msg; |
msg = async_send_3(fs_phone, VFS_OUT_STAT, file->node->dev_handle, |
file->node->index, true, NULL); |
ipc_forward_fast(callid, fs_phone, 0, 0, 0, IPC_FF_ROUTE_FROM_ME); |
async_wait_for(msg, &rc); |
vfs_release_phone(fs_phone); |
fibril_mutex_unlock(&file->lock); |
ipc_answer_0(rid, rc); |
} |
void vfs_stat(ipc_callid_t rid, ipc_call_t *request) |
{ |
size_t len; |
ipc_callid_t callid; |
if (!ipc_data_write_receive(&callid, &len)) { |
ipc_answer_0(callid, EINVAL); |
ipc_answer_0(rid, EINVAL); |
return; |
} |
char *path = malloc(len + 1); |
if (!path) { |
ipc_answer_0(callid, ENOMEM); |
ipc_answer_0(rid, ENOMEM); |
return; |
} |
int rc; |
if ((rc = ipc_data_write_finalize(callid, path, len))) { |
ipc_answer_0(rid, rc); |
free(path); |
return; |
} |
path[len] = '\0'; |
if (!ipc_data_read_receive(&callid, NULL)) { |
free(path); |
ipc_answer_0(callid, EINVAL); |
ipc_answer_0(rid, EINVAL); |
return; |
} |
vfs_lookup_res_t lr; |
fibril_rwlock_read_lock(&namespace_rwlock); |
rc = vfs_lookup_internal(path, L_NONE, &lr, NULL); |
free(path); |
if (rc != EOK) { |
fibril_rwlock_read_unlock(&namespace_rwlock); |
ipc_answer_0(callid, rc); |
ipc_answer_0(rid, rc); |
return; |
} |
vfs_node_t *node = vfs_node_get(&lr); |
if (!node) { |
fibril_rwlock_read_unlock(&namespace_rwlock); |
ipc_answer_0(callid, ENOMEM); |
ipc_answer_0(rid, ENOMEM); |
return; |
} |
fibril_rwlock_read_unlock(&namespace_rwlock); |
int fs_phone = vfs_grab_phone(node->fs_handle); |
aid_t msg; |
msg = async_send_3(fs_phone, VFS_OUT_STAT, node->dev_handle, |
node->index, false, NULL); |
ipc_forward_fast(callid, fs_phone, 0, 0, 0, IPC_FF_ROUTE_FROM_ME); |
ipcarg_t rv; |
async_wait_for(msg, &rv); |
vfs_release_phone(fs_phone); |
ipc_answer_0(rid, rv); |
vfs_node_put(node); |
} |
void vfs_mkdir(ipc_callid_t rid, ipc_call_t *request) |
{ |
int mode = IPC_GET_ARG1(*request); |
size_t len; |
ipc_callid_t callid; |
if (!ipc_data_write_receive(&callid, &len)) { |
ipc_answer_0(callid, EINVAL); |
ipc_answer_0(rid, EINVAL); |
return; |
} |
char *path = malloc(len + 1); |
if (!path) { |
ipc_answer_0(callid, ENOMEM); |
ipc_answer_0(rid, ENOMEM); |
return; |
} |
int rc; |
if ((rc = ipc_data_write_finalize(callid, path, len))) { |
ipc_answer_0(rid, rc); |
free(path); |
return; |
} |
path[len] = '\0'; |
fibril_rwlock_write_lock(&namespace_rwlock); |
int lflag = L_DIRECTORY | L_CREATE | L_EXCLUSIVE; |
rc = vfs_lookup_internal(path, lflag, NULL, NULL); |
fibril_rwlock_write_unlock(&namespace_rwlock); |
free(path); |
ipc_answer_0(rid, rc); |
} |
void vfs_unlink(ipc_callid_t rid, ipc_call_t *request) |
{ |
int lflag = IPC_GET_ARG1(*request); |
size_t len; |
ipc_callid_t callid; |
if (!ipc_data_write_receive(&callid, &len)) { |
ipc_answer_0(callid, EINVAL); |
ipc_answer_0(rid, EINVAL); |
return; |
} |
char *path = malloc(len + 1); |
if (!path) { |
ipc_answer_0(callid, ENOMEM); |
ipc_answer_0(rid, ENOMEM); |
return; |
} |
int rc; |
if ((rc = ipc_data_write_finalize(callid, path, len))) { |
ipc_answer_0(rid, rc); |
free(path); |
return; |
} |
path[len] = '\0'; |
fibril_rwlock_write_lock(&namespace_rwlock); |
lflag &= L_DIRECTORY; /* sanitize lflag */ |
vfs_lookup_res_t lr; |
rc = vfs_lookup_internal(path, lflag | L_UNLINK, &lr, NULL); |
free(path); |
if (rc != EOK) { |
fibril_rwlock_write_unlock(&namespace_rwlock); |
ipc_answer_0(rid, rc); |
return; |
} |
/* |
* The name has already been unlinked by vfs_lookup_internal(). |
* We have to get and put the VFS node to ensure that it is |
* VFS_OUT_DESTROY'ed after the last reference to it is dropped. |
*/ |
vfs_node_t *node = vfs_node_get(&lr); |
fibril_mutex_lock(&nodes_mutex); |
node->lnkcnt--; |
fibril_mutex_unlock(&nodes_mutex); |
fibril_rwlock_write_unlock(&namespace_rwlock); |
vfs_node_put(node); |
ipc_answer_0(rid, EOK); |
} |
void vfs_rename(ipc_callid_t rid, ipc_call_t *request) |
{ |
size_t olen, nlen; |
ipc_callid_t callid; |
int rc; |
/* Retrieve the old path. */ |
if (!ipc_data_write_receive(&callid, &olen)) { |
ipc_answer_0(callid, EINVAL); |
ipc_answer_0(rid, EINVAL); |
return; |
} |
char *old = malloc(olen + 1); |
if (!old) { |
ipc_answer_0(callid, ENOMEM); |
ipc_answer_0(rid, ENOMEM); |
return; |
} |
if ((rc = ipc_data_write_finalize(callid, old, olen))) { |
ipc_answer_0(rid, rc); |
free(old); |
return; |
} |
old[olen] = '\0'; |
/* Retrieve the new path. */ |
if (!ipc_data_write_receive(&callid, &nlen)) { |
ipc_answer_0(callid, EINVAL); |
ipc_answer_0(rid, EINVAL); |
free(old); |
return; |
} |
char *new = malloc(nlen + 1); |
if (!new) { |
ipc_answer_0(callid, ENOMEM); |
ipc_answer_0(rid, ENOMEM); |
free(old); |
return; |
} |
if ((rc = ipc_data_write_finalize(callid, new, nlen))) { |
ipc_answer_0(rid, rc); |
free(old); |
free(new); |
return; |
} |
new[nlen] = '\0'; |
char *oldc = canonify(old, &olen); |
char *newc = canonify(new, &nlen); |
if (!oldc || !newc) { |
ipc_answer_0(rid, EINVAL); |
free(old); |
free(new); |
return; |
} |
oldc[olen] = '\0'; |
newc[nlen] = '\0'; |
if ((!str_lcmp(newc, oldc, str_length(oldc))) && |
((newc[str_length(oldc)] == '/') || |
(str_length(oldc) == 1) || |
(str_length(oldc) == str_length(newc)))) { |
/* |
* oldc is a prefix of newc and either |
* - newc continues with a / where oldc ends, or |
* - oldc was / itself, or |
* - oldc and newc are equal. |
*/ |
ipc_answer_0(rid, EINVAL); |
free(old); |
free(new); |
return; |
} |
vfs_lookup_res_t old_lr; |
vfs_lookup_res_t new_lr; |
vfs_lookup_res_t new_par_lr; |
fibril_rwlock_write_lock(&namespace_rwlock); |
/* Lookup the node belonging to the old file name. */ |
rc = vfs_lookup_internal(oldc, L_NONE, &old_lr, NULL); |
if (rc != EOK) { |
fibril_rwlock_write_unlock(&namespace_rwlock); |
ipc_answer_0(rid, rc); |
free(old); |
free(new); |
return; |
} |
vfs_node_t *old_node = vfs_node_get(&old_lr); |
if (!old_node) { |
fibril_rwlock_write_unlock(&namespace_rwlock); |
ipc_answer_0(rid, ENOMEM); |
free(old); |
free(new); |
return; |
} |
/* Determine the path to the parent of the node with the new name. */ |
char *parentc = str_dup(newc); |
if (!parentc) { |
fibril_rwlock_write_unlock(&namespace_rwlock); |
ipc_answer_0(rid, rc); |
free(old); |
free(new); |
return; |
} |
char *lastsl = str_rchr(parentc + 1, '/'); |
if (lastsl) |
*lastsl = '\0'; |
else |
parentc[1] = '\0'; |
/* Lookup parent of the new file name. */ |
rc = vfs_lookup_internal(parentc, L_NONE, &new_par_lr, NULL); |
free(parentc); /* not needed anymore */ |
if (rc != EOK) { |
fibril_rwlock_write_unlock(&namespace_rwlock); |
ipc_answer_0(rid, rc); |
free(old); |
free(new); |
return; |
} |
/* Check whether linking to the same file system instance. */ |
if ((old_node->fs_handle != new_par_lr.triplet.fs_handle) || |
(old_node->dev_handle != new_par_lr.triplet.dev_handle)) { |
fibril_rwlock_write_unlock(&namespace_rwlock); |
ipc_answer_0(rid, EXDEV); /* different file systems */ |
free(old); |
free(new); |
return; |
} |
/* Destroy the old link for the new name. */ |
vfs_node_t *new_node = NULL; |
rc = vfs_lookup_internal(newc, L_UNLINK, &new_lr, NULL); |
switch (rc) { |
case ENOENT: |
/* simply not in our way */ |
break; |
case EOK: |
new_node = vfs_node_get(&new_lr); |
if (!new_node) { |
fibril_rwlock_write_unlock(&namespace_rwlock); |
ipc_answer_0(rid, ENOMEM); |
free(old); |
free(new); |
return; |
} |
fibril_mutex_lock(&nodes_mutex); |
new_node->lnkcnt--; |
fibril_mutex_unlock(&nodes_mutex); |
break; |
default: |
fibril_rwlock_write_unlock(&namespace_rwlock); |
ipc_answer_0(rid, ENOTEMPTY); |
free(old); |
free(new); |
return; |
} |
/* Create the new link for the new name. */ |
rc = vfs_lookup_internal(newc, L_LINK, NULL, NULL, old_node->index); |
if (rc != EOK) { |
fibril_rwlock_write_unlock(&namespace_rwlock); |
if (new_node) |
vfs_node_put(new_node); |
ipc_answer_0(rid, rc); |
free(old); |
free(new); |
return; |
} |
fibril_mutex_lock(&nodes_mutex); |
old_node->lnkcnt++; |
fibril_mutex_unlock(&nodes_mutex); |
/* Destroy the link for the old name. */ |
rc = vfs_lookup_internal(oldc, L_UNLINK, NULL, NULL); |
if (rc != EOK) { |
fibril_rwlock_write_unlock(&namespace_rwlock); |
vfs_node_put(old_node); |
if (new_node) |
vfs_node_put(new_node); |
ipc_answer_0(rid, rc); |
free(old); |
free(new); |
return; |
} |
fibril_mutex_lock(&nodes_mutex); |
old_node->lnkcnt--; |
fibril_mutex_unlock(&nodes_mutex); |
fibril_rwlock_write_unlock(&namespace_rwlock); |
vfs_node_put(old_node); |
if (new_node) |
vfs_node_put(new_node); |
free(old); |
free(new); |
ipc_answer_0(rid, EOK); |
} |
/** |
* @} |
*/ |
//branches/snapshot/uspace/srv/vfs/vfs.c |
---|
0,0 → 1,186 |
/* |
* Copyright (c) 2008 Jakub Jermar |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup fs |
* @{ |
*/ |
/** |
* @file vfs.c |
* @brief VFS service for HelenOS. |
*/ |
#include <ipc/ipc.h> |
#include <ipc/services.h> |
#include <async.h> |
#include <errno.h> |
#include <stdio.h> |
#include <bool.h> |
#include <string.h> |
#include <as.h> |
#include <atomic.h> |
#include "vfs.h" |
#define NAME "vfs" |
static void vfs_connection(ipc_callid_t iid, ipc_call_t *icall) |
{ |
bool keep_on_going = true; |
/* |
* The connection was opened via the IPC_CONNECT_ME_TO call. |
* This call needs to be answered. |
*/ |
ipc_answer_0(iid, EOK); |
/* |
* Here we enter the main connection fibril loop. |
* The logic behind this loop and the protocol is that we'd like to keep |
* each connection open until the client hangs up. When the client hangs |
* up, we will free its VFS state. The act of hanging up the connection |
* by the client is equivalent to client termination because we cannot |
* distinguish one from the other. On the other hand, the client can |
* hang up arbitrarily if it has no open files and reestablish the |
* connection later. |
*/ |
while (keep_on_going) { |
ipc_call_t call; |
ipc_callid_t callid = async_get_call(&call); |
fs_handle_t fs_handle; |
int phone; |
switch (IPC_GET_METHOD(call)) { |
case IPC_M_PHONE_HUNGUP: |
keep_on_going = false; |
break; |
case VFS_IN_REGISTER: |
vfs_register(callid, &call); |
keep_on_going = false; |
break; |
case VFS_IN_MOUNT: |
vfs_mount(callid, &call); |
break; |
case VFS_IN_OPEN: |
vfs_open(callid, &call); |
break; |
case VFS_IN_OPEN_NODE: |
vfs_open_node(callid, &call); |
break; |
case VFS_IN_CLOSE: |
vfs_close(callid, &call); |
break; |
case VFS_IN_READ: |
vfs_read(callid, &call); |
break; |
case VFS_IN_WRITE: |
vfs_write(callid, &call); |
break; |
case VFS_IN_SEEK: |
vfs_seek(callid, &call); |
break; |
case VFS_IN_TRUNCATE: |
vfs_truncate(callid, &call); |
break; |
case VFS_IN_FSTAT: |
vfs_fstat(callid, &call); |
break; |
case VFS_IN_STAT: |
vfs_stat(callid, &call); |
break; |
case VFS_IN_MKDIR: |
vfs_mkdir(callid, &call); |
break; |
case VFS_IN_UNLINK: |
vfs_unlink(callid, &call); |
break; |
case VFS_IN_RENAME: |
vfs_rename(callid, &call); |
break; |
case VFS_IN_SYNC: |
vfs_sync(callid, &call); |
break; |
default: |
ipc_answer_0(callid, ENOTSUP); |
break; |
} |
} |
/* TODO: cleanup after the client */ |
} |
int main(int argc, char **argv) |
{ |
printf(NAME ": HelenOS VFS server\n"); |
/* |
* Initialize VFS node hash table. |
*/ |
if (!vfs_nodes_init()) { |
printf(NAME ": Failed to initialize VFS node hash table\n"); |
return ENOMEM; |
} |
/* |
* Allocate and initialize the Path Lookup Buffer. |
*/ |
plb = as_get_mappable_page(PLB_SIZE); |
if (!plb) { |
printf(NAME ": Cannot allocate a mappable piece of address space\n"); |
return ENOMEM; |
} |
if (as_area_create(plb, PLB_SIZE, AS_AREA_READ | AS_AREA_WRITE | |
AS_AREA_CACHEABLE) != plb) { |
printf(NAME ": Cannot create address space area\n"); |
return ENOMEM; |
} |
memset(plb, 0, PLB_SIZE); |
/* |
* Set a connection handling function/fibril. |
*/ |
async_set_client_connection(vfs_connection); |
/* |
* Register at the naming service. |
*/ |
ipcarg_t phonead; |
ipc_connect_to_me(PHONE_NS, SERVICE_VFS, 0, 0, &phonead); |
/* |
* Start accepting connections. |
*/ |
printf(NAME ": Accepting connections\n"); |
async_manager(); |
return 0; |
} |
/** |
* @} |
*/ |
//branches/snapshot/uspace/srv/vfs/vfs.h |
---|
0,0 → 1,218 |
/* |
* Copyright (c) 2008 Jakub Jermar |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup fs |
* @{ |
*/ |
#ifndef VFS_VFS_H_ |
#define VFS_VFS_H_ |
#include <ipc/ipc.h> |
#include <adt/list.h> |
#include <fibril_sync.h> |
#include <sys/types.h> |
#include <devmap.h> |
#include <bool.h> |
#include <ipc/vfs.h> |
// FIXME: according to CONFIG_DEBUG |
// #define dprintf(...) printf(__VA_ARGS__) |
#define dprintf(...) |
/** |
* A structure like this will be allocated for each registered file system. |
*/ |
typedef struct { |
link_t fs_link; |
vfs_info_t vfs_info; |
fs_handle_t fs_handle; |
fibril_mutex_t phone_lock; |
ipcarg_t phone; |
} fs_info_t; |
/** |
* VFS_PAIR uniquely represents a file system instance. |
*/ |
#define VFS_PAIR \ |
fs_handle_t fs_handle; \ |
dev_handle_t dev_handle; |
/** |
* VFS_TRIPLET uniquely identifies a file system node (e.g. directory, file) but |
* doesn't contain any state. For a stateful structure, see vfs_node_t. |
* |
* @note fs_handle, dev_handle and index are meant to be returned in one |
* IPC reply. |
*/ |
#define VFS_TRIPLET \ |
VFS_PAIR; \ |
fs_index_t index; |
typedef struct { |
VFS_PAIR; |
} vfs_pair_t; |
typedef struct { |
VFS_TRIPLET; |
} vfs_triplet_t; |
typedef enum vfs_node_type { |
VFS_NODE_UNKNOWN, |
VFS_NODE_FILE, |
VFS_NODE_DIRECTORY, |
} vfs_node_type_t; |
typedef struct { |
vfs_triplet_t triplet; |
vfs_node_type_t type; |
size_t size; |
unsigned lnkcnt; |
} vfs_lookup_res_t; |
/** |
* Instances of this type represent an active, in-memory VFS node and any state |
* which may be associated with it. |
*/ |
typedef struct { |
VFS_TRIPLET; /**< Identity of the node. */ |
/** |
* Usage counter. This includes, but is not limited to, all vfs_file_t |
* structures that reference this node. |
*/ |
unsigned refcnt; |
/** Number of names this node has in the file system namespace. */ |
unsigned lnkcnt; |
link_t nh_link; /**< Node hash-table link. */ |
vfs_node_type_t type; /**< Partial info about the node type. */ |
size_t size; /**< Cached size if the node is a file. */ |
/** |
* Holding this rwlock prevents modifications of the node's contents. |
*/ |
fibril_rwlock_t contents_rwlock; |
} vfs_node_t; |
/** |
* Instances of this type represent an open file. If the file is opened by more |
* than one task, there will be a separate structure allocated for each task. |
*/ |
typedef struct { |
/** Serializes access to this open file. */ |
fibril_mutex_t lock; |
vfs_node_t *node; |
/** Number of file handles referencing this file. */ |
unsigned refcnt; |
/** Append on write. */ |
bool append; |
/** Current position in the file. */ |
off_t pos; |
} vfs_file_t; |
extern fibril_mutex_t nodes_mutex; |
extern fibril_condvar_t fs_head_cv; |
extern fibril_mutex_t fs_head_lock; |
extern link_t fs_head; /**< List of registered file systems. */ |
extern vfs_pair_t rootfs; /**< Root file system. */ |
/** Each instance of this type describes one path lookup in progress. */ |
typedef struct { |
link_t plb_link; /**< Active PLB entries list link. */ |
unsigned index; /**< Index of the first character in PLB. */ |
size_t len; /**< Number of characters in this PLB entry. */ |
} plb_entry_t; |
extern fibril_mutex_t plb_mutex;/**< Mutex protecting plb and plb_head. */ |
extern uint8_t *plb; /**< Path Lookup Buffer */ |
extern link_t plb_head; /**< List of active PLB entries. */ |
#define MAX_MNTOPTS_LEN 256 |
/** Holding this rwlock prevents changes in file system namespace. */ |
extern fibril_rwlock_t namespace_rwlock; |
extern int vfs_grab_phone(fs_handle_t); |
extern void vfs_release_phone(int); |
extern fs_handle_t fs_name_to_handle(char *, bool); |
extern int vfs_lookup_internal(char *, int, vfs_lookup_res_t *, |
vfs_pair_t *, ...); |
extern int vfs_open_node_internal(vfs_lookup_res_t *); |
extern bool vfs_nodes_init(void); |
extern vfs_node_t *vfs_node_get(vfs_lookup_res_t *); |
extern void vfs_node_put(vfs_node_t *); |
#define MAX_OPEN_FILES 128 |
extern bool vfs_files_init(void); |
extern vfs_file_t *vfs_file_get(int); |
extern int vfs_fd_alloc(void); |
extern int vfs_fd_free(int); |
extern void vfs_file_addref(vfs_file_t *); |
extern void vfs_file_delref(vfs_file_t *); |
extern void vfs_node_addref(vfs_node_t *); |
extern void vfs_node_delref(vfs_node_t *); |
extern void vfs_register(ipc_callid_t, ipc_call_t *); |
extern void vfs_mount(ipc_callid_t, ipc_call_t *); |
extern void vfs_open(ipc_callid_t, ipc_call_t *); |
extern void vfs_open_node(ipc_callid_t, ipc_call_t *); |
extern void vfs_sync(ipc_callid_t, ipc_call_t *); |
extern void vfs_close(ipc_callid_t, ipc_call_t *); |
extern void vfs_read(ipc_callid_t, ipc_call_t *); |
extern void vfs_write(ipc_callid_t, ipc_call_t *); |
extern void vfs_seek(ipc_callid_t, ipc_call_t *); |
extern void vfs_truncate(ipc_callid_t, ipc_call_t *); |
extern void vfs_fstat(ipc_callid_t, ipc_call_t *); |
extern void vfs_fstat(ipc_callid_t, ipc_call_t *); |
extern void vfs_stat(ipc_callid_t, ipc_call_t *); |
extern void vfs_mkdir(ipc_callid_t, ipc_call_t *); |
extern void vfs_unlink(ipc_callid_t, ipc_call_t *); |
extern void vfs_rename(ipc_callid_t, ipc_call_t *); |
#endif |
/** |
* @} |
*/ |
//branches/snapshot/uspace/srv/vfs/vfs_node.c |
---|
0,0 → 1,235 |
/* |
* Copyright (c) 2008 Jakub Jermar |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup fs |
* @{ |
*/ |
/** |
* @file vfs_node.c |
* @brief Various operations on VFS nodes have their home in this file. |
*/ |
#include "vfs.h" |
#include <stdlib.h> |
#include <string.h> |
#include <fibril_sync.h> |
#include <adt/hash_table.h> |
#include <assert.h> |
#include <async.h> |
#include <errno.h> |
/** Mutex protecting the VFS node hash table. */ |
FIBRIL_MUTEX_INITIALIZE(nodes_mutex); |
#define NODES_BUCKETS_LOG 8 |
#define NODES_BUCKETS (1 << NODES_BUCKETS_LOG) |
/** VFS node hash table containing all active, in-memory VFS nodes. */ |
hash_table_t nodes; |
#define KEY_FS_HANDLE 0 |
#define KEY_DEV_HANDLE 1 |
#define KEY_INDEX 2 |
static hash_index_t nodes_hash(unsigned long []); |
static int nodes_compare(unsigned long [], hash_count_t, link_t *); |
static void nodes_remove_callback(link_t *); |
/** VFS node hash table operations. */ |
hash_table_operations_t nodes_ops = { |
.hash = nodes_hash, |
.compare = nodes_compare, |
.remove_callback = nodes_remove_callback |
}; |
/** Initialize the VFS node hash table. |
* |
* @return Return true on success, false on failure. |
*/ |
bool vfs_nodes_init(void) |
{ |
return hash_table_create(&nodes, NODES_BUCKETS, 3, &nodes_ops); |
} |
static inline void _vfs_node_addref(vfs_node_t *node) |
{ |
node->refcnt++; |
} |
/** Increment reference count of a VFS node. |
* |
* @param node VFS node that will have its refcnt incremented. |
*/ |
void vfs_node_addref(vfs_node_t *node) |
{ |
fibril_mutex_lock(&nodes_mutex); |
_vfs_node_addref(node); |
fibril_mutex_unlock(&nodes_mutex); |
} |
/** Decrement reference count of a VFS node. |
* |
* This function handles the case when the reference count drops to zero. |
* |
* @param node VFS node that will have its refcnt decremented. |
*/ |
void vfs_node_delref(vfs_node_t *node) |
{ |
bool free_vfs_node = false; |
bool free_fs_node = false; |
fibril_mutex_lock(&nodes_mutex); |
if (node->refcnt-- == 1) { |
/* |
* We are dropping the last reference to this node. |
* Remove it from the VFS node hash table. |
*/ |
unsigned long key[] = { |
[KEY_FS_HANDLE] = node->fs_handle, |
[KEY_DEV_HANDLE] = node->dev_handle, |
[KEY_INDEX] = node->index |
}; |
hash_table_remove(&nodes, key, 3); |
free_vfs_node = true; |
if (!node->lnkcnt) |
free_fs_node = true; |
} |
fibril_mutex_unlock(&nodes_mutex); |
if (free_fs_node) { |
/* |
* The node is not visible in the file system namespace. |
* Free up its resources. |
*/ |
int phone = vfs_grab_phone(node->fs_handle); |
ipcarg_t rc; |
rc = async_req_2_0(phone, VFS_OUT_DESTROY, |
(ipcarg_t)node->dev_handle, (ipcarg_t)node->index); |
assert(rc == EOK); |
vfs_release_phone(phone); |
} |
if (free_vfs_node) |
free(node); |
} |
/** Find VFS node. |
* |
* This function will try to lookup the given triplet in the VFS node hash |
* table. In case the triplet is not found there, a new VFS node is created. |
* In any case, the VFS node will have its reference count incremented. Every |
* node returned by this call should be eventually put back by calling |
* vfs_node_put() on it. |
* |
* @param result Populated lookup result structure. |
* |
* @return VFS node corresponding to the given triplet. |
*/ |
vfs_node_t *vfs_node_get(vfs_lookup_res_t *result) |
{ |
unsigned long key[] = { |
[KEY_FS_HANDLE] = result->triplet.fs_handle, |
[KEY_DEV_HANDLE] = result->triplet.dev_handle, |
[KEY_INDEX] = result->triplet.index |
}; |
link_t *tmp; |
vfs_node_t *node; |
fibril_mutex_lock(&nodes_mutex); |
tmp = hash_table_find(&nodes, key); |
if (!tmp) { |
node = (vfs_node_t *) malloc(sizeof(vfs_node_t)); |
if (!node) { |
fibril_mutex_unlock(&nodes_mutex); |
return NULL; |
} |
memset(node, 0, sizeof(vfs_node_t)); |
node->fs_handle = result->triplet.fs_handle; |
node->dev_handle = result->triplet.dev_handle; |
node->index = result->triplet.index; |
node->size = result->size; |
node->lnkcnt = result->lnkcnt; |
node->type = result->type; |
link_initialize(&node->nh_link); |
fibril_rwlock_initialize(&node->contents_rwlock); |
hash_table_insert(&nodes, key, &node->nh_link); |
} else { |
node = hash_table_get_instance(tmp, vfs_node_t, nh_link); |
if (node->type == VFS_NODE_UNKNOWN && |
result->type != VFS_NODE_UNKNOWN) { |
/* Upgrade the node type. */ |
node->type = result->type; |
} |
} |
assert(node->size == result->size); |
assert(node->lnkcnt == result->lnkcnt); |
assert(node->type == result->type || result->type == VFS_NODE_UNKNOWN); |
_vfs_node_addref(node); |
fibril_mutex_unlock(&nodes_mutex); |
return node; |
} |
/** Return VFS node when no longer needed by the caller. |
* |
* This function will remove the reference on the VFS node created by |
* vfs_node_get(). This function can only be called as a closing bracket to the |
* preceding vfs_node_get() call. |
* |
* @param node VFS node being released. |
*/ |
void vfs_node_put(vfs_node_t *node) |
{ |
vfs_node_delref(node); |
} |
hash_index_t nodes_hash(unsigned long key[]) |
{ |
hash_index_t a = key[KEY_FS_HANDLE] << (NODES_BUCKETS_LOG / 4); |
hash_index_t b = (a | key[KEY_DEV_HANDLE]) << (NODES_BUCKETS_LOG / 2); |
return (b | key[KEY_INDEX]) & (NODES_BUCKETS - 1); |
} |
int nodes_compare(unsigned long key[], hash_count_t keys, link_t *item) |
{ |
vfs_node_t *node = hash_table_get_instance(item, vfs_node_t, nh_link); |
return (node->fs_handle == key[KEY_FS_HANDLE]) && |
(node->dev_handle == key[KEY_DEV_HANDLE]) && |
(node->index == key[KEY_INDEX]); |
} |
void nodes_remove_callback(link_t *item) |
{ |
} |
/** |
* @} |
*/ |
//branches/snapshot/uspace/srv/vfs/vfs_lookup.c |
---|
0,0 → 1,232 |
/* |
* Copyright (c) 2008 Jakub Jermar |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup fs |
* @{ |
*/ |
/** |
* @file vfs_lookup.c |
* @brief |
*/ |
#include "vfs.h" |
#include <ipc/ipc.h> |
#include <async.h> |
#include <errno.h> |
#include <string.h> |
#include <stdarg.h> |
#include <bool.h> |
#include <fibril_sync.h> |
#include <adt/list.h> |
#include <vfs/canonify.h> |
#define min(a, b) ((a) < (b) ? (a) : (b)) |
FIBRIL_MUTEX_INITIALIZE(plb_mutex); |
LIST_INITIALIZE(plb_head); /**< PLB entry ring buffer. */ |
uint8_t *plb = NULL; |
/** Perform a path lookup. |
* |
* @param path Path to be resolved; it must be a NULL-terminated |
* string. |
* @param lflag Flags to be used during lookup. |
* @param result Empty structure where the lookup result will be stored. |
* Can be NULL. |
* @param altroot If non-empty, will be used instead of rootfs as the root |
* of the whole VFS tree. |
* |
* @return EOK on success or an error code from errno.h. |
* |
*/ |
int vfs_lookup_internal(char *path, int lflag, vfs_lookup_res_t *result, |
vfs_pair_t *altroot, ...) |
{ |
vfs_pair_t *root; |
if (altroot) |
root = altroot; |
else |
root = &rootfs; |
if (!root->fs_handle) |
return ENOENT; |
size_t len; |
path = canonify(path, &len); |
if (!path) |
return EINVAL; |
fs_index_t index = 0; |
if (lflag & L_LINK) { |
va_list ap; |
va_start(ap, altroot); |
index = va_arg(ap, fs_index_t); |
va_end(ap); |
} |
fibril_mutex_lock(&plb_mutex); |
plb_entry_t entry; |
link_initialize(&entry.plb_link); |
entry.len = len; |
off_t first; /* the first free index */ |
off_t last; /* the last free index */ |
if (list_empty(&plb_head)) { |
first = 0; |
last = PLB_SIZE - 1; |
} else { |
plb_entry_t *oldest = list_get_instance(plb_head.next, |
plb_entry_t, plb_link); |
plb_entry_t *newest = list_get_instance(plb_head.prev, |
plb_entry_t, plb_link); |
first = (newest->index + newest->len) % PLB_SIZE; |
last = (oldest->index - 1) % PLB_SIZE; |
} |
if (first <= last) { |
if ((last - first) + 1 < len) { |
/* |
* The buffer cannot absorb the path. |
*/ |
fibril_mutex_unlock(&plb_mutex); |
return ELIMIT; |
} |
} else { |
if (PLB_SIZE - ((first - last) + 1) < len) { |
/* |
* The buffer cannot absorb the path. |
*/ |
fibril_mutex_unlock(&plb_mutex); |
return ELIMIT; |
} |
} |
/* |
* We know the first free index in PLB and we also know that there is |
* enough space in the buffer to hold our path. |
*/ |
entry.index = first; |
entry.len = len; |
/* |
* Claim PLB space by inserting the entry into the PLB entry ring |
* buffer. |
*/ |
list_append(&entry.plb_link, &plb_head); |
fibril_mutex_unlock(&plb_mutex); |
/* |
* Copy the path into PLB. |
*/ |
size_t cnt1 = min(len, (PLB_SIZE - first) + 1); |
size_t cnt2 = len - cnt1; |
memcpy(&plb[first], path, cnt1); |
memcpy(plb, &path[cnt1], cnt2); |
ipc_call_t answer; |
int phone = vfs_grab_phone(root->fs_handle); |
aid_t req = async_send_5(phone, VFS_OUT_LOOKUP, (ipcarg_t) first, |
(ipcarg_t) (first + len - 1) % PLB_SIZE, |
(ipcarg_t) root->dev_handle, (ipcarg_t) lflag, (ipcarg_t) index, |
&answer); |
ipcarg_t rc; |
async_wait_for(req, &rc); |
vfs_release_phone(phone); |
fibril_mutex_lock(&plb_mutex); |
list_remove(&entry.plb_link); |
/* |
* Erasing the path from PLB will come handy for debugging purposes. |
*/ |
memset(&plb[first], 0, cnt1); |
memset(plb, 0, cnt2); |
fibril_mutex_unlock(&plb_mutex); |
if ((rc == EOK) && (result)) { |
result->triplet.fs_handle = (fs_handle_t) IPC_GET_ARG1(answer); |
result->triplet.dev_handle = (dev_handle_t) IPC_GET_ARG2(answer); |
result->triplet.index = (fs_index_t) IPC_GET_ARG3(answer); |
result->size = (size_t) IPC_GET_ARG4(answer); |
result->lnkcnt = (unsigned) IPC_GET_ARG5(answer); |
if (lflag & L_FILE) |
result->type = VFS_NODE_FILE; |
else if (lflag & L_DIRECTORY) |
result->type = VFS_NODE_DIRECTORY; |
else |
result->type = VFS_NODE_UNKNOWN; |
} |
return rc; |
} |
/** Perform a node open operation. |
* |
* @return EOK on success or an error code from errno.h. |
* |
*/ |
int vfs_open_node_internal(vfs_lookup_res_t *result) |
{ |
int phone = vfs_grab_phone(result->triplet.fs_handle); |
ipc_call_t answer; |
aid_t req = async_send_2(phone, VFS_OUT_OPEN_NODE, |
(ipcarg_t) result->triplet.dev_handle, |
(ipcarg_t) result->triplet.index, &answer); |
ipcarg_t rc; |
async_wait_for(req, &rc); |
vfs_release_phone(phone); |
if (rc == EOK) { |
result->size = (size_t) IPC_GET_ARG1(answer); |
result->lnkcnt = (unsigned) IPC_GET_ARG2(answer); |
if (IPC_GET_ARG3(answer) & L_FILE) |
result->type = VFS_NODE_FILE; |
else if (IPC_GET_ARG3(answer) & L_DIRECTORY) |
result->type = VFS_NODE_DIRECTORY; |
else |
result->type = VFS_NODE_UNKNOWN; |
} |
return rc; |
} |
/** |
* @} |
*/ |
//branches/snapshot/uspace/srv/vfs/vfs_register.c |
---|
0,0 → 1,355 |
/* |
* Copyright (c) 2008 Jakub Jermar |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup fs |
* @{ |
*/ |
/** |
* @file vfs_register.c |
* @brief |
*/ |
#include <ipc/ipc.h> |
#include <ipc/services.h> |
#include <async.h> |
#include <fibril.h> |
#include <errno.h> |
#include <stdio.h> |
#include <stdlib.h> |
#include <string.h> |
#include <ctype.h> |
#include <bool.h> |
#include <fibril_sync.h> |
#include <adt/list.h> |
#include <as.h> |
#include <assert.h> |
#include <atomic.h> |
#include "vfs.h" |
FIBRIL_CONDVAR_INITIALIZE(fs_head_cv); |
FIBRIL_MUTEX_INITIALIZE(fs_head_lock); |
LIST_INITIALIZE(fs_head); |
atomic_t fs_handle_next = { |
.count = 1 |
}; |
/** Verify the VFS info structure. |
* |
* @param info Info structure to be verified. |
* |
* @return Non-zero if the info structure is sane, zero otherwise. |
*/ |
static bool vfs_info_sane(vfs_info_t *info) |
{ |
int i; |
/* |
* Check if the name is non-empty and is composed solely of ASCII |
* characters [a-z]+[a-z0-9_-]*. |
*/ |
if (!islower(info->name[0])) { |
dprintf("The name doesn't start with a lowercase character.\n"); |
return false; |
} |
for (i = 1; i < FS_NAME_MAXLEN; i++) { |
if (!(islower(info->name[i]) || isdigit(info->name[i])) && |
(info->name[i] != '-') && (info->name[i] != '_')) { |
if (info->name[i] == '\0') { |
break; |
} else { |
dprintf("The name contains illegal " |
"characters.\n"); |
return false; |
} |
} |
} |
/* |
* This check is not redundant. It ensures that the name is |
* NULL-terminated, even if FS_NAME_MAXLEN characters are used. |
*/ |
if (info->name[i] != '\0') { |
dprintf("The name is not properly NULL-terminated.\n"); |
return false; |
} |
return true; |
} |
/** VFS_REGISTER protocol function. |
* |
* @param rid Hash of the call with the request. |
* @param request Call structure with the request. |
*/ |
void vfs_register(ipc_callid_t rid, ipc_call_t *request) |
{ |
ipc_callid_t callid; |
ipc_call_t call; |
int rc; |
size_t size; |
dprintf("Processing VFS_REGISTER request received from %p.\n", |
request->in_phone_hash); |
/* |
* The first call has to be IPC_M_DATA_SEND in which we receive the |
* VFS info structure from the client FS. |
*/ |
if (!ipc_data_write_receive(&callid, &size)) { |
/* |
* The client doesn't obey the same protocol as we do. |
*/ |
dprintf("Receiving of VFS info failed.\n"); |
ipc_answer_0(callid, EINVAL); |
ipc_answer_0(rid, EINVAL); |
return; |
} |
dprintf("VFS info received, size = %d\n", size); |
/* |
* We know the size of the VFS info structure. See if the client |
* understands this easy concept too. |
*/ |
if (size != sizeof(vfs_info_t)) { |
/* |
* The client is sending us something, which cannot be |
* the info structure. |
*/ |
dprintf("Received VFS info has bad size.\n"); |
ipc_answer_0(callid, EINVAL); |
ipc_answer_0(rid, EINVAL); |
return; |
} |
/* |
* Allocate and initialize a buffer for the fs_info structure. |
*/ |
fs_info_t *fs_info; |
fs_info = (fs_info_t *) malloc(sizeof(fs_info_t)); |
if (!fs_info) { |
dprintf("Could not allocate memory for FS info.\n"); |
ipc_answer_0(callid, ENOMEM); |
ipc_answer_0(rid, ENOMEM); |
return; |
} |
link_initialize(&fs_info->fs_link); |
fibril_mutex_initialize(&fs_info->phone_lock); |
rc = ipc_data_write_finalize(callid, &fs_info->vfs_info, size); |
if (rc != EOK) { |
dprintf("Failed to deliver the VFS info into our AS, rc=%d.\n", |
rc); |
free(fs_info); |
ipc_answer_0(callid, rc); |
ipc_answer_0(rid, rc); |
return; |
} |
dprintf("VFS info delivered.\n"); |
if (!vfs_info_sane(&fs_info->vfs_info)) { |
free(fs_info); |
ipc_answer_0(callid, EINVAL); |
ipc_answer_0(rid, EINVAL); |
return; |
} |
fibril_mutex_lock(&fs_head_lock); |
/* |
* Check for duplicit registrations. |
*/ |
if (fs_name_to_handle(fs_info->vfs_info.name, false)) { |
/* |
* We already register a fs like this. |
*/ |
dprintf("FS is already registered.\n"); |
fibril_mutex_unlock(&fs_head_lock); |
free(fs_info); |
ipc_answer_0(callid, EEXISTS); |
ipc_answer_0(rid, EEXISTS); |
return; |
} |
/* |
* Add fs_info to the list of registered FS's. |
*/ |
dprintf("Inserting FS into the list of registered file systems.\n"); |
list_append(&fs_info->fs_link, &fs_head); |
/* |
* Now we want the client to send us the IPC_M_CONNECT_TO_ME call so |
* that a callback connection is created and we have a phone through |
* which to forward VFS requests to it. |
*/ |
callid = async_get_call(&call); |
if (IPC_GET_METHOD(call) != IPC_M_CONNECT_TO_ME) { |
dprintf("Unexpected call, method = %d\n", IPC_GET_METHOD(call)); |
list_remove(&fs_info->fs_link); |
fibril_mutex_unlock(&fs_head_lock); |
free(fs_info); |
ipc_answer_0(callid, EINVAL); |
ipc_answer_0(rid, EINVAL); |
return; |
} |
fs_info->phone = IPC_GET_ARG5(call); |
ipc_answer_0(callid, EOK); |
dprintf("Callback connection to FS created.\n"); |
/* |
* The client will want us to send him the address space area with PLB. |
*/ |
if (!ipc_share_in_receive(&callid, &size)) { |
dprintf("Unexpected call, method = %d\n", IPC_GET_METHOD(call)); |
list_remove(&fs_info->fs_link); |
fibril_mutex_unlock(&fs_head_lock); |
ipc_hangup(fs_info->phone); |
free(fs_info); |
ipc_answer_0(callid, EINVAL); |
ipc_answer_0(rid, EINVAL); |
return; |
} |
/* |
* We can only send the client address space area PLB_SIZE bytes long. |
*/ |
if (size != PLB_SIZE) { |
dprintf("Client suggests wrong size of PFB, size = %d\n", size); |
list_remove(&fs_info->fs_link); |
fibril_mutex_unlock(&fs_head_lock); |
ipc_hangup(fs_info->phone); |
free(fs_info); |
ipc_answer_0(callid, EINVAL); |
ipc_answer_0(rid, EINVAL); |
return; |
} |
/* |
* Commit to read-only sharing the PLB with the client. |
*/ |
(void) ipc_share_in_finalize(callid, plb, |
AS_AREA_READ | AS_AREA_CACHEABLE); |
dprintf("Sharing PLB.\n"); |
/* |
* That was it. The FS has been registered. |
* In reply to the VFS_REGISTER request, we assign the client file |
* system a global file system handle. |
*/ |
fs_info->fs_handle = (fs_handle_t) atomic_postinc(&fs_handle_next); |
ipc_answer_1(rid, EOK, (ipcarg_t) fs_info->fs_handle); |
fibril_condvar_broadcast(&fs_head_cv); |
fibril_mutex_unlock(&fs_head_lock); |
dprintf("\"%.*s\" filesystem successfully registered, handle=%d.\n", |
FS_NAME_MAXLEN, fs_info->vfs_info.name, fs_info->fs_handle); |
} |
/** For a given file system handle, implement policy for allocating a phone. |
* |
* @param handle File system handle. |
* |
* @return Phone over which a multi-call request can be safely |
* sent. Return 0 if no phone was found. |
*/ |
int vfs_grab_phone(fs_handle_t handle) |
{ |
int phone; |
/* |
* For now, we don't try to be very clever and very fast. We simply |
* lookup the phone in the fs_head list and duplicate it. The duplicate |
* phone will be returned to the client and the client will use it for |
* communication. In the future, we should cache the connections so |
* that they do not have to be reestablished over and over again. |
*/ |
fibril_mutex_lock(&fs_head_lock); |
link_t *cur; |
fs_info_t *fs; |
for (cur = fs_head.next; cur != &fs_head; cur = cur->next) { |
fs = list_get_instance(cur, fs_info_t, fs_link); |
if (fs->fs_handle == handle) { |
fibril_mutex_unlock(&fs_head_lock); |
fibril_mutex_lock(&fs->phone_lock); |
phone = ipc_connect_me_to(fs->phone, 0, 0, 0); |
fibril_mutex_unlock(&fs->phone_lock); |
assert(phone > 0); |
return phone; |
} |
} |
fibril_mutex_unlock(&fs_head_lock); |
return 0; |
} |
/** Tell VFS that the phone is not needed anymore. |
* |
* @param phone Phone to FS task. |
*/ |
void vfs_release_phone(int phone) |
{ |
/* TODO: implement connection caching */ |
ipc_hangup(phone); |
} |
/** Convert file system name to its handle. |
* |
* @param name File system name. |
* @param lock If true, the function will lock and unlock the |
* fs_head_lock. |
* |
* @return File system handle or zero if file system not found. |
*/ |
fs_handle_t fs_name_to_handle(char *name, bool lock) |
{ |
int handle = 0; |
if (lock) |
fibril_mutex_lock(&fs_head_lock); |
link_t *cur; |
for (cur = fs_head.next; cur != &fs_head; cur = cur->next) { |
fs_info_t *fs = list_get_instance(cur, fs_info_t, fs_link); |
if (str_cmp(fs->vfs_info.name, name) == 0) { |
handle = fs->fs_handle; |
break; |
} |
} |
if (lock) |
fibril_mutex_unlock(&fs_head_lock); |
return handle; |
} |
/** |
* @} |
*/ |
//branches/snapshot/uspace/srv/vfs/vfs_file.c |
---|
0,0 → 1,175 |
/* |
* Copyright (c) 2007 Jakub Jermar |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup fs |
* @{ |
*/ |
/** |
* @file vfs_file.c |
* @brief Various operations on files have their home in this file. |
*/ |
#include <errno.h> |
#include <stdlib.h> |
#include <string.h> |
#include <assert.h> |
#include <bool.h> |
#include <fibril.h> |
#include <fibril_sync.h> |
#include "vfs.h" |
/** |
* This is a per-connection table of open files. |
* Our assumption is that each client opens only one connection and therefore |
* there is one table of open files per task. However, this may not be the case |
* and the client can open more connections to VFS. In that case, there will be |
* several tables and several file handle name spaces per task. Besides of this, |
* the functionality will stay unchanged. So unless the client knows what it is |
* doing, it should open one connection to VFS only. |
* |
* Allocation of the open files table is deferred until the client makes the |
* first VFS_OPEN operation. |
* |
* This resource being per-connection and, in the first place, per-fibril, we |
* don't need to protect it by a mutex. |
*/ |
fibril_local vfs_file_t **files = NULL; |
/** Initialize the table of open files. */ |
bool vfs_files_init(void) |
{ |
if (!files) { |
files = malloc(MAX_OPEN_FILES * sizeof(vfs_file_t *)); |
if (!files) |
return false; |
memset(files, 0, MAX_OPEN_FILES * sizeof(vfs_file_t *)); |
} |
return true; |
} |
/** Allocate a file descriptor. |
* |
* @return First available file descriptor or a negative error |
* code. |
*/ |
int vfs_fd_alloc(void) |
{ |
if (!vfs_files_init()) |
return ENOMEM; |
unsigned int i; |
for (i = 0; i < MAX_OPEN_FILES; i++) { |
if (!files[i]) { |
files[i] = (vfs_file_t *) malloc(sizeof(vfs_file_t)); |
if (!files[i]) |
return ENOMEM; |
memset(files[i], 0, sizeof(vfs_file_t)); |
fibril_mutex_initialize(&files[i]->lock); |
vfs_file_addref(files[i]); |
return (int) i; |
} |
} |
return EMFILE; |
} |
/** Release file descriptor. |
* |
* @param fd File descriptor being released. |
* |
* @return EOK on success or EBADF if fd is an invalid file |
* descriptor. |
*/ |
int vfs_fd_free(int fd) |
{ |
if (!vfs_files_init()) |
return ENOMEM; |
if ((fd < 0) || (fd >= MAX_OPEN_FILES) || (files[fd] == NULL)) |
return EBADF; |
vfs_file_delref(files[fd]); |
files[fd] = NULL; |
return EOK; |
} |
/** Increment reference count of VFS file structure. |
* |
* @param file File structure that will have reference count |
* incremented. |
*/ |
void vfs_file_addref(vfs_file_t *file) |
{ |
/* |
* File structures are per-connection, so no-one, except the current |
* fibril, should have a reference to them. This is the reason we don't |
* do any synchronization here. |
*/ |
file->refcnt++; |
} |
/** Decrement reference count of VFS file structure. |
* |
* @param file File structure that will have reference count |
* decremented. |
*/ |
void vfs_file_delref(vfs_file_t *file) |
{ |
if (file->refcnt-- == 1) { |
/* |
* Lost the last reference to a file, need to drop our reference |
* to the underlying VFS node. |
*/ |
vfs_node_delref(file->node); |
free(file); |
} |
} |
/** Find VFS file structure for a given file descriptor. |
* |
* @param fd File descriptor. |
* |
* @return VFS file structure corresponding to fd. |
*/ |
vfs_file_t *vfs_file_get(int fd) |
{ |
if (!vfs_files_init()) |
return NULL; |
if ((fd >= 0) && (fd < MAX_OPEN_FILES)) |
return files[fd]; |
return NULL; |
} |
/** |
* @} |
*/ |
//branches/snapshot/uspace/srv/vfs/Makefile |
---|
0,0 → 1,81 |
# |
# Copyright (c) 2006 Martin Decky |
# Copyright (c) 2008 Jakub Jermar |
# All rights reserved. |
# |
# Redistribution and use in source and binary forms, with or without |
# modification, are permitted provided that the following conditions |
# are met: |
# |
# - Redistributions of source code must retain the above copyright |
# notice, this list of conditions and the following disclaimer. |
# - 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. |
# - The name of the author may not be used to endorse or promote products |
# derived from this software without specific prior written permission. |
# |
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
# |
## Setup toolchain |
# |
LIBC_PREFIX = ../../lib/libc |
SOFTINT_PREFIX = ../../lib/softint |
include $(LIBC_PREFIX)/Makefile.toolchain |
LIBS = $(LIBC_PREFIX)/libc.a |
## Sources |
# |
OUTPUT = vfs |
SOURCES = \ |
vfs.c \ |
vfs_node.c \ |
vfs_file.c \ |
vfs_ops.c \ |
vfs_lookup.c \ |
vfs_register.c |
OBJECTS := $(addsuffix .o,$(basename $(SOURCES))) |
.PHONY: all clean depend disasm |
all: $(OUTPUT) $(OUTPUT).disasm |
-include Makefile.depend |
clean: |
-rm -f $(OUTPUT) $(OUTPUT).map $(OUTPUT).disasm Makefile.depend $(OBJECTS) |
depend: |
$(CC) $(DEFS) $(CFLAGS) -M $(SOURCES) > Makefile.depend |
$(OUTPUT): $(OBJECTS) $(LIBS) |
$(LD) -T $(LIBC_PREFIX)/arch/$(UARCH)/_link.ld $(OBJECTS) $(LIBS) $(LFLAGS) -o $@ -Map $(OUTPUT).map |
disasm: $(OUTPUT).disasm |
$(OUTPUT).disasm: $(OUTPUT) |
$(OBJDUMP) -d $< > $@ |
%.o: %.S |
$(CC) $(DEFS) $(AFLAGS) $(CFLAGS) -D__ASM__ -c $< -o $@ |
%.o: %.s |
$(AS) $(AFLAGS) $< -o $@ |
%.o: %.c |
$(CC) $(DEFS) $(CFLAGS) -c $< -o $@ |
//branches/snapshot/uspace/srv/devmap/devmap.c |
---|
0,0 → 1,871 |
/* |
* Copyright (c) 2007 Josef Cejka |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** |
* @defgroup devmap Device mapper. |
* @brief HelenOS device mapper. |
* @{ |
*/ |
/** @file |
*/ |
#include <ipc/services.h> |
#include <ipc/ns.h> |
#include <async.h> |
#include <stdio.h> |
#include <errno.h> |
#include <bool.h> |
#include <fibril_sync.h> |
#include <stdlib.h> |
#include <string.h> |
#include <ipc/devmap.h> |
#define NAME "devmap" |
#define NULL_DEVICES 256 |
/** Representation of device driver. |
* |
* Each driver is responsible for a set of devices. |
* |
*/ |
typedef struct { |
/** Pointers to previous and next drivers in linked list */ |
link_t drivers; |
/** Pointer to the linked list of devices controlled by this driver */ |
link_t devices; |
/** Phone asociated with this driver */ |
ipcarg_t phone; |
/** Device driver name */ |
char *name; |
/** Fibril mutex for list of devices owned by this driver */ |
fibril_mutex_t devices_mutex; |
} devmap_driver_t; |
/** Info about registered device |
* |
*/ |
typedef struct { |
/** Pointer to the previous and next device in the list of all devices */ |
link_t devices; |
/** Pointer to the previous and next device in the list of devices |
owned by one driver */ |
link_t driver_devices; |
/** Unique device identifier */ |
dev_handle_t handle; |
/** Device name */ |
char *name; |
/** Device driver handling this device */ |
devmap_driver_t *driver; |
} devmap_device_t; |
LIST_INITIALIZE(devices_list); |
LIST_INITIALIZE(drivers_list); |
/* Locking order: |
* drivers_list_mutex |
* devices_list_mutex |
* (devmap_driver_t *)->devices_mutex |
* create_handle_mutex |
**/ |
static FIBRIL_MUTEX_INITIALIZE(devices_list_mutex); |
static FIBRIL_CONDVAR_INITIALIZE(devices_list_cv); |
static FIBRIL_MUTEX_INITIALIZE(drivers_list_mutex); |
static FIBRIL_MUTEX_INITIALIZE(create_handle_mutex); |
static FIBRIL_MUTEX_INITIALIZE(null_devices_mutex); |
static dev_handle_t last_handle = 0; |
static devmap_device_t *null_devices[NULL_DEVICES]; |
static dev_handle_t devmap_create_handle(void) |
{ |
/* TODO: allow reusing old handles after their unregistration |
* and implement some version of LRU algorithm, avoid overflow |
*/ |
fibril_mutex_lock(&create_handle_mutex); |
last_handle++; |
fibril_mutex_unlock(&create_handle_mutex); |
return last_handle; |
} |
/** Find device with given name. |
* |
*/ |
static devmap_device_t *devmap_device_find_name(const char *name) |
{ |
link_t *item = devices_list.next; |
devmap_device_t *device = NULL; |
while (item != &devices_list) { |
device = list_get_instance(item, devmap_device_t, devices); |
if (str_cmp(device->name, name) == 0) |
break; |
item = item->next; |
} |
if (item == &devices_list) |
return NULL; |
device = list_get_instance(item, devmap_device_t, devices); |
return device; |
} |
/** Find device with given handle. |
* |
* @todo: use hash table |
* |
*/ |
static devmap_device_t *devmap_device_find_handle(dev_handle_t handle) |
{ |
fibril_mutex_lock(&devices_list_mutex); |
link_t *item = (&devices_list)->next; |
devmap_device_t *device = NULL; |
while (item != &devices_list) { |
device = list_get_instance(item, devmap_device_t, devices); |
if (device->handle == handle) |
break; |
item = item->next; |
} |
if (item == &devices_list) { |
fibril_mutex_unlock(&devices_list_mutex); |
return NULL; |
} |
device = list_get_instance(item, devmap_device_t, devices); |
fibril_mutex_unlock(&devices_list_mutex); |
return device; |
} |
/** |
* Unregister device and free it. It's assumed that driver's device list is |
* already locked. |
*/ |
static int devmap_device_unregister_core(devmap_device_t *device) |
{ |
list_remove(&(device->devices)); |
list_remove(&(device->driver_devices)); |
free(device->name); |
free(device); |
return EOK; |
} |
/** |
* Read info about new driver and add it into linked list of registered |
* drivers. |
*/ |
static void devmap_driver_register(devmap_driver_t **odriver) |
{ |
*odriver = NULL; |
ipc_call_t icall; |
ipc_callid_t iid = async_get_call(&icall); |
if (IPC_GET_METHOD(icall) != DEVMAP_DRIVER_REGISTER) { |
ipc_answer_0(iid, EREFUSED); |
return; |
} |
devmap_driver_t *driver = (devmap_driver_t *) malloc(sizeof(devmap_driver_t)); |
if (driver == NULL) { |
ipc_answer_0(iid, ENOMEM); |
return; |
} |
/* |
* Get driver name |
*/ |
ipc_callid_t callid; |
size_t name_size; |
if (!ipc_data_write_receive(&callid, &name_size)) { |
free(driver); |
ipc_answer_0(callid, EREFUSED); |
ipc_answer_0(iid, EREFUSED); |
return; |
} |
if (name_size > DEVMAP_NAME_MAXLEN) { |
free(driver); |
ipc_answer_0(callid, EINVAL); |
ipc_answer_0(iid, EREFUSED); |
return; |
} |
/* |
* Allocate buffer for device name. |
*/ |
driver->name = (char *) malloc(name_size + 1); |
if (driver->name == NULL) { |
free(driver); |
ipc_answer_0(callid, ENOMEM); |
ipc_answer_0(iid, EREFUSED); |
return; |
} |
/* |
* Send confirmation to sender and get data into buffer. |
*/ |
if (ipc_data_write_finalize(callid, driver->name, name_size) != EOK) { |
free(driver->name); |
free(driver); |
ipc_answer_0(iid, EREFUSED); |
return; |
} |
driver->name[name_size] = 0; |
/* Initialize mutex for list of devices owned by this driver */ |
fibril_mutex_initialize(&driver->devices_mutex); |
/* |
* Initialize list of asociated devices |
*/ |
list_initialize(&driver->devices); |
/* |
* Create connection to the driver |
*/ |
ipc_call_t call; |
callid = async_get_call(&call); |
if (IPC_GET_METHOD(call) != IPC_M_CONNECT_TO_ME) { |
ipc_answer_0(callid, ENOTSUP); |
free(driver->name); |
free(driver); |
ipc_answer_0(iid, ENOTSUP); |
return; |
} |
driver->phone = IPC_GET_ARG5(call); |
ipc_answer_0(callid, EOK); |
list_initialize(&(driver->drivers)); |
fibril_mutex_lock(&drivers_list_mutex); |
/* TODO: |
* check that no driver with name equal to driver->name is registered |
*/ |
/* |
* Insert new driver into list of registered drivers |
*/ |
list_append(&(driver->drivers), &drivers_list); |
fibril_mutex_unlock(&drivers_list_mutex); |
ipc_answer_0(iid, EOK); |
*odriver = driver; |
} |
/** |
* Unregister device driver, unregister all its devices and free driver |
* structure. |
* |
*/ |
static int devmap_driver_unregister(devmap_driver_t *driver) |
{ |
if (driver == NULL) |
return EEXISTS; |
fibril_mutex_lock(&drivers_list_mutex); |
if (driver->phone != 0) |
ipc_hangup(driver->phone); |
/* Remove it from list of drivers */ |
list_remove(&(driver->drivers)); |
/* Unregister all its devices */ |
fibril_mutex_lock(&devices_list_mutex); |
fibril_mutex_lock(&driver->devices_mutex); |
while (!list_empty(&(driver->devices))) { |
devmap_device_t *device = list_get_instance(driver->devices.next, |
devmap_device_t, driver_devices); |
devmap_device_unregister_core(device); |
} |
fibril_mutex_unlock(&driver->devices_mutex); |
fibril_mutex_unlock(&devices_list_mutex); |
fibril_mutex_unlock(&drivers_list_mutex); |
/* free name and driver */ |
if (driver->name != NULL) |
free(driver->name); |
free(driver); |
return EOK; |
} |
/** Register instance of device |
* |
*/ |
static void devmap_device_register(ipc_callid_t iid, ipc_call_t *icall, |
devmap_driver_t *driver) |
{ |
if (driver == NULL) { |
ipc_answer_0(iid, EREFUSED); |
return; |
} |
/* Create new device entry */ |
devmap_device_t *device = (devmap_device_t *) malloc(sizeof(devmap_device_t)); |
if (device == NULL) { |
ipc_answer_0(iid, ENOMEM); |
return; |
} |
/* Get device name */ |
ipc_callid_t callid; |
size_t size; |
if (!ipc_data_write_receive(&callid, &size)) { |
free(device); |
ipc_answer_0(iid, EREFUSED); |
return; |
} |
if (size > DEVMAP_NAME_MAXLEN) { |
free(device); |
ipc_answer_0(callid, EINVAL); |
ipc_answer_0(iid, EREFUSED); |
return; |
} |
/* +1 for terminating \0 */ |
device->name = (char *) malloc(size + 1); |
if (device->name == NULL) { |
free(device); |
ipc_answer_0(callid, ENOMEM); |
ipc_answer_0(iid, EREFUSED); |
return; |
} |
ipc_data_write_finalize(callid, device->name, size); |
device->name[size] = 0; |
list_initialize(&(device->devices)); |
list_initialize(&(device->driver_devices)); |
fibril_mutex_lock(&devices_list_mutex); |
/* Check that device with such name is not already registered */ |
if (NULL != devmap_device_find_name(device->name)) { |
printf(NAME ": Device '%s' already registered\n", device->name); |
fibril_mutex_unlock(&devices_list_mutex); |
free(device->name); |
free(device); |
ipc_answer_0(iid, EEXISTS); |
return; |
} |
/* Get unique device handle */ |
device->handle = devmap_create_handle(); |
device->driver = driver; |
/* Insert device into list of all devices */ |
list_append(&device->devices, &devices_list); |
/* Insert device into list of devices that belog to one driver */ |
fibril_mutex_lock(&device->driver->devices_mutex); |
list_append(&device->driver_devices, &device->driver->devices); |
fibril_mutex_unlock(&device->driver->devices_mutex); |
fibril_condvar_broadcast(&devices_list_cv); |
fibril_mutex_unlock(&devices_list_mutex); |
ipc_answer_1(iid, EOK, device->handle); |
} |
/** |
* |
*/ |
static int devmap_device_unregister(ipc_callid_t iid, ipc_call_t *icall, |
devmap_driver_t *driver) |
{ |
/* TODO */ |
return EOK; |
} |
/** Connect client to the device. |
* |
* Find device driver owning requested device and forward |
* the message to it. |
* |
*/ |
static void devmap_forward(ipc_callid_t callid, ipc_call_t *call) |
{ |
/* |
* Get handle from request |
*/ |
dev_handle_t handle = IPC_GET_ARG2(*call); |
devmap_device_t *dev = devmap_device_find_handle(handle); |
if ((dev == NULL) || (dev->driver == NULL) || (dev->driver->phone == 0)) { |
ipc_answer_0(callid, ENOENT); |
return; |
} |
ipc_forward_fast(callid, dev->driver->phone, dev->handle, |
IPC_GET_ARG3(*call), 0, IPC_FF_NONE); |
} |
/** Find handle for device instance identified by name. |
* |
* In answer will be send EOK and device handle in arg1 or a error |
* code from errno.h. |
* |
*/ |
static void devmap_get_handle(ipc_callid_t iid, ipc_call_t *icall) |
{ |
/* |
* Wait for incoming message with device name (but do not |
* read the name itself until the buffer is allocated). |
*/ |
ipc_callid_t callid; |
size_t size; |
if (!ipc_data_write_receive(&callid, &size)) { |
ipc_answer_0(callid, EREFUSED); |
ipc_answer_0(iid, EREFUSED); |
return; |
} |
if ((size < 1) || (size > DEVMAP_NAME_MAXLEN)) { |
ipc_answer_0(callid, EINVAL); |
ipc_answer_0(iid, EREFUSED); |
return; |
} |
/* |
* Allocate buffer for device name. |
*/ |
char *name = (char *) malloc(size + 1); |
if (name == NULL) { |
ipc_answer_0(callid, ENOMEM); |
ipc_answer_0(iid, EREFUSED); |
return; |
} |
/* |
* Send confirmation to sender and get data into buffer. |
*/ |
ipcarg_t retval = ipc_data_write_finalize(callid, name, size); |
if (retval != EOK) { |
ipc_answer_0(iid, EREFUSED); |
free(name); |
return; |
} |
name[size] = '\0'; |
fibril_mutex_lock(&devices_list_mutex); |
const devmap_device_t *dev; |
recheck: |
/* |
* Find device name in the list of known devices. |
*/ |
dev = devmap_device_find_name(name); |
/* |
* Device was not found. |
*/ |
if (dev == NULL) { |
if (IPC_GET_ARG1(*icall) & IPC_FLAG_BLOCKING) { |
/* Blocking lookup */ |
fibril_condvar_wait(&devices_list_cv, |
&devices_list_mutex); |
goto recheck; |
} |
ipc_answer_0(iid, ENOENT); |
free(name); |
fibril_mutex_unlock(&devices_list_mutex); |
return; |
} |
fibril_mutex_unlock(&devices_list_mutex); |
ipc_answer_1(iid, EOK, dev->handle); |
free(name); |
} |
/** Find name of device identified by id and send it to caller. |
* |
*/ |
static void devmap_get_name(ipc_callid_t iid, ipc_call_t *icall) |
{ |
const devmap_device_t *device = devmap_device_find_handle(IPC_GET_ARG1(*icall)); |
/* |
* Device not found. |
*/ |
if (device == NULL) { |
ipc_answer_0(iid, ENOENT); |
return; |
} |
ipc_answer_0(iid, EOK); |
size_t name_size = str_size(device->name); |
/* FIXME: |
* We have no channel from DEVMAP to client, therefore |
* sending must be initiated by client. |
* |
* int rc = ipc_data_write_send(phone, device->name, name_size); |
* if (rc != EOK) { |
* async_wait_for(req, NULL); |
* return rc; |
* } |
*/ |
/* TODO: send name in response */ |
} |
static void devmap_get_count(ipc_callid_t iid, ipc_call_t *icall) |
{ |
fibril_mutex_lock(&devices_list_mutex); |
ipc_answer_1(iid, EOK, list_count(&devices_list)); |
fibril_mutex_unlock(&devices_list_mutex); |
} |
static void devmap_get_devices(ipc_callid_t iid, ipc_call_t *icall) |
{ |
fibril_mutex_lock(&devices_list_mutex); |
ipc_callid_t callid; |
size_t size; |
if (!ipc_data_read_receive(&callid, &size)) { |
ipc_answer_0(callid, EREFUSED); |
ipc_answer_0(iid, EREFUSED); |
return; |
} |
if ((size % sizeof(dev_desc_t)) != 0) { |
ipc_answer_0(callid, EINVAL); |
ipc_answer_0(iid, EREFUSED); |
return; |
} |
size_t count = size / sizeof(dev_desc_t); |
dev_desc_t *desc = (dev_desc_t *) malloc(size); |
if (desc == NULL) { |
ipc_answer_0(callid, ENOMEM); |
ipc_answer_0(iid, EREFUSED); |
return; |
} |
size_t pos = 0; |
link_t *item = devices_list.next; |
while ((item != &devices_list) && (pos < count)) { |
devmap_device_t *device = list_get_instance(item, devmap_device_t, devices); |
desc[pos].handle = device->handle; |
str_cpy(desc[pos].name, DEVMAP_NAME_MAXLEN, device->name); |
pos++; |
item = item->next; |
} |
ipcarg_t retval = ipc_data_read_finalize(callid, desc, pos * sizeof(dev_desc_t)); |
if (retval != EOK) { |
ipc_answer_0(iid, EREFUSED); |
free(desc); |
return; |
} |
free(desc); |
fibril_mutex_unlock(&devices_list_mutex); |
ipc_answer_1(iid, EOK, pos); |
} |
static void devmap_null_create(ipc_callid_t iid, ipc_call_t *icall) |
{ |
fibril_mutex_lock(&null_devices_mutex); |
unsigned int i; |
bool fnd = false; |
for (i = 0; i < NULL_DEVICES; i++) { |
if (null_devices[i] == NULL) { |
fnd = true; |
break; |
} |
} |
if (!fnd) { |
fibril_mutex_unlock(&null_devices_mutex); |
ipc_answer_0(iid, ENOMEM); |
return; |
} |
/* Create NULL device entry */ |
devmap_device_t *device = (devmap_device_t *) malloc(sizeof(devmap_device_t)); |
if (device == NULL) { |
fibril_mutex_unlock(&null_devices_mutex); |
ipc_answer_0(iid, ENOMEM); |
return; |
} |
char null[DEVMAP_NAME_MAXLEN]; |
snprintf(null, DEVMAP_NAME_MAXLEN, "null%u", i); |
device->name = str_dup(null); |
if (device->name == NULL) { |
fibril_mutex_unlock(&null_devices_mutex); |
free(device); |
ipc_answer_0(iid, ENOMEM); |
return; |
} |
list_initialize(&(device->devices)); |
list_initialize(&(device->driver_devices)); |
fibril_mutex_lock(&devices_list_mutex); |
/* Get unique device handle */ |
device->handle = devmap_create_handle(); |
device->driver = NULL; |
/* Insert device into list of all devices |
and into null devices array */ |
list_append(&device->devices, &devices_list); |
null_devices[i] = device; |
fibril_mutex_unlock(&devices_list_mutex); |
fibril_mutex_unlock(&null_devices_mutex); |
ipc_answer_1(iid, EOK, (ipcarg_t) i); |
} |
static void devmap_null_destroy(ipc_callid_t iid, ipc_call_t *icall) |
{ |
fibril_mutex_lock(&null_devices_mutex); |
ipcarg_t i = IPC_GET_ARG1(*icall); |
if (null_devices[i] == NULL) { |
ipc_answer_0(iid, ENOENT); |
return; |
} |
devmap_device_unregister_core(null_devices[i]); |
null_devices[i] = NULL; |
fibril_mutex_unlock(&null_devices_mutex); |
ipc_answer_0(iid, EOK); |
} |
/** Initialize device mapper. |
* |
* |
*/ |
static bool devmap_init(void) |
{ |
fibril_mutex_lock(&null_devices_mutex); |
unsigned int i; |
for (i = 0; i < NULL_DEVICES; i++) |
null_devices[i] = NULL; |
fibril_mutex_unlock(&null_devices_mutex); |
return true; |
} |
/** Handle connection with device driver. |
* |
*/ |
static void devmap_connection_driver(ipc_callid_t iid, ipc_call_t *icall) |
{ |
/* Accept connection */ |
ipc_answer_0(iid, EOK); |
devmap_driver_t *driver = NULL; |
devmap_driver_register(&driver); |
if (NULL == driver) |
return; |
bool cont = true; |
while (cont) { |
ipc_call_t call; |
ipc_callid_t callid = async_get_call(&call); |
switch (IPC_GET_METHOD(call)) { |
case IPC_M_PHONE_HUNGUP: |
cont = false; |
continue; |
case DEVMAP_DRIVER_UNREGISTER: |
if (NULL == driver) |
ipc_answer_0(callid, ENOENT); |
else |
ipc_answer_0(callid, EOK); |
break; |
case DEVMAP_DEVICE_REGISTER: |
/* Register one instance of device */ |
devmap_device_register(callid, &call, driver); |
break; |
case DEVMAP_DEVICE_UNREGISTER: |
/* Remove instance of device identified by handler */ |
devmap_device_unregister(callid, &call, driver); |
break; |
case DEVMAP_DEVICE_GET_HANDLE: |
devmap_get_handle(callid, &call); |
break; |
case DEVMAP_DEVICE_GET_NAME: |
devmap_get_name(callid, &call); |
break; |
default: |
if (!(callid & IPC_CALLID_NOTIFICATION)) |
ipc_answer_0(callid, ENOENT); |
} |
} |
if (driver != NULL) { |
/* |
* Unregister the device driver and all its devices. |
*/ |
devmap_driver_unregister(driver); |
driver = NULL; |
} |
} |
/** Handle connection with device client. |
* |
*/ |
static void devmap_connection_client(ipc_callid_t iid, ipc_call_t *icall) |
{ |
/* Accept connection */ |
ipc_answer_0(iid, EOK); |
bool cont = true; |
while (cont) { |
ipc_call_t call; |
ipc_callid_t callid = async_get_call(&call); |
switch (IPC_GET_METHOD(call)) { |
case IPC_M_PHONE_HUNGUP: |
cont = false; |
continue; |
case DEVMAP_DEVICE_GET_HANDLE: |
devmap_get_handle(callid, &call); |
break; |
case DEVMAP_DEVICE_GET_NAME: |
devmap_get_name(callid, &call); |
break; |
case DEVMAP_DEVICE_NULL_CREATE: |
devmap_null_create(callid, &call); |
break; |
case DEVMAP_DEVICE_NULL_DESTROY: |
devmap_null_destroy(callid, &call); |
break; |
case DEVMAP_DEVICE_GET_COUNT: |
devmap_get_count(callid, &call); |
break; |
case DEVMAP_DEVICE_GET_DEVICES: |
devmap_get_devices(callid, &call); |
break; |
default: |
if (!(callid & IPC_CALLID_NOTIFICATION)) |
ipc_answer_0(callid, ENOENT); |
} |
} |
} |
/** Function for handling connections to devmap |
* |
*/ |
static void devmap_connection(ipc_callid_t iid, ipc_call_t *icall) |
{ |
/* Select interface */ |
switch ((ipcarg_t) (IPC_GET_ARG1(*icall))) { |
case DEVMAP_DRIVER: |
devmap_connection_driver(iid, icall); |
break; |
case DEVMAP_CLIENT: |
devmap_connection_client(iid, icall); |
break; |
case DEVMAP_CONNECT_TO_DEVICE: |
/* Connect client to selected device */ |
devmap_forward(iid, icall); |
break; |
default: |
/* No such interface */ |
ipc_answer_0(iid, ENOENT); |
} |
} |
/** |
* |
*/ |
int main(int argc, char *argv[]) |
{ |
printf(NAME ": HelenOS Device Mapper\n"); |
if (!devmap_init()) { |
printf(NAME ": Error while initializing service\n"); |
return -1; |
} |
/* Set a handler of incomming connections */ |
async_set_client_connection(devmap_connection); |
/* Register device mapper at naming service */ |
ipcarg_t phonead; |
if (ipc_connect_to_me(PHONE_NS, SERVICE_DEVMAP, 0, 0, &phonead) != 0) |
return -1; |
printf(NAME ": Accepting connections\n"); |
async_manager(); |
/* Never reached */ |
return 0; |
} |
/** |
* @} |
*/ |
//branches/snapshot/uspace/srv/devmap/Makefile |
---|
0,0 → 1,77 |
# |
# Copyright (c) 2005 Martin Decky |
# All rights reserved. |
# |
# Redistribution and use in source and binary forms, with or without |
# modification, are permitted provided that the following conditions |
# are met: |
# |
# - Redistributions of source code must retain the above copyright |
# notice, this list of conditions and the following disclaimer. |
# - 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. |
# - The name of the author may not be used to endorse or promote products |
# derived from this software without specific prior written permission. |
# |
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
# |
## Setup toolchain |
# |
LIBC_PREFIX = ../../lib/libc |
SOFTINT_PREFIX = ../../lib/softint |
include $(LIBC_PREFIX)/Makefile.toolchain |
LIBS = $(LIBC_PREFIX)/libc.a |
## Sources |
# |
OUTPUT = devmap |
SOURCES = \ |
devmap.c |
CFLAGS += -D$(UARCH) |
OBJECTS := $(addsuffix .o,$(basename $(SOURCES))) |
.PHONY: all clean depend disasm |
all: $(OUTPUT) $(OUTPUT).disasm |
-include Makefile.depend |
clean: |
-rm -f $(OUTPUT) $(OUTPUT).map $(OUTPUT).disasm Makefile.depend $(OBJECTS) |
depend: |
$(CC) $(DEFS) $(CFLAGS) -M $(SOURCES) > Makefile.depend |
$(OUTPUT): $(OBJECTS) $(LIBS) |
$(LD) -T $(LIBC_PREFIX)/arch/$(UARCH)/_link.ld $(OBJECTS) $(LIBS) $(LFLAGS) -o $@ -Map $(OUTPUT).map |
disasm: $(OUTPUT).disasm |
$(OUTPUT).disasm: $(OUTPUT) |
$(OBJDUMP) -d $< > $@ |
%.o: %.S |
$(CC) $(DEFS) $(AFLAGS) $(CFLAGS) -D__ASM__ -c $< -o $@ |
%.o: %.s |
$(AS) $(AFLAGS) $< -o $@ |
%.o: %.c |
$(CC) $(DEFS) $(CFLAGS) -c $< -o $@ |
//branches/snapshot/uspace/srv/fs/devfs/devfs_ops.c |
---|
0,0 → 1,538 |
/* |
* Copyright (c) 2009 Martin Decky |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup fs |
* @{ |
*/ |
/** |
* @file devfs_ops.c |
* @brief Implementation of VFS operations for the devfs file system server. |
*/ |
#include <ipc/ipc.h> |
#include <bool.h> |
#include <errno.h> |
#include <malloc.h> |
#include <string.h> |
#include <libfs.h> |
#include <fibril_sync.h> |
#include <adt/hash_table.h> |
#include <sys/stat.h> |
#include "devfs.h" |
#include "devfs_ops.h" |
#define PLB_GET_CHAR(pos) (devfs_reg.plb_ro[pos % PLB_SIZE]) |
/** Opened devices structure */ |
typedef struct { |
dev_handle_t handle; |
int phone; |
size_t refcount; |
link_t link; |
} device_t; |
/** Hash table of opened devices */ |
static hash_table_t devices; |
/** Hash table mutex */ |
static FIBRIL_MUTEX_INITIALIZE(devices_mutex); |
#define DEVICES_KEYS 1 |
#define DEVICES_KEY_HANDLE 0 |
#define DEVICES_BUCKETS 256 |
/* Implementation of hash table interface for the nodes hash table. */ |
static hash_index_t devices_hash(unsigned long key[]) |
{ |
return key[DEVICES_KEY_HANDLE] % DEVICES_BUCKETS; |
} |
static int devices_compare(unsigned long key[], hash_count_t keys, link_t *item) |
{ |
device_t *dev = hash_table_get_instance(item, device_t, link); |
return (dev->handle == (dev_handle_t) key[DEVICES_KEY_HANDLE]); |
} |
static void devices_remove_callback(link_t *item) |
{ |
free(hash_table_get_instance(item, device_t, link)); |
} |
static hash_table_operations_t devices_ops = { |
.hash = devices_hash, |
.compare = devices_compare, |
.remove_callback = devices_remove_callback |
}; |
bool devfs_init(void) |
{ |
if (!hash_table_create(&devices, DEVICES_BUCKETS, |
DEVICES_KEYS, &devices_ops)) |
return false; |
if (devmap_get_phone(DEVMAP_CLIENT, IPC_FLAG_BLOCKING) < 0) |
return false; |
return true; |
} |
void devfs_mounted(ipc_callid_t rid, ipc_call_t *request) |
{ |
/* Accept the mount options */ |
ipc_callid_t callid; |
size_t size; |
if (!ipc_data_write_receive(&callid, &size)) { |
ipc_answer_0(callid, EINVAL); |
ipc_answer_0(rid, EINVAL); |
return; |
} |
char *opts = malloc(size + 1); |
if (!opts) { |
ipc_answer_0(callid, ENOMEM); |
ipc_answer_0(rid, ENOMEM); |
return; |
} |
ipcarg_t retval = ipc_data_write_finalize(callid, opts, size); |
if (retval != EOK) { |
ipc_answer_0(rid, retval); |
free(opts); |
return; |
} |
free(opts); |
ipc_answer_3(rid, EOK, 0, 0, 0); |
} |
void devfs_mount(ipc_callid_t rid, ipc_call_t *request) |
{ |
ipc_answer_0(rid, ENOTSUP); |
} |
void devfs_lookup(ipc_callid_t rid, ipc_call_t *request) |
{ |
ipcarg_t first = IPC_GET_ARG1(*request); |
ipcarg_t last = IPC_GET_ARG2(*request); |
dev_handle_t dev_handle = IPC_GET_ARG3(*request); |
ipcarg_t lflag = IPC_GET_ARG4(*request); |
fs_index_t index = IPC_GET_ARG5(*request); |
/* Hierarchy is flat, no altroot is supported */ |
if (index != 0) { |
ipc_answer_0(rid, ENOENT); |
return; |
} |
if ((lflag & L_LINK) || (lflag & L_UNLINK)) { |
ipc_answer_0(rid, ENOTSUP); |
return; |
} |
/* Eat slash */ |
if (PLB_GET_CHAR(first) == '/') { |
first++; |
first %= PLB_SIZE; |
} |
if (first >= last) { |
/* Root entry */ |
if (!(lflag & L_FILE)) |
ipc_answer_5(rid, EOK, devfs_reg.fs_handle, dev_handle, 0, 0, 0); |
else |
ipc_answer_0(rid, ENOENT); |
} else { |
if (!(lflag & L_DIRECTORY)) { |
size_t len; |
if (last >= first) |
len = last - first + 1; |
else |
len = first + PLB_SIZE - last + 1; |
char *name = (char *) malloc(len + 1); |
if (name == NULL) { |
ipc_answer_0(rid, ENOMEM); |
return; |
} |
size_t i; |
for (i = 0; i < len; i++) |
name[i] = PLB_GET_CHAR(first + i); |
name[len] = 0; |
dev_handle_t handle; |
if (devmap_device_get_handle(name, &handle, 0) != EOK) { |
free(name); |
ipc_answer_0(rid, ENOENT); |
return; |
} |
if (lflag & L_OPEN) { |
unsigned long key[] = { |
[DEVICES_KEY_HANDLE] = (unsigned long) handle |
}; |
fibril_mutex_lock(&devices_mutex); |
link_t *lnk = hash_table_find(&devices, key); |
if (lnk == NULL) { |
int phone = devmap_device_connect(handle, 0); |
if (phone < 0) { |
fibril_mutex_unlock(&devices_mutex); |
free(name); |
ipc_answer_0(rid, ENOENT); |
return; |
} |
device_t *dev = (device_t *) malloc(sizeof(device_t)); |
if (dev == NULL) { |
fibril_mutex_unlock(&devices_mutex); |
free(name); |
ipc_answer_0(rid, ENOMEM); |
return; |
} |
dev->handle = handle; |
dev->phone = phone; |
dev->refcount = 1; |
hash_table_insert(&devices, key, &dev->link); |
} else { |
device_t *dev = hash_table_get_instance(lnk, device_t, link); |
dev->refcount++; |
} |
fibril_mutex_unlock(&devices_mutex); |
} |
free(name); |
ipc_answer_5(rid, EOK, devfs_reg.fs_handle, dev_handle, handle, 0, 1); |
} else |
ipc_answer_0(rid, ENOENT); |
} |
} |
void devfs_open_node(ipc_callid_t rid, ipc_call_t *request) |
{ |
dev_handle_t handle = IPC_GET_ARG2(*request); |
unsigned long key[] = { |
[DEVICES_KEY_HANDLE] = (unsigned long) handle |
}; |
fibril_mutex_lock(&devices_mutex); |
link_t *lnk = hash_table_find(&devices, key); |
if (lnk == NULL) { |
int phone = devmap_device_connect(handle, 0); |
if (phone < 0) { |
fibril_mutex_unlock(&devices_mutex); |
ipc_answer_0(rid, ENOENT); |
return; |
} |
device_t *dev = (device_t *) malloc(sizeof(device_t)); |
if (dev == NULL) { |
fibril_mutex_unlock(&devices_mutex); |
ipc_answer_0(rid, ENOMEM); |
return; |
} |
dev->handle = handle; |
dev->phone = phone; |
dev->refcount = 1; |
hash_table_insert(&devices, key, &dev->link); |
} else { |
device_t *dev = hash_table_get_instance(lnk, device_t, link); |
dev->refcount++; |
} |
fibril_mutex_unlock(&devices_mutex); |
ipc_answer_3(rid, EOK, 0, 1, L_FILE); |
} |
void devfs_stat(ipc_callid_t rid, ipc_call_t *request) |
{ |
dev_handle_t dev_handle = (dev_handle_t) IPC_GET_ARG1(*request); |
fs_index_t index = (fs_index_t) IPC_GET_ARG2(*request); |
ipc_callid_t callid; |
size_t size; |
if (!ipc_data_read_receive(&callid, &size) || |
size < sizeof(struct stat)) { |
ipc_answer_0(callid, EINVAL); |
ipc_answer_0(rid, EINVAL); |
return; |
} |
struct stat *stat = malloc(sizeof(struct stat)); |
if (!stat) { |
ipc_answer_0(callid, ENOMEM); |
ipc_answer_0(rid, ENOMEM); |
return; |
} |
memset(stat, 0, sizeof(struct stat)); |
stat->fs_handle = devfs_reg.fs_handle; |
stat->dev_handle = dev_handle; |
stat->index = index; |
stat->lnkcnt = 1; |
stat->is_file = (index != 0); |
stat->size = 0; |
if (index != 0) { |
unsigned long key[] = { |
[DEVICES_KEY_HANDLE] = (unsigned long) index |
}; |
fibril_mutex_lock(&devices_mutex); |
link_t *lnk = hash_table_find(&devices, key); |
if (lnk != NULL) |
stat->devfs_stat.device = (dev_handle_t)index; |
fibril_mutex_unlock(&devices_mutex); |
} |
ipc_data_read_finalize(callid, stat, sizeof(struct stat)); |
ipc_answer_0(rid, EOK); |
free(stat); |
} |
void devfs_read(ipc_callid_t rid, ipc_call_t *request) |
{ |
fs_index_t index = (fs_index_t) IPC_GET_ARG2(*request); |
off_t pos = (off_t) IPC_GET_ARG3(*request); |
if (index != 0) { |
unsigned long key[] = { |
[DEVICES_KEY_HANDLE] = (unsigned long) index |
}; |
fibril_mutex_lock(&devices_mutex); |
link_t *lnk = hash_table_find(&devices, key); |
if (lnk == NULL) { |
fibril_mutex_unlock(&devices_mutex); |
ipc_answer_0(rid, ENOENT); |
return; |
} |
device_t *dev = hash_table_get_instance(lnk, device_t, link); |
ipc_callid_t callid; |
if (!ipc_data_read_receive(&callid, NULL)) { |
fibril_mutex_unlock(&devices_mutex); |
ipc_answer_0(callid, EINVAL); |
ipc_answer_0(rid, EINVAL); |
return; |
} |
/* Make a request at the driver */ |
ipc_call_t answer; |
aid_t msg = async_send_3(dev->phone, IPC_GET_METHOD(*request), |
IPC_GET_ARG1(*request), IPC_GET_ARG2(*request), |
IPC_GET_ARG3(*request), &answer); |
/* Forward the IPC_M_DATA_READ request to the driver */ |
ipc_forward_fast(callid, dev->phone, 0, 0, 0, IPC_FF_ROUTE_FROM_ME); |
fibril_mutex_unlock(&devices_mutex); |
/* Wait for reply from the driver. */ |
ipcarg_t rc; |
async_wait_for(msg, &rc); |
size_t bytes = IPC_GET_ARG1(answer); |
/* Driver reply is the final result of the whole operation */ |
ipc_answer_1(rid, rc, bytes); |
} else { |
ipc_callid_t callid; |
size_t size; |
if (!ipc_data_read_receive(&callid, &size)) { |
ipc_answer_0(callid, EINVAL); |
ipc_answer_0(rid, EINVAL); |
return; |
} |
size_t count = devmap_device_get_count(); |
dev_desc_t *desc = malloc(count * sizeof(dev_desc_t)); |
if (desc == NULL) { |
ipc_answer_0(callid, ENOMEM); |
ipc_answer_1(rid, ENOMEM, 0); |
return; |
} |
size_t max = devmap_device_get_devices(count, desc); |
if (pos < max) { |
ipc_data_read_finalize(callid, desc[pos].name, str_size(desc[pos].name) + 1); |
} else { |
ipc_answer_0(callid, ENOENT); |
ipc_answer_1(rid, ENOENT, 0); |
return; |
} |
free(desc); |
ipc_answer_1(rid, EOK, 1); |
} |
} |
void devfs_write(ipc_callid_t rid, ipc_call_t *request) |
{ |
fs_index_t index = (fs_index_t) IPC_GET_ARG2(*request); |
off_t pos = (off_t) IPC_GET_ARG3(*request); |
if (index != 0) { |
unsigned long key[] = { |
[DEVICES_KEY_HANDLE] = (unsigned long) index |
}; |
fibril_mutex_lock(&devices_mutex); |
link_t *lnk = hash_table_find(&devices, key); |
if (lnk == NULL) { |
fibril_mutex_unlock(&devices_mutex); |
ipc_answer_0(rid, ENOENT); |
return; |
} |
device_t *dev = hash_table_get_instance(lnk, device_t, link); |
ipc_callid_t callid; |
if (!ipc_data_write_receive(&callid, NULL)) { |
fibril_mutex_unlock(&devices_mutex); |
ipc_answer_0(callid, EINVAL); |
ipc_answer_0(rid, EINVAL); |
return; |
} |
/* Make a request at the driver */ |
ipc_call_t answer; |
aid_t msg = async_send_3(dev->phone, IPC_GET_METHOD(*request), |
IPC_GET_ARG1(*request), IPC_GET_ARG2(*request), |
IPC_GET_ARG3(*request), &answer); |
/* Forward the IPC_M_DATA_WRITE request to the driver */ |
ipc_forward_fast(callid, dev->phone, 0, 0, 0, IPC_FF_ROUTE_FROM_ME); |
fibril_mutex_unlock(&devices_mutex); |
/* Wait for reply from the driver. */ |
ipcarg_t rc; |
async_wait_for(msg, &rc); |
size_t bytes = IPC_GET_ARG1(answer); |
/* Driver reply is the final result of the whole operation */ |
ipc_answer_1(rid, rc, bytes); |
} else { |
/* Read-only filesystem */ |
ipc_answer_0(rid, ENOTSUP); |
} |
} |
void devfs_truncate(ipc_callid_t rid, ipc_call_t *request) |
{ |
ipc_answer_0(rid, ENOTSUP); |
} |
void devfs_close(ipc_callid_t rid, ipc_call_t *request) |
{ |
fs_index_t index = (fs_index_t) IPC_GET_ARG2(*request); |
if (index != 0) { |
unsigned long key[] = { |
[DEVICES_KEY_HANDLE] = (unsigned long) index |
}; |
fibril_mutex_lock(&devices_mutex); |
link_t *lnk = hash_table_find(&devices, key); |
if (lnk == NULL) { |
fibril_mutex_unlock(&devices_mutex); |
ipc_answer_0(rid, ENOENT); |
return; |
} |
device_t *dev = hash_table_get_instance(lnk, device_t, link); |
dev->refcount--; |
if (dev->refcount == 0) { |
ipc_hangup(dev->phone); |
hash_table_remove(&devices, key, DEVICES_KEYS); |
} |
fibril_mutex_unlock(&devices_mutex); |
ipc_answer_0(rid, EOK); |
} else |
ipc_answer_0(rid, ENOTSUP); |
} |
void devfs_sync(ipc_callid_t rid, ipc_call_t *request) |
{ |
fs_index_t index = (fs_index_t) IPC_GET_ARG2(*request); |
if (index != 0) { |
unsigned long key[] = { |
[DEVICES_KEY_HANDLE] = (unsigned long) index |
}; |
fibril_mutex_lock(&devices_mutex); |
link_t *lnk = hash_table_find(&devices, key); |
if (lnk == NULL) { |
fibril_mutex_unlock(&devices_mutex); |
ipc_answer_0(rid, ENOENT); |
return; |
} |
device_t *dev = hash_table_get_instance(lnk, device_t, link); |
/* Make a request at the driver */ |
ipc_call_t answer; |
aid_t msg = async_send_2(dev->phone, IPC_GET_METHOD(*request), |
IPC_GET_ARG1(*request), IPC_GET_ARG2(*request), &answer); |
fibril_mutex_unlock(&devices_mutex); |
/* Wait for reply from the driver */ |
ipcarg_t rc; |
async_wait_for(msg, &rc); |
/* Driver reply is the final result of the whole operation */ |
ipc_answer_0(rid, rc); |
} else |
ipc_answer_0(rid, ENOTSUP); |
} |
void devfs_destroy(ipc_callid_t rid, ipc_call_t *request) |
{ |
ipc_answer_0(rid, ENOTSUP); |
} |
/** |
* @} |
*/ |
//branches/snapshot/uspace/srv/fs/devfs/devfs.c |
---|
0,0 → 1,141 |
/* |
* Copyright (c) 2009 Martin Decky |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup fs |
* @{ |
*/ |
/** |
* @file devfs.c |
* @brief Devices file system. |
* |
* Every device registered to device mapper is represented as a file in this |
* file system. |
*/ |
#include <stdio.h> |
#include <ipc/ipc.h> |
#include <ipc/services.h> |
#include <async.h> |
#include <errno.h> |
#include <libfs.h> |
#include "devfs.h" |
#include "devfs_ops.h" |
#define NAME "devfs" |
static vfs_info_t devfs_vfs_info = { |
.name = "devfs", |
}; |
fs_reg_t devfs_reg; |
static void devfs_connection(ipc_callid_t iid, ipc_call_t *icall) |
{ |
if (iid) |
ipc_answer_0(iid, EOK); |
while (true) { |
ipc_call_t call; |
ipc_callid_t callid = async_get_call(&call); |
switch (IPC_GET_METHOD(call)) { |
case IPC_M_PHONE_HUNGUP: |
return; |
case VFS_OUT_MOUNTED: |
devfs_mounted(callid, &call); |
break; |
case VFS_OUT_MOUNT: |
devfs_mount(callid, &call); |
break; |
case VFS_OUT_LOOKUP: |
devfs_lookup(callid, &call); |
break; |
case VFS_OUT_OPEN_NODE: |
devfs_open_node(callid, &call); |
break; |
case VFS_OUT_STAT: |
devfs_stat(callid, &call); |
break; |
case VFS_OUT_READ: |
devfs_read(callid, &call); |
break; |
case VFS_OUT_WRITE: |
devfs_write(callid, &call); |
break; |
case VFS_OUT_TRUNCATE: |
devfs_truncate(callid, &call); |
break; |
case VFS_OUT_CLOSE: |
devfs_close(callid, &call); |
break; |
case VFS_OUT_SYNC: |
devfs_sync(callid, &call); |
break; |
case VFS_OUT_DESTROY: |
devfs_destroy(callid, &call); |
break; |
default: |
ipc_answer_0(callid, ENOTSUP); |
break; |
} |
} |
} |
int main(int argc, char *argv[]) |
{ |
printf(NAME ": HelenOS Device Filesystem\n"); |
if (!devfs_init()) { |
printf(NAME ": failed to initialize devfs\n"); |
return -1; |
} |
int vfs_phone = ipc_connect_me_to_blocking(PHONE_NS, SERVICE_VFS, 0, 0); |
if (vfs_phone < EOK) { |
printf(NAME ": Unable to connect to VFS\n"); |
return -1; |
} |
int rc = fs_register(vfs_phone, &devfs_reg, &devfs_vfs_info, |
devfs_connection); |
if (rc != EOK) { |
printf(NAME ": Failed to register file system (%d)\n", rc); |
return rc; |
} |
printf(NAME ": Accepting connections\n"); |
async_manager(); |
/* Not reached */ |
return 0; |
} |
/** |
* @} |
*/ |
//branches/snapshot/uspace/srv/fs/devfs/devfs_ops.h |
---|
0,0 → 1,57 |
/* |
* Copyright (c) 2009 Martin Decky |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup fs |
* @{ |
*/ |
#ifndef DEVFS_DEVFS_OPS_H_ |
#define DEVFS_DEVFS_OPS_H_ |
#include <ipc/ipc.h> |
#include <bool.h> |
extern bool devfs_init(void); |
extern void devfs_mounted(ipc_callid_t, ipc_call_t *); |
extern void devfs_mount(ipc_callid_t, ipc_call_t *); |
extern void devfs_lookup(ipc_callid_t, ipc_call_t *); |
extern void devfs_open_node(ipc_callid_t, ipc_call_t *); |
extern void devfs_stat(ipc_callid_t, ipc_call_t *); |
extern void devfs_sync(ipc_callid_t, ipc_call_t *); |
extern void devfs_read(ipc_callid_t, ipc_call_t *); |
extern void devfs_write(ipc_callid_t, ipc_call_t *); |
extern void devfs_truncate(ipc_callid_t, ipc_call_t *); |
extern void devfs_close(ipc_callid_t, ipc_call_t *); |
extern void devfs_destroy(ipc_callid_t, ipc_call_t *); |
#endif |
/** |
* @} |
*/ |
//branches/snapshot/uspace/srv/fs/devfs/Makefile |
---|
0,0 → 1,82 |
# |
# Copyright (c) 2005 Martin Decky |
# All rights reserved. |
# |
# Redistribution and use in source and binary forms, with or without |
# modification, are permitted provided that the following conditions |
# are met: |
# |
# - Redistributions of source code must retain the above copyright |
# notice, this list of conditions and the following disclaimer. |
# - 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. |
# - The name of the author may not be used to endorse or promote products |
# derived from this software without specific prior written permission. |
# |
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
# |
## Setup toolchain |
# |
LIBC_PREFIX = ../../../lib/libc |
LIBFS_PREFIX = ../../../lib/libfs |
SOFTINT_PREFIX = ../../../lib/softint |
include $(LIBC_PREFIX)/Makefile.toolchain |
CFLAGS += -I $(LIBFS_PREFIX) |
LIBS = \ |
$(LIBFS_PREFIX)/libfs.a \ |
$(LIBC_PREFIX)/libc.a |
## Sources |
# |
OUTPUT = devfs |
SOURCES = \ |
devfs.c \ |
devfs_ops.c |
OBJECTS := $(addsuffix .o,$(basename $(SOURCES))) |
.PHONY: all clean depend disasm |
all: $(OUTPUT) $(OUTPUT).disasm |
-include Makefile.depend |
clean: |
-rm -f $(OUTPUT) $(OUTPUT).map $(OUTPUT).disasm Makefile.depend $(OBJECTS) |
depend: |
$(CC) $(DEFS) $(CFLAGS) -M $(SOURCES) > Makefile.depend |
$(OUTPUT): $(OBJECTS) $(LIBS) |
$(LD) -T $(LIBC_PREFIX)/arch/$(UARCH)/_link.ld $(OBJECTS) $(LIBS) $(LFLAGS) -o $@ -Map $(OUTPUT).map |
disasm: $(OUTPUT).disasm |
$(OUTPUT).disasm: $(OUTPUT) |
$(OBJDUMP) -d $< > $@ |
%.o: %.S |
$(CC) $(DEFS) $(AFLAGS) $(CFLAGS) -D__ASM__ -c $< -o $@ |
%.o: %.s |
$(AS) $(AFLAGS) $< -o $@ |
%.o: %.c |
$(CC) $(DEFS) $(CFLAGS) -c $< -o $@ |
//branches/snapshot/uspace/srv/fs/devfs/devfs.h |
---|
0,0 → 1,44 |
/* |
* Copyright (c) 2009 Martin Decky |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup fs |
* @{ |
*/ |
#ifndef DEVFS_DEVFS_H_ |
#define DEVFS_DEVFS_H_ |
#include <libfs.h> |
extern fs_reg_t devfs_reg; |
#endif |
/** |
* @} |
*/ |
//branches/snapshot/uspace/srv/fs/tmpfs/tmpfs_ops.c |
---|
0,0 → 1,644 |
/* |
* Copyright (c) 2008 Jakub Jermar |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup fs |
* @{ |
*/ |
/** |
* @file tmpfs_ops.c |
* @brief Implementation of VFS operations for the TMPFS file system |
* server. |
*/ |
#include "tmpfs.h" |
#include "../../vfs/vfs.h" |
#include <ipc/ipc.h> |
#include <async.h> |
#include <errno.h> |
#include <atomic.h> |
#include <stdlib.h> |
#include <string.h> |
#include <stdio.h> |
#include <assert.h> |
#include <sys/types.h> |
#include <adt/hash_table.h> |
#include <as.h> |
#include <libfs.h> |
#define min(a, b) ((a) < (b) ? (a) : (b)) |
#define max(a, b) ((a) > (b) ? (a) : (b)) |
#define NODES_BUCKETS 256 |
/** All root nodes have index 0. */ |
#define TMPFS_SOME_ROOT 0 |
/** Global counter for assigning node indices. Shared by all instances. */ |
fs_index_t tmpfs_next_index = 1; |
/* |
* Implementation of the libfs interface. |
*/ |
/* Forward declarations of static functions. */ |
static fs_node_t *tmpfs_match(fs_node_t *, const char *); |
static fs_node_t *tmpfs_node_get(dev_handle_t, fs_index_t); |
static void tmpfs_node_put(fs_node_t *); |
static fs_node_t *tmpfs_create_node(dev_handle_t, int); |
static int tmpfs_link_node(fs_node_t *, fs_node_t *, const char *); |
static int tmpfs_unlink_node(fs_node_t *, fs_node_t *, const char *); |
static int tmpfs_destroy_node(fs_node_t *); |
/* Implementation of helper functions. */ |
static fs_index_t tmpfs_index_get(fs_node_t *fn) |
{ |
return TMPFS_NODE(fn)->index; |
} |
static size_t tmpfs_size_get(fs_node_t *fn) |
{ |
return TMPFS_NODE(fn)->size; |
} |
static unsigned tmpfs_lnkcnt_get(fs_node_t *fn) |
{ |
return TMPFS_NODE(fn)->lnkcnt; |
} |
static bool tmpfs_has_children(fs_node_t *fn) |
{ |
return !list_empty(&TMPFS_NODE(fn)->cs_head); |
} |
static fs_node_t *tmpfs_root_get(dev_handle_t dev_handle) |
{ |
return tmpfs_node_get(dev_handle, TMPFS_SOME_ROOT); |
} |
static char tmpfs_plb_get_char(unsigned pos) |
{ |
return tmpfs_reg.plb_ro[pos % PLB_SIZE]; |
} |
static bool tmpfs_is_directory(fs_node_t *fn) |
{ |
return TMPFS_NODE(fn)->type == TMPFS_DIRECTORY; |
} |
static bool tmpfs_is_file(fs_node_t *fn) |
{ |
return TMPFS_NODE(fn)->type == TMPFS_FILE; |
} |
/** libfs operations */ |
libfs_ops_t tmpfs_libfs_ops = { |
.match = tmpfs_match, |
.node_get = tmpfs_node_get, |
.node_put = tmpfs_node_put, |
.create = tmpfs_create_node, |
.destroy = tmpfs_destroy_node, |
.link = tmpfs_link_node, |
.unlink = tmpfs_unlink_node, |
.index_get = tmpfs_index_get, |
.size_get = tmpfs_size_get, |
.lnkcnt_get = tmpfs_lnkcnt_get, |
.has_children = tmpfs_has_children, |
.root_get = tmpfs_root_get, |
.plb_get_char = tmpfs_plb_get_char, |
.is_directory = tmpfs_is_directory, |
.is_file = tmpfs_is_file |
}; |
/** Hash table of all TMPFS nodes. */ |
hash_table_t nodes; |
#define NODES_KEY_INDEX 0 |
#define NODES_KEY_DEV 1 |
/* Implementation of hash table interface for the nodes hash table. */ |
static hash_index_t nodes_hash(unsigned long key[]) |
{ |
return key[NODES_KEY_INDEX] % NODES_BUCKETS; |
} |
static int nodes_compare(unsigned long key[], hash_count_t keys, link_t *item) |
{ |
tmpfs_node_t *nodep = hash_table_get_instance(item, tmpfs_node_t, |
nh_link); |
return (nodep->index == key[NODES_KEY_INDEX] && |
nodep->dev_handle == key[NODES_KEY_DEV]); |
} |
static void nodes_remove_callback(link_t *item) |
{ |
} |
/** TMPFS nodes hash table operations. */ |
hash_table_operations_t nodes_ops = { |
.hash = nodes_hash, |
.compare = nodes_compare, |
.remove_callback = nodes_remove_callback |
}; |
static void tmpfs_node_initialize(tmpfs_node_t *nodep) |
{ |
nodep->bp = NULL; |
nodep->index = 0; |
nodep->dev_handle = 0; |
nodep->type = TMPFS_NONE; |
nodep->lnkcnt = 0; |
nodep->size = 0; |
nodep->data = NULL; |
link_initialize(&nodep->nh_link); |
list_initialize(&nodep->cs_head); |
} |
static void tmpfs_dentry_initialize(tmpfs_dentry_t *dentryp) |
{ |
link_initialize(&dentryp->link); |
dentryp->name = NULL; |
dentryp->node = NULL; |
} |
bool tmpfs_init(void) |
{ |
if (!hash_table_create(&nodes, NODES_BUCKETS, 2, &nodes_ops)) |
return false; |
return true; |
} |
static bool tmpfs_instance_init(dev_handle_t dev_handle) |
{ |
fs_node_t *rfn; |
rfn = tmpfs_create_node(dev_handle, L_DIRECTORY); |
if (!rfn) |
return false; |
TMPFS_NODE(rfn)->lnkcnt = 0; /* FS root is not linked */ |
return true; |
} |
fs_node_t *tmpfs_match(fs_node_t *pfn, const char *component) |
{ |
tmpfs_node_t *parentp = TMPFS_NODE(pfn); |
link_t *lnk; |
for (lnk = parentp->cs_head.next; lnk != &parentp->cs_head; |
lnk = lnk->next) { |
tmpfs_dentry_t *dentryp = list_get_instance(lnk, tmpfs_dentry_t, |
link); |
if (!str_cmp(dentryp->name, component)) |
return FS_NODE(dentryp->node); |
} |
return NULL; |
} |
fs_node_t *tmpfs_node_get(dev_handle_t dev_handle, fs_index_t index) |
{ |
unsigned long key[] = { |
[NODES_KEY_INDEX] = index, |
[NODES_KEY_DEV] = dev_handle |
}; |
link_t *lnk = hash_table_find(&nodes, key); |
if (!lnk) |
return NULL; |
return FS_NODE(hash_table_get_instance(lnk, tmpfs_node_t, nh_link)); |
} |
void tmpfs_node_put(fs_node_t *fn) |
{ |
/* nothing to do */ |
} |
fs_node_t *tmpfs_create_node(dev_handle_t dev_handle, int lflag) |
{ |
assert((lflag & L_FILE) ^ (lflag & L_DIRECTORY)); |
tmpfs_node_t *nodep = malloc(sizeof(tmpfs_node_t)); |
if (!nodep) |
return NULL; |
tmpfs_node_initialize(nodep); |
nodep->bp = malloc(sizeof(fs_node_t)); |
if (!nodep->bp) { |
free(nodep); |
return NULL; |
} |
fs_node_initialize(nodep->bp); |
nodep->bp->data = nodep; /* link the FS and TMPFS nodes */ |
if (!tmpfs_root_get(dev_handle)) |
nodep->index = TMPFS_SOME_ROOT; |
else |
nodep->index = tmpfs_next_index++; |
nodep->dev_handle = dev_handle; |
if (lflag & L_DIRECTORY) |
nodep->type = TMPFS_DIRECTORY; |
else |
nodep->type = TMPFS_FILE; |
/* Insert the new node into the nodes hash table. */ |
unsigned long key[] = { |
[NODES_KEY_INDEX] = nodep->index, |
[NODES_KEY_DEV] = nodep->dev_handle |
}; |
hash_table_insert(&nodes, key, &nodep->nh_link); |
return FS_NODE(nodep); |
} |
int tmpfs_link_node(fs_node_t *pfn, fs_node_t *cfn, const char *nm) |
{ |
tmpfs_node_t *parentp = TMPFS_NODE(pfn); |
tmpfs_node_t *childp = TMPFS_NODE(cfn); |
tmpfs_dentry_t *dentryp; |
link_t *lnk; |
assert(parentp->type == TMPFS_DIRECTORY); |
/* Check for duplicit entries. */ |
for (lnk = parentp->cs_head.next; lnk != &parentp->cs_head; |
lnk = lnk->next) { |
dentryp = list_get_instance(lnk, tmpfs_dentry_t, link); |
if (!str_cmp(dentryp->name, nm)) |
return EEXIST; |
} |
/* Allocate and initialize the dentry. */ |
dentryp = malloc(sizeof(tmpfs_dentry_t)); |
if (!dentryp) |
return ENOMEM; |
tmpfs_dentry_initialize(dentryp); |
/* Populate and link the new dentry. */ |
size_t size = str_size(nm); |
dentryp->name = malloc(size + 1); |
if (!dentryp->name) { |
free(dentryp); |
return ENOMEM; |
} |
str_cpy(dentryp->name, size + 1, nm); |
dentryp->node = childp; |
childp->lnkcnt++; |
list_append(&dentryp->link, &parentp->cs_head); |
return EOK; |
} |
int tmpfs_unlink_node(fs_node_t *pfn, fs_node_t *cfn, const char *nm) |
{ |
tmpfs_node_t *parentp = TMPFS_NODE(pfn); |
tmpfs_node_t *childp = NULL; |
tmpfs_dentry_t *dentryp; |
link_t *lnk; |
if (!parentp) |
return EBUSY; |
for (lnk = parentp->cs_head.next; lnk != &parentp->cs_head; |
lnk = lnk->next) { |
dentryp = list_get_instance(lnk, tmpfs_dentry_t, link); |
if (!str_cmp(dentryp->name, nm)) { |
childp = dentryp->node; |
assert(FS_NODE(childp) == cfn); |
break; |
} |
} |
if (!childp) |
return ENOENT; |
if ((childp->lnkcnt == 1) && !list_empty(&childp->cs_head)) |
return ENOTEMPTY; |
list_remove(&dentryp->link); |
free(dentryp); |
childp->lnkcnt--; |
return EOK; |
} |
int tmpfs_destroy_node(fs_node_t *fn) |
{ |
tmpfs_node_t *nodep = TMPFS_NODE(fn); |
assert(!nodep->lnkcnt); |
assert(list_empty(&nodep->cs_head)); |
unsigned long key[] = { |
[NODES_KEY_INDEX] = nodep->index, |
[NODES_KEY_DEV] = nodep->dev_handle |
}; |
hash_table_remove(&nodes, key, 2); |
if (nodep->type == TMPFS_FILE) |
free(nodep->data); |
free(nodep->bp); |
free(nodep); |
return EOK; |
} |
void tmpfs_mounted(ipc_callid_t rid, ipc_call_t *request) |
{ |
dev_handle_t dev_handle = (dev_handle_t) IPC_GET_ARG1(*request); |
/* accept the mount options */ |
ipc_callid_t callid; |
size_t size; |
if (!ipc_data_write_receive(&callid, &size)) { |
ipc_answer_0(callid, EINVAL); |
ipc_answer_0(rid, EINVAL); |
return; |
} |
char *opts = malloc(size + 1); |
if (!opts) { |
ipc_answer_0(callid, ENOMEM); |
ipc_answer_0(rid, ENOMEM); |
return; |
} |
ipcarg_t retval = ipc_data_write_finalize(callid, opts, size); |
if (retval != EOK) { |
ipc_answer_0(rid, retval); |
free(opts); |
return; |
} |
opts[size] = '\0'; |
/* Initialize TMPFS instance. */ |
if (!tmpfs_instance_init(dev_handle)) { |
ipc_answer_0(rid, ENOMEM); |
return; |
} |
tmpfs_node_t *rootp = TMPFS_NODE(tmpfs_root_get(dev_handle)); |
if (str_cmp(opts, "restore") == 0) { |
if (tmpfs_restore(dev_handle)) |
ipc_answer_3(rid, EOK, rootp->index, rootp->size, |
rootp->lnkcnt); |
else |
ipc_answer_0(rid, ELIMIT); |
} else { |
ipc_answer_3(rid, EOK, rootp->index, rootp->size, |
rootp->lnkcnt); |
} |
} |
void tmpfs_mount(ipc_callid_t rid, ipc_call_t *request) |
{ |
libfs_mount(&tmpfs_libfs_ops, tmpfs_reg.fs_handle, rid, request); |
} |
void tmpfs_lookup(ipc_callid_t rid, ipc_call_t *request) |
{ |
libfs_lookup(&tmpfs_libfs_ops, tmpfs_reg.fs_handle, rid, request); |
} |
void tmpfs_read(ipc_callid_t rid, ipc_call_t *request) |
{ |
dev_handle_t dev_handle = (dev_handle_t)IPC_GET_ARG1(*request); |
fs_index_t index = (fs_index_t)IPC_GET_ARG2(*request); |
off_t pos = (off_t)IPC_GET_ARG3(*request); |
/* |
* Lookup the respective TMPFS node. |
*/ |
link_t *hlp; |
unsigned long key[] = { |
[NODES_KEY_INDEX] = index, |
[NODES_KEY_DEV] = dev_handle, |
}; |
hlp = hash_table_find(&nodes, key); |
if (!hlp) { |
ipc_answer_0(rid, ENOENT); |
return; |
} |
tmpfs_node_t *nodep = hash_table_get_instance(hlp, tmpfs_node_t, |
nh_link); |
/* |
* Receive the read request. |
*/ |
ipc_callid_t callid; |
size_t size; |
if (!ipc_data_read_receive(&callid, &size)) { |
ipc_answer_0(callid, EINVAL); |
ipc_answer_0(rid, EINVAL); |
return; |
} |
size_t bytes; |
if (nodep->type == TMPFS_FILE) { |
bytes = max(0, min(nodep->size - pos, size)); |
(void) ipc_data_read_finalize(callid, nodep->data + pos, |
bytes); |
} else { |
tmpfs_dentry_t *dentryp; |
link_t *lnk; |
int i; |
assert(nodep->type == TMPFS_DIRECTORY); |
/* |
* Yes, we really use O(n) algorithm here. |
* If it bothers someone, it could be fixed by introducing a |
* hash table. |
*/ |
for (i = 0, lnk = nodep->cs_head.next; |
i < pos && lnk != &nodep->cs_head; |
i++, lnk = lnk->next) |
; |
if (lnk == &nodep->cs_head) { |
ipc_answer_0(callid, ENOENT); |
ipc_answer_1(rid, ENOENT, 0); |
return; |
} |
dentryp = list_get_instance(lnk, tmpfs_dentry_t, link); |
(void) ipc_data_read_finalize(callid, dentryp->name, |
str_size(dentryp->name) + 1); |
bytes = 1; |
} |
/* |
* Answer the VFS_READ call. |
*/ |
ipc_answer_1(rid, EOK, bytes); |
} |
void tmpfs_write(ipc_callid_t rid, ipc_call_t *request) |
{ |
dev_handle_t dev_handle = (dev_handle_t)IPC_GET_ARG1(*request); |
fs_index_t index = (fs_index_t)IPC_GET_ARG2(*request); |
off_t pos = (off_t)IPC_GET_ARG3(*request); |
/* |
* Lookup the respective TMPFS node. |
*/ |
link_t *hlp; |
unsigned long key[] = { |
[NODES_KEY_INDEX] = index, |
[NODES_KEY_DEV] = dev_handle |
}; |
hlp = hash_table_find(&nodes, key); |
if (!hlp) { |
ipc_answer_0(rid, ENOENT); |
return; |
} |
tmpfs_node_t *nodep = hash_table_get_instance(hlp, tmpfs_node_t, |
nh_link); |
/* |
* Receive the write request. |
*/ |
ipc_callid_t callid; |
size_t size; |
if (!ipc_data_write_receive(&callid, &size)) { |
ipc_answer_0(callid, EINVAL); |
ipc_answer_0(rid, EINVAL); |
return; |
} |
/* |
* Check whether the file needs to grow. |
*/ |
if (pos + size <= nodep->size) { |
/* The file size is not changing. */ |
(void) ipc_data_write_finalize(callid, nodep->data + pos, size); |
ipc_answer_2(rid, EOK, size, nodep->size); |
return; |
} |
size_t delta = (pos + size) - nodep->size; |
/* |
* At this point, we are deliberately extremely straightforward and |
* simply realloc the contents of the file on every write that grows the |
* file. In the end, the situation might not be as bad as it may look: |
* our heap allocator can save us and just grow the block whenever |
* possible. |
*/ |
void *newdata = realloc(nodep->data, nodep->size + delta); |
if (!newdata) { |
ipc_answer_0(callid, ENOMEM); |
ipc_answer_2(rid, EOK, 0, nodep->size); |
return; |
} |
/* Clear any newly allocated memory in order to emulate gaps. */ |
memset(newdata + nodep->size, 0, delta); |
nodep->size += delta; |
nodep->data = newdata; |
(void) ipc_data_write_finalize(callid, nodep->data + pos, size); |
ipc_answer_2(rid, EOK, size, nodep->size); |
} |
void tmpfs_truncate(ipc_callid_t rid, ipc_call_t *request) |
{ |
dev_handle_t dev_handle = (dev_handle_t)IPC_GET_ARG1(*request); |
fs_index_t index = (fs_index_t)IPC_GET_ARG2(*request); |
size_t size = (off_t)IPC_GET_ARG3(*request); |
/* |
* Lookup the respective TMPFS node. |
*/ |
link_t *hlp; |
unsigned long key[] = { |
[NODES_KEY_INDEX] = index, |
[NODES_KEY_DEV] = dev_handle |
}; |
hlp = hash_table_find(&nodes, key); |
if (!hlp) { |
ipc_answer_0(rid, ENOENT); |
return; |
} |
tmpfs_node_t *nodep = hash_table_get_instance(hlp, tmpfs_node_t, |
nh_link); |
if (size == nodep->size) { |
ipc_answer_0(rid, EOK); |
return; |
} |
void *newdata = realloc(nodep->data, size); |
if (!newdata) { |
ipc_answer_0(rid, ENOMEM); |
return; |
} |
if (size > nodep->size) { |
size_t delta = size - nodep->size; |
memset(newdata + nodep->size, 0, delta); |
} |
nodep->size = size; |
nodep->data = newdata; |
ipc_answer_0(rid, EOK); |
} |
void tmpfs_close(ipc_callid_t rid, ipc_call_t *request) |
{ |
ipc_answer_0(rid, EOK); |
} |
void tmpfs_destroy(ipc_callid_t rid, ipc_call_t *request) |
{ |
dev_handle_t dev_handle = (dev_handle_t)IPC_GET_ARG1(*request); |
fs_index_t index = (fs_index_t)IPC_GET_ARG2(*request); |
int rc; |
link_t *hlp; |
unsigned long key[] = { |
[NODES_KEY_INDEX] = index, |
[NODES_KEY_DEV] = dev_handle |
}; |
hlp = hash_table_find(&nodes, key); |
if (!hlp) { |
ipc_answer_0(rid, ENOENT); |
return; |
} |
tmpfs_node_t *nodep = hash_table_get_instance(hlp, tmpfs_node_t, |
nh_link); |
rc = tmpfs_destroy_node(FS_NODE(nodep)); |
ipc_answer_0(rid, rc); |
} |
void tmpfs_open_node(ipc_callid_t rid, ipc_call_t *request) |
{ |
libfs_open_node(&tmpfs_libfs_ops, tmpfs_reg.fs_handle, rid, request); |
} |
void tmpfs_stat(ipc_callid_t rid, ipc_call_t *request) |
{ |
libfs_stat(&tmpfs_libfs_ops, tmpfs_reg.fs_handle, rid, request); |
} |
void tmpfs_sync(ipc_callid_t rid, ipc_call_t *request) |
{ |
/* Dummy implementation */ |
ipc_answer_0(rid, EOK); |
} |
/** |
* @} |
*/ |
//branches/snapshot/uspace/srv/fs/tmpfs/tmpfs.h |
---|
0,0 → 1,101 |
/* |
* Copyright (c) 2008 Jakub Jermar |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup fs |
* @{ |
*/ |
#ifndef TMPFS_TMPFS_H_ |
#define TMPFS_TMPFS_H_ |
#include <ipc/ipc.h> |
#include <libfs.h> |
#include <atomic.h> |
#include <sys/types.h> |
#include <bool.h> |
#include <adt/hash_table.h> |
#ifndef dprintf |
#define dprintf(...) printf(__VA_ARGS__) |
#endif |
#define TMPFS_NODE(node) ((node) ? (tmpfs_node_t *)(node)->data : NULL) |
#define FS_NODE(node) ((node) ? (node)->bp : NULL) |
typedef enum { |
TMPFS_NONE, |
TMPFS_FILE, |
TMPFS_DIRECTORY |
} tmpfs_dentry_type_t; |
/* forward declaration */ |
struct tmpfs_node; |
typedef struct tmpfs_dentry { |
link_t link; /**< Linkage for the list of siblings. */ |
struct tmpfs_node *node;/**< Back pointer to TMPFS node. */ |
char *name; /**< Name of dentry. */ |
} tmpfs_dentry_t; |
typedef struct tmpfs_node { |
fs_node_t *bp; /**< Back pointer to the FS node. */ |
fs_index_t index; /**< TMPFS node index. */ |
dev_handle_t dev_handle;/**< Device handle. */ |
link_t nh_link; /**< Nodes hash table link. */ |
tmpfs_dentry_type_t type; |
unsigned lnkcnt; /**< Link count. */ |
size_t size; /**< File size if type is TMPFS_FILE. */ |
void *data; /**< File content's if type is TMPFS_FILE. */ |
link_t cs_head; /**< Head of child's siblings list. */ |
} tmpfs_node_t; |
extern fs_reg_t tmpfs_reg; |
extern libfs_ops_t tmpfs_libfs_ops; |
extern bool tmpfs_init(void); |
extern void tmpfs_mounted(ipc_callid_t, ipc_call_t *); |
extern void tmpfs_mount(ipc_callid_t, ipc_call_t *); |
extern void tmpfs_lookup(ipc_callid_t, ipc_call_t *); |
extern void tmpfs_read(ipc_callid_t, ipc_call_t *); |
extern void tmpfs_write(ipc_callid_t, ipc_call_t *); |
extern void tmpfs_truncate(ipc_callid_t, ipc_call_t *); |
extern void tmpfs_stat(ipc_callid_t, ipc_call_t *); |
extern void tmpfs_close(ipc_callid_t, ipc_call_t *); |
extern void tmpfs_destroy(ipc_callid_t, ipc_call_t *); |
extern void tmpfs_open_node(ipc_callid_t, ipc_call_t *); |
extern void tmpfs_sync(ipc_callid_t, ipc_call_t *); |
extern bool tmpfs_restore(dev_handle_t); |
#endif |
/** |
* @} |
*/ |
//branches/snapshot/uspace/srv/fs/tmpfs/tmpfs.c |
---|
0,0 → 1,171 |
/* |
* Copyright (c) 2006 Martin Decky |
* Copyright (c) 2008 Jakub Jermar |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup fs |
* @{ |
*/ |
/** |
* @file tmpfs.c |
* @brief File system driver for in-memory file system. |
* |
* Every instance of tmpfs exists purely in memory and has neither a disk layout |
* nor any permanent storage (e.g. disk blocks). With each system reboot, data |
* stored in a tmpfs file system is lost. |
*/ |
#include "tmpfs.h" |
#include <ipc/ipc.h> |
#include <ipc/services.h> |
#include <async.h> |
#include <errno.h> |
#include <unistd.h> |
#include <stdio.h> |
#include <libfs.h> |
#include "../../vfs/vfs.h" |
#define NAME "tmpfs" |
vfs_info_t tmpfs_vfs_info = { |
.name = "tmpfs", |
}; |
fs_reg_t tmpfs_reg; |
/** |
* This connection fibril processes VFS requests from VFS. |
* |
* In order to support simultaneous VFS requests, our design is as follows. |
* The connection fibril accepts VFS requests from VFS. If there is only one |
* instance of the fibril, VFS will need to serialize all VFS requests it sends |
* to FAT. To overcome this bottleneck, VFS can send TMPFS the |
* IPC_M_CONNECT_ME_TO call. In that case, a new connection fibril will be |
* created, which in turn will accept the call. Thus, a new phone will be |
* opened for VFS. |
* |
* There are few issues with this arrangement. First, VFS can run out of |
* available phones. In that case, VFS can close some other phones or use one |
* phone for more serialized requests. Similarily, TMPFS can refuse to duplicate |
* the connection. VFS should then just make use of already existing phones and |
* route its requests through them. To avoid paying the fibril creation price |
* upon each request, TMPFS might want to keep the connections open after the |
* request has been completed. |
*/ |
static void tmpfs_connection(ipc_callid_t iid, ipc_call_t *icall) |
{ |
if (iid) { |
/* |
* This only happens for connections opened by |
* IPC_M_CONNECT_ME_TO calls as opposed to callback connections |
* created by IPC_M_CONNECT_TO_ME. |
*/ |
ipc_answer_0(iid, EOK); |
} |
dprintf("VFS-TMPFS connection established.\n"); |
while (1) { |
ipc_callid_t callid; |
ipc_call_t call; |
callid = async_get_call(&call); |
switch (IPC_GET_METHOD(call)) { |
case IPC_M_PHONE_HUNGUP: |
return; |
case VFS_OUT_MOUNTED: |
tmpfs_mounted(callid, &call); |
break; |
case VFS_OUT_MOUNT: |
tmpfs_mount(callid, &call); |
break; |
case VFS_OUT_LOOKUP: |
tmpfs_lookup(callid, &call); |
break; |
case VFS_OUT_READ: |
tmpfs_read(callid, &call); |
break; |
case VFS_OUT_WRITE: |
tmpfs_write(callid, &call); |
break; |
case VFS_OUT_TRUNCATE: |
tmpfs_truncate(callid, &call); |
break; |
case VFS_OUT_CLOSE: |
tmpfs_close(callid, &call); |
break; |
case VFS_OUT_DESTROY: |
tmpfs_destroy(callid, &call); |
break; |
case VFS_OUT_OPEN_NODE: |
tmpfs_open_node(callid, &call); |
break; |
case VFS_OUT_STAT: |
tmpfs_stat(callid, &call); |
break; |
case VFS_OUT_SYNC: |
tmpfs_sync(callid, &call); |
break; |
default: |
ipc_answer_0(callid, ENOTSUP); |
break; |
} |
} |
} |
int main(int argc, char **argv) |
{ |
printf(NAME ": HelenOS TMPFS file system server\n"); |
if (!tmpfs_init()) { |
printf(NAME ": failed to initialize TMPFS\n"); |
return -1; |
} |
int vfs_phone = ipc_connect_me_to_blocking(PHONE_NS, SERVICE_VFS, 0, 0); |
if (vfs_phone < EOK) { |
printf(NAME ": Unable to connect to VFS\n"); |
return -1; |
} |
int rc = fs_register(vfs_phone, &tmpfs_reg, &tmpfs_vfs_info, |
tmpfs_connection); |
if (rc != EOK) { |
printf(NAME ": Failed to register file system (%d)\n", rc); |
return rc; |
} |
printf(NAME ": Accepting connections\n"); |
async_manager(); |
/* not reached */ |
return 0; |
} |
/** |
* @} |
*/ |
//branches/snapshot/uspace/srv/fs/tmpfs/tmpfs_dump.c |
---|
0,0 → 1,199 |
/* |
* Copyright (c) 2008 Jakub Jermar |
* Copyright (c) 2008 Martin Decky |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup fs |
* @{ |
*/ |
/** |
* @file tmpfs_dump.c |
* @brief Support for loading TMPFS file system dump. |
*/ |
#include "tmpfs.h" |
#include "../../vfs/vfs.h" |
#include <errno.h> |
#include <stdlib.h> |
#include <string.h> |
#include <sys/types.h> |
#include <as.h> |
#include <libblock.h> |
#include <byteorder.h> |
#define TMPFS_BLOCK_SIZE 1024 |
struct rdentry { |
uint8_t type; |
uint32_t len; |
} __attribute__((packed)); |
static bool |
tmpfs_restore_recursion(dev_handle_t dev, off_t *bufpos, size_t *buflen, |
off_t *pos, fs_node_t *pfn) |
{ |
struct rdentry entry; |
libfs_ops_t *ops = &tmpfs_libfs_ops; |
int rc; |
do { |
char *fname; |
fs_node_t *fn; |
tmpfs_node_t *nodep; |
uint32_t size; |
if (block_seqread(dev, bufpos, buflen, pos, &entry, |
sizeof(entry), TMPFS_BLOCK_SIZE) != EOK) |
return false; |
entry.len = uint32_t_le2host(entry.len); |
switch (entry.type) { |
case TMPFS_NONE: |
break; |
case TMPFS_FILE: |
fname = malloc(entry.len + 1); |
if (fname == NULL) |
return false; |
fn = ops->create(dev, L_FILE); |
if (fn == NULL) { |
free(fname); |
return false; |
} |
if (block_seqread(dev, bufpos, buflen, pos, fname, |
entry.len, TMPFS_BLOCK_SIZE) != EOK) { |
ops->destroy(fn); |
free(fname); |
return false; |
} |
fname[entry.len] = 0; |
rc = ops->link(pfn, fn, fname); |
if (rc != EOK) { |
ops->destroy(fn); |
free(fname); |
return false; |
} |
free(fname); |
if (block_seqread(dev, bufpos, buflen, pos, &size, |
sizeof(size), TMPFS_BLOCK_SIZE) != EOK) |
return false; |
size = uint32_t_le2host(size); |
nodep = TMPFS_NODE(fn); |
nodep->data = malloc(size); |
if (nodep->data == NULL) |
return false; |
nodep->size = size; |
if (block_seqread(dev, bufpos, buflen, pos, nodep->data, |
size, TMPFS_BLOCK_SIZE) != EOK) |
return false; |
break; |
case TMPFS_DIRECTORY: |
fname = malloc(entry.len + 1); |
if (fname == NULL) |
return false; |
fn = ops->create(dev, L_DIRECTORY); |
if (fn == NULL) { |
free(fname); |
return false; |
} |
if (block_seqread(dev, bufpos, buflen, pos, fname, |
entry.len, TMPFS_BLOCK_SIZE) != EOK) { |
ops->destroy(fn); |
free(fname); |
return false; |
} |
fname[entry.len] = 0; |
rc = ops->link(pfn, fn, fname); |
if (rc != EOK) { |
ops->destroy(fn); |
free(fname); |
return false; |
} |
free(fname); |
if (!tmpfs_restore_recursion(dev, bufpos, buflen, pos, |
fn)) |
return false; |
break; |
default: |
return false; |
} |
} while (entry.type != TMPFS_NONE); |
return true; |
} |
bool tmpfs_restore(dev_handle_t dev) |
{ |
libfs_ops_t *ops = &tmpfs_libfs_ops; |
int rc; |
rc = block_init(dev, TMPFS_BLOCK_SIZE); |
if (rc != EOK) |
return false; |
off_t bufpos = 0; |
size_t buflen = 0; |
off_t pos = 0; |
char tag[6]; |
if (block_seqread(dev, &bufpos, &buflen, &pos, tag, 5, |
TMPFS_BLOCK_SIZE) != EOK) |
goto error; |
tag[5] = 0; |
if (str_cmp(tag, "TMPFS") != 0) |
goto error; |
if (!tmpfs_restore_recursion(dev, &bufpos, &buflen, &pos, |
ops->root_get(dev))) |
goto error; |
block_fini(dev); |
return true; |
error: |
block_fini(dev); |
return false; |
} |
/** |
* @} |
*/ |
//branches/snapshot/uspace/srv/fs/tmpfs/Makefile |
---|
0,0 → 1,84 |
# |
# Copyright (c) 2006 Martin Decky |
# All rights reserved. |
# |
# Redistribution and use in source and binary forms, with or without |
# modification, are permitted provided that the following conditions |
# are met: |
# |
# - Redistributions of source code must retain the above copyright |
# notice, this list of conditions and the following disclaimer. |
# - 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. |
# - The name of the author may not be used to endorse or promote products |
# derived from this software without specific prior written permission. |
# |
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
# |
## Setup toolchain |
# |
LIBC_PREFIX = ../../../lib/libc |
LIBFS_PREFIX = ../../../lib/libfs |
LIBBLOCK_PREFIX = ../../../lib/libblock |
SOFTINT_PREFIX = ../../../lib/softint |
include $(LIBC_PREFIX)/Makefile.toolchain |
CFLAGS += -I $(LIBFS_PREFIX) -I $(LIBBLOCK_PREFIX) |
LIBS = \ |
$(LIBFS_PREFIX)/libfs.a \ |
$(LIBBLOCK_PREFIX)/libblock.a \ |
$(LIBC_PREFIX)/libc.a |
## Sources |
# |
OUTPUT = tmpfs |
SOURCES = \ |
tmpfs.c \ |
tmpfs_ops.c \ |
tmpfs_dump.c |
OBJECTS := $(addsuffix .o,$(basename $(SOURCES))) |
.PHONY: all clean depend disasm |
all: $(OUTPUT) $(OUTPUT).disasm |
-include Makefile.depend |
clean: |
-rm -f $(OUTPUT) $(OUTPUT).map $(OUTPUT).disasm Makefile.depend $(OBJECTS) |
depend: |
$(CC) $(DEFS) $(CFLAGS) -M $(SOURCES) > Makefile.depend |
$(OUTPUT): $(OBJECTS) $(LIBS) |
$(LD) -T $(LIBC_PREFIX)/arch/$(UARCH)/_link.ld $(OBJECTS) $(LIBS) $(LFLAGS) -o $@ -Map $(OUTPUT).map |
disasm: $(OUTPUT).disasm |
$(OUTPUT).disasm: $(OUTPUT) |
$(OBJDUMP) -d $< > $@ |
%.o: %.S |
$(CC) $(DEFS) $(AFLAGS) $(CFLAGS) -D__ASM__ -c $< -o $@ |
%.o: %.s |
$(AS) $(AFLAGS) $< -o $@ |
%.o: %.c |
$(CC) $(DEFS) $(CFLAGS) -c $< -o $@ |
//branches/snapshot/uspace/srv/fs/fat/fat_ops.c |
---|
0,0 → 1,1218 |
/* |
* Copyright (c) 2008 Jakub Jermar |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup fs |
* @{ |
*/ |
/** |
* @file fat_ops.c |
* @brief Implementation of VFS operations for the FAT file system server. |
*/ |
#include "fat.h" |
#include "fat_dentry.h" |
#include "fat_fat.h" |
#include "../../vfs/vfs.h" |
#include <libfs.h> |
#include <libblock.h> |
#include <ipc/ipc.h> |
#include <ipc/services.h> |
#include <ipc/devmap.h> |
#include <async.h> |
#include <errno.h> |
#include <string.h> |
#include <byteorder.h> |
#include <adt/hash_table.h> |
#include <adt/list.h> |
#include <assert.h> |
#include <fibril_sync.h> |
#include <sys/mman.h> |
#include <align.h> |
#define FAT_NODE(node) ((node) ? (fat_node_t *) (node)->data : NULL) |
#define FS_NODE(node) ((node) ? (node)->bp : NULL) |
/** Mutex protecting the list of cached free FAT nodes. */ |
static FIBRIL_MUTEX_INITIALIZE(ffn_mutex); |
/** List of cached free FAT nodes. */ |
static LIST_INITIALIZE(ffn_head); |
static void fat_node_initialize(fat_node_t *node) |
{ |
fibril_mutex_initialize(&node->lock); |
node->bp = NULL; |
node->idx = NULL; |
node->type = 0; |
link_initialize(&node->ffn_link); |
node->size = 0; |
node->lnkcnt = 0; |
node->refcnt = 0; |
node->dirty = false; |
} |
static void fat_node_sync(fat_node_t *node) |
{ |
block_t *b; |
fat_bs_t *bs; |
fat_dentry_t *d; |
uint16_t bps; |
unsigned dps; |
assert(node->dirty); |
bs = block_bb_get(node->idx->dev_handle); |
bps = uint16_t_le2host(bs->bps); |
dps = bps / sizeof(fat_dentry_t); |
/* Read the block that contains the dentry of interest. */ |
b = _fat_block_get(bs, node->idx->dev_handle, node->idx->pfc, |
(node->idx->pdi * sizeof(fat_dentry_t)) / bps, BLOCK_FLAGS_NONE); |
d = ((fat_dentry_t *)b->data) + (node->idx->pdi % dps); |
d->firstc = host2uint16_t_le(node->firstc); |
if (node->type == FAT_FILE) { |
d->size = host2uint32_t_le(node->size); |
} else if (node->type == FAT_DIRECTORY) { |
d->attr = FAT_ATTR_SUBDIR; |
} |
/* TODO: update other fields? (e.g time fields) */ |
b->dirty = true; /* need to sync block */ |
block_put(b); |
} |
static fat_node_t *fat_node_get_new(void) |
{ |
fs_node_t *fn; |
fat_node_t *nodep; |
fibril_mutex_lock(&ffn_mutex); |
if (!list_empty(&ffn_head)) { |
/* Try to use a cached free node structure. */ |
fat_idx_t *idxp_tmp; |
nodep = list_get_instance(ffn_head.next, fat_node_t, ffn_link); |
if (!fibril_mutex_trylock(&nodep->lock)) |
goto skip_cache; |
idxp_tmp = nodep->idx; |
if (!fibril_mutex_trylock(&idxp_tmp->lock)) { |
fibril_mutex_unlock(&nodep->lock); |
goto skip_cache; |
} |
list_remove(&nodep->ffn_link); |
fibril_mutex_unlock(&ffn_mutex); |
if (nodep->dirty) |
fat_node_sync(nodep); |
idxp_tmp->nodep = NULL; |
fibril_mutex_unlock(&nodep->lock); |
fibril_mutex_unlock(&idxp_tmp->lock); |
fn = FS_NODE(nodep); |
} else { |
skip_cache: |
/* Try to allocate a new node structure. */ |
fibril_mutex_unlock(&ffn_mutex); |
fn = (fs_node_t *)malloc(sizeof(fs_node_t)); |
if (!fn) |
return NULL; |
nodep = (fat_node_t *)malloc(sizeof(fat_node_t)); |
if (!nodep) { |
free(fn); |
return NULL; |
} |
} |
fat_node_initialize(nodep); |
fs_node_initialize(fn); |
fn->data = nodep; |
nodep->bp = fn; |
return nodep; |
} |
/** Internal version of fat_node_get(). |
* |
* @param idxp Locked index structure. |
*/ |
static fat_node_t *fat_node_get_core(fat_idx_t *idxp) |
{ |
block_t *b; |
fat_bs_t *bs; |
fat_dentry_t *d; |
fat_node_t *nodep = NULL; |
unsigned bps; |
unsigned spc; |
unsigned dps; |
if (idxp->nodep) { |
/* |
* We are lucky. |
* The node is already instantiated in memory. |
*/ |
fibril_mutex_lock(&idxp->nodep->lock); |
if (!idxp->nodep->refcnt++) |
list_remove(&idxp->nodep->ffn_link); |
fibril_mutex_unlock(&idxp->nodep->lock); |
return idxp->nodep; |
} |
/* |
* We must instantiate the node from the file system. |
*/ |
assert(idxp->pfc); |
nodep = fat_node_get_new(); |
if (!nodep) |
return NULL; |
bs = block_bb_get(idxp->dev_handle); |
bps = uint16_t_le2host(bs->bps); |
spc = bs->spc; |
dps = bps / sizeof(fat_dentry_t); |
/* Read the block that contains the dentry of interest. */ |
b = _fat_block_get(bs, idxp->dev_handle, idxp->pfc, |
(idxp->pdi * sizeof(fat_dentry_t)) / bps, BLOCK_FLAGS_NONE); |
assert(b); |
d = ((fat_dentry_t *)b->data) + (idxp->pdi % dps); |
if (d->attr & FAT_ATTR_SUBDIR) { |
/* |
* The only directory which does not have this bit set is the |
* root directory itself. The root directory node is handled |
* and initialized elsewhere. |
*/ |
nodep->type = FAT_DIRECTORY; |
/* |
* Unfortunately, the 'size' field of the FAT dentry is not |
* defined for the directory entry type. We must determine the |
* size of the directory by walking the FAT. |
*/ |
nodep->size = bps * spc * fat_clusters_get(bs, idxp->dev_handle, |
uint16_t_le2host(d->firstc)); |
} else { |
nodep->type = FAT_FILE; |
nodep->size = uint32_t_le2host(d->size); |
} |
nodep->firstc = uint16_t_le2host(d->firstc); |
nodep->lnkcnt = 1; |
nodep->refcnt = 1; |
block_put(b); |
/* Link the idx structure with the node structure. */ |
nodep->idx = idxp; |
idxp->nodep = nodep; |
return nodep; |
} |
/* |
* Forward declarations of FAT libfs operations. |
*/ |
static fs_node_t *fat_node_get(dev_handle_t, fs_index_t); |
static void fat_node_put(fs_node_t *); |
static fs_node_t *fat_create_node(dev_handle_t, int); |
static int fat_destroy_node(fs_node_t *); |
static int fat_link(fs_node_t *, fs_node_t *, const char *); |
static int fat_unlink(fs_node_t *, fs_node_t *, const char *); |
static fs_node_t *fat_match(fs_node_t *, const char *); |
static fs_index_t fat_index_get(fs_node_t *); |
static size_t fat_size_get(fs_node_t *); |
static unsigned fat_lnkcnt_get(fs_node_t *); |
static bool fat_has_children(fs_node_t *); |
static fs_node_t *fat_root_get(dev_handle_t); |
static char fat_plb_get_char(unsigned); |
static bool fat_is_directory(fs_node_t *); |
static bool fat_is_file(fs_node_t *node); |
/* |
* FAT libfs operations. |
*/ |
/** Instantiate a FAT in-core node. */ |
fs_node_t *fat_node_get(dev_handle_t dev_handle, fs_index_t index) |
{ |
fat_node_t *nodep; |
fat_idx_t *idxp; |
idxp = fat_idx_get_by_index(dev_handle, index); |
if (!idxp) |
return NULL; |
/* idxp->lock held */ |
nodep = fat_node_get_core(idxp); |
fibril_mutex_unlock(&idxp->lock); |
return FS_NODE(nodep); |
} |
void fat_node_put(fs_node_t *fn) |
{ |
fat_node_t *nodep = FAT_NODE(fn); |
bool destroy = false; |
fibril_mutex_lock(&nodep->lock); |
if (!--nodep->refcnt) { |
if (nodep->idx) { |
fibril_mutex_lock(&ffn_mutex); |
list_append(&nodep->ffn_link, &ffn_head); |
fibril_mutex_unlock(&ffn_mutex); |
} else { |
/* |
* The node does not have any index structure associated |
* with itself. This can only mean that we are releasing |
* the node after a failed attempt to allocate the index |
* structure for it. |
*/ |
destroy = true; |
} |
} |
fibril_mutex_unlock(&nodep->lock); |
if (destroy) { |
free(nodep->bp); |
free(nodep); |
} |
} |
fs_node_t *fat_create_node(dev_handle_t dev_handle, int flags) |
{ |
fat_idx_t *idxp; |
fat_node_t *nodep; |
fat_bs_t *bs; |
fat_cluster_t mcl, lcl; |
uint16_t bps; |
int rc; |
bs = block_bb_get(dev_handle); |
bps = uint16_t_le2host(bs->bps); |
if (flags & L_DIRECTORY) { |
/* allocate a cluster */ |
rc = fat_alloc_clusters(bs, dev_handle, 1, &mcl, &lcl); |
if (rc != EOK) |
return NULL; |
} |
nodep = fat_node_get_new(); |
if (!nodep) { |
fat_free_clusters(bs, dev_handle, mcl); |
return NULL; |
} |
idxp = fat_idx_get_new(dev_handle); |
if (!idxp) { |
fat_free_clusters(bs, dev_handle, mcl); |
fat_node_put(FS_NODE(nodep)); |
return NULL; |
} |
/* idxp->lock held */ |
if (flags & L_DIRECTORY) { |
int i; |
block_t *b; |
/* |
* Populate the new cluster with unused dentries. |
*/ |
for (i = 0; i < bs->spc; i++) { |
b = _fat_block_get(bs, dev_handle, mcl, i, |
BLOCK_FLAGS_NOREAD); |
/* mark all dentries as never-used */ |
memset(b->data, 0, bps); |
b->dirty = false; |
block_put(b); |
} |
nodep->type = FAT_DIRECTORY; |
nodep->firstc = mcl; |
nodep->size = bps * bs->spc; |
} else { |
nodep->type = FAT_FILE; |
nodep->firstc = FAT_CLST_RES0; |
nodep->size = 0; |
} |
nodep->lnkcnt = 0; /* not linked anywhere */ |
nodep->refcnt = 1; |
nodep->dirty = true; |
nodep->idx = idxp; |
idxp->nodep = nodep; |
fibril_mutex_unlock(&idxp->lock); |
return FS_NODE(nodep); |
} |
int fat_destroy_node(fs_node_t *fn) |
{ |
fat_node_t *nodep = FAT_NODE(fn); |
fat_bs_t *bs; |
/* |
* The node is not reachable from the file system. This means that the |
* link count should be zero and that the index structure cannot be |
* found in the position hash. Obviously, we don't need to lock the node |
* nor its index structure. |
*/ |
assert(nodep->lnkcnt == 0); |
/* |
* The node may not have any children. |
*/ |
assert(fat_has_children(fn) == false); |
bs = block_bb_get(nodep->idx->dev_handle); |
if (nodep->firstc != FAT_CLST_RES0) { |
assert(nodep->size); |
/* Free all clusters allocated to the node. */ |
fat_free_clusters(bs, nodep->idx->dev_handle, nodep->firstc); |
} |
fat_idx_destroy(nodep->idx); |
free(nodep->bp); |
free(nodep); |
return EOK; |
} |
int fat_link(fs_node_t *pfn, fs_node_t *cfn, const char *name) |
{ |
fat_node_t *parentp = FAT_NODE(pfn); |
fat_node_t *childp = FAT_NODE(cfn); |
fat_dentry_t *d; |
fat_bs_t *bs; |
block_t *b; |
int i, j; |
uint16_t bps; |
unsigned dps; |
unsigned blocks; |
fat_cluster_t mcl, lcl; |
int rc; |
fibril_mutex_lock(&childp->lock); |
if (childp->lnkcnt == 1) { |
/* |
* On FAT, we don't support multiple hard links. |
*/ |
fibril_mutex_unlock(&childp->lock); |
return EMLINK; |
} |
assert(childp->lnkcnt == 0); |
fibril_mutex_unlock(&childp->lock); |
if (!fat_dentry_name_verify(name)) { |
/* |
* Attempt to create unsupported name. |
*/ |
return ENOTSUP; |
} |
/* |
* Get us an unused parent node's dentry or grow the parent and allocate |
* a new one. |
*/ |
fibril_mutex_lock(&parentp->idx->lock); |
bs = block_bb_get(parentp->idx->dev_handle); |
bps = uint16_t_le2host(bs->bps); |
dps = bps / sizeof(fat_dentry_t); |
blocks = parentp->size / bps; |
for (i = 0; i < blocks; i++) { |
b = fat_block_get(bs, parentp, i, BLOCK_FLAGS_NONE); |
for (j = 0; j < dps; j++) { |
d = ((fat_dentry_t *)b->data) + j; |
switch (fat_classify_dentry(d)) { |
case FAT_DENTRY_SKIP: |
case FAT_DENTRY_VALID: |
/* skipping used and meta entries */ |
continue; |
case FAT_DENTRY_FREE: |
case FAT_DENTRY_LAST: |
/* found an empty slot */ |
goto hit; |
} |
} |
block_put(b); |
} |
j = 0; |
/* |
* We need to grow the parent in order to create a new unused dentry. |
*/ |
if (parentp->idx->pfc == FAT_CLST_ROOT) { |
/* Can't grow the root directory. */ |
fibril_mutex_unlock(&parentp->idx->lock); |
return ENOSPC; |
} |
rc = fat_alloc_clusters(bs, parentp->idx->dev_handle, 1, &mcl, &lcl); |
if (rc != EOK) { |
fibril_mutex_unlock(&parentp->idx->lock); |
return rc; |
} |
fat_append_clusters(bs, parentp, mcl); |
b = fat_block_get(bs, parentp, i, BLOCK_FLAGS_NOREAD); |
d = (fat_dentry_t *)b->data; |
/* |
* Clear all dentries in the block except for the first one (the first |
* dentry will be cleared in the next step). |
*/ |
memset(d + 1, 0, bps - sizeof(fat_dentry_t)); |
hit: |
/* |
* At this point we only establish the link between the parent and the |
* child. The dentry, except of the name and the extension, will remain |
* uninitialized until the corresponding node is synced. Thus the valid |
* dentry data is kept in the child node structure. |
*/ |
memset(d, 0, sizeof(fat_dentry_t)); |
fat_dentry_name_set(d, name); |
b->dirty = true; /* need to sync block */ |
block_put(b); |
fibril_mutex_unlock(&parentp->idx->lock); |
fibril_mutex_lock(&childp->idx->lock); |
/* |
* If possible, create the Sub-directory Identifier Entry and the |
* Sub-directory Parent Pointer Entry (i.e. "." and ".."). These entries |
* are not mandatory according to Standard ECMA-107 and HelenOS VFS does |
* not use them anyway, so this is rather a sign of our good will. |
*/ |
b = fat_block_get(bs, childp, 0, BLOCK_FLAGS_NONE); |
d = (fat_dentry_t *)b->data; |
if (fat_classify_dentry(d) == FAT_DENTRY_LAST || |
str_cmp(d->name, FAT_NAME_DOT) == 0) { |
memset(d, 0, sizeof(fat_dentry_t)); |
str_cpy(d->name, 8, FAT_NAME_DOT); |
str_cpy(d->ext, 3, FAT_EXT_PAD); |
d->attr = FAT_ATTR_SUBDIR; |
d->firstc = host2uint16_t_le(childp->firstc); |
/* TODO: initialize also the date/time members. */ |
} |
d++; |
if (fat_classify_dentry(d) == FAT_DENTRY_LAST || |
str_cmp(d->name, FAT_NAME_DOT_DOT) == 0) { |
memset(d, 0, sizeof(fat_dentry_t)); |
str_cpy(d->name, 8, FAT_NAME_DOT_DOT); |
str_cpy(d->ext, 3, FAT_EXT_PAD); |
d->attr = FAT_ATTR_SUBDIR; |
d->firstc = (parentp->firstc == FAT_CLST_ROOT) ? |
host2uint16_t_le(FAT_CLST_RES0) : |
host2uint16_t_le(parentp->firstc); |
/* TODO: initialize also the date/time members. */ |
} |
b->dirty = true; /* need to sync block */ |
block_put(b); |
childp->idx->pfc = parentp->firstc; |
childp->idx->pdi = i * dps + j; |
fibril_mutex_unlock(&childp->idx->lock); |
fibril_mutex_lock(&childp->lock); |
childp->lnkcnt = 1; |
childp->dirty = true; /* need to sync node */ |
fibril_mutex_unlock(&childp->lock); |
/* |
* Hash in the index structure into the position hash. |
*/ |
fat_idx_hashin(childp->idx); |
return EOK; |
} |
int fat_unlink(fs_node_t *pfn, fs_node_t *cfn, const char *nm) |
{ |
fat_node_t *parentp = FAT_NODE(pfn); |
fat_node_t *childp = FAT_NODE(cfn); |
fat_bs_t *bs; |
fat_dentry_t *d; |
uint16_t bps; |
block_t *b; |
if (!parentp) |
return EBUSY; |
if (fat_has_children(cfn)) |
return ENOTEMPTY; |
fibril_mutex_lock(&parentp->lock); |
fibril_mutex_lock(&childp->lock); |
assert(childp->lnkcnt == 1); |
fibril_mutex_lock(&childp->idx->lock); |
bs = block_bb_get(childp->idx->dev_handle); |
bps = uint16_t_le2host(bs->bps); |
b = _fat_block_get(bs, childp->idx->dev_handle, childp->idx->pfc, |
(childp->idx->pdi * sizeof(fat_dentry_t)) / bps, |
BLOCK_FLAGS_NONE); |
d = (fat_dentry_t *)b->data + |
(childp->idx->pdi % (bps / sizeof(fat_dentry_t))); |
/* mark the dentry as not-currently-used */ |
d->name[0] = FAT_DENTRY_ERASED; |
b->dirty = true; /* need to sync block */ |
block_put(b); |
/* remove the index structure from the position hash */ |
fat_idx_hashout(childp->idx); |
/* clear position information */ |
childp->idx->pfc = FAT_CLST_RES0; |
childp->idx->pdi = 0; |
fibril_mutex_unlock(&childp->idx->lock); |
childp->lnkcnt = 0; |
childp->dirty = true; |
fibril_mutex_unlock(&childp->lock); |
fibril_mutex_unlock(&parentp->lock); |
return EOK; |
} |
fs_node_t *fat_match(fs_node_t *pfn, const char *component) |
{ |
fat_bs_t *bs; |
fat_node_t *parentp = FAT_NODE(pfn); |
char name[FAT_NAME_LEN + 1 + FAT_EXT_LEN + 1]; |
unsigned i, j; |
unsigned bps; /* bytes per sector */ |
unsigned dps; /* dentries per sector */ |
unsigned blocks; |
fat_dentry_t *d; |
block_t *b; |
fibril_mutex_lock(&parentp->idx->lock); |
bs = block_bb_get(parentp->idx->dev_handle); |
bps = uint16_t_le2host(bs->bps); |
dps = bps / sizeof(fat_dentry_t); |
blocks = parentp->size / bps; |
for (i = 0; i < blocks; i++) { |
b = fat_block_get(bs, parentp, i, BLOCK_FLAGS_NONE); |
for (j = 0; j < dps; j++) { |
d = ((fat_dentry_t *)b->data) + j; |
switch (fat_classify_dentry(d)) { |
case FAT_DENTRY_SKIP: |
case FAT_DENTRY_FREE: |
continue; |
case FAT_DENTRY_LAST: |
block_put(b); |
fibril_mutex_unlock(&parentp->idx->lock); |
return NULL; |
default: |
case FAT_DENTRY_VALID: |
fat_dentry_name_get(d, name); |
break; |
} |
if (fat_dentry_namecmp(name, component) == 0) { |
/* hit */ |
fat_node_t *nodep; |
/* |
* Assume tree hierarchy for locking. We |
* already have the parent and now we are going |
* to lock the child. Never lock in the oposite |
* order. |
*/ |
fat_idx_t *idx = fat_idx_get_by_pos( |
parentp->idx->dev_handle, parentp->firstc, |
i * dps + j); |
fibril_mutex_unlock(&parentp->idx->lock); |
if (!idx) { |
/* |
* Can happen if memory is low or if we |
* run out of 32-bit indices. |
*/ |
block_put(b); |
return NULL; |
} |
nodep = fat_node_get_core(idx); |
fibril_mutex_unlock(&idx->lock); |
block_put(b); |
return FS_NODE(nodep); |
} |
} |
block_put(b); |
} |
fibril_mutex_unlock(&parentp->idx->lock); |
return NULL; |
} |
fs_index_t fat_index_get(fs_node_t *fn) |
{ |
return FAT_NODE(fn)->idx->index; |
} |
size_t fat_size_get(fs_node_t *fn) |
{ |
return FAT_NODE(fn)->size; |
} |
unsigned fat_lnkcnt_get(fs_node_t *fn) |
{ |
return FAT_NODE(fn)->lnkcnt; |
} |
bool fat_has_children(fs_node_t *fn) |
{ |
fat_bs_t *bs; |
fat_node_t *nodep = FAT_NODE(fn); |
unsigned bps; |
unsigned dps; |
unsigned blocks; |
block_t *b; |
unsigned i, j; |
if (nodep->type != FAT_DIRECTORY) |
return false; |
fibril_mutex_lock(&nodep->idx->lock); |
bs = block_bb_get(nodep->idx->dev_handle); |
bps = uint16_t_le2host(bs->bps); |
dps = bps / sizeof(fat_dentry_t); |
blocks = nodep->size / bps; |
for (i = 0; i < blocks; i++) { |
fat_dentry_t *d; |
b = fat_block_get(bs, nodep, i, BLOCK_FLAGS_NONE); |
for (j = 0; j < dps; j++) { |
d = ((fat_dentry_t *)b->data) + j; |
switch (fat_classify_dentry(d)) { |
case FAT_DENTRY_SKIP: |
case FAT_DENTRY_FREE: |
continue; |
case FAT_DENTRY_LAST: |
block_put(b); |
fibril_mutex_unlock(&nodep->idx->lock); |
return false; |
default: |
case FAT_DENTRY_VALID: |
block_put(b); |
fibril_mutex_unlock(&nodep->idx->lock); |
return true; |
} |
block_put(b); |
fibril_mutex_unlock(&nodep->idx->lock); |
return true; |
} |
block_put(b); |
} |
fibril_mutex_unlock(&nodep->idx->lock); |
return false; |
} |
fs_node_t *fat_root_get(dev_handle_t dev_handle) |
{ |
return fat_node_get(dev_handle, 0); |
} |
char fat_plb_get_char(unsigned pos) |
{ |
return fat_reg.plb_ro[pos % PLB_SIZE]; |
} |
bool fat_is_directory(fs_node_t *fn) |
{ |
return FAT_NODE(fn)->type == FAT_DIRECTORY; |
} |
bool fat_is_file(fs_node_t *fn) |
{ |
return FAT_NODE(fn)->type == FAT_FILE; |
} |
/** libfs operations */ |
libfs_ops_t fat_libfs_ops = { |
.match = fat_match, |
.node_get = fat_node_get, |
.node_put = fat_node_put, |
.create = fat_create_node, |
.destroy = fat_destroy_node, |
.link = fat_link, |
.unlink = fat_unlink, |
.index_get = fat_index_get, |
.size_get = fat_size_get, |
.lnkcnt_get = fat_lnkcnt_get, |
.has_children = fat_has_children, |
.root_get = fat_root_get, |
.plb_get_char = fat_plb_get_char, |
.is_directory = fat_is_directory, |
.is_file = fat_is_file |
}; |
/* |
* VFS operations. |
*/ |
void fat_mounted(ipc_callid_t rid, ipc_call_t *request) |
{ |
dev_handle_t dev_handle = (dev_handle_t) IPC_GET_ARG1(*request); |
enum cache_mode cmode; |
fat_bs_t *bs; |
uint16_t bps; |
uint16_t rde; |
int rc; |
/* accept the mount options */ |
ipc_callid_t callid; |
size_t size; |
if (!ipc_data_write_receive(&callid, &size)) { |
ipc_answer_0(callid, EINVAL); |
ipc_answer_0(rid, EINVAL); |
return; |
} |
char *opts = malloc(size + 1); |
if (!opts) { |
ipc_answer_0(callid, ENOMEM); |
ipc_answer_0(rid, ENOMEM); |
return; |
} |
ipcarg_t retval = ipc_data_write_finalize(callid, opts, size); |
if (retval != EOK) { |
ipc_answer_0(rid, retval); |
free(opts); |
return; |
} |
opts[size] = '\0'; |
/* Check for option enabling write through. */ |
if (str_cmp(opts, "wtcache") == 0) |
cmode = CACHE_MODE_WT; |
else |
cmode = CACHE_MODE_WB; |
/* initialize libblock */ |
rc = block_init(dev_handle, BS_SIZE); |
if (rc != EOK) { |
ipc_answer_0(rid, rc); |
return; |
} |
/* prepare the boot block */ |
rc = block_bb_read(dev_handle, BS_BLOCK * BS_SIZE, BS_SIZE); |
if (rc != EOK) { |
block_fini(dev_handle); |
ipc_answer_0(rid, rc); |
return; |
} |
/* get the buffer with the boot sector */ |
bs = block_bb_get(dev_handle); |
/* Read the number of root directory entries. */ |
bps = uint16_t_le2host(bs->bps); |
rde = uint16_t_le2host(bs->root_ent_max); |
if (bps != BS_SIZE) { |
block_fini(dev_handle); |
ipc_answer_0(rid, ENOTSUP); |
return; |
} |
/* Initialize the block cache */ |
rc = block_cache_init(dev_handle, bps, 0 /* XXX */, cmode); |
if (rc != EOK) { |
block_fini(dev_handle); |
ipc_answer_0(rid, rc); |
return; |
} |
rc = fat_idx_init_by_dev_handle(dev_handle); |
if (rc != EOK) { |
block_fini(dev_handle); |
ipc_answer_0(rid, rc); |
return; |
} |
/* Initialize the root node. */ |
fs_node_t *rfn = (fs_node_t *)malloc(sizeof(fs_node_t)); |
if (!rfn) { |
block_fini(dev_handle); |
fat_idx_fini_by_dev_handle(dev_handle); |
ipc_answer_0(rid, ENOMEM); |
return; |
} |
fs_node_initialize(rfn); |
fat_node_t *rootp = (fat_node_t *)malloc(sizeof(fat_node_t)); |
if (!rootp) { |
free(rfn); |
block_fini(dev_handle); |
fat_idx_fini_by_dev_handle(dev_handle); |
ipc_answer_0(rid, ENOMEM); |
return; |
} |
fat_node_initialize(rootp); |
fat_idx_t *ridxp = fat_idx_get_by_pos(dev_handle, FAT_CLST_ROOTPAR, 0); |
if (!ridxp) { |
free(rfn); |
free(rootp); |
block_fini(dev_handle); |
fat_idx_fini_by_dev_handle(dev_handle); |
ipc_answer_0(rid, ENOMEM); |
return; |
} |
assert(ridxp->index == 0); |
/* ridxp->lock held */ |
rootp->type = FAT_DIRECTORY; |
rootp->firstc = FAT_CLST_ROOT; |
rootp->refcnt = 1; |
rootp->lnkcnt = 0; /* FS root is not linked */ |
rootp->size = rde * sizeof(fat_dentry_t); |
rootp->idx = ridxp; |
ridxp->nodep = rootp; |
rootp->bp = rfn; |
rfn->data = rootp; |
fibril_mutex_unlock(&ridxp->lock); |
ipc_answer_3(rid, EOK, ridxp->index, rootp->size, rootp->lnkcnt); |
} |
void fat_mount(ipc_callid_t rid, ipc_call_t *request) |
{ |
libfs_mount(&fat_libfs_ops, fat_reg.fs_handle, rid, request); |
} |
void fat_lookup(ipc_callid_t rid, ipc_call_t *request) |
{ |
libfs_lookup(&fat_libfs_ops, fat_reg.fs_handle, rid, request); |
} |
void fat_read(ipc_callid_t rid, ipc_call_t *request) |
{ |
dev_handle_t dev_handle = (dev_handle_t)IPC_GET_ARG1(*request); |
fs_index_t index = (fs_index_t)IPC_GET_ARG2(*request); |
off_t pos = (off_t)IPC_GET_ARG3(*request); |
fs_node_t *fn = fat_node_get(dev_handle, index); |
fat_node_t *nodep; |
fat_bs_t *bs; |
uint16_t bps; |
size_t bytes; |
block_t *b; |
if (!fn) { |
ipc_answer_0(rid, ENOENT); |
return; |
} |
nodep = FAT_NODE(fn); |
ipc_callid_t callid; |
size_t len; |
if (!ipc_data_read_receive(&callid, &len)) { |
fat_node_put(fn); |
ipc_answer_0(callid, EINVAL); |
ipc_answer_0(rid, EINVAL); |
return; |
} |
bs = block_bb_get(dev_handle); |
bps = uint16_t_le2host(bs->bps); |
if (nodep->type == FAT_FILE) { |
/* |
* Our strategy for regular file reads is to read one block at |
* most and make use of the possibility to return less data than |
* requested. This keeps the code very simple. |
*/ |
if (pos >= nodep->size) { |
/* reading beyond the EOF */ |
bytes = 0; |
(void) ipc_data_read_finalize(callid, NULL, 0); |
} else { |
bytes = min(len, bps - pos % bps); |
bytes = min(bytes, nodep->size - pos); |
b = fat_block_get(bs, nodep, pos / bps, |
BLOCK_FLAGS_NONE); |
(void) ipc_data_read_finalize(callid, b->data + pos % bps, |
bytes); |
block_put(b); |
} |
} else { |
unsigned bnum; |
off_t spos = pos; |
char name[FAT_NAME_LEN + 1 + FAT_EXT_LEN + 1]; |
fat_dentry_t *d; |
assert(nodep->type == FAT_DIRECTORY); |
assert(nodep->size % bps == 0); |
assert(bps % sizeof(fat_dentry_t) == 0); |
/* |
* Our strategy for readdir() is to use the position pointer as |
* an index into the array of all dentries. On entry, it points |
* to the first unread dentry. If we skip any dentries, we bump |
* the position pointer accordingly. |
*/ |
bnum = (pos * sizeof(fat_dentry_t)) / bps; |
while (bnum < nodep->size / bps) { |
off_t o; |
b = fat_block_get(bs, nodep, bnum, BLOCK_FLAGS_NONE); |
for (o = pos % (bps / sizeof(fat_dentry_t)); |
o < bps / sizeof(fat_dentry_t); |
o++, pos++) { |
d = ((fat_dentry_t *)b->data) + o; |
switch (fat_classify_dentry(d)) { |
case FAT_DENTRY_SKIP: |
case FAT_DENTRY_FREE: |
continue; |
case FAT_DENTRY_LAST: |
block_put(b); |
goto miss; |
default: |
case FAT_DENTRY_VALID: |
fat_dentry_name_get(d, name); |
block_put(b); |
goto hit; |
} |
} |
block_put(b); |
bnum++; |
} |
miss: |
fat_node_put(fn); |
ipc_answer_0(callid, ENOENT); |
ipc_answer_1(rid, ENOENT, 0); |
return; |
hit: |
(void) ipc_data_read_finalize(callid, name, str_size(name) + 1); |
bytes = (pos - spos) + 1; |
} |
fat_node_put(fn); |
ipc_answer_1(rid, EOK, (ipcarg_t)bytes); |
} |
void fat_write(ipc_callid_t rid, ipc_call_t *request) |
{ |
dev_handle_t dev_handle = (dev_handle_t)IPC_GET_ARG1(*request); |
fs_index_t index = (fs_index_t)IPC_GET_ARG2(*request); |
off_t pos = (off_t)IPC_GET_ARG3(*request); |
fs_node_t *fn = fat_node_get(dev_handle, index); |
fat_node_t *nodep; |
fat_bs_t *bs; |
size_t bytes; |
block_t *b; |
uint16_t bps; |
unsigned spc; |
unsigned bpc; /* bytes per cluster */ |
off_t boundary; |
int flags = BLOCK_FLAGS_NONE; |
if (!fn) { |
ipc_answer_0(rid, ENOENT); |
return; |
} |
nodep = FAT_NODE(fn); |
ipc_callid_t callid; |
size_t len; |
if (!ipc_data_write_receive(&callid, &len)) { |
fat_node_put(fn); |
ipc_answer_0(callid, EINVAL); |
ipc_answer_0(rid, EINVAL); |
return; |
} |
bs = block_bb_get(dev_handle); |
bps = uint16_t_le2host(bs->bps); |
spc = bs->spc; |
bpc = bps * spc; |
/* |
* In all scenarios, we will attempt to write out only one block worth |
* of data at maximum. There might be some more efficient approaches, |
* but this one greatly simplifies fat_write(). Note that we can afford |
* to do this because the client must be ready to handle the return |
* value signalizing a smaller number of bytes written. |
*/ |
bytes = min(len, bps - pos % bps); |
if (bytes == bps) |
flags |= BLOCK_FLAGS_NOREAD; |
boundary = ROUND_UP(nodep->size, bpc); |
if (pos < boundary) { |
/* |
* This is the easier case - we are either overwriting already |
* existing contents or writing behind the EOF, but still within |
* the limits of the last cluster. The node size may grow to the |
* next block size boundary. |
*/ |
fat_fill_gap(bs, nodep, FAT_CLST_RES0, pos); |
b = fat_block_get(bs, nodep, pos / bps, flags); |
(void) ipc_data_write_finalize(callid, b->data + pos % bps, |
bytes); |
b->dirty = true; /* need to sync block */ |
block_put(b); |
if (pos + bytes > nodep->size) { |
nodep->size = pos + bytes; |
nodep->dirty = true; /* need to sync node */ |
} |
ipc_answer_2(rid, EOK, bytes, nodep->size); |
fat_node_put(fn); |
return; |
} else { |
/* |
* This is the more difficult case. We must allocate new |
* clusters for the node and zero them out. |
*/ |
int status; |
unsigned nclsts; |
fat_cluster_t mcl, lcl; |
nclsts = (ROUND_UP(pos + bytes, bpc) - boundary) / bpc; |
/* create an independent chain of nclsts clusters in all FATs */ |
status = fat_alloc_clusters(bs, dev_handle, nclsts, &mcl, &lcl); |
if (status != EOK) { |
/* could not allocate a chain of nclsts clusters */ |
fat_node_put(fn); |
ipc_answer_0(callid, status); |
ipc_answer_0(rid, status); |
return; |
} |
/* zero fill any gaps */ |
fat_fill_gap(bs, nodep, mcl, pos); |
b = _fat_block_get(bs, dev_handle, lcl, (pos / bps) % spc, |
flags); |
(void) ipc_data_write_finalize(callid, b->data + pos % bps, |
bytes); |
b->dirty = true; /* need to sync block */ |
block_put(b); |
/* |
* Append the cluster chain starting in mcl to the end of the |
* node's cluster chain. |
*/ |
fat_append_clusters(bs, nodep, mcl); |
nodep->size = pos + bytes; |
nodep->dirty = true; /* need to sync node */ |
ipc_answer_2(rid, EOK, bytes, nodep->size); |
fat_node_put(fn); |
return; |
} |
} |
void fat_truncate(ipc_callid_t rid, ipc_call_t *request) |
{ |
dev_handle_t dev_handle = (dev_handle_t)IPC_GET_ARG1(*request); |
fs_index_t index = (fs_index_t)IPC_GET_ARG2(*request); |
size_t size = (off_t)IPC_GET_ARG3(*request); |
fs_node_t *fn = fat_node_get(dev_handle, index); |
fat_node_t *nodep; |
fat_bs_t *bs; |
uint16_t bps; |
uint8_t spc; |
unsigned bpc; /* bytes per cluster */ |
int rc; |
if (!fn) { |
ipc_answer_0(rid, ENOENT); |
return; |
} |
nodep = FAT_NODE(fn); |
bs = block_bb_get(dev_handle); |
bps = uint16_t_le2host(bs->bps); |
spc = bs->spc; |
bpc = bps * spc; |
if (nodep->size == size) { |
rc = EOK; |
} else if (nodep->size < size) { |
/* |
* The standard says we have the freedom to grow the node. |
* For now, we simply return an error. |
*/ |
rc = EINVAL; |
} else if (ROUND_UP(nodep->size, bpc) == ROUND_UP(size, bpc)) { |
/* |
* The node will be shrunk, but no clusters will be deallocated. |
*/ |
nodep->size = size; |
nodep->dirty = true; /* need to sync node */ |
rc = EOK; |
} else { |
/* |
* The node will be shrunk, clusters will be deallocated. |
*/ |
if (size == 0) { |
fat_chop_clusters(bs, nodep, FAT_CLST_RES0); |
} else { |
fat_cluster_t lastc; |
(void) fat_cluster_walk(bs, dev_handle, nodep->firstc, |
&lastc, (size - 1) / bpc); |
fat_chop_clusters(bs, nodep, lastc); |
} |
nodep->size = size; |
nodep->dirty = true; /* need to sync node */ |
rc = EOK; |
} |
fat_node_put(fn); |
ipc_answer_0(rid, rc); |
return; |
} |
void fat_close(ipc_callid_t rid, ipc_call_t *request) |
{ |
ipc_answer_0(rid, EOK); |
} |
void fat_destroy(ipc_callid_t rid, ipc_call_t *request) |
{ |
dev_handle_t dev_handle = (dev_handle_t)IPC_GET_ARG1(*request); |
fs_index_t index = (fs_index_t)IPC_GET_ARG2(*request); |
int rc; |
fs_node_t *fn = fat_node_get(dev_handle, index); |
if (!fn) { |
ipc_answer_0(rid, ENOENT); |
return; |
} |
rc = fat_destroy_node(fn); |
ipc_answer_0(rid, rc); |
} |
void fat_open_node(ipc_callid_t rid, ipc_call_t *request) |
{ |
libfs_open_node(&fat_libfs_ops, fat_reg.fs_handle, rid, request); |
} |
void fat_stat(ipc_callid_t rid, ipc_call_t *request) |
{ |
libfs_stat(&fat_libfs_ops, fat_reg.fs_handle, rid, request); |
} |
void fat_sync(ipc_callid_t rid, ipc_call_t *request) |
{ |
/* Dummy implementation */ |
ipc_answer_0(rid, EOK); |
} |
/** |
* @} |
*/ |
//branches/snapshot/uspace/srv/fs/fat/fat.h |
---|
0,0 → 1,233 |
/* |
* Copyright (c) 2008 Jakub Jermar |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup fs |
* @{ |
*/ |
#ifndef FAT_FAT_H_ |
#define FAT_FAT_H_ |
#include "fat_fat.h" |
#include <ipc/ipc.h> |
#include <fibril_sync.h> |
#include <libfs.h> |
#include <atomic.h> |
#include <sys/types.h> |
#include <bool.h> |
#include "../../vfs/vfs.h" |
#ifndef dprintf |
#define dprintf(...) printf(__VA_ARGS__) |
#endif |
#define min(a, b) ((a) < (b) ? (a) : (b)) |
#define BS_BLOCK 0 |
#define BS_SIZE 512 |
typedef struct fat_bs { |
uint8_t ji[3]; /**< Jump instruction. */ |
uint8_t oem_name[8]; |
/* BIOS Parameter Block */ |
uint16_t bps; /**< Bytes per sector. */ |
uint8_t spc; /**< Sectors per cluster. */ |
uint16_t rscnt; /**< Reserved sector count. */ |
uint8_t fatcnt; /**< Number of FATs. */ |
uint16_t root_ent_max; /**< Maximum number of root directory |
entries. */ |
uint16_t totsec16; /**< Total sectors. 16-bit version. */ |
uint8_t mdesc; /**< Media descriptor. */ |
uint16_t sec_per_fat; /**< Sectors per FAT12/FAT16. */ |
uint16_t sec_per_track; /**< Sectors per track. */ |
uint16_t headcnt; /**< Number of heads. */ |
uint32_t hidden_sec; /**< Hidden sectors. */ |
uint32_t totsec32; /**< Total sectors. 32-bit version. */ |
union { |
struct { |
/* FAT12/FAT16 only: Extended BIOS Parameter Block */ |
/** Physical drive number. */ |
uint8_t pdn; |
uint8_t reserved; |
/** Extended boot signature. */ |
uint8_t ebs; |
/** Serial number. */ |
uint32_t id; |
/** Volume label. */ |
uint8_t label[11]; |
/** FAT type. */ |
uint8_t type[8]; |
/** Boot code. */ |
uint8_t boot_code[448]; |
/** Boot sector signature. */ |
uint16_t signature; |
} __attribute__ ((packed)); |
struct { |
/* FAT32 only */ |
/** Sectors per FAT. */ |
uint32_t sectors_per_fat; |
/** FAT flags. */ |
uint16_t flags; |
/** Version. */ |
uint16_t version; |
/** Cluster number of root directory. */ |
uint32_t root_cluster; |
/** Sector number of file system information sector. */ |
uint16_t fsinfo_sec; |
/** Sector number of boot sector copy. */ |
uint16_t bscopy_sec; |
uint8_t reserved1[12]; |
/** Physical drive number. */ |
uint8_t pdn; |
uint8_t reserved2; |
/** Extended boot signature. */ |
uint8_t ebs; |
/** Serial number. */ |
uint32_t id; |
/** Volume label. */ |
uint8_t label[11]; |
/** FAT type. */ |
uint8_t type[8]; |
/** Boot code. */ |
uint8_t boot_code[420]; |
/** Signature. */ |
uint16_t signature; |
} __attribute__ ((packed)); |
}; |
} __attribute__ ((packed)) fat_bs_t; |
typedef enum { |
FAT_INVALID, |
FAT_DIRECTORY, |
FAT_FILE |
} fat_node_type_t; |
struct fat_node; |
/** FAT index structure. |
* |
* This structure exists to help us to overcome certain limitations of the FAT |
* file system design. The problem with FAT is that it is hard to find |
* an entity which could represent a VFS index. There are two candidates: |
* |
* a) number of the node's first cluster |
* b) the pair of the parent directory's first cluster and the dentry index |
* within the parent directory |
* |
* We need VFS indices to be: |
* A) unique |
* B) stable in time, at least until the next mount |
* |
* Unfortunately a) does not meet the A) criterion because zero-length files |
* will have the first cluster field cleared. And b) does not meet the B) |
* criterion because unlink() and rename() will both free up the original |
* dentry, which contains all the essential info about the file. |
* |
* Therefore, a completely opaque indices are used and the FAT server maintains |
* a mapping between them and otherwise nice b) variant. On rename(), the VFS |
* index stays unaltered, while the internal FAT "physical tree address" |
* changes. The unlink case is also handled this way thanks to an in-core node |
* pointer embedded in the index structure. |
*/ |
typedef struct { |
/** Used indices (position) hash table link. */ |
link_t uph_link; |
/** Used indices (index) hash table link. */ |
link_t uih_link; |
fibril_mutex_t lock; |
dev_handle_t dev_handle; |
fs_index_t index; |
/** |
* Parent node's first cluster. |
* Zero is used if this node is not linked, in which case nodep must |
* contain a pointer to the in-core node structure. |
* One is used when the parent is the root directory. |
*/ |
fat_cluster_t pfc; |
/** Directory entry index within the parent node. */ |
unsigned pdi; |
/** Pointer to in-core node instance. */ |
struct fat_node *nodep; |
} fat_idx_t; |
/** FAT in-core node. */ |
typedef struct fat_node { |
/** Back pointer to the FS node. */ |
fs_node_t *bp; |
fibril_mutex_t lock; |
fat_node_type_t type; |
fat_idx_t *idx; |
/** |
* Node's first cluster. |
* Zero is used for zero-length nodes. |
* One is used to mark root directory. |
*/ |
fat_cluster_t firstc; |
/** FAT in-core node free list link. */ |
link_t ffn_link; |
size_t size; |
unsigned lnkcnt; |
unsigned refcnt; |
bool dirty; |
} fat_node_t; |
extern fs_reg_t fat_reg; |
extern void fat_mounted(ipc_callid_t, ipc_call_t *); |
extern void fat_mount(ipc_callid_t, ipc_call_t *); |
extern void fat_lookup(ipc_callid_t, ipc_call_t *); |
extern void fat_read(ipc_callid_t, ipc_call_t *); |
extern void fat_write(ipc_callid_t, ipc_call_t *); |
extern void fat_truncate(ipc_callid_t, ipc_call_t *); |
extern void fat_stat(ipc_callid_t, ipc_call_t *); |
extern void fat_close(ipc_callid_t, ipc_call_t *); |
extern void fat_destroy(ipc_callid_t, ipc_call_t *); |
extern void fat_open_node(ipc_callid_t, ipc_call_t *); |
extern void fat_stat(ipc_callid_t, ipc_call_t *); |
extern void fat_sync(ipc_callid_t, ipc_call_t *); |
extern fat_idx_t *fat_idx_get_new(dev_handle_t); |
extern fat_idx_t *fat_idx_get_by_pos(dev_handle_t, fat_cluster_t, unsigned); |
extern fat_idx_t *fat_idx_get_by_index(dev_handle_t, fs_index_t); |
extern void fat_idx_destroy(fat_idx_t *); |
extern void fat_idx_hashin(fat_idx_t *); |
extern void fat_idx_hashout(fat_idx_t *); |
extern int fat_idx_init(void); |
extern void fat_idx_fini(void); |
extern int fat_idx_init_by_dev_handle(dev_handle_t); |
extern void fat_idx_fini_by_dev_handle(dev_handle_t); |
#endif |
/** |
* @} |
*/ |
//branches/snapshot/uspace/srv/fs/fat/fat.c |
---|
0,0 → 1,171 |
/* |
* Copyright (c) 2006 Martin Decky |
* Copyright (c) 2008 Jakub Jermar |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup fs |
* @{ |
*/ |
/** |
* @file fat.c |
* @brief FAT file system driver for HelenOS. |
*/ |
#include "fat.h" |
#include <ipc/ipc.h> |
#include <ipc/services.h> |
#include <async.h> |
#include <errno.h> |
#include <unistd.h> |
#include <stdio.h> |
#include <libfs.h> |
#include "../../vfs/vfs.h" |
vfs_info_t fat_vfs_info = { |
.name = "fat", |
}; |
fs_reg_t fat_reg; |
/** |
* This connection fibril processes VFS requests from VFS. |
* |
* In order to support simultaneous VFS requests, our design is as follows. |
* The connection fibril accepts VFS requests from VFS. If there is only one |
* instance of the fibril, VFS will need to serialize all VFS requests it sends |
* to FAT. To overcome this bottleneck, VFS can send FAT the IPC_M_CONNECT_ME_TO |
* call. In that case, a new connection fibril will be created, which in turn |
* will accept the call. Thus, a new phone will be opened for VFS. |
* |
* There are few issues with this arrangement. First, VFS can run out of |
* available phones. In that case, VFS can close some other phones or use one |
* phone for more serialized requests. Similarily, FAT can refuse to duplicate |
* the connection. VFS should then just make use of already existing phones and |
* route its requests through them. To avoid paying the fibril creation price |
* upon each request, FAT might want to keep the connections open after the |
* request has been completed. |
*/ |
static void fat_connection(ipc_callid_t iid, ipc_call_t *icall) |
{ |
if (iid) { |
/* |
* This only happens for connections opened by |
* IPC_M_CONNECT_ME_TO calls as opposed to callback connections |
* created by IPC_M_CONNECT_TO_ME. |
*/ |
ipc_answer_0(iid, EOK); |
} |
dprintf("VFS-FAT connection established.\n"); |
while (1) { |
ipc_callid_t callid; |
ipc_call_t call; |
callid = async_get_call(&call); |
switch (IPC_GET_METHOD(call)) { |
case IPC_M_PHONE_HUNGUP: |
return; |
case VFS_OUT_MOUNTED: |
fat_mounted(callid, &call); |
break; |
case VFS_OUT_MOUNT: |
fat_mount(callid, &call); |
break; |
case VFS_OUT_LOOKUP: |
fat_lookup(callid, &call); |
break; |
case VFS_OUT_READ: |
fat_read(callid, &call); |
break; |
case VFS_OUT_WRITE: |
fat_write(callid, &call); |
break; |
case VFS_OUT_TRUNCATE: |
fat_truncate(callid, &call); |
break; |
case VFS_OUT_STAT: |
fat_stat(callid, &call); |
break; |
case VFS_OUT_CLOSE: |
fat_close(callid, &call); |
break; |
case VFS_OUT_DESTROY: |
fat_destroy(callid, &call); |
break; |
case VFS_OUT_OPEN_NODE: |
fat_open_node(callid, &call); |
break; |
case VFS_OUT_SYNC: |
fat_sync(callid, &call); |
break; |
default: |
ipc_answer_0(callid, ENOTSUP); |
break; |
} |
} |
} |
int main(int argc, char **argv) |
{ |
int vfs_phone; |
int rc; |
printf("fat: HelenOS FAT file system server.\n"); |
rc = fat_idx_init(); |
if (rc != EOK) |
goto err; |
vfs_phone = ipc_connect_me_to_blocking(PHONE_NS, SERVICE_VFS, 0, 0); |
if (vfs_phone < EOK) { |
printf("fat: failed to connect to VFS\n"); |
return -1; |
} |
rc = fs_register(vfs_phone, &fat_reg, &fat_vfs_info, fat_connection); |
if (rc != EOK) { |
fat_idx_fini(); |
goto err; |
} |
dprintf("FAT filesystem registered, fs_handle=%d.\n", |
fat_reg.fs_handle); |
async_manager(); |
/* not reached */ |
return 0; |
err: |
printf("Failed to register the FAT file system (%d)\n", rc); |
return rc; |
} |
/** |
* @} |
*/ |
//branches/snapshot/uspace/srv/fs/fat/fat_idx.c |
---|
0,0 → 1,556 |
/* |
* Copyright (c) 2008 Jakub Jermar |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup fs |
* @{ |
*/ |
/** |
* @file fat_idx.c |
* @brief Layer for translating FAT entities to VFS node indices. |
*/ |
#include "fat.h" |
#include "../../vfs/vfs.h" |
#include <errno.h> |
#include <string.h> |
#include <adt/hash_table.h> |
#include <adt/list.h> |
#include <assert.h> |
#include <fibril_sync.h> |
/** Each instance of this type describes one interval of freed VFS indices. */ |
typedef struct { |
link_t link; |
fs_index_t first; |
fs_index_t last; |
} freed_t; |
/** |
* Each instance of this type describes state of all VFS indices that |
* are currently unused. |
*/ |
typedef struct { |
link_t link; |
dev_handle_t dev_handle; |
/** Next unassigned index. */ |
fs_index_t next; |
/** Number of remaining unassigned indices. */ |
uint64_t remaining; |
/** Sorted list of intervals of freed indices. */ |
link_t freed_head; |
} unused_t; |
/** Mutex protecting the list of unused structures. */ |
static FIBRIL_MUTEX_INITIALIZE(unused_lock); |
/** List of unused structures. */ |
static LIST_INITIALIZE(unused_head); |
static void unused_initialize(unused_t *u, dev_handle_t dev_handle) |
{ |
link_initialize(&u->link); |
u->dev_handle = dev_handle; |
u->next = 0; |
u->remaining = ((uint64_t)((fs_index_t)-1)) + 1; |
list_initialize(&u->freed_head); |
} |
static unused_t *unused_find(dev_handle_t dev_handle, bool lock) |
{ |
unused_t *u; |
link_t *l; |
if (lock) |
fibril_mutex_lock(&unused_lock); |
for (l = unused_head.next; l != &unused_head; l = l->next) { |
u = list_get_instance(l, unused_t, link); |
if (u->dev_handle == dev_handle) |
return u; |
} |
if (lock) |
fibril_mutex_unlock(&unused_lock); |
return NULL; |
} |
/** Mutex protecting the up_hash and ui_hash. */ |
static FIBRIL_MUTEX_INITIALIZE(used_lock); |
/** |
* Global hash table of all used fat_idx_t structures. |
* The index structures are hashed by the dev_handle, parent node's first |
* cluster and index within the parent directory. |
*/ |
static hash_table_t up_hash; |
#define UPH_BUCKETS_LOG 12 |
#define UPH_BUCKETS (1 << UPH_BUCKETS_LOG) |
#define UPH_DH_KEY 0 |
#define UPH_PFC_KEY 1 |
#define UPH_PDI_KEY 2 |
static hash_index_t pos_hash(unsigned long key[]) |
{ |
dev_handle_t dev_handle = (dev_handle_t)key[UPH_DH_KEY]; |
fat_cluster_t pfc = (fat_cluster_t)key[UPH_PFC_KEY]; |
unsigned pdi = (unsigned)key[UPH_PDI_KEY]; |
hash_index_t h; |
/* |
* The least significant half of all bits are the least significant bits |
* of the parent node's first cluster. |
* |
* The least significant half of the most significant half of all bits |
* are the least significant bits of the node's dentry index within the |
* parent directory node. |
* |
* The most significant half of the most significant half of all bits |
* are the least significant bits of the device handle. |
*/ |
h = pfc & ((1 << (UPH_BUCKETS_LOG / 2)) - 1); |
h |= (pdi & ((1 << (UPH_BUCKETS_LOG / 4)) - 1)) << |
(UPH_BUCKETS_LOG / 2); |
h |= (dev_handle & ((1 << (UPH_BUCKETS_LOG / 4)) - 1)) << |
(3 * (UPH_BUCKETS_LOG / 4)); |
return h; |
} |
static int pos_compare(unsigned long key[], hash_count_t keys, link_t *item) |
{ |
dev_handle_t dev_handle = (dev_handle_t)key[UPH_DH_KEY]; |
fat_cluster_t pfc = (fat_cluster_t)key[UPH_PFC_KEY]; |
unsigned pdi = (unsigned)key[UPH_PDI_KEY]; |
fat_idx_t *fidx = list_get_instance(item, fat_idx_t, uph_link); |
return (dev_handle == fidx->dev_handle) && (pfc == fidx->pfc) && |
(pdi == fidx->pdi); |
} |
static void pos_remove_callback(link_t *item) |
{ |
/* nothing to do */ |
} |
static hash_table_operations_t uph_ops = { |
.hash = pos_hash, |
.compare = pos_compare, |
.remove_callback = pos_remove_callback, |
}; |
/** |
* Global hash table of all used fat_idx_t structures. |
* The index structures are hashed by the dev_handle and index. |
*/ |
static hash_table_t ui_hash; |
#define UIH_BUCKETS_LOG 12 |
#define UIH_BUCKETS (1 << UIH_BUCKETS_LOG) |
#define UIH_DH_KEY 0 |
#define UIH_INDEX_KEY 1 |
static hash_index_t idx_hash(unsigned long key[]) |
{ |
dev_handle_t dev_handle = (dev_handle_t)key[UIH_DH_KEY]; |
fs_index_t index = (fs_index_t)key[UIH_INDEX_KEY]; |
hash_index_t h; |
h = dev_handle & ((1 << (UIH_BUCKETS_LOG / 2)) - 1); |
h |= (index & ((1 << (UIH_BUCKETS_LOG / 2)) - 1)) << |
(UIH_BUCKETS_LOG / 2); |
return h; |
} |
static int idx_compare(unsigned long key[], hash_count_t keys, link_t *item) |
{ |
dev_handle_t dev_handle = (dev_handle_t)key[UIH_DH_KEY]; |
fs_index_t index = (fs_index_t)key[UIH_INDEX_KEY]; |
fat_idx_t *fidx = list_get_instance(item, fat_idx_t, uih_link); |
return (dev_handle == fidx->dev_handle) && (index == fidx->index); |
} |
static void idx_remove_callback(link_t *item) |
{ |
/* nothing to do */ |
} |
static hash_table_operations_t uih_ops = { |
.hash = idx_hash, |
.compare = idx_compare, |
.remove_callback = idx_remove_callback, |
}; |
/** Allocate a VFS index which is not currently in use. */ |
static bool fat_index_alloc(dev_handle_t dev_handle, fs_index_t *index) |
{ |
unused_t *u; |
assert(index); |
u = unused_find(dev_handle, true); |
if (!u) |
return false; |
if (list_empty(&u->freed_head)) { |
if (u->remaining) { |
/* |
* There are no freed indices, allocate one directly |
* from the counter. |
*/ |
*index = u->next++; |
--u->remaining; |
fibril_mutex_unlock(&unused_lock); |
return true; |
} |
} else { |
/* There are some freed indices which we can reuse. */ |
freed_t *f = list_get_instance(u->freed_head.next, freed_t, |
link); |
*index = f->first; |
if (f->first++ == f->last) { |
/* Destroy the interval. */ |
list_remove(&f->link); |
free(f); |
} |
fibril_mutex_unlock(&unused_lock); |
return true; |
} |
/* |
* We ran out of indices, which is extremely unlikely with FAT16, but |
* theoretically still possible (e.g. too many open unlinked nodes or |
* too many zero-sized nodes). |
*/ |
fibril_mutex_unlock(&unused_lock); |
return false; |
} |
/** If possible, coalesce two intervals of freed indices. */ |
static void try_coalesce_intervals(link_t *l, link_t *r, link_t *cur) |
{ |
freed_t *fl = list_get_instance(l, freed_t, link); |
freed_t *fr = list_get_instance(r, freed_t, link); |
if (fl->last + 1 == fr->first) { |
if (cur == l) { |
fl->last = fr->last; |
list_remove(r); |
free(r); |
} else { |
fr->first = fl->first; |
list_remove(l); |
free(l); |
} |
} |
} |
/** Free a VFS index, which is no longer in use. */ |
static void fat_index_free(dev_handle_t dev_handle, fs_index_t index) |
{ |
unused_t *u; |
u = unused_find(dev_handle, true); |
assert(u); |
if (u->next == index + 1) { |
/* The index can be returned directly to the counter. */ |
u->next--; |
u->remaining++; |
} else { |
/* |
* The index must be returned either to an existing freed |
* interval or a new interval must be created. |
*/ |
link_t *lnk; |
freed_t *n; |
for (lnk = u->freed_head.next; lnk != &u->freed_head; |
lnk = lnk->next) { |
freed_t *f = list_get_instance(lnk, freed_t, link); |
if (f->first == index + 1) { |
f->first--; |
if (lnk->prev != &u->freed_head) |
try_coalesce_intervals(lnk->prev, lnk, |
lnk); |
fibril_mutex_unlock(&unused_lock); |
return; |
} |
if (f->last == index - 1) { |
f->last++; |
if (lnk->next != &u->freed_head) |
try_coalesce_intervals(lnk, lnk->next, |
lnk); |
fibril_mutex_unlock(&unused_lock); |
return; |
} |
if (index > f->first) { |
n = malloc(sizeof(freed_t)); |
/* TODO: sleep until allocation succeeds */ |
assert(n); |
link_initialize(&n->link); |
n->first = index; |
n->last = index; |
list_insert_before(&n->link, lnk); |
fibril_mutex_unlock(&unused_lock); |
return; |
} |
} |
/* The index will form the last interval. */ |
n = malloc(sizeof(freed_t)); |
/* TODO: sleep until allocation succeeds */ |
assert(n); |
link_initialize(&n->link); |
n->first = index; |
n->last = index; |
list_append(&n->link, &u->freed_head); |
} |
fibril_mutex_unlock(&unused_lock); |
} |
static fat_idx_t *fat_idx_create(dev_handle_t dev_handle) |
{ |
fat_idx_t *fidx; |
fidx = (fat_idx_t *) malloc(sizeof(fat_idx_t)); |
if (!fidx) |
return NULL; |
if (!fat_index_alloc(dev_handle, &fidx->index)) { |
free(fidx); |
return NULL; |
} |
link_initialize(&fidx->uph_link); |
link_initialize(&fidx->uih_link); |
fibril_mutex_initialize(&fidx->lock); |
fidx->dev_handle = dev_handle; |
fidx->pfc = FAT_CLST_RES0; /* no parent yet */ |
fidx->pdi = 0; |
fidx->nodep = NULL; |
return fidx; |
} |
fat_idx_t *fat_idx_get_new(dev_handle_t dev_handle) |
{ |
fat_idx_t *fidx; |
fibril_mutex_lock(&used_lock); |
fidx = fat_idx_create(dev_handle); |
if (!fidx) { |
fibril_mutex_unlock(&used_lock); |
return NULL; |
} |
unsigned long ikey[] = { |
[UIH_DH_KEY] = dev_handle, |
[UIH_INDEX_KEY] = fidx->index, |
}; |
hash_table_insert(&ui_hash, ikey, &fidx->uih_link); |
fibril_mutex_lock(&fidx->lock); |
fibril_mutex_unlock(&used_lock); |
return fidx; |
} |
fat_idx_t * |
fat_idx_get_by_pos(dev_handle_t dev_handle, fat_cluster_t pfc, unsigned pdi) |
{ |
fat_idx_t *fidx; |
link_t *l; |
unsigned long pkey[] = { |
[UPH_DH_KEY] = dev_handle, |
[UPH_PFC_KEY] = pfc, |
[UPH_PDI_KEY] = pdi, |
}; |
fibril_mutex_lock(&used_lock); |
l = hash_table_find(&up_hash, pkey); |
if (l) { |
fidx = hash_table_get_instance(l, fat_idx_t, uph_link); |
} else { |
fidx = fat_idx_create(dev_handle); |
if (!fidx) { |
fibril_mutex_unlock(&used_lock); |
return NULL; |
} |
unsigned long ikey[] = { |
[UIH_DH_KEY] = dev_handle, |
[UIH_INDEX_KEY] = fidx->index, |
}; |
fidx->pfc = pfc; |
fidx->pdi = pdi; |
hash_table_insert(&up_hash, pkey, &fidx->uph_link); |
hash_table_insert(&ui_hash, ikey, &fidx->uih_link); |
} |
fibril_mutex_lock(&fidx->lock); |
fibril_mutex_unlock(&used_lock); |
return fidx; |
} |
void fat_idx_hashin(fat_idx_t *idx) |
{ |
unsigned long pkey[] = { |
[UPH_DH_KEY] = idx->dev_handle, |
[UPH_PFC_KEY] = idx->pfc, |
[UPH_PDI_KEY] = idx->pdi, |
}; |
fibril_mutex_lock(&used_lock); |
hash_table_insert(&up_hash, pkey, &idx->uph_link); |
fibril_mutex_unlock(&used_lock); |
} |
void fat_idx_hashout(fat_idx_t *idx) |
{ |
unsigned long pkey[] = { |
[UPH_DH_KEY] = idx->dev_handle, |
[UPH_PFC_KEY] = idx->pfc, |
[UPH_PDI_KEY] = idx->pdi, |
}; |
fibril_mutex_lock(&used_lock); |
hash_table_remove(&up_hash, pkey, 3); |
fibril_mutex_unlock(&used_lock); |
} |
fat_idx_t * |
fat_idx_get_by_index(dev_handle_t dev_handle, fs_index_t index) |
{ |
fat_idx_t *fidx = NULL; |
link_t *l; |
unsigned long ikey[] = { |
[UIH_DH_KEY] = dev_handle, |
[UIH_INDEX_KEY] = index, |
}; |
fibril_mutex_lock(&used_lock); |
l = hash_table_find(&ui_hash, ikey); |
if (l) { |
fidx = hash_table_get_instance(l, fat_idx_t, uih_link); |
fibril_mutex_lock(&fidx->lock); |
} |
fibril_mutex_unlock(&used_lock); |
return fidx; |
} |
/** Destroy the index structure. |
* |
* @param idx The index structure to be destroyed. |
*/ |
void fat_idx_destroy(fat_idx_t *idx) |
{ |
unsigned long ikey[] = { |
[UIH_DH_KEY] = idx->dev_handle, |
[UIH_INDEX_KEY] = idx->index, |
}; |
assert(idx->pfc == FAT_CLST_RES0); |
fibril_mutex_lock(&used_lock); |
/* |
* Since we can only free unlinked nodes, the index structure is not |
* present in the position hash (uph). We therefore hash it out from |
* the index hash only. |
*/ |
hash_table_remove(&ui_hash, ikey, 2); |
fibril_mutex_unlock(&used_lock); |
/* Release the VFS index. */ |
fat_index_free(idx->dev_handle, idx->index); |
/* Deallocate the structure. */ |
free(idx); |
} |
int fat_idx_init(void) |
{ |
if (!hash_table_create(&up_hash, UPH_BUCKETS, 3, &uph_ops)) |
return ENOMEM; |
if (!hash_table_create(&ui_hash, UIH_BUCKETS, 2, &uih_ops)) { |
hash_table_destroy(&up_hash); |
return ENOMEM; |
} |
return EOK; |
} |
void fat_idx_fini(void) |
{ |
/* We assume the hash tables are empty. */ |
hash_table_destroy(&up_hash); |
hash_table_destroy(&ui_hash); |
} |
int fat_idx_init_by_dev_handle(dev_handle_t dev_handle) |
{ |
unused_t *u; |
int rc = EOK; |
u = (unused_t *) malloc(sizeof(unused_t)); |
if (!u) |
return ENOMEM; |
unused_initialize(u, dev_handle); |
fibril_mutex_lock(&unused_lock); |
if (!unused_find(dev_handle, false)) |
list_append(&u->link, &unused_head); |
else |
rc = EEXIST; |
fibril_mutex_unlock(&unused_lock); |
return rc; |
} |
void fat_idx_fini_by_dev_handle(dev_handle_t dev_handle) |
{ |
unused_t *u; |
u = unused_find(dev_handle, true); |
assert(u); |
list_remove(&u->link); |
fibril_mutex_unlock(&unused_lock); |
while (!list_empty(&u->freed_head)) { |
freed_t *f; |
f = list_get_instance(u->freed_head.next, freed_t, link); |
list_remove(&f->link); |
free(f); |
} |
free(u); |
} |
/** |
* @} |
*/ |
//branches/snapshot/uspace/srv/fs/fat/fat_fat.c |
---|
0,0 → 1,455 |
/* |
* Copyright (c) 2008 Jakub Jermar |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup fs |
* @{ |
*/ |
/** |
* @file fat_fat.c |
* @brief Functions that manipulate the File Allocation Tables. |
*/ |
#include "fat_fat.h" |
#include "fat_dentry.h" |
#include "fat.h" |
#include "../../vfs/vfs.h" |
#include <libfs.h> |
#include <libblock.h> |
#include <errno.h> |
#include <byteorder.h> |
#include <align.h> |
#include <assert.h> |
#include <fibril_sync.h> |
#include <mem.h> |
/** |
* The fat_alloc_lock mutex protects all copies of the File Allocation Table |
* during allocation of clusters. The lock does not have to be held durring |
* deallocation of clusters. |
*/ |
static FIBRIL_MUTEX_INITIALIZE(fat_alloc_lock); |
/** Walk the cluster chain. |
* |
* @param bs Buffer holding the boot sector for the file. |
* @param dev_handle Device handle of the device with the file. |
* @param firstc First cluster to start the walk with. |
* @param lastc If non-NULL, output argument hodling the last cluster number visited. |
* @param max_clusters Maximum number of clusters to visit. |
* |
* @return Number of clusters seen during the walk. |
*/ |
uint16_t |
fat_cluster_walk(fat_bs_t *bs, dev_handle_t dev_handle, fat_cluster_t firstc, |
fat_cluster_t *lastc, uint16_t max_clusters) |
{ |
block_t *b; |
unsigned bps; |
unsigned rscnt; /* block address of the first FAT */ |
uint16_t clusters = 0; |
fat_cluster_t clst = firstc; |
bps = uint16_t_le2host(bs->bps); |
rscnt = uint16_t_le2host(bs->rscnt); |
if (firstc == FAT_CLST_RES0) { |
/* No space allocated to the file. */ |
if (lastc) |
*lastc = firstc; |
return 0; |
} |
while (clst < FAT_CLST_LAST1 && clusters < max_clusters) { |
bn_t fsec; /* sector offset relative to FAT1 */ |
unsigned fidx; /* FAT1 entry index */ |
assert(clst >= FAT_CLST_FIRST); |
if (lastc) |
*lastc = clst; /* remember the last cluster number */ |
fsec = (clst * sizeof(fat_cluster_t)) / bps; |
fidx = clst % (bps / sizeof(fat_cluster_t)); |
/* read FAT1 */ |
b = block_get(dev_handle, rscnt + fsec, BLOCK_FLAGS_NONE); |
clst = uint16_t_le2host(((fat_cluster_t *)b->data)[fidx]); |
assert(clst != FAT_CLST_BAD); |
block_put(b); |
clusters++; |
} |
if (lastc && clst < FAT_CLST_LAST1) |
*lastc = clst; |
return clusters; |
} |
/** Read block from file located on a FAT file system. |
* |
* @param bs Buffer holding the boot sector of the file system. |
* @param dev_handle Device handle of the file system. |
* @param firstc First cluster used by the file. Can be zero if the file |
* is empty. |
* @param bn Block number. |
* @param flags Flags passed to libblock. |
* |
* @return Block structure holding the requested block. |
*/ |
block_t * |
_fat_block_get(fat_bs_t *bs, dev_handle_t dev_handle, fat_cluster_t firstc, |
bn_t bn, int flags) |
{ |
block_t *b; |
unsigned bps; |
unsigned rscnt; /* block address of the first FAT */ |
unsigned rde; |
unsigned rds; /* root directory size */ |
unsigned sf; |
unsigned ssa; /* size of the system area */ |
unsigned clusters, max_clusters; |
fat_cluster_t lastc; |
bps = uint16_t_le2host(bs->bps); |
rscnt = uint16_t_le2host(bs->rscnt); |
rde = uint16_t_le2host(bs->root_ent_max); |
sf = uint16_t_le2host(bs->sec_per_fat); |
rds = (sizeof(fat_dentry_t) * rde) / bps; |
rds += ((sizeof(fat_dentry_t) * rde) % bps != 0); |
ssa = rscnt + bs->fatcnt * sf + rds; |
if (firstc == FAT_CLST_ROOT) { |
/* root directory special case */ |
assert(bn < rds); |
b = block_get(dev_handle, rscnt + bs->fatcnt * sf + bn, flags); |
return b; |
} |
max_clusters = bn / bs->spc; |
clusters = fat_cluster_walk(bs, dev_handle, firstc, &lastc, |
max_clusters); |
assert(clusters == max_clusters); |
b = block_get(dev_handle, ssa + (lastc - FAT_CLST_FIRST) * bs->spc + |
bn % bs->spc, flags); |
return b; |
} |
/** Fill the gap between EOF and a new file position. |
* |
* @param bs Buffer holding the boot sector for nodep. |
* @param nodep FAT node with the gap. |
* @param mcl First cluster in an independent cluster chain that will |
* be later appended to the end of the node's own cluster |
* chain. If pos is still in the last allocated cluster, |
* this argument is ignored. |
* @param pos Position in the last node block. |
*/ |
void fat_fill_gap(fat_bs_t *bs, fat_node_t *nodep, fat_cluster_t mcl, off_t pos) |
{ |
uint16_t bps; |
unsigned spc; |
block_t *b; |
off_t o, boundary; |
bps = uint16_t_le2host(bs->bps); |
spc = bs->spc; |
boundary = ROUND_UP(nodep->size, bps * spc); |
/* zero out already allocated space */ |
for (o = nodep->size; o < pos && o < boundary; |
o = ALIGN_DOWN(o + bps, bps)) { |
int flags = (o % bps == 0) ? |
BLOCK_FLAGS_NOREAD : BLOCK_FLAGS_NONE; |
b = fat_block_get(bs, nodep, o / bps, flags); |
memset(b->data + o % bps, 0, bps - o % bps); |
b->dirty = true; /* need to sync node */ |
block_put(b); |
} |
if (o >= pos) |
return; |
/* zero out the initial part of the new cluster chain */ |
for (o = boundary; o < pos; o += bps) { |
b = _fat_block_get(bs, nodep->idx->dev_handle, mcl, |
(o - boundary) / bps, BLOCK_FLAGS_NOREAD); |
memset(b->data, 0, min(bps, pos - o)); |
b->dirty = true; /* need to sync node */ |
block_put(b); |
} |
} |
/** Get cluster from the first FAT. |
* |
* @param bs Buffer holding the boot sector for the file system. |
* @param dev_handle Device handle for the file system. |
* @param clst Cluster which to get. |
* |
* @return Value found in the cluster. |
*/ |
fat_cluster_t |
fat_get_cluster(fat_bs_t *bs, dev_handle_t dev_handle, fat_cluster_t clst) |
{ |
block_t *b; |
uint16_t bps; |
uint16_t rscnt; |
fat_cluster_t *cp, value; |
bps = uint16_t_le2host(bs->bps); |
rscnt = uint16_t_le2host(bs->rscnt); |
b = block_get(dev_handle, rscnt + (clst * sizeof(fat_cluster_t)) / bps, |
BLOCK_FLAGS_NONE); |
cp = (fat_cluster_t *)b->data + clst % (bps / sizeof(fat_cluster_t)); |
value = uint16_t_le2host(*cp); |
block_put(b); |
return value; |
} |
/** Set cluster in one instance of FAT. |
* |
* @param bs Buffer holding the boot sector for the file system. |
* @param dev_handle Device handle for the file system. |
* @param fatno Number of the FAT instance where to make the change. |
* @param clst Cluster which is to be set. |
* @param value Value to set the cluster with. |
*/ |
void |
fat_set_cluster(fat_bs_t *bs, dev_handle_t dev_handle, unsigned fatno, |
fat_cluster_t clst, fat_cluster_t value) |
{ |
block_t *b; |
uint16_t bps; |
uint16_t rscnt; |
uint16_t sf; |
fat_cluster_t *cp; |
bps = uint16_t_le2host(bs->bps); |
rscnt = uint16_t_le2host(bs->rscnt); |
sf = uint16_t_le2host(bs->sec_per_fat); |
assert(fatno < bs->fatcnt); |
b = block_get(dev_handle, rscnt + sf * fatno + |
(clst * sizeof(fat_cluster_t)) / bps, BLOCK_FLAGS_NONE); |
cp = (fat_cluster_t *)b->data + clst % (bps / sizeof(fat_cluster_t)); |
*cp = host2uint16_t_le(value); |
b->dirty = true; /* need to sync block */ |
block_put(b); |
} |
/** Replay the allocatoin of clusters in all shadow instances of FAT. |
* |
* @param bs Buffer holding the boot sector of the file system. |
* @param dev_handle Device handle of the file system. |
* @param lifo Chain of allocated clusters. |
* @param nclsts Number of clusters in the lifo chain. |
*/ |
void fat_alloc_shadow_clusters(fat_bs_t *bs, dev_handle_t dev_handle, |
fat_cluster_t *lifo, unsigned nclsts) |
{ |
uint8_t fatno; |
unsigned c; |
for (fatno = FAT1 + 1; fatno < bs->fatcnt; fatno++) { |
for (c = 0; c < nclsts; c++) { |
fat_set_cluster(bs, dev_handle, fatno, lifo[c], |
c == 0 ? FAT_CLST_LAST1 : lifo[c - 1]); |
} |
} |
} |
/** Allocate clusters in all copies of FAT. |
* |
* This function will attempt to allocate the requested number of clusters in |
* all instances of the FAT. The FAT will be altered so that the allocated |
* clusters form an independent chain (i.e. a chain which does not belong to any |
* file yet). |
* |
* @param bs Buffer holding the boot sector of the file system. |
* @param dev_handle Device handle of the file system. |
* @param nclsts Number of clusters to allocate. |
* @param mcl Output parameter where the first cluster in the chain |
* will be returned. |
* @param lcl Output parameter where the last cluster in the chain |
* will be returned. |
* |
* @return EOK on success, a negative error code otherwise. |
*/ |
int |
fat_alloc_clusters(fat_bs_t *bs, dev_handle_t dev_handle, unsigned nclsts, |
fat_cluster_t *mcl, fat_cluster_t *lcl) |
{ |
uint16_t bps; |
uint16_t rscnt; |
uint16_t sf; |
block_t *blk; |
fat_cluster_t *lifo; /* stack for storing free cluster numbers */ |
unsigned found = 0; /* top of the free cluster number stack */ |
unsigned b, c, cl; |
lifo = (fat_cluster_t *) malloc(nclsts * sizeof(fat_cluster_t)); |
if (!lifo) |
return ENOMEM; |
bps = uint16_t_le2host(bs->bps); |
rscnt = uint16_t_le2host(bs->rscnt); |
sf = uint16_t_le2host(bs->sec_per_fat); |
/* |
* Search FAT1 for unused clusters. |
*/ |
fibril_mutex_lock(&fat_alloc_lock); |
for (b = 0, cl = 0; b < sf; b++) { |
blk = block_get(dev_handle, rscnt + b, BLOCK_FLAGS_NONE); |
for (c = 0; c < bps / sizeof(fat_cluster_t); c++, cl++) { |
fat_cluster_t *clst = (fat_cluster_t *)blk->data + c; |
if (uint16_t_le2host(*clst) == FAT_CLST_RES0) { |
/* |
* The cluster is free. Put it into our stack |
* of found clusters and mark it as non-free. |
*/ |
lifo[found] = cl; |
*clst = (found == 0) ? |
host2uint16_t_le(FAT_CLST_LAST1) : |
host2uint16_t_le(lifo[found - 1]); |
blk->dirty = true; /* need to sync block */ |
if (++found == nclsts) { |
/* we are almost done */ |
block_put(blk); |
/* update the shadow copies of FAT */ |
fat_alloc_shadow_clusters(bs, |
dev_handle, lifo, nclsts); |
*mcl = lifo[found - 1]; |
*lcl = lifo[0]; |
free(lifo); |
fibril_mutex_unlock(&fat_alloc_lock); |
return EOK; |
} |
} |
} |
block_put(blk); |
} |
fibril_mutex_unlock(&fat_alloc_lock); |
/* |
* We could not find enough clusters. Now we need to free the clusters |
* we have allocated so far. |
*/ |
while (found--) { |
fat_set_cluster(bs, dev_handle, FAT1, lifo[found], |
FAT_CLST_RES0); |
} |
free(lifo); |
return ENOSPC; |
} |
/** Free clusters forming a cluster chain in all copies of FAT. |
* |
* @param bs Buffer hodling the boot sector of the file system. |
* @param dev_handle Device handle of the file system. |
* @param firstc First cluster in the chain which is to be freed. |
*/ |
void |
fat_free_clusters(fat_bs_t *bs, dev_handle_t dev_handle, fat_cluster_t firstc) |
{ |
unsigned fatno; |
fat_cluster_t nextc; |
/* Mark all clusters in the chain as free in all copies of FAT. */ |
while (firstc < FAT_CLST_LAST1) { |
assert(firstc >= FAT_CLST_FIRST && firstc < FAT_CLST_BAD); |
nextc = fat_get_cluster(bs, dev_handle, firstc); |
for (fatno = FAT1; fatno < bs->fatcnt; fatno++) |
fat_set_cluster(bs, dev_handle, fatno, firstc, |
FAT_CLST_RES0); |
firstc = nextc; |
} |
} |
/** Append a cluster chain to the last file cluster in all FATs. |
* |
* @param bs Buffer holding the boot sector of the file system. |
* @param nodep Node representing the file. |
* @param mcl First cluster of the cluster chain to append. |
*/ |
void fat_append_clusters(fat_bs_t *bs, fat_node_t *nodep, fat_cluster_t mcl) |
{ |
dev_handle_t dev_handle = nodep->idx->dev_handle; |
fat_cluster_t lcl; |
uint8_t fatno; |
if (fat_cluster_walk(bs, dev_handle, nodep->firstc, &lcl, |
(uint16_t) -1) == 0) { |
/* No clusters allocated to the node yet. */ |
nodep->firstc = mcl; |
nodep->dirty = true; /* need to sync node */ |
return; |
} |
for (fatno = FAT1; fatno < bs->fatcnt; fatno++) |
fat_set_cluster(bs, nodep->idx->dev_handle, fatno, lcl, mcl); |
} |
/** Chop off node clusters in all copies of FAT. |
* |
* @param bs Buffer holding the boot sector of the file system. |
* @param nodep FAT node where the chopping will take place. |
* @param lastc Last cluster which will remain in the node. If this |
* argument is FAT_CLST_RES0, then all clusters will |
* be chopped off. |
*/ |
void fat_chop_clusters(fat_bs_t *bs, fat_node_t *nodep, fat_cluster_t lastc) |
{ |
dev_handle_t dev_handle = nodep->idx->dev_handle; |
if (lastc == FAT_CLST_RES0) { |
/* The node will have zero size and no clusters allocated. */ |
fat_free_clusters(bs, dev_handle, nodep->firstc); |
nodep->firstc = FAT_CLST_RES0; |
nodep->dirty = true; /* need to sync node */ |
} else { |
fat_cluster_t nextc; |
unsigned fatno; |
nextc = fat_get_cluster(bs, dev_handle, lastc); |
/* Terminate the cluster chain in all copies of FAT. */ |
for (fatno = FAT1; fatno < bs->fatcnt; fatno++) |
fat_set_cluster(bs, dev_handle, fatno, lastc, FAT_CLST_LAST1); |
/* Free all following clusters. */ |
fat_free_clusters(bs, dev_handle, nextc); |
} |
} |
/** |
* @} |
*/ |
//branches/snapshot/uspace/srv/fs/fat/Makefile |
---|
0,0 → 1,86 |
# |
# Copyright (c) 2006 Martin Decky |
# All rights reserved. |
# |
# Redistribution and use in source and binary forms, with or without |
# modification, are permitted provided that the following conditions |
# are met: |
# |
# - Redistributions of source code must retain the above copyright |
# notice, this list of conditions and the following disclaimer. |
# - 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. |
# - The name of the author may not be used to endorse or promote products |
# derived from this software without specific prior written permission. |
# |
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
# |
## Setup toolchain |
# |
LIBC_PREFIX = ../../../lib/libc |
LIBFS_PREFIX = ../../../lib/libfs |
LIBBLOCK_PREFIX = ../../../lib/libblock |
SOFTINT_PREFIX = ../../../lib/softint |
include $(LIBC_PREFIX)/Makefile.toolchain |
CFLAGS += -I $(LIBFS_PREFIX) -I $(LIBBLOCK_PREFIX) |
LIBS = \ |
$(LIBFS_PREFIX)/libfs.a \ |
$(LIBBLOCK_PREFIX)/libblock.a \ |
$(LIBC_PREFIX)/libc.a |
## Sources |
# |
OUTPUT = fat |
SOURCES = \ |
fat.c \ |
fat_ops.c \ |
fat_idx.c \ |
fat_dentry.c \ |
fat_fat.c |
OBJECTS := $(addsuffix .o,$(basename $(SOURCES))) |
.PHONY: all clean depend disasm |
all: $(OUTPUT) $(OUTPUT).disasm |
-include Makefile.depend |
clean: |
-rm -f $(OUTPUT) $(OUTPUT).map $(OUTPUT).disasm Makefile.depend $(OBJECTS) |
depend: |
$(CC) $(DEFS) $(CFLAGS) -M $(SOURCES) > Makefile.depend |
$(OUTPUT): $(OBJECTS) $(LIBS) |
$(LD) -T $(LIBC_PREFIX)/arch/$(UARCH)/_link.ld $(OBJECTS) $(LIBS) $(LFLAGS) -o $@ -Map $(OUTPUT).map |
disasm: $(OUTPUT).disasm |
$(OUTPUT).disasm: $(OUTPUT) |
$(OBJDUMP) -d $< > $@ |
%.o: %.S |
$(CC) $(DEFS) $(AFLAGS) $(CFLAGS) -D__ASM__ -c $< -o $@ |
%.o: %.s |
$(AS) $(AFLAGS) $< -o $@ |
%.o: %.c |
$(CC) $(DEFS) $(CFLAGS) -c $< -o $@ |
//branches/snapshot/uspace/srv/fs/fat/fat_dentry.c |
---|
0,0 → 1,243 |
/* |
* Copyright (c) 2008 Jakub Jermar |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup fs |
* @{ |
*/ |
/** |
* @file fat_dentry.c |
* @brief Functions that work with FAT directory entries. |
*/ |
#include "fat_dentry.h" |
#include <ctype.h> |
#include <string.h> |
static bool is_d_char(const char ch) |
{ |
if (isalnum(ch) || ch == '_') |
return true; |
else |
return false; |
} |
/** Compare path component with the name read from the dentry. |
* |
* This function compares the path component with the name read from the dentry. |
* The comparison is case insensitive and tolerates a mismatch on the trailing |
* dot character at the end of the name (i.e. when there is a dot, but no |
* extension). |
* |
* @param name Node name read from the dentry. |
* @param component Path component. |
* |
* @return Zero on match, non-zero otherwise. |
*/ |
int fat_dentry_namecmp(char *name, const char *component) |
{ |
int rc; |
size_t size; |
if (!(rc = stricmp(name, component))) |
return rc; |
if (!str_chr(name, '.')) { |
/* |
* There is no '.' in the name, so we know that there is enough |
* space for appending an extra '.' to name. |
*/ |
size = str_size(name); |
name[size] = '.'; |
name[size + 1] = '\0'; |
rc = stricmp(name, component); |
} |
return rc; |
} |
bool fat_dentry_name_verify(const char *name) |
{ |
unsigned i, dot; |
bool dot_found = false; |
for (i = 0; name[i]; i++) { |
if (name[i] == '.') { |
if (dot_found) { |
return false; |
} else { |
dot_found = true; |
dot = i; |
} |
} else { |
if (!is_d_char(name[i])) |
return false; |
} |
} |
if (dot_found) { |
if (dot > FAT_NAME_LEN) |
return false; |
if (i - dot > FAT_EXT_LEN + 1) |
return false; |
} else { |
if (i > FAT_NAME_LEN) |
return false; |
} |
return true; |
} |
void fat_dentry_name_get(const fat_dentry_t *d, char *buf) |
{ |
unsigned int i; |
for (i = 0; i < FAT_NAME_LEN; i++) { |
if (d->name[i] == FAT_PAD) |
break; |
if (d->name[i] == FAT_DENTRY_E5_ESC) |
*buf++ = 0xe5; |
else { |
if (d->lcase & FAT_LCASE_LOWER_NAME) |
*buf++ = tolower(d->name[i]); |
else |
*buf++ = d->name[i]; |
} |
} |
if (d->ext[0] != FAT_PAD) |
*buf++ = '.'; |
for (i = 0; i < FAT_EXT_LEN; i++) { |
if (d->ext[i] == FAT_PAD) { |
*buf = '\0'; |
return; |
} |
if (d->ext[i] == FAT_DENTRY_E5_ESC) |
*buf++ = 0xe5; |
else { |
if (d->lcase & FAT_LCASE_LOWER_EXT) |
*buf++ = tolower(d->ext[i]); |
else |
*buf++ = d->ext[i]; |
} |
} |
*buf = '\0'; |
} |
void fat_dentry_name_set(fat_dentry_t *d, const char *name) |
{ |
unsigned int i; |
const char fake_ext[] = " "; |
bool lower_name = true; |
bool lower_ext = true; |
for (i = 0; i < FAT_NAME_LEN; i++) { |
switch ((uint8_t) *name) { |
case 0xe5: |
d->name[i] = FAT_DENTRY_E5_ESC; |
name++; |
break; |
case '\0': |
case '.': |
d->name[i] = FAT_PAD; |
break; |
default: |
if (isalpha(*name)) { |
if (!islower(*name)) |
lower_name = false; |
} |
d->name[i] = toupper(*name++); |
break; |
} |
} |
if (*name++ != '.') |
name = fake_ext; |
for (i = 0; i < FAT_EXT_LEN; i++) { |
switch ((uint8_t) *name) { |
case 0xe5: |
d->ext[i] = FAT_DENTRY_E5_ESC; |
name++; |
break; |
case '\0': |
d->ext[i] = FAT_PAD; |
break; |
default: |
if (isalpha(*name)) { |
if (!islower(*name)) |
lower_ext = false; |
} |
d->ext[i] = toupper(*name++); |
break; |
} |
} |
if (lower_name) |
d->lcase |= FAT_LCASE_LOWER_NAME; |
else |
d->lcase &= ~FAT_LCASE_LOWER_NAME; |
if (lower_ext) |
d->lcase |= FAT_LCASE_LOWER_EXT; |
else |
d->lcase &= ~FAT_LCASE_LOWER_EXT; |
} |
fat_dentry_clsf_t fat_classify_dentry(const fat_dentry_t *d) |
{ |
if (d->attr & FAT_ATTR_VOLLABEL) { |
/* volume label entry */ |
return FAT_DENTRY_SKIP; |
} |
if (d->name[0] == FAT_DENTRY_ERASED) { |
/* not-currently-used entry */ |
return FAT_DENTRY_FREE; |
} |
if (d->name[0] == FAT_DENTRY_UNUSED) { |
/* never used entry */ |
return FAT_DENTRY_LAST; |
} |
if (d->name[0] == FAT_DENTRY_DOT) { |
/* |
* Most likely '.' or '..'. |
* It cannot occur in a regular file name. |
*/ |
return FAT_DENTRY_SKIP; |
} |
return FAT_DENTRY_VALID; |
} |
/** |
* @} |
*/ |
//branches/snapshot/uspace/srv/fs/fat/fat_dentry.h |
---|
0,0 → 1,99 |
/* |
* Copyright (c) 2008 Jakub Jermar |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup fs |
* @{ |
*/ |
#ifndef FAT_FAT_DENTRY_H_ |
#define FAT_FAT_DENTRY_H_ |
#include <stdint.h> |
#include <bool.h> |
#define FAT_NAME_LEN 8 |
#define FAT_EXT_LEN 3 |
#define FAT_NAME_DOT ". " |
#define FAT_NAME_DOT_DOT ".. " |
#define FAT_EXT_PAD " " |
#define FAT_ATTR_RDONLY (1 << 0) |
#define FAT_ATTR_VOLLABEL (1 << 3) |
#define FAT_ATTR_SUBDIR (1 << 4) |
#define FAT_LCASE_LOWER_NAME 0x08 |
#define FAT_LCASE_LOWER_EXT 0x10 |
#define FAT_PAD ' ' |
#define FAT_DENTRY_UNUSED 0x00 |
#define FAT_DENTRY_E5_ESC 0x05 |
#define FAT_DENTRY_DOT 0x2e |
#define FAT_DENTRY_ERASED 0xe5 |
typedef enum { |
FAT_DENTRY_SKIP, |
FAT_DENTRY_LAST, |
FAT_DENTRY_FREE, |
FAT_DENTRY_VALID |
} fat_dentry_clsf_t; |
typedef struct { |
uint8_t name[8]; |
uint8_t ext[3]; |
uint8_t attr; |
uint8_t lcase; |
uint8_t ctime_fine; |
uint16_t ctime; |
uint16_t cdate; |
uint16_t adate; |
union { |
uint16_t eaidx; /* FAT12/FAT16 */ |
uint16_t firstc_hi; /* FAT32 */ |
} __attribute__ ((packed)); |
uint16_t mtime; |
uint16_t mdate; |
union { |
uint16_t firstc; /* FAT12/FAT16 */ |
uint16_t firstc_lo; /* FAT32 */ |
} __attribute__ ((packed)); |
uint32_t size; |
} __attribute__ ((packed)) fat_dentry_t; |
extern int fat_dentry_namecmp(char *, const char *); |
extern bool fat_dentry_name_verify(const char *); |
extern void fat_dentry_name_get(const fat_dentry_t *, char *); |
extern void fat_dentry_name_set(fat_dentry_t *, const char *); |
extern fat_dentry_clsf_t fat_classify_dentry(const fat_dentry_t *); |
#endif |
/** |
* @} |
*/ |
//branches/snapshot/uspace/srv/fs/fat/fat_fat.h |
---|
0,0 → 1,91 |
/* |
* Copyright (c) 2008 Jakub Jermar |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup fs |
* @{ |
*/ |
#ifndef FAT_FAT_FAT_H_ |
#define FAT_FAT_FAT_H_ |
#include "../../vfs/vfs.h" |
#include <stdint.h> |
#include <libblock.h> |
#define FAT1 0 |
#define FAT_CLST_RES0 0x0000 |
#define FAT_CLST_RES1 0x0001 |
#define FAT_CLST_FIRST 0x0002 |
#define FAT_CLST_BAD 0xfff7 |
#define FAT_CLST_LAST1 0xfff8 |
#define FAT_CLST_LAST8 0xffff |
/* internally used to mark root directory's parent */ |
#define FAT_CLST_ROOTPAR FAT_CLST_RES0 |
/* internally used to mark root directory */ |
#define FAT_CLST_ROOT FAT_CLST_RES1 |
/* forward declarations */ |
struct block; |
struct fat_node; |
struct fat_bs; |
typedef uint16_t fat_cluster_t; |
#define fat_clusters_get(bs, dh, fc) \ |
fat_cluster_walk((bs), (dh), (fc), NULL, (uint16_t) -1) |
extern uint16_t fat_cluster_walk(struct fat_bs *, dev_handle_t, fat_cluster_t, |
fat_cluster_t *, uint16_t); |
#define fat_block_get(bs, np, bn, flags) \ |
_fat_block_get((bs), (np)->idx->dev_handle, (np)->firstc, (bn), (flags)) |
extern struct block *_fat_block_get(struct fat_bs *, dev_handle_t, |
fat_cluster_t, bn_t, int); |
extern void fat_append_clusters(struct fat_bs *, struct fat_node *, |
fat_cluster_t); |
extern void fat_chop_clusters(struct fat_bs *, struct fat_node *, |
fat_cluster_t); |
extern int fat_alloc_clusters(struct fat_bs *, dev_handle_t, unsigned, |
fat_cluster_t *, fat_cluster_t *); |
extern void fat_free_clusters(struct fat_bs *, dev_handle_t, fat_cluster_t); |
extern void fat_alloc_shadow_clusters(struct fat_bs *, dev_handle_t, |
fat_cluster_t *, unsigned); |
extern fat_cluster_t fat_get_cluster(struct fat_bs *, dev_handle_t, fat_cluster_t); |
extern void fat_set_cluster(struct fat_bs *, dev_handle_t, unsigned, |
fat_cluster_t, fat_cluster_t); |
extern void fat_fill_gap(struct fat_bs *, struct fat_node *, fat_cluster_t, |
off_t); |
#endif |
/** |
* @} |
*/ |
//branches/snapshot/uspace/srv/bd/rd/rd.c |
---|
0,0 → 1,241 |
/* |
* Copyright (c) 2007 Michal Konopa |
* Copyright (c) 2007 Martin Jelen |
* Copyright (c) 2007 Peter Majer |
* Copyright (c) 2007 Jakub Jermar |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup rd |
* @{ |
*/ |
/** |
* @file rd.c |
* @brief Initial RAM disk for HelenOS. |
*/ |
#include <ipc/ipc.h> |
#include <ipc/services.h> |
#include <ipc/ns.h> |
#include <sysinfo.h> |
#include <as.h> |
#include <ddi.h> |
#include <align.h> |
#include <bool.h> |
#include <errno.h> |
#include <async.h> |
#include <align.h> |
#include <async.h> |
#include <fibril_sync.h> |
#include <stdio.h> |
#include <devmap.h> |
#include <ipc/bd.h> |
#define NAME "rd" |
/** Pointer to the ramdisk's image. */ |
static void *rd_addr; |
/** Size of the ramdisk. */ |
static size_t rd_size; |
/** |
* This rwlock protects the ramdisk's data. |
* If we were to serve multiple requests (read + write or several writes) |
* concurrently (i.e. from two or more threads), each read and write needs to be |
* protected by this rwlock. |
*/ |
fibril_rwlock_t rd_lock; |
/** Handle one connection to ramdisk. |
* |
* @param iid Hash of the request that opened the connection. |
* @param icall Call data of the request that opened the connection. |
*/ |
static void rd_connection(ipc_callid_t iid, ipc_call_t *icall) |
{ |
ipc_callid_t callid; |
ipc_call_t call; |
int retval; |
void *fs_va = NULL; |
off_t offset; |
size_t block_size; |
size_t maxblock_size; |
/* |
* Answer the first IPC_M_CONNECT_ME_TO call. |
*/ |
ipc_answer_0(iid, EOK); |
/* |
* Now we wait for the client to send us its communication as_area. |
*/ |
int flags; |
if (ipc_share_out_receive(&callid, &maxblock_size, &flags)) { |
fs_va = as_get_mappable_page(maxblock_size); |
if (fs_va) { |
(void) ipc_share_out_finalize(callid, fs_va); |
} else { |
ipc_answer_0(callid, EHANGUP); |
return; |
} |
} else { |
/* |
* The client doesn't speak the same protocol. |
* At this point we can't handle protocol variations. |
* Close the connection. |
*/ |
ipc_answer_0(callid, EHANGUP); |
return; |
} |
while (true) { |
callid = async_get_call(&call); |
switch (IPC_GET_METHOD(call)) { |
case IPC_M_PHONE_HUNGUP: |
/* |
* The other side has hung up. |
* Answer the message and exit the fibril. |
*/ |
ipc_answer_0(callid, EOK); |
return; |
case BD_READ_BLOCK: |
offset = IPC_GET_ARG1(call); |
block_size = IPC_GET_ARG2(call); |
if (block_size > maxblock_size) { |
/* |
* Maximum block size exceeded. |
*/ |
retval = ELIMIT; |
break; |
} |
if (offset * block_size > rd_size - block_size) { |
/* |
* Reading past the end of the device. |
*/ |
retval = ELIMIT; |
break; |
} |
fibril_rwlock_read_lock(&rd_lock); |
memcpy(fs_va, rd_addr + offset * block_size, block_size); |
fibril_rwlock_read_unlock(&rd_lock); |
retval = EOK; |
break; |
case BD_WRITE_BLOCK: |
offset = IPC_GET_ARG1(call); |
block_size = IPC_GET_ARG2(call); |
if (block_size > maxblock_size) { |
/* |
* Maximum block size exceeded. |
*/ |
retval = ELIMIT; |
break; |
} |
if (offset * block_size > rd_size - block_size) { |
/* |
* Writing past the end of the device. |
*/ |
retval = ELIMIT; |
break; |
} |
fibril_rwlock_write_lock(&rd_lock); |
memcpy(rd_addr + offset * block_size, fs_va, block_size); |
fibril_rwlock_write_unlock(&rd_lock); |
retval = EOK; |
break; |
default: |
/* |
* The client doesn't speak the same protocol. |
* Instead of closing the connection, we just ignore |
* the call. This can be useful if the client uses a |
* newer version of the protocol. |
*/ |
retval = EINVAL; |
break; |
} |
ipc_answer_0(callid, retval); |
} |
} |
/** Prepare the ramdisk image for operation. */ |
static bool rd_init(void) |
{ |
rd_size = sysinfo_value("rd.size"); |
void *rd_ph_addr = (void *) sysinfo_value("rd.address.physical"); |
if (rd_size == 0) { |
printf(NAME ": No RAM disk found\n"); |
return false; |
} |
rd_addr = as_get_mappable_page(rd_size); |
int flags = AS_AREA_READ | AS_AREA_WRITE | AS_AREA_CACHEABLE; |
int retval = physmem_map(rd_ph_addr, rd_addr, |
ALIGN_UP(rd_size, PAGE_SIZE) >> PAGE_WIDTH, flags); |
if (retval < 0) { |
printf(NAME ": Error mapping RAM disk\n"); |
return false; |
} |
printf(NAME ": Found RAM disk at %p, %d bytes\n", rd_ph_addr, rd_size); |
int rc = devmap_driver_register(NAME, rd_connection); |
if (rc < 0) { |
printf(NAME ": Unable to register driver (%d)\n", rc); |
return false; |
} |
dev_handle_t dev_handle; |
if (devmap_device_register("initrd", &dev_handle) != EOK) { |
devmap_hangup_phone(DEVMAP_DRIVER); |
printf(NAME ": Unable to register device\n"); |
return false; |
} |
fibril_rwlock_initialize(&rd_lock); |
return true; |
} |
int main(int argc, char **argv) |
{ |
printf(NAME ": HelenOS RAM disk server\n"); |
if (!rd_init()) |
return -1; |
printf(NAME ": Accepting connections\n"); |
async_manager(); |
/* Never reached */ |
return 0; |
} |
/** |
* @} |
*/ |
//branches/snapshot/uspace/srv/bd/rd/Makefile |
---|
0,0 → 1,76 |
# |
# Copyright (c) 2006 Martin Decky |
# All rights reserved. |
# |
# Redistribution and use in source and binary forms, with or without |
# modification, are permitted provided that the following conditions |
# are met: |
# |
# - Redistributions of source code must retain the above copyright |
# notice, this list of conditions and the following disclaimer. |
# - 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. |
# - The name of the author may not be used to endorse or promote products |
# derived from this software without specific prior written permission. |
# |
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
# |
## Setup toolchain |
# |
LIBC_PREFIX = ../../../lib/libc |
SOFTINT_PREFIX = ../../../lib/softint |
include $(LIBC_PREFIX)/Makefile.toolchain |
LIBS = $(LIBC_PREFIX)/libc.a |
## Sources |
# |
OUTPUT = rd |
SOURCES = \ |
rd.c |
OBJECTS := $(addsuffix .o,$(basename $(SOURCES))) |
.PHONY: all clean depend disasm |
all: $(OUTPUT) $(OUTPUT).disasm |
-include Makefile.depend |
clean: |
-rm -f $(OUTPUT) $(OUTPUT).map $(OUTPUT).disasm Makefile.depend $(OBJECTS) |
depend: |
$(CC) $(DEFS) $(CFLAGS) -M $(SOURCES) > Makefile.depend |
$(OUTPUT): $(OBJECTS) $(LIBS) |
$(LD) -T $(LIBC_PREFIX)/arch/$(UARCH)/_link.ld $(OBJECTS) $(LIBS) $(LFLAGS) -o $@ -Map $(OUTPUT).map |
disasm: $(OUTPUT).disasm |
$(OUTPUT).disasm: $(OUTPUT) |
$(OBJDUMP) -d $< > $@ |
%.o: %.S |
$(CC) $(DEFS) $(AFLAGS) $(CFLAGS) -D__ASM__ -c $< -o $@ |
%.o: %.s |
$(AS) $(AFLAGS) $< -o $@ |
%.o: %.c |
$(CC) $(DEFS) $(CFLAGS) -c $< -o $@ |
//branches/snapshot/uspace/srv/bd/file_bd/file_bd.c |
---|
0,0 → 1,213 |
/* |
* Copyright (c) 2009 Jiri Svoboda |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup bd |
* @{ |
*/ |
/** |
* @file |
* @brief File-backed block device driver |
* |
* Allows accessing a file as a block device. Useful for, e.g., mounting |
* a disk image. |
*/ |
#include <stdio.h> |
#include <unistd.h> |
#include <ipc/ipc.h> |
#include <ipc/bd.h> |
#include <async.h> |
#include <as.h> |
#include <fibril_sync.h> |
#include <devmap.h> |
#include <sys/types.h> |
#include <errno.h> |
#include <bool.h> |
#define NAME "file_bd" |
static size_t comm_size; |
static FILE *img; |
static dev_handle_t dev_handle; |
static fibril_mutex_t dev_lock; |
static int file_bd_init(const char *fname); |
static void file_bd_connection(ipc_callid_t iid, ipc_call_t *icall); |
static int file_bd_read(off_t blk_idx, size_t size, void *buf); |
static int file_bd_write(off_t blk_idx, size_t size, void *buf); |
int main(int argc, char **argv) |
{ |
int rc; |
printf(NAME ": File-backed block device driver\n"); |
if (argc != 3) { |
printf("Expected two arguments (image name, device name).\n"); |
return -1; |
} |
if (file_bd_init(argv[1]) != EOK) |
return -1; |
rc = devmap_device_register(argv[2], &dev_handle); |
if (rc != EOK) { |
devmap_hangup_phone(DEVMAP_DRIVER); |
printf(NAME ": Unable to register device %s.\n", |
argv[2]); |
return rc; |
} |
printf(NAME ": Accepting connections\n"); |
async_manager(); |
/* Not reached */ |
return 0; |
} |
static int file_bd_init(const char *fname) |
{ |
int rc; |
rc = devmap_driver_register(NAME, file_bd_connection); |
if (rc < 0) { |
printf(NAME ": Unable to register driver.\n"); |
return rc; |
} |
img = fopen(fname, "rb+"); |
if (img == NULL) |
return EINVAL; |
fibril_mutex_initialize(&dev_lock); |
return EOK; |
} |
static void file_bd_connection(ipc_callid_t iid, ipc_call_t *icall) |
{ |
void *fs_va = NULL; |
ipc_callid_t callid; |
ipc_call_t call; |
ipcarg_t method; |
int flags; |
int retval; |
off_t idx; |
size_t size; |
/* Answer the IPC_M_CONNECT_ME_TO call. */ |
ipc_answer_0(iid, EOK); |
if (!ipc_share_out_receive(&callid, &comm_size, &flags)) { |
ipc_answer_0(callid, EHANGUP); |
return; |
} |
fs_va = as_get_mappable_page(comm_size); |
if (fs_va == NULL) { |
ipc_answer_0(callid, EHANGUP); |
return; |
} |
(void) ipc_share_out_finalize(callid, fs_va); |
while (1) { |
callid = async_get_call(&call); |
method = IPC_GET_METHOD(call); |
switch (method) { |
case IPC_M_PHONE_HUNGUP: |
/* The other side has hung up. */ |
ipc_answer_0(callid, EOK); |
return; |
case BD_READ_BLOCK: |
case BD_WRITE_BLOCK: |
idx = IPC_GET_ARG1(call); |
size = IPC_GET_ARG2(call); |
if (size > comm_size) { |
retval = EINVAL; |
break; |
} |
if (method == BD_READ_BLOCK) |
retval = file_bd_read(idx, size, fs_va); |
else |
retval = file_bd_write(idx, size, fs_va); |
break; |
default: |
retval = EINVAL; |
break; |
} |
ipc_answer_0(callid, retval); |
} |
} |
static int file_bd_read(off_t blk_idx, size_t size, void *buf) |
{ |
size_t n_rd; |
fibril_mutex_lock(&dev_lock); |
fseek(img, blk_idx * size, SEEK_SET); |
n_rd = fread(buf, 1, size, img); |
if (ferror(img)) { |
fibril_mutex_unlock(&dev_lock); |
return EIO; /* Read error */ |
} |
fibril_mutex_unlock(&dev_lock); |
if (n_rd < size) |
return EINVAL; /* Read beyond end of disk */ |
return EOK; |
} |
static int file_bd_write(off_t blk_idx, size_t size, void *buf) |
{ |
size_t n_wr; |
fibril_mutex_lock(&dev_lock); |
fseek(img, blk_idx * size, SEEK_SET); |
n_wr = fread(buf, 1, size, img); |
if (ferror(img) || n_wr < size) { |
fibril_mutex_unlock(&dev_lock); |
return EIO; /* Write error */ |
} |
fibril_mutex_unlock(&dev_lock); |
return EOK; |
} |
/** |
* @} |
*/ |
//branches/snapshot/uspace/srv/bd/file_bd/Makefile |
---|
0,0 → 1,76 |
# |
# Copyright (c) 2006 Martin Decky |
# All rights reserved. |
# |
# Redistribution and use in source and binary forms, with or without |
# modification, are permitted provided that the following conditions |
# are met: |
# |
# - Redistributions of source code must retain the above copyright |
# notice, this list of conditions and the following disclaimer. |
# - 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. |
# - The name of the author may not be used to endorse or promote products |
# derived from this software without specific prior written permission. |
# |
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
# |
## Setup toolchain |
# |
LIBC_PREFIX = ../../../lib/libc |
SOFTINT_PREFIX = ../../../lib/softint |
include $(LIBC_PREFIX)/Makefile.toolchain |
LIBS = $(LIBC_PREFIX)/libc.a |
## Sources |
# |
OUTPUT = file_bd |
SOURCES = \ |
file_bd.c |
OBJECTS := $(addsuffix .o,$(basename $(SOURCES))) |
.PHONY: all clean depend disasm |
all: $(OUTPUT) $(OUTPUT).disasm |
-include Makefile.depend |
clean: |
-rm -f $(OUTPUT) $(OUTPUT).map $(OUTPUT).disasm Makefile.depend $(OBJECTS) |
depend: |
$(CC) $(DEFS) $(CFLAGS) -M $(SOURCES) > Makefile.depend |
$(OUTPUT): $(OBJECTS) $(LIBS) |
$(LD) -T $(LIBC_PREFIX)/arch/$(UARCH)/_link.ld $(OBJECTS) $(LIBS) $(LFLAGS) -o $@ -Map $(OUTPUT).map |
disasm: $(OUTPUT).disasm |
$(OUTPUT).disasm: $(OUTPUT) |
$(OBJDUMP) -d $< > $@ |
%.o: %.S |
$(CC) $(DEFS) $(AFLAGS) $(CFLAGS) -D__ASM__ -c $< -o $@ |
%.o: %.s |
$(AS) $(AFLAGS) $< -o $@ |
%.o: %.c |
$(CC) $(DEFS) $(CFLAGS) -c $< -o $@ |
//branches/snapshot/uspace/srv/bd/gxe_bd/gxe_bd.c |
---|
0,0 → 1,308 |
/* |
* Copyright (c) 2009 Jiri Svoboda |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup bd |
* @{ |
*/ |
/** |
* @file |
* @brief GXemul disk driver |
*/ |
#include <stdio.h> |
#include <libarch/ddi.h> |
#include <ddi.h> |
#include <ipc/ipc.h> |
#include <ipc/bd.h> |
#include <async.h> |
#include <as.h> |
#include <fibril_sync.h> |
#include <devmap.h> |
#include <sys/types.h> |
#include <errno.h> |
#define NAME "gxe_bd" |
enum { |
CTL_READ_START = 0, |
CTL_WRITE_START = 1, |
}; |
enum { |
STATUS_FAILURE = 0 |
}; |
enum { |
MAX_DISKS = 2 |
}; |
typedef struct { |
uint32_t offset_lo; |
uint32_t pad0; |
uint32_t offset_hi; |
uint32_t pad1; |
uint32_t disk_id; |
uint32_t pad2[3]; |
uint32_t control; |
uint32_t pad3[3]; |
uint32_t status; |
uint32_t pad4[3]; |
uint8_t pad5[0x3fc0]; |
uint8_t buffer[512]; |
} gxe_bd_t; |
static const size_t block_size = 512; |
static size_t comm_size; |
static uintptr_t dev_physical = 0x13000000; |
static gxe_bd_t *dev; |
static dev_handle_t dev_handle[MAX_DISKS]; |
static fibril_mutex_t dev_lock[MAX_DISKS]; |
static int gxe_bd_init(void); |
static void gxe_bd_connection(ipc_callid_t iid, ipc_call_t *icall); |
static int gx_bd_rdwr(int disk_id, ipcarg_t method, off_t offset, size_t size, |
void *buf); |
static int gxe_bd_read_block(int disk_id, uint64_t offset, size_t size, |
void *buf); |
static int gxe_bd_write_block(int disk_id, uint64_t offset, size_t size, |
const void *buf); |
int main(int argc, char **argv) |
{ |
printf(NAME ": GXemul disk driver\n"); |
if (gxe_bd_init() != EOK) |
return -1; |
printf(NAME ": Accepting connections\n"); |
async_manager(); |
/* Not reached */ |
return 0; |
} |
static int gxe_bd_init(void) |
{ |
void *vaddr; |
int rc, i; |
char name[16]; |
rc = devmap_driver_register(NAME, gxe_bd_connection); |
if (rc < 0) { |
printf(NAME ": Unable to register driver.\n"); |
return rc; |
} |
rc = pio_enable((void *) dev_physical, sizeof(gxe_bd_t), &vaddr); |
if (rc != EOK) { |
printf(NAME ": Could not initialize device I/O space.\n"); |
return rc; |
} |
dev = vaddr; |
for (i = 0; i < MAX_DISKS; i++) { |
snprintf(name, 16, "disk%d", i); |
rc = devmap_device_register(name, &dev_handle[i]); |
if (rc != EOK) { |
devmap_hangup_phone(DEVMAP_DRIVER); |
printf(NAME ": Unable to register device %s.\n", |
name); |
return rc; |
} |
fibril_mutex_initialize(&dev_lock[i]); |
} |
return EOK; |
} |
static void gxe_bd_connection(ipc_callid_t iid, ipc_call_t *icall) |
{ |
void *fs_va = NULL; |
ipc_callid_t callid; |
ipc_call_t call; |
ipcarg_t method; |
dev_handle_t dh; |
int flags; |
int retval; |
off_t idx; |
size_t size; |
int disk_id, i; |
/* Get the device handle. */ |
dh = IPC_GET_ARG1(*icall); |
/* Determine which disk device is the client connecting to. */ |
disk_id = -1; |
for (i = 0; i < MAX_DISKS; i++) |
if (dev_handle[i] == dh) |
disk_id = i; |
if (disk_id < 0) { |
ipc_answer_0(iid, EINVAL); |
return; |
} |
/* Answer the IPC_M_CONNECT_ME_TO call. */ |
ipc_answer_0(iid, EOK); |
if (!ipc_share_out_receive(&callid, &comm_size, &flags)) { |
ipc_answer_0(callid, EHANGUP); |
return; |
} |
fs_va = as_get_mappable_page(comm_size); |
if (fs_va == NULL) { |
ipc_answer_0(callid, EHANGUP); |
return; |
} |
(void) ipc_share_out_finalize(callid, fs_va); |
while (1) { |
callid = async_get_call(&call); |
method = IPC_GET_METHOD(call); |
switch (method) { |
case IPC_M_PHONE_HUNGUP: |
/* The other side has hung up. */ |
ipc_answer_0(callid, EOK); |
return; |
case BD_READ_BLOCK: |
case BD_WRITE_BLOCK: |
idx = IPC_GET_ARG1(call); |
size = IPC_GET_ARG2(call); |
if (size > comm_size) { |
retval = EINVAL; |
break; |
} |
retval = gx_bd_rdwr(disk_id, method, idx * size, |
size, fs_va); |
break; |
default: |
retval = EINVAL; |
break; |
} |
ipc_answer_0(callid, retval); |
} |
} |
static int gx_bd_rdwr(int disk_id, ipcarg_t method, off_t offset, size_t size, |
void *buf) |
{ |
int rc; |
size_t now; |
while (size > 0) { |
now = size < block_size ? size : block_size; |
if (method == BD_READ_BLOCK) |
rc = gxe_bd_read_block(disk_id, offset, now, buf); |
else |
rc = gxe_bd_write_block(disk_id, offset, now, buf); |
if (rc != EOK) |
return rc; |
buf += block_size; |
offset += block_size; |
if (size > block_size) |
size -= block_size; |
else |
size = 0; |
} |
return EOK; |
} |
static int gxe_bd_read_block(int disk_id, uint64_t offset, size_t size, |
void *buf) |
{ |
uint32_t status; |
size_t i; |
uint32_t w; |
fibril_mutex_lock(&dev_lock[disk_id]); |
pio_write_32(&dev->offset_lo, (uint32_t) offset); |
pio_write_32(&dev->offset_hi, offset >> 32); |
pio_write_32(&dev->disk_id, disk_id); |
pio_write_32(&dev->control, CTL_READ_START); |
status = pio_read_32(&dev->status); |
if (status == STATUS_FAILURE) { |
fibril_mutex_unlock(&dev_lock[disk_id]); |
return EIO; |
} |
for (i = 0; i < size; i++) { |
((uint8_t *) buf)[i] = w = pio_read_8(&dev->buffer[i]); |
} |
fibril_mutex_unlock(&dev_lock[disk_id]); |
return EOK; |
} |
static int gxe_bd_write_block(int disk_id, uint64_t offset, size_t size, |
const void *buf) |
{ |
uint32_t status; |
size_t i; |
for (i = 0; i < size; i++) { |
pio_write_8(&dev->buffer[i], ((const uint8_t *) buf)[i]); |
} |
fibril_mutex_lock(&dev_lock[disk_id]); |
pio_write_32(&dev->offset_lo, (uint32_t) offset); |
pio_write_32(&dev->offset_hi, offset >> 32); |
pio_write_32(&dev->disk_id, disk_id); |
pio_write_32(&dev->control, CTL_WRITE_START); |
status = pio_read_32(&dev->status); |
if (status == STATUS_FAILURE) { |
fibril_mutex_unlock(&dev_lock[disk_id]); |
return EIO; |
} |
fibril_mutex_unlock(&dev_lock[disk_id]); |
return EOK; |
} |
/** |
* @} |
*/ |
//branches/snapshot/uspace/srv/bd/gxe_bd/Makefile |
---|
0,0 → 1,76 |
# |
# Copyright (c) 2006 Martin Decky |
# All rights reserved. |
# |
# Redistribution and use in source and binary forms, with or without |
# modification, are permitted provided that the following conditions |
# are met: |
# |
# - Redistributions of source code must retain the above copyright |
# notice, this list of conditions and the following disclaimer. |
# - 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. |
# - The name of the author may not be used to endorse or promote products |
# derived from this software without specific prior written permission. |
# |
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
# |
## Setup toolchain |
# |
LIBC_PREFIX = ../../../lib/libc |
SOFTINT_PREFIX = ../../../lib/softint |
include $(LIBC_PREFIX)/Makefile.toolchain |
LIBS = $(LIBC_PREFIX)/libc.a |
## Sources |
# |
OUTPUT = gxe_bd |
SOURCES = \ |
gxe_bd.c |
OBJECTS := $(addsuffix .o,$(basename $(SOURCES))) |
.PHONY: all clean depend disasm |
all: $(OUTPUT) $(OUTPUT).disasm |
-include Makefile.depend |
clean: |
-rm -f $(OUTPUT) $(OUTPUT).map $(OUTPUT).disasm Makefile.depend $(OBJECTS) |
depend: |
$(CC) $(DEFS) $(CFLAGS) -M $(SOURCES) > Makefile.depend |
$(OUTPUT): $(OBJECTS) $(LIBS) |
$(LD) -T $(LIBC_PREFIX)/arch/$(UARCH)/_link.ld $(OBJECTS) $(LIBS) $(LFLAGS) -o $@ -Map $(OUTPUT).map |
disasm: $(OUTPUT).disasm |
$(OUTPUT).disasm: $(OUTPUT) |
$(OBJDUMP) -d $< > $@ |
%.o: %.S |
$(CC) $(DEFS) $(AFLAGS) $(CFLAGS) -D__ASM__ -c $< -o $@ |
%.o: %.s |
$(AS) $(AFLAGS) $< -o $@ |
%.o: %.c |
$(CC) $(DEFS) $(CFLAGS) -c $< -o $@ |
//branches/snapshot/uspace/srv/bd/ata_bd/ata_bd.h |
---|
0,0 → 1,151 |
/* |
* Copyright (c) 2009 Jiri Svoboda |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup bd |
* @{ |
*/ |
/** @file |
*/ |
#ifndef __ATA_BD_H__ |
#define __ATA_BD_H__ |
#include <sys/types.h> |
#include <fibril_sync.h> |
enum { |
CTL_READ_START = 0, |
CTL_WRITE_START = 1, |
}; |
enum { |
STATUS_FAILURE = 0 |
}; |
enum { |
MAX_DISKS = 2 |
}; |
/** ATA Command Register Block. */ |
typedef union { |
/* Read/Write */ |
struct { |
uint16_t data_port; |
uint8_t sector_count; |
uint8_t sector_number; |
uint8_t cylinder_low; |
uint8_t cylinder_high; |
uint8_t drive_head; |
uint8_t pad_rw0; |
}; |
/* Read Only */ |
struct { |
uint8_t pad_ro0; |
uint8_t error; |
uint8_t pad_ro1[5]; |
uint8_t status; |
}; |
/* Write Only */ |
struct { |
uint8_t pad_wo0; |
uint8_t features; |
uint8_t pad_wo1[5]; |
uint8_t command; |
}; |
} ata_cmd_t; |
typedef union { |
/* Read */ |
struct { |
uint8_t pad0[6]; |
uint8_t alt_status; |
uint8_t drive_address; |
}; |
/* Write */ |
struct { |
uint8_t pad1[6]; |
uint8_t device_control; |
uint8_t pad2; |
}; |
} ata_ctl_t; |
enum devctl_bits { |
DCR_SRST = 0x04, /**< Software Reset */ |
DCR_nIEN = 0x02 /**< Interrupt Enable (negated) */ |
}; |
enum status_bits { |
SR_BSY = 0x80, /**< Busy */ |
SR_DRDY = 0x40, /**< Drive Ready */ |
SR_DWF = 0x20, /**< Drive Write Fault */ |
SR_DSC = 0x10, /**< Drive Seek Complete */ |
SR_DRQ = 0x08, /**< Data Request */ |
SR_CORR = 0x04, /**< Corrected Data */ |
SR_IDX = 0x02, /**< Index */ |
SR_ERR = 0x01 /**< Error */ |
}; |
enum drive_head_bits { |
DHR_DRV = 0x10 |
}; |
enum error_bits { |
ER_BBK = 0x80, /**< Bad Block Detected */ |
ER_UNC = 0x40, /**< Uncorrectable Data Error */ |
ER_MC = 0x20, /**< Media Changed */ |
ER_IDNF = 0x10, /**< ID Not Found */ |
ER_MCR = 0x08, /**< Media Change Request */ |
ER_ABRT = 0x04, /**< Aborted Command */ |
ER_TK0NF = 0x02, /**< Track 0 Not Found */ |
ER_AMNF = 0x01 /**< Address Mark Not Found */ |
}; |
enum ata_command { |
CMD_IDENTIFY_DRIVE = 0xEC, |
CMD_READ_SECTORS = 0x20, |
CMD_WRITE_SECTORS = 0x30 |
}; |
typedef struct { |
bool present; |
unsigned heads; |
unsigned cylinders; |
unsigned sectors; |
uint64_t blocks; |
fibril_mutex_t lock; |
dev_handle_t dev_handle; |
} disk_t; |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/srv/bd/ata_bd/ata_bd.c |
---|
0,0 → 1,438 |
/* |
* Copyright (c) 2009 Jiri Svoboda |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup bd |
* @{ |
*/ |
/** |
* @file |
* @brief ATA disk driver |
* |
* This driver currently works only with CHS addressing and uses PIO. |
* Currently based on the (now obsolete) ANSI X3.221-1994 (ATA-1) standard. |
* At this point only reading is possible, not writing. |
* |
* The driver services a single controller which can have up to two disks |
* attached. |
*/ |
#include <stdio.h> |
#include <libarch/ddi.h> |
#include <ddi.h> |
#include <ipc/ipc.h> |
#include <ipc/bd.h> |
#include <async.h> |
#include <as.h> |
#include <fibril_sync.h> |
#include <devmap.h> |
#include <sys/types.h> |
#include <errno.h> |
#include <bool.h> |
#include "ata_bd.h" |
#define NAME "ata_bd" |
static const size_t block_size = 512; |
static size_t comm_size; |
static uintptr_t cmd_physical = 0x1f0; |
static uintptr_t ctl_physical = 0x170; |
static ata_cmd_t *cmd; |
static ata_ctl_t *ctl; |
/** Per-disk state. */ |
static disk_t disk[MAX_DISKS]; |
static int ata_bd_init(void); |
static void ata_bd_connection(ipc_callid_t iid, ipc_call_t *icall); |
static int ata_bd_rdwr(int disk_id, ipcarg_t method, off_t offset, size_t size, |
void *buf); |
static int ata_bd_read_block(int disk_id, uint64_t blk_idx, size_t blk_cnt, |
void *buf); |
static int ata_bd_write_block(int disk_id, uint64_t blk_idx, size_t blk_cnt, |
const void *buf); |
static int drive_identify(int drive_id, disk_t *d); |
int main(int argc, char **argv) |
{ |
uint8_t status; |
char name[16]; |
int i, rc; |
int n_disks; |
printf(NAME ": ATA disk driver\n"); |
printf("I/O address 0x%x\n", cmd_physical); |
if (ata_bd_init() != EOK) |
return -1; |
/* Put drives to reset, disable interrupts. */ |
printf("Reset drives...\n"); |
pio_write_8(&ctl->device_control, DCR_SRST); |
/* FIXME: Find out how to do this properly. */ |
async_usleep(100); |
pio_write_8(&ctl->device_control, 0); |
do { |
status = pio_read_8(&cmd->status); |
} while ((status & SR_BSY) != 0); |
printf("Done\n"); |
printf("Status = 0x%x\n", pio_read_8(&cmd->status)); |
(void) drive_identify(0, &disk[0]); |
(void) drive_identify(1, &disk[1]); |
n_disks = 0; |
for (i = 0; i < MAX_DISKS; i++) { |
/* Skip unattached drives. */ |
if (disk[i].present == false) |
continue; |
snprintf(name, 16, "disk%d", i); |
rc = devmap_device_register(name, &disk[i].dev_handle); |
if (rc != EOK) { |
devmap_hangup_phone(DEVMAP_DRIVER); |
printf(NAME ": Unable to register device %s.\n", |
name); |
return rc; |
} |
++n_disks; |
} |
if (n_disks == 0) { |
printf("No disks detected.\n"); |
return -1; |
} |
printf(NAME ": Accepting connections\n"); |
async_manager(); |
/* Not reached */ |
return 0; |
} |
static int drive_identify(int disk_id, disk_t *d) |
{ |
uint16_t data; |
uint8_t status; |
size_t i; |
printf("Identify drive %d\n", disk_id); |
pio_write_8(&cmd->drive_head, ((disk_id != 0) ? DHR_DRV : 0)); |
async_usleep(100); |
pio_write_8(&cmd->command, CMD_IDENTIFY_DRIVE); |
status = pio_read_8(&cmd->status); |
printf("Status = 0x%x\n", status); |
d->present = false; |
/* |
* Detect if drive is present. This is Qemu only! Need to |
* do the right thing to work with real drives. |
*/ |
if ((status & SR_DRDY) == 0) { |
printf("None attached.\n"); |
return ENOENT; |
} |
for (i = 0; i < block_size / 2; i++) { |
do { |
status = pio_read_8(&cmd->status); |
} while ((status & SR_DRDY) == 0); |
data = pio_read_16(&cmd->data_port); |
switch (i) { |
case 1: d->cylinders = data; break; |
case 3: d->heads = data; break; |
case 6: d->sectors = data; break; |
} |
} |
d->blocks = d->cylinders * d->heads * d->sectors; |
printf("Geometry: %u cylinders, %u heads, %u sectors\n", |
d->cylinders, d->heads, d->sectors); |
d->present = true; |
fibril_mutex_initialize(&d->lock); |
return EOK; |
} |
static int ata_bd_init(void) |
{ |
void *vaddr; |
int rc; |
rc = devmap_driver_register(NAME, ata_bd_connection); |
if (rc < 0) { |
printf(NAME ": Unable to register driver.\n"); |
return rc; |
} |
rc = pio_enable((void *) cmd_physical, sizeof(ata_cmd_t), &vaddr); |
if (rc != EOK) { |
printf(NAME ": Could not initialize device I/O space.\n"); |
return rc; |
} |
cmd = vaddr; |
rc = pio_enable((void *) ctl_physical, sizeof(ata_ctl_t), &vaddr); |
if (rc != EOK) { |
printf(NAME ": Could not initialize device I/O space.\n"); |
return rc; |
} |
ctl = vaddr; |
return EOK; |
} |
static void ata_bd_connection(ipc_callid_t iid, ipc_call_t *icall) |
{ |
void *fs_va = NULL; |
ipc_callid_t callid; |
ipc_call_t call; |
ipcarg_t method; |
dev_handle_t dh; |
int flags; |
int retval; |
off_t idx; |
size_t size; |
int disk_id, i; |
/* Get the device handle. */ |
dh = IPC_GET_ARG1(*icall); |
/* Determine which disk device is the client connecting to. */ |
disk_id = -1; |
for (i = 0; i < MAX_DISKS; i++) |
if (disk[i].dev_handle == dh) |
disk_id = i; |
if (disk_id < 0 || disk[disk_id].present == false) { |
ipc_answer_0(iid, EINVAL); |
return; |
} |
/* Answer the IPC_M_CONNECT_ME_TO call. */ |
ipc_answer_0(iid, EOK); |
if (!ipc_share_out_receive(&callid, &comm_size, &flags)) { |
ipc_answer_0(callid, EHANGUP); |
return; |
} |
fs_va = as_get_mappable_page(comm_size); |
if (fs_va == NULL) { |
ipc_answer_0(callid, EHANGUP); |
return; |
} |
(void) ipc_share_out_finalize(callid, fs_va); |
while (1) { |
callid = async_get_call(&call); |
method = IPC_GET_METHOD(call); |
switch (method) { |
case IPC_M_PHONE_HUNGUP: |
/* The other side has hung up. */ |
ipc_answer_0(callid, EOK); |
return; |
case BD_READ_BLOCK: |
case BD_WRITE_BLOCK: |
idx = IPC_GET_ARG1(call); |
size = IPC_GET_ARG2(call); |
if (size > comm_size) { |
retval = EINVAL; |
break; |
} |
retval = ata_bd_rdwr(disk_id, method, idx, |
size, fs_va); |
break; |
default: |
retval = EINVAL; |
break; |
} |
ipc_answer_0(callid, retval); |
} |
} |
static int ata_bd_rdwr(int disk_id, ipcarg_t method, off_t blk_idx, size_t size, |
void *buf) |
{ |
int rc; |
size_t now; |
while (size > 0) { |
now = size < block_size ? size : block_size; |
if (now != block_size) |
return EINVAL; |
if (method == BD_READ_BLOCK) |
rc = ata_bd_read_block(disk_id, blk_idx, 1, buf); |
else |
rc = ata_bd_write_block(disk_id, blk_idx, 1, buf); |
if (rc != EOK) |
return rc; |
buf += block_size; |
blk_idx++; |
if (size > block_size) |
size -= block_size; |
else |
size = 0; |
} |
return EOK; |
} |
static int ata_bd_read_block(int disk_id, uint64_t blk_idx, size_t blk_cnt, |
void *buf) |
{ |
size_t i; |
uint16_t data; |
uint8_t status; |
uint64_t c, h, s; |
uint64_t idx; |
uint8_t drv_head; |
disk_t *d; |
d = &disk[disk_id]; |
/* Check device bounds. */ |
if (blk_idx >= d->blocks) |
return EINVAL; |
/* Compute CHS. */ |
c = blk_idx / (d->heads * d->sectors); |
idx = blk_idx % (d->heads * d->sectors); |
h = idx / d->sectors; |
s = 1 + (idx % d->sectors); |
/* New value for Drive/Head register */ |
drv_head = |
((disk_id != 0) ? DHR_DRV : 0) | |
(h & 0x0f); |
fibril_mutex_lock(&d->lock); |
/* Program a Read Sectors operation. */ |
pio_write_8(&cmd->drive_head, drv_head); |
pio_write_8(&cmd->sector_count, 1); |
pio_write_8(&cmd->sector_number, s); |
pio_write_8(&cmd->cylinder_low, c & 0xff); |
pio_write_8(&cmd->cylinder_high, c >> 16); |
pio_write_8(&cmd->command, CMD_READ_SECTORS); |
/* Read data from the disk buffer. */ |
for (i = 0; i < block_size / 2; i++) { |
do { |
status = pio_read_8(&cmd->status); |
} while ((status & SR_DRDY) == 0); |
data = pio_read_16(&cmd->data_port); |
((uint16_t *) buf)[i] = data; |
} |
fibril_mutex_unlock(&d->lock); |
return EOK; |
} |
static int ata_bd_write_block(int disk_id, uint64_t blk_idx, size_t blk_cnt, |
const void *buf) |
{ |
size_t i; |
uint8_t status; |
uint64_t c, h, s; |
uint64_t idx; |
uint8_t drv_head; |
disk_t *d; |
d = &disk[disk_id]; |
/* Check device bounds. */ |
if (blk_idx >= d->blocks) |
return EINVAL; |
/* Compute CHS. */ |
c = blk_idx / (d->heads * d->sectors); |
idx = blk_idx % (d->heads * d->sectors); |
h = idx / d->sectors; |
s = 1 + (idx % d->sectors); |
/* New value for Drive/Head register */ |
drv_head = |
((disk_id != 0) ? DHR_DRV : 0) | |
(h & 0x0f); |
fibril_mutex_lock(&d->lock); |
/* Program a Read Sectors operation. */ |
pio_write_8(&cmd->drive_head, drv_head); |
pio_write_8(&cmd->sector_count, 1); |
pio_write_8(&cmd->sector_number, s); |
pio_write_8(&cmd->cylinder_low, c & 0xff); |
pio_write_8(&cmd->cylinder_high, c >> 16); |
pio_write_8(&cmd->command, CMD_WRITE_SECTORS); |
/* Write data to the disk buffer. */ |
for (i = 0; i < block_size / 2; i++) { |
do { |
status = pio_read_8(&cmd->status); |
} while ((status & SR_DRDY) == 0); |
pio_write_16(&cmd->data_port, ((uint16_t *) buf)[i]); |
} |
fibril_mutex_unlock(&d->lock); |
return EOK; |
} |
/** |
* @} |
*/ |
//branches/snapshot/uspace/srv/bd/ata_bd/Makefile |
---|
0,0 → 1,76 |
# |
# Copyright (c) 2006 Martin Decky |
# All rights reserved. |
# |
# Redistribution and use in source and binary forms, with or without |
# modification, are permitted provided that the following conditions |
# are met: |
# |
# - Redistributions of source code must retain the above copyright |
# notice, this list of conditions and the following disclaimer. |
# - 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. |
# - The name of the author may not be used to endorse or promote products |
# derived from this software without specific prior written permission. |
# |
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
# |
## Setup toolchain |
# |
LIBC_PREFIX = ../../../lib/libc |
SOFTINT_PREFIX = ../../../lib/softint |
include $(LIBC_PREFIX)/Makefile.toolchain |
LIBS = $(LIBC_PREFIX)/libc.a |
## Sources |
# |
OUTPUT = ata_bd |
SOURCES = \ |
ata_bd.c |
OBJECTS := $(addsuffix .o,$(basename $(SOURCES))) |
.PHONY: all clean depend disasm |
all: $(OUTPUT) $(OUTPUT).disasm |
-include Makefile.depend |
clean: |
-rm -f $(OUTPUT) $(OUTPUT).map $(OUTPUT).disasm Makefile.depend $(OBJECTS) |
depend: |
$(CC) $(DEFS) $(CFLAGS) -M $(SOURCES) > Makefile.depend |
$(OUTPUT): $(OBJECTS) $(LIBS) |
$(LD) -T $(LIBC_PREFIX)/arch/$(UARCH)/_link.ld $(OBJECTS) $(LIBS) $(LFLAGS) -o $@ -Map $(OUTPUT).map |
disasm: $(OUTPUT).disasm |
$(OUTPUT).disasm: $(OUTPUT) |
$(OBJDUMP) -d $< > $@ |
%.o: %.S |
$(CC) $(DEFS) $(AFLAGS) $(CFLAGS) -D__ASM__ -c $< -o $@ |
%.o: %.s |
$(AS) $(AFLAGS) $< -o $@ |
%.o: %.c |
$(CC) $(DEFS) $(CFLAGS) -c $< -o $@ |
//branches/snapshot/uspace/srv/loader/main.c |
---|
0,0 → 1,457 |
/* |
* Copyright (c) 2008 Jiri Svoboda |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup loader |
* @brief Loads and runs programs from VFS. |
* @{ |
*/ |
/** |
* @file |
* @brief Loads and runs programs from VFS. |
* |
* The program loader is a special init binary. Its image is used |
* to create a new task upon a @c task_spawn syscall. The syscall |
* returns the id of a phone connected to the newly created task. |
* |
* The caller uses this phone to send the pathname and various other |
* information to the loader. This is normally done by the C library |
* and completely hidden from applications. |
*/ |
#include <stdio.h> |
#include <stdlib.h> |
#include <unistd.h> |
#include <bool.h> |
#include <fcntl.h> |
#include <sys/types.h> |
#include <ipc/ipc.h> |
#include <ipc/services.h> |
#include <ipc/loader.h> |
#include <loader/pcb.h> |
#include <errno.h> |
#include <async.h> |
#include <string.h> |
#include <as.h> |
#include <elf.h> |
#include <elf_load.h> |
#define DPRINTF(...) |
/** Pathname of the file that will be loaded */ |
static char *pathname = NULL; |
/** The Program control block */ |
static pcb_t pcb; |
/** Number of arguments */ |
static int argc = 0; |
/** Argument vector */ |
static char **argv = NULL; |
/** Buffer holding all arguments */ |
static char *arg_buf = NULL; |
/** Number of preset files */ |
static int filc = 0; |
/** Preset files vector */ |
static fdi_node_t **filv = NULL; |
/** Buffer holding all preset files */ |
static fdi_node_t *fil_buf = NULL; |
static elf_info_t prog_info; |
static elf_info_t interp_info; |
static bool is_dyn_linked; |
/** Used to limit number of connections to one. */ |
static bool connected; |
static void ldr_get_taskid(ipc_callid_t rid, ipc_call_t *request) |
{ |
ipc_callid_t callid; |
task_id_t task_id; |
size_t len; |
task_id = task_get_id(); |
if (!ipc_data_read_receive(&callid, &len)) { |
ipc_answer_0(callid, EINVAL); |
ipc_answer_0(rid, EINVAL); |
return; |
} |
if (len > sizeof(task_id)) |
len = sizeof(task_id); |
ipc_data_read_finalize(callid, &task_id, len); |
ipc_answer_0(rid, EOK); |
} |
/** Receive a call setting pathname of the program to execute. |
* |
* @param rid |
* @param request |
*/ |
static void ldr_set_pathname(ipc_callid_t rid, ipc_call_t *request) |
{ |
ipc_callid_t callid; |
size_t len; |
char *name_buf; |
if (!ipc_data_write_receive(&callid, &len)) { |
ipc_answer_0(callid, EINVAL); |
ipc_answer_0(rid, EINVAL); |
return; |
} |
name_buf = malloc(len + 1); |
if (!name_buf) { |
ipc_answer_0(callid, ENOMEM); |
ipc_answer_0(rid, ENOMEM); |
return; |
} |
ipc_data_write_finalize(callid, name_buf, len); |
ipc_answer_0(rid, EOK); |
if (pathname != NULL) { |
free(pathname); |
pathname = NULL; |
} |
name_buf[len] = '\0'; |
pathname = name_buf; |
} |
/** Receive a call setting arguments of the program to execute. |
* |
* @param rid |
* @param request |
*/ |
static void ldr_set_args(ipc_callid_t rid, ipc_call_t *request) |
{ |
ipc_callid_t callid; |
size_t buf_size, arg_size; |
char *p; |
int n; |
if (!ipc_data_write_receive(&callid, &buf_size)) { |
ipc_answer_0(callid, EINVAL); |
ipc_answer_0(rid, EINVAL); |
return; |
} |
if (arg_buf != NULL) { |
free(arg_buf); |
arg_buf = NULL; |
} |
if (argv != NULL) { |
free(argv); |
argv = NULL; |
} |
arg_buf = malloc(buf_size + 1); |
if (!arg_buf) { |
ipc_answer_0(callid, ENOMEM); |
ipc_answer_0(rid, ENOMEM); |
return; |
} |
ipc_data_write_finalize(callid, arg_buf, buf_size); |
arg_buf[buf_size] = '\0'; |
/* |
* Count number of arguments |
*/ |
p = arg_buf; |
n = 0; |
while (p < arg_buf + buf_size) { |
arg_size = str_size(p); |
p = p + arg_size + 1; |
++n; |
} |
/* Allocate argv */ |
argv = malloc((n + 1) * sizeof(char *)); |
if (argv == NULL) { |
free(arg_buf); |
ipc_answer_0(rid, ENOMEM); |
return; |
} |
/* |
* Fill argv with argument pointers |
*/ |
p = arg_buf; |
n = 0; |
while (p < arg_buf + buf_size) { |
argv[n] = p; |
arg_size = str_size(p); |
p = p + arg_size + 1; |
++n; |
} |
argc = n; |
argv[n] = NULL; |
ipc_answer_0(rid, EOK); |
} |
/** Receive a call setting preset files of the program to execute. |
* |
* @param rid |
* @param request |
*/ |
static void ldr_set_files(ipc_callid_t rid, ipc_call_t *request) |
{ |
ipc_callid_t callid; |
size_t buf_size; |
if (!ipc_data_write_receive(&callid, &buf_size)) { |
ipc_answer_0(callid, EINVAL); |
ipc_answer_0(rid, EINVAL); |
return; |
} |
if ((buf_size % sizeof(fdi_node_t)) != 0) { |
ipc_answer_0(callid, EINVAL); |
ipc_answer_0(rid, EINVAL); |
return; |
} |
if (fil_buf != NULL) { |
free(fil_buf); |
fil_buf = NULL; |
} |
if (filv != NULL) { |
free(filv); |
filv = NULL; |
} |
fil_buf = malloc(buf_size); |
if (!fil_buf) { |
ipc_answer_0(callid, ENOMEM); |
ipc_answer_0(rid, ENOMEM); |
return; |
} |
ipc_data_write_finalize(callid, fil_buf, buf_size); |
int count = buf_size / sizeof(fdi_node_t); |
/* Allocate filvv */ |
filv = malloc((count + 1) * sizeof(fdi_node_t *)); |
if (filv == NULL) { |
free(fil_buf); |
ipc_answer_0(rid, ENOMEM); |
return; |
} |
/* |
* Fill filv with argument pointers |
*/ |
int i; |
for (i = 0; i < count; i++) |
filv[i] = &fil_buf[i]; |
filc = count; |
filv[count] = NULL; |
ipc_answer_0(rid, EOK); |
} |
/** Load the previously selected program. |
* |
* @param rid |
* @param request |
* @return 0 on success, !0 on error. |
*/ |
static int ldr_load(ipc_callid_t rid, ipc_call_t *request) |
{ |
int rc; |
rc = elf_load_file(pathname, 0, &prog_info); |
if (rc != EE_OK) { |
DPRINTF("Failed to load executable '%s'.\n", pathname); |
ipc_answer_0(rid, EINVAL); |
return 1; |
} |
elf_create_pcb(&prog_info, &pcb); |
pcb.argc = argc; |
pcb.argv = argv; |
pcb.filc = filc; |
pcb.filv = filv; |
if (prog_info.interp == NULL) { |
/* Statically linked program */ |
is_dyn_linked = false; |
ipc_answer_0(rid, EOK); |
return 0; |
} |
rc = elf_load_file(prog_info.interp, 0, &interp_info); |
if (rc != EE_OK) { |
DPRINTF("Failed to load interpreter '%s.'\n", |
prog_info.interp); |
ipc_answer_0(rid, EINVAL); |
return 1; |
} |
is_dyn_linked = true; |
ipc_answer_0(rid, EOK); |
return 0; |
} |
/** Run the previously loaded program. |
* |
* @param rid |
* @param request |
* @return 0 on success, !0 on error. |
*/ |
static void ldr_run(ipc_callid_t rid, ipc_call_t *request) |
{ |
const char *cp; |
/* Set the task name. */ |
cp = str_rchr(pathname, '/'); |
cp = (cp == NULL) ? pathname : (cp + 1); |
task_set_name(cp); |
if (is_dyn_linked == true) { |
/* Dynamically linked program */ |
DPRINTF("Run ELF interpreter.\n"); |
DPRINTF("Entry point: 0x%lx\n", interp_info.entry); |
ipc_answer_0(rid, EOK); |
elf_run(&interp_info, &pcb); |
} else { |
/* Statically linked program */ |
ipc_answer_0(rid, EOK); |
elf_run(&prog_info, &pcb); |
} |
/* Not reached */ |
} |
/** Handle loader connection. |
* |
* Receive and carry out commands (of which the last one should be |
* to execute the loaded program). |
*/ |
static void ldr_connection(ipc_callid_t iid, ipc_call_t *icall) |
{ |
ipc_callid_t callid; |
ipc_call_t call; |
int retval; |
/* Already have a connection? */ |
if (connected) { |
ipc_answer_0(iid, ELIMIT); |
return; |
} |
connected = true; |
/* Accept the connection */ |
ipc_answer_0(iid, EOK); |
/* Ignore parameters, the connection is already open */ |
(void) iid; |
(void) icall; |
while (1) { |
callid = async_get_call(&call); |
switch (IPC_GET_METHOD(call)) { |
case IPC_M_PHONE_HUNGUP: |
exit(0); |
case LOADER_GET_TASKID: |
ldr_get_taskid(callid, &call); |
continue; |
case LOADER_SET_PATHNAME: |
ldr_set_pathname(callid, &call); |
continue; |
case LOADER_SET_ARGS: |
ldr_set_args(callid, &call); |
continue; |
case LOADER_SET_FILES: |
ldr_set_files(callid, &call); |
continue; |
case LOADER_LOAD: |
ldr_load(callid, &call); |
continue; |
case LOADER_RUN: |
ldr_run(callid, &call); |
/* Not reached */ |
default: |
retval = ENOENT; |
break; |
} |
if ((callid & IPC_CALLID_NOTIFICATION) == 0 && |
IPC_GET_METHOD(call) != IPC_M_PHONE_HUNGUP) { |
DPRINTF("Responding EINVAL to method %d.\n", |
IPC_GET_METHOD(call)); |
ipc_answer_0(callid, EINVAL); |
} |
} |
} |
/** Program loader main function. |
*/ |
int main(int argc, char *argv[]) |
{ |
ipcarg_t phonead; |
connected = false; |
/* Set a handler of incomming connections. */ |
async_set_client_connection(ldr_connection); |
/* Register at naming service. */ |
if (ipc_connect_to_me(PHONE_NS, SERVICE_LOAD, 0, 0, &phonead) != 0) |
return -1; |
async_manager(); |
/* Never reached */ |
return 0; |
} |
/** @} |
*/ |
//branches/snapshot/uspace/srv/loader/elf_load.c |
---|
0,0 → 1,474 |
/* |
* Copyright (c) 2006 Sergey Bondari |
* Copyright (c) 2006 Jakub Jermar |
* Copyright (c) 2008 Jiri Svoboda |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup generic |
* @{ |
*/ |
/** |
* @file |
* @brief Userspace ELF loader. |
* |
* This module allows loading ELF binaries (both executables and |
* shared objects) from VFS. The current implementation allocates |
* anonymous memory, fills it with segment data and then adjusts |
* the memory areas' flags to the final value. In the future, |
* the segments will be mapped directly from the file. |
*/ |
#include <stdio.h> |
#include <sys/types.h> |
#include <align.h> |
#include <assert.h> |
#include <as.h> |
#include <unistd.h> |
#include <fcntl.h> |
#include <smc.h> |
#include <loader/pcb.h> |
#include "elf.h" |
#include "elf_load.h" |
#include "arch.h" |
#define DPRINTF(...) |
static char *error_codes[] = { |
"no error", |
"invalid image", |
"address space error", |
"incompatible image", |
"unsupported image type", |
"irrecoverable error" |
}; |
static unsigned int elf_load(elf_ld_t *elf, size_t so_bias); |
static int segment_header(elf_ld_t *elf, elf_segment_header_t *entry); |
static int section_header(elf_ld_t *elf, elf_section_header_t *entry); |
static int load_segment(elf_ld_t *elf, elf_segment_header_t *entry); |
/** Read until the buffer is read in its entirety. */ |
static int my_read(int fd, void *buf, size_t len) |
{ |
int cnt = 0; |
do { |
buf += cnt; |
len -= cnt; |
cnt = read(fd, buf, len); |
} while ((cnt > 0) && ((len - cnt) > 0)); |
return cnt; |
} |
/** Load ELF binary from a file. |
* |
* Load an ELF binary from the specified file. If the file is |
* an executable program, it is loaded unbiased. If it is a shared |
* object, it is loaded with the bias @a so_bias. Some information |
* extracted from the binary is stored in a elf_info_t structure |
* pointed to by @a info. |
* |
* @param file_name Path to the ELF file. |
* @param so_bias Bias to use if the file is a shared object. |
* @param info Pointer to a structure for storing information |
* extracted from the binary. |
* |
* @return EOK on success or negative error code. |
*/ |
int elf_load_file(char *file_name, size_t so_bias, elf_info_t *info) |
{ |
elf_ld_t elf; |
int fd; |
int rc; |
fd = open(file_name, O_RDONLY); |
if (fd < 0) { |
DPRINTF("failed opening file\n"); |
return -1; |
} |
elf.fd = fd; |
elf.info = info; |
rc = elf_load(&elf, so_bias); |
close(fd); |
return rc; |
} |
/** Run an ELF executable. |
* |
* Transfers control to the entry point of an ELF executable loaded |
* earlier with elf_load_file(). This function does not return. |
* |
* @param info Info structure filled earlier by elf_load_file() |
*/ |
void elf_run(elf_info_t *info, pcb_t *pcb) |
{ |
program_run(info->entry, pcb); |
/* not reached */ |
} |
/** Create the program control block (PCB). |
* |
* Fills the program control block @a pcb with information from |
* @a info. |
* |
* @param info Program info structure |
* @return EOK on success or negative error code |
*/ |
void elf_create_pcb(elf_info_t *info, pcb_t *pcb) |
{ |
pcb->entry = info->entry; |
pcb->dynamic = info->dynamic; |
} |
/** Load an ELF binary. |
* |
* The @a elf structure contains the loader state, including |
* an open file, from which the binary will be loaded, |
* a pointer to the @c info structure etc. |
* |
* @param elf Pointer to loader state buffer. |
* @param so_bias Bias to use if the file is a shared object. |
* @return EE_OK on success or EE_xx error code. |
*/ |
static unsigned int elf_load(elf_ld_t *elf, size_t so_bias) |
{ |
elf_header_t header_buf; |
elf_header_t *header = &header_buf; |
int i, rc; |
rc = my_read(elf->fd, header, sizeof(elf_header_t)); |
if (rc < 0) { |
DPRINTF("Read error.\n"); |
return EE_INVALID; |
} |
elf->header = header; |
/* Identify ELF */ |
if (header->e_ident[EI_MAG0] != ELFMAG0 || |
header->e_ident[EI_MAG1] != ELFMAG1 || |
header->e_ident[EI_MAG2] != ELFMAG2 || |
header->e_ident[EI_MAG3] != ELFMAG3) { |
DPRINTF("Invalid header.\n"); |
return EE_INVALID; |
} |
/* Identify ELF compatibility */ |
if (header->e_ident[EI_DATA] != ELF_DATA_ENCODING || |
header->e_machine != ELF_MACHINE || |
header->e_ident[EI_VERSION] != EV_CURRENT || |
header->e_version != EV_CURRENT || |
header->e_ident[EI_CLASS] != ELF_CLASS) { |
DPRINTF("Incompatible data/version/class.\n"); |
return EE_INCOMPATIBLE; |
} |
if (header->e_phentsize != sizeof(elf_segment_header_t)) { |
DPRINTF("e_phentsize:%d != %d\n", header->e_phentsize, |
sizeof(elf_segment_header_t)); |
return EE_INCOMPATIBLE; |
} |
if (header->e_shentsize != sizeof(elf_section_header_t)) { |
DPRINTF("e_shentsize:%d != %d\n", header->e_shentsize, |
sizeof(elf_section_header_t)); |
return EE_INCOMPATIBLE; |
} |
/* Check if the object type is supported. */ |
if (header->e_type != ET_EXEC && header->e_type != ET_DYN) { |
DPRINTF("Object type %d is not supported\n", header->e_type); |
return EE_UNSUPPORTED; |
} |
/* Shared objects can be loaded with a bias */ |
if (header->e_type == ET_DYN) |
elf->bias = so_bias; |
else |
elf->bias = 0; |
elf->info->interp = NULL; |
elf->info->dynamic = NULL; |
/* Walk through all segment headers and process them. */ |
for (i = 0; i < header->e_phnum; i++) { |
elf_segment_header_t segment_hdr; |
/* Seek to start of segment header */ |
lseek(elf->fd, header->e_phoff |
+ i * sizeof(elf_segment_header_t), SEEK_SET); |
rc = my_read(elf->fd, &segment_hdr, |
sizeof(elf_segment_header_t)); |
if (rc < 0) { |
DPRINTF("Read error.\n"); |
return EE_INVALID; |
} |
rc = segment_header(elf, &segment_hdr); |
if (rc != EE_OK) |
return rc; |
} |
DPRINTF("Parse sections.\n"); |
/* Inspect all section headers and proccess them. */ |
for (i = 0; i < header->e_shnum; i++) { |
elf_section_header_t section_hdr; |
/* Seek to start of section header */ |
lseek(elf->fd, header->e_shoff |
+ i * sizeof(elf_section_header_t), SEEK_SET); |
rc = my_read(elf->fd, §ion_hdr, |
sizeof(elf_section_header_t)); |
if (rc < 0) { |
DPRINTF("Read error.\n"); |
return EE_INVALID; |
} |
rc = section_header(elf, §ion_hdr); |
if (rc != EE_OK) |
return rc; |
} |
elf->info->entry = |
(entry_point_t)((uint8_t *)header->e_entry + elf->bias); |
DPRINTF("Done.\n"); |
return EE_OK; |
} |
/** Print error message according to error code. |
* |
* @param rc Return code returned by elf_load(). |
* |
* @return NULL terminated description of error. |
*/ |
char *elf_error(unsigned int rc) |
{ |
assert(rc < sizeof(error_codes) / sizeof(char *)); |
return error_codes[rc]; |
} |
/** Process segment header. |
* |
* @param entry Segment header. |
* |
* @return EE_OK on success, error code otherwise. |
*/ |
static int segment_header(elf_ld_t *elf, elf_segment_header_t *entry) |
{ |
switch (entry->p_type) { |
case PT_NULL: |
case PT_PHDR: |
break; |
case PT_LOAD: |
return load_segment(elf, entry); |
break; |
case PT_INTERP: |
/* Assume silently interp == "/rtld.so" */ |
elf->info->interp = "/rtld.so"; |
break; |
case PT_DYNAMIC: |
case PT_SHLIB: |
case PT_NOTE: |
case PT_LOPROC: |
case PT_HIPROC: |
default: |
DPRINTF("Segment p_type %d unknown.\n", entry->p_type); |
return EE_UNSUPPORTED; |
break; |
} |
return EE_OK; |
} |
/** Load segment described by program header entry. |
* |
* @param elf Loader state. |
* @param entry Program header entry describing segment to be loaded. |
* |
* @return EE_OK on success, error code otherwise. |
*/ |
int load_segment(elf_ld_t *elf, elf_segment_header_t *entry) |
{ |
void *a; |
int flags = 0; |
uintptr_t bias; |
uintptr_t base; |
void *seg_ptr; |
uintptr_t seg_addr; |
size_t mem_sz; |
int rc; |
bias = elf->bias; |
seg_addr = entry->p_vaddr + bias; |
seg_ptr = (void *) seg_addr; |
DPRINTF("Load segment at addr 0x%x, size 0x%x\n", seg_addr, |
entry->p_memsz); |
if (entry->p_align > 1) { |
if ((entry->p_offset % entry->p_align) != |
(seg_addr % entry->p_align)) { |
DPRINTF("Align check 1 failed offset%%align=%d, " |
"vaddr%%align=%d\n", |
entry->p_offset % entry->p_align, |
seg_addr % entry->p_align |
); |
return EE_INVALID; |
} |
} |
/* Final flags that will be set for the memory area */ |
if (entry->p_flags & PF_X) |
flags |= AS_AREA_EXEC; |
if (entry->p_flags & PF_W) |
flags |= AS_AREA_WRITE; |
if (entry->p_flags & PF_R) |
flags |= AS_AREA_READ; |
flags |= AS_AREA_CACHEABLE; |
base = ALIGN_DOWN(entry->p_vaddr, PAGE_SIZE); |
mem_sz = entry->p_memsz + (entry->p_vaddr - base); |
DPRINTF("Map to seg_addr=0x%x-0x%x.\n", seg_addr, |
entry->p_vaddr + bias + ALIGN_UP(entry->p_memsz, PAGE_SIZE)); |
/* |
* For the course of loading, the area needs to be readable |
* and writeable. |
*/ |
a = as_area_create((uint8_t *)base + bias, mem_sz, |
AS_AREA_READ | AS_AREA_WRITE | AS_AREA_CACHEABLE); |
if (a == (void *)(-1)) { |
DPRINTF("Memory mapping failed.\n"); |
return EE_MEMORY; |
} |
DPRINTF("as_area_create(0x%lx, 0x%x, %d) -> 0x%lx\n", |
base + bias, mem_sz, flags, (uintptr_t)a); |
/* |
* Load segment data |
*/ |
rc = lseek(elf->fd, entry->p_offset, SEEK_SET); |
if (rc < 0) { |
printf("seek error\n"); |
return EE_INVALID; |
} |
/* rc = read(fd, (void *)(entry->p_vaddr + bias), entry->p_filesz); |
if (rc < 0) { printf("read error\n"); return EE_INVALID; }*/ |
/* Long reads are not possible yet. Load segment piecewise. */ |
unsigned left, now; |
uint8_t *dp; |
left = entry->p_filesz; |
dp = seg_ptr; |
while (left > 0) { |
now = 16384; |
if (now > left) now = left; |
rc = my_read(elf->fd, dp, now); |
if (rc < 0) { |
DPRINTF("Read error.\n"); |
return EE_INVALID; |
} |
left -= now; |
dp += now; |
} |
rc = as_area_change_flags(seg_ptr, flags); |
if (rc != 0) { |
DPRINTF("Failed to set memory area flags.\n"); |
return EE_MEMORY; |
} |
if (flags & AS_AREA_EXEC) { |
/* Enforce SMC coherence for the segment */ |
if (smc_coherence(seg_ptr, entry->p_filesz)) |
return EE_MEMORY; |
} |
return EE_OK; |
} |
/** Process section header. |
* |
* @param elf Loader state. |
* @param entry Segment header. |
* |
* @return EE_OK on success, error code otherwise. |
*/ |
static int section_header(elf_ld_t *elf, elf_section_header_t *entry) |
{ |
switch (entry->sh_type) { |
case SHT_PROGBITS: |
if (entry->sh_flags & SHF_TLS) { |
/* .tdata */ |
} |
break; |
case SHT_NOBITS: |
if (entry->sh_flags & SHF_TLS) { |
/* .tbss */ |
} |
break; |
case SHT_DYNAMIC: |
/* Record pointer to dynamic section into info structure */ |
elf->info->dynamic = |
(void *)((uint8_t *)entry->sh_addr + elf->bias); |
DPRINTF("Dynamic section found at 0x%x.\n", |
(uintptr_t)elf->info->dynamic); |
break; |
default: |
break; |
} |
return EE_OK; |
} |
/** @} |
*/ |
//branches/snapshot/uspace/srv/loader/arch/ia32/ia32.s |
---|
0,0 → 1,49 |
# |
# Copyright (c) 2008 Jiri Svoboda |
# All rights reserved. |
# |
# Redistribution and use in source and binary forms, with or without |
# modification, are permitted provided that the following conditions |
# are met: |
# |
# - Redistributions of source code must retain the above copyright |
# notice, this list of conditions and the following disclaimer. |
# - 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. |
# - The name of the author may not be used to endorse or promote products |
# derived from this software without specific prior written permission. |
# |
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
# |
.globl program_run |
## void program_run(void *entry_point, void *pcb); |
# |
# Jump to a program entry point |
program_run: |
# Use standard ia32 prologue not to confuse anybody |
push %ebp |
movl %esp, %ebp |
# %eax := entry_point |
movl 0x8(%ebp), %eax |
# %ebx := pcb |
# pcb is passed to the entry point int %ebx |
mov 0xc(%ebp), %ebx |
# Save a tiny bit of stack space |
pop %ebp |
jmp *%eax |
//branches/snapshot/uspace/srv/loader/arch/ia32/_link.ld.in |
---|
0,0 → 1,55 |
/* |
* The difference from _link.ld.in for regular statically-linked apps |
* is the base address and the special interp section. |
*/ |
STARTUP(LIBC_PREFIX/arch/UARCH/src/entry.o) |
ENTRY(__entry) |
PHDRS { |
interp PT_INTERP; |
text PT_LOAD FILEHDR PHDRS FLAGS(5); |
data PT_LOAD FLAGS(6); |
} |
SECTIONS { |
.interp : { |
*(.interp); |
} :interp |
. = 0x70001000; |
.init ALIGN(0x1000) : SUBALIGN(0x1000) { |
*(.init); |
} :text |
.text : { |
*(.text); |
*(.rodata*); |
} :text |
.data ALIGN(0x1000) : SUBALIGN(0x1000) { |
*(.data); |
} :data |
.tdata : { |
_tdata_start = .; |
*(.tdata); |
_tdata_end = .; |
} :data |
.tbss : { |
_tbss_start = .; |
*(.tbss); |
_tbss_end = .; |
} :data |
_tls_alignment = MAX(ALIGNOF(.tdata), ALIGNOF(.tbss)); |
.bss : { |
*(COMMON); |
*(.bss); |
} :data |
. = ALIGN(0x1000); |
_heap = .; |
/DISCARD/ : { |
*(*); |
} |
} |
//branches/snapshot/uspace/srv/loader/arch/ia32/Makefile.inc |
---|
0,0 → 1,30 |
# |
# Copyright (c) 2008 Jiri Svoboda |
# All rights reserved. |
# |
# Redistribution and use in source and binary forms, with or without |
# modification, are permitted provided that the following conditions |
# are met: |
# |
# - Redistributions of source code must retain the above copyright |
# notice, this list of conditions and the following disclaimer. |
# - 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. |
# - The name of the author may not be used to endorse or promote products |
# derived from this software without specific prior written permission. |
# |
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
# |
CFLAGS += -D__32_BITS__ |
ARCH_SOURCES := arch/$(UARCH)/ia32.s |
//branches/snapshot/uspace/srv/loader/arch/sparc64/_link.ld.in |
---|
0,0 → 1,59 |
STARTUP(LIBC_PREFIX/arch/UARCH/src/entry.o) |
ENTRY(__entry) |
PHDRS { |
interp PT_INTERP; |
text PT_LOAD FLAGS(5); |
data PT_LOAD FLAGS(6); |
} |
SECTIONS { |
.interp : { |
*(.interp); |
} :interp |
. = 0x70004000 + SIZEOF_HEADERS; |
.init : { |
*(.init); |
} :text |
.text : { |
*(.text); |
*(.rodata*); |
} :text |
. = . + 0x4000; |
.got : { |
_gp = .; |
*(.got*); |
} :data |
.data : { |
*(.data); |
*(.sdata); |
} :data |
.tdata : { |
_tdata_start = .; |
*(.tdata); |
_tdata_end = .; |
} :data |
.tbss : { |
_tbss_start = .; |
*(.tbss); |
_tbss_end = .; |
} :data |
_tls_alignment = MAX(ALIGNOF(.tdata), ALIGNOF(.tbss)); |
.bss : { |
*(.sbss); |
*(COMMON); |
*(.bss); |
} :data |
. = ALIGN(0x4000); |
_heap = .; |
/DISCARD/ : { |
*(*); |
} |
} |
//branches/snapshot/uspace/srv/loader/arch/sparc64/Makefile.inc |
---|
0,0 → 1,30 |
# |
# Copyright (c) 2008 Jiri Svoboda |
# All rights reserved. |
# |
# Redistribution and use in source and binary forms, with or without |
# modification, are permitted provided that the following conditions |
# are met: |
# |
# - Redistributions of source code must retain the above copyright |
# notice, this list of conditions and the following disclaimer. |
# - 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. |
# - The name of the author may not be used to endorse or promote products |
# derived from this software without specific prior written permission. |
# |
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
# |
CFLAGS += -D__64_BITS__ |
ARCH_SOURCES := arch/$(UARCH)/sparc64.s |
//branches/snapshot/uspace/srv/loader/arch/sparc64/sparc64.s |
---|
0,0 → 1,42 |
# |
# Copyright (c) 2008 Jiri Svoboda |
# All rights reserved. |
# |
# Redistribution and use in source and binary forms, with or without |
# modification, are permitted provided that the following conditions |
# are met: |
# |
# - Redistributions of source code must retain the above copyright |
# notice, this list of conditions and the following disclaimer. |
# - 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. |
# - The name of the author may not be used to endorse or promote products |
# derived from this software without specific prior written permission. |
# |
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
# |
.globl program_run |
## void program_run(void *entry_point, void *pcb); |
# |
# %o0 contains entry_point |
# %o1 contains pcb |
# |
# Jump to a program entry point |
program_run: |
# Pass pcb pointer to entry point in %o1. As it is already |
# there, no action is needed. |
call %o0 |
nop |
# fixme: use branch instead of call |
//branches/snapshot/uspace/srv/loader/arch/ia64/_link.ld.in |
---|
0,0 → 1,61 |
STARTUP(LIBC_PREFIX/arch/UARCH/src/entry.o) |
ENTRY(__entry) |
PHDRS { |
interp PT_INTERP; |
text PT_LOAD FLAGS(5); |
data PT_LOAD FLAGS(6); |
} |
SECTIONS { |
.interp : { |
*(.interp); |
} :interp |
/* On Itanium code sections must be aligned to 16 bytes. */ |
. = ALIGN(0x800000000 + SIZEOF_HEADERS, 16); |
.init : { |
*(.init); |
} : text |
.text : { |
*(.text); |
*(.rodata*); |
} :text |
. = . + 0x4000; |
.got : { |
_gp = .; |
*(.got*); |
} :data |
.data : { |
*(.opd); |
*(.data .data.*); |
*(.sdata); |
} :data |
.tdata : { |
_tdata_start = .; |
*(.tdata); |
_tdata_end = .; |
} :data |
.tbss : { |
_tbss_start = .; |
*(.tbss); |
_tbss_end = .; |
} :data |
_tls_alignment = MAX(ALIGNOF(.tdata), ALIGNOF(.tbss)); |
.bss : { |
*(.sbss); |
*(.scommon); |
*(COMMON); |
*(.bss); |
} :data |
. = ALIGN(0x4000); |
_heap = .; |
/DISCARD/ : { |
*(*); |
} |
} |
//branches/snapshot/uspace/srv/loader/arch/ia64/Makefile.inc |
---|
0,0 → 1,31 |
# |
# Copyright (c) 2008 Jiri Svoboda |
# All rights reserved. |
# |
# Redistribution and use in source and binary forms, with or without |
# modification, are permitted provided that the following conditions |
# are met: |
# |
# - Redistributions of source code must retain the above copyright |
# notice, this list of conditions and the following disclaimer. |
# - 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. |
# - The name of the author may not be used to endorse or promote products |
# derived from this software without specific prior written permission. |
# |
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
# |
CFLAGS += -D__64_BITS__ |
ARCH_SOURCES := arch/$(UARCH)/ia64.s |
AFLAGS += -xexplicit |
//branches/snapshot/uspace/srv/loader/arch/ia64/ia64.s |
---|
0,0 → 1,43 |
# |
# Copyright (c) 2008 Jiri Svoboda |
# All rights reserved. |
# |
# Redistribution and use in source and binary forms, with or without |
# modification, are permitted provided that the following conditions |
# are met: |
# |
# - Redistributions of source code must retain the above copyright |
# notice, this list of conditions and the following disclaimer. |
# - 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. |
# - The name of the author may not be used to endorse or promote products |
# derived from this software without specific prior written permission. |
# |
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
# |
.text |
.globl program_run |
## void program_run(void *entry_point, void *pcb); |
# |
# in0 (r32) contains entry_point |
# in1 (r33) contains pcb |
# |
# Jump to a program entry point |
program_run: |
# Pass pcb to the entry point in r2 |
mov b6 = r32 |
mov r2 = r33 ;; |
br b6 ;; |
//branches/snapshot/uspace/srv/loader/arch/arm32/_link.ld.in |
---|
0,0 → 1,59 |
/* |
* The only difference from _link.ld.in for regular statically-linked apps |
* is the base address. |
*/ |
STARTUP(LIBC_PREFIX/arch/UARCH/src/entry.o) |
ENTRY(__entry) |
PHDRS { |
interp PT_INTERP; |
text PT_LOAD FLAGS(5); |
data PT_LOAD FLAGS(6); |
} |
SECTIONS { |
.interp : { |
*(.interp); |
} : interp |
. = 0x70001000; |
.init ALIGN(0x1000): SUBALIGN(0x1000) { |
*(.init); |
} : text |
.text : { |
*(.text); |
*(.rodata*); |
} :text |
.data ALIGN(0x1000) : SUBALIGN(0x1000) { |
*(.opd); |
*(.data .data.*); |
*(.sdata); |
} :data |
.tdata : { |
_tdata_start = .; |
*(.tdata); |
_tdata_end = .; |
} :data |
.tbss : { |
_tbss_start = .; |
*(.tbss); |
_tbss_end = .; |
} :data |
_tls_alignment = MAX(ALIGNOF(.tdata), ALIGNOF(.tbss)); |
.bss : { |
*(.sbss); |
*(.scommon); |
*(COMMON); |
*(.bss); |
} :data |
. = ALIGN(0x1000); |
_heap = .; |
/DISCARD/ : { |
*(*); |
} |
} |
//branches/snapshot/uspace/srv/loader/arch/arm32/Makefile.inc |
---|
0,0 → 1,30 |
# |
# Copyright (c) 2008 Jiri Svoboda |
# All rights reserved. |
# |
# Redistribution and use in source and binary forms, with or without |
# modification, are permitted provided that the following conditions |
# are met: |
# |
# - Redistributions of source code must retain the above copyright |
# notice, this list of conditions and the following disclaimer. |
# - 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. |
# - The name of the author may not be used to endorse or promote products |
# derived from this software without specific prior written permission. |
# |
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
# |
CFLAGS += -D__32_BITS__ |
ARCH_SOURCES := arch/$(UARCH)/arm32.s |
//branches/snapshot/uspace/srv/loader/arch/arm32/arm32.s |
---|
0,0 → 1,39 |
# |
# Copyright (c) 2008 Jiri Svoboda |
# All rights reserved. |
# |
# Redistribution and use in source and binary forms, with or without |
# modification, are permitted provided that the following conditions |
# are met: |
# |
# - Redistributions of source code must retain the above copyright |
# notice, this list of conditions and the following disclaimer. |
# - 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. |
# - The name of the author may not be used to endorse or promote products |
# derived from this software without specific prior written permission. |
# |
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
# |
.globl program_run |
## void program_run(void *entry_point, void *pcb); |
# |
# r0 contains entry_point |
# r1 contains pcb |
# |
# Jump to a program entry point |
program_run: |
# pcb is passed to the entry point in r1 (where it already is) |
mov r15, r0 |
//branches/snapshot/uspace/srv/loader/arch/ppc32/_link.ld.in |
---|
0,0 → 1,57 |
/* |
* The only difference from _link.ld.in for regular statically-linked apps |
* is the base address. |
*/ |
STARTUP(LIBC_PREFIX/arch/UARCH/src/entry.o) |
ENTRY(__entry) |
PHDRS { |
interp PT_INTERP; |
text PT_LOAD FLAGS(5); |
data PT_LOAD FLAGS(6); |
} |
SECTIONS { |
.interp : { |
*(.interp); |
} :interp |
. = 0x70001000; |
.init ALIGN(0x1000) : SUBALIGN(0x1000) { |
*(.init); |
} :text |
.text : { |
*(.text); |
*(.rodata*); |
} :text |
.data ALIGN(0x1000) : SUBALIGN(0x1000) { |
*(.data); |
*(.sdata); |
} :data |
.tdata : { |
_tdata_start = .; |
*(.tdata); |
_tdata_end = .; |
} :data |
.tbss : { |
_tbss_start = .; |
*(.tbss); |
_tbss_end = .; |
} :data |
_tls_alignment = MAX(ALIGNOF(.tdata), ALIGNOF(.tbss)); |
.bss : { |
*(.sbss); |
*(COMMON); |
*(.bss); |
} :data |
. = ALIGN(0x1000); |
_heap = .; |
/DISCARD/ : { |
*(*); |
} |
} |
//branches/snapshot/uspace/srv/loader/arch/ppc32/Makefile.inc |
---|
0,0 → 1,30 |
# |
# Copyright (c) 2008 Jiri Svoboda |
# All rights reserved. |
# |
# Redistribution and use in source and binary forms, with or without |
# modification, are permitted provided that the following conditions |
# are met: |
# |
# - Redistributions of source code must retain the above copyright |
# notice, this list of conditions and the following disclaimer. |
# - 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. |
# - The name of the author may not be used to endorse or promote products |
# derived from this software without specific prior written permission. |
# |
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
# |
CFLAGS += -D__32_BITS__ |
ARCH_SOURCES := arch/$(UARCH)/ppc32.s |
//branches/snapshot/uspace/srv/loader/arch/ppc32/ppc32.s |
---|
0,0 → 1,40 |
# |
# Copyright (c) 2008 Jiri Svoboda |
# All rights reserved. |
# |
# Redistribution and use in source and binary forms, with or without |
# modification, are permitted provided that the following conditions |
# are met: |
# |
# - Redistributions of source code must retain the above copyright |
# notice, this list of conditions and the following disclaimer. |
# - 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. |
# - The name of the author may not be used to endorse or promote products |
# derived from this software without specific prior written permission. |
# |
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
# |
.globl program_run |
## void program_run(void *entry_point, void *pcb); |
# |
# %r3 contains entry_point |
# %r4 contains pcb |
# |
# Jump to a program entry point |
program_run: |
mtctr %r3 |
mr %r6, %r4 # Pass pcb to the entry point in %r6 |
bctr |
//branches/snapshot/uspace/srv/loader/arch/amd64/_link.ld.in |
---|
0,0 → 1,52 |
STARTUP(LIBC_PREFIX/arch/UARCH/src/entry.o) |
ENTRY(__entry) |
PHDRS { |
interp PT_INTERP; |
text PT_LOAD FLAGS(5); |
data PT_LOAD FLAGS(6); |
} |
SECTIONS { |
.interp : { |
*(.interp); |
} : interp |
/* . = 0x0000700000001000;*/ |
. = 0x70001000; |
.init ALIGN(0x1000) : SUBALIGN(0x1000) { |
*(.init); |
} :text |
.text : { |
*(.text); |
*(.rodata*); |
} :text |
.data ALIGN(0x1000) : SUBALIGN(0x1000) { |
*(.data); |
} :data |
.tdata : { |
_tdata_start = .; |
*(.tdata); |
_tdata_end = .; |
} :data |
.tbss : { |
_tbss_start = .; |
*(.tbss); |
_tbss_end = .; |
} :data |
_tls_alignment = MAX(ALIGNOF(.tdata), ALIGNOF(.tbss)); |
.bss : { |
*(COMMON); |
*(.bss); |
} :data |
. = ALIGN(0x1000); |
_heap = .; |
/DISCARD/ : { |
*(*); |
} |
} |
//branches/snapshot/uspace/srv/loader/arch/amd64/Makefile.inc |
---|
0,0 → 1,30 |
# |
# Copyright (c) 2008 Jiri Svoboda |
# All rights reserved. |
# |
# Redistribution and use in source and binary forms, with or without |
# modification, are permitted provided that the following conditions |
# are met: |
# |
# - Redistributions of source code must retain the above copyright |
# notice, this list of conditions and the following disclaimer. |
# - 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. |
# - The name of the author may not be used to endorse or promote products |
# derived from this software without specific prior written permission. |
# |
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
# |
CFLAGS += -D__64_BITS__ |
ARCH_SOURCES := arch/$(UARCH)/amd64.s |
//branches/snapshot/uspace/srv/loader/arch/amd64/amd64.s |
---|
0,0 → 1,43 |
# |
# Copyright (c) 2008 Jiri Svoboda |
# All rights reserved. |
# |
# Redistribution and use in source and binary forms, with or without |
# modification, are permitted provided that the following conditions |
# are met: |
# |
# - Redistributions of source code must retain the above copyright |
# notice, this list of conditions and the following disclaimer. |
# - 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. |
# - The name of the author may not be used to endorse or promote products |
# derived from this software without specific prior written permission. |
# |
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
# |
.globl program_run |
## void program_run(void *entry_point, void *pcb); |
# |
# %rdi contains entry_point |
# %rsi contains pcb |
# |
# Jump to a program entry point |
program_run: |
# pcb must be passed in %rdi, use %rdx as a scratch register |
mov %rdi, %rdx |
mov %rsi, %rdi |
# jump to entry point |
jmp %rdx |
//branches/snapshot/uspace/srv/loader/arch/mips32/_link.ld.in |
---|
0,0 → 1,66 |
/* |
* The only difference from _link.ld.in for regular statically-linked apps |
* is the base address. |
*/ |
STARTUP(LIBC_PREFIX/arch/UARCH/src/entry.o) |
ENTRY(__entry) |
PHDRS { |
interp PT_INTERP; |
text PT_LOAD FLAGS(5); |
data PT_LOAD FLAGS(6); |
} |
SECTIONS { |
.interp : { |
*(.interp); |
} :interp |
. = 0x70004000; |
.init ALIGN(0x4000) : SUBALIGN(0x4000) { |
*(.init); |
} :text |
.text : { |
*(.text); |
*(.rodata*); |
} :text |
.data : { |
*(.data); |
*(.data.rel*); |
} :data |
.got : { |
_gp = .; |
*(.got); |
} :data |
.tdata : { |
_tdata_start = .; |
*(.tdata); |
_tdata_end = .; |
} :data |
.tbss : { |
_tbss_start = .; |
*(.tbss); |
_tbss_end = .; |
} :data |
_tls_alignment = MAX(ALIGNOF(.tdata), ALIGNOF(.tbss)); |
.sbss : { |
*(.scommon); |
*(.sbss); |
} |
.bss : { |
*(.bss); |
*(COMMON); |
} :data |
. = ALIGN(0x4000); |
_heap = .; |
/DISCARD/ : { |
*(*); |
} |
} |
//branches/snapshot/uspace/srv/loader/arch/mips32/Makefile.inc |
---|
0,0 → 1,30 |
# |
# Copyright (c) 2008 Jiri Svoboda |
# All rights reserved. |
# |
# Redistribution and use in source and binary forms, with or without |
# modification, are permitted provided that the following conditions |
# are met: |
# |
# - Redistributions of source code must retain the above copyright |
# notice, this list of conditions and the following disclaimer. |
# - 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. |
# - The name of the author may not be used to endorse or promote products |
# derived from this software without specific prior written permission. |
# |
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
# |
CFLAGS += -D__32_BITS__ |
ARCH_SOURCES := arch/$(UARCH)/mips32.s |
//branches/snapshot/uspace/srv/loader/arch/mips32/mips32.s |
---|
0,0 → 1,49 |
# |
# Copyright (c) 2008 Jiri Svoboda |
# All rights reserved. |
# |
# Redistribution and use in source and binary forms, with or without |
# modification, are permitted provided that the following conditions |
# are met: |
# |
# - Redistributions of source code must retain the above copyright |
# notice, this list of conditions and the following disclaimer. |
# - 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. |
# - The name of the author may not be used to endorse or promote products |
# derived from this software without specific prior written permission. |
# |
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
# |
.text |
.section .text |
.global program_run |
.set noreorder |
## void program_run(void *entry_point, void *pcb); |
# |
# $a0 (=$4) contains entry_point |
# $a1 (=$5) contains pcb |
# |
# Jump to a program entry point |
.ent program_run |
program_run: |
# tmp := entry_point |
move $25, $a0 |
# Pass pcb to the entry point in $a0 |
move $a0, $a1 |
jr $25 |
nop |
.end |
//branches/snapshot/uspace/srv/loader/arch/mips32eb |
---|
0,0 → 1,0 |
link mips32 |
Property changes: |
Added: svn:special |
+* |
\ No newline at end of property |
//branches/snapshot/uspace/srv/loader/Makefile |
---|
0,0 → 1,83 |
# |
# Copyright (c) 2005 Martin Decky |
# Copyright (c) 2008 Jiri Svoboda |
# All rights reserved. |
# |
# Redistribution and use in source and binary forms, with or without |
# modification, are permitted provided that the following conditions |
# are met: |
# |
# - Redistributions of source code must retain the above copyright |
# notice, this list of conditions and the following disclaimer. |
# - 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. |
# - The name of the author may not be used to endorse or promote products |
# derived from this software without specific prior written permission. |
# |
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
# |
## Setup toolchain |
# |
LIBC_PREFIX = ../../lib/libc |
SOFTINT_PREFIX = ../../lib/softint |
include $(LIBC_PREFIX)/Makefile.toolchain |
include arch/$(UARCH)/Makefile.inc |
CFLAGS += -Iinclude |
LIBS = $(LIBC_PREFIX)/libc.a $(SOFTINT_PREFIX)/libsoftint.a |
## Sources |
# |
OUTPUT = loader |
GENERIC_SOURCES = \ |
main.c \ |
elf_load.c \ |
interp.s |
SOURCES := $(GENERIC_SOURCES) $(ARCH_SOURCES) |
OBJECTS := $(addsuffix .o,$(basename $(SOURCES))) |
.PHONY: all clean depend disasm |
all: $(OUTPUT) disasm |
-include Makefile.depend |
clean: |
-rm -f $(OUTPUT) $(OBJECTS) $(OUTPUT).map $(OUTPUT).disasm arch/$(UARCH)/_link.ld Makefile.depend |
depend: |
$(CC) $(DEFS) $(CFLAGS) -M $(SOURCES) > Makefile.depend |
$(OUTPUT): $(OBJECTS) $(LIBS) arch/$(UARCH)/_link.ld |
$(LD) -T arch/$(UARCH)/_link.ld $(LFLAGS) $(OBJECTS) $(LIBS) -o $@ -Map $(OUTPUT).map |
disasm: |
$(OBJDUMP) -d $(OUTPUT) >$(OUTPUT).disasm |
arch/$(UARCH)/_link.ld: arch/$(UARCH)/_link.ld.in |
$(CC) $(DEFS) $(CFLAGS) -DLIBC_PREFIX=$(LIBC_PREFIX) -E -x c $< | grep -v "^\#" > $@ |
%.o: %.S |
$(CC) $(DEFS) $(AFLAGS) $(CFLAGS) -D__ASM__ -c $< -o $@ |
%.o: %.s |
$(AS) $(AFLAGS) $< -o $@ |
%.o: %.c |
$(CC) $(DEFS) $(CFLAGS) -c $< -o $@ |
//branches/snapshot/uspace/srv/loader/interp.s |
---|
0,0 → 1,7 |
# |
# Provide a string to be included in a special DT_INTERP header, even though |
# this is a statically-linked executable. This will mark the binary as |
# the program loader. |
# |
.section .interp , "" |
.string "kernel" |
//branches/snapshot/uspace/srv/loader/include/arch.h |
---|
0,0 → 1,45 |
/* |
* Copyright (c) 2008 Jiri Svoboda |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup fs |
* @{ |
*/ |
/** @file |
* @brief |
*/ |
#ifndef LOADER_ARCH_H_ |
#define LOADER_ARCH_H_ |
void program_run(void *entry_point, void *pcb); |
#endif |
/** |
* @} |
*/ |
//branches/snapshot/uspace/srv/loader/include/elf_load.h |
---|
0,0 → 1,83 |
/* |
* Copyright (c) 2008 Jiri Svoboda |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup generic |
* @{ |
*/ |
/** @file |
* @brief ELF loader structures and public functions. |
*/ |
#ifndef ELF_LOAD_H_ |
#define ELF_LOAD_H_ |
#include <arch/elf.h> |
#include <sys/types.h> |
#include <loader/pcb.h> |
#include "elf.h" |
/** |
* Some data extracted from the headers are stored here |
*/ |
typedef struct { |
/** Entry point */ |
entry_point_t entry; |
/** ELF interpreter name or NULL if statically-linked */ |
char *interp; |
/** Pointer to the dynamic section */ |
void *dynamic; |
} elf_info_t; |
/** |
* Holds information about an ELF binary being loaded. |
*/ |
typedef struct { |
/** Filedescriptor of the file from which we are loading */ |
int fd; |
/** Difference between run-time addresses and link-time addresses */ |
uintptr_t bias; |
/** A copy of the ELF file header */ |
elf_header_t *header; |
/** Store extracted info here */ |
elf_info_t *info; |
} elf_ld_t; |
int elf_load_file(char *file_name, size_t so_bias, elf_info_t *info); |
void elf_run(elf_info_t *info, pcb_t *pcb); |
void elf_create_pcb(elf_info_t *info, pcb_t *pcb); |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/srv/loader/include/elf.h |
---|
0,0 → 1,344 |
/* |
* Copyright (c) 2006 Sergey Bondari |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup generic |
* @{ |
*/ |
/** @file |
*/ |
#ifndef ELF_H_ |
#define ELF_H_ |
#include <arch/elf.h> |
#include <sys/types.h> |
/** |
* current ELF version |
*/ |
#define EV_CURRENT 1 |
/** |
* ELF types |
*/ |
#define ET_NONE 0 /* No type */ |
#define ET_REL 1 /* Relocatable file */ |
#define ET_EXEC 2 /* Executable */ |
#define ET_DYN 3 /* Shared object */ |
#define ET_CORE 4 /* Core */ |
#define ET_LOPROC 0xff00 /* Processor specific */ |
#define ET_HIPROC 0xffff /* Processor specific */ |
/** |
* ELF machine types |
*/ |
#define EM_NO 0 /* No machine */ |
#define EM_SPARC 2 /* SPARC */ |
#define EM_386 3 /* i386 */ |
#define EM_MIPS 8 /* MIPS RS3000 */ |
#define EM_MIPS_RS3_LE 10 /* MIPS RS3000 LE */ |
#define EM_PPC 20 /* PPC32 */ |
#define EM_PPC64 21 /* PPC64 */ |
#define EM_ARM 40 /* ARM */ |
#define EM_SPARCV9 43 /* SPARC64 */ |
#define EM_IA_64 50 /* IA-64 */ |
#define EM_X86_64 62 /* AMD64/EMT64 */ |
/** |
* ELF identification indexes |
*/ |
#define EI_MAG0 0 |
#define EI_MAG1 1 |
#define EI_MAG2 2 |
#define EI_MAG3 3 |
#define EI_CLASS 4 /* File class */ |
#define EI_DATA 5 /* Data encoding */ |
#define EI_VERSION 6 /* File version */ |
#define EI_OSABI 7 |
#define EI_ABIVERSION 8 |
#define EI_PAD 9 /* Start of padding bytes */ |
#define EI_NIDENT 16 /* ELF identification table size */ |
/** |
* ELF magic number |
*/ |
#define ELFMAG0 0x7f |
#define ELFMAG1 'E' |
#define ELFMAG2 'L' |
#define ELFMAG3 'F' |
/** |
* ELF file classes |
*/ |
#define ELFCLASSNONE 0 |
#define ELFCLASS32 1 |
#define ELFCLASS64 2 |
/** |
* ELF data encoding types |
*/ |
#define ELFDATANONE 0 |
#define ELFDATA2LSB 1 /* Least significant byte first (little endian) */ |
#define ELFDATA2MSB 2 /* Most signigicant byte first (big endian) */ |
/** |
* ELF error return codes |
*/ |
#define EE_OK 0 /* No error */ |
#define EE_INVALID 1 /* Invalid ELF image */ |
#define EE_MEMORY 2 /* Cannot allocate address space */ |
#define EE_INCOMPATIBLE 3 /* ELF image is not compatible with current architecture */ |
#define EE_UNSUPPORTED 4 /* Non-supported ELF (e.g. dynamic ELFs) */ |
#define EE_IRRECOVERABLE 5 |
/** |
* ELF section types |
*/ |
#define SHT_NULL 0 |
#define SHT_PROGBITS 1 |
#define SHT_SYMTAB 2 |
#define SHT_STRTAB 3 |
#define SHT_RELA 4 |
#define SHT_HASH 5 |
#define SHT_DYNAMIC 6 |
#define SHT_NOTE 7 |
#define SHT_NOBITS 8 |
#define SHT_REL 9 |
#define SHT_SHLIB 10 |
#define SHT_DYNSYM 11 |
#define SHT_LOOS 0x60000000 |
#define SHT_HIOS 0x6fffffff |
#define SHT_LOPROC 0x70000000 |
#define SHT_HIPROC 0x7fffffff |
#define SHT_LOUSER 0x80000000 |
#define SHT_HIUSER 0xffffffff |
/** |
* ELF section flags |
*/ |
#define SHF_WRITE 0x1 |
#define SHF_ALLOC 0x2 |
#define SHF_EXECINSTR 0x4 |
#define SHF_TLS 0x400 |
#define SHF_MASKPROC 0xf0000000 |
/** |
* Symbol binding |
*/ |
#define STB_LOCAL 0 |
#define STB_GLOBAL 1 |
#define STB_WEAK 2 |
#define STB_LOPROC 13 |
#define STB_HIPROC 15 |
/** |
* Symbol types |
*/ |
#define STT_NOTYPE 0 |
#define STT_OBJECT 1 |
#define STT_FUNC 2 |
#define STT_SECTION 3 |
#define STT_FILE 4 |
#define STT_LOPROC 13 |
#define STT_HIPROC 15 |
/** |
* Program segment types |
*/ |
#define PT_NULL 0 |
#define PT_LOAD 1 |
#define PT_DYNAMIC 2 |
#define PT_INTERP 3 |
#define PT_NOTE 4 |
#define PT_SHLIB 5 |
#define PT_PHDR 6 |
#define PT_LOPROC 0x70000000 |
#define PT_HIPROC 0x7fffffff |
/** |
* Program segment attributes. |
*/ |
#define PF_X 1 |
#define PF_W 2 |
#define PF_R 4 |
/** |
* ELF data types |
* |
* These types are found to be identical in both 32-bit and 64-bit |
* ELF object file specifications. They are the only types used |
* in ELF header. |
*/ |
typedef uint64_t elf_xword; |
typedef int64_t elf_sxword; |
typedef uint32_t elf_word; |
typedef int32_t elf_sword; |
typedef uint16_t elf_half; |
/** |
* 32-bit ELF data types. |
* |
* These types are specific for 32-bit format. |
*/ |
typedef uint32_t elf32_addr; |
typedef uint32_t elf32_off; |
/** |
* 64-bit ELF data types. |
* |
* These types are specific for 64-bit format. |
*/ |
typedef uint64_t elf64_addr; |
typedef uint64_t elf64_off; |
/** ELF header */ |
struct elf32_header { |
uint8_t e_ident[EI_NIDENT]; |
elf_half e_type; |
elf_half e_machine; |
elf_word e_version; |
elf32_addr e_entry; |
elf32_off e_phoff; |
elf32_off e_shoff; |
elf_word e_flags; |
elf_half e_ehsize; |
elf_half e_phentsize; |
elf_half e_phnum; |
elf_half e_shentsize; |
elf_half e_shnum; |
elf_half e_shstrndx; |
}; |
struct elf64_header { |
uint8_t e_ident[EI_NIDENT]; |
elf_half e_type; |
elf_half e_machine; |
elf_word e_version; |
elf64_addr e_entry; |
elf64_off e_phoff; |
elf64_off e_shoff; |
elf_word e_flags; |
elf_half e_ehsize; |
elf_half e_phentsize; |
elf_half e_phnum; |
elf_half e_shentsize; |
elf_half e_shnum; |
elf_half e_shstrndx; |
}; |
/* |
* ELF segment header. |
* Segments headers are also known as program headers. |
*/ |
struct elf32_segment_header { |
elf_word p_type; |
elf32_off p_offset; |
elf32_addr p_vaddr; |
elf32_addr p_paddr; |
elf_word p_filesz; |
elf_word p_memsz; |
elf_word p_flags; |
elf_word p_align; |
}; |
struct elf64_segment_header { |
elf_word p_type; |
elf_word p_flags; |
elf64_off p_offset; |
elf64_addr p_vaddr; |
elf64_addr p_paddr; |
elf_xword p_filesz; |
elf_xword p_memsz; |
elf_xword p_align; |
}; |
/* |
* ELF section header |
*/ |
struct elf32_section_header { |
elf_word sh_name; |
elf_word sh_type; |
elf_word sh_flags; |
elf32_addr sh_addr; |
elf32_off sh_offset; |
elf_word sh_size; |
elf_word sh_link; |
elf_word sh_info; |
elf_word sh_addralign; |
elf_word sh_entsize; |
}; |
struct elf64_section_header { |
elf_word sh_name; |
elf_word sh_type; |
elf_xword sh_flags; |
elf64_addr sh_addr; |
elf64_off sh_offset; |
elf_xword sh_size; |
elf_word sh_link; |
elf_word sh_info; |
elf_xword sh_addralign; |
elf_xword sh_entsize; |
}; |
/* |
* ELF symbol table entry |
*/ |
struct elf32_symbol { |
elf_word st_name; |
elf32_addr st_value; |
elf_word st_size; |
uint8_t st_info; |
uint8_t st_other; |
elf_half st_shndx; |
}; |
struct elf64_symbol { |
elf_word st_name; |
uint8_t st_info; |
uint8_t st_other; |
elf_half st_shndx; |
elf64_addr st_value; |
elf_xword st_size; |
}; |
#ifdef __32_BITS__ |
typedef struct elf32_header elf_header_t; |
typedef struct elf32_segment_header elf_segment_header_t; |
typedef struct elf32_section_header elf_section_header_t; |
typedef struct elf32_symbol elf_symbol_t; |
#endif |
#ifdef __64_BITS__ |
typedef struct elf64_header elf_header_t; |
typedef struct elf64_segment_header elf_segment_header_t; |
typedef struct elf64_section_header elf_section_header_t; |
typedef struct elf64_symbol elf_symbol_t; |
#endif |
extern char *elf_error(unsigned int rc); |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/srv/ns/clonable.c |
---|
0,0 → 1,143 |
/* |
* Copyright (c) 2009 Martin Decky |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup ns |
* @{ |
*/ |
#include <ipc/ipc.h> |
#include <ipc/services.h> |
#include <adt/list.h> |
#include <bool.h> |
#include <errno.h> |
#include <assert.h> |
#include <stdio.h> |
#include <malloc.h> |
#include <loader/loader.h> |
#include "clonable.h" |
#include "ns.h" |
/** Request for connection to a clonable service. */ |
typedef struct { |
link_t link; |
ipcarg_t service; |
ipc_call_t call; |
ipc_callid_t callid; |
} cs_req_t; |
/** List of clonable-service connection requests. */ |
static link_t cs_req; |
int clonable_init(void) |
{ |
list_initialize(&cs_req); |
return EOK; |
} |
/** Return true if @a service is clonable. */ |
bool service_clonable(int service) |
{ |
return (service == SERVICE_LOAD); |
} |
/** Register clonable service. |
* |
* @param service Service to be registered. |
* @param phone Phone to be used for connections to the service. |
* @param call Pointer to call structure. |
* |
*/ |
void register_clonable(ipcarg_t service, ipcarg_t phone, ipc_call_t *call, |
ipc_callid_t callid) |
{ |
if (list_empty(&cs_req)) { |
/* There was no pending connection request. */ |
printf(NAME ": Unexpected clonable server.\n"); |
ipc_answer_0(callid, EBUSY); |
return; |
} |
cs_req_t *csr = list_get_instance(cs_req.next, cs_req_t, link); |
list_remove(&csr->link); |
/* Currently we can only handle a single type of clonable service. */ |
assert(csr->service == SERVICE_LOAD); |
ipc_answer_0(callid, EOK); |
ipc_forward_fast(csr->callid, phone, IPC_GET_ARG2(csr->call), |
IPC_GET_ARG3(csr->call), 0, IPC_FF_NONE); |
free(csr); |
ipc_hangup(phone); |
} |
/** Connect client to clonable service. |
* |
* @param service Service to be connected to. |
* @param call Pointer to call structure. |
* @param callid Call ID of the request. |
* |
* @return Zero on success or a value from @ref errno.h. |
* |
*/ |
void connect_to_clonable(ipcarg_t service, ipc_call_t *call, |
ipc_callid_t callid) |
{ |
assert(service == SERVICE_LOAD); |
cs_req_t *csr = malloc(sizeof(cs_req_t)); |
if (csr == NULL) { |
ipc_answer_0(callid, ENOMEM); |
return; |
} |
/* Spawn a loader. */ |
int rc = loader_spawn("loader"); |
if (rc < 0) { |
free(csr); |
ipc_answer_0(callid, rc); |
return; |
} |
csr->service = service; |
csr->call = *call; |
csr->callid = callid; |
/* |
* We can forward the call only after the server we spawned connects |
* to us. Meanwhile we might need to service more connection requests. |
* Thus we store the call in a queue. |
*/ |
list_append(&csr->link, &cs_req); |
} |
/** |
* @} |
*/ |
//branches/snapshot/uspace/srv/ns/service.c |
---|
0,0 → 1,254 |
/* |
* Copyright (c) 2009 Martin Decky |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup ns |
* @{ |
*/ |
#include <ipc/ipc.h> |
#include <adt/hash_table.h> |
#include <assert.h> |
#include <errno.h> |
#include "service.h" |
#include "ns.h" |
#define SERVICE_HASH_TABLE_CHAINS 20 |
/** Service hash table item. */ |
typedef struct { |
link_t link; |
ipcarg_t service; /**< Number of the service. */ |
ipcarg_t phone; /**< Phone registered with the service. */ |
ipcarg_t in_phone_hash; /**< Incoming phone hash. */ |
} hashed_service_t; |
/** Compute hash index into service hash table. |
* |
* @param key Pointer keys. However, only the first key (i.e. service number) |
* is used to compute the hash index. |
* |
* @return Hash index corresponding to key[0]. |
* |
*/ |
static hash_index_t service_hash(unsigned long *key) |
{ |
assert(key); |
return (*key % SERVICE_HASH_TABLE_CHAINS); |
} |
/** Compare a key with hashed item. |
* |
* This compare function always ignores the third key. |
* It exists only to make it possible to remove records |
* originating from connection with key[1] in_phone_hash |
* value. Note that this is close to being classified |
* as a nasty hack. |
* |
* @param key Array of keys. |
* @param keys Must be lesser or equal to 3. |
* @param item Pointer to a hash table item. |
* |
* @return Non-zero if the key matches the item, zero otherwise. |
* |
*/ |
static int service_compare(unsigned long key[], hash_count_t keys, link_t *item) |
{ |
assert(key); |
assert(keys <= 3); |
assert(item); |
hashed_service_t *hs = hash_table_get_instance(item, hashed_service_t, link); |
if (keys == 2) |
return (key[1] == hs->in_phone_hash); |
else |
return (key[0] == hs->service); |
} |
/** Perform actions after removal of item from the hash table. |
* |
* @param item Item that was removed from the hash table. |
* |
*/ |
static void service_remove(link_t *item) |
{ |
assert(item); |
free(hash_table_get_instance(item, hashed_service_t, link)); |
} |
/** Operations for service hash table. */ |
static hash_table_operations_t service_hash_table_ops = { |
.hash = service_hash, |
.compare = service_compare, |
.remove_callback = service_remove |
}; |
/** Service hash table structure. */ |
static hash_table_t service_hash_table; |
/** Pending connection structure. */ |
typedef struct { |
link_t link; |
ipcarg_t service; /**< Number of the service. */ |
ipc_callid_t callid; /**< Call ID waiting for the connection */ |
ipcarg_t arg2; /**< Second argument */ |
ipcarg_t arg3; /**< Third argument */ |
} pending_conn_t; |
static link_t pending_conn; |
int service_init(void) |
{ |
if (!hash_table_create(&service_hash_table, SERVICE_HASH_TABLE_CHAINS, |
3, &service_hash_table_ops)) { |
printf(NAME ": No memory available for services\n"); |
return ENOMEM; |
} |
list_initialize(&pending_conn); |
return EOK; |
} |
/** Process pending connection requests */ |
void process_pending_conn(void) |
{ |
link_t *cur; |
loop: |
for (cur = pending_conn.next; cur != &pending_conn; cur = cur->next) { |
pending_conn_t *pr = list_get_instance(cur, pending_conn_t, link); |
unsigned long keys[3] = { |
pr->service, |
0, |
0 |
}; |
link_t *link = hash_table_find(&service_hash_table, keys); |
if (!link) |
continue; |
hashed_service_t *hs = hash_table_get_instance(link, hashed_service_t, link); |
ipcarg_t retval = ipc_forward_fast(pr->callid, hs->phone, |
pr->arg2, pr->arg3, 0, IPC_FF_NONE); |
if (!(pr->callid & IPC_CALLID_NOTIFICATION)) |
ipc_answer_0(pr->callid, retval); |
list_remove(cur); |
free(pr); |
goto loop; |
} |
} |
/** Register service. |
* |
* @param service Service to be registered. |
* @param phone Phone to be used for connections to the service. |
* @param call Pointer to call structure. |
* |
* @return Zero on success or a value from @ref errno.h. |
* |
*/ |
int register_service(ipcarg_t service, ipcarg_t phone, ipc_call_t *call) |
{ |
unsigned long keys[3] = { |
service, |
call->in_phone_hash, |
0 |
}; |
if (hash_table_find(&service_hash_table, keys)) |
return EEXISTS; |
hashed_service_t *hs = (hashed_service_t *) malloc(sizeof(hashed_service_t)); |
if (!hs) |
return ENOMEM; |
link_initialize(&hs->link); |
hs->service = service; |
hs->phone = phone; |
hs->in_phone_hash = call->in_phone_hash; |
hash_table_insert(&service_hash_table, keys, &hs->link); |
return 0; |
} |
/** Connect client to service. |
* |
* @param service Service to be connected to. |
* @param call Pointer to call structure. |
* @param callid Call ID of the request. |
* |
* @return Zero on success or a value from @ref errno.h. |
* |
*/ |
void connect_to_service(ipcarg_t service, ipc_call_t *call, ipc_callid_t callid) |
{ |
ipcarg_t retval; |
unsigned long keys[3] = { |
service, |
0, |
0 |
}; |
link_t *link = hash_table_find(&service_hash_table, keys); |
if (!link) { |
if (IPC_GET_ARG4(*call) & IPC_FLAG_BLOCKING) { |
/* Blocking connection, add to pending list */ |
pending_conn_t *pr = |
(pending_conn_t *) malloc(sizeof(pending_conn_t)); |
if (!pr) { |
retval = ENOMEM; |
goto out; |
} |
pr->service = service; |
pr->callid = callid; |
pr->arg2 = IPC_GET_ARG2(*call); |
pr->arg3 = IPC_GET_ARG3(*call); |
list_append(&pr->link, &pending_conn); |
return; |
} |
retval = ENOENT; |
goto out; |
} |
hashed_service_t *hs = hash_table_get_instance(link, hashed_service_t, link); |
retval = ipc_forward_fast(callid, hs->phone, IPC_GET_ARG2(*call), |
IPC_GET_ARG3(*call), 0, IPC_FF_NONE); |
out: |
if (!(callid & IPC_CALLID_NOTIFICATION)) |
ipc_answer_0(callid, retval); |
} |
/** |
* @} |
*/ |
//branches/snapshot/uspace/srv/ns/task.c |
---|
0,0 → 1,269 |
/* |
* Copyright (c) 2009 Martin Decky |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup ns |
* @{ |
*/ |
#include <ipc/ipc.h> |
#include <adt/hash_table.h> |
#include <bool.h> |
#include <errno.h> |
#include <assert.h> |
#include <stdio.h> |
#include <macros.h> |
#include "task.h" |
#include "ns.h" |
#define TASK_HASH_TABLE_CHAINS 256 |
/* TODO: |
* |
* The current implementation of waiting on a task is not perfect. If somebody |
* wants to wait on a task which has already finished before the NS asked |
* the kernel to receive notifications, it would block indefinitively. |
* |
* A solution to this is to fail immediately on a task for which no creation |
* notification was received yet. However, there is a danger of a race condition |
* in this solution -- the caller has to make sure that it is not trying to wait |
* before the NS has a change to receive the task creation notification. This |
* can be assured by waiting for this event in task_spawn(). |
* |
* Finally, as there is currently no convention that each task has to be waited |
* for, the NS can leak memory because of the zombie tasks. |
* |
*/ |
/** Task hash table item. */ |
typedef struct { |
link_t link; |
task_id_t id; /**< Task ID. */ |
bool destroyed; |
} hashed_task_t; |
/** Compute hash index into task hash table. |
* |
* @param key Pointer keys. However, only the first key (i.e. truncated task |
* number) is used to compute the hash index. |
* |
* @return Hash index corresponding to key[0]. |
* |
*/ |
static hash_index_t task_hash(unsigned long *key) |
{ |
assert(key); |
return (LOWER32(*key) % TASK_HASH_TABLE_CHAINS); |
} |
/** Compare a key with hashed item. |
* |
* @param key Array of keys. |
* @param keys Must be lesser or equal to 2. |
* @param item Pointer to a hash table item. |
* |
* @return Non-zero if the key matches the item, zero otherwise. |
* |
*/ |
static int task_compare(unsigned long key[], hash_count_t keys, link_t *item) |
{ |
assert(key); |
assert(keys <= 2); |
assert(item); |
hashed_task_t *ht = hash_table_get_instance(item, hashed_task_t, link); |
if (keys == 2) |
return ((LOWER32(key[1]) == UPPER32(ht->id)) |
&& (LOWER32(key[0]) == LOWER32(ht->id))); |
else |
return (LOWER32(key[0]) == LOWER32(ht->id)); |
} |
/** Perform actions after removal of item from the hash table. |
* |
* @param item Item that was removed from the hash table. |
* |
*/ |
static void task_remove(link_t *item) |
{ |
assert(item); |
free(hash_table_get_instance(item, hashed_task_t, link)); |
} |
/** Operations for task hash table. */ |
static hash_table_operations_t task_hash_table_ops = { |
.hash = task_hash, |
.compare = task_compare, |
.remove_callback = task_remove |
}; |
/** Task hash table structure. */ |
static hash_table_t task_hash_table; |
/** Pending task wait structure. */ |
typedef struct { |
link_t link; |
task_id_t id; /**< Task ID. */ |
ipc_callid_t callid; /**< Call ID waiting for the connection */ |
} pending_wait_t; |
static link_t pending_wait; |
int task_init(void) |
{ |
if (!hash_table_create(&task_hash_table, TASK_HASH_TABLE_CHAINS, |
2, &task_hash_table_ops)) { |
printf(NAME ": No memory available for tasks\n"); |
return ENOMEM; |
} |
if (event_subscribe(EVENT_WAIT, 0) != EOK) |
printf(NAME ": Error registering wait notifications\n"); |
list_initialize(&pending_wait); |
return EOK; |
} |
/** Process pending wait requests */ |
void process_pending_wait(void) |
{ |
link_t *cur; |
loop: |
for (cur = pending_wait.next; cur != &pending_wait; cur = cur->next) { |
pending_wait_t *pr = list_get_instance(cur, pending_wait_t, link); |
unsigned long keys[2] = { |
LOWER32(pr->id), |
UPPER32(pr->id) |
}; |
link_t *link = hash_table_find(&task_hash_table, keys); |
if (!link) |
continue; |
hashed_task_t *ht = hash_table_get_instance(link, hashed_task_t, link); |
if (!ht->destroyed) |
continue; |
if (!(pr->callid & IPC_CALLID_NOTIFICATION)) |
ipc_answer_0(pr->callid, EOK); |
hash_table_remove(&task_hash_table, keys, 2); |
list_remove(cur); |
free(pr); |
goto loop; |
} |
} |
static void fail_pending_wait(task_id_t id, int rc) |
{ |
link_t *cur; |
loop: |
for (cur = pending_wait.next; cur != &pending_wait; cur = cur->next) { |
pending_wait_t *pr = list_get_instance(cur, pending_wait_t, link); |
if (pr->id == id) { |
if (!(pr->callid & IPC_CALLID_NOTIFICATION)) |
ipc_answer_0(pr->callid, rc); |
list_remove(cur); |
free(pr); |
goto loop; |
} |
} |
} |
void wait_notification(wait_type_t et, task_id_t id) |
{ |
unsigned long keys[2] = { |
LOWER32(id), |
UPPER32(id) |
}; |
link_t *link = hash_table_find(&task_hash_table, keys); |
if (link == NULL) { |
hashed_task_t *ht = |
(hashed_task_t *) malloc(sizeof(hashed_task_t)); |
if (ht == NULL) { |
fail_pending_wait(id, ENOMEM); |
return; |
} |
link_initialize(&ht->link); |
ht->id = id; |
ht->destroyed = (et == TASK_CREATE) ? false : true; |
hash_table_insert(&task_hash_table, keys, &ht->link); |
} else { |
hashed_task_t *ht = |
hash_table_get_instance(link, hashed_task_t, link); |
ht->destroyed = (et == TASK_CREATE) ? false : true; |
} |
} |
void wait_for_task(task_id_t id, ipc_call_t *call, ipc_callid_t callid) |
{ |
ipcarg_t retval; |
unsigned long keys[2] = { |
LOWER32(id), |
UPPER32(id) |
}; |
link_t *link = hash_table_find(&task_hash_table, keys); |
hashed_task_t *ht = (link != NULL) ? |
hash_table_get_instance(link, hashed_task_t, link) : NULL; |
if ((ht == NULL) || (!ht->destroyed)) { |
/* Add to pending list */ |
pending_wait_t *pr = |
(pending_wait_t *) malloc(sizeof(pending_wait_t)); |
if (!pr) { |
retval = ENOMEM; |
goto out; |
} |
pr->id = id; |
pr->callid = callid; |
list_append(&pr->link, &pending_wait); |
return; |
} |
hash_table_remove(&task_hash_table, keys, 2); |
retval = EOK; |
out: |
if (!(callid & IPC_CALLID_NOTIFICATION)) |
ipc_answer_0(callid, retval); |
} |
/** |
* @} |
*/ |
//branches/snapshot/uspace/srv/ns/ns.c |
---|
0,0 → 1,188 |
/* |
* Copyright (c) 2006 Ondrej Palkovsky |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup ns |
* @{ |
*/ |
/** |
* @file ns.c |
* @brief Naming service for HelenOS IPC. |
*/ |
#include <ipc/ipc.h> |
#include <ipc/services.h> |
#include <ipc/ns.h> |
#include <unistd.h> |
#include <stdio.h> |
#include <errno.h> |
#include <as.h> |
#include <ddi.h> |
#include <event.h> |
#include <macros.h> |
#include <sysinfo.h> |
#include "ns.h" |
#include "service.h" |
#include "clonable.h" |
#include "task.h" |
static void *clockaddr = NULL; |
static void *klogaddr = NULL; |
static void get_as_area(ipc_callid_t callid, ipc_call_t *call, void *ph_addr, |
size_t pages, void **addr) |
{ |
if (ph_addr == NULL) { |
ipc_answer_0(callid, ENOENT); |
return; |
} |
if (*addr == NULL) { |
*addr = as_get_mappable_page(pages * PAGE_SIZE); |
if (*addr == NULL) { |
ipc_answer_0(callid, ENOENT); |
return; |
} |
if (physmem_map(ph_addr, *addr, pages, |
AS_AREA_READ | AS_AREA_CACHEABLE) != 0) { |
ipc_answer_0(callid, ENOENT); |
return; |
} |
} |
ipc_answer_2(callid, EOK, (ipcarg_t) *addr, AS_AREA_READ); |
} |
int main(int argc, char **argv) |
{ |
printf(NAME ": HelenOS IPC Naming Service\n"); |
int rc = service_init(); |
if (rc != EOK) |
return rc; |
rc = clonable_init(); |
if (rc != EOK) |
return rc; |
rc = task_init(); |
if (rc != EOK) |
return rc; |
printf(NAME ": Accepting connections\n"); |
while (true) { |
process_pending_conn(); |
process_pending_wait(); |
ipc_call_t call; |
ipc_callid_t callid = ipc_wait_for_call(&call); |
task_id_t id; |
ipcarg_t retval; |
if (callid & IPC_CALLID_NOTIFICATION) { |
id = (task_id_t) |
MERGE_LOUP32(IPC_GET_ARG2(call), IPC_GET_ARG3(call)); |
wait_notification((wait_type_t) IPC_GET_ARG1(call), id); |
continue; |
} |
switch (IPC_GET_METHOD(call)) { |
case IPC_M_SHARE_IN: |
switch (IPC_GET_ARG3(call)) { |
case SERVICE_MEM_REALTIME: |
get_as_area(callid, &call, |
(void *) sysinfo_value("clock.faddr"), |
1, &clockaddr); |
break; |
case SERVICE_MEM_KLOG: |
get_as_area(callid, &call, |
(void *) sysinfo_value("klog.faddr"), |
sysinfo_value("klog.pages"), &klogaddr); |
break; |
default: |
ipc_answer_0(callid, ENOENT); |
} |
continue; |
case IPC_M_PHONE_HUNGUP: |
retval = EOK; |
break; |
case IPC_M_CONNECT_TO_ME: |
/* |
* Server requests service registration. |
*/ |
if (service_clonable(IPC_GET_ARG1(call))) { |
register_clonable(IPC_GET_ARG1(call), |
IPC_GET_ARG5(call), &call, callid); |
continue; |
} else { |
retval = register_service(IPC_GET_ARG1(call), |
IPC_GET_ARG5(call), &call); |
} |
break; |
case IPC_M_CONNECT_ME_TO: |
/* |
* Client requests to be connected to a service. |
*/ |
if (service_clonable(IPC_GET_ARG1(call))) { |
connect_to_clonable(IPC_GET_ARG1(call), |
&call, callid); |
continue; |
} else { |
connect_to_service(IPC_GET_ARG1(call), &call, |
callid); |
continue; |
} |
break; |
case NS_PING: |
retval = EOK; |
break; |
case NS_TASK_WAIT: |
id = (task_id_t) |
MERGE_LOUP32(IPC_GET_ARG1(call), IPC_GET_ARG2(call)); |
wait_for_task(id, &call, callid); |
continue; |
default: |
retval = ENOENT; |
break; |
} |
if (!(callid & IPC_CALLID_NOTIFICATION)) |
ipc_answer_0(callid, retval); |
} |
/* Not reached */ |
return 0; |
} |
/** |
* @} |
*/ |
//branches/snapshot/uspace/srv/ns/clonable.h |
---|
0,0 → 1,51 |
/* |
* Copyright (c) 2009 Martin Decky |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup ns |
* @{ |
*/ |
#ifndef NS_CLONABLE_H__ |
#define NS_CLONABLE_H__ |
#include <ipc/ipc.h> |
#include <bool.h> |
extern int clonable_init(void); |
extern bool service_clonable(int service); |
extern void register_clonable(ipcarg_t service, ipcarg_t phone, |
ipc_call_t *call, ipc_callid_t callid); |
extern void connect_to_clonable(ipcarg_t service, ipc_call_t *call, |
ipc_callid_t callid); |
#endif |
/** |
* @} |
*/ |
//branches/snapshot/uspace/srv/ns/ns.h |
---|
0,0 → 1,42 |
/* |
* Copyright (c) 2009 Martin Decky |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup ns |
* @{ |
*/ |
#ifndef NS_NS_H__ |
#define NS_NS_H__ |
#define NAME "ns" |
#endif |
/** |
* @} |
*/ |
//branches/snapshot/uspace/srv/ns/service.h |
---|
0,0 → 1,49 |
/* |
* Copyright (c) 2009 Martin Decky |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup ns |
* @{ |
*/ |
#ifndef NS_SERVICE_H__ |
#define NS_SERVICE_H__ |
#include <ipc/ipc.h> |
extern int service_init(void); |
extern void process_pending_conn(void); |
extern int register_service(ipcarg_t service, ipcarg_t phone, ipc_call_t *call); |
extern void connect_to_service(ipcarg_t service, ipc_call_t *call, |
ipc_callid_t callid); |
#endif |
/** |
* @} |
*/ |
//branches/snapshot/uspace/srv/ns/task.h |
---|
0,0 → 1,49 |
/* |
* Copyright (c) 2009 Martin Decky |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup ns |
* @{ |
*/ |
#ifndef NS_TASK_H__ |
#define NS_TASK_H__ |
#include <ipc/ipc.h> |
#include <event.h> |
extern int task_init(void); |
extern void process_pending_wait(void); |
extern void wait_notification(wait_type_t et, task_id_t id); |
extern void wait_for_task(task_id_t id, ipc_call_t *call, ipc_callid_t callid); |
#endif |
/** |
* @} |
*/ |
//branches/snapshot/uspace/srv/ns/Makefile |
---|
0,0 → 1,78 |
# |
# Copyright (c) 2005 Martin Decky |
# All rights reserved. |
# |
# Redistribution and use in source and binary forms, with or without |
# modification, are permitted provided that the following conditions |
# are met: |
# |
# - Redistributions of source code must retain the above copyright |
# notice, this list of conditions and the following disclaimer. |
# - 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. |
# - The name of the author may not be used to endorse or promote products |
# derived from this software without specific prior written permission. |
# |
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
# |
## Setup toolchain |
# |
LIBC_PREFIX = ../../lib/libc |
SOFTINT_PREFIX = ../../lib/softint |
include $(LIBC_PREFIX)/Makefile.toolchain |
LIBS = $(LIBC_PREFIX)/libc.a |
## Sources |
# |
OUTPUT = ns |
SOURCES = \ |
ns.c \ |
service.c \ |
clonable.c \ |
task.c |
OBJECTS := $(addsuffix .o,$(basename $(SOURCES))) |
.PHONY: all clean depend disasm |
all: $(OUTPUT) $(OUTPUT).disasm |
-include Makefile.depend |
clean: |
-rm -f $(OUTPUT) $(OUTPUT).map $(OUTPUT).disasm Makefile.depend $(OBJECTS) |
depend: |
$(CC) $(DEFS) $(CFLAGS) -M $(SOURCES) > Makefile.depend |
$(OUTPUT): $(OBJECTS) $(LIBS) |
$(LD) -T $(LIBC_PREFIX)/arch/$(UARCH)/_link.ld $(OBJECTS) $(LIBS) $(LFLAGS) -o $@ -Map $(OUTPUT).map |
disasm: $(OUTPUT).disasm |
$(OUTPUT).disasm: $(OUTPUT) |
$(OBJDUMP) -d $< > $@ |
%.o: %.S |
$(CC) $(DEFS) $(AFLAGS) $(CFLAGS) -D__ASM__ -c $< -o $@ |
%.o: %.s |
$(AS) $(AFLAGS) $< -o $@ |
%.o: %.c |
$(CC) $(DEFS) $(CFLAGS) -c $< -o $@ |
//branches/snapshot/uspace/srv/cir/fhc/Makefile |
---|
0,0 → 1,76 |
# |
# Copyright (c) 2006 Martin Decky |
# All rights reserved. |
# |
# Redistribution and use in source and binary forms, with or without |
# modification, are permitted provided that the following conditions |
# are met: |
# |
# - Redistributions of source code must retain the above copyright |
# notice, this list of conditions and the following disclaimer. |
# - 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. |
# - The name of the author may not be used to endorse or promote products |
# derived from this software without specific prior written permission. |
# |
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
# |
## Setup toolchain |
# |
LIBC_PREFIX = ../../../lib/libc |
SOFTINT_PREFIX = ../../../lib/softint |
include $(LIBC_PREFIX)/Makefile.toolchain |
LIBS = $(LIBC_PREFIX)/libc.a |
## Sources |
# |
OUTPUT = fhc |
SOURCES = \ |
fhc.c |
OBJECTS := $(addsuffix .o,$(basename $(SOURCES))) |
.PHONY: all clean depend disasm |
all: $(OUTPUT) $(OUTPUT).disasm |
-include Makefile.depend |
clean: |
-rm -f $(OUTPUT) $(OUTPUT).map $(OUTPUT).disasm Makefile.depend $(OBJECTS) |
depend: |
$(CC) $(DEFS) $(CFLAGS) -M $(SOURCES) > Makefile.depend |
$(OUTPUT): $(OBJECTS) $(LIBS) |
$(LD) -T $(LIBC_PREFIX)/arch/$(UARCH)/_link.ld $(OBJECTS) $(LIBS) $(LFLAGS) -o $@ -Map $(OUTPUT).map |
disasm: $(OUTPUT).disasm |
$(OUTPUT).disasm: $(OUTPUT) |
$(OBJDUMP) -d $< > $@ |
%.o: %.S |
$(CC) $(DEFS) $(AFLAGS) $(CFLAGS) -D__ASM__ -c $< -o $@ |
%.o: %.s |
$(AS) $(AFLAGS) $< -o $@ |
%.o: %.c |
$(CC) $(DEFS) $(CFLAGS) -c $< -o $@ |
//branches/snapshot/uspace/srv/cir/fhc/fhc.c |
---|
0,0 → 1,157 |
/* |
* Copyright (c) 2009 Jakub Jermar |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup fhc |
* @{ |
*/ |
/** |
* @file fhc.c |
* @brief FHC bus controller driver. |
*/ |
#include <ipc/ipc.h> |
#include <ipc/services.h> |
#include <ipc/bus.h> |
#include <ipc/ns.h> |
#include <sysinfo.h> |
#include <as.h> |
#include <ddi.h> |
#include <align.h> |
#include <bool.h> |
#include <errno.h> |
#include <async.h> |
#include <align.h> |
#include <async.h> |
#include <stdio.h> |
#include <ipc/devmap.h> |
#define NAME "fhc" |
#define FHC_UART_INR 0x39 |
#define FHC_UART_IMAP 0x0 |
#define FHC_UART_ICLR 0x4 |
static void *fhc_uart_phys; |
static volatile uint32_t *fhc_uart_virt; |
static size_t fhc_uart_size; |
/** Handle one connection to fhc. |
* |
* @param iid Hash of the request that opened the connection. |
* @param icall Call data of the request that opened the connection. |
*/ |
static void fhc_connection(ipc_callid_t iid, ipc_call_t *icall) |
{ |
ipc_callid_t callid; |
ipc_call_t call; |
/* |
* Answer the first IPC_M_CONNECT_ME_TO call. |
*/ |
ipc_answer_0(iid, EOK); |
while (1) { |
int inr; |
callid = async_get_call(&call); |
switch (IPC_GET_METHOD(call)) { |
case BUS_CLEAR_INTERRUPT: |
inr = IPC_GET_ARG1(call); |
switch (inr) { |
case FHC_UART_INR: |
fhc_uart_virt[FHC_UART_ICLR] = 0; |
ipc_answer_0(callid, EOK); |
break; |
default: |
ipc_answer_0(callid, ENOTSUP); |
break; |
} |
break; |
default: |
ipc_answer_0(callid, EINVAL); |
break; |
} |
} |
} |
/** Initialize the FHC driver. |
* |
* So far, the driver heavily depends on information provided by the kernel via |
* sysinfo. In the future, there should be a standalone FHC driver. |
*/ |
static bool fhc_init(void) |
{ |
ipcarg_t phonead; |
fhc_uart_size = sysinfo_value("fhc.uart.size"); |
fhc_uart_phys = (void *) sysinfo_value("fhc.uart.physical"); |
if (!fhc_uart_size) { |
printf(NAME ": no FHC UART registers found\n"); |
return false; |
} |
fhc_uart_virt = as_get_mappable_page(fhc_uart_size); |
int flags = AS_AREA_READ | AS_AREA_WRITE; |
int retval = physmem_map(fhc_uart_phys, (void *) fhc_uart_virt, |
ALIGN_UP(fhc_uart_size, PAGE_SIZE) >> PAGE_WIDTH, flags); |
if (retval < 0) { |
printf(NAME ": Error mapping FHC UART registers\n"); |
return false; |
} |
printf(NAME ": FHC UART registers at %p, %d bytes\n", fhc_uart_phys, |
fhc_uart_size); |
async_set_client_connection(fhc_connection); |
ipc_connect_to_me(PHONE_NS, SERVICE_FHC, 0, 0, &phonead); |
return true; |
} |
int main(int argc, char **argv) |
{ |
printf(NAME ": HelenOS FHC bus controller driver\n"); |
if (!fhc_init()) |
return -1; |
printf(NAME ": Accepting connections\n"); |
async_manager(); |
/* Never reached */ |
return 0; |
} |
/** |
* @} |
*/ |
//branches/snapshot/uspace/srv/cir/obio/Makefile |
---|
0,0 → 1,76 |
# |
# Copyright (c) 2006 Martin Decky |
# All rights reserved. |
# |
# Redistribution and use in source and binary forms, with or without |
# modification, are permitted provided that the following conditions |
# are met: |
# |
# - Redistributions of source code must retain the above copyright |
# notice, this list of conditions and the following disclaimer. |
# - 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. |
# - The name of the author may not be used to endorse or promote products |
# derived from this software without specific prior written permission. |
# |
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
# |
## Setup toolchain |
# |
LIBC_PREFIX = ../../../lib/libc |
SOFTINT_PREFIX = ../../../lib/softint |
include $(LIBC_PREFIX)/Makefile.toolchain |
LIBS = $(LIBC_PREFIX)/libc.a |
## Sources |
# |
OUTPUT = obio |
SOURCES = \ |
obio.c |
OBJECTS := $(addsuffix .o,$(basename $(SOURCES))) |
.PHONY: all clean depend disasm |
all: $(OUTPUT) $(OUTPUT).disasm |
-include Makefile.depend |
clean: |
-rm -f $(OUTPUT) $(OUTPUT).map $(OUTPUT).disasm Makefile.depend $(OBJECTS) |
depend: |
$(CC) $(DEFS) $(CFLAGS) -M $(SOURCES) > Makefile.depend |
$(OUTPUT): $(OBJECTS) $(LIBS) |
$(LD) -T $(LIBC_PREFIX)/arch/$(UARCH)/_link.ld $(OBJECTS) $(LIBS) $(LFLAGS) -o $@ -Map $(OUTPUT).map |
disasm: $(OUTPUT).disasm |
$(OUTPUT).disasm: $(OUTPUT) |
$(OBJDUMP) -d $< > $@ |
%.o: %.S |
$(CC) $(DEFS) $(AFLAGS) $(CFLAGS) -D__ASM__ -c $< -o $@ |
%.o: %.s |
$(AS) $(AFLAGS) $< -o $@ |
%.o: %.c |
$(CC) $(DEFS) $(CFLAGS) -c $< -o $@ |
//branches/snapshot/uspace/srv/cir/obio/obio.c |
---|
0,0 → 1,158 |
/* |
* Copyright (c) 2009 Jakub Jermar |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup obio |
* @{ |
*/ |
/** |
* @file obio.c |
* @brief OBIO driver. |
* |
* OBIO is a short for on-board I/O. On UltraSPARC IIi and systems with U2P, |
* there is a piece of the root PCI bus controller address space, which |
* contains interrupt mapping and clear registers for all on-board devices. |
* Although UltraSPARC IIi and U2P are different in general, these registers can |
* be found at the same addresses. |
*/ |
#include <ipc/ipc.h> |
#include <ipc/services.h> |
#include <ipc/bus.h> |
#include <ipc/ns.h> |
#include <sysinfo.h> |
#include <as.h> |
#include <ddi.h> |
#include <align.h> |
#include <bool.h> |
#include <errno.h> |
#include <async.h> |
#include <align.h> |
#include <async.h> |
#include <stdio.h> |
#include <ipc/devmap.h> |
#define NAME "obio" |
#define OBIO_SIZE 0x1898 |
#define OBIO_IMR_BASE 0x200 |
#define OBIO_IMR(ino) (OBIO_IMR_BASE + ((ino) & INO_MASK)) |
#define OBIO_CIR_BASE 0x300 |
#define OBIO_CIR(ino) (OBIO_CIR_BASE + ((ino) & INO_MASK)) |
#define INO_MASK 0x1f |
static void *base_phys; |
static volatile uint64_t *base_virt; |
/** Handle one connection to obio. |
* |
* @param iid Hash of the request that opened the connection. |
* @param icall Call data of the request that opened the connection. |
*/ |
static void obio_connection(ipc_callid_t iid, ipc_call_t *icall) |
{ |
ipc_callid_t callid; |
ipc_call_t call; |
/* |
* Answer the first IPC_M_CONNECT_ME_TO call. |
*/ |
ipc_answer_0(iid, EOK); |
while (1) { |
int inr; |
callid = async_get_call(&call); |
switch (IPC_GET_METHOD(call)) { |
case BUS_CLEAR_INTERRUPT: |
inr = IPC_GET_ARG1(call); |
base_virt[OBIO_CIR(inr & INO_MASK)] = 0; |
ipc_answer_0(callid, EOK); |
break; |
default: |
ipc_answer_0(callid, EINVAL); |
break; |
} |
} |
} |
/** Initialize the OBIO driver. |
* |
* So far, the driver heavily depends on information provided by the kernel via |
* sysinfo. In the future, there should be a standalone OBIO driver. |
*/ |
static bool obio_init(void) |
{ |
ipcarg_t phonead; |
base_phys = (void *) sysinfo_value("obio.base.physical"); |
if (!base_phys) { |
printf(NAME ": no OBIO registers found\n"); |
return false; |
} |
base_virt = as_get_mappable_page(OBIO_SIZE); |
int flags = AS_AREA_READ | AS_AREA_WRITE; |
int retval = physmem_map(base_phys, (void *) base_virt, |
ALIGN_UP(OBIO_SIZE, PAGE_SIZE) >> PAGE_WIDTH, flags); |
if (retval < 0) { |
printf(NAME ": Error mapping OBIO registers\n"); |
return false; |
} |
printf(NAME ": OBIO registers with base at %p\n", base_phys); |
async_set_client_connection(obio_connection); |
ipc_connect_to_me(PHONE_NS, SERVICE_OBIO, 0, 0, &phonead); |
return true; |
} |
int main(int argc, char **argv) |
{ |
printf(NAME ": HelenOS OBIO driver\n"); |
if (!obio_init()) |
return -1; |
printf(NAME ": Accepting connections\n"); |
async_manager(); |
/* Never reached */ |
return 0; |
} |
/** |
* @} |
*/ |
Property changes: |
Added: svn:mergeinfo |
//branches/snapshot/uspace/srv/cir/obio |
---|
Property changes: |
Added: svn:mergeinfo |
//branches/snapshot/uspace/srv/pci/libpci/names.c |
---|
0,0 → 1,456 |
/* |
* The PCI Library -- ID to Name Translation |
* |
* Copyright (c) 1997--2005 Martin Mares <mj@ucw.cz> |
* |
* May 8, 2006 - Modified and ported to HelenOS by Jakub Jermar. |
* |
* Can be freely distributed and used under the terms of the GNU GPL. |
*/ |
#include <stdio.h> |
#include <stdlib.h> |
#include <stdarg.h> |
#include <string.h> |
#include <errno.h> |
#include "internal.h" |
#include "pci_ids.h" |
struct id_entry { |
struct id_entry *next; |
u32 id12, id34; |
byte cat; |
byte name[1]; |
}; |
enum id_entry_type { |
ID_UNKNOWN, |
ID_VENDOR, |
ID_DEVICE, |
ID_SUBSYSTEM, |
ID_GEN_SUBSYSTEM, |
ID_CLASS, |
ID_SUBCLASS, |
ID_PROGIF |
}; |
struct id_bucket { |
struct id_bucket *next; |
unsigned int full; |
}; |
#define MAX_LINE 1024 |
#define BUCKET_SIZE 8192 |
#define HASH_SIZE 4099 |
#ifdef __GNUC__ |
#define BUCKET_ALIGNMENT __alignof__(struct id_bucket) |
#else |
union id_align { |
struct id_bucket *next; |
unsigned int full; |
}; |
#define BUCKET_ALIGNMENT sizeof(union id_align) |
#endif |
#define BUCKET_ALIGN(n) ((n)+BUCKET_ALIGNMENT-(n)%BUCKET_ALIGNMENT) |
static void *id_alloc(struct pci_access *a, unsigned int size) |
{ |
struct id_bucket *buck = a->current_id_bucket; |
unsigned int pos; |
if (!buck || buck->full + size > BUCKET_SIZE) { |
buck = pci_malloc(a, BUCKET_SIZE); |
buck->next = a->current_id_bucket; |
a->current_id_bucket = buck; |
buck->full = BUCKET_ALIGN(sizeof(struct id_bucket)); |
} |
pos = buck->full; |
buck->full = BUCKET_ALIGN(buck->full + size); |
return (byte *) buck + pos; |
} |
static inline u32 id_pair(unsigned int x, unsigned int y) |
{ |
return ((x << 16) | y); |
} |
static inline unsigned int id_hash(int cat, u32 id12, u32 id34) |
{ |
unsigned int h; |
h = id12 ^ (id34 << 3) ^ (cat << 5); |
return h % HASH_SIZE; |
} |
static struct id_entry *id_lookup(struct pci_access *a, int cat, int id1, |
int id2, int id3, int id4) |
{ |
struct id_entry *n; |
u32 id12 = id_pair(id1, id2); |
u32 id34 = id_pair(id3, id4); |
n = a->id_hash[id_hash(cat, id12, id34)]; |
while (n && (n->id12 != id12 || n->id34 != id34 || n->cat != cat)) |
n = n->next; |
return n; |
} |
static int id_insert(struct pci_access *a, int cat, int id1, int id2, |
int id3, int id4, byte * text) |
{ |
u32 id12 = id_pair(id1, id2); |
u32 id34 = id_pair(id3, id4); |
unsigned int h = id_hash(cat, id12, id34); |
struct id_entry *n = a->id_hash[h]; |
int len = str_size((char *) text); |
while (n && (n->id12 != id12 || n->id34 != id34 || n->cat != cat)) |
n = n->next; |
if (n) |
return 1; |
n = id_alloc(a, sizeof(struct id_entry) + len); |
n->id12 = id12; |
n->id34 = id34; |
n->cat = cat; |
memcpy(n->name, text, len + 1); |
n->next = a->id_hash[h]; |
a->id_hash[h] = n; |
return 0; |
} |
static int id_hex(byte * p, int cnt) |
{ |
int x = 0; |
while (cnt--) { |
x <<= 4; |
if (*p >= '0' && *p <= '9') |
x += (*p - '0'); |
else if (*p >= 'a' && *p <= 'f') |
x += (*p - 'a' + 10); |
else if (*p >= 'A' && *p <= 'F') |
x += (*p - 'A' + 10); |
else |
return -1; |
p++; |
} |
return x; |
} |
static inline int id_white_p(int c) |
{ |
return (c == ' ') || (c == '\t'); |
} |
static const char *id_parse_list(struct pci_access *a, int *lino) |
{ |
byte *line; |
byte *p; |
int id1 = 0, id2 = 0, id3 = 0, id4 = 0; |
int cat = -1; |
int nest; |
static const char parse_error[] = "Parse error"; |
int i; |
*lino = 0; |
for (i = 0; i < sizeof(pci_ids) / sizeof(char *); i++) { |
line = (byte *) pci_ids[i]; |
(*lino)++; |
p = line; |
while (*p) |
p++; |
if (p > line && (p[-1] == ' ' || p[-1] == '\t')) |
*--p = 0; |
p = line; |
while (id_white_p(*p)) |
p++; |
if (!*p || *p == '#') |
continue; |
p = line; |
while (*p == '\t') |
p++; |
nest = p - line; |
if (!nest) { /* Top-level entries */ |
if (p[0] == 'C' && p[1] == ' ') { /* Class block */ |
if ((id1 = id_hex(p + 2, 2)) < 0 || !id_white_p(p[4])) |
return parse_error; |
cat = ID_CLASS; |
p += 5; |
} else if (p[0] == 'S' && p[1] == ' ') { /* Generic subsystem block */ |
if ((id1 = id_hex(p + 2, 4)) < 0 || p[6]) |
return parse_error; |
if (!id_lookup(a, ID_VENDOR, id1, 0, 0, 0)) |
return "Vendor does not exist"; |
cat = ID_GEN_SUBSYSTEM; |
continue; |
} else if (p[0] >= 'A' && p[0] <= 'Z' && p[1] == ' ') { /* Unrecognized block (RFU) */ |
cat = ID_UNKNOWN; |
continue; |
} else { /* Vendor ID */ |
if ((id1 = id_hex(p, 4)) < 0 || !id_white_p(p[4])) |
return parse_error; |
cat = ID_VENDOR; |
p += 5; |
} |
id2 = id3 = id4 = 0; |
} else if (cat == ID_UNKNOWN) /* Nested entries in RFU blocks are skipped */ |
continue; |
else if (nest == 1) /* Nesting level 1 */ |
switch (cat) { |
case ID_VENDOR: |
case ID_DEVICE: |
case ID_SUBSYSTEM: |
if ((id2 = id_hex(p, 4)) < 0 || !id_white_p(p[4])) |
return parse_error; |
p += 5; |
cat = ID_DEVICE; |
id3 = id4 = 0; |
break; |
case ID_GEN_SUBSYSTEM: |
if ((id2 = id_hex(p, 4)) < 0 || !id_white_p(p[4])) |
return parse_error; |
p += 5; |
id3 = id4 = 0; |
break; |
case ID_CLASS: |
case ID_SUBCLASS: |
case ID_PROGIF: |
if ((id2 = id_hex(p, 2)) < 0 || !id_white_p(p[2])) |
return parse_error; |
p += 3; |
cat = ID_SUBCLASS; |
id3 = id4 = 0; |
break; |
default: |
return parse_error; |
} else if (nest == 2) /* Nesting level 2 */ |
switch (cat) { |
case ID_DEVICE: |
case ID_SUBSYSTEM: |
if ((id3 = id_hex(p, 4)) < 0 || !id_white_p(p[4]) |
|| (id4 = id_hex(p + 5, 4)) < 0 || !id_white_p(p[9])) |
return parse_error; |
p += 10; |
cat = ID_SUBSYSTEM; |
break; |
case ID_CLASS: |
case ID_SUBCLASS: |
case ID_PROGIF: |
if ((id3 = id_hex(p, 2)) < 0 || !id_white_p(p[2])) |
return parse_error; |
p += 3; |
cat = ID_PROGIF; |
id4 = 0; |
break; |
default: |
return parse_error; |
} else /* Nesting level 3 or more */ |
return parse_error; |
while (id_white_p(*p)) |
p++; |
if (!*p) |
return parse_error; |
if (id_insert(a, cat, id1, id2, id3, id4, p)) |
return "Duplicate entry"; |
} |
return NULL; |
} |
int pci_load_name_list(struct pci_access *a) |
{ |
int lino; |
const char *err; |
pci_free_name_list(a); |
a->id_hash = pci_malloc(a, sizeof(struct id_entry *) * HASH_SIZE); |
bzero(a->id_hash, sizeof(struct id_entry *) * HASH_SIZE); |
err = id_parse_list(a, &lino); |
if (err) |
a->error("%s at %s, element %d\n", err, "pci_ids.h", lino); |
return 1; |
} |
void pci_free_name_list(struct pci_access *a) |
{ |
pci_mfree(a->id_hash); |
a->id_hash = NULL; |
while (a->current_id_bucket) { |
struct id_bucket *buck = a->current_id_bucket; |
a->current_id_bucket = buck->next; |
pci_mfree(buck); |
} |
} |
static struct id_entry *id_lookup_subsys(struct pci_access *a, int iv, |
int id, int isv, int isd) |
{ |
struct id_entry *d = NULL; |
if (iv > 0 && id > 0) /* Per-device lookup */ |
d = id_lookup(a, ID_SUBSYSTEM, iv, id, isv, isd); |
if (!d) /* Generic lookup */ |
d = id_lookup(a, ID_GEN_SUBSYSTEM, isv, isd, 0, 0); |
if (!d && iv == isv && id == isd) /* Check for subsystem == device */ |
d = id_lookup(a, ID_DEVICE, iv, id, 0, 0); |
return d; |
} |
char *pci_lookup_name(struct pci_access *a, char *buf, int size, int flags, |
...) |
{ |
va_list args; |
int num, res, synth; |
struct id_entry *v, *d, *cls, *pif; |
int iv, id, isv, isd, icls, ipif; |
va_start(args, flags); |
num = 0; |
if ((flags & PCI_LOOKUP_NUMERIC) || a->numeric_ids) { |
flags &= ~PCI_LOOKUP_NUMERIC; |
num = 1; |
} else if (!a->id_hash) { |
if (!pci_load_name_list(a)) |
num = a->numeric_ids = 1; |
} |
if (flags & PCI_LOOKUP_NO_NUMBERS) { |
flags &= ~PCI_LOOKUP_NO_NUMBERS; |
synth = 0; |
if (num) |
return NULL; |
} else |
synth = 1; |
switch (flags) { |
case PCI_LOOKUP_VENDOR: |
iv = va_arg(args, int); |
if (num) |
res = snprintf(buf, size, "%04x", iv); |
else if (v = id_lookup(a, ID_VENDOR, iv, 0, 0, 0)) |
return (char *) v->name; |
else |
res = snprintf(buf, size, "Unknown vendor %04x", iv); |
break; |
case PCI_LOOKUP_DEVICE: |
iv = va_arg(args, int); |
id = va_arg(args, int); |
if (num) |
res = snprintf(buf, size, "%04x", id); |
else if (d = id_lookup(a, ID_DEVICE, iv, id, 0, 0)) |
return (char *) d->name; |
else if (synth) |
res = snprintf(buf, size, "Unknown device %04x", id); |
else |
return NULL; |
break; |
case PCI_LOOKUP_VENDOR | PCI_LOOKUP_DEVICE: |
iv = va_arg(args, int); |
id = va_arg(args, int); |
if (num) |
res = snprintf(buf, size, "%04x:%04x", iv, id); |
else { |
v = id_lookup(a, ID_VENDOR, iv, 0, 0, 0); |
d = id_lookup(a, ID_DEVICE, iv, id, 0, 0); |
if (v && d) |
res = snprintf(buf, size, "%s %s", v->name, |
d->name); |
else if (!synth) |
return NULL; |
else if (!v) |
res = snprintf(buf, size, "Unknown device %04x:%04x", iv, id); |
else /* !d */ |
res = snprintf(buf, size, "%s Unknown device %04x", v->name, id); |
} |
break; |
case PCI_LOOKUP_SUBSYSTEM | PCI_LOOKUP_VENDOR: |
isv = va_arg(args, int); |
if (num) |
res = snprintf(buf, size, "%04x", isv); |
else if (v = id_lookup(a, ID_VENDOR, isv, 0, 0, 0)) |
return (char *) v->name; |
else if (synth) |
res = snprintf(buf, size, "Unknown vendor %04x", isv); |
else |
return NULL; |
break; |
case PCI_LOOKUP_SUBSYSTEM | PCI_LOOKUP_DEVICE: |
iv = va_arg(args, int); |
id = va_arg(args, int); |
isv = va_arg(args, int); |
isd = va_arg(args, int); |
if (num) |
res = snprintf(buf, size, "%04x", isd); |
else if (d = id_lookup_subsys(a, iv, id, isv, isd)) |
return (char *) d->name; |
else if (synth) |
res = snprintf(buf, size, "Unknown device %04x", isd); |
else |
return NULL; |
break; |
case PCI_LOOKUP_VENDOR | PCI_LOOKUP_DEVICE | PCI_LOOKUP_SUBSYSTEM: |
iv = va_arg(args, int); |
id = va_arg(args, int); |
isv = va_arg(args, int); |
isd = va_arg(args, int); |
if (num) |
res = snprintf(buf, size, "%04x:%04x", isv, isd); |
else { |
v = id_lookup(a, ID_VENDOR, isv, 0, 0, 0); |
d = id_lookup_subsys(a, iv, id, isv, isd); |
if (v && d) |
res = snprintf(buf, size, "%s %s", v->name, d->name); |
else if (!synth) |
return NULL; |
else if (!v) |
res = snprintf(buf, size, "Unknown device %04x:%04x", isv, isd); |
else /* !d */ |
res = snprintf(buf, size, "%s Unknown device %04x", v->name, isd); |
} |
break; |
case PCI_LOOKUP_CLASS: |
icls = va_arg(args, int); |
if (num) |
res = snprintf(buf, size, "%04x", icls); |
else if (cls = id_lookup(a, ID_SUBCLASS, icls >> 8, icls & 0xff, 0, 0)) |
return (char *) cls->name; |
else if (cls = id_lookup(a, ID_CLASS, icls, 0, 0, 0)) |
res = snprintf(buf, size, "%s [%04x]", cls->name, icls); |
else if (synth) |
res = snprintf(buf, size, "Class %04x", icls); |
else |
return NULL; |
break; |
case PCI_LOOKUP_PROGIF: |
icls = va_arg(args, int); |
ipif = va_arg(args, int); |
if (num) |
res = snprintf(buf, size, "%02x", ipif); |
else if (pif = id_lookup(a, ID_PROGIF, icls >> 8, icls & 0xff, ipif, 0)) |
return (char *) pif->name; |
else if (icls == 0x0101 && !(ipif & 0x70)) { |
/* IDE controllers have complex prog-if semantics */ |
res = snprintf(buf, size, "%s%s%s%s%s", |
(ipif & 0x80) ? "Master " : "", |
(ipif & 0x08) ? "SecP " : "", |
(ipif & 0x04) ? "SecO " : "", |
(ipif & 0x02) ? "PriP " : "", |
(ipif & 0x01) ? "PriO " : ""); |
if (res > 0 && res < size) |
buf[--res] = 0; |
} else if (synth) |
res = snprintf(buf, size, "ProgIf %02x", ipif); |
else |
return NULL; |
break; |
default: |
return "<pci_lookup_name: invalid request>"; |
} |
if (res < 0 || res >= size) |
return "<pci_lookup_name: buffer too small>"; |
else |
return buf; |
} |
//branches/snapshot/uspace/srv/pci/libpci/Makefile |
---|
0,0 → 1,29 |
# Makefile for The PCI Library |
# (c) 1999 Martin Mares <mj@ucw.cz> |
# Modified and ported to HelenOS by Jakub Jermar |
LIBC_PREFIX=$(shell cd ../../../lib/libc; pwd) |
include $(LIBC_PREFIX)/Makefile.toolchain |
LIBS = $(LIBC_PREFIX)/libc.a |
CFLAGS += -I$(LIBC_PREFIX)/include -trigraphs |
OBJS=access.o generic.o names.o |
INCL=internal.h pci.h header.h sysdep.h types.h pci_ids.h |
PCILIB=libpci.a |
OBJS += i386-ports.o |
all: $(PCILIB) |
$(PCILIB): $(OBJS) |
$(AR) rc $@ $(OBJS) |
%.o: %.c $(INCL) |
$(CC) $(CFLAGS) -c $< -o $@ |
clean: |
-rm *.o libpci.a |
//branches/snapshot/uspace/srv/pci/libpci/types.h |
---|
0,0 → 1,49 |
/* |
* The PCI Library -- Types and Format Strings |
* |
* Copyright (c) 1997--2005 Martin Mares <mj@ucw.cz> |
* |
* May 8, 2006 - Modified and ported to HelenOS by Jakub Jermar. |
* |
* Can be freely distributed and used under the terms of the GNU GPL. |
*/ |
#include <sys/types.h> |
#ifndef PCI_HAVE_Uxx_TYPES |
typedef uint8_t u8; |
typedef uint16_t u16; |
typedef uint32_t u32; |
#ifdef PCI_HAVE_64BIT_ADDRESS |
#include <limits.h> |
#if ULONG_MAX > 0xffffffff |
typedef unsigned long u64; |
#define PCI_U64_FMT "l" |
#else |
typedef unsigned long long u64; |
#define PCI_U64_FMT "ll" |
#endif |
#endif |
#endif /* PCI_HAVE_Uxx_TYPES */ |
#ifdef PCI_HAVE_64BIT_ADDRESS |
typedef u64 pciaddr_t; |
#define PCIADDR_T_FMT "%08" PCI_U64_FMT "x" |
#define PCIADDR_PORT_FMT "%04" PCI_U64_FMT "x" |
#else |
typedef u32 pciaddr_t; |
#define PCIADDR_T_FMT "%08x" |
#define PCIADDR_PORT_FMT "%04x" |
#endif |
#ifdef PCI_ARCH_SPARC64 |
/* On sparc64 Linux the kernel reports remapped port addresses and IRQ numbers */ |
#undef PCIADDR_PORT_FMT |
#define PCIADDR_PORT_FMT PCIADDR_T_FMT |
#define PCIIRQ_FMT "%08x" |
#else |
#define PCIIRQ_FMT "%d" |
#endif |
//branches/snapshot/uspace/srv/pci/libpci/pci.h |
---|
0,0 → 1,146 |
/* |
* The PCI Library |
* |
* Copyright (c) 1997--2005 Martin Mares <mj@ucw.cz> |
* |
* May 8, 2006 - Modified and ported to HelenOS by Jakub Jermar. |
* |
* Can be freely distributed and used under the terms of the GNU GPL. |
*/ |
#ifndef _PCI_LIB_H |
#define _PCI_LIB_H |
#include "header.h" |
#include "types.h" |
#define PCI_LIB_VERSION 0x020200 |
/* |
* PCI Access Structure |
*/ |
struct pci_methods; |
enum pci_access_type { |
/* Known access methods, remember to update access.c as well */ |
PCI_ACCESS_I386_TYPE1, /* i386 ports, type 1 (params: none) */ |
PCI_ACCESS_I386_TYPE2, /* i386 ports, type 2 (params: none) */ |
PCI_ACCESS_MAX |
}; |
struct pci_access { |
/* Options you can change: */ |
unsigned int method; /* Access method */ |
char *method_params[PCI_ACCESS_MAX]; /* Parameters for the methods */ |
int writeable; /* Open in read/write mode */ |
int buscentric; /* Bus-centric view of the world */ |
int numeric_ids; /* Don't resolve device IDs to names */ |
int debugging; /* Turn on debugging messages */ |
/* Functions you can override: */ |
void (*error) (char *msg, ...); /* Write error message and quit */ |
void (*warning) (char *msg, ...); /* Write a warning message */ |
void (*debug) (char *msg, ...); /* Write a debugging message */ |
struct pci_dev *devices; /* Devices found on this bus */ |
/* Fields used internally: */ |
struct pci_methods *methods; |
struct id_entry **id_hash; /* names.c */ |
struct id_bucket *current_id_bucket; |
}; |
/* Initialize PCI access */ |
struct pci_access *pci_alloc(void); |
void pci_init(struct pci_access *); |
void pci_cleanup(struct pci_access *); |
/* Scanning of devices */ |
void pci_scan_bus(struct pci_access *acc); |
struct pci_dev *pci_get_dev(struct pci_access *acc, int domain, int bus, int dev, int func); /* Raw access to specified device */ |
void pci_free_dev(struct pci_dev *); |
/* |
* Devices |
*/ |
struct pci_dev { |
struct pci_dev *next; /* Next device in the chain */ |
u16 domain; /* PCI domain (host bridge) */ |
u8 bus, dev, func; /* Bus inside domain, device and function */ |
/* These fields are set by pci_fill_info() */ |
int known_fields; /* Set of info fields already known */ |
u16 vendor_id, device_id; /* Identity of the device */ |
int irq; /* IRQ number */ |
pciaddr_t base_addr[6]; /* Base addresses */ |
pciaddr_t size[6]; /* Region sizes */ |
pciaddr_t rom_base_addr; /* Expansion ROM base address */ |
pciaddr_t rom_size; /* Expansion ROM size */ |
/* Fields used internally: */ |
struct pci_access *access; |
struct pci_methods *methods; |
u8 *cache; /* Cached config registers */ |
int cache_len; |
int hdrtype; /* Cached low 7 bits of header type, -1 if unknown */ |
void *aux; /* Auxillary data */ |
}; |
#define PCI_ADDR_IO_MASK (~(pciaddr_t) 0x3) |
#define PCI_ADDR_MEM_MASK (~(pciaddr_t) 0xf) |
u8 pci_read_byte(struct pci_dev *, int pos); /* Access to configuration space */ |
u16 pci_read_word(struct pci_dev *, int pos); |
u32 pci_read_long(struct pci_dev *, int pos); |
int pci_read_block(struct pci_dev *, int pos, u8 * buf, int len); |
int pci_write_byte(struct pci_dev *, int pos, u8 data); |
int pci_write_word(struct pci_dev *, int pos, u16 data); |
int pci_write_long(struct pci_dev *, int pos, u32 data); |
int pci_write_block(struct pci_dev *, int pos, u8 * buf, int len); |
int pci_fill_info(struct pci_dev *, int flags); /* Fill in device information */ |
#define PCI_FILL_IDENT 1 |
#define PCI_FILL_IRQ 2 |
#define PCI_FILL_BASES 4 |
#define PCI_FILL_ROM_BASE 8 |
#define PCI_FILL_SIZES 16 |
#define PCI_FILL_RESCAN 0x10000 |
void pci_setup_cache(struct pci_dev *, u8 * cache, int len); |
/* |
* Conversion of PCI ID's to names (according to the pci.ids file) |
* |
* Call pci_lookup_name() to identify different types of ID's: |
* |
* VENDOR (vendorID) -> vendor |
* DEVICE (vendorID, deviceID) -> device |
* VENDOR | DEVICE (vendorID, deviceID) -> combined vendor and device |
* SUBSYSTEM | VENDOR (subvendorID) -> subsystem vendor |
* SUBSYSTEM | DEVICE (vendorID, deviceID, subvendorID, subdevID) -> subsystem device |
* SUBSYSTEM | VENDOR | DEVICE (vendorID, deviceID, subvendorID, subdevID) -> combined subsystem v+d |
* SUBSYSTEM | ... (-1, -1, subvendorID, subdevID) -> generic subsystem |
* CLASS (classID) -> class |
* PROGIF (classID, progif) -> programming interface |
*/ |
char *pci_lookup_name(struct pci_access *a, char *buf, int size, int flags, |
...); |
int pci_load_name_list(struct pci_access *a); /* Called automatically by pci_lookup_*() when needed; returns success */ |
void pci_free_name_list(struct pci_access *a); /* Called automatically by pci_cleanup() */ |
enum pci_lookup_mode { |
PCI_LOOKUP_VENDOR = 1, /* Vendor name (args: vendorID) */ |
PCI_LOOKUP_DEVICE = 2, /* Device name (args: vendorID, deviceID) */ |
PCI_LOOKUP_CLASS = 4, /* Device class (args: classID) */ |
PCI_LOOKUP_SUBSYSTEM = 8, |
PCI_LOOKUP_PROGIF = 16, /* Programming interface (args: classID, prog_if) */ |
PCI_LOOKUP_NUMERIC = 0x10000, /* Want only formatted numbers; default if access->numeric_ids is set */ |
PCI_LOOKUP_NO_NUMBERS = 0x20000 /* Return NULL if not found in the database; default is to print numerically */ |
}; |
#endif |
//branches/snapshot/uspace/srv/pci/libpci/VERSION |
---|
0,0 → 1,2 |
This libpci has been ported from pciutils-2.2.3 |
on May 8, 2006 by Jakub Jermar. |
//branches/snapshot/uspace/srv/pci/libpci/i386-ports.c |
---|
0,0 → 1,274 |
/* |
* The PCI Library -- Direct Configuration access via i386 Ports |
* |
* Copyright (c) 1997--2004 Martin Mares <mj@ucw.cz> |
* |
* May 8, 2006 - Modified and ported to HelenOS by Jakub Jermar. |
* |
* Can be freely distributed and used under the terms of the GNU GPL. |
*/ |
#include <unistd.h> |
#include "internal.h" |
static inline void outb(u8 b, u16 port) |
{ |
asm volatile ("outb %0, %1\n" :: "a" (b), "d" (port)); |
} |
static inline void outw(u16 w, u16 port) |
{ |
asm volatile ("outw %0, %1\n" :: "a" (w), "d" (port)); |
} |
static inline void outl(u32 l, u16 port) |
{ |
asm volatile ("outl %0, %1\n" :: "a" (l), "d" (port)); |
} |
static inline u8 inb(u16 port) |
{ |
u8 val; |
asm volatile ("inb %1, %0 \n" : "=a" (val) : "d"(port)); |
return val; |
} |
static inline u16 inw(u16 port) |
{ |
u16 val; |
asm volatile ("inw %1, %0 \n" : "=a" (val) : "d"(port)); |
return val; |
} |
static inline u32 inl(u16 port) |
{ |
u32 val; |
asm volatile ("inl %1, %0 \n" : "=a" (val) : "d"(port)); |
return val; |
} |
static void conf12_init(struct pci_access *a) |
{ |
} |
static void conf12_cleanup(struct pci_access *a UNUSED) |
{ |
} |
/* |
* Before we decide to use direct hardware access mechanisms, we try to do some |
* trivial checks to ensure it at least _seems_ to be working -- we just test |
* whether bus 00 contains a host bridge (this is similar to checking |
* techniques used in XFree86, but ours should be more reliable since we |
* attempt to make use of direct access hints provided by the PCI BIOS). |
* |
* This should be close to trivial, but it isn't, because there are buggy |
* chipsets (yes, you guessed it, by Intel and Compaq) that have no class ID. |
*/ |
static int intel_sanity_check(struct pci_access *a, struct pci_methods *m) |
{ |
struct pci_dev d; |
a->debug("...sanity check"); |
d.bus = 0; |
d.func = 0; |
for (d.dev = 0; d.dev < 32; d.dev++) { |
u16 class, vendor; |
if (m->read(&d, PCI_CLASS_DEVICE, (byte *) & class, |
sizeof(class)) |
&& (class == cpu_to_le16(PCI_CLASS_BRIDGE_HOST) |
|| class == cpu_to_le16(PCI_CLASS_DISPLAY_VGA)) |
|| m->read(&d, PCI_VENDOR_ID, (byte *) & vendor, |
sizeof(vendor)) |
&& (vendor == cpu_to_le16(PCI_VENDOR_ID_INTEL) |
|| vendor == cpu_to_le16(PCI_VENDOR_ID_COMPAQ))) { |
a->debug("...outside the Asylum at 0/%02x/0", |
d.dev); |
return 1; |
} |
} |
a->debug("...insane"); |
return 0; |
} |
/* |
* Configuration type 1 |
*/ |
#define CONFIG_CMD(bus, device_fn, where) (0x80000000 | (bus << 16) | (device_fn << 8) | (where & ~3)) |
static int conf1_detect(struct pci_access *a) |
{ |
unsigned int tmp; |
int res = 0; |
outb(0x01, 0xCFB); |
tmp = inl(0xCF8); |
outl(0x80000000, 0xCF8); |
if (inl(0xCF8) == 0x80000000) |
res = 1; |
outl(tmp, 0xCF8); |
if (res) |
res = intel_sanity_check(a, &pm_intel_conf1); |
return res; |
} |
static int conf1_read(struct pci_dev *d, int pos, byte * buf, int len) |
{ |
int addr = 0xcfc + (pos & 3); |
if (pos >= 256) |
return 0; |
outl(0x80000000 | ((d->bus & 0xff) << 16) | |
(PCI_DEVFN(d->dev, d->func) << 8) | (pos & ~3), 0xcf8); |
switch (len) { |
case 1: |
buf[0] = inb(addr); |
break; |
case 2: |
((u16 *) buf)[0] = cpu_to_le16(inw(addr)); |
break; |
case 4: |
((u32 *) buf)[0] = cpu_to_le32(inl(addr)); |
break; |
default: |
return pci_generic_block_read(d, pos, buf, len); |
} |
return 1; |
} |
static int conf1_write(struct pci_dev *d, int pos, byte * buf, int len) |
{ |
int addr = 0xcfc + (pos & 3); |
if (pos >= 256) |
return 0; |
outl(0x80000000 | ((d->bus & 0xff) << 16) | |
(PCI_DEVFN(d->dev, d->func) << 8) | (pos & ~3), 0xcf8); |
switch (len) { |
case 1: |
outb(buf[0], addr); |
break; |
case 2: |
outw(le16_to_cpu(((u16 *) buf)[0]), addr); |
break; |
case 4: |
outl(le32_to_cpu(((u32 *) buf)[0]), addr); |
break; |
default: |
return pci_generic_block_write(d, pos, buf, len); |
} |
return 1; |
} |
/* |
* Configuration type 2. Obsolete and brain-damaged, but existing. |
*/ |
static int conf2_detect(struct pci_access *a) |
{ |
/* This is ugly and tends to produce false positives. Beware. */ |
outb(0x00, 0xCFB); |
outb(0x00, 0xCF8); |
outb(0x00, 0xCFA); |
if (inb(0xCF8) == 0x00 && inb(0xCFA) == 0x00) |
return intel_sanity_check(a, &pm_intel_conf2); |
else |
return 0; |
} |
static int conf2_read(struct pci_dev *d, int pos, byte * buf, int len) |
{ |
int addr = 0xc000 | (d->dev << 8) | pos; |
if (pos >= 256) |
return 0; |
if (d->dev >= 16) |
/* conf2 supports only 16 devices per bus */ |
return 0; |
outb((d->func << 1) | 0xf0, 0xcf8); |
outb(d->bus, 0xcfa); |
switch (len) { |
case 1: |
buf[0] = inb(addr); |
break; |
case 2: |
((u16 *) buf)[0] = cpu_to_le16(inw(addr)); |
break; |
case 4: |
((u32 *) buf)[0] = cpu_to_le32(inl(addr)); |
break; |
default: |
outb(0, 0xcf8); |
return pci_generic_block_read(d, pos, buf, len); |
} |
outb(0, 0xcf8); |
return 1; |
} |
static int conf2_write(struct pci_dev *d, int pos, byte * buf, int len) |
{ |
int addr = 0xc000 | (d->dev << 8) | pos; |
if (pos >= 256) |
return 0; |
if (d->dev >= 16) |
d->access->error("conf2_write: only first 16 devices exist."); |
outb((d->func << 1) | 0xf0, 0xcf8); |
outb(d->bus, 0xcfa); |
switch (len) { |
case 1: |
outb(buf[0], addr); |
break; |
case 2: |
outw(le16_to_cpu(*(u16 *) buf), addr); |
break; |
case 4: |
outl(le32_to_cpu(*(u32 *) buf), addr); |
break; |
default: |
outb(0, 0xcf8); |
return pci_generic_block_write(d, pos, buf, len); |
} |
outb(0, 0xcf8); |
return 1; |
} |
struct pci_methods pm_intel_conf1 = { |
"Intel-conf1", |
NULL, /* config */ |
conf1_detect, |
conf12_init, |
conf12_cleanup, |
pci_generic_scan, |
pci_generic_fill_info, |
conf1_read, |
conf1_write, |
NULL, /* init_dev */ |
NULL /* cleanup_dev */ |
}; |
struct pci_methods pm_intel_conf2 = { |
"Intel-conf2", |
NULL, /* config */ |
conf2_detect, |
conf12_init, |
conf12_cleanup, |
pci_generic_scan, |
pci_generic_fill_info, |
conf2_read, |
conf2_write, |
NULL, /* init_dev */ |
NULL /* cleanup_dev */ |
}; |
//branches/snapshot/uspace/srv/pci/libpci/access.c |
---|
0,0 → 1,270 |
/* |
* The PCI Library -- User Access |
* |
* Copyright (c) 1997--2003 Martin Mares <mj@ucw.cz> |
* |
* May 8, 2006 - Modified and ported to HelenOS by Jakub Jermar. |
* |
* Can be freely distributed and used under the terms of the GNU GPL. |
*/ |
#include <stdio.h> |
#include <stdlib.h> |
#include <stdarg.h> |
#include <string.h> |
#include "internal.h" |
static struct pci_methods *pci_methods[PCI_ACCESS_MAX] = { |
&pm_intel_conf1, |
&pm_intel_conf2, |
}; |
struct pci_access *pci_alloc(void) |
{ |
struct pci_access *a = malloc(sizeof(struct pci_access)); |
int i; |
if (!a) |
return NULL; |
bzero(a, sizeof(*a)); |
for (i = 0; i < PCI_ACCESS_MAX; i++) |
if (pci_methods[i] && pci_methods[i]->config) |
pci_methods[i]->config(a); |
return a; |
} |
void *pci_malloc(struct pci_access *a, int size) |
{ |
void *x = malloc(size); |
if (!x) |
a->error("Out of memory (allocation of %d bytes failed)", size); |
return x; |
} |
void pci_mfree(void *x) |
{ |
if (x) |
free(x); |
} |
static void pci_generic_error(char *msg, ...) |
{ |
va_list args; |
va_start(args, msg); |
puts("pcilib: "); |
vprintf(msg, args); |
putchar('\n'); |
exit(1); |
} |
static void pci_generic_warn(char *msg, ...) |
{ |
va_list args; |
va_start(args, msg); |
puts("pcilib: "); |
vprintf(msg, args); |
putchar('\n'); |
} |
static void pci_generic_debug(char *msg, ...) |
{ |
va_list args; |
va_start(args, msg); |
vprintf(msg, args); |
va_end(args); |
} |
static void pci_null_debug(char *msg UNUSED, ...) |
{ |
} |
void pci_init(struct pci_access *a) |
{ |
if (!a->error) |
a->error = pci_generic_error; |
if (!a->warning) |
a->warning = pci_generic_warn; |
if (!a->debug) |
a->debug = pci_generic_debug; |
if (!a->debugging) |
a->debug = pci_null_debug; |
if (a->method) { |
if (a->method >= PCI_ACCESS_MAX || !pci_methods[a->method]) |
a->error("This access method is not supported."); |
a->methods = pci_methods[a->method]; |
} else { |
unsigned int i; |
for (i = 0; i < PCI_ACCESS_MAX; i++) |
if (pci_methods[i]) { |
a->debug("Trying method %d...", i); |
if (pci_methods[i]->detect(a)) { |
a->debug("...OK\n"); |
a->methods = pci_methods[i]; |
a->method = i; |
break; |
} |
a->debug("...No.\n"); |
} |
if (!a->methods) |
a->error("Cannot find any working access method."); |
} |
a->debug("Decided to use %s\n", a->methods->name); |
a->methods->init(a); |
} |
void pci_cleanup(struct pci_access *a) |
{ |
struct pci_dev *d, *e; |
for (d = a->devices; d; d = e) { |
e = d->next; |
pci_free_dev(d); |
} |
if (a->methods) |
a->methods->cleanup(a); |
pci_free_name_list(a); |
pci_mfree(a); |
} |
void pci_scan_bus(struct pci_access *a) |
{ |
a->methods->scan(a); |
} |
struct pci_dev *pci_alloc_dev(struct pci_access *a) |
{ |
struct pci_dev *d = pci_malloc(a, sizeof(struct pci_dev)); |
bzero(d, sizeof(*d)); |
d->access = a; |
d->methods = a->methods; |
d->hdrtype = -1; |
if (d->methods->init_dev) |
d->methods->init_dev(d); |
return d; |
} |
int pci_link_dev(struct pci_access *a, struct pci_dev *d) |
{ |
d->next = a->devices; |
a->devices = d; |
return 1; |
} |
struct pci_dev *pci_get_dev(struct pci_access *a, int domain, int bus, |
int dev, int func) |
{ |
struct pci_dev *d = pci_alloc_dev(a); |
d->domain = domain; |
d->bus = bus; |
d->dev = dev; |
d->func = func; |
return d; |
} |
void pci_free_dev(struct pci_dev *d) |
{ |
if (d->methods->cleanup_dev) |
d->methods->cleanup_dev(d); |
pci_mfree(d); |
} |
static inline void |
pci_read_data(struct pci_dev *d, void *buf, int pos, int len) |
{ |
if (pos & (len - 1)) |
d->access->error("Unaligned read: pos=%02x, len=%d", pos, |
len); |
if (pos + len <= d->cache_len) |
memcpy(buf, d->cache + pos, len); |
else if (!d->methods->read(d, pos, buf, len)) |
memset(buf, 0xff, len); |
} |
byte pci_read_byte(struct pci_dev *d, int pos) |
{ |
byte buf; |
pci_read_data(d, &buf, pos, 1); |
return buf; |
} |
word pci_read_word(struct pci_dev * d, int pos) |
{ |
word buf; |
pci_read_data(d, &buf, pos, 2); |
return le16_to_cpu(buf); |
} |
u32 pci_read_long(struct pci_dev * d, int pos) |
{ |
u32 buf; |
pci_read_data(d, &buf, pos, 4); |
return le32_to_cpu(buf); |
} |
int pci_read_block(struct pci_dev *d, int pos, byte * buf, int len) |
{ |
return d->methods->read(d, pos, buf, len); |
} |
static inline int |
pci_write_data(struct pci_dev *d, void *buf, int pos, int len) |
{ |
if (pos & (len - 1)) |
d->access->error("Unaligned write: pos=%02x,len=%d", pos, len); |
if (pos + len <= d->cache_len) |
memcpy(d->cache + pos, buf, len); |
return d->methods->write(d, pos, buf, len); |
} |
int pci_write_byte(struct pci_dev *d, int pos, byte data) |
{ |
return pci_write_data(d, &data, pos, 1); |
} |
int pci_write_word(struct pci_dev *d, int pos, word data) |
{ |
word buf = cpu_to_le16(data); |
return pci_write_data(d, &buf, pos, 2); |
} |
int pci_write_long(struct pci_dev *d, int pos, u32 data) |
{ |
u32 buf = cpu_to_le32(data); |
return pci_write_data(d, &buf, pos, 4); |
} |
int pci_write_block(struct pci_dev *d, int pos, byte * buf, int len) |
{ |
if (pos < d->cache_len) { |
int l = (pos + len >= d->cache_len) ? (d->cache_len - pos) : len; |
memcpy(d->cache + pos, buf, l); |
} |
return d->methods->write(d, pos, buf, len); |
} |
int pci_fill_info(struct pci_dev *d, int flags) |
{ |
if (flags & PCI_FILL_RESCAN) { |
flags &= ~PCI_FILL_RESCAN; |
d->known_fields = 0; |
} |
if (flags & ~d->known_fields) |
d->known_fields |= d->methods->fill_info(d, flags & ~d->known_fields); |
return d->known_fields; |
} |
void pci_setup_cache(struct pci_dev *d, byte * cache, int len) |
{ |
d->cache = cache; |
d->cache_len = len; |
} |
//branches/snapshot/uspace/srv/pci/libpci/internal.h |
---|
0,0 → 1,43 |
/* |
* The PCI Library -- Internal Stuff |
* |
* Copyright (c) 1997--2004 Martin Mares <mj@ucw.cz> |
* |
* May 8, 2006 - Modified and ported to HelenOS by Jakub Jermar. |
* |
* Can be freely distributed and used under the terms of the GNU GPL. |
*/ |
#include "pci.h" |
#include "sysdep.h" |
struct pci_methods { |
char *name; |
void (*config) (struct pci_access *); |
int (*detect) (struct pci_access *); |
void (*init) (struct pci_access *); |
void (*cleanup) (struct pci_access *); |
void (*scan) (struct pci_access *); |
int (*fill_info) (struct pci_dev *, int flags); |
int (*read) (struct pci_dev *, int pos, byte * buf, int len); |
int (*write) (struct pci_dev *, int pos, byte * buf, int len); |
void (*init_dev) (struct pci_dev *); |
void (*cleanup_dev) (struct pci_dev *); |
}; |
void pci_generic_scan_bus(struct pci_access *, byte * busmap, int bus); |
void pci_generic_scan(struct pci_access *); |
int pci_generic_fill_info(struct pci_dev *, int flags); |
int pci_generic_block_read(struct pci_dev *, int pos, byte * buf, int len); |
int pci_generic_block_write(struct pci_dev *, int pos, byte * buf, |
int len); |
void *pci_malloc(struct pci_access *, int); |
void pci_mfree(void *); |
struct pci_dev *pci_alloc_dev(struct pci_access *); |
int pci_link_dev(struct pci_access *, struct pci_dev *); |
extern struct pci_methods pm_intel_conf1, pm_intel_conf2, pm_linux_proc, |
pm_fbsd_device, pm_aix_device, pm_nbsd_libpci, pm_obsd_device, |
pm_dump, pm_linux_sysfs; |
//branches/snapshot/uspace/srv/pci/libpci/generic.c |
---|
0,0 → 1,206 |
/* |
* The PCI Library -- Generic Direct Access Functions |
* |
* Copyright (c) 1997--2000 Martin Mares <mj@ucw.cz> |
* |
* May 8, 2006 - Modified and ported to HelenOS by Jakub Jermar. |
* |
* Can be freely distributed and used under the terms of the GNU GPL. |
*/ |
#include <string.h> |
#include "internal.h" |
void pci_generic_scan_bus(struct pci_access *a, byte * busmap, int bus) |
{ |
int dev, multi, ht; |
struct pci_dev *t; |
a->debug("Scanning bus %02x for devices...\n", bus); |
if (busmap[bus]) { |
a->warning("Bus %02x seen twice (firmware bug). Ignored.", |
bus); |
return; |
} |
busmap[bus] = 1; |
t = pci_alloc_dev(a); |
t->bus = bus; |
for (dev = 0; dev < 32; dev++) { |
t->dev = dev; |
multi = 0; |
for (t->func = 0; !t->func || multi && t->func < 8; |
t->func++) { |
u32 vd = pci_read_long(t, PCI_VENDOR_ID); |
struct pci_dev *d; |
if (!vd || vd == 0xffffffff) |
continue; |
ht = pci_read_byte(t, PCI_HEADER_TYPE); |
if (!t->func) |
multi = ht & 0x80; |
ht &= 0x7f; |
d = pci_alloc_dev(a); |
d->bus = t->bus; |
d->dev = t->dev; |
d->func = t->func; |
d->vendor_id = vd & 0xffff; |
d->device_id = vd >> 16U; |
d->known_fields = PCI_FILL_IDENT; |
d->hdrtype = ht; |
pci_link_dev(a, d); |
switch (ht) { |
case PCI_HEADER_TYPE_NORMAL: |
break; |
case PCI_HEADER_TYPE_BRIDGE: |
case PCI_HEADER_TYPE_CARDBUS: |
pci_generic_scan_bus(a, busmap, |
pci_read_byte(t, |
PCI_SECONDARY_BUS)); |
break; |
default: |
a->debug |
("Device %04x:%02x:%02x.%d has unknown header type %02x.\n", |
d->domain, d->bus, d->dev, d->func, |
ht); |
} |
} |
} |
pci_free_dev(t); |
} |
void pci_generic_scan(struct pci_access *a) |
{ |
byte busmap[256]; |
bzero(busmap, sizeof(busmap)); |
pci_generic_scan_bus(a, busmap, 0); |
} |
int pci_generic_fill_info(struct pci_dev *d, int flags) |
{ |
struct pci_access *a = d->access; |
if ((flags & (PCI_FILL_BASES | PCI_FILL_ROM_BASE)) |
&& d->hdrtype < 0) |
d->hdrtype = pci_read_byte(d, PCI_HEADER_TYPE) & 0x7f; |
if (flags & PCI_FILL_IDENT) { |
d->vendor_id = pci_read_word(d, PCI_VENDOR_ID); |
d->device_id = pci_read_word(d, PCI_DEVICE_ID); |
} |
if (flags & PCI_FILL_IRQ) |
d->irq = pci_read_byte(d, PCI_INTERRUPT_LINE); |
if (flags & PCI_FILL_BASES) { |
int cnt = 0, i; |
bzero(d->base_addr, sizeof(d->base_addr)); |
switch (d->hdrtype) { |
case PCI_HEADER_TYPE_NORMAL: |
cnt = 6; |
break; |
case PCI_HEADER_TYPE_BRIDGE: |
cnt = 2; |
break; |
case PCI_HEADER_TYPE_CARDBUS: |
cnt = 1; |
break; |
} |
if (cnt) { |
for (i = 0; i < cnt; i++) { |
u32 x = pci_read_long(d, PCI_BASE_ADDRESS_0 + i * 4); |
if (!x || x == (u32) ~ 0) |
continue; |
if ((x & PCI_BASE_ADDRESS_SPACE) == PCI_BASE_ADDRESS_SPACE_IO) |
d->base_addr[i] = x; |
else { |
if ((x & PCI_BASE_ADDRESS_MEM_TYPE_MASK) != PCI_BASE_ADDRESS_MEM_TYPE_64) |
d->base_addr[i] = x; |
else if (i >= cnt - 1) |
a->warning("%04x:%02x:%02x.%d: Invalid 64-bit address seen for BAR %d.", |
d->domain, d->bus, |
d->dev, d->func, i); |
else { |
u32 y = pci_read_long(d, PCI_BASE_ADDRESS_0 + (++i) * 4); |
#ifdef PCI_HAVE_64BIT_ADDRESS |
d->base_addr[i - 1] = x | (((pciaddr_t) y) << 32); |
#else |
if (y) |
a->warning("%04x:%02x:%02x.%d 64-bit device address ignored.", |
d->domain, |
d->bus, |
d->dev, |
d->func); |
else |
d->base_addr[i - 1] = x; |
#endif |
} |
} |
} |
} |
} |
if (flags & PCI_FILL_ROM_BASE) { |
int reg = 0; |
d->rom_base_addr = 0; |
switch (d->hdrtype) { |
case PCI_HEADER_TYPE_NORMAL: |
reg = PCI_ROM_ADDRESS; |
break; |
case PCI_HEADER_TYPE_BRIDGE: |
reg = PCI_ROM_ADDRESS1; |
break; |
} |
if (reg) { |
u32 u = pci_read_long(d, reg); |
if (u != 0xffffffff) |
d->rom_base_addr = u; |
} |
} |
return flags & ~PCI_FILL_SIZES; |
} |
static int |
pci_generic_block_op(struct pci_dev *d, int pos, byte * buf, int len, |
int (*r) (struct pci_dev * d, int pos, byte * buf, |
int len)) |
{ |
if ((pos & 1) && len >= 1) { |
if (!r(d, pos, buf, 1)) |
return 0; |
pos++; |
buf++; |
len--; |
} |
if ((pos & 3) && len >= 2) { |
if (!r(d, pos, buf, 2)) |
return 0; |
pos += 2; |
buf += 2; |
len -= 2; |
} |
while (len >= 4) { |
if (!r(d, pos, buf, 4)) |
return 0; |
pos += 4; |
buf += 4; |
len -= 4; |
} |
if (len >= 2) { |
if (!r(d, pos, buf, 2)) |
return 0; |
pos += 2; |
buf += 2; |
len -= 2; |
} |
if (len && !r(d, pos, buf, 1)) |
return 0; |
return 1; |
} |
int pci_generic_block_read(struct pci_dev *d, int pos, byte * buf, int len) |
{ |
return pci_generic_block_op(d, pos, buf, len, d->access->methods->read); |
} |
int pci_generic_block_write(struct pci_dev *d, int pos, byte * buf, int len) |
{ |
return pci_generic_block_op(d, pos, buf, len, d->access->methods->write); |
} |
//branches/snapshot/uspace/srv/pci/libpci/sysdep.h |
---|
0,0 → 1,26 |
/* |
* The PCI Library -- System-Dependent Stuff |
* |
* Copyright (c) 1997--2004 Martin Mares <mj@ucw.cz> |
* |
* May 8, 2006 - Modified and ported to HelenOS by Jakub Jermar. |
* |
* Can be freely distributed and used under the terms of the GNU GPL. |
*/ |
#ifdef __GNUC__ |
#define UNUSED __attribute__((unused)) |
#define NONRET __attribute__((noreturn)) |
#else |
#define UNUSED |
#define NONRET |
#define inline |
#endif |
typedef u8 byte; |
typedef u16 word; |
#define cpu_to_le16(x) (x) |
#define cpu_to_le32(x) (x) |
#define le16_to_cpu(x) (x) |
#define le32_to_cpu(x) (x) |
//branches/snapshot/uspace/srv/pci/libpci/header.h |
---|
0,0 → 1,937 |
/* |
* The PCI Library -- PCI Header Structure (based on <linux/pci.h>) |
* |
* Copyright (c) 1997--2005 Martin Mares <mj@ucw.cz> |
* |
* May 8, 2006 - Modified and ported to HelenOS by Jakub Jermar. |
* |
* Can be freely distributed and used under the terms of the GNU GPL. |
*/ |
/* |
* Under PCI, each device has 256 bytes of configuration address space, |
* of which the first 64 bytes are standardized as follows: |
*/ |
#define PCI_VENDOR_ID 0x00 /* 16 bits */ |
#define PCI_DEVICE_ID 0x02 /* 16 bits */ |
#define PCI_COMMAND 0x04 /* 16 bits */ |
#define PCI_COMMAND_IO 0x1 /* Enable response in I/O space */ |
#define PCI_COMMAND_MEMORY 0x2 /* Enable response in Memory space */ |
#define PCI_COMMAND_MASTER 0x4 /* Enable bus mastering */ |
#define PCI_COMMAND_SPECIAL 0x8 /* Enable response to special cycles */ |
#define PCI_COMMAND_INVALIDATE 0x10 /* Use memory write and invalidate */ |
#define PCI_COMMAND_VGA_PALETTE 0x20 /* Enable palette snooping */ |
#define PCI_COMMAND_PARITY 0x40 /* Enable parity checking */ |
#define PCI_COMMAND_WAIT 0x80 /* Enable address/data stepping */ |
#define PCI_COMMAND_SERR 0x100 /* Enable SERR */ |
#define PCI_COMMAND_FAST_BACK 0x200 /* Enable back-to-back writes */ |
#define PCI_STATUS 0x06 /* 16 bits */ |
#define PCI_STATUS_CAP_LIST 0x10 /* Support Capability List */ |
#define PCI_STATUS_66MHZ 0x20 /* Support 66 Mhz PCI 2.1 bus */ |
#define PCI_STATUS_UDF 0x40 /* Support User Definable Features [obsolete] */ |
#define PCI_STATUS_FAST_BACK 0x80 /* Accept fast-back to back */ |
#define PCI_STATUS_PARITY 0x100 /* Detected parity error */ |
#define PCI_STATUS_DEVSEL_MASK 0x600 /* DEVSEL timing */ |
#define PCI_STATUS_DEVSEL_FAST 0x000 |
#define PCI_STATUS_DEVSEL_MEDIUM 0x200 |
#define PCI_STATUS_DEVSEL_SLOW 0x400 |
#define PCI_STATUS_SIG_TARGET_ABORT 0x800 /* Set on target abort */ |
#define PCI_STATUS_REC_TARGET_ABORT 0x1000 /* Master ack of " */ |
#define PCI_STATUS_REC_MASTER_ABORT 0x2000 /* Set on master abort */ |
#define PCI_STATUS_SIG_SYSTEM_ERROR 0x4000 /* Set when we drive SERR */ |
#define PCI_STATUS_DETECTED_PARITY 0x8000 /* Set on parity error */ |
#define PCI_CLASS_REVISION 0x08 /* High 24 bits are class, low 8 |
revision */ |
#define PCI_REVISION_ID 0x08 /* Revision ID */ |
#define PCI_CLASS_PROG 0x09 /* Reg. Level Programming Interface */ |
#define PCI_CLASS_DEVICE 0x0a /* Device class */ |
#define PCI_CACHE_LINE_SIZE 0x0c /* 8 bits */ |
#define PCI_LATENCY_TIMER 0x0d /* 8 bits */ |
#define PCI_HEADER_TYPE 0x0e /* 8 bits */ |
#define PCI_HEADER_TYPE_NORMAL 0 |
#define PCI_HEADER_TYPE_BRIDGE 1 |
#define PCI_HEADER_TYPE_CARDBUS 2 |
#define PCI_BIST 0x0f /* 8 bits */ |
#define PCI_BIST_CODE_MASK 0x0f /* Return result */ |
#define PCI_BIST_START 0x40 /* 1 to start BIST, 2 secs or less */ |
#define PCI_BIST_CAPABLE 0x80 /* 1 if BIST capable */ |
/* |
* Base addresses specify locations in memory or I/O space. |
* Decoded size can be determined by writing a value of |
* 0xffffffff to the register, and reading it back. Only |
* 1 bits are decoded. |
*/ |
#define PCI_BASE_ADDRESS_0 0x10 /* 32 bits */ |
#define PCI_BASE_ADDRESS_1 0x14 /* 32 bits [htype 0,1 only] */ |
#define PCI_BASE_ADDRESS_2 0x18 /* 32 bits [htype 0 only] */ |
#define PCI_BASE_ADDRESS_3 0x1c /* 32 bits */ |
#define PCI_BASE_ADDRESS_4 0x20 /* 32 bits */ |
#define PCI_BASE_ADDRESS_5 0x24 /* 32 bits */ |
#define PCI_BASE_ADDRESS_SPACE 0x01 /* 0 = memory, 1 = I/O */ |
#define PCI_BASE_ADDRESS_SPACE_IO 0x01 |
#define PCI_BASE_ADDRESS_SPACE_MEMORY 0x00 |
#define PCI_BASE_ADDRESS_MEM_TYPE_MASK 0x06 |
#define PCI_BASE_ADDRESS_MEM_TYPE_32 0x00 /* 32 bit address */ |
#define PCI_BASE_ADDRESS_MEM_TYPE_1M 0x02 /* Below 1M [obsolete] */ |
#define PCI_BASE_ADDRESS_MEM_TYPE_64 0x04 /* 64 bit address */ |
#define PCI_BASE_ADDRESS_MEM_PREFETCH 0x08 /* prefetchable? */ |
#define PCI_BASE_ADDRESS_MEM_MASK (~(pciaddr_t)0x0f) |
#define PCI_BASE_ADDRESS_IO_MASK (~(pciaddr_t)0x03) |
/* bit 1 is reserved if address_space = 1 */ |
/* Header type 0 (normal devices) */ |
#define PCI_CARDBUS_CIS 0x28 |
#define PCI_SUBSYSTEM_VENDOR_ID 0x2c |
#define PCI_SUBSYSTEM_ID 0x2e |
#define PCI_ROM_ADDRESS 0x30 /* Bits 31..11 are address, 10..1 reserved */ |
#define PCI_ROM_ADDRESS_ENABLE 0x01 |
#define PCI_ROM_ADDRESS_MASK (~(pciaddr_t)0x7ff) |
#define PCI_CAPABILITY_LIST 0x34 /* Offset of first capability list entry */ |
/* 0x35-0x3b are reserved */ |
#define PCI_INTERRUPT_LINE 0x3c /* 8 bits */ |
#define PCI_INTERRUPT_PIN 0x3d /* 8 bits */ |
#define PCI_MIN_GNT 0x3e /* 8 bits */ |
#define PCI_MAX_LAT 0x3f /* 8 bits */ |
/* Header type 1 (PCI-to-PCI bridges) */ |
#define PCI_PRIMARY_BUS 0x18 /* Primary bus number */ |
#define PCI_SECONDARY_BUS 0x19 /* Secondary bus number */ |
#define PCI_SUBORDINATE_BUS 0x1a /* Highest bus number behind the bridge */ |
#define PCI_SEC_LATENCY_TIMER 0x1b /* Latency timer for secondary interface */ |
#define PCI_IO_BASE 0x1c /* I/O range behind the bridge */ |
#define PCI_IO_LIMIT 0x1d |
#define PCI_IO_RANGE_TYPE_MASK 0x0f /* I/O bridging type */ |
#define PCI_IO_RANGE_TYPE_16 0x00 |
#define PCI_IO_RANGE_TYPE_32 0x01 |
#define PCI_IO_RANGE_MASK ~0x0f |
#define PCI_SEC_STATUS 0x1e /* Secondary status register */ |
#define PCI_MEMORY_BASE 0x20 /* Memory range behind */ |
#define PCI_MEMORY_LIMIT 0x22 |
#define PCI_MEMORY_RANGE_TYPE_MASK 0x0f |
#define PCI_MEMORY_RANGE_MASK ~0x0f |
#define PCI_PREF_MEMORY_BASE 0x24 /* Prefetchable memory range behind */ |
#define PCI_PREF_MEMORY_LIMIT 0x26 |
#define PCI_PREF_RANGE_TYPE_MASK 0x0f |
#define PCI_PREF_RANGE_TYPE_32 0x00 |
#define PCI_PREF_RANGE_TYPE_64 0x01 |
#define PCI_PREF_RANGE_MASK ~0x0f |
#define PCI_PREF_BASE_UPPER32 0x28 /* Upper half of prefetchable memory range */ |
#define PCI_PREF_LIMIT_UPPER32 0x2c |
#define PCI_IO_BASE_UPPER16 0x30 /* Upper half of I/O addresses */ |
#define PCI_IO_LIMIT_UPPER16 0x32 |
/* 0x34 same as for htype 0 */ |
/* 0x35-0x3b is reserved */ |
#define PCI_ROM_ADDRESS1 0x38 /* Same as PCI_ROM_ADDRESS, but for htype 1 */ |
/* 0x3c-0x3d are same as for htype 0 */ |
#define PCI_BRIDGE_CONTROL 0x3e |
#define PCI_BRIDGE_CTL_PARITY 0x01 /* Enable parity detection on secondary interface */ |
#define PCI_BRIDGE_CTL_SERR 0x02 /* The same for SERR forwarding */ |
#define PCI_BRIDGE_CTL_NO_ISA 0x04 /* Disable bridging of ISA ports */ |
#define PCI_BRIDGE_CTL_VGA 0x08 /* Forward VGA addresses */ |
#define PCI_BRIDGE_CTL_MASTER_ABORT 0x20 /* Report master aborts */ |
#define PCI_BRIDGE_CTL_BUS_RESET 0x40 /* Secondary bus reset */ |
#define PCI_BRIDGE_CTL_FAST_BACK 0x80 /* Fast Back2Back enabled on secondary interface */ |
/* Header type 2 (CardBus bridges) */ |
/* 0x14-0x15 reserved */ |
#define PCI_CB_SEC_STATUS 0x16 /* Secondary status */ |
#define PCI_CB_PRIMARY_BUS 0x18 /* PCI bus number */ |
#define PCI_CB_CARD_BUS 0x19 /* CardBus bus number */ |
#define PCI_CB_SUBORDINATE_BUS 0x1a /* Subordinate bus number */ |
#define PCI_CB_LATENCY_TIMER 0x1b /* CardBus latency timer */ |
#define PCI_CB_MEMORY_BASE_0 0x1c |
#define PCI_CB_MEMORY_LIMIT_0 0x20 |
#define PCI_CB_MEMORY_BASE_1 0x24 |
#define PCI_CB_MEMORY_LIMIT_1 0x28 |
#define PCI_CB_IO_BASE_0 0x2c |
#define PCI_CB_IO_BASE_0_HI 0x2e |
#define PCI_CB_IO_LIMIT_0 0x30 |
#define PCI_CB_IO_LIMIT_0_HI 0x32 |
#define PCI_CB_IO_BASE_1 0x34 |
#define PCI_CB_IO_BASE_1_HI 0x36 |
#define PCI_CB_IO_LIMIT_1 0x38 |
#define PCI_CB_IO_LIMIT_1_HI 0x3a |
#define PCI_CB_IO_RANGE_MASK ~0x03 |
/* 0x3c-0x3d are same as for htype 0 */ |
#define PCI_CB_BRIDGE_CONTROL 0x3e |
#define PCI_CB_BRIDGE_CTL_PARITY 0x01 /* Similar to standard bridge control register */ |
#define PCI_CB_BRIDGE_CTL_SERR 0x02 |
#define PCI_CB_BRIDGE_CTL_ISA 0x04 |
#define PCI_CB_BRIDGE_CTL_VGA 0x08 |
#define PCI_CB_BRIDGE_CTL_MASTER_ABORT 0x20 |
#define PCI_CB_BRIDGE_CTL_CB_RESET 0x40 /* CardBus reset */ |
#define PCI_CB_BRIDGE_CTL_16BIT_INT 0x80 /* Enable interrupt for 16-bit cards */ |
#define PCI_CB_BRIDGE_CTL_PREFETCH_MEM0 0x100 /* Prefetch enable for both memory regions */ |
#define PCI_CB_BRIDGE_CTL_PREFETCH_MEM1 0x200 |
#define PCI_CB_BRIDGE_CTL_POST_WRITES 0x400 |
#define PCI_CB_SUBSYSTEM_VENDOR_ID 0x40 |
#define PCI_CB_SUBSYSTEM_ID 0x42 |
#define PCI_CB_LEGACY_MODE_BASE 0x44 /* 16-bit PC Card legacy mode base address (ExCa) */ |
/* 0x48-0x7f reserved */ |
/* Capability lists */ |
#define PCI_CAP_LIST_ID 0 /* Capability ID */ |
#define PCI_CAP_ID_PM 0x01 /* Power Management */ |
#define PCI_CAP_ID_AGP 0x02 /* Accelerated Graphics Port */ |
#define PCI_CAP_ID_VPD 0x03 /* Vital Product Data */ |
#define PCI_CAP_ID_SLOTID 0x04 /* Slot Identification */ |
#define PCI_CAP_ID_MSI 0x05 /* Message Signalled Interrupts */ |
#define PCI_CAP_ID_CHSWP 0x06 /* CompactPCI HotSwap */ |
#define PCI_CAP_ID_PCIX 0x07 /* PCI-X */ |
#define PCI_CAP_ID_HT 0x08 /* HyperTransport */ |
#define PCI_CAP_ID_VNDR 0x09 /* Vendor specific */ |
#define PCI_CAP_ID_DBG 0x0A /* Debug port */ |
#define PCI_CAP_ID_CCRC 0x0B /* CompactPCI Central Resource Control */ |
#define PCI_CAP_ID_AGP3 0x0E /* AGP 8x */ |
#define PCI_CAP_ID_EXP 0x10 /* PCI Express */ |
#define PCI_CAP_ID_MSIX 0x11 /* MSI-X */ |
#define PCI_CAP_LIST_NEXT 1 /* Next capability in the list */ |
#define PCI_CAP_FLAGS 2 /* Capability defined flags (16 bits) */ |
#define PCI_CAP_SIZEOF 4 |
/* Capabilities residing in the PCI Express extended configuration space */ |
#define PCI_EXT_CAP_ID_AER 0x01 /* Advanced Error Reporting */ |
#define PCI_EXT_CAP_ID_VC 0x02 /* Virtual Channel */ |
#define PCI_EXT_CAP_ID_DSN 0x03 /* Device Serial Number */ |
#define PCI_EXT_CAP_ID_PB 0x04 /* Power Budgeting */ |
/* Power Management Registers */ |
#define PCI_PM_CAP_VER_MASK 0x0007 /* Version (2=PM1.1) */ |
#define PCI_PM_CAP_PME_CLOCK 0x0008 /* Clock required for PME generation */ |
#define PCI_PM_CAP_DSI 0x0020 /* Device specific initialization required */ |
#define PCI_PM_CAP_AUX_C_MASK 0x01c0 /* Maximum aux current required in D3cold */ |
#define PCI_PM_CAP_D1 0x0200 /* D1 power state support */ |
#define PCI_PM_CAP_D2 0x0400 /* D2 power state support */ |
#define PCI_PM_CAP_PME_D0 0x0800 /* PME can be asserted from D0 */ |
#define PCI_PM_CAP_PME_D1 0x1000 /* PME can be asserted from D1 */ |
#define PCI_PM_CAP_PME_D2 0x2000 /* PME can be asserted from D2 */ |
#define PCI_PM_CAP_PME_D3_HOT 0x4000 /* PME can be asserted from D3hot */ |
#define PCI_PM_CAP_PME_D3_COLD 0x8000 /* PME can be asserted from D3cold */ |
#define PCI_PM_CTRL 4 /* PM control and status register */ |
#define PCI_PM_CTRL_STATE_MASK 0x0003 /* Current power state (D0 to D3) */ |
#define PCI_PM_CTRL_PME_ENABLE 0x0100 /* PME pin enable */ |
#define PCI_PM_CTRL_DATA_SEL_MASK 0x1e00 /* PM table data index */ |
#define PCI_PM_CTRL_DATA_SCALE_MASK 0x6000 /* PM table data scaling factor */ |
#define PCI_PM_CTRL_PME_STATUS 0x8000 /* PME pin status */ |
#define PCI_PM_PPB_EXTENSIONS 6 /* PPB support extensions */ |
#define PCI_PM_PPB_B2_B3 0x40 /* If bridge enters D3hot, bus enters: 0=B3, 1=B2 */ |
#define PCI_PM_BPCC_ENABLE 0x80 /* Secondary bus is power managed */ |
#define PCI_PM_DATA_REGISTER 7 /* PM table contents read here */ |
#define PCI_PM_SIZEOF 8 |
/* AGP registers */ |
#define PCI_AGP_VERSION 2 /* BCD version number */ |
#define PCI_AGP_RFU 3 /* Rest of capability flags */ |
#define PCI_AGP_STATUS 4 /* Status register */ |
#define PCI_AGP_STATUS_RQ_MASK 0xff000000 /* Maximum number of requests - 1 */ |
#define PCI_AGP_STATUS_ISOCH 0x10000 /* Isochronous transactions supported */ |
#define PCI_AGP_STATUS_ARQSZ_MASK 0xe000 /* log2(optimum async req size in bytes) - 4 */ |
#define PCI_AGP_STATUS_CAL_MASK 0x1c00 /* Calibration cycle timing */ |
#define PCI_AGP_STATUS_SBA 0x0200 /* Sideband addressing supported */ |
#define PCI_AGP_STATUS_ITA_COH 0x0100 /* In-aperture accesses always coherent */ |
#define PCI_AGP_STATUS_GART64 0x0080 /* 64-bit GART entries supported */ |
#define PCI_AGP_STATUS_HTRANS 0x0040 /* If 0, core logic can xlate host CPU accesses thru aperture */ |
#define PCI_AGP_STATUS_64BIT 0x0020 /* 64-bit addressing cycles supported */ |
#define PCI_AGP_STATUS_FW 0x0010 /* Fast write transfers supported */ |
#define PCI_AGP_STATUS_AGP3 0x0008 /* AGP3 mode supported */ |
#define PCI_AGP_STATUS_RATE4 0x0004 /* 4x transfer rate supported (RFU in AGP3 mode) */ |
#define PCI_AGP_STATUS_RATE2 0x0002 /* 2x transfer rate supported (8x in AGP3 mode) */ |
#define PCI_AGP_STATUS_RATE1 0x0001 /* 1x transfer rate supported (4x in AGP3 mode) */ |
#define PCI_AGP_COMMAND 8 /* Control register */ |
#define PCI_AGP_COMMAND_RQ_MASK 0xff000000 /* Master: Maximum number of requests */ |
#define PCI_AGP_COMMAND_ARQSZ_MASK 0xe000 /* log2(optimum async req size in bytes) - 4 */ |
#define PCI_AGP_COMMAND_CAL_MASK 0x1c00 /* Calibration cycle timing */ |
#define PCI_AGP_COMMAND_SBA 0x0200 /* Sideband addressing enabled */ |
#define PCI_AGP_COMMAND_AGP 0x0100 /* Allow processing of AGP transactions */ |
#define PCI_AGP_COMMAND_GART64 0x0080 /* 64-bit GART entries enabled */ |
#define PCI_AGP_COMMAND_64BIT 0x0020 /* Allow generation of 64-bit addr cycles */ |
#define PCI_AGP_COMMAND_FW 0x0010 /* Enable FW transfers */ |
#define PCI_AGP_COMMAND_RATE4 0x0004 /* Use 4x rate (RFU in AGP3 mode) */ |
#define PCI_AGP_COMMAND_RATE2 0x0002 /* Use 2x rate (8x in AGP3 mode) */ |
#define PCI_AGP_COMMAND_RATE1 0x0001 /* Use 1x rate (4x in AGP3 mode) */ |
#define PCI_AGP_SIZEOF 12 |
/* Slot Identification */ |
#define PCI_SID_ESR 2 /* Expansion Slot Register */ |
#define PCI_SID_ESR_NSLOTS 0x1f /* Number of expansion slots available */ |
#define PCI_SID_ESR_FIC 0x20 /* First In Chassis Flag */ |
#define PCI_SID_CHASSIS_NR 3 /* Chassis Number */ |
/* Message Signalled Interrupts registers */ |
#define PCI_MSI_FLAGS 2 /* Various flags */ |
#define PCI_MSI_FLAGS_64BIT 0x80 /* 64-bit addresses allowed */ |
#define PCI_MSI_FLAGS_QSIZE 0x70 /* Message queue size configured */ |
#define PCI_MSI_FLAGS_QMASK 0x0e /* Maximum queue size available */ |
#define PCI_MSI_FLAGS_ENABLE 0x01 /* MSI feature enabled */ |
#define PCI_MSI_RFU 3 /* Rest of capability flags */ |
#define PCI_MSI_ADDRESS_LO 4 /* Lower 32 bits */ |
#define PCI_MSI_ADDRESS_HI 8 /* Upper 32 bits (if PCI_MSI_FLAGS_64BIT set) */ |
#define PCI_MSI_DATA_32 8 /* 16 bits of data for 32-bit devices */ |
#define PCI_MSI_DATA_64 12 /* 16 bits of data for 64-bit devices */ |
/* PCI-X */ |
#define PCI_PCIX_COMMAND 2 /* Command register offset */ |
#define PCI_PCIX_COMMAND_DPERE 0x0001 /* Data Parity Error Recover Enable */ |
#define PCI_PCIX_COMMAND_ERO 0x0002 /* Enable Relaxed Ordering */ |
#define PCI_PCIX_COMMAND_MAX_MEM_READ_BYTE_COUNT 0x000c /* Maximum Memory Read Byte Count */ |
#define PCI_PCIX_COMMAND_MAX_OUTSTANDING_SPLIT_TRANS 0x0070 |
#define PCI_PCIX_COMMAND_RESERVED 0xf80 |
#define PCI_PCIX_STATUS 4 /* Status register offset */ |
#define PCI_PCIX_STATUS_FUNCTION 0x00000007 |
#define PCI_PCIX_STATUS_DEVICE 0x000000f8 |
#define PCI_PCIX_STATUS_BUS 0x0000ff00 |
#define PCI_PCIX_STATUS_64BIT 0x00010000 |
#define PCI_PCIX_STATUS_133MHZ 0x00020000 |
#define PCI_PCIX_STATUS_SC_DISCARDED 0x00040000 /* Split Completion Discarded */ |
#define PCI_PCIX_STATUS_UNEXPECTED_SC 0x00080000 /* Unexpected Split Completion */ |
#define PCI_PCIX_STATUS_DEVICE_COMPLEXITY 0x00100000 /* 0 = simple device, 1 = bridge device */ |
#define PCI_PCIX_STATUS_DESIGNED_MAX_MEM_READ_BYTE_COUNT 0x00600000 /* 0 = 512 bytes, 1 = 1024, 2 = 2048, 3 = 4096 */ |
#define PCI_PCIX_STATUS_DESIGNED_MAX_OUTSTANDING_SPLIT_TRANS 0x03800000 |
#define PCI_PCIX_STATUS_DESIGNED_MAX_CUMULATIVE_READ_SIZE 0x1c000000 |
#define PCI_PCIX_STATUS_RCVD_SC_ERR_MESS 0x20000000 /* Received Split Completion Error Message */ |
#define PCI_PCIX_STATUS_266MHZ 0x40000000 /* 266 MHz capable */ |
#define PCI_PCIX_STATUS_533MHZ 0x80000000 /* 533 MHz capable */ |
#define PCI_PCIX_SIZEOF 4 |
/* PCI-X Bridges */ |
#define PCI_PCIX_BRIDGE_SEC_STATUS 2 /* Secondary bus status register offset */ |
#define PCI_PCIX_BRIDGE_SEC_STATUS_64BIT 0x0001 |
#define PCI_PCIX_BRIDGE_SEC_STATUS_133MHZ 0x0002 |
#define PCI_PCIX_BRIDGE_SEC_STATUS_SC_DISCARDED 0x0004 /* Split Completion Discarded on secondary bus */ |
#define PCI_PCIX_BRIDGE_SEC_STATUS_UNEXPECTED_SC 0x0008 /* Unexpected Split Completion on secondary bus */ |
#define PCI_PCIX_BRIDGE_SEC_STATUS_SC_OVERRUN 0x0010 /* Split Completion Overrun on secondary bus */ |
#define PCI_PCIX_BRIDGE_SEC_STATUS_SPLIT_REQUEST_DELAYED 0x0020 |
#define PCI_PCIX_BRIDGE_SEC_STATUS_CLOCK_FREQ 0x01c0 |
#define PCI_PCIX_BRIDGE_SEC_STATUS_RESERVED 0xfe00 |
#define PCI_PCIX_BRIDGE_STATUS 4 /* Primary bus status register offset */ |
#define PCI_PCIX_BRIDGE_STATUS_FUNCTION 0x00000007 |
#define PCI_PCIX_BRIDGE_STATUS_DEVICE 0x000000f8 |
#define PCI_PCIX_BRIDGE_STATUS_BUS 0x0000ff00 |
#define PCI_PCIX_BRIDGE_STATUS_64BIT 0x00010000 |
#define PCI_PCIX_BRIDGE_STATUS_133MHZ 0x00020000 |
#define PCI_PCIX_BRIDGE_STATUS_SC_DISCARDED 0x00040000 /* Split Completion Discarded */ |
#define PCI_PCIX_BRIDGE_STATUS_UNEXPECTED_SC 0x00080000 /* Unexpected Split Completion */ |
#define PCI_PCIX_BRIDGE_STATUS_SC_OVERRUN 0x00100000 /* Split Completion Overrun */ |
#define PCI_PCIX_BRIDGE_STATUS_SPLIT_REQUEST_DELAYED 0x00200000 |
#define PCI_PCIX_BRIDGE_STATUS_RESERVED 0xffc00000 |
#define PCI_PCIX_BRIDGE_UPSTREAM_SPLIT_TRANS_CTRL 8 /* Upstream Split Transaction Register offset */ |
#define PCI_PCIX_BRIDGE_DOWNSTREAM_SPLIT_TRANS_CTRL 12 /* Downstream Split Transaction Register offset */ |
#define PCI_PCIX_BRIDGE_STR_CAPACITY 0x0000ffff |
#define PCI_PCIX_BRIDGE_STR_COMMITMENT_LIMIT 0xffff0000 |
#define PCI_PCIX_BRIDGE_SIZEOF 12 |
/* HyperTransport (as of spec rev. 2.00) */ |
#define PCI_HT_CMD 2 /* Command Register */ |
#define PCI_HT_CMD_TYP_HI 0xe000 /* Capability Type high part */ |
#define PCI_HT_CMD_TYP_HI_PRI 0x0000 /* Slave or Primary Interface */ |
#define PCI_HT_CMD_TYP_HI_SEC 0x2000 /* Host or Secondary Interface */ |
#define PCI_HT_CMD_TYP 0xf800 /* Capability Type */ |
#define PCI_HT_CMD_TYP_SW 0x4000 /* Switch */ |
#define PCI_HT_CMD_TYP_IDC 0x8000 /* Interrupt Discovery and Configuration */ |
#define PCI_HT_CMD_TYP_RID 0x8800 /* Revision ID */ |
#define PCI_HT_CMD_TYP_UIDC 0x9000 /* UnitID Clumping */ |
#define PCI_HT_CMD_TYP_ECSA 0x9800 /* Extended Configuration Space Access */ |
#define PCI_HT_CMD_TYP_AM 0xa000 /* Address Mapping */ |
#define PCI_HT_CMD_TYP_MSIM 0xa800 /* MSI Mapping */ |
#define PCI_HT_CMD_TYP_DR 0xb000 /* DirectRoute */ |
#define PCI_HT_CMD_TYP_VCS 0xb800 /* VCSet */ |
#define PCI_HT_CMD_TYP_RM 0xc000 /* Retry Mode */ |
#define PCI_HT_CMD_TYP_X86 0xc800 /* X86 (reserved) */ |
/* Link Control Register */ |
#define PCI_HT_LCTR_CFLE 0x0002 /* CRC Flood Enable */ |
#define PCI_HT_LCTR_CST 0x0004 /* CRC Start Test */ |
#define PCI_HT_LCTR_CFE 0x0008 /* CRC Force Error */ |
#define PCI_HT_LCTR_LKFAIL 0x0010 /* Link Failure */ |
#define PCI_HT_LCTR_INIT 0x0020 /* Initialization Complete */ |
#define PCI_HT_LCTR_EOC 0x0040 /* End of Chain */ |
#define PCI_HT_LCTR_TXO 0x0080 /* Transmitter Off */ |
#define PCI_HT_LCTR_CRCERR 0x0f00 /* CRC Error */ |
#define PCI_HT_LCTR_ISOCEN 0x1000 /* Isochronous Flow Control Enable */ |
#define PCI_HT_LCTR_LSEN 0x2000 /* LDTSTOP# Tristate Enable */ |
#define PCI_HT_LCTR_EXTCTL 0x4000 /* Extended CTL Time */ |
#define PCI_HT_LCTR_64B 0x8000 /* 64-bit Addressing Enable */ |
/* Link Configuration Register */ |
#define PCI_HT_LCNF_MLWI 0x0007 /* Max Link Width In */ |
#define PCI_HT_LCNF_LW_8B 0x0 /* Link Width 8 bits */ |
#define PCI_HT_LCNF_LW_16B 0x1 /* Link Width 16 bits */ |
#define PCI_HT_LCNF_LW_32B 0x3 /* Link Width 32 bits */ |
#define PCI_HT_LCNF_LW_2B 0x4 /* Link Width 2 bits */ |
#define PCI_HT_LCNF_LW_4B 0x5 /* Link Width 4 bits */ |
#define PCI_HT_LCNF_LW_NC 0x7 /* Link physically not connected */ |
#define PCI_HT_LCNF_DFI 0x0008 /* Doubleword Flow Control In */ |
#define PCI_HT_LCNF_MLWO 0x0070 /* Max Link Width Out */ |
#define PCI_HT_LCNF_DFO 0x0080 /* Doubleword Flow Control Out */ |
#define PCI_HT_LCNF_LWI 0x0700 /* Link Width In */ |
#define PCI_HT_LCNF_DFIE 0x0800 /* Doubleword Flow Control In Enable */ |
#define PCI_HT_LCNF_LWO 0x7000 /* Link Width Out */ |
#define PCI_HT_LCNF_DFOE 0x8000 /* Doubleword Flow Control Out Enable */ |
/* Revision ID Register */ |
#define PCI_HT_RID_MIN 0x1f /* Minor Revision */ |
#define PCI_HT_RID_MAJ 0xe0 /* Major Revision */ |
/* Link Frequency/Error Register */ |
#define PCI_HT_LFRER_FREQ 0x0f /* Transmitter Clock Frequency */ |
#define PCI_HT_LFRER_200 0x00 /* 200MHz */ |
#define PCI_HT_LFRER_300 0x01 /* 300MHz */ |
#define PCI_HT_LFRER_400 0x02 /* 400MHz */ |
#define PCI_HT_LFRER_500 0x03 /* 500MHz */ |
#define PCI_HT_LFRER_600 0x04 /* 600MHz */ |
#define PCI_HT_LFRER_800 0x05 /* 800MHz */ |
#define PCI_HT_LFRER_1000 0x06 /* 1.0GHz */ |
#define PCI_HT_LFRER_1200 0x07 /* 1.2GHz */ |
#define PCI_HT_LFRER_1400 0x08 /* 1.4GHz */ |
#define PCI_HT_LFRER_1600 0x09 /* 1.6GHz */ |
#define PCI_HT_LFRER_VEND 0x0f /* Vendor-Specific */ |
#define PCI_HT_LFRER_ERR 0xf0 /* Link Error */ |
#define PCI_HT_LFRER_PROT 0x10 /* Protocol Error */ |
#define PCI_HT_LFRER_OV 0x20 /* Overflow Error */ |
#define PCI_HT_LFRER_EOC 0x40 /* End of Chain Error */ |
#define PCI_HT_LFRER_CTLT 0x80 /* CTL Timeout */ |
/* Link Frequency Capability Register */ |
#define PCI_HT_LFCAP_200 0x0001 /* 200MHz */ |
#define PCI_HT_LFCAP_300 0x0002 /* 300MHz */ |
#define PCI_HT_LFCAP_400 0x0004 /* 400MHz */ |
#define PCI_HT_LFCAP_500 0x0008 /* 500MHz */ |
#define PCI_HT_LFCAP_600 0x0010 /* 600MHz */ |
#define PCI_HT_LFCAP_800 0x0020 /* 800MHz */ |
#define PCI_HT_LFCAP_1000 0x0040 /* 1.0GHz */ |
#define PCI_HT_LFCAP_1200 0x0080 /* 1.2GHz */ |
#define PCI_HT_LFCAP_1400 0x0100 /* 1.4GHz */ |
#define PCI_HT_LFCAP_1600 0x0200 /* 1.6GHz */ |
#define PCI_HT_LFCAP_VEND 0x8000 /* Vendor-Specific */ |
/* Feature Register */ |
#define PCI_HT_FTR_ISOCFC 0x0001 /* Isochronous Flow Control Mode */ |
#define PCI_HT_FTR_LDTSTOP 0x0002 /* LDTSTOP# Supported */ |
#define PCI_HT_FTR_CRCTM 0x0004 /* CRC Test Mode */ |
#define PCI_HT_FTR_ECTLT 0x0008 /* Extended CTL Time Required */ |
#define PCI_HT_FTR_64BA 0x0010 /* 64-bit Addressing */ |
#define PCI_HT_FTR_UIDRD 0x0020 /* UnitID Reorder Disable */ |
/* Error Handling Register */ |
#define PCI_HT_EH_PFLE 0x0001 /* Protocol Error Flood Enable */ |
#define PCI_HT_EH_OFLE 0x0002 /* Overflow Error Flood Enable */ |
#define PCI_HT_EH_PFE 0x0004 /* Protocol Error Fatal Enable */ |
#define PCI_HT_EH_OFE 0x0008 /* Overflow Error Fatal Enable */ |
#define PCI_HT_EH_EOCFE 0x0010 /* End of Chain Error Fatal Enable */ |
#define PCI_HT_EH_RFE 0x0020 /* Response Error Fatal Enable */ |
#define PCI_HT_EH_CRCFE 0x0040 /* CRC Error Fatal Enable */ |
#define PCI_HT_EH_SERRFE 0x0080 /* System Error Fatal Enable (B */ |
#define PCI_HT_EH_CF 0x0100 /* Chain Fail */ |
#define PCI_HT_EH_RE 0x0200 /* Response Error */ |
#define PCI_HT_EH_PNFE 0x0400 /* Protocol Error Nonfatal Enable */ |
#define PCI_HT_EH_ONFE 0x0800 /* Overflow Error Nonfatal Enable */ |
#define PCI_HT_EH_EOCNFE 0x1000 /* End of Chain Error Nonfatal Enable */ |
#define PCI_HT_EH_RNFE 0x2000 /* Response Error Nonfatal Enable */ |
#define PCI_HT_EH_CRCNFE 0x4000 /* CRC Error Nonfatal Enable */ |
#define PCI_HT_EH_SERRNFE 0x8000 /* System Error Nonfatal Enable */ |
/* HyperTransport: Slave or Primary Interface */ |
#define PCI_HT_PRI_CMD 2 /* Command Register */ |
#define PCI_HT_PRI_CMD_BUID 0x001f /* Base UnitID */ |
#define PCI_HT_PRI_CMD_UC 0x03e0 /* Unit Count */ |
#define PCI_HT_PRI_CMD_MH 0x0400 /* Master Host */ |
#define PCI_HT_PRI_CMD_DD 0x0800 /* Default Direction */ |
#define PCI_HT_PRI_CMD_DUL 0x1000 /* Drop on Uninitialized Link */ |
#define PCI_HT_PRI_LCTR0 4 /* Link Control 0 Register */ |
#define PCI_HT_PRI_LCNF0 6 /* Link Config 0 Register */ |
#define PCI_HT_PRI_LCTR1 8 /* Link Control 1 Register */ |
#define PCI_HT_PRI_LCNF1 10 /* Link Config 1 Register */ |
#define PCI_HT_PRI_RID 12 /* Revision ID Register */ |
#define PCI_HT_PRI_LFRER0 13 /* Link Frequency/Error 0 Register */ |
#define PCI_HT_PRI_LFCAP0 14 /* Link Frequency Capability 0 Register */ |
#define PCI_HT_PRI_FTR 16 /* Feature Register */ |
#define PCI_HT_PRI_LFRER1 17 /* Link Frequency/Error 1 Register */ |
#define PCI_HT_PRI_LFCAP1 18 /* Link Frequency Capability 1 Register */ |
#define PCI_HT_PRI_ES 20 /* Enumeration Scratchpad Register */ |
#define PCI_HT_PRI_EH 22 /* Error Handling Register */ |
#define PCI_HT_PRI_MBU 24 /* Memory Base Upper Register */ |
#define PCI_HT_PRI_MLU 25 /* Memory Limit Upper Register */ |
#define PCI_HT_PRI_BN 26 /* Bus Number Register */ |
#define PCI_HT_PRI_SIZEOF 28 |
/* HyperTransport: Host or Secondary Interface */ |
#define PCI_HT_SEC_CMD 2 /* Command Register */ |
#define PCI_HT_SEC_CMD_WR 0x0001 /* Warm Reset */ |
#define PCI_HT_SEC_CMD_DE 0x0002 /* Double-Ended */ |
#define PCI_HT_SEC_CMD_DN 0x0076 /* Device Number */ |
#define PCI_HT_SEC_CMD_CS 0x0080 /* Chain Side */ |
#define PCI_HT_SEC_CMD_HH 0x0100 /* Host Hide */ |
#define PCI_HT_SEC_CMD_AS 0x0400 /* Act as Slave */ |
#define PCI_HT_SEC_CMD_HIECE 0x0800 /* Host Inbound End of Chain Error */ |
#define PCI_HT_SEC_CMD_DUL 0x1000 /* Drop on Uninitialized Link */ |
#define PCI_HT_SEC_LCTR 4 /* Link Control Register */ |
#define PCI_HT_SEC_LCNF 6 /* Link Config Register */ |
#define PCI_HT_SEC_RID 8 /* Revision ID Register */ |
#define PCI_HT_SEC_LFRER 9 /* Link Frequency/Error Register */ |
#define PCI_HT_SEC_LFCAP 10 /* Link Frequency Capability Register */ |
#define PCI_HT_SEC_FTR 12 /* Feature Register */ |
#define PCI_HT_SEC_FTR_EXTRS 0x0100 /* Extended Register Set */ |
#define PCI_HT_SEC_FTR_UCNFE 0x0200 /* Upstream Configuration Enable */ |
#define PCI_HT_SEC_ES 16 /* Enumeration Scratchpad Register */ |
#define PCI_HT_SEC_EH 18 /* Error Handling Register */ |
#define PCI_HT_SEC_MBU 20 /* Memory Base Upper Register */ |
#define PCI_HT_SEC_MLU 21 /* Memory Limit Upper Register */ |
#define PCI_HT_SEC_SIZEOF 24 |
/* HyperTransport: Switch */ |
#define PCI_HT_SW_CMD 2 /* Switch Command Register */ |
#define PCI_HT_SW_CMD_VIBERR 0x0080 /* VIB Error */ |
#define PCI_HT_SW_CMD_VIBFL 0x0100 /* VIB Flood */ |
#define PCI_HT_SW_CMD_VIBFT 0x0200 /* VIB Fatal */ |
#define PCI_HT_SW_CMD_VIBNFT 0x0400 /* VIB Nonfatal */ |
#define PCI_HT_SW_PMASK 4 /* Partition Mask Register */ |
#define PCI_HT_SW_SWINF 8 /* Switch Info Register */ |
#define PCI_HT_SW_SWINF_DP 0x0000001f /* Default Port */ |
#define PCI_HT_SW_SWINF_EN 0x00000020 /* Enable Decode */ |
#define PCI_HT_SW_SWINF_CR 0x00000040 /* Cold Reset */ |
#define PCI_HT_SW_SWINF_PCIDX 0x00000f00 /* Performance Counter Index */ |
#define PCI_HT_SW_SWINF_BLRIDX 0x0003f000 /* Base/Limit Range Index */ |
#define PCI_HT_SW_SWINF_SBIDX 0x00002000 /* Secondary Base Range Index */ |
#define PCI_HT_SW_SWINF_HP 0x00040000 /* Hot Plug */ |
#define PCI_HT_SW_SWINF_HIDE 0x00080000 /* Hide Port */ |
#define PCI_HT_SW_PCD 12 /* Performance Counter Data Register */ |
#define PCI_HT_SW_BLRD 16 /* Base/Limit Range Data Register */ |
#define PCI_HT_SW_SBD 20 /* Secondary Base Data Register */ |
#define PCI_HT_SW_SIZEOF 24 |
/* Counter indices */ |
#define PCI_HT_SW_PC_PCR 0x0 /* Posted Command Receive */ |
#define PCI_HT_SW_PC_NPCR 0x1 /* Nonposted Command Receive */ |
#define PCI_HT_SW_PC_RCR 0x2 /* Response Command Receive */ |
#define PCI_HT_SW_PC_PDWR 0x3 /* Posted DW Receive */ |
#define PCI_HT_SW_PC_NPDWR 0x4 /* Nonposted DW Receive */ |
#define PCI_HT_SW_PC_RDWR 0x5 /* Response DW Receive */ |
#define PCI_HT_SW_PC_PCT 0x6 /* Posted Command Transmit */ |
#define PCI_HT_SW_PC_NPCT 0x7 /* Nonposted Command Transmit */ |
#define PCI_HT_SW_PC_RCT 0x8 /* Response Command Transmit */ |
#define PCI_HT_SW_PC_PDWT 0x9 /* Posted DW Transmit */ |
#define PCI_HT_SW_PC_NPDWT 0xa /* Nonposted DW Transmit */ |
#define PCI_HT_SW_PC_RDWT 0xb /* Response DW Transmit */ |
/* Base/Limit Range indices */ |
#define PCI_HT_SW_BLR_BASE0_LO 0x0 /* Base 0[31:1], Enable */ |
#define PCI_HT_SW_BLR_BASE0_HI 0x1 /* Base 0 Upper */ |
#define PCI_HT_SW_BLR_LIM0_LO 0x2 /* Limit 0 Lower */ |
#define PCI_HT_SW_BLR_LIM0_HI 0x3 /* Limit 0 Upper */ |
/* Secondary Base indices */ |
#define PCI_HT_SW_SB_LO 0x0 /* Secondary Base[31:1], Enable */ |
#define PCI_HT_SW_S0_HI 0x1 /* Secondary Base Upper */ |
/* HyperTransport: Interrupt Discovery and Configuration */ |
#define PCI_HT_IDC_IDX 2 /* Index Register */ |
#define PCI_HT_IDC_DATA 4 /* Data Register */ |
#define PCI_HT_IDC_SIZEOF 8 |
/* Register indices */ |
#define PCI_HT_IDC_IDX_LINT 0x01 /* Last Interrupt Register */ |
#define PCI_HT_IDC_LINT 0x00ff0000 /* Last interrupt definition */ |
#define PCI_HT_IDC_IDX_IDR 0x10 /* Interrupt Definition Registers */ |
/* Low part (at index) */ |
#define PCI_HT_IDC_IDR_MASK 0x10000001 /* Mask */ |
#define PCI_HT_IDC_IDR_POL 0x10000002 /* Polarity */ |
#define PCI_HT_IDC_IDR_II_2 0x1000001c /* IntrInfo[4:2]: Message Type */ |
#define PCI_HT_IDC_IDR_II_5 0x10000020 /* IntrInfo[5]: Request EOI */ |
#define PCI_HT_IDC_IDR_II_6 0x00ffffc0 /* IntrInfo[23:6] */ |
#define PCI_HT_IDC_IDR_II_24 0xff000000 /* IntrInfo[31:24] */ |
/* High part (at index + 1) */ |
#define PCI_HT_IDC_IDR_II_32 0x00ffffff /* IntrInfo[55:32] */ |
#define PCI_HT_IDC_IDR_PASSPW 0x40000000 /* PassPW setting for messages */ |
#define PCI_HT_IDC_IDR_WEOI 0x80000000 /* Waiting for EOI */ |
/* HyperTransport: Revision ID */ |
#define PCI_HT_RID_RID 2 /* Revision Register */ |
#define PCI_HT_RID_SIZEOF 4 |
/* HyperTransport: UnitID Clumping */ |
#define PCI_HT_UIDC_CS 4 /* Clumping Support Register */ |
#define PCI_HT_UIDC_CE 8 /* Clumping Enable Register */ |
#define PCI_HT_UIDC_SIZEOF 12 |
/* HyperTransport: Extended Configuration Space Access */ |
#define PCI_HT_ECSA_ADDR 4 /* Configuration Address Register */ |
#define PCI_HT_ECSA_ADDR_REG 0x00000ffc /* Register */ |
#define PCI_HT_ECSA_ADDR_FUN 0x00007000 /* Function */ |
#define PCI_HT_ECSA_ADDR_DEV 0x000f1000 /* Device */ |
#define PCI_HT_ECSA_ADDR_BUS 0x0ff00000 /* Bus Number */ |
#define PCI_HT_ECSA_ADDR_TYPE 0x10000000 /* Access Type */ |
#define PCI_HT_ECSA_DATA 8 /* Configuration Data Register */ |
#define PCI_HT_ECSA_SIZEOF 12 |
/* HyperTransport: Address Mapping */ |
#define PCI_HT_AM_CMD 2 /* Command Register */ |
#define PCI_HT_AM_CMD_NDMA 0x000f /* Number of DMA Mappings */ |
#define PCI_HT_AM_CMD_IOSIZ 0x01f0 /* I/O Size */ |
#define PCI_HT_AM_CMD_MT 0x0600 /* Map Type */ |
#define PCI_HT_AM_CMD_MT_40B 0x0000 /* 40-bit */ |
#define PCI_HT_AM_CMD_MT_64B 0x0200 /* 64-bit */ |
/* Window Control Register bits */ |
#define PCI_HT_AM_SBW_CTR_COMP 0x1 /* Compat */ |
#define PCI_HT_AM_SBW_CTR_NCOH 0x2 /* NonCoherent */ |
#define PCI_HT_AM_SBW_CTR_ISOC 0x4 /* Isochronous */ |
#define PCI_HT_AM_SBW_CTR_EN 0x8 /* Enable */ |
/* HyperTransport: 40-bit Address Mapping */ |
#define PCI_HT_AM40_SBNPW 4 /* Secondary Bus Non-Prefetchable Window Register */ |
#define PCI_HT_AM40_SBW_BASE 0x000fffff /* Window Base */ |
#define PCI_HT_AM40_SBW_CTR 0xf0000000 /* Window Control */ |
#define PCI_HT_AM40_SBPW 8 /* Secondary Bus Prefetchable Window Register */ |
#define PCI_HT_AM40_DMA_PBASE0 12 /* DMA Window Primary Base 0 Register */ |
#define PCI_HT_AM40_DMA_CTR0 15 /* DMA Window Control 0 Register */ |
#define PCI_HT_AM40_DMA_CTR_CTR 0xf0 /* Window Control */ |
#define PCI_HT_AM40_DMA_SLIM0 16 /* DMA Window Secondary Limit 0 Register */ |
#define PCI_HT_AM40_DMA_SBASE0 18 /* DMA Window Secondary Base 0 Register */ |
#define PCI_HT_AM40_SIZEOF 12 /* size is variable: 12 + 8 * NDMA */ |
/* HyperTransport: 64-bit Address Mapping */ |
#define PCI_HT_AM64_IDX 4 /* Index Register */ |
#define PCI_HT_AM64_DATA_LO 8 /* Data Lower Register */ |
#define PCI_HT_AM64_DATA_HI 12 /* Data Upper Register */ |
#define PCI_HT_AM64_SIZEOF 16 |
/* Register indices */ |
#define PCI_HT_AM64_IDX_SBNPW 0x00 /* Secondary Bus Non-Prefetchable Window Register */ |
#define PCI_HT_AM64_W_BASE_LO 0xfff00000 /* Window Base Lower */ |
#define PCI_HT_AM64_W_CTR 0x0000000f /* Window Control */ |
#define PCI_HT_AM64_IDX_SBPW 0x01 /* Secondary Bus Prefetchable Window Register */ |
#define PCI_HT_AM64_IDX_PBNPW 0x02 /* Primary Bus Non-Prefetchable Window Register */ |
#define PCI_HT_AM64_IDX_DMAPB0 0x04 /* DMA Window Primary Base 0 Register */ |
#define PCI_HT_AM64_IDX_DMASB0 0x05 /* DMA Window Secondary Base 0 Register */ |
#define PCI_HT_AM64_IDX_DMASL0 0x06 /* DMA Window Secondary Limit 0 Register */ |
/* HyperTransport: MSI Mapping */ |
#define PCI_HT_MSIM_CMD 2 /* Command Register */ |
#define PCI_HT_MSIM_CMD_EN 0x0001 /* Mapping Active */ |
#define PCI_HT_MSIM_CMD_FIXD 0x0002 /* MSI Mapping Address Fixed */ |
#define PCI_HT_MSIM_ADDR_LO 4 /* MSI Mapping Address Lower Register */ |
#define PCI_HT_MSIM_ADDR_HI 8 /* MSI Mapping Address Upper Register */ |
#define PCI_HT_MSIM_SIZEOF 12 |
/* HyperTransport: DirectRoute */ |
#define PCI_HT_DR_CMD 2 /* Command Register */ |
#define PCI_HT_DR_CMD_NDRS 0x000f /* Number of DirectRoute Spaces */ |
#define PCI_HT_DR_CMD_IDX 0x01f0 /* Index */ |
#define PCI_HT_DR_EN 4 /* Enable Vector Register */ |
#define PCI_HT_DR_DATA 8 /* Data Register */ |
#define PCI_HT_DR_SIZEOF 12 |
/* Register indices */ |
#define PCI_HT_DR_IDX_BASE_LO 0x00 /* DirectRoute Base Lower Register */ |
#define PCI_HT_DR_OTNRD 0x00000001 /* Opposite to Normal Request Direction */ |
#define PCI_HT_DR_BL_LO 0xffffff00 /* Base/Limit Lower */ |
#define PCI_HT_DR_IDX_BASE_HI 0x01 /* DirectRoute Base Upper Register */ |
#define PCI_HT_DR_IDX_LIMIT_LO 0x02 /* DirectRoute Limit Lower Register */ |
#define PCI_HT_DR_IDX_LIMIT_HI 0x03 /* DirectRoute Limit Upper Register */ |
/* HyperTransport: VCSet */ |
#define PCI_HT_VCS_SUP 4 /* VCSets Supported Register */ |
#define PCI_HT_VCS_L1EN 5 /* Link 1 VCSets Enabled Register */ |
#define PCI_HT_VCS_L0EN 6 /* Link 0 VCSets Enabled Register */ |
#define PCI_HT_VCS_SBD 8 /* Stream Bucket Depth Register */ |
#define PCI_HT_VCS_SINT 9 /* Stream Interval Register */ |
#define PCI_HT_VCS_SSUP 10 /* Number of Streaming VCs Supported Register */ |
#define PCI_HT_VCS_SSUP_0 0x00 /* Streaming VC 0 */ |
#define PCI_HT_VCS_SSUP_3 0x01 /* Streaming VCs 0-3 */ |
#define PCI_HT_VCS_SSUP_15 0x02 /* Streaming VCs 0-15 */ |
#define PCI_HT_VCS_NFCBD 12 /* Non-FC Bucket Depth Register */ |
#define PCI_HT_VCS_NFCINT 13 /* Non-FC Bucket Interval Register */ |
#define PCI_HT_VCS_SIZEOF 16 |
/* HyperTransport: Retry Mode */ |
#define PCI_HT_RM_CTR0 4 /* Control 0 Register */ |
#define PCI_HT_RM_CTR_LRETEN 0x01 /* Link Retry Enable */ |
#define PCI_HT_RM_CTR_FSER 0x02 /* Force Single Error */ |
#define PCI_HT_RM_CTR_ROLNEN 0x04 /* Rollover Nonfatal Enable */ |
#define PCI_HT_RM_CTR_FSS 0x08 /* Force Single Stomp */ |
#define PCI_HT_RM_CTR_RETNEN 0x10 /* Retry Nonfatal Enable */ |
#define PCI_HT_RM_CTR_RETFEN 0x20 /* Retry Fatal Enable */ |
#define PCI_HT_RM_CTR_AA 0xc0 /* Allowed Attempts */ |
#define PCI_HT_RM_STS0 5 /* Status 0 Register */ |
#define PCI_HT_RM_STS_RETSNT 0x01 /* Retry Sent */ |
#define PCI_HT_RM_STS_CNTROL 0x02 /* Count Rollover */ |
#define PCI_HT_RM_STS_SRCV 0x04 /* Stomp Received */ |
#define PCI_HT_RM_CTR1 6 /* Control 1 Register */ |
#define PCI_HT_RM_STS1 7 /* Status 1 Register */ |
#define PCI_HT_RM_CNT0 8 /* Retry Count 0 Register */ |
#define PCI_HT_RM_CNT1 10 /* Retry Count 1 Register */ |
#define PCI_HT_RM_SIZEOF 12 |
/* PCI Express */ |
#define PCI_EXP_FLAGS 0x2 /* Capabilities register */ |
#define PCI_EXP_FLAGS_VERS 0x000f /* Capability version */ |
#define PCI_EXP_FLAGS_TYPE 0x00f0 /* Device/Port type */ |
#define PCI_EXP_TYPE_ENDPOINT 0x0 /* Express Endpoint */ |
#define PCI_EXP_TYPE_LEG_END 0x1 /* Legacy Endpoint */ |
#define PCI_EXP_TYPE_ROOT_PORT 0x4 /* Root Port */ |
#define PCI_EXP_TYPE_UPSTREAM 0x5 /* Upstream Port */ |
#define PCI_EXP_TYPE_DOWNSTREAM 0x6 /* Downstream Port */ |
#define PCI_EXP_TYPE_PCI_BRIDGE 0x7 /* PCI/PCI-X Bridge */ |
#define PCI_EXP_FLAGS_SLOT 0x0100 /* Slot implemented */ |
#define PCI_EXP_FLAGS_IRQ 0x3e00 /* Interrupt message number */ |
#define PCI_EXP_DEVCAP 0x4 /* Device capabilities */ |
#define PCI_EXP_DEVCAP_PAYLOAD 0x07 /* Max_Payload_Size */ |
#define PCI_EXP_DEVCAP_PHANTOM 0x18 /* Phantom functions */ |
#define PCI_EXP_DEVCAP_EXT_TAG 0x20 /* Extended tags */ |
#define PCI_EXP_DEVCAP_L0S 0x1c0 /* L0s Acceptable Latency */ |
#define PCI_EXP_DEVCAP_L1 0xe00 /* L1 Acceptable Latency */ |
#define PCI_EXP_DEVCAP_ATN_BUT 0x1000 /* Attention Button Present */ |
#define PCI_EXP_DEVCAP_ATN_IND 0x2000 /* Attention Indicator Present */ |
#define PCI_EXP_DEVCAP_PWR_IND 0x4000 /* Power Indicator Present */ |
#define PCI_EXP_DEVCAP_PWR_VAL 0x3fc0000 /* Slot Power Limit Value */ |
#define PCI_EXP_DEVCAP_PWR_SCL 0xc000000 /* Slot Power Limit Scale */ |
#define PCI_EXP_DEVCTL 0x8 /* Device Control */ |
#define PCI_EXP_DEVCTL_CERE 0x0001 /* Correctable Error Reporting En. */ |
#define PCI_EXP_DEVCTL_NFERE 0x0002 /* Non-Fatal Error Reporting Enable */ |
#define PCI_EXP_DEVCTL_FERE 0x0004 /* Fatal Error Reporting Enable */ |
#define PCI_EXP_DEVCTL_URRE 0x0008 /* Unsupported Request Reporting En. */ |
#define PCI_EXP_DEVCTL_RELAXED 0x0010 /* Enable Relaxed Ordering */ |
#define PCI_EXP_DEVCTL_PAYLOAD 0x00e0 /* Max_Payload_Size */ |
#define PCI_EXP_DEVCTL_EXT_TAG 0x0100 /* Extended Tag Field Enable */ |
#define PCI_EXP_DEVCTL_PHANTOM 0x0200 /* Phantom Functions Enable */ |
#define PCI_EXP_DEVCTL_AUX_PME 0x0400 /* Auxiliary Power PM Enable */ |
#define PCI_EXP_DEVCTL_NOSNOOP 0x0800 /* Enable No Snoop */ |
#define PCI_EXP_DEVCTL_READRQ 0x7000 /* Max_Read_Request_Size */ |
#define PCI_EXP_DEVSTA 0xa /* Device Status */ |
#define PCI_EXP_DEVSTA_CED 0x01 /* Correctable Error Detected */ |
#define PCI_EXP_DEVSTA_NFED 0x02 /* Non-Fatal Error Detected */ |
#define PCI_EXP_DEVSTA_FED 0x04 /* Fatal Error Detected */ |
#define PCI_EXP_DEVSTA_URD 0x08 /* Unsupported Request Detected */ |
#define PCI_EXP_DEVSTA_AUXPD 0x10 /* AUX Power Detected */ |
#define PCI_EXP_DEVSTA_TRPND 0x20 /* Transactions Pending */ |
#define PCI_EXP_LNKCAP 0xc /* Link Capabilities */ |
#define PCI_EXP_LNKCAP_SPEED 0x0000f /* Maximum Link Speed */ |
#define PCI_EXP_LNKCAP_WIDTH 0x003f0 /* Maximum Link Width */ |
#define PCI_EXP_LNKCAP_ASPM 0x00c00 /* Active State Power Management */ |
#define PCI_EXP_LNKCAP_L0S 0x07000 /* L0s Acceptable Latency */ |
#define PCI_EXP_LNKCAP_L1 0x38000 /* L1 Acceptable Latency */ |
#define PCI_EXP_LNKCAP_PORT 0xff000000 /* Port Number */ |
#define PCI_EXP_LNKCTL 0x10 /* Link Control */ |
#define PCI_EXP_LNKCTL_ASPM 0x0003 /* ASPM Control */ |
#define PCI_EXP_LNKCTL_RCB 0x0008 /* Read Completion Boundary */ |
#define PCI_EXP_LNKCTL_DISABLE 0x0010 /* Link Disable */ |
#define PCI_EXP_LNKCTL_RETRAIN 0x0020 /* Retrain Link */ |
#define PCI_EXP_LNKCTL_CLOCK 0x0040 /* Common Clock Configuration */ |
#define PCI_EXP_LNKCTL_XSYNCH 0x0080 /* Extended Synch */ |
#define PCI_EXP_LNKSTA 0x12 /* Link Status */ |
#define PCI_EXP_LNKSTA_SPEED 0x000f /* Negotiated Link Speed */ |
#define PCI_EXP_LNKSTA_WIDTH 0x03f0 /* Negotiated Link Width */ |
#define PCI_EXP_LNKSTA_TR_ERR 0x0400 /* Training Error */ |
#define PCI_EXP_LNKSTA_TRAIN 0x0800 /* Link Training */ |
#define PCI_EXP_LNKSTA_SL_CLK 0x1000 /* Slot Clock Configuration */ |
#define PCI_EXP_SLTCAP 0x14 /* Slot Capabilities */ |
#define PCI_EXP_SLTCAP_ATNB 0x0001 /* Attention Button Present */ |
#define PCI_EXP_SLTCAP_PWRC 0x0002 /* Power Controller Present */ |
#define PCI_EXP_SLTCAP_MRL 0x0004 /* MRL Sensor Present */ |
#define PCI_EXP_SLTCAP_ATNI 0x0008 /* Attention Indicator Present */ |
#define PCI_EXP_SLTCAP_PWRI 0x0010 /* Power Indicator Present */ |
#define PCI_EXP_SLTCAP_HPS 0x0020 /* Hot-Plug Surprise */ |
#define PCI_EXP_SLTCAP_HPC 0x0040 /* Hot-Plug Capable */ |
#define PCI_EXP_SLTCAP_PWR_VAL 0x00007f80 /* Slot Power Limit Value */ |
#define PCI_EXP_SLTCAP_PWR_SCL 0x00018000 /* Slot Power Limit Scale */ |
#define PCI_EXP_SLTCAP_PSN 0xfff80000 /* Physical Slot Number */ |
#define PCI_EXP_SLTCTL 0x18 /* Slot Control */ |
#define PCI_EXP_SLTCTL_ATNB 0x0001 /* Attention Button Pressed Enable */ |
#define PCI_EXP_SLTCTL_PWRF 0x0002 /* Power Fault Detected Enable */ |
#define PCI_EXP_SLTCTL_MRLS 0x0004 /* MRL Sensor Changed Enable */ |
#define PCI_EXP_SLTCTL_PRSD 0x0008 /* Presence Detect Changed Enable */ |
#define PCI_EXP_SLTCTL_CMDC 0x0010 /* Command Completed Interrupt Enable */ |
#define PCI_EXP_SLTCTL_HPIE 0x0020 /* Hot-Plug Interrupt Enable */ |
#define PCI_EXP_SLTCTL_ATNI 0x00C0 /* Attention Indicator Control */ |
#define PCI_EXP_SLTCTL_PWRI 0x0300 /* Power Indicator Control */ |
#define PCI_EXP_SLTCTL_PWRC 0x0400 /* Power Controller Control */ |
#define PCI_EXP_SLTSTA 0x1a /* Slot Status */ |
#define PCI_EXP_RTCTL 0x1c /* Root Control */ |
#define PCI_EXP_RTCTL_SECEE 0x1 /* System Error on Correctable Error */ |
#define PCI_EXP_RTCTL_SENFEE 0x1 /* System Error on Non-Fatal Error */ |
#define PCI_EXP_RTCTL_SEFEE 0x1 /* System Error on Fatal Error */ |
#define PCI_EXP_RTCTL_PMEIE 0x1 /* PME Interrupt Enable */ |
#define PCI_EXP_RTSTA 0x20 /* Root Status */ |
/* MSI-X */ |
#define PCI_MSIX_ENABLE 0x8000 |
#define PCI_MSIX_MASK 0x4000 |
#define PCI_MSIX_TABSIZE 0x03ff |
#define PCI_MSIX_TABLE 4 |
#define PCI_MSIX_PBA 8 |
#define PCI_MSIX_BIR 0x7 |
/* Advanced Error Reporting */ |
#define PCI_ERR_UNCOR_STATUS 4 /* Uncorrectable Error Status */ |
#define PCI_ERR_UNC_TRAIN 0x00000001 /* Training */ |
#define PCI_ERR_UNC_DLP 0x00000010 /* Data Link Protocol */ |
#define PCI_ERR_UNC_POISON_TLP 0x00001000 /* Poisoned TLP */ |
#define PCI_ERR_UNC_FCP 0x00002000 /* Flow Control Protocol */ |
#define PCI_ERR_UNC_COMP_TIME 0x00004000 /* Completion Timeout */ |
#define PCI_ERR_UNC_COMP_ABORT 0x00008000 /* Completer Abort */ |
#define PCI_ERR_UNC_UNX_COMP 0x00010000 /* Unexpected Completion */ |
#define PCI_ERR_UNC_RX_OVER 0x00020000 /* Receiver Overflow */ |
#define PCI_ERR_UNC_MALF_TLP 0x00040000 /* Malformed TLP */ |
#define PCI_ERR_UNC_ECRC 0x00080000 /* ECRC Error Status */ |
#define PCI_ERR_UNC_UNSUP 0x00100000 /* Unsupported Request */ |
#define PCI_ERR_UNCOR_MASK 8 /* Uncorrectable Error Mask */ |
/* Same bits as above */ |
#define PCI_ERR_UNCOR_SEVER 12 /* Uncorrectable Error Severity */ |
/* Same bits as above */ |
#define PCI_ERR_COR_STATUS 16 /* Correctable Error Status */ |
#define PCI_ERR_COR_RCVR 0x00000001 /* Receiver Error Status */ |
#define PCI_ERR_COR_BAD_TLP 0x00000040 /* Bad TLP Status */ |
#define PCI_ERR_COR_BAD_DLLP 0x00000080 /* Bad DLLP Status */ |
#define PCI_ERR_COR_REP_ROLL 0x00000100 /* REPLAY_NUM Rollover */ |
#define PCI_ERR_COR_REP_TIMER 0x00001000 /* Replay Timer Timeout */ |
#define PCI_ERR_COR_MASK 20 /* Correctable Error Mask */ |
/* Same bits as above */ |
#define PCI_ERR_CAP 24 /* Advanced Error Capabilities */ |
#define PCI_ERR_CAP_FEP(x) ((x) & 31) /* First Error Pointer */ |
#define PCI_ERR_CAP_ECRC_GENC 0x00000020 /* ECRC Generation Capable */ |
#define PCI_ERR_CAP_ECRC_GENE 0x00000040 /* ECRC Generation Enable */ |
#define PCI_ERR_CAP_ECRC_CHKC 0x00000080 /* ECRC Check Capable */ |
#define PCI_ERR_CAP_ECRC_CHKE 0x00000100 /* ECRC Check Enable */ |
#define PCI_ERR_HEADER_LOG 28 /* Header Log Register (16 bytes) */ |
#define PCI_ERR_ROOT_COMMAND 44 /* Root Error Command */ |
#define PCI_ERR_ROOT_STATUS 48 |
#define PCI_ERR_ROOT_COR_SRC 52 |
#define PCI_ERR_ROOT_SRC 54 |
/* Virtual Channel */ |
#define PCI_VC_PORT_REG1 4 |
#define PCI_VC_PORT_REG2 8 |
#define PCI_VC_PORT_CTRL 12 |
#define PCI_VC_PORT_STATUS 14 |
#define PCI_VC_RES_CAP 16 |
#define PCI_VC_RES_CTRL 20 |
#define PCI_VC_RES_STATUS 26 |
/* Power Budgeting */ |
#define PCI_PWR_DSR 4 /* Data Select Register */ |
#define PCI_PWR_DATA 8 /* Data Register */ |
#define PCI_PWR_DATA_BASE(x) ((x) & 0xff) /* Base Power */ |
#define PCI_PWR_DATA_SCALE(x) (((x) >> 8) & 3) /* Data Scale */ |
#define PCI_PWR_DATA_PM_SUB(x) (((x) >> 10) & 7) /* PM Sub State */ |
#define PCI_PWR_DATA_PM_STATE(x) (((x) >> 13) & 3) /* PM State */ |
#define PCI_PWR_DATA_TYPE(x) (((x) >> 15) & 7) /* Type */ |
#define PCI_PWR_DATA_RAIL(x) (((x) >> 18) & 7) /* Power Rail */ |
#define PCI_PWR_CAP 12 /* Capability */ |
#define PCI_PWR_CAP_BUDGET(x) ((x) & 1) /* Included in system budget */ |
/* |
* The PCI interface treats multi-function devices as independent |
* devices. The slot/function address of each device is encoded |
* in a single byte as follows: |
* |
* 7:3 = slot |
* 2:0 = function |
*/ |
#define PCI_DEVFN(slot,func) ((((slot) & 0x1f) << 3) | ((func) & 0x07)) |
#define PCI_SLOT(devfn) (((devfn) >> 3) & 0x1f) |
#define PCI_FUNC(devfn) ((devfn) & 0x07) |
/* Device classes and subclasses */ |
#define PCI_CLASS_NOT_DEFINED 0x0000 |
#define PCI_CLASS_NOT_DEFINED_VGA 0x0001 |
#define PCI_BASE_CLASS_STORAGE 0x01 |
#define PCI_CLASS_STORAGE_SCSI 0x0100 |
#define PCI_CLASS_STORAGE_IDE 0x0101 |
#define PCI_CLASS_STORAGE_FLOPPY 0x0102 |
#define PCI_CLASS_STORAGE_IPI 0x0103 |
#define PCI_CLASS_STORAGE_RAID 0x0104 |
#define PCI_CLASS_STORAGE_OTHER 0x0180 |
#define PCI_BASE_CLASS_NETWORK 0x02 |
#define PCI_CLASS_NETWORK_ETHERNET 0x0200 |
#define PCI_CLASS_NETWORK_TOKEN_RING 0x0201 |
#define PCI_CLASS_NETWORK_FDDI 0x0202 |
#define PCI_CLASS_NETWORK_ATM 0x0203 |
#define PCI_CLASS_NETWORK_OTHER 0x0280 |
#define PCI_BASE_CLASS_DISPLAY 0x03 |
#define PCI_CLASS_DISPLAY_VGA 0x0300 |
#define PCI_CLASS_DISPLAY_XGA 0x0301 |
#define PCI_CLASS_DISPLAY_OTHER 0x0380 |
#define PCI_BASE_CLASS_MULTIMEDIA 0x04 |
#define PCI_CLASS_MULTIMEDIA_VIDEO 0x0400 |
#define PCI_CLASS_MULTIMEDIA_AUDIO 0x0401 |
#define PCI_CLASS_MULTIMEDIA_OTHER 0x0480 |
#define PCI_BASE_CLASS_MEMORY 0x05 |
#define PCI_CLASS_MEMORY_RAM 0x0500 |
#define PCI_CLASS_MEMORY_FLASH 0x0501 |
#define PCI_CLASS_MEMORY_OTHER 0x0580 |
#define PCI_BASE_CLASS_BRIDGE 0x06 |
#define PCI_CLASS_BRIDGE_HOST 0x0600 |
#define PCI_CLASS_BRIDGE_ISA 0x0601 |
#define PCI_CLASS_BRIDGE_EISA 0x0602 |
#define PCI_CLASS_BRIDGE_MC 0x0603 |
#define PCI_CLASS_BRIDGE_PCI 0x0604 |
#define PCI_CLASS_BRIDGE_PCMCIA 0x0605 |
#define PCI_CLASS_BRIDGE_NUBUS 0x0606 |
#define PCI_CLASS_BRIDGE_CARDBUS 0x0607 |
#define PCI_CLASS_BRIDGE_OTHER 0x0680 |
#define PCI_BASE_CLASS_COMMUNICATION 0x07 |
#define PCI_CLASS_COMMUNICATION_SERIAL 0x0700 |
#define PCI_CLASS_COMMUNICATION_PARALLEL 0x0701 |
#define PCI_CLASS_COMMUNICATION_OTHER 0x0780 |
#define PCI_BASE_CLASS_SYSTEM 0x08 |
#define PCI_CLASS_SYSTEM_PIC 0x0800 |
#define PCI_CLASS_SYSTEM_DMA 0x0801 |
#define PCI_CLASS_SYSTEM_TIMER 0x0802 |
#define PCI_CLASS_SYSTEM_RTC 0x0803 |
#define PCI_CLASS_SYSTEM_OTHER 0x0880 |
#define PCI_BASE_CLASS_INPUT 0x09 |
#define PCI_CLASS_INPUT_KEYBOARD 0x0900 |
#define PCI_CLASS_INPUT_PEN 0x0901 |
#define PCI_CLASS_INPUT_MOUSE 0x0902 |
#define PCI_CLASS_INPUT_OTHER 0x0980 |
#define PCI_BASE_CLASS_DOCKING 0x0a |
#define PCI_CLASS_DOCKING_GENERIC 0x0a00 |
#define PCI_CLASS_DOCKING_OTHER 0x0a01 |
#define PCI_BASE_CLASS_PROCESSOR 0x0b |
#define PCI_CLASS_PROCESSOR_386 0x0b00 |
#define PCI_CLASS_PROCESSOR_486 0x0b01 |
#define PCI_CLASS_PROCESSOR_PENTIUM 0x0b02 |
#define PCI_CLASS_PROCESSOR_ALPHA 0x0b10 |
#define PCI_CLASS_PROCESSOR_POWERPC 0x0b20 |
#define PCI_CLASS_PROCESSOR_CO 0x0b40 |
#define PCI_BASE_CLASS_SERIAL 0x0c |
#define PCI_CLASS_SERIAL_FIREWIRE 0x0c00 |
#define PCI_CLASS_SERIAL_ACCESS 0x0c01 |
#define PCI_CLASS_SERIAL_SSA 0x0c02 |
#define PCI_CLASS_SERIAL_USB 0x0c03 |
#define PCI_CLASS_SERIAL_FIBER 0x0c04 |
#define PCI_CLASS_OTHERS 0xff |
/* Several ID's we need in the library */ |
#define PCI_VENDOR_ID_INTEL 0x8086 |
#define PCI_VENDOR_ID_COMPAQ 0x0e11 |
//branches/snapshot/uspace/srv/pci/libpci/pci_ids.h |
---|
0,0 → 1,11934 |
/* DO NOT EDIT, THIS FILE IS AUTOMATICALLY GENERATED */ |
char *pci_ids[] = { |
"0000 Gammagraphx, Inc.", |
"001a Ascend Communications, Inc.", |
"0033 Paradyne corp.", |
"003d Lockheed Martin-Marietta Corp", |
"0059 Tiger Jet Network Inc. (Wrong ID)", |
"0070 Hauppauge computer works Inc.", |
"0071 Nebula Electronics Ltd.", |
"0095 Silicon Image, Inc. (Wrong ID)", |
" 0680 Ultra ATA/133 IDE RAID CONTROLLER CARD", |
"00a7 Teles AG (Wrong ID)", |
"00f5 BFG Technologies, Inc.", |
"0100 Ncipher Corp Ltd", |
"0123 General Dynamics", |
"018a LevelOne", |
" 0106 FPC-0106TX misprogrammed [RTL81xx]", |
"021b Compaq Computer Corporation", |
" 8139 HNE-300 (RealTek RTL8139c) [iPaq Networking]", |
"0270 Hauppauge computer works Inc. (Wrong ID)", |
"0291 Davicom Semiconductor, Inc.", |
" 8212 DM9102A(DM9102AE, SM9102AF) Ethernet 100/10 MBit(Rev 40)", |
"02ac SpeedStream", |
" 1012 1012 PCMCIA 10/100 Ethernet Card [RTL81xx]", |
"0315 SK-Electronics Co., Ltd.", |
"0357 TTTech AG", |
" 000a TTP-Monitoring Card V2.0", |
"0432 SCM Microsystems, Inc.", |
" 0001 Pluto2 DVB-T Receiver for PCMCIA [EasyWatch MobilSet]", |
"045e Microsoft", |
" 006e MN-510 802.11b wireless USB paddle", |
" 00c2 MN-710 wireless USB paddle", |
"04cf Myson Century, Inc", |
" 8818 CS8818 USB2.0-to-ATAPI Bridge Controller with Embedded PHY", |
"050d Belkin", |
" 0109 F5U409-CU USB/Serial Portable Adapter", |
" 7050 F5D7050 802.11g Wireless USB Adapter", |
"05e3 CyberDoor", |
" 0701 CBD516", |
"066f Sigmatel Inc.", |
" 3410 SMTP3410", |
" 3500 SMTP3500", |
"0675 Dynalink", |
" 1700 IS64PH ISDN Adapter", |
" 1702 IS64PH ISDN Adapter", |
" 1703 ISDN Adapter (PCI Bus, DV, W)", |
" 1704 ISDN Adapter (PCI Bus, D, C)", |
"067b Prolific Technology, Inc.", |
" 3507 PL-3507 Hi-Speed USB & IEEE 1394 Combo to IDE Bridge Controller", |
"0721 Sapphire, Inc.", |
"07e2 ELMEG Communication Systems GmbH", |
"0925 VIA Technologies, Inc. (Wrong ID)", |
"09c1 Arris", |
" 0704 CM 200E Cable Modem", |
"0a89 BREA Technologies Inc", |
"0b0b Rhino Equiment Corp.", |
" 0105 Rhino R1T1", |
" 0205 Rhino R4FXO", |
" 0305 Rhino R4T1", |
" 0405 Rhino R8FXX", |
" 0505 Rhino R24FXX", |
" 0506 Rhino R2T1", |
"0b49 ASCII Corporation", |
" 064f Trance Vibrator", |
"0e11 Compaq Computer Corporation", |
" 0001 PCI to EISA Bridge", |
" 0002 PCI to ISA Bridge", |
" 0046 Smart Array 64xx", |
" 0e11 409a Smart Array 641", |
" 0e11 409b Smart Array 642", |
" 0e11 409c Smart Array 6400", |
" 0e11 409d Smart Array 6400 EM", |
" 0049 NC7132 Gigabit Upgrade Module", |
" 004a NC6136 Gigabit Server Adapter", |
" 005a Remote Insight II board - Lights-Out", |
" 007c NC7770 1000BaseTX", |
" 007d NC6770 1000BaseTX", |
" 0085 NC7780 1000BaseTX", |
" 00b1 Remote Insight II board - PCI device", |
" 00bb NC7760", |
" 00ca NC7771", |
" 00cb NC7781", |
" 00cf NC7772", |
" 00d0 NC7782", |
" 00d1 NC7783", |
" 00e3 NC7761", |
" 0508 Netelligent 4/16 Token Ring", |
" 1000 Triflex/Pentium Bridge, Model 1000", |
" 2000 Triflex/Pentium Bridge, Model 2000", |
" 3032 QVision 1280/p", |
" 3033 QVision 1280/p", |
" 3034 QVision 1280/p", |
" 4000 4000 [Triflex]", |
" 4030 SMART-2/P", |
" 4031 SMART-2SL", |
" 4032 Smart Array 3200", |
" 4033 Smart Array 3100ES", |
" 4034 Smart Array 221", |
" 4040 Integrated Array", |
" 4048 Compaq Raid LC2", |
" 4050 Smart Array 4200", |
" 4051 Smart Array 4250ES", |
" 4058 Smart Array 431", |
" 4070 Smart Array 5300", |
" 4080 Smart Array 5i", |
" 4082 Smart Array 532", |
" 4083 Smart Array 5312", |
" 4091 Smart Array 6i", |
" 409a Smart Array 641", |
" 409b Smart Array 642", |
" 409c Smart Array 6400", |
" 409d Smart Array 6400 EM", |
" 6010 HotPlug PCI Bridge 6010", |
" 7020 USB Controller", |
" a0ec Fibre Channel Host Controller", |
" a0f0 Advanced System Management Controller", |
" a0f3 Triflex PCI to ISA Bridge", |
" a0f7 PCI Hotplug Controller", |
" 8086 002a PCI Hotplug Controller A", |
" 8086 002b PCI Hotplug Controller B", |
" a0f8 ZFMicro Chipset USB", |
" a0fc FibreChannel HBA Tachyon", |
" ae10 Smart-2/P RAID Controller", |
" 0e11 4030 Smart-2/P Array Controller", |
" 0e11 4031 Smart-2SL Array Controller", |
" 0e11 4032 Smart Array Controller", |
" 0e11 4033 Smart 3100ES Array Controller", |
" ae29 MIS-L", |
" ae2a MPC", |
" ae2b MIS-E", |
" ae31 System Management Controller", |
" ae32 Netelligent 10/100 TX PCI UTP", |
" ae33 Triflex Dual EIDE Controller", |
" ae34 Netelligent 10 T PCI UTP", |
" ae35 Integrated NetFlex-3/P", |
" ae40 Netelligent Dual 10/100 TX PCI UTP", |
" ae43 Netelligent Integrated 10/100 TX UTP", |
" ae69 CETUS-L", |
" ae6c Northstar", |
" ae6d NorthStar CPU to PCI Bridge", |
" b011 Netelligent 10/100 TX Embedded UTP", |
" b012 Netelligent 10 T/2 PCI UTP/Coax", |
" b01e NC3120 Fast Ethernet NIC", |
" b01f NC3122 Fast Ethernet NIC", |
" b02f NC1120 Ethernet NIC", |
" b030 Netelligent 10/100 TX UTP", |
" b04a 10/100 TX PCI Intel WOL UTP Controller", |
" b060 Smart Array 5300 Controller", |
" b0c6 NC3161 Fast Ethernet NIC", |
" b0c7 NC3160 Fast Ethernet NIC", |
" b0d7 NC3121 Fast Ethernet NIC", |
" b0dd NC3131 Fast Ethernet NIC", |
" b0de NC3132 Fast Ethernet Module", |
" b0df NC6132 Gigabit Module", |
" b0e0 NC6133 Gigabit Module", |
" b0e1 NC3133 Fast Ethernet Module", |
" b123 NC6134 Gigabit NIC", |
" b134 NC3163 Fast Ethernet NIC", |
" b13c NC3162 Fast Ethernet NIC", |
" b144 NC3123 Fast Ethernet NIC", |
" b163 NC3134 Fast Ethernet NIC", |
" b164 NC3165 Fast Ethernet Upgrade Module", |
" b178 Smart Array 5i/532", |
" 0e11 4080 Smart Array 5i", |
" 0e11 4082 Smart Array 532", |
" 0e11 4083 Smart Array 5312", |
" b1a4 NC7131 Gigabit Server Adapter", |
" b200 Memory Hot-Plug Controller", |
" b203 Integrated Lights Out Controller", |
" b204 Integrated Lights Out Processor", |
" f130 NetFlex-3/P ThunderLAN 1.0", |
" f150 NetFlex-3/P ThunderLAN 2.3", |
"0e21 Cowon Systems, Inc.", |
"0e55 HaSoTec GmbH", |
"1000 LSI Logic / Symbios Logic", |
" 0001 53c810", |
" 1000 1000 LSI53C810AE PCI to SCSI I/O Processor", |
" 0002 53c820", |
" 0003 53c825", |
" 1000 1000 LSI53C825AE PCI to SCSI I/O Processor (Ultra Wide)", |
" 0004 53c815", |
" 0005 53c810AP", |
" 0006 53c860", |
" 1000 1000 LSI53C860E PCI to Ultra SCSI I/O Processor", |
" 000a 53c1510", |
" 1000 1000 LSI53C1510 PCI to Dual Channel Wide Ultra2 SCSI Controller (Nonintelligent mode)", |
" 000b 53C896/897", |
" 0e11 6004 EOB003 Series SCSI host adapter", |
" 1000 1000 LSI53C896/7 PCI to Dual Channel Ultra2 SCSI Multifunction Controller", |
" 1000 1010 LSI22910 PCI to Dual Channel Ultra2 SCSI host adapter", |
" 1000 1020 LSI21002 PCI to Dual Channel Ultra2 SCSI host adapter", |
" 13e9 1000 6221L-4U", |
" 000c 53c895", |
" 1000 1010 LSI8951U PCI to Ultra2 SCSI host adapter", |
" 1000 1020 LSI8952U PCI to Ultra2 SCSI host adapter", |
" 1de1 3906 DC-390U2B SCSI adapter", |
" 1de1 3907 DC-390U2W", |
" 000d 53c885", |
" 000f 53c875", |
" 0e11 7004 Embedded Ultra Wide SCSI Controller", |
" 1000 1000 LSI53C876/E PCI to Dual Channel SCSI Controller", |
" 1000 1010 LSI22801 PCI to Dual Channel Ultra SCSI host adapter", |
" 1000 1020 LSI22802 PCI to Dual Channel Ultra SCSI host adapter", |
" 1092 8760 FirePort 40 Dual SCSI Controller", |
" 1de1 3904 DC390F/U Ultra Wide SCSI Adapter", |
" 4c53 1000 CC7/CR7/CP7/VC7/VP7/VR7 mainboard", |
" 4c53 1050 CT7 mainboard", |
" 0010 53C1510", |
" 0e11 4040 Integrated Array Controller", |
" 0e11 4048 RAID LC2 Controller", |
" 1000 1000 53C1510 PCI to Dual Channel Wide Ultra2 SCSI Controller (Intelligent mode)", |
" 0012 53c895a", |
" 1000 1000 LSI53C895A PCI to Ultra2 SCSI Controller", |
" 0013 53c875a", |
" 1000 1000 LSI53C875A PCI to Ultra SCSI Controller", |
" 0020 53c1010 Ultra3 SCSI Adapter", |
" 1000 1000 LSI53C1010-33 PCI to Dual Channel Ultra160 SCSI Controller", |
" 1de1 1020 DC-390U3W", |
" 0021 53c1010 66MHz Ultra3 SCSI Adapter", |
" 1000 1000 LSI53C1000/1000R/1010R/1010-66 PCI to Ultra160 SCSI Controller", |
" 1000 1010 Asus TR-DLS onboard 53C1010-66", |
" 124b 1070 PMC-USCSI3", |
" 4c53 1080 CT8 mainboard", |
" 4c53 1300 P017 mezzanine (32-bit PMC)", |
" 4c53 1310 P017 mezzanine (64-bit PMC)", |
" 0030 53c1030 PCI-X Fusion-MPT Dual Ultra320 SCSI", |
" 0e11 00da ProLiant ML 350", |
" 1028 0123 PowerEdge 2600", |
" 1028 014a PowerEdge 1750", |
" 1028 016c PowerEdge 1850 MPT Fusion SCSI/RAID (Perc 4)", |
" 1028 0183 PowerEdge 1800", |
" 1028 1010 LSI U320 SCSI Controller", |
" 124b 1170 PMC-USCSI320", |
" 1734 1052 Primergy RX300 S2", |
" 0031 53c1030ZC PCI-X Fusion-MPT Dual Ultra320 SCSI", |
" 0032 53c1035 PCI-X Fusion-MPT Dual Ultra320 SCSI", |
" 1000 1000 LSI53C1020/1030 PCI-X to Ultra320 SCSI Controller", |
" 0033 1030ZC_53c1035 PCI-X Fusion-MPT Dual Ultra320 SCSI", |
" 0040 53c1035 PCI-X Fusion-MPT Dual Ultra320 SCSI", |
" 1000 0033 MegaRAID SCSI 320-2XR", |
" 1000 0066 MegaRAID SCSI 320-2XRWS", |
" 0041 53C1035ZC PCI-X Fusion-MPT Dual Ultra320 SCSI", |
" 0050 SAS1064 PCI-X Fusion-MPT SAS", |
" 0054 SAS1068 PCI-X Fusion-MPT SAS", |
" 0056 SAS1064E PCI-Express Fusion-MPT SAS", |
" 0058 SAS1068E PCI-Express Fusion-MPT SAS", |
" 005a SAS1066E PCI-Express Fusion-MPT SAS", |
" 005c SAS1064A PCI-X Fusion-MPT SAS", |
" 005e SAS1066 PCI-X Fusion-MPT SAS", |
" 0060 SAS1078 PCI-X Fusion-MPT SAS", |
" 0062 SAS1078 PCI-Express Fusion-MPT SAS", |
" 1000 0062 SAS1078 PCI-Express Fusion-MPT SAS", |
" 008f 53c875J", |
" 1092 8000 FirePort 40 SCSI Controller", |
" 1092 8760 FirePort 40 Dual SCSI Host Adapter", |
" 0407 MegaRAID", |
" 1000 0530 MegaRAID 530 SCSI 320-0X RAID Controller", |
" 1000 0531 MegaRAID 531 SCSI 320-4X RAID Controller", |
" 1000 0532 MegaRAID 532 SCSI 320-2X RAID Controller", |
" 1028 0531 PowerEdge Expandable RAID Controller 4/QC", |
" 1028 0533 PowerEdge Expandable RAID Controller 4/QC", |
" 8086 0530 MegaRAID Intel RAID Controller SRCZCRX", |
" 8086 0532 MegaRAID Intel RAID Controller SRCU42X", |
" 0408 MegaRAID", |
" 1000 0001 MegaRAID SCSI 320-1E RAID Controller", |
" 1000 0002 MegaRAID SCSI 320-2E RAID Controller", |
" 1025 004d MegaRAID ACER ROMB-2E RAID Controller", |
" 1028 0001 PowerEdge RAID Controller PERC4e/SC", |
" 1028 0002 PowerEdge RAID Controller PERC4e/DC", |
" 1734 1065 FSC MegaRAID PCI Express ROMB", |
" 8086 0002 MegaRAID Intel RAID Controller SRCU42E", |
" 0409 MegaRAID", |
" 1000 3004 MegaRAID SATA 300-4X RAID Controller", |
" 1000 3008 MegaRAID SATA 300-8X RAID Controller", |
" 8086 3008 MegaRAID RAID Controller SRCS28X", |
" 8086 3431 MegaRAID RAID Controller Alief SROMBU42E", |
" 8086 3499 MegaRAID RAID Controller Harwich SROMBU42E", |
" 0621 FC909 Fibre Channel Adapter", |
" 0622 FC929 Fibre Channel Adapter", |
" 1000 1020 44929 O Dual Fibre Channel card", |
" 0623 FC929 LAN", |
" 0624 FC919 Fibre Channel Adapter", |
" 0625 FC919 LAN", |
" 0626 FC929X Fibre Channel Adapter", |
" 1000 1010 7202-XP-LC Dual Fibre Channel card", |
" 0627 FC929X LAN", |
" 0628 FC919X Fibre Channel Adapter", |
" 0629 FC919X LAN", |
" 0640 FC949X Fibre Channel Adapter", |
" 0642 FC939X Fibre Channel Adapter", |
" 0646 FC949ES Fibre Channel Adapter", |
" 0701 83C885 NT50 DigitalScape Fast Ethernet", |
" 0702 Yellowfin G-NIC gigabit ethernet", |
" 1318 0000 PEI100X", |
" 0804 SA2010", |
" 0805 SA2010ZC", |
" 0806 SA2020", |
" 0807 SA2020ZC", |
" 0901 61C102", |
" 1000 63C815", |
" 1960 MegaRAID", |
" 1000 0518 MegaRAID 518 SCSI 320-2 Controller", |
" 1000 0520 MegaRAID 520 SCSI 320-1 Controller", |
" 1000 0522 MegaRAID 522 i4 133 RAID Controller", |
" 1000 0523 MegaRAID SATA 150-6 RAID Controller", |
" 1000 4523 MegaRAID SATA 150-4 RAID Controller", |
" 1000 a520 MegaRAID ZCR SCSI 320-0 Controller", |
" 1028 0518 MegaRAID 518 DELL PERC 4/DC RAID Controller", |
" 1028 0520 MegaRAID 520 DELL PERC 4/SC RAID Controller", |
" 1028 0531 PowerEdge Expandable RAID Controller 4/QC", |
" 1028 0533 PowerEdge Expandable RAID Controller 4/QC", |
" 8086 0520 MegaRAIDRAID Controller SRCU41L", |
" 8086 0523 MegaRAID RAID Controller SRCS16", |
"1001 Kolter Electronic", |
" 0010 PCI 1616 Measurement card with 32 digital I/O lines", |
" 0011 OPTO-PCI Opto-Isolated digital I/O board", |
" 0012 PCI-AD/DA Analogue I/O board", |
" 0013 PCI-OPTO-RELAIS Digital I/O board with relay outputs", |
" 0014 PCI-Counter/Timer Counter Timer board", |
" 0015 PCI-DAC416 Analogue output board", |
" 0016 PCI-MFB Analogue I/O board", |
" 0017 PROTO-3 PCI Prototyping board", |
" 9100 INI-9100/9100W SCSI Host", |
"1002 ATI Technologies Inc", |
" 3150 M24 1P [Radeon Mobility X600]", |
" 3152 M22 [Radeon Mobility X300]", |
" 3154 M24 1T [FireGL M24 GL]", |
" 3e50 RV380 0x3e50 [Radeon X600]", |
" 3e54 RV380 0x3e54 [FireGL V3200]", |
" 3e70 RV380 [Radeon X600] Secondary", |
" 4136 Radeon IGP 320 M", |
" 4137 Radeon IGP330/340/350", |
" 4144 R300 AD [Radeon 9500 Pro]", |
" 4145 R300 AE [Radeon 9700 Pro]", |
" 4146 R300 AF [Radeon 9700 Pro]", |
" 4147 R300 AG [FireGL Z1/X1]", |
" 4148 R350 AH [Radeon 9800]", |
" 4149 R350 AI [Radeon 9800]", |
" 414a R350 AJ [Radeon 9800]", |
" 414b R350 AK [Fire GL X2]", |
" 4150 RV350 AP [Radeon 9600]", |
" 1002 0002 R9600 Pro primary (Asus OEM for HP)", |
" 1002 0003 R9600 Pro secondary (Asus OEM for HP)", |
" 1002 4722 All-in-Wonder 2006 AGP Edition", |
" 1458 4024 Giga-Byte GV-R96128D Primary", |
" 148c 2064 PowerColor R96A-C3N", |
" 148c 2066 PowerColor R96A-C3N", |
" 174b 7c19 Sapphire Atlantis Radeon 9600 Pro", |
" 174b 7c29 GC-R9600PRO Primary [Sapphire]", |
" 17ee 2002 Radeon 9600 256Mb Primary", |
" 18bc 0101 GC-R9600PRO Primary", |
" 4151 RV350 AQ [Radeon 9600]", |
" 1043 c004 A9600SE", |
" 4152 RV350 AR [Radeon 9600]", |
" 1002 0002 Radeon 9600XT", |
" 1002 4772 All-in-Wonder 9600 XT", |
" 1043 c002 Radeon 9600 XT TVD", |
" 1043 c01a A9600XT/TD", |
" 174b 7c29 Sapphire Radeon 9600XT", |
" 1787 4002 Radeon 9600 XT", |
" 4153 RV350 AS [Radeon 9550]", |
" 1462 932c 865PE Neo2-V (MS-6788) mainboard", |
" 4154 RV350 AT [Fire GL T2]", |
" 4155 RV350 AU [Fire GL T2]", |
" 4156 RV350 AV [Fire GL T2]", |
" 4157 RV350 AW [Fire GL T2]", |
" 4158 68800AX [Mach32]", |
" 4164 R300 AD [Radeon 9500 Pro] (Secondary)", |
" 4165 R300 AE [Radeon 9700 Pro] (Secondary)", |
" 4166 R300 AF [Radeon 9700 Pro] (Secondary)", |
" 4168 Radeon R350 [Radeon 9800] (Secondary)", |
" 4170 RV350 AP [Radeon 9600] (Secondary)", |
" 1002 0003 R9600 Pro secondary (Asus OEM for HP)", |
" 1002 4723 All-in-Wonder 2006 AGP Edition (Secondary)", |
" 1458 4025 Giga-Byte GV-R96128D Secondary", |
" 148c 2067 PowerColor R96A-C3N (Secondary)", |
" 174b 7c28 GC-R9600PRO Secondary [Sapphire]", |
" 17ee 2003 Radeon 9600 256Mb Secondary", |
" 18bc 0100 GC-R9600PRO Secondary", |
" 4171 RV350 AQ [Radeon 9600] (Secondary)", |
" 1043 c005 A9600SE (Secondary)", |
" 4172 RV350 AR [Radeon 9600] (Secondary)", |
" 1002 0003 Radeon 9600XT (Secondary)", |
" 1002 4773 All-in-Wonder 9600 XT (Secondary)", |
" 1043 c003 A9600XT (Secondary)", |
" 1043 c01b A9600XT/TD (Secondary)", |
" 174b 7c28 Sapphire Radeon 9600XT (Secondary)", |
" 1787 4003 Radeon 9600 XT (Secondary)", |
" 4173 RV350 ?? [Radeon 9550] (Secondary)", |
" 4237 Radeon 7000 IGP", |
" 4242 R200 BB [Radeon All in Wonder 8500DV]", |
" 1002 02aa Radeon 8500 AIW DV Edition", |
" 4243 R200 BC [Radeon All in Wonder 8500]", |
" 4336 Radeon Mobility U1", |
" 1002 4336 Pavilion ze4300 ATI Radeon Mobility U1 (IGP 320 M)", |
" 103c 0024 Pavilion ze4400 builtin Video", |
" 161f 2029 eMachines M5312 builtin Video", |
" 4337 Radeon IGP 330M/340M/350M", |
" 1014 053a ThinkPad R40e (2684-HVG) builtin VGA controller", |
" 103c 0850 Radeon IGP 345M", |
" 4341 IXP150 AC'97 Audio Controller", |
" 4345 EHCI USB Controller", |
" 4347 OHCI USB Controller #1", |
" 4348 OHCI USB Controller #2", |
" 4349 ATI Dual Channel Bus Master PCI IDE Controller", |
" 434d IXP AC'97 Modem", |
" 4353 ATI SMBus", |
" 4354 215CT [Mach64 CT]", |
" 4358 210888CX [Mach64 CX]", |
" 4363 ATI SMBus", |
" 436e ATI 436E Serial ATA Controller", |
" 4370 IXP SB400 AC'97 Audio Controller", |
" 1025 0079 Aspire 5024WLMMi", |
" 103c 308b MX6125", |
" 107b 0300 MX6421", |
" 4371 IXP SB400 PCI-PCI Bridge", |
" 103c 308b MX6125", |
" 4372 IXP SB400 SMBus Controller", |
" 1025 0080 Aspire 5024WLMMi", |
" 103c 308b MX6125", |
" 4373 IXP SB400 USB2 Host Controller", |
" 1025 0080 Aspire 5024WLMMi", |
" 103c 308b MX6125", |
" 4374 IXP SB400 USB Host Controller", |
" 103c 308b MX6125", |
" 4375 IXP SB400 USB Host Controller", |
" 1025 0080 Aspire 5024WLMMi", |
" 103c 308b MX6125", |
" 4376 Standard Dual Channel PCI IDE Controller ATI", |
" 1025 0080 Aspire 5024WLMMi", |
" 103c 308b MX6125", |
" 4377 IXP SB400 PCI-ISA Bridge", |
" 1025 0080 Aspire 5024WLMi", |
" 103c 308b MX6125", |
" 4378 ATI SB400 - AC'97 Modem Controller", |
" 1025 0080 Aspire 5024WLMMi", |
" 103c 308b MX6125", |
" 4379 ATI 4379 Serial ATA Controller", |
" 437a ATI 437A Serial ATA Controller", |
" 437b SB450 HDA Audio", |
" 4380 SB600 Non-Raid-5 SATA", |
" 4381 SB600 Raid-5 SATA", |
" 4382 SB600 AC97 Audio", |
" 4383 SB600 Azalia", |
" 4384 SB600 PCI to PCI Bridge", |
" 4385 SB600 SMBus", |
" 4386 SB600 USB Controller (EHCI)", |
" 4387 SB600 USB (OHCI0)", |
" 4388 SB600 USB (OHCI1)", |
" 4389 SB600 USB (OHCI2)", |
" 438a SB600 USB (OHCI3)", |
" 438b SB600 USB (OHCI4)", |
" 438c SB600 IDE", |
" 438d SB600 PCI to LPC Bridge", |
" 438e SB600 AC97 Modem", |
" 4437 Radeon Mobility 7000 IGP", |
" 4554 210888ET [Mach64 ET]", |
" 4654 Mach64 VT", |
" 4742 3D Rage Pro AGP 1X/2X", |
" 1002 0040 Rage Pro Turbo AGP 2X", |
" 1002 0044 Rage Pro Turbo AGP 2X", |
" 1002 0061 Rage Pro AIW AGP 2X", |
" 1002 0062 Rage Pro AIW AGP 2X", |
" 1002 0063 Rage Pro AIW AGP 2X", |
" 1002 0080 Rage Pro Turbo AGP 2X", |
" 1002 0084 Rage Pro Turbo AGP 2X", |
" 1002 4742 Rage Pro Turbo AGP 2X", |
" 1002 8001 Rage Pro Turbo AGP 2X", |
" 1028 0082 Rage Pro Turbo AGP 2X", |
" 1028 4082 Optiplex GX1 Onboard Display Adapter", |
" 1028 8082 Rage Pro Turbo AGP 2X", |
" 1028 c082 Rage Pro Turbo AGP 2X", |
" 8086 4152 Xpert 98D AGP 2X", |
" 8086 464a Rage Pro Turbo AGP 2X", |
" 4744 3D Rage Pro AGP 1X", |
" 1002 4744 Rage Pro Turbo AGP", |
" 4747 3D Rage Pro", |
" 4749 3D Rage Pro", |
" 1002 0061 Rage Pro AIW", |
" 1002 0062 Rage Pro AIW", |
" 474c Rage XC", |
" 474d Rage XL AGP 2X", |
" 1002 0004 Xpert 98 RXL AGP 2X", |
" 1002 0008 Xpert 98 RXL AGP 2X", |
" 1002 0080 Rage XL AGP 2X", |
" 1002 0084 Xpert 98 AGP 2X", |
" 1002 474d Rage XL AGP", |
" 1033 806a Rage XL AGP", |
" 474e Rage XC AGP", |
" 1002 474e Rage XC AGP", |
" 474f Rage XL", |
" 1002 0008 Rage XL", |
" 1002 474f Rage XL", |
" 4750 3D Rage Pro 215GP", |
" 1002 0040 Rage Pro Turbo", |
" 1002 0044 Rage Pro Turbo", |
" 1002 0080 Rage Pro Turbo", |
" 1002 0084 Rage Pro Turbo", |
" 1002 4750 Rage Pro Turbo", |
" 4751 3D Rage Pro 215GQ", |
" 4752 Rage XL", |
" 0e11 001e Proliant Rage XL", |
" 1002 0008 Rage XL", |
" 1002 4752 Proliant Rage XL", |
" 1002 8008 Rage XL", |
" 1028 00ce PowerEdge 1400", |
" 1028 00d1 PowerEdge 2550", |
" 1028 00d9 PowerEdge 2500", |
" 1028 0134 Poweredge SC600", |
" 103c 10e1 NetServer Rage XL", |
" 1734 007a Primergy RX300", |
" 8086 3411 SDS2 Mainboard", |
" 8086 3427 S875WP1-E mainboard", |
" 4753 Rage XC", |
" 1002 4753 Rage XC", |
" 4754 3D Rage I/II 215GT [Mach64 GT]", |
" 4755 3D Rage II+ 215GTB [Mach64 GTB]", |
" 4756 3D Rage IIC 215IIC [Mach64 GT IIC]", |
" 1002 4756 Rage IIC", |
" 4757 3D Rage IIC AGP", |
" 1002 4757 Rage IIC AGP", |
" 1028 0089 Rage 3D IIC", |
" 1028 008e PowerEdge 1300 onboard video", |
" 1028 4082 Rage 3D IIC", |
" 1028 8082 Rage 3D IIC", |
" 1028 c082 Rage 3D IIC", |
" 4758 210888GX [Mach64 GX]", |
" 4759 3D Rage IIC", |
" 475a 3D Rage IIC AGP", |
" 1002 0084 Rage 3D Pro AGP 2x XPERT 98", |
" 1002 0087 Rage 3D IIC", |
" 1002 475a Rage IIC AGP", |
" 4964 Radeon RV250 Id [Radeon 9000]", |
" 4965 Radeon RV250 Ie [Radeon 9000]", |
" 4966 Radeon RV250 If [Radeon 9000]", |
" 10f1 0002 RV250 If [Tachyon G9000 PRO]", |
" 148c 2039 RV250 If [Radeon 9000 Pro 'Evil Commando']", |
" 1509 9a00 RV250 If [Radeon 9000 'AT009']", |
" 1681 0040 RV250 If [3D prophet 9000]", |
" 174b 7176 RV250 If [Sapphire Radeon 9000 Pro]", |
" 174b 7192 RV250 If [Radeon 9000 'Atlantis']", |
" 17af 2005 RV250 If [Excalibur Radeon 9000 Pro]", |
" 17af 2006 RV250 If [Excalibur Radeon 9000]", |
" 4967 Radeon RV250 Ig [Radeon 9000]", |
" 496e Radeon RV250 [Radeon 9000] (Secondary)", |
" 4a48 R420 JH [Radeon X800]", |
" 4a49 R420 JI [Radeon X800PRO]", |
" 4a4a R420 JJ [Radeon X800SE]", |
" 4a4b R420 JK [Radeon X800]", |
" 4a4c R420 JL [Radeon X800]", |
" 4a4d R420 JM [FireGL X3]", |
" 4a4e M18 JN [Radeon Mobility 9800]", |
" 4a50 R420 JP [Radeon X800XT]", |
" 4a70 R420 [X800XT-PE] (Secondary)", |
" 4b49 R480 [Radeon X850XT]", |
" 4b4b R480 [Radeon X850Pro]", |
" 4b4c R481 [Radeon X850XT-PE]", |
" 4b69 R480 [Radeon X850XT] (Secondary)", |
" 4b6b R480 [Radeon X850Pro] (Secondary)", |
" 4b6c R481 [Radeon X850XT-PE] (Secondary)", |
" 4c42 3D Rage LT Pro AGP-133", |
" 0e11 b0e7 Rage LT Pro (Compaq Presario 5240)", |
" 0e11 b0e8 Rage 3D LT Pro", |
" 0e11 b10e 3D Rage LT Pro (Compaq Armada 1750)", |
" 1002 0040 Rage LT Pro AGP 2X", |
" 1002 0044 Rage LT Pro AGP 2X", |
" 1002 4c42 Rage LT Pro AGP 2X", |
" 1002 8001 Rage LT Pro AGP 2X", |
" 1028 0085 Rage 3D LT Pro", |
" 4c44 3D Rage LT Pro AGP-66", |
" 4c45 Rage Mobility M3 AGP", |
" 4c46 Rage Mobility M3 AGP 2x", |
" 1028 00b1 Latitude C600", |
" 4c47 3D Rage LT-G 215LG", |
" 4c49 3D Rage LT Pro", |
" 1002 0004 Rage LT Pro", |
" 1002 0040 Rage LT Pro", |
" 1002 0044 Rage LT Pro", |
" 1002 4c49 Rage LT Pro", |
" 4c4d Rage Mobility P/M AGP 2x", |
" 0e11 b111 Armada M700", |
" 0e11 b160 Armada E500", |
" 1002 0084 Xpert 98 AGP 2X (Mobility)", |
" 1014 0154 ThinkPad A20m/A21m", |
" 1028 00aa Latitude CPt", |
" 1028 00bb Latitude CPx", |
" 10e1 10cf Fujitsu Siemens LifeBook C Series", |
" 1179 ff00 Satellite 1715XCDS laptop", |
" 13bd 1019 PC-AR10", |
" 4c4e Rage Mobility L AGP 2x", |
" 4c50 3D Rage LT Pro", |
" 1002 4c50 Rage LT Pro", |
" 4c51 3D Rage LT Pro", |
" 4c52 Rage Mobility P/M", |
" 1033 8112 Versa Note VXi", |
" 4c53 Rage Mobility L", |
" 4c54 264LT [Mach64 LT]", |
" 4c57 Radeon Mobility M7 LW [Radeon Mobility 7500]", |
" 1014 0517 ThinkPad T30", |
" 1028 00e6 Radeon Mobility M7 LW (Dell Inspiron 8100)", |
" 1028 012a Latitude C640", |
" 144d c006 Radeon Mobility M7 LW in vpr Matrix 170B4", |
" 4c58 Radeon RV200 LX [Mobility FireGL 7800 M7]", |
" 4c59 Radeon Mobility M6 LY", |
" 0e11 b111 Evo N600c", |
" 1014 0235 ThinkPad A30/A30p (2652/2653)", |
" 1014 0239 ThinkPad X22/X23/X24", |
" 104d 80e7 VAIO PCG-GR214EP/GR214MP/GR215MP/GR314MP/GR315MP", |
" 104d 8140 PCG-Z1SP laptop", |
" 1509 1930 Medion MD9703", |
" 4c5a Radeon Mobility M6 LZ", |
" 4c64 Radeon R250 Ld [Radeon Mobility 9000 M9]", |
" 4c65 Radeon R250 Le [Radeon Mobility 9000 M9]", |
" 4c66 Radeon R250 [Radeon Mobility 9200]", |
" 4c67 Radeon R250 Lg [Radeon Mobility 9000 M9]", |
" 4c6e Radeon R250 Ln [Radeon Mobility 9000 M9] [Secondary]", |
" 4d46 Rage Mobility M4 AGP", |
" 4d4c Rage Mobility M4 AGP", |
" 4e44 Radeon R300 ND [Radeon 9700 Pro]", |
" 1002 515e Radeon ES1000", |
" 1002 5965 Radeon ES1000", |
" 4e45 Radeon R300 NE [Radeon 9500 Pro]", |
" 1002 0002 Radeon R300 NE [Radeon 9500 Pro]", |
" 1681 0002 Hercules 3D Prophet 9500 PRO [Radeon 9500 Pro]", |
" 4e46 RV350 NF [Radeon 9600]", |
" 4e47 Radeon R300 NG [FireGL X1]", |
" 4e48 Radeon R350 [Radeon 9800 Pro]", |
" 4e49 Radeon R350 [Radeon 9800]", |
" 4e4a RV350 NJ [Radeon 9800 XT]", |
" 4e4b R350 NK [Fire GL X2]", |
" 4e50 RV350 [Mobility Radeon 9600 M10]", |
" 1025 005a TravelMate 290", |
" 103c 088c NC8000 laptop", |
" 103c 0890 NC6000 laptop", |
" 1462 0311 MSI M510A", |
" 1734 1055 Amilo M1420W", |
" 4e51 M10 NQ [Radeon Mobility 9600]", |
" 4e52 RV350 [Mobility Radeon 9600 M10]", |
" 4e53 M10 NS [Radeon Mobility 9600]", |
" 4e54 M10 NT [FireGL Mobility T2]", |
" 4e56 M11 NV [FireGL Mobility T2e]", |
" 4e64 Radeon R300 [Radeon 9700 Pro] (Secondary)", |
" 4e65 Radeon R300 [Radeon 9500 Pro] (Secondary)", |
" 1002 0003 Radeon R300 NE [Radeon 9500 Pro]", |
" 1681 0003 Hercules 3D Prophet 9500 PRO [Radeon 9500 Pro] (Secondary)", |
" 4e66 RV350 NF [Radeon 9600] (Secondary)", |
" 4e67 Radeon R300 [FireGL X1] (Secondary)", |
" 4e68 Radeon R350 [Radeon 9800 Pro] (Secondary)", |
" 4e69 Radeon R350 [Radeon 9800] (Secondary)", |
" 4e6a RV350 NJ [Radeon 9800 XT] (Secondary)", |
" 1002 4e71 ATI Technologies Inc M10 NQ [Radeon Mobility 9600]", |
" 4e71 M10 NQ [Radeon Mobility 9600] (Secondary)", |
" 4f72 RV250 [Radeon 9000 Series]", |
" 4f73 Radeon RV250 [Radeon 9000 Series] (Secondary)", |
" 5041 Rage 128 PA/PRO", |
" 5042 Rage 128 PB/PRO AGP 2x", |
" 5043 Rage 128 PC/PRO AGP 4x", |
" 5044 Rage 128 PD/PRO TMDS", |
" 1002 0028 Rage 128 AIW", |
" 1002 0029 Rage 128 AIW", |
" 5045 Rage 128 PE/PRO AGP 2x TMDS", |
" 5046 Rage 128 PF/PRO AGP 4x TMDS", |
" 1002 0004 Rage Fury Pro", |
" 1002 0008 Rage Fury Pro/Xpert 2000 Pro", |
" 1002 0014 Rage Fury Pro", |
" 1002 0018 Rage Fury Pro/Xpert 2000 Pro", |
" 1002 0028 Rage 128 Pro AIW AGP", |
" 1002 002a Rage 128 Pro AIW AGP", |
" 1002 0048 Rage Fury Pro", |
" 1002 2000 Rage Fury MAXX AGP 4x (TMDS) (VGA device)", |
" 1002 2001 Rage Fury MAXX AGP 4x (TMDS) (Extra device?!)", |
" 5047 Rage 128 PG/PRO", |
" 5048 Rage 128 PH/PRO AGP 2x", |
" 5049 Rage 128 PI/PRO AGP 4x", |
" 504a Rage 128 PJ/PRO TMDS", |
" 504b Rage 128 PK/PRO AGP 2x TMDS", |
" 504c Rage 128 PL/PRO AGP 4x TMDS", |
" 504d Rage 128 PM/PRO", |
" 504e Rage 128 PN/PRO AGP 2x", |
" 504f Rage 128 PO/PRO AGP 4x", |
" 5050 Rage 128 PP/PRO TMDS [Xpert 128]", |
" 1002 0008 Xpert 128", |
" 5051 Rage 128 PQ/PRO AGP 2x TMDS", |
" 5052 Rage 128 PR/PRO AGP 4x TMDS", |
" 5053 Rage 128 PS/PRO", |
" 5054 Rage 128 PT/PRO AGP 2x", |
" 5055 Rage 128 PU/PRO AGP 4x", |
" 5056 Rage 128 PV/PRO TMDS", |
" 5057 Rage 128 PW/PRO AGP 2x TMDS", |
" 5058 Rage 128 PX/PRO AGP 4x TMDS", |
" 5144 Radeon R100 QD [Radeon 7200]", |
" 1002 0008 Radeon 7000/Radeon VE", |
" 1002 0009 Radeon 7000/Radeon", |
" 1002 000a Radeon 7000/Radeon", |
" 1002 001a Radeon 7000/Radeon", |
" 1002 0029 Radeon AIW", |
" 1002 0038 Radeon 7000/Radeon", |
" 1002 0039 Radeon 7000/Radeon", |
" 1002 008a Radeon 7000/Radeon", |
" 1002 00ba Radeon 7000/Radeon", |
" 1002 0139 Radeon 7000/Radeon", |
" 1002 028a Radeon 7000/Radeon", |
" 1002 02aa Radeon AIW", |
" 1002 053a Radeon 7000/Radeon", |
" 5145 Radeon R100 QE", |
" 5146 Radeon R100 QF", |
" 5147 Radeon R100 QG", |
" 5148 Radeon R200 QH [Radeon 8500]", |
" 1002 010a FireGL 8800 64Mb", |
" 1002 0152 FireGL 8800 128Mb", |
" 1002 0162 FireGL 8700 32Mb", |
" 1002 0172 FireGL 8700 64Mb", |
" 5149 Radeon R200 QI", |
" 514a Radeon R200 QJ", |
" 514b Radeon R200 QK", |
" 514c Radeon R200 QL [Radeon 8500 LE]", |
" 1002 003a Radeon R200 QL [Radeon 8500 LE]", |
" 1002 013a Radeon 8500", |
" 148c 2026 R200 QL [Radeon 8500 Evil Master II Multi Display Edition]", |
" 1681 0010 Radeon 8500 [3D Prophet 8500 128Mb]", |
" 174b 7149 Radeon R200 QL [Sapphire Radeon 8500 LE]", |
" 514d Radeon R200 QM [Radeon 9100]", |
" 514e Radeon R200 QN [Radeon 8500LE]", |
" 514f Radeon R200 QO [Radeon 8500LE]", |
" 5154 R200 QT [Radeon 8500]", |
" 5155 R200 QU [Radeon 9100]", |
" 5157 Radeon RV200 QW [Radeon 7500]", |
" 1002 013a Radeon 7500", |
" 1002 103a Dell Optiplex GX260", |
" 1458 4000 RV200 QW [RADEON 7500 PRO MAYA AR]", |
" 148c 2024 RV200 QW [Radeon 7500LE Dual Display]", |
" 148c 2025 RV200 QW [Radeon 7500 Evil Master Multi Display Edition]", |
" 148c 2036 RV200 QW [Radeon 7500 PCI Dual Display]", |
" 174b 7146 RV200 QW [Radeon 7500 LE]", |
" 174b 7147 RV200 QW [Sapphire Radeon 7500LE]", |
" 174b 7161 Radeon RV200 QW [Radeon 7500 LE]", |
" 17af 0202 RV200 QW [Excalibur Radeon 7500LE]", |
" 5158 Radeon RV200 QX [Radeon 7500]", |
" 5159 Radeon RV100 QY [Radeon 7000/VE]", |
" 1002 000a Radeon 7000/Radeon VE", |
" 1002 000b Radeon 7000", |
" 1002 0038 Radeon 7000/Radeon VE", |
" 1002 003a Radeon 7000/Radeon VE", |
" 1002 00ba Radeon 7000/Radeon VE", |
" 1002 013a Radeon 7000/Radeon VE", |
" 1002 0908 XVR-100 (supplied by Sun)", |
" 1014 029a Remote Supervisor Adapter II (RSA2)", |
" 1014 02c8 IBM eServer xSeries server mainboard", |
" 1028 019a PowerEdge SC1425", |
" 1458 4002 RV100 QY [RADEON 7000 PRO MAYA AV Series]", |
" 148c 2003 RV100 QY [Radeon 7000 Multi-Display Edition]", |
" 148c 2023 RV100 QY [Radeon 7000 Evil Master Multi-Display]", |
" 174b 7112 RV100 QY [Sapphire Radeon VE 7000]", |
" 174b 7c28 Sapphire Radeon VE 7000 DDR", |
" 1787 0202 RV100 QY [Excalibur Radeon 7000]", |
" 515a Radeon RV100 QZ [Radeon 7000/VE]", |
" 515e ES1000", |
" 515f ES1000", |
" 5168 Radeon R200 Qh", |
" 5169 Radeon R200 Qi", |
" 516a Radeon R200 Qj", |
" 516b Radeon R200 Qk", |
" 516c Radeon R200 Ql", |
" 5245 Rage 128 RE/SG", |
" 1002 0008 Xpert 128", |
" 1002 0028 Rage 128 AIW", |
" 1002 0029 Rage 128 AIW", |
" 1002 0068 Rage 128 AIW", |
" 5246 Rage 128 RF/SG AGP", |
" 1002 0004 Magnum/Xpert 128/Xpert 99", |
" 1002 0008 Magnum/Xpert128/X99/Xpert2000", |
" 1002 0028 Rage 128 AIW AGP", |
" 1002 0044 Rage Fury/Xpert 128/Xpert 2000", |
" 1002 0068 Rage 128 AIW AGP", |
" 1002 0448 Rage Fury", |
" 5247 Rage 128 RG", |
" 524b Rage 128 RK/VR", |
" 524c Rage 128 RL/VR AGP", |
" 1002 0008 Xpert 99/Xpert 2000", |
" 1002 0088 Xpert 99", |
" 5345 Rage 128 SE/4x", |
" 5346 Rage 128 SF/4x AGP 2x", |
" 1002 0048 RAGE 128 16MB VGA TVOUT AMC PAL", |
" 5347 Rage 128 SG/4x AGP 4x", |
" 5348 Rage 128 SH", |
" 534b Rage 128 SK/4x", |
" 534c Rage 128 SL/4x AGP 2x", |
" 534d Rage 128 SM/4x AGP 4x", |
" 1002 0008 Xpert 99/Xpert 2000", |
" 1002 0018 Xpert 2000", |
" 534e Rage 128 4x", |
" 5354 Mach 64 VT", |
" 1002 5654 Mach 64 reference", |
" 5446 Rage 128 Pro Ultra TF", |
" 1002 0004 Rage Fury Pro", |
" 1002 0008 Rage Fury Pro/Xpert 2000 Pro", |
" 1002 0018 Rage Fury Pro/Xpert 2000 Pro", |
" 1002 0028 Rage 128 AIW Pro AGP", |
" 1002 0029 Rage 128 AIW", |
" 1002 002a Rage 128 AIW Pro AGP", |
" 1002 002b Rage 128 AIW", |
" 1002 0048 Xpert 2000 Pro", |
" 544c Rage 128 Pro Ultra TL", |
" 5452 Rage 128 Pro Ultra TR", |
" 1002 001c Rage 128 Pro 4XL", |
" 103c 1279 Rage 128 Pro 4XL", |
" 5453 Rage 128 Pro Ultra TS", |
" 5454 Rage 128 Pro Ultra TT", |
" 5455 Rage 128 Pro Ultra TU", |
" 5460 M22 [Radeon Mobility M300]", |
" 5462 M24 [Radeon Mobility X600]", |
" 5464 M22 [FireGL GL]", |
" 5548 R423 UH [Radeon X800 (PCIE)]", |
" 5549 R423 UI [Radeon X800PRO (PCIE)]", |
" 554a R423 UJ [Radeon X800LE (PCIE)]", |
" 554b R423 UK [Radeon X800SE (PCIE)]", |
" 554d R430 [Radeon X800 XL] (PCIe)", |
" 554f R430 [Radeon X800 (PCIE)]", |
" 5550 R423 [Fire GL V7100]", |
" 5551 R423 UQ [FireGL V7200 (PCIE)]", |
" 5552 R423 UR [FireGL V5100 (PCIE)]", |
" 5554 R423 UT [FireGL V7100 (PCIE)]", |
" 556b Radeon R423 UK (PCIE) [X800 SE] (Secondary)", |
" 556d R430 [Radeon X800 XL] (PCIe) Secondary", |
" 556f R430 [Radeon X800 (PCIE) Secondary]", |
" 564a M26 [Mobility FireGL V5000]", |
" 564b M26 [Mobility FireGL V5000]", |
" 564f M26 [Radeon Mobility X700 XL] (PCIE)", |
" 5652 M26 [Radeon Mobility X700]", |
" 5653 Radeon Mobility X700 (PCIE)", |
" 1025 0080 Aspire 5024WLMi", |
" 5654 264VT [Mach64 VT]", |
" 1002 5654 Mach64VT Reference", |
" 5655 264VT3 [Mach64 VT3]", |
" 5656 264VT4 [Mach64 VT4]", |
" 5830 RS300 Host Bridge", |
" 5831 RS300 Host Bridge", |
" 5832 RS300 Host Bridge", |
" 5833 Radeon 9100 IGP Host Bridge", |
" 5834 Radeon 9100 IGP", |
" 5835 RS300M AGP [Radeon Mobility 9100IGP]", |
" 5838 Radeon 9100 IGP AGP Bridge", |
" 5940 RV280 [Radeon 9200 PRO] (Secondary)", |
" 5941 RV280 [Radeon 9200] (Secondary)", |
" 1458 4019 Gigabyte Radeon 9200", |
" 174b 7c12 Sapphire Radeon 9200", |
" 17af 200d Excalibur Radeon 9200", |
" 18bc 0050 GeXcube GC-R9200-C3 (Secondary)", |
" 5944 RV280 [Radeon 9200 SE (PCI)]", |
" 5950 RS480 Host Bridge", |
" 1025 0080 Aspire 5024WLMMi", |
" 103c 308b MX6125", |
" 5951 ATI Radeon Xpress 200 (RS480/RS482/RX480/RX482) Chipset - Host bridge", |
" 5954 RS480 [Radeon Xpress 200G Series]", |
" 1002 5954 RV370 [Radeon Xpress 200G Series]", |
" 5955 ATI Radeon XPRESS 200M 5955 (PCIE)", |
" 1002 5955 RS480 0x5955 [ATI Radeon XPRESS 200M 5955 (PCIE)]", |
" 103c 308b MX6125", |
" 5960 RV280 [Radeon 9200 PRO]", |
" 5961 RV280 [Radeon 9200]", |
" 1002 2f72 All-in-Wonder 9200 Series", |
" 1019 4c30 Radeon 9200 VIVO", |
" 12ab 5961 YUAN SMARTVGA Radeon 9200", |
" 1458 4018 Gigabyte Radeon 9200", |
" 174b 7c13 Sapphire Radeon 9200", |
" 17af 200c Excalibur Radeon 9200", |
" 18bc 0050 Radeon 9200 Game Buster", |
" 18bc 0051 GeXcube GC-R9200-C3", |
" 18bc 0053 Radeon 9200 Game Buster VIVO", |
" 5962 RV280 [Radeon 9200]", |
" 5964 RV280 [Radeon 9200 SE]", |
" 1043 c006 ASUS Radeon 9200 SE / TD / 128M", |
" 1458 4018 Radeon 9200 SE", |
" 1458 4032 Radeon 9200 SE 128MB", |
" 147b 6191 R9200SE-DT", |
" 148c 2073 CN-AG92E", |
" 174b 7c13 Sapphire Radeon 9200 SE", |
" 1787 5964 Excalibur 9200SE VIVO 128M", |
" 17af 2012 Radeon 9200 SE Excalibur", |
" 18bc 0170 Sapphire Radeon 9200 SE 128MB Game Buster", |
" 18bc 0173 GC-R9200L(SE)-C3H [Radeon 9200 Game Buster]", |
" 5969 ES1000", |
" 5974 RS482 [Radeon Xpress 200]", |
" 5975 RS482 [Radeon Xpress 200M]", |
" 5a34 RS480 PCI-X Root Port", |
" 5a36 RS480 PCI Bridge", |
" 5a38 RS480 PCI Bridge", |
" 5a39 RS480 PCI Bridge", |
" 5a3f RS480 PCI Bridge", |
" 5a41 RS400 [Radeon Xpress 200]", |
" 5a42 RS400 [Radeon Xpress 200M]", |
" 5a61 RC410 [Radeon Xpress 200]", |
" 5a62 RC410 [Radeon Xpress 200M]", |
" 5b60 RV370 5B60 [Radeon X300 (PCIE)]", |
" 1043 002a Extreme AX300SE-X", |
" 1043 032e Extreme AX300/TD", |
" 1462 0400 RX300SE-TD128E (MS-8940 REV:200)", |
" 1462 0402 RX300SE-TD128E (MS-8940)", |
" 5b62 RV370 5B62 [Radeon X600 (PCIE)]", |
" 5b63 RV370 [Sapphire X550 Silent]", |
" 5b64 RV370 5B64 [FireGL V3100 (PCIE)]", |
" 5b65 RV370 5B65 [FireGL D1100 (PCIE)]", |
" 5b70 RV370 [Radeon X300SE]", |
" 1462 0403 RX300SE-TD128E (MS-8940) (secondary display)", |
" 5b72 Radeon X600(RV380)", |
" 5b73 RV370 secondary [Sapphire X550 Silent]", |
" 5b74 RV370 5B64 [FireGL V3100 (PCIE)] (Secondary)", |
" 5c61 M9+ 5C61 [Radeon Mobility 9200 (AGP)]", |
" 5c63 M9+ 5C63 [Radeon Mobility 9200 (AGP)]", |
" 1002 5c63 Apple iBook G4 2004", |
" 5d44 RV280 [Radeon 9200 SE] (Secondary)", |
" 1458 4019 Radeon 9200 SE (Secondary)", |
" 1458 4032 Radeon 9200 SE 128MB", |
" 174b 7c12 Sapphire Radeon 9200 SE (Secondary)", |
" 1787 5965 Excalibur 9200SE VIVO 128M (Secondary)", |
" 17af 2013 Radeon 9200 SE Excalibur (Secondary)", |
" 18bc 0171 Radeon 9200 SE 128MB Game Buster (Secondary)", |
" 18bc 0172 GC-R9200L(SE)-C3H [Radeon 9200 Game Buster]", |
" 5d48 M28 [Radeon Mobility X800XT]", |
" 5d49 M28 [Mobility FireGL V5100]", |
" 5d4a Mobility Radeon X800", |
" 5d4d R480 [Radeon X850XT Platinum (PCIE)]", |
" 5d4f R480 [Radeon X800 GTO (PCIE)]", |
" 5d52 R480 [Radeon X850XT (PCIE)] (Primary)", |
" 1002 0b12 PowerColor X850XT PCIe Primary", |
" 1002 0b13 PowerColor X850XT PCIe Secondary", |
" 5d57 R423 5F57 [Radeon X800XT (PCIE)]", |
" 5d6d R480 [Radeon X850XT Platinum (PCIE)] (Secondary)", |
" 5d6f R480 [Radeon X800 GTO (PCIE)] (Secondary)", |
" 5d72 R480 [Radeon X850XT (PCIE)] (Secondary)", |
" 5d77 R423 5F57 [Radeon X800XT (PCIE)] (Secondary)", |
" 5e48 RV410 [FireGL V5000]", |
" 5e49 RV410 [FireGL V3300]", |
" 5e4a RV410 [Radeon X700XT]", |
" 5e4b RV410 [Radeon X700 Pro (PCIE)]", |
" 5e4c RV410 [Radeon X700SE]", |
" 5e4d RV410 [Radeon X700 (PCIE)]", |
" 148c 2116 PowerColor Bravo X700", |
" 5e4f RV410 [Radeon X700]", |
" 5e6b RV410 [Radeon X700 Pro (PCIE)] Secondary", |
" 5e6d RV410 [Radeon X700 (PCIE)] (Secondary)", |
" 148c 2117 PowerColor Bravo X700", |
" 5f57 R423 [Radeon X800XT (PCIE)]", |
" 700f PCI Bridge [IGP 320M]", |
" 7010 PCI Bridge [IGP 340M]", |
" 7100 R520 [Radeon X1800]", |
" 7105 R520 [FireGL]", |
" 7109 R520 [Radeon X1800]", |
" 1002 0322 All-in-Wonder X1800XL", |
" 1002 0d02 Radeon X1800 CrossFire Edition", |
" 7120 R520 [Radeon X1800] (Secondary)", |
" 7129 R520 [Radeon X1800] (Secondary)", |
" 1002 0323 All-in-Wonder X1800XL (Secondary)", |
" 1002 0d03 Radeon X1800 CrossFire Edition (Secondary)", |
" 7142 RV515 [Radeon X1300]", |
" 1002 0322 All-in-Wonder 2006 PCI-E Edition", |
" 7145 Radeon Mobility X1400", |
" 7146 RV515 [Radeon X1300]", |
" 1002 0322 All-in-Wonder 2006 PCI-E Edition", |
" 7149 M52 [ATI Mobility Radeon X1300]", |
" 714a M52 [ATI Mobility Radeon X1300]", |
" 714b M52 [ATI Mobility Radeon X1300]", |
" 714c M52 [ATI Mobility Radeon X1300]", |
" 7162 RV515 [Radeon X1300] (Secondary)", |
" 1002 0323 All-in-Wonder 2006 PCI-E Edition (Secondary)", |
" 7166 RV515 [Radeon X1300] (Secondary)", |
" 1002 0323 All-in-Wonder 2006 PCI-E Edition (Secondary)", |
" 71c0 RV530 [Radeon X1600]", |
" 71c2 RV530 [Radeon X1600]", |
" 71c4 M56GL [ATI Mobility FireGL V5200]", |
" 71c5 M56P [Radeon Mobility X1600]", |
" 71e0 RV530 [Radeon X1600] (Secondary)", |
" 71e2 RV530 [Radeon X1600] (Secondary)", |
" 7833 Radeon 9100 IGP Host Bridge", |
" 7834 Radeon 9100 PRO IGP", |
" 7835 Radeon Mobility 9200 IGP", |
" 7838 Radeon 9100 IGP PCI/AGP Bridge", |
" 7c37 RV350 AQ [Radeon 9600 SE]", |
" cab0 AGP Bridge [IGP 320M]", |
" cab2 RS200/RS200M AGP Bridge [IGP 340M]", |
" cab3 R200 AGP Bridge [Mobility Radeon 7000 IGP]", |
" cbb2 RS200/RS200M AGP Bridge [IGP 340M]", |
"1003 ULSI Systems", |
" 0201 US201", |
"1004 VLSI Technology Inc", |
" 0005 82C592-FC1", |
" 0006 82C593-FC1", |
" 0007 82C594-AFC2", |
" 0008 82C596/7 [Wildcat]", |
" 0009 82C597-AFC2", |
" 000c 82C541 [Lynx]", |
" 000d 82C543 [Lynx]", |
" 0101 82C532", |
" 0102 82C534 [Eagle]", |
" 0103 82C538", |
" 0104 82C535", |
" 0105 82C147", |
" 0200 82C975", |
" 0280 82C925", |
" 0304 QSound ThunderBird PCI Audio", |
" 1004 0304 QSound ThunderBird PCI Audio", |
" 122d 1206 DSP368 Audio", |
" 1483 5020 XWave Thunder 3D Audio", |
" 0305 QSound ThunderBird PCI Audio Gameport", |
" 1004 0305 QSound ThunderBird PCI Audio Gameport", |
" 122d 1207 DSP368 Audio Gameport", |
" 1483 5021 XWave Thunder 3D Audio Gameport", |
" 0306 QSound ThunderBird PCI Audio Support Registers", |
" 1004 0306 QSound ThunderBird PCI Audio Support Registers", |
" 122d 1208 DSP368 Audio Support Registers", |
" 1483 5022 XWave Thunder 3D Audio Support Registers", |
" 0307 Thunderbird", |
" 0308 Thunderbird", |
" 0702 VAS96011 [Golden Gate II]", |
" 0703 Tollgate", |
"1005 Avance Logic Inc. [ALI]", |
" 2064 ALG2032/2064", |
" 2128 ALG2364A", |
" 2301 ALG2301", |
" 2302 ALG2302", |
" 2364 ALG2364", |
" 2464 ALG2364A", |
" 2501 ALG2564A/25128A", |
"1006 Reply Group", |
"1007 NetFrame Systems Inc", |
"1008 Epson", |
"100a Phoenix Technologies", |
"100b National Semiconductor Corporation", |
" 0001 DP83810", |
" 0002 87415/87560 IDE", |
" 000e 87560 Legacy I/O", |
" 000f FireWire Controller", |
" 0011 NS87560 National PCI System I/O", |
" 0012 USB Controller", |
" 0020 DP83815 (MacPhyter) Ethernet Controller", |
" 103c 0024 Pavilion ze4400 builtin Network", |
" 12d9 000c Aculab E1/T1 PMXc cPCI carrier card", |
" 1385 f311 FA311 / FA312 (FA311 with WoL HW)", |
" 0021 PC87200 PCI to ISA Bridge", |
" 0022 DP83820 10/100/1000 Ethernet Controller", |
" 0028 Geode GX2 Host Bridge", |
" 002a CS5535 South Bridge", |
" 002b CS5535 ISA bridge", |
" 002d CS5535 IDE", |
" 002e CS5535 Audio", |
" 002f CS5535 USB", |
" 0030 Geode GX2 Graphics Processor", |
" 0035 DP83065 [Saturn] 10/100/1000 Ethernet Controller", |
" 0500 SCx200 Bridge", |
" 0501 SCx200 SMI", |
" 0502 SCx200 IDE", |
" 0503 SCx200 Audio", |
" 0504 SCx200 Video", |
" 0505 SCx200 XBus", |
" 0510 SC1100 Bridge", |
" 0511 SC1100 SMI", |
" 0515 SC1100 XBus", |
" d001 87410 IDE", |
"100c Tseng Labs Inc", |
" 3202 ET4000/W32p rev A", |
" 3205 ET4000/W32p rev B", |
" 3206 ET4000/W32p rev C", |
" 3207 ET4000/W32p rev D", |
" 3208 ET6000", |
" 4702 ET6300", |
"100d AST Research Inc", |
"100e Weitek", |
" 9000 P9000 Viper", |
" 9001 P9000 Viper", |
" 9002 P9000 Viper", |
" 9100 P9100 Viper Pro/SE", |
"1010 Video Logic, Ltd.", |
"1011 Digital Equipment Corporation", |
" 0001 DECchip 21050", |
" 0002 DECchip 21040 [Tulip]", |
" 0004 DECchip 21030 [TGA]", |
" 0007 NVRAM [Zephyr NVRAM]", |
" 0008 KZPSA [KZPSA]", |
" 0009 DECchip 21140 [FasterNet]", |
" 1025 0310 21140 Fast Ethernet", |
" 10b8 2001 SMC9332BDT EtherPower 10/100", |
" 10b8 2002 SMC9332BVT EtherPower T4 10/100", |
" 10b8 2003 SMC9334BDT EtherPower 10/100 (1-port)", |
" 1109 2400 ANA-6944A/TX Fast Ethernet", |
" 1112 2300 RNS2300 Fast Ethernet", |
" 1112 2320 RNS2320 Fast Ethernet", |
" 1112 2340 RNS2340 Fast Ethernet", |
" 1113 1207 EN-1207-TX Fast Ethernet", |
" 1186 1100 DFE-500TX Fast Ethernet", |
" 1186 1112 DFE-570TX Fast Ethernet", |
" 1186 1140 DFE-660 Cardbus Ethernet 10/100", |
" 1186 1142 DFE-660 Cardbus Ethernet 10/100", |
" 11f6 0503 Freedomline Fast Ethernet", |
" 1282 9100 AEF-380TXD Fast Ethernet", |
" 1385 1100 FA310TX Fast Ethernet", |
" 2646 0001 KNE100TX Fast Ethernet", |
" 000a 21230 Video Codec", |
" 000d PBXGB [TGA2]", |
" 000f PCI-to-PDQ Interface Chip [PFI]", |
" 1011 def1 FDDI controller (DEFPA)", |
" 103c def1 FDDI controller (3X-DEFPA)", |
" 0014 DECchip 21041 [Tulip Pass 3]", |
" 1186 0100 DE-530+", |
" 0016 DGLPB [OPPO]", |
" 0017 PV-PCI Graphics Controller (ZLXp-L)", |
" 0019 DECchip 21142/43", |
" 1011 500a DE500A Fast Ethernet", |
" 1011 500b DE500B Fast Ethernet", |
" 1014 0001 10/100 EtherJet Cardbus", |
" 1025 0315 ALN315 Fast Ethernet", |
" 1033 800c PC-9821-CS01 100BASE-TX Interface Card", |
" 1033 800d PC-9821NR-B06 100BASE-TX Interface Card", |
" 108d 0016 Rapidfire 2327 10/100 Ethernet", |
" 108d 0017 GoCard 2250 Ethernet 10/100 Cardbus", |
" 10b8 2005 SMC8032DT Extreme Ethernet 10/100", |
" 10b8 8034 SMC8034 Extreme Ethernet 10/100", |
" 10ef 8169 Cardbus Fast Ethernet", |
" 1109 2a00 ANA-6911A/TX Fast Ethernet", |
" 1109 2b00 ANA-6911A/TXC Fast Ethernet", |
" 1109 3000 ANA-6922/TX Fast Ethernet", |
" 1113 1207 Cheetah Fast Ethernet", |
" 1113 2220 Cardbus Fast Ethernet", |
" 115d 0002 Cardbus Ethernet 10/100", |
" 1179 0203 Fast Ethernet", |
" 1179 0204 Cardbus Fast Ethernet", |
" 1186 1100 DFE-500TX Fast Ethernet", |
" 1186 1101 DFE-500TX Fast Ethernet", |
" 1186 1102 DFE-500TX Fast Ethernet", |
" 1186 1112 DFE-570TX Quad Fast Ethernet", |
" 1259 2800 AT-2800Tx Fast Ethernet", |
" 1266 0004 Eagle Fast EtherMAX", |
" 12af 0019 NetFlyer Cardbus Fast Ethernet", |
" 1374 0001 Cardbus Ethernet Card 10/100", |
" 1374 0002 Cardbus Ethernet Card 10/100", |
" 1374 0007 Cardbus Ethernet Card 10/100", |
" 1374 0008 Cardbus Ethernet Card 10/100", |
" 1385 2100 FA510", |
" 1395 0001 10/100 Ethernet CardBus PC Card", |
" 13d1 ab01 EtherFast 10/100 Cardbus (PCMPC200)", |
" 14cb 0100 LNDL-100N 100Base-TX Ethernet PC Card", |
" 8086 0001 EtherExpress PRO/100 Mobile CardBus 32", |
" 001a Farallon PN9000SX Gigabit Ethernet", |
" 0021 DECchip 21052", |
" 0022 DECchip 21150", |
" 0023 DECchip 21150", |
" 0024 DECchip 21152", |
" 0025 DECchip 21153", |
" 0026 DECchip 21154", |
" 0034 56k Modem Cardbus", |
" 1374 0003 56k Modem Cardbus", |
" 0045 DECchip 21553", |
" 0046 DECchip 21554", |
" 0e11 4050 Integrated Smart Array", |
" 0e11 4051 Integrated Smart Array", |
" 0e11 4058 Integrated Smart Array", |
" 103c 10c2 Hewlett-Packard NetRAID-4M", |
" 12d9 000a IP Telephony card", |
" 4c53 1050 CT7 mainboard", |
" 4c53 1051 CE7 mainboard", |
" 9005 0364 5400S (Mustang)", |
" 9005 0365 5400S (Mustang)", |
" 9005 1364 Dell PowerEdge RAID Controller 2", |
" 9005 1365 Dell PowerEdge RAID Controller 2", |
" e4bf 1000 CC8-1-BLUES", |
" 1065 StrongARM DC21285", |
" 1069 0020 DAC960P / DAC1164P", |
"1012 Micronics Computers Inc", |
"1013 Cirrus Logic", |
" 0038 GD 7548", |
" 0040 GD 7555 Flat Panel GUI Accelerator", |
" 004c GD 7556 Video/Graphics LCD/CRT Ctrlr", |
" 00a0 GD 5430/40 [Alpine]", |
" 00a2 GD 5432 [Alpine]", |
" 00a4 GD 5434-4 [Alpine]", |
" 00a8 GD 5434-8 [Alpine]", |
" 00ac GD 5436 [Alpine]", |
" 00b0 GD 5440", |
" 00b8 GD 5446", |
" 00bc GD 5480", |
" 1013 00bc CL-GD5480", |
" 00d0 GD 5462", |
" 00d2 GD 5462 [Laguna I]", |
" 00d4 GD 5464 [Laguna]", |
" 00d5 GD 5464 BD [Laguna]", |
" 00d6 GD 5465 [Laguna]", |
" 13ce 8031 Barco Metheus 2 Megapixel, Dual Head", |
" 13cf 8031 Barco Metheus 2 Megapixel, Dual Head", |
" 00e8 GD 5436U", |
" 1100 CL 6729", |
" 1110 PD 6832 PCMCIA/CardBus Ctrlr", |
" 1112 PD 6834 PCMCIA/CardBus Ctrlr", |
" 1113 PD 6833 PCMCIA/CardBus Ctrlr", |
" 1200 GD 7542 [Nordic]", |
" 1202 GD 7543 [Viking]", |
" 1204 GD 7541 [Nordic Light]", |
" 4000 MD 5620 [CLM Data Fax Voice]", |
" 4400 CD 4400", |
" 6001 CS 4610/11 [CrystalClear SoundFusion Audio Accelerator]", |
" 1014 1010 CS4610 SoundFusion Audio Accelerator", |
" 6003 CS 4614/22/24 [CrystalClear SoundFusion Audio Accelerator]", |
" 1013 4280 Crystal SoundFusion PCI Audio Accelerator", |
" 1014 0153 ThinkPad A20m", |
" 153b 1136 SiXPack 5.1+", |
" 1681 0050 Game Theater XP", |
" 1681 a011 Fortissimo III 7.1", |
" 6004 CS 4614/22/24 [CrystalClear SoundFusion Audio Accelerator]", |
" 6005 Crystal CS4281 PCI Audio", |
" 1013 4281 Crystal CS4281 PCI Audio", |
" 10cf 10a8 Crystal CS4281 PCI Audio", |
" 10cf 10a9 Crystal CS4281 PCI Audio", |
" 10cf 10aa Crystal CS4281 PCI Audio", |
" 10cf 10ab Crystal CS4281 PCI Audio", |
" 10cf 10ac Crystal CS4281 PCI Audio", |
" 10cf 10ad Crystal CS4281 PCI Audio", |
" 10cf 10b4 Crystal CS4281 PCI Audio", |
" 1179 0001 Crystal CS4281 PCI Audio", |
" 14c0 000c Crystal CS4281 PCI Audio", |
"1014 IBM", |
" 0002 PCI to MCA Bridge", |
" 0005 Alta Lite", |
" 0007 Alta MP", |
" 000a Fire Coral", |
" 0017 CPU to PCI Bridge", |
" 0018 TR Auto LANstreamer", |
" 001b GXT-150P", |
" 001c Carrera", |
" 001d 82G2675", |
" 0020 GXT1000 Graphics Adapter", |
" 0022 IBM27-82351", |
" 002d Python", |
" 002e SCSI RAID Adapter [ServeRAID]", |
" 1014 002e ServeRAID-3x", |
" 1014 022e ServeRAID-4H", |
" 0031 2 Port Serial Adapter", |
" 1014 0031 2721 WAN IOA - 2 Port Sync Serial Adapter", |
" 0036 Miami", |
" 0037 82660 CPU to PCI Bridge", |
" 003a CPU to PCI Bridge", |
" 003c GXT250P/GXT255P Graphics Adapter", |
" 003e 16/4 Token ring UTP/STP controller", |
" 1014 003e Token-Ring Adapter", |
" 1014 00cd Token-Ring Adapter + Wake-On-LAN", |
" 1014 00ce 16/4 Token-Ring Adapter 2", |
" 1014 00cf 16/4 Token-Ring Adapter Special", |
" 1014 00e4 High-Speed 100/16/4 Token-Ring Adapter", |
" 1014 00e5 16/4 Token-Ring Adapter 2 + Wake-On-LAN", |
" 1014 016d iSeries 2744 Card", |
" 0045 SSA Adapter", |
" 0046 MPIC interrupt controller", |
" 0047 PCI to PCI Bridge", |
" 0048 PCI to PCI Bridge", |
" 0049 Warhead SCSI Controller", |
" 004e ATM Controller (14104e00)", |
" 004f ATM Controller (14104f00)", |
" 0050 ATM Controller (14105000)", |
" 0053 25 MBit ATM Controller", |
" 0054 GXT500P/GXT550P Graphics Adapter", |
" 0057 MPEG PCI Bridge", |
" 005c i82557B 10/100", |
" 005e GXT800P Graphics Adapter", |
" 007c ATM Controller (14107c00)", |
" 007d 3780IDSP [MWave]", |
" 008b EADS PCI to PCI Bridge", |
" 008e GXT3000P Graphics Adapter", |
" 0090 GXT 3000P", |
" 1014 008e GXT-3000P", |
" 0091 SSA Adapter", |
" 0095 20H2999 PCI Docking Bridge", |
" 0096 Chukar chipset SCSI controller", |
" 1014 0097 iSeries 2778 DASD IOA", |
" 1014 0098 iSeries 2763 DASD IOA", |
" 1014 0099 iSeries 2748 DASD IOA", |
" 009f PCI 4758 Cryptographic Accelerator", |
" 00a5 ATM Controller (1410a500)", |
" 00a6 ATM 155MBPS MM Controller (1410a600)", |
" 00b7 256-bit Graphics Rasterizer [Fire GL1]", |
" 1092 00b8 FireGL1 AGP 32Mb", |
" 00b8 GXT2000P Graphics Adapter", |
" 00be ATM 622MBPS Controller (1410be00)", |
" 00dc Advanced Systems Management Adapter (ASMA)", |
" 00fc CPC710 Dual Bridge and Memory Controller (PCI-64)", |
" 0104 Gigabit Ethernet-SX Adapter", |
" 0105 CPC710 Dual Bridge and Memory Controller (PCI-32)", |
" 010f Remote Supervisor Adapter (RSA)", |
" 0142 Yotta Video Compositor Input", |
" 1014 0143 Yotta Input Controller (ytin)", |
" 0144 Yotta Video Compositor Output", |
" 1014 0145 Yotta Output Controller (ytout)", |
" 0156 405GP PLB to PCI Bridge", |
" 015e 622Mbps ATM PCI Adapter", |
" 0160 64bit/66MHz PCI ATM 155 MMF", |
" 016e GXT4000P Graphics Adapter", |
" 0170 GXT6000P Graphics Adapter", |
" 017d GXT300P Graphics Adapter", |
" 0180 Snipe chipset SCSI controller", |
" 1014 0241 iSeries 2757 DASD IOA", |
" 1014 0264 Quad Channel PCI-X U320 SCSI RAID Adapter (2780)", |
" 0188 EADS-X PCI-X to PCI-X Bridge", |
" 01a7 PCI-X to PCI-X Bridge", |
" 01bd ServeRAID Controller", |
" 1014 01be ServeRAID-4M", |
" 1014 01bf ServeRAID-4L", |
" 1014 0208 ServeRAID-4Mx", |
" 1014 020e ServeRAID-4Lx", |
" 1014 022e ServeRAID-4H", |
" 1014 0258 ServeRAID-5i", |
" 1014 0259 ServeRAID-5i", |
" 01c1 64bit/66MHz PCI ATM 155 UTP", |
" 01e6 Cryptographic Accelerator", |
" 01ff 10/100 Mbps Ethernet", |
" 0219 Multiport Serial Adapter", |
" 1014 021a Dual RVX", |
" 1014 0251 Internal Modem/RVX", |
" 1014 0252 Quad Internal Modem", |
" 021b GXT6500P Graphics Adapter", |
" 021c GXT4500P Graphics Adapter", |
" 0233 GXT135P Graphics Adapter", |
" 0266 PCI-X Dual Channel SCSI", |
" 0268 Gigabit Ethernet-SX Adapter (PCI-X)", |
" 0269 10/100/1000 Base-TX Ethernet Adapter (PCI-X)", |
" 028c Citrine chipset SCSI controller", |
" 1014 028d Dual Channel PCI-X DDR SAS RAID Adapter (572E)", |
" 1014 02be Dual Channel PCI-X DDR U320 SCSI RAID Adapter (571B)", |
" 1014 02c0 Dual Channel PCI-X DDR U320 SCSI Adapter (571A)", |
" 1014 030d PCI-X DDR Auxiliary Cache Adapter (575B)", |
" 02a1 Calgary PCI-X Host Bridge", |
" 02bd Obsidian chipset SCSI controller", |
" 1014 02c1 PCI-X DDR 3Gb SAS Adapter (572A/572C)", |
" 1014 02c2 PCI-X DDR 3Gb SAS RAID Adapter (572B/571D)", |
" 0302 Winnipeg PCI-X Host Bridge", |
" 0314 ZISC 036 Neural accelerator card", |
" 3022 QLA3022 Network Adapter", |
" 4022 QLA3022 Network Adapter", |
" ffff MPIC-2 interrupt controller", |
"1015 LSI Logic Corp of Canada", |
"1016 ICL Personal Systems", |
"1017 SPEA Software AG", |
" 5343 SPEA 3D Accelerator", |
"1018 Unisys Systems", |
"1019 Elitegroup Computer Systems", |
"101a AT&T GIS (NCR)", |
" 0005 100VG ethernet", |
"101b Vitesse Semiconductor", |
"101c Western Digital", |
" 0193 33C193A", |
" 0196 33C196A", |
" 0197 33C197A", |
" 0296 33C296A", |
" 3193 7193", |
" 3197 7197", |
" 3296 33C296A", |
" 4296 34C296", |
" 9710 Pipeline 9710", |
" 9712 Pipeline 9712", |
" c24a 90C", |
"101e American Megatrends Inc.", |
" 0009 MegaRAID 428 Ultra RAID Controller (rev 03)", |
" 1960 MegaRAID", |
" 101e 0471 MegaRAID 471 Enterprise 1600 RAID Controller", |
" 101e 0475 MegaRAID 475 Express 500/500LC RAID Controller", |
" 101e 0477 MegaRAID 477 Elite 3100 RAID Controller", |
" 101e 0493 MegaRAID 493 Elite 1600 RAID Controller", |
" 101e 0494 MegaRAID 494 Elite 1650 RAID Controller", |
" 101e 0503 MegaRAID 503 Enterprise 1650 RAID Controller", |
" 101e 0511 MegaRAID 511 i4 IDE RAID Controller", |
" 101e 0522 MegaRAID 522 i4133 RAID Controller", |
" 1028 0471 PowerEdge RAID Controller 3/QC", |
" 1028 0475 PowerEdge RAID Controller 3/SC", |
" 1028 0493 PowerEdge RAID Controller 3/DC", |
" 1028 0511 PowerEdge Cost Effective RAID Controller ATA100/4Ch", |
" 103c 60e7 NetRAID-1M", |
" 9010 MegaRAID 428 Ultra RAID Controller", |
" 9030 EIDE Controller", |
" 9031 EIDE Controller", |
" 9032 EIDE & SCSI Controller", |
" 9033 SCSI Controller", |
" 9040 Multimedia card", |
" 9060 MegaRAID 434 Ultra GT RAID Controller", |
" 9063 MegaRAC", |
" 101e 0767 Dell Remote Assistant Card 2", |
"101f PictureTel", |
"1020 Hitachi Computer Products", |
"1021 OKI Electric Industry Co. Ltd.", |
"1022 Advanced Micro Devices [AMD]", |
" 1100 K8 [Athlon64/Opteron] HyperTransport Technology Configuration", |
" 1101 K8 [Athlon64/Opteron] Address Map", |
" 1102 K8 [Athlon64/Opteron] DRAM Controller", |
" 1103 K8 [Athlon64/Opteron] Miscellaneous Control", |
" 2000 79c970 [PCnet32 LANCE]", |
" 1014 2000 NetFinity 10/100 Fast Ethernet", |
" 1022 2000 PCnet - Fast 79C971", |
" 103c 104c Ethernet with LAN remote power Adapter", |
" 103c 1064 Ethernet with LAN remote power Adapter", |
" 103c 1065 Ethernet with LAN remote power Adapter", |
" 103c 106c Ethernet with LAN remote power Adapter", |
" 103c 106e Ethernet with LAN remote power Adapter", |
" 103c 10ea Ethernet with LAN remote power Adapter", |
" 1113 1220 EN1220 10/100 Fast Ethernet", |
" 1259 2450 AT-2450 10/100 Fast Ethernet", |
" 1259 2454 AT-2450v4 10Mb Ethernet Adapter", |
" 1259 2700 AT-2700TX 10/100 Fast Ethernet", |
" 1259 2701 AT-2700FX 100Mb Ethernet", |
" 1259 2702 AT-2700FTX 10/100 Mb Fiber/Copper Fast Ethernet", |
" 1259 2703 AT-2701FX", |
" 4c53 1000 CC7/CR7/CP7/VC7/VP7/VR7 mainboard", |
" 4c53 1010 CP5/CR6 mainboard", |
" 4c53 1020 VR6 mainboard", |
" 4c53 1030 PC5 mainboard", |
" 4c53 1040 CL7 mainboard", |
" 4c53 1060 PC7 mainboard", |
" 2001 79c978 [HomePNA]", |
" 1092 0a78 Multimedia Home Network Adapter", |
" 1668 0299 ActionLink Home Network Adapter", |
" 2003 Am 1771 MBW [Alchemy]", |
" 2020 53c974 [PCscsi]", |
" 2040 79c974", |
" 2081 Geode LX Video", |
" 2082 Geode LX AES Security Block", |
" 208f CS5536 GeodeLink PCI South Bridge", |
" 2090 CS5536 [Geode companion] ISA", |
" 2091 CS5536 [Geode companion] FLASH", |
" 2093 CS5536 [Geode companion] Audio", |
" 2094 CS5536 [Geode companion] OHC", |
" 2095 CS5536 [Geode companion] EHC", |
" 2096 CS5536 [Geode companion] UDC", |
" 2097 CS5536 [Geode companion] UOC", |
" 209a CS5536 [Geode companion] IDE", |
" 3000 ELanSC520 Microcontroller", |
" 7006 AMD-751 [Irongate] System Controller", |
" 7007 AMD-751 [Irongate] AGP Bridge", |
" 700a AMD-IGR4 AGP Host to PCI Bridge", |
" 700b AMD-IGR4 PCI to PCI Bridge", |
" 700c AMD-760 MP [IGD4-2P] System Controller", |
" 700d AMD-760 MP [IGD4-2P] AGP Bridge", |
" 700e AMD-760 [IGD4-1P] System Controller", |
" 700f AMD-760 [IGD4-1P] AGP Bridge", |
" 7400 AMD-755 [Cobra] ISA", |
" 7401 AMD-755 [Cobra] IDE", |
" 7403 AMD-755 [Cobra] ACPI", |
" 7404 AMD-755 [Cobra] USB", |
" 7408 AMD-756 [Viper] ISA", |
" 7409 AMD-756 [Viper] IDE", |
" 740b AMD-756 [Viper] ACPI", |
" 740c AMD-756 [Viper] USB", |
" 7410 AMD-766 [ViperPlus] ISA", |
" 7411 AMD-766 [ViperPlus] IDE", |
" 7413 AMD-766 [ViperPlus] ACPI", |
" 7414 AMD-766 [ViperPlus] USB", |
" 7440 AMD-768 [Opus] ISA", |
" 1043 8044 A7M-D Mainboard", |
" 7441 AMD-768 [Opus] IDE", |
" 7443 AMD-768 [Opus] ACPI", |
" 1043 8044 A7M-D Mainboard", |
" 7445 AMD-768 [Opus] Audio", |
" 7446 AMD-768 [Opus] MC97 Modem (Smart Link HAMR5600 compatible)", |
" 7448 AMD-768 [Opus] PCI", |
" 7449 AMD-768 [Opus] USB", |
" 7450 AMD-8131 PCI-X Bridge", |
" 7451 AMD-8131 PCI-X IOAPIC", |
" 7454 AMD-8151 System Controller", |
" 7455 AMD-8151 AGP Bridge", |
" 7458 AMD-8132 PCI-X Bridge", |
" 7459 AMD-8132 PCI-X IOAPIC", |
" 7460 AMD-8111 PCI", |
" 161f 3017 HDAMB", |
" 7461 AMD-8111 USB", |
" 7462 AMD-8111 Ethernet", |
" 7464 AMD-8111 USB", |
" 161f 3017 HDAMB", |
" 7468 AMD-8111 LPC", |
" 161f 3017 HDAMB", |
" 7469 AMD-8111 IDE", |
" 1022 2b80 AMD-8111 IDE [Quartet]", |
" 161f 3017 HDAMB", |
" 746a AMD-8111 SMBus 2.0", |
" 746b AMD-8111 ACPI", |
" 161f 3017 HDAMB", |
" 746d AMD-8111 AC97 Audio", |
" 161f 3017 HDAMB", |
" 746e AMD-8111 MC97 Modem", |
" 756b AMD-8111 ACPI", |
"1023 Trident Microsystems", |
" 0194 82C194", |
" 2000 4DWave DX", |
" 2001 4DWave NX", |
" 122d 1400 Trident PCI288-Q3DII (NX)", |
" 2100 CyberBlade XP4m32", |
" 2200 XGI Volari XP5", |
" 8400 CyberBlade/i7", |
" 1023 8400 CyberBlade i7 AGP", |
" 8420 CyberBlade/i7d", |
" 0e11 b15a CyberBlade i7 AGP", |
" 8500 CyberBlade/i1", |
" 8520 CyberBlade i1", |
" 0e11 b16e CyberBlade i1 AGP", |
" 1023 8520 CyberBlade i1 AGP", |
" 8620 CyberBlade/i1", |
" 1014 0502 ThinkPad R30/T30", |
" 1014 1025 Travelmate 352TE", |
" 8820 CyberBlade XPAi1", |
" 9320 TGUI 9320", |
" 9350 GUI Accelerator", |
" 9360 Flat panel GUI Accelerator", |
" 9382 Cyber 9382 [Reference design]", |
" 9383 Cyber 9383 [Reference design]", |
" 9385 Cyber 9385 [Reference design]", |
" 9386 Cyber 9386", |
" 9388 Cyber 9388", |
" 9397 Cyber 9397", |
" 939a Cyber 9397DVD", |
" 9420 TGUI 9420", |
" 9430 TGUI 9430", |
" 9440 TGUI 9440", |
" 9460 TGUI 9460", |
" 9470 TGUI 9470", |
" 9520 Cyber 9520", |
" 9525 Cyber 9525", |
" 10cf 1094 Lifebook C6155", |
" 9540 Cyber 9540", |
" 9660 TGUI 9660/938x/968x", |
" 9680 TGUI 9680", |
" 9682 TGUI 9682", |
" 9683 TGUI 9683", |
" 9685 ProVIDIA 9685", |
" 9750 3DImage 9750", |
" 1014 9750 3DImage 9750", |
" 1023 9750 3DImage 9750", |
" 9753 TGUI 9753", |
" 9754 TGUI 9754", |
" 9759 TGUI 975", |
" 9783 TGUI 9783", |
" 9785 TGUI 9785", |
" 9850 3DImage 9850", |
" 9880 Blade 3D PCI/AGP", |
" 1023 9880 Blade 3D", |
" 9910 CyberBlade/XP", |
" 9930 CyberBlade/XPm", |
"1024 Zenith Data Systems", |
"1025 Acer Incorporated [ALI]", |
" 1435 M1435", |
" 1445 M1445", |
" 1449 M1449", |
" 1451 M1451", |
" 1461 M1461", |
" 1489 M1489", |
" 1511 M1511", |
" 1512 ALI M1512 Aladdin", |
" 1513 M1513", |
" 1521 ALI M1521 Aladdin III CPU Bridge", |
" 10b9 1521 ALI M1521 Aladdin III CPU Bridge", |
" 1523 ALI M1523 ISA Bridge", |
" 10b9 1523 ALI M1523 ISA Bridge", |
" 1531 M1531 Northbridge [Aladdin IV/IV+]", |
" 1533 M1533 PCI-to-ISA Bridge", |
" 10b9 1533 ALI M1533 Aladdin IV/V ISA South Bridge", |
" 1535 M1535 PCI Bridge + Super I/O + FIR", |
" 1541 M1541 Northbridge [Aladdin V]", |
" 10b9 1541 ALI M1541 Aladdin V/V+ AGP+PCI North Bridge", |
" 1542 M1542 Northbridge [Aladdin V]", |
" 1543 M1543 PCI-to-ISA Bridge + Super I/O + FIR", |
" 1561 M1561 Northbridge [Aladdin 7]", |
" 1621 M1621 Northbridge [Aladdin-Pro II]", |
" 1631 M1631 Northbridge+3D Graphics [Aladdin TNT2]", |
" 1641 M1641 Northbridge [Aladdin-Pro IV]", |
" 1647 M1647 [MaGiK1] PCI North Bridge", |
" 1671 M1671 Northbridge [ALADDiN-P4]", |
" 1672 Northbridge [CyberALADDiN-P4]", |
" 3141 M3141", |
" 3143 M3143", |
" 3145 M3145", |
" 3147 M3147", |
" 3149 M3149", |
" 3151 M3151", |
" 3307 M3307 MPEG-I Video Controller", |
" 3309 M3309 MPEG-II Video w/ Software Audio Decoder", |
" 3321 M3321 MPEG-II Audio/Video Decoder", |
" 5212 M4803", |
" 5215 ALI PCI EIDE Controller", |
" 5217 M5217H", |
" 5219 M5219", |
" 5225 M5225", |
" 5229 M5229", |
" 5235 M5235", |
" 5237 M5237 PCI USB Host Controller", |
" 5240 EIDE Controller", |
" 5241 PCMCIA Bridge", |
" 5242 General Purpose Controller", |
" 5243 PCI to PCI Bridge Controller", |
" 5244 Floppy Disk Controller", |
" 5247 M1541 PCI to PCI Bridge", |
" 5251 M5251 P1394 Controller", |
" 5427 PCI to AGP Bridge", |
" 5451 M5451 PCI AC-Link Controller Audio Device", |
" 5453 M5453 PCI AC-Link Controller Modem Device", |
" 7101 M7101 PCI PMU Power Management Controller", |
" 10b9 7101 M7101 PCI PMU Power Management Controller", |
"1028 Dell", |
" 0001 PowerEdge Expandable RAID Controller 2/Si", |
" 1028 0001 PowerEdge 2400", |
" 0002 PowerEdge Expandable RAID Controller 3/Di", |
" 1028 0002 PowerEdge 4400", |
" 0003 PowerEdge Expandable RAID Controller 3/Si", |
" 1028 0003 PowerEdge 2450", |
" 0006 PowerEdge Expandable RAID Controller 3/Di", |
" 0007 Remote Access Card III", |
" 0008 Remote Access Card III", |
" 0009 Remote Access Card III: BMC/SMIC device not present", |
" 000a PowerEdge Expandable RAID Controller 3/Di", |
" 000c Embedded Remote Access or ERA/O", |
" 000d Embedded Remote Access: BMC/SMIC device", |
" 000e PowerEdge Expandable RAID controller 4/Di", |
" 000f PowerEdge Expandable RAID controller 4/Di", |
" 0010 Remote Access Card 4", |
" 0011 Remote Access Card 4 Daughter Card", |
" 0012 Remote Access Card 4 Daughter Card Virtual UART", |
" 0013 PowerEdge Expandable RAID controller 4", |
" 1028 016c PowerEdge Expandable RAID Controller 4e/Si", |
" 1028 016d PowerEdge Expandable RAID Controller 4e/Di", |
" 1028 016e PowerEdge Expandable RAID Controller 4e/Di", |
" 1028 016f PowerEdge Expandable RAID Controller 4e/Di", |
" 1028 0170 PowerEdge Expandable RAID Controller 4e/Di", |
" 0014 Remote Access Card 4 Daughter Card SMIC interface", |
" 0015 PowerEdge Expandable RAID controller 5", |
"1029 Siemens Nixdorf IS", |
"102a LSI Logic", |
" 0000 HYDRA", |
" 0010 ASPEN", |
" 001f AHA-2940U2/U2W /7890/7891 SCSI Controllers", |
" 9005 000f 2940U2W SCSI Controller", |
" 9005 0106 2940U2W SCSI Controller", |
" 9005 a180 2940U2W SCSI Controller", |
" 00c5 AIC-7899 U160/m SCSI Controller", |
" 1028 00c5 PowerEdge 2550/2650/4600", |
" 00cf AIC-7899P U160/m", |
" 1028 0106 PowerEdge 4600", |
" 1028 0121 PowerEdge 2650", |
"102b Matrox Graphics, Inc.", |
" 0010 MGA-I [Impression?]", |
" 0100 MGA 1064SG [Mystique]", |
" 0518 MGA-II [Athena]", |
" 0519 MGA 2064W [Millennium]", |
" 051a MGA 1064SG [Mystique]", |
" 102b 0100 MGA-1064SG Mystique", |
" 102b 1100 MGA-1084SG Mystique", |
" 102b 1200 MGA-1084SG Mystique", |
" 1100 102b MGA-1084SG Mystique", |
" 110a 0018 Scenic Pro C5 (D1025)", |
" 051b MGA 2164W [Millennium II]", |
" 102b 051b MGA-2164W Millennium II", |
" 102b 1100 MGA-2164W Millennium II", |
" 102b 1200 MGA-2164W Millennium II", |
" 051e MGA 1064SG [Mystique] AGP", |
" 051f MGA 2164W [Millennium II] AGP", |
" 0520 MGA G200", |
" 102b dbc2 G200 Multi-Monitor", |
" 102b dbc8 G200 Multi-Monitor", |
" 102b dbe2 G200 Multi-Monitor", |
" 102b dbe8 G200 Multi-Monitor", |
" 102b ff03 Millennium G200 SD", |
" 102b ff04 Marvel G200", |
" 0521 MGA G200 AGP", |
" 1014 ff03 Millennium G200 AGP", |
" 102b 48e9 Mystique G200 AGP", |
" 102b 48f8 Millennium G200 SD AGP", |
" 102b 4a60 Millennium G200 LE AGP", |
" 102b 4a64 Millennium G200 AGP", |
" 102b c93c Millennium G200 AGP", |
" 102b c9b0 Millennium G200 AGP", |
" 102b c9bc Millennium G200 AGP", |
" 102b ca60 Millennium G250 LE AGP", |
" 102b ca6c Millennium G250 AGP", |
" 102b dbbc Millennium G200 AGP", |
" 102b dbc2 Millennium G200 MMS (Dual G200)", |
" 102b dbc3 G200 Multi-Monitor", |
" 102b dbc8 Millennium G200 MMS (Dual G200)", |
" 102b dbd2 G200 Multi-Monitor", |
" 102b dbd3 G200 Multi-Monitor", |
" 102b dbd4 G200 Multi-Monitor", |
" 102b dbd5 G200 Multi-Monitor", |
" 102b dbd8 G200 Multi-Monitor", |
" 102b dbd9 G200 Multi-Monitor", |
" 102b dbe2 Millennium G200 MMS (Quad G200)", |
" 102b dbe3 G200 Multi-Monitor", |
" 102b dbe8 Millennium G200 MMS (Quad G200)", |
" 102b dbf2 G200 Multi-Monitor", |
" 102b dbf3 G200 Multi-Monitor", |
" 102b dbf4 G200 Multi-Monitor", |
" 102b dbf5 G200 Multi-Monitor", |
" 102b dbf8 G200 Multi-Monitor", |
" 102b dbf9 G200 Multi-Monitor", |
" 102b f806 Mystique G200 Video AGP", |
" 102b ff00 MGA-G200 AGP", |
" 102b ff02 Mystique G200 AGP", |
" 102b ff03 Millennium G200 AGP", |
" 102b ff04 Marvel G200 AGP", |
" 110a 0032 MGA-G200 AGP", |
" 0522 MGA G200e [Pilot] ServerEngines (SEP1)", |
" 0525 MGA G400/G450", |
" 0e11 b16f MGA-G400 AGP", |
" 102b 0328 Millennium G400 16Mb SDRAM", |
" 102b 0338 Millennium G400 16Mb SDRAM", |
" 102b 0378 Millennium G400 32Mb SDRAM", |
" 102b 0541 Millennium G450 Dual Head", |
" 102b 0542 Millennium G450 Dual Head LX", |
" 102b 0543 Millennium G450 Single Head LX", |
" 102b 0641 Millennium G450 32Mb SDRAM Dual Head", |
" 102b 0642 Millennium G450 32Mb SDRAM Dual Head LX", |
" 102b 0643 Millennium G450 32Mb SDRAM Single Head LX", |
" 102b 07c0 Millennium G450 Dual Head LE", |
" 102b 07c1 Millennium G450 SDR Dual Head LE", |
" 102b 0d41 Millennium G450 Dual Head PCI", |
" 102b 0d42 Millennium G450 Dual Head LX PCI", |
" 102b 0d43 Millennium G450 32Mb Dual Head PCI", |
" 102b 0e00 Marvel G450 eTV", |
" 102b 0e01 Marvel G450 eTV", |
" 102b 0e02 Marvel G450 eTV", |
" 102b 0e03 Marvel G450 eTV", |
" 102b 0f80 Millennium G450 Low Profile", |
" 102b 0f81 Millennium G450 Low Profile", |
" 102b 0f82 Millennium G450 Low Profile DVI", |
" 102b 0f83 Millennium G450 Low Profile DVI", |
" 102b 19d8 Millennium G400 16Mb SGRAM", |
" 102b 19f8 Millennium G400 32Mb SGRAM", |
" 102b 2159 Millennium G400 Dual Head 16Mb", |
" 102b 2179 Millennium G400 MAX/Dual Head 32Mb", |
" 102b 217d Millennium G400 Dual Head Max", |
" 102b 23c0 Millennium G450", |
" 102b 23c1 Millennium G450", |
" 102b 23c2 Millennium G450 DVI", |
" 102b 23c3 Millennium G450 DVI", |
" 102b 2f58 Millennium G400", |
" 102b 2f78 Millennium G400", |
" 102b 3693 Marvel G400 AGP", |
" 102b 5dd0 4Sight II", |
" 102b 5f50 4Sight II", |
" 102b 5f51 4Sight II", |
" 102b 5f52 4Sight II", |
" 102b 9010 Millennium G400 Dual Head", |
" 1458 0400 GA-G400", |
" 1705 0001 Millennium G450 32MB SGRAM", |
" 1705 0002 Millennium G450 16MB SGRAM", |
" 1705 0003 Millennium G450 32MB", |
" 1705 0004 Millennium G450 16MB", |
" 0527 MGA Parhelia AGP", |
" 102b 0840 Parhelia 128Mb", |
" 102b 0850 Parhelia 256MB AGP 4X", |
" 0528 Parhelia 8X", |
" 102b 1020 Parhelia 128MB", |
" 102b 1030 Parhelia 256 MB Dual DVI", |
" 102b 14e1 Parhelia PCI 256MB", |
" 102b 2021 QID Pro", |
" 0d10 MGA Ultima/Impression", |
" 1000 MGA G100 [Productiva]", |
" 102b ff01 Productiva G100", |
" 102b ff05 Productiva G100 Multi-Monitor", |
" 1001 MGA G100 [Productiva] AGP", |
" 102b 1001 MGA-G100 AGP", |
" 102b ff00 MGA-G100 AGP", |
" 102b ff01 MGA-G100 Productiva AGP", |
" 102b ff03 Millennium G100 AGP", |
" 102b ff04 MGA-G100 AGP", |
" 102b ff05 MGA-G100 Productiva AGP Multi-Monitor", |
" 110a 001e MGA-G100 AGP", |
" 2007 MGA Mistral", |
" 2527 MGA G550 AGP", |
" 102b 0f83 Millennium G550", |
" 102b 0f84 Millennium G550 Dual Head DDR 32Mb", |
" 102b 1e41 Millennium G550", |
" 2537 Millenium P650/P750", |
" 102b 1820 Millennium P750 64MB", |
" 102b 1830 Millennium P650 64MB", |
" 102b 1c10 QID 128MB", |
" 102b 2811 Millennium P650 Low-profile PCI 64MB", |
" 102b 2c11 QID Low-profile PCI", |
" 2538 Millenium P650 PCIe", |
" 102b 08c7 Millennium P650 PCIe 128MB", |
" 102b 0907 Millennium P650 PCIe 64MB", |
" 102b 1047 Millennium P650 LP PCIe 128MB", |
" 102b 1087 Millennium P650 LP PCIe 64MB", |
" 102b 2538 Parhelia APVe", |
" 102b 3007 QID Low-profile PCIe", |
" 4536 VIA Framegrabber", |
" 6573 Shark 10/100 Multiport SwitchNIC", |
"102c Chips and Technologies", |
" 00b8 F64310", |
" 00c0 F69000 HiQVideo", |
" 102c 00c0 F69000 HiQVideo", |
" 4c53 1000 CC7/CR7/CP7/VC7/VP7/VR7 mainboard", |
" 4c53 1010 CP5/CR6 mainboard", |
" 4c53 1020 VR6 mainboard", |
" 4c53 1030 PC5 mainboard", |
" 4c53 1050 CT7 mainboard", |
" 4c53 1051 CE7 mainboard", |
" 00d0 F65545", |
" 00d8 F65545", |
" 00dc F65548", |
" 00e0 F65550", |
" 00e4 F65554", |
" 00e5 F65555 HiQVPro", |
" 0e11 b049 Armada 1700 Laptop Display Controller", |
" 1179 0001 Satellite Pro", |
" 00f0 F68554", |
" 00f4 F68554 HiQVision", |
" 00f5 F68555", |
" 0c30 F69030", |
" 4c53 1000 CC7/CR7/CP7/VC7/VP7/VR7 mainboard", |
" 4c53 1050 CT7 mainboard", |
" 4c53 1051 CE7 mainboard", |
" 4c53 1080 CT8 mainboard", |
"102d Wyse Technology Inc.", |
" 50dc 3328 Audio", |
"102e Olivetti Advanced Technology", |
"102f Toshiba America", |
" 0009 r4x00", |
" 000a TX3927 MIPS RISC PCI Controller", |
" 0020 ATM Meteor 155", |
" 102f 00f8 ATM Meteor 155", |
" 0030 TC35815CF PCI 10/100 Mbit Ethernet Controller", |
" 0031 TC35815CF PCI 10/100 Mbit Ethernet Controller with WOL", |
" 0105 TC86C001 [goku-s] IDE", |
" 0106 TC86C001 [goku-s] USB 1.1 Host", |
" 0107 TC86C001 [goku-s] USB Device Controller", |
" 0108 TC86C001 [goku-s] I2C/SIO/GPIO Controller", |
" 0180 TX4927/38 MIPS RISC PCI Controller", |
" 0181 TX4925 MIPS RISC PCI Controller", |
" 0182 TX4937 MIPS RISC PCI Controller", |
"1030 TMC Research", |
"1031 Miro Computer Products AG", |
" 5601 DC20 ASIC", |
" 5607 Video I/O & motion JPEG compressor", |
" 5631 Media 3D", |
" 6057 MiroVideo DC10/DC30+", |
"1032 Compaq", |
"1033 NEC Corporation", |
" 0000 Vr4181A USB Host or Function Control Unit", |
" 0001 PCI to 486-like bus Bridge", |
" 0002 PCI to VL98 Bridge", |
" 0003 ATM Controller", |
" 0004 R4000 PCI Bridge", |
" 0005 PCI to 486-like bus Bridge", |
" 0006 PC-9800 Graphic Accelerator", |
" 0007 PCI to UX-Bus Bridge", |
" 0008 PC-9800 Graphic Accelerator", |
" 0009 PCI to PC9800 Core-Graph Bridge", |
" 0016 PCI to VL Bridge", |
" 001a [Nile II]", |
" 0021 Vrc4373 [Nile I]", |
" 0029 PowerVR PCX1", |
" 002a PowerVR 3D", |
" 002c Star Alpha 2", |
" 002d PCI to C-bus Bridge", |
" 0035 USB", |
" 1033 0035 Hama USB 2.0 CardBus", |
" 1179 0001 USB", |
" 12ee 7000 Root Hub", |
" 14c2 0105 PTI-205N USB 2.0 Host Controller", |
" 1799 0001 Root Hub", |
" 1931 000a GlobeTrotter Fusion Quad Lite (PPP data)", |
" 1931 000b GlobeTrotter Fusion Quad Lite (GSM data)", |
" 807d 0035 PCI-USB2 (OHCI subsystem)", |
" 003b PCI to C-bus Bridge", |
" 003e NAPCCARD Cardbus Controller", |
" 0046 PowerVR PCX2 [midas]", |
" 005a Vrc5074 [Nile 4]", |
" 0063 Firewarden", |
" 0067 PowerVR Neon 250 Chipset", |
" 1010 0020 PowerVR Neon 250 AGP 32Mb", |
" 1010 0080 PowerVR Neon 250 AGP 16Mb", |
" 1010 0088 PowerVR Neon 250 16Mb", |
" 1010 0090 PowerVR Neon 250 AGP 16Mb", |
" 1010 0098 PowerVR Neon 250 16Mb", |
" 1010 00a0 PowerVR Neon 250 AGP 32Mb", |
" 1010 00a8 PowerVR Neon 250 32Mb", |
" 1010 0120 PowerVR Neon 250 AGP 32Mb", |
" 0072 uPD72874 IEEE1394 OHCI 1.1 3-port PHY-Link Ctrlr", |
" 0074 56k Voice Modem", |
" 1033 8014 RCV56ACF 56k Voice Modem", |
" 009b Vrc5476", |
" 00a5 VRC4173", |
" 00a6 VRC5477 AC97", |
" 00cd IEEE 1394 [OrangeLink] Host Controller", |
" 12ee 8011 Root hub", |
" 00ce IEEE 1394 Host Controller", |
" 00df Vr4131", |
" 00e0 USB 2.0", |
" 12ee 7001 Root hub", |
" 14c2 0205 PTI-205N USB 2.0 Host Controller", |
" 1799 0002 Root Hub", |
" 807d 1043 PCI-USB2 (EHCI subsystem)", |
" 00e7 IEEE 1394 Host Controller", |
" 00f2 uPD72874 IEEE1394 OHCI 1.1 3-port PHY-Link Ctrlr", |
" 00f3 uPD6113x Multimedia Decoder/Processor [EMMA2]", |
" 010c VR7701", |
" 0125 uPD720400 PCI Express - PCI/PCI-X Bridge", |
"1034 Framatome Connectors USA Inc.", |
"1035 Comp. & Comm. Research Lab", |
"1036 Future Domain Corp.", |
" 0000 TMC-18C30 [36C70]", |
"1037 Hitachi Micro Systems", |
"1038 AMP, Inc", |
"1039 Silicon Integrated Systems [SiS]", |
" 0001 Virtual PCI-to-PCI bridge (AGP)", |
" 0002 SG86C202", |
" 0003 SiS AGP Port (virtual PCI-to-PCI bridge)", |
" 0004 PCI-to-PCI bridge", |
" 0006 85C501/2/3", |
" 0008 SiS85C503/5513 (LPC Bridge)", |
" 0009 ACPI", |
" 000a PCI-to-PCI bridge", |
" 0016 SiS961/2 SMBus Controller", |
" 0018 SiS85C503/5513 (LPC Bridge)", |
" 0180 RAID bus controller 180 SATA/PATA [SiS]", |
" 0181 SATA", |
" 0182 182 SATA/RAID Controller", |
" 0190 190 Gigabit Ethernet Adapter", |
" 0191 191 Gigabit Ethernet Adapter", |
" 0200 5597/5598/6326 VGA", |
" 1039 0000 SiS5597 SVGA (Shared RAM)", |
" 0204 82C204", |
" 0205 SG86C205", |
" 0300 300/305 PCI/AGP VGA Display Adapter", |
" 107d 2720 Leadtek WinFast VR300", |
" 0310 315H PCI/AGP VGA Display Adapter", |
" 0315 315 PCI/AGP VGA Display Adapter", |
" 0325 315PRO PCI/AGP VGA Display Adapter", |
" 0330 330 [Xabre] PCI/AGP VGA Display Adapter", |
" 0406 85C501/2", |
" 0496 85C496", |
" 0530 530 Host", |
" 0540 540 Host", |
" 0550 550 Host", |
" 0597 5513C", |
" 0601 85C601", |
" 0620 620 Host", |
" 0630 630 Host", |
" 0633 633 Host", |
" 0635 635 Host", |
" 0645 SiS645 Host & Memory & AGP Controller", |
" 0646 SiS645DX Host & Memory & AGP Controller", |
" 0648 645xx", |
" 0650 650/M650 Host", |
" 0651 651 Host", |
" 0655 655 Host", |
" 0660 660 Host", |
" 0661 661FX/M661FX/M661MX Host", |
" 0730 730 Host", |
" 0733 733 Host", |
" 0735 735 Host", |
" 0740 740 Host", |
" 0741 741/741GX/M741 Host", |
" 0745 745 Host", |
" 0746 746 Host", |
" 0755 755 Host", |
" 0760 760/M760 Host", |
" 0761 761/M761 Host", |
" 0900 SiS900 PCI Fast Ethernet", |
" 1019 0a14 K7S5A motherboard", |
" 1039 0900 SiS900 10/100 Ethernet Adapter", |
" 1043 8035 CUSI-FX motherboard", |
" 0961 SiS961 [MuTIOL Media IO]", |
" 0962 SiS962 [MuTIOL Media IO]", |
" 0963 SiS963 [MuTIOL Media IO]", |
" 0964 SiS964 [MuTIOL Media IO]", |
" 0965 SiS965 [MuTIOL Media IO]", |
" 3602 83C602", |
" 5107 5107", |
" 5300 SiS540 PCI Display Adapter", |
" 5315 550 PCI/AGP VGA Display Adapter", |
" 5401 486 PCI Chipset", |
" 5511 5511/5512", |
" 5513 5513 [IDE]", |
" 1019 0970 P6STP-FL motherboard", |
" 1039 5513 SiS5513 EIDE Controller (A,B step)", |
" 1043 8035 CUSI-FX motherboard", |
" 5517 5517", |
" 5571 5571", |
" 5581 5581 Pentium Chipset", |
" 5582 5582", |
" 5591 5591/5592 Host", |
" 5596 5596 Pentium Chipset", |
" 5597 5597 [SiS5582]", |
" 5600 5600 Host", |
" 6204 Video decoder & MPEG interface", |
" 6205 VGA Controller", |
" 6236 6236 3D-AGP", |
" 6300 630/730 PCI/AGP VGA Display Adapter", |
" 1019 0970 P6STP-FL motherboard", |
" 1043 8035 CUSI-FX motherboard", |
" 6306 530/620 PCI/AGP VGA Display Adapter", |
" 1039 6306 SiS530,620 GUI Accelerator+3D", |
" 6325 65x/M650/740 PCI/AGP VGA Display Adapter", |
" 6326 86C326 5598/6326", |
" 1039 6326 SiS6326 GUI Accelerator", |
" 1092 0a50 SpeedStar A50", |
" 1092 0a70 SpeedStar A70", |
" 1092 4910 SpeedStar A70", |
" 1092 4920 SpeedStar A70", |
" 1569 6326 SiS6326 GUI Accelerator", |
" 6330 661/741/760/761 PCI/AGP VGA Display Adapter", |
" 1039 6330 [M]661xX/[M]741[GX]/[M]760 PCI/AGP VGA Adapter", |
" 7001 USB 1.0 Controller", |
" 1019 0a14 K7S5A motherboard", |
" 1039 7000 Onboard USB Controller", |
" 1462 5470 K7SOM+ 5.2C Motherboard", |
" 7002 USB 2.0 Controller", |
" 1509 7002 Onboard USB Controller", |
" 7007 FireWire Controller", |
" 7012 AC'97 Sound Controller", |
" 15bd 1001 DFI 661FX motherboard", |
" 7013 AC'97 Modem Controller", |
" 7016 SiS7016 PCI Fast Ethernet Adapter", |
" 1039 7016 SiS7016 10/100 Ethernet Adapter", |
" 7018 SiS PCI Audio Accelerator", |
" 1014 01b6 SiS PCI Audio Accelerator", |
" 1014 01b7 SiS PCI Audio Accelerator", |
" 1019 7018 SiS PCI Audio Accelerator", |
" 1025 000e SiS PCI Audio Accelerator", |
" 1025 0018 SiS PCI Audio Accelerator", |
" 1039 7018 SiS PCI Audio Accelerator", |
" 1043 800b SiS PCI Audio Accelerator", |
" 1054 7018 SiS PCI Audio Accelerator", |
" 107d 5330 SiS PCI Audio Accelerator", |
" 107d 5350 SiS PCI Audio Accelerator", |
" 1170 3209 SiS PCI Audio Accelerator", |
" 1462 400a SiS PCI Audio Accelerator", |
" 14a4 2089 SiS PCI Audio Accelerator", |
" 14cd 2194 SiS PCI Audio Accelerator", |
" 14ff 1100 SiS PCI Audio Accelerator", |
" 152d 8808 SiS PCI Audio Accelerator", |
" 1558 1103 SiS PCI Audio Accelerator", |
" 1558 2200 SiS PCI Audio Accelerator", |
" 1563 7018 SiS PCI Audio Accelerator", |
" 15c5 0111 SiS PCI Audio Accelerator", |
" 270f a171 SiS PCI Audio Accelerator", |
" a0a0 0022 SiS PCI Audio Accelerator", |
" 7019 SiS7019 Audio Accelerator", |
"103a Seiko Epson Corporation", |
"103b Tatung Co. of America", |
"103c Hewlett-Packard Company", |
" 002a NX9000 Notebook", |
" 1005 A4977A Visualize EG", |
" 1008 Visualize FX", |
" 1028 Tach TL Fibre Channel Host Adapter", |
" 1029 Tach XL2 Fibre Channel Host Adapter", |
" 107e 000f Interphase 5560 Fibre Channel Adapter", |
" 9004 9210 1Gb/2Gb Family Fibre Channel Controller", |
" 9004 9211 1Gb/2Gb Family Fibre Channel Controller", |
" 102a Tach TS Fibre Channel Host Adapter", |
" 107e 000e Interphase 5540/5541 Fibre Channel Adapter", |
" 9004 9110 1Gb/2Gb Family Fibre Channel Controller", |
" 9004 9111 1Gb/2Gb Family Fibre Channel Controller", |
" 1030 J2585A DeskDirect 10/100VG NIC", |
" 1031 J2585B HP 10/100VG PCI LAN Adapter", |
" 103c 1040 J2973A DeskDirect 10BaseT NIC", |
" 103c 1041 J2585B DeskDirect 10/100VG NIC", |
" 103c 1042 J2970A DeskDirect 10BaseT/2 NIC", |
" 1040 J2973A DeskDirect 10BaseT NIC", |
" 1041 J2585B DeskDirect 10/100 NIC", |
" 1042 J2970A DeskDirect 10BaseT/2 NIC", |
" 1048 Diva Serial [GSP] Multiport UART", |
" 103c 1049 Tosca Console", |
" 103c 104a Tosca Secondary", |
" 103c 104b Maestro SP2", |
" 103c 1223 Superdome Console", |
" 103c 1226 Keystone SP2", |
" 103c 1227 Powerbar SP2", |
" 103c 1282 Everest SP2", |
" 103c 1301 Diva RMP3", |
" 1054 PCI Local Bus Adapter", |
" 1064 79C970 PCnet Ethernet Controller", |
" 108b Visualize FXe", |
" 10c1 NetServer Smart IRQ Router", |
" 10ed TopTools Remote Control", |
" 10f0 rio System Bus Adapter", |
" 10f1 rio I/O Controller", |
" 1200 82557B 10/100 NIC", |
" 1219 NetServer PCI Hot-Plug Controller", |
" 121a NetServer SMIC Controller", |
" 121b NetServer Legacy COM Port Decoder", |
" 121c NetServer PCI COM Port Decoder", |
" 1229 zx1 System Bus Adapter", |
" 122a zx1 I/O Controller", |
" 122e zx1 Local Bus Adapter", |
" 127c sx1000 I/O Controller", |
" 1290 Auxiliary Diva Serial Port", |
" 1291 Auxiliary Diva Serial Port", |
" 12b4 zx1 QuickSilver AGP8x Local Bus Adapter", |
" 12f8 Broadcom BCM4306 802.11b/g Wireless LAN", |
" 12fa BCM4306 802.11b/g Wireless LAN Controller", |
" 2910 E2910A PCIBus Exerciser", |
" 2925 E2925A 32 Bit, 33 MHzPCI Exerciser & Analyzer", |
" 3080 Pavilion ze2028ea", |
" 3085 Realtek RTL8139/8139C/8139C+", |
" 3220 Hewlett-Packard Smart Array P600", |
" 3230 Hewlett-Packard Smart Array Controller", |
"103e Solliday Engineering", |
"103f Synopsys/Logic Modeling Group", |
"1040 Accelgraphics Inc.", |
"1041 Computrend", |
"1042 Micron", |
" 1000 PC Tech RZ1000", |
" 1001 PC Tech RZ1001", |
" 3000 Samurai_0", |
" 3010 Samurai_1", |
" 3020 Samurai_IDE", |
"1043 ASUSTeK Computer Inc.", |
" 0675 ISDNLink P-IN100-ST-D", |
" 0675 1704 ISDN Adapter (PCI Bus, D, C)", |
" 0675 1707 ISDN Adapter (PCI Bus, DV, W)", |
" 10cf 105e ISDN Adapter (PCI Bus, DV, W)", |
" 0c11 A7N8X Motherboard nForce2 IDE/USB/SMBus", |
" 4015 v7100 SDRAM [GeForce2 MX]", |
" 4021 v7100 Combo Deluxe [GeForce2 MX + TV tuner]", |
" 4057 v8200 GeForce 3", |
" 8043 v8240 PAL 128M [P4T] Motherboard", |
" 807b v9280/TD [Geforce4 TI4200 8X With TV-Out and DVI]", |
" 8095 A7N8X Motherboard nForce2 AC97 Audio", |
" 80ac A7N8X Motherboard nForce2 AGP/Memory", |
" 80bb v9180 Magic/T [GeForce4 MX440 AGP 8x 64MB TV-out]", |
" 80c5 nForce3 chipset motherboard [SK8N]", |
" 80df v9520 Magic/T", |
" 8187 802.11a/b/g Wireless LAN Card", |
" 8188 Tiger Hybrid TV Capture Device", |
"1044 Adaptec (formerly DPT)", |
" 1012 Domino RAID Engine", |
" a400 SmartCache/Raid I-IV Controller", |
" a500 PCI Bridge", |
" a501 SmartRAID V Controller", |
" 1044 c001 PM1554U2 Ultra2 Single Channel", |
" 1044 c002 PM1654U2 Ultra2 Single Channel", |
" 1044 c003 PM1564U3 Ultra3 Single Channel", |
" 1044 c004 PM1564U3 Ultra3 Dual Channel", |
" 1044 c005 PM1554U2 Ultra2 Single Channel (NON ACPI)", |
" 1044 c00a PM2554U2 Ultra2 Single Channel", |
" 1044 c00b PM2654U2 Ultra2 Single Channel", |
" 1044 c00c PM2664U3 Ultra3 Single Channel", |
" 1044 c00d PM2664U3 Ultra3 Dual Channel", |
" 1044 c00e PM2554U2 Ultra2 Single Channel (NON ACPI)", |
" 1044 c00f PM2654U2 Ultra2 Single Channel (NON ACPI)", |
" 1044 c014 PM3754U2 Ultra2 Single Channel (NON ACPI)", |
" 1044 c015 PM3755U2B Ultra2 Single Channel (NON ACPI)", |
" 1044 c016 PM3755F Fibre Channel (NON ACPI)", |
" 1044 c01e PM3757U2 Ultra2 Single Channel", |
" 1044 c01f PM3757U2 Ultra2 Dual Channel", |
" 1044 c020 PM3767U3 Ultra3 Dual Channel", |
" 1044 c021 PM3767U3 Ultra3 Quad Channel", |
" 1044 c028 PM2865U3 Ultra3 Single Channel", |
" 1044 c029 PM2865U3 Ultra3 Dual Channel", |
" 1044 c02a PM2865F Fibre Channel", |
" 1044 c03c 2000S Ultra3 Single Channel", |
" 1044 c03d 2000S Ultra3 Dual Channel", |
" 1044 c03e 2000F Fibre Channel", |
" 1044 c046 3000S Ultra3 Single Channel", |
" 1044 c047 3000S Ultra3 Dual Channel", |
" 1044 c048 3000F Fibre Channel", |
" 1044 c050 5000S Ultra3 Single Channel", |
" 1044 c051 5000S Ultra3 Dual Channel", |
" 1044 c052 5000F Fibre Channel", |
" 1044 c05a 2400A UDMA Four Channel", |
" 1044 c05b 2400A UDMA Four Channel DAC", |
" 1044 c064 3010S Ultra3 Dual Channel", |
" 1044 c065 3410S Ultra160 Four Channel", |
" 1044 c066 3010S Fibre Channel", |
" a511 SmartRAID V Controller", |
" 1044 c032 ASR-2005S I2O Zero Channel", |
" 1044 c035 ASR-2010S I2O Zero Channel", |
"1045 OPTi Inc.", |
" a0f8 82C750 [Vendetta] USB Controller", |
" c101 92C264", |
" c178 92C178", |
" c556 82X556 [Viper]", |
" c557 82C557 [Viper-M]", |
" c558 82C558 [Viper-M ISA+IDE]", |
" c567 82C750 [Vendetta], device 0", |
" c568 82C750 [Vendetta], device 1", |
" c569 82C579 [Viper XPress+ Chipset]", |
" c621 82C621 [Viper-M/N+]", |
" c700 82C700 [FireStar]", |
" c701 82C701 [FireStar Plus]", |
" c814 82C814 [Firebridge 1]", |
" c822 82C822", |
" c824 82C824", |
" c825 82C825 [Firebridge 2]", |
" c832 82C832", |
" c861 82C861", |
" c895 82C895", |
" c935 EV1935 ECTIVA MachOne PCIAudio", |
" d568 82C825 [Firebridge 2]", |
" d721 IDE [FireStar]", |
"1046 IPC Corporation, Ltd.", |
"1047 Genoa Systems Corp", |
"1048 Elsa AG", |
" 0c60 Gladiac MX", |
" 0d22 Quadro4 900XGL [ELSA GLoria4 900XGL]", |
" 1000 QuickStep 1000", |
" 3000 QuickStep 3000", |
" 8901 Gloria XL", |
" 1048 0935 GLoria XL (Virge)", |
"1049 Fountain Technologies, Inc.", |
"104a STMicroelectronics", |
" 0008 STG 2000X", |
" 0009 STG 1764X", |
" 0010 STG4000 [3D Prophet Kyro Series]", |
" 0209 STPC Consumer/Industrial North- and Southbridge", |
" 020a STPC Atlas/ConsumerS/Consumer IIA Northbridge", |
" 0210 STPC Atlas ISA Bridge", |
" 021a STPC Consumer S Southbridge", |
" 021b STPC Consumer IIA Southbridge", |
" 0500 ST70137 [Unicorn] ADSL DMT Transceiver", |
" 0564 STPC Client Northbridge", |
" 0981 21x4x DEC-Tulip compatible 10/100 Ethernet", |
" 1746 STG 1764X", |
" 2774 21x4x DEC-Tulip compatible 10/100 Ethernet", |
" 3520 MPEG-II decoder card", |
" 55cc STPC Client Southbridge", |
"104b BusLogic", |
" 0140 BT-946C (old) [multimaster 01]", |
" 1040 BT-946C (BA80C30) [MultiMaster 10]", |
" 8130 Flashpoint LT", |
"104c Texas Instruments", |
" 0500 100 MBit LAN Controller", |
" 0508 TMS380C2X Compressor Interface", |
" 1000 Eagle i/f AS", |
" 104c PCI1510 PC card Cardbus Controller", |
" 3d04 TVP4010 [Permedia]", |
" 3d07 TVP4020 [Permedia 2]", |
" 1011 4d10 Comet", |
" 1040 000f AccelStar II", |
" 1040 0011 AccelStar II", |
" 1048 0a31 WINNER 2000", |
" 1048 0a32 GLoria Synergy", |
" 1048 0a34 GLoria Synergy", |
" 1048 0a35 GLoria Synergy", |
" 1048 0a36 GLoria Synergy", |
" 1048 0a43 GLoria Synergy", |
" 1048 0a44 GLoria Synergy", |
" 107d 2633 WinFast 3D L2300", |
" 1092 0127 FIRE GL 1000 PRO", |
" 1092 0136 FIRE GL 1000 PRO", |
" 1092 0141 FIRE GL 1000 PRO", |
" 1092 0146 FIRE GL 1000 PRO", |
" 1092 0148 FIRE GL 1000 PRO", |
" 1092 0149 FIRE GL 1000 PRO", |
" 1092 0152 FIRE GL 1000 PRO", |
" 1092 0154 FIRE GL 1000 PRO", |
" 1092 0155 FIRE GL 1000 PRO", |
" 1092 0156 FIRE GL 1000 PRO", |
" 1092 0157 FIRE GL 1000 PRO", |
" 1097 3d01 Jeronimo Pro", |
" 1102 100f Graphics Blaster Extreme", |
" 3d3d 0100 Reference Permedia 2 3D", |
" 8000 PCILynx/PCILynx2 IEEE 1394 Link Layer Controller", |
" e4bf 1010 CF1-1-SNARE", |
" e4bf 1020 CF1-2-SNARE", |
" 8009 FireWire Controller", |
" 104d 8032 8032 OHCI i.LINK (IEEE 1394) Controller", |
" 8017 PCI4410 FireWire Controller", |
" 8019 TSB12LV23 IEEE-1394 Controller", |
" 11bd 000a Studio DV500-1394", |
" 11bd 000e Studio DV", |
" e4bf 1010 CF2-1-CYMBAL", |
" 8020 TSB12LV26 IEEE-1394 Controller (Link)", |
" 11bd 000f Studio DV500-1394", |
" 8021 TSB43AA22 IEEE-1394 Controller (PHY/Link Integrated)", |
" 104d 80df Vaio PCG-FX403", |
" 104d 80e7 VAIO PCG-GR214EP/GR214MP/GR215MP/GR314MP/GR315MP", |
" 8022 TSB43AB22 IEEE-1394a-2000 Controller (PHY/Link)", |
" 8023 TSB43AB22/A IEEE-1394a-2000 Controller (PHY/Link)", |
" 103c 088c NC8000 laptop", |
" 1043 808b K8N4-E Mainboard", |
" 8024 TSB43AB23 IEEE-1394a-2000 Controller (PHY/Link)", |
" 8025 TSB82AA2 IEEE-1394b Link Layer Controller", |
" 1458 1000 GA-K8N Ultra-9 Mainboard", |
" 8026 TSB43AB21 IEEE-1394a-2000 Controller (PHY/Link)", |
" 1025 003c Aspire 2001WLCi (Compaq CL50 motherboard)", |
" 103c 006a NX9500", |
" 1043 808d A7V333 mainboard.", |
" 8027 PCI4451 IEEE-1394 Controller", |
" 1028 00e6 PCI4451 IEEE-1394 Controller (Dell Inspiron 8100)", |
" 8029 PCI4510 IEEE-1394 Controller", |
" 1028 0163 Latitude D505", |
" 1028 0196 Inspiron 5160", |
" 1071 8160 MIM2900", |
" 802b PCI7410,7510,7610 OHCI-Lynx Controller", |
" 1028 0139 Latitude D400", |
" 1028 014e PCI7410,7510,7610 OHCI-Lynx Controller (Dell Latitude D800)", |
" 802e PCI7x20 1394a-2000 OHCI Two-Port PHY/Link-Layer Controller", |
" 8031 PCIxx21/x515 Cardbus Controller", |
" 1025 0080 Aspire 5024WLMi", |
" 103c 099c NX6110/NC6120", |
" 103c 308b MX6125", |
" 8032 OHCI Compliant IEEE 1394 Host Controller", |
" 1025 0080 Aspire 5024WLMi", |
" 103c 099c NX6110/NC6120", |
" 103c 308b MX6125", |
" 8033 PCIxx21 Integrated FlashMedia Controller", |
" 1025 0080 Aspire 5024WLMi", |
" 103c 099c NX6110/NC6120", |
" 103c 308b MX6125", |
" 8034 PCI6411, PCI6421, PCI6611, PCI6621, PCI7411, PCI7421, PCI7611, PCI7621 Secure Digital (SD) Controller", |
" 1025 0080 Aspire 5024WLMi", |
" 103c 099c NX6110/NC6120", |
" 103c 308b MX6125", |
" 8035 PCI6411, PCI6421, PCI6611, PCI6621, PCI7411, PCI7421, PCI7611, PCI7621 Smart Card Controller (SMC)", |
" 103c 099c NX6110/NC6120", |
" 8036 PCI6515 Cardbus Controller", |
" 8038 PCI6515 SmartCard Controller", |
" 803b 5-in-1 Multimedia Card Reader (SD/MMC/MS/MS PRO/xD)", |
" 8201 PCI1620 Firmware Loading Function", |
" 8204 PCI7410,7510,7610 PCI Firmware Loading Function", |
" 1028 0139 Latitude D400", |
" 1028 014e Latitude D800", |
" 8231 XIO2000(A)/XIO2200 PCI Express-to-PCI Bridge", |
" 8235 XIO2200 IEEE-1394a-2000 Controller (PHY/Link)", |
" 8400 ACX 100 22Mbps Wireless Interface", |
" 1186 3b00 DWL-650+ PC Card cardbus 22Mbs Wireless Adapter [AirPlus]", |
" 1186 3b01 DWL-520+ 22Mbps PCI Wireless Adapter", |
" 16ab 8501 WL-8305 IEEE802.11b+ Wireless LAN PCI Adapter", |
" 8401 ACX 100 22Mbps Wireless Interface", |
" 9000 Wireless Interface (of unknown type)", |
" 9065 TMS320DM642", |
" 9066 ACX 111 54Mbps Wireless Interface", |
" 104c 9066 Trendnet TEW-421PC Wireless PCI Adapter", |
" 1186 3b04 DWL-G520+ Wireless PCI Adapter", |
" 1186 3b05 DWL-G650+ AirPlusG+ CardBus Wireless LAN", |
" 13d1 aba0 SWLMP-54108 108Mbps Wireless mini PCI card 802.11g+", |
" 1737 0033 WPC54G Ver.2 802.11G PC Card", |
" a001 TDC1570", |
" a100 TDC1561", |
" a102 TNETA1575 HyperSAR Plus w/PCI Host i/f & UTOPIA i/f", |
" a106 TMS320C6414 TMS320C6415 TMS320C6416", |
" 175c 5000 ASI50xx Audio Adapter", |
" 175c 6400 ASI6400 Cobranet series", |
" 175c 8700 ASI87xx Radio Tuner card", |
" ac10 PCI1050", |
" ac11 PCI1053", |
" ac12 PCI1130", |
" ac13 PCI1031", |
" ac15 PCI1131", |
" ac16 PCI1250", |
" 1014 0092 ThinkPad 600", |
" ac17 PCI1220", |
" ac18 PCI1260", |
" ac19 PCI1221", |
" ac1a PCI1210", |
" ac1b PCI1450", |
" 0e11 b113 Armada M700", |
" 1014 0130 Thinkpad T20/T22/A21m", |
" ac1c PCI1225", |
" 0e11 b121 Armada E500", |
" 1028 0088 Latitude CPi A400XT", |
" ac1d PCI1251A", |
" ac1e PCI1211", |
" ac1f PCI1251B", |
" ac20 TI 2030", |
" ac21 PCI2031", |
" ac22 PCI2032 PCI Docking Bridge", |
" ac23 PCI2250 PCI-to-PCI Bridge", |
" ac28 PCI2050 PCI-to-PCI Bridge", |
" ac30 PCI1260 PC card Cardbus Controller", |
" ac40 PCI4450 PC card Cardbus Controller", |
" ac41 PCI4410 PC card Cardbus Controller", |
" ac42 PCI4451 PC card Cardbus Controller", |
" 1028 00e6 PCI4451 PC card CardBus Controller (Dell Inspiron 8100)", |
" ac44 PCI4510 PC card Cardbus Controller", |
" 1028 0163 Latitude D505", |
" 1028 0196 Inspiron 5160", |
" 1071 8160 MIM2000", |
" ac46 PCI4520 PC card Cardbus Controller", |
" ac47 PCI7510 PC card Cardbus Controller", |
" 1028 0139 Latitude D400", |
" 1028 013f Precision M60", |
" 1028 014e Latitude D800", |
" ac4a PCI7510,7610 PC card Cardbus Controller", |
" 1028 0139 Latitude D400", |
" 1028 014e Latitude D800", |
" ac50 PCI1410 PC card Cardbus Controller", |
" ac51 PCI1420", |
" 0e11 004e Evo N600c", |
" 1014 0148 ThinkPad A20m", |
" 1014 023b ThinkPad T23 (2647-4MG)", |
" 1028 00b1 Latitude C600", |
" 1028 012a Latitude C640", |
" 1033 80cd Versa Note VXi", |
" 1095 10cf Fujitsu-Siemens LifeBook C Series", |
" 10cf 1095 Lifebook S-4510/C6155", |
" e4bf 1000 CP2-2-HIPHOP", |
" ac52 PCI1451 PC card Cardbus Controller", |
" ac53 PCI1421 PC card Cardbus Controller", |
" ac54 PCI1620 PC Card Controller", |
" ac55 PCI1520 PC card Cardbus Controller", |
" 1014 0512 ThinkPad T30/T40", |
" ac56 PCI1510 PC card Cardbus Controller", |
" 1014 0528 ThinkPad R40e (2684-HVG) Cardbus Controller", |
" ac60 PCI2040 PCI to DSP Bridge Controller", |
" 175c 5100 ASI51xx Audio Adapter", |
" 175c 6100 ASI61xx Audio Adapter", |
" 175c 6200 ASI62xx Audio Adapter", |
" 175c 8800 ASI88xx Audio Adapter", |
" ac8d PCI 7620", |
" ac8e PCI7420 CardBus Controller", |
" ac8f PCI7420/PCI7620 Dual Socket CardBus and Smart Card Cont. w/ 1394a-2000 OHCI Two-Port PHY/Link-Layer Cont. and SD/MS-Pro Sockets", |
" fe00 FireWire Host Controller", |
" fe03 12C01A FireWire Host Controller", |
"104d Sony Corporation", |
" 8004 DTL-H2500 [Playstation development board]", |
" 8009 CXD1947Q i.LINK Controller", |
" 8039 CXD3222 i.LINK Controller", |
" 8056 Rockwell HCF 56K modem", |
" 808a Memory Stick Controller", |
"104e Oak Technology, Inc", |
" 0017 OTI-64017", |
" 0107 OTI-107 [Spitfire]", |
" 0109 Video Adapter", |
" 0111 OTI-64111 [Spitfire]", |
" 0217 OTI-64217", |
" 0317 OTI-64317", |
"104f Co-time Computer Ltd", |
"1050 Winbond Electronics Corp", |
" 0000 NE2000", |
" 0001 W83769F", |
" 0033 W89C33D 802.11 a/b/g BB/MAC", |
" 0105 W82C105", |
" 0840 W89C840", |
" 1050 0001 W89C840 Ethernet Adapter", |
" 1050 0840 W89C840 Ethernet Adapter", |
" 0940 W89C940", |
" 5a5a W89C940F", |
" 6692 W6692", |
" 1043 1702 ISDN Adapter (PCI Bus, D, W)", |
" 1043 1703 ISDN Adapter (PCI Bus, DV, W)", |
" 1043 1707 ISDN Adapter (PCI Bus, DV, W)", |
" 144f 1702 ISDN Adapter (PCI Bus, D, W)", |
" 144f 1703 ISDN Adapter (PCI Bus, DV, W)", |
" 144f 1707 ISDN Adapter (PCI Bus, DV, W)", |
" 9921 W99200F MPEG-1 Video Encoder", |
" 9922 W99200F/W9922PF MPEG-1/2 Video Encoder", |
" 9970 W9970CF", |
"1051 Anigma, Inc.", |
"1052 ?Young Micro Systems", |
"1053 Young Micro Systems", |
"1054 Hitachi, Ltd", |
"1055 Efar Microsystems", |
" 9130 SLC90E66 [Victory66] IDE", |
" 9460 SLC90E66 [Victory66] ISA", |
" 9462 SLC90E66 [Victory66] USB", |
" 9463 SLC90E66 [Victory66] ACPI", |
"1056 ICL", |
"1057 Motorola", |
" 0001 MPC105 [Eagle]", |
" 0002 MPC106 [Grackle]", |
" 0003 MPC8240 [Kahlua]", |
" 0004 MPC107", |
" 0006 MPC8245 [Unity]", |
" 0008 MPC8540", |
" 0009 MPC8560", |
" 0100 MC145575 [HFC-PCI]", |
" 0431 KTI829c 100VG", |
" 1801 DSP56301 Digital Signal Processor", |
" 14fb 0101 Transas Radar Imitator Board [RIM]", |
" 14fb 0102 Transas Radar Imitator Board [RIM-2]", |
" 14fb 0202 Transas Radar Integrator Board [RIB-2]", |
" 14fb 0611 1 channel CAN bus Controller [CanPci-1]", |
" 14fb 0612 2 channels CAN bus Controller [CanPci-2]", |
" 14fb 0613 3 channels CAN bus Controller [CanPci-3]", |
" 14fb 0614 4 channels CAN bus Controller [CanPci-4]", |
" 14fb 0621 1 channel CAN bus Controller [CanPci2-1]", |
" 14fb 0622 2 channels CAN bus Controller [CanPci2-2]", |
" 14fb 0810 Transas VTS Radar Integrator Board [RIB-4]", |
" 175c 4200 ASI4215 Audio Adapter", |
" 175c 4300 ASI43xx Audio Adapter", |
" 175c 4400 ASI4401 Audio Adapter", |
" ecc0 0010 Darla", |
" ecc0 0020 Gina", |
" ecc0 0030 Layla rev.0", |
" ecc0 0031 Layla rev.1", |
" ecc0 0040 Darla24 rev.0", |
" ecc0 0041 Darla24 rev.1", |
" ecc0 0050 Gina24 rev.0", |
" ecc0 0051 Gina24 rev.1", |
" ecc0 0070 Mona rev.0", |
" ecc0 0071 Mona rev.1", |
" ecc0 0072 Mona rev.2", |
" 18c0 MPC8265A/8266/8272", |
" 18c1 MPC8271/MPC8272", |
" 3410 DSP56361 Digital Signal Processor", |
" ecc0 0050 Gina24 rev.0", |
" ecc0 0051 Gina24 rev.1", |
" ecc0 0060 Layla24", |
" ecc0 0070 Mona rev.0", |
" ecc0 0071 Mona rev.1", |
" ecc0 0072 Mona rev.2", |
" ecc0 0080 Mia rev.0", |
" ecc0 0081 Mia rev.1", |
" ecc0 0090 Indigo", |
" ecc0 00a0 Indigo IO", |
" ecc0 00b0 Indigo DJ", |
" ecc0 0100 3G", |
" 4801 Raven", |
" 4802 Falcon", |
" 4803 Hawk", |
" 4806 CPX8216", |
" 4d68 20268", |
" 5600 SM56 PCI Modem", |
" 1057 0300 SM56 PCI Speakerphone Modem", |
" 1057 0301 SM56 PCI Voice Modem", |
" 1057 0302 SM56 PCI Fax Modem", |
" 1057 5600 SM56 PCI Voice modem", |
" 13d2 0300 SM56 PCI Speakerphone Modem", |
" 13d2 0301 SM56 PCI Voice modem", |
" 13d2 0302 SM56 PCI Fax Modem", |
" 1436 0300 SM56 PCI Speakerphone Modem", |
" 1436 0301 SM56 PCI Voice modem", |
" 1436 0302 SM56 PCI Fax Modem", |
" 144f 100c SM56 PCI Fax Modem", |
" 1494 0300 SM56 PCI Speakerphone Modem", |
" 1494 0301 SM56 PCI Voice modem", |
" 14c8 0300 SM56 PCI Speakerphone Modem", |
" 14c8 0302 SM56 PCI Fax Modem", |
" 1668 0300 SM56 PCI Speakerphone Modem", |
" 1668 0302 SM56 PCI Fax Modem", |
" 5608 Wildcard X100P", |
" 5803 MPC5200", |
" 5806 MCF54 Coldfire", |
" 5808 MPC8220", |
" 5809 MPC5200B", |
" 6400 MPC190 Security Processor (S1 family, encryption)", |
" 6405 MPC184 Security Processor (S1 family)", |
"1058 Electronics & Telecommunications RSH", |
"1059 Teknor Industrial Computers Inc", |
"105a Promise Technology, Inc.", |
" 0d30 PDC20265 (FastTrak100 Lite/Ultra100)", |
" 105a 4d33 Ultra100", |
" 0d38 20263", |
" 105a 4d39 Fasttrak66", |
" 1275 20275", |
" 3318 PDC20318 (SATA150 TX4)", |
" 3319 PDC20319 (FastTrak S150 TX4)", |
" 8086 3427 S875WP1-E mainboard", |
" 3371 PDC20371 (FastTrak S150 TX2plus)", |
" 3373 PDC20378 (FastTrak 378/SATA 378)", |
" 1043 80f5 K8V Deluxe/PC-DL Deluxe motherboard", |
" 1462 702e K8T NEO FIS2R motherboard", |
" 3375 PDC20375 (SATA150 TX2plus)", |
" 3376 PDC20376 (FastTrak 376)", |
" 1043 809e A7V8X motherboard", |
" 3515 PDC40719 [FastTrak TX4300/TX4310]", |
" 3519 PDC40519 (FastTrak TX4200)", |
" 3570 20771 (FastTrak TX2300)", |
" 3571 PDC20571 (FastTrak TX2200)", |
" 3574 PDC20579 SATAII 150 IDE Controller", |
" 3577 PDC40779 (SATA 300 779)", |
" 3d17 PDC40718 (SATA 300 TX4)", |
" 3d18 PDC20518/PDC40518 (SATAII 150 TX4)", |
" 3d73 PDC40775 (SATA 300 TX2plus)", |
" 3d75 PDC20575 (SATAII150 TX2plus)", |
" 4d30 PDC20267 (FastTrak100/Ultra100)", |
" 105a 4d33 Ultra100", |
" 105a 4d39 FastTrak100", |
" 4d33 20246", |
" 105a 4d33 20246 IDE Controller", |
" 4d38 PDC20262 (FastTrak66/Ultra66)", |
" 105a 4d30 Ultra Device on SuperTrak", |
" 105a 4d33 Ultra66", |
" 105a 4d39 FastTrak66", |
" 4d68 PDC20268 (Ultra100 TX2)", |
" 105a 4d68 Ultra100TX2", |
" 4d69 20269", |
" 105a 4d68 Ultra133TX2", |
" 5275 PDC20276 (MBFastTrak133 Lite)", |
" 1043 807e A7V333 motherboard.", |
" 105a 0275 SuperTrak SX6000 IDE", |
" 105a 1275 MBFastTrak133 Lite (tm) Controller (RAID mode)", |
" 1458 b001 MBUltra 133", |
" 5300 DC5300", |
" 6268 PDC20270 (FastTrak100 LP/TX2/TX4)", |
" 105a 4d68 FastTrak100 TX2", |
" 6269 PDC20271 (FastTrak TX2000)", |
" 105a 6269 FastTrak TX2/TX2000", |
" 6621 PDC20621 (FastTrak S150 SX4/FastTrak SX4000 lite)", |
" 6622 PDC20621 [SATA150 SX4] 4 Channel IDE RAID Controller", |
" 6624 PDC20621 [FastTrak SX4100]", |
" 6626 PDC20618 (Ultra 618)", |
" 6629 PDC20619 (FastTrak TX4000)", |
" 7275 PDC20277 (SBFastTrak133 Lite)", |
" 8002 SATAII150 SX8", |
"105b Foxconn International, Inc.", |
"105c Wipro Infotech Limited", |
"105d Number 9 Computer Company", |
" 2309 Imagine 128", |
" 2339 Imagine 128-II", |
" 105d 0000 Imagine 128 series 2 4Mb VRAM", |
" 105d 0001 Imagine 128 series 2 4Mb VRAM", |
" 105d 0002 Imagine 128 series 2 4Mb VRAM", |
" 105d 0003 Imagine 128 series 2 4Mb VRAM", |
" 105d 0004 Imagine 128 series 2 4Mb VRAM", |
" 105d 0005 Imagine 128 series 2 4Mb VRAM", |
" 105d 0006 Imagine 128 series 2 4Mb VRAM", |
" 105d 0007 Imagine 128 series 2 4Mb VRAM", |
" 105d 0008 Imagine 128 series 2e 4Mb DRAM", |
" 105d 0009 Imagine 128 series 2e 4Mb DRAM", |
" 105d 000a Imagine 128 series 2 8Mb VRAM", |
" 105d 000b Imagine 128 series 2 8Mb H-VRAM", |
" 11a4 000a Barco Metheus 5 Megapixel", |
" 13cc 0000 Barco Metheus 5 Megapixel", |
" 13cc 0004 Barco Metheus 5 Megapixel", |
" 13cc 0005 Barco Metheus 5 Megapixel", |
" 13cc 0006 Barco Metheus 5 Megapixel", |
" 13cc 0008 Barco Metheus 5 Megapixel", |
" 13cc 0009 Barco Metheus 5 Megapixel", |
" 13cc 000a Barco Metheus 5 Megapixel", |
" 13cc 000c Barco Metheus 5 Megapixel", |
" 493d Imagine 128 T2R [Ticket to Ride]", |
" 11a4 000a Barco Metheus 5 Megapixel, Dual Head", |
" 11a4 000b Barco Metheus 5 Megapixel, Dual Head", |
" 13cc 0002 Barco Metheus 4 Megapixel, Dual Head", |
" 13cc 0003 Barco Metheus 5 Megapixel, Dual Head", |
" 13cc 0007 Barco Metheus 5 Megapixel, Dual Head", |
" 13cc 0008 Barco Metheus 5 Megapixel, Dual Head", |
" 13cc 0009 Barco Metheus 5 Megapixel, Dual Head", |
" 13cc 000a Barco Metheus 5 Megapixel, Dual Head", |
" 5348 Revolution 4", |
" 105d 0037 Revolution IV-FP AGP (For SGI 1600SW)", |
" 11a4 0028 PVS5600M", |
" 11a4 0038 PVS5600D", |
"105e Vtech Computers Ltd", |
"105f Infotronic America Inc", |
"1060 United Microelectronics [UMC]", |
" 0001 UM82C881", |
" 0002 UM82C886", |
" 0101 UM8673F", |
" 0881 UM8881", |
" 0886 UM8886F", |
" 0891 UM8891A", |
" 1001 UM886A", |
" 673a UM8886BF", |
" 673b EIDE Master/DMA", |
" 8710 UM8710", |
" 886a UM8886A", |
" 8881 UM8881F", |
" 8886 UM8886F", |
" 888a UM8886A", |
" 8891 UM8891A", |
" 9017 UM9017F", |
" 9018 UM9018", |
" 9026 UM9026", |
" e881 UM8881N", |
" e886 UM8886N", |
" e88a UM8886N", |
" e891 UM8891N", |
"1061 I.I.T.", |
" 0001 AGX016", |
" 0002 IIT3204/3501", |
"1062 Maspar Computer Corp", |
"1063 Ocean Office Automation", |
"1064 Alcatel", |
"1065 Texas Microsystems", |
"1066 PicoPower Technology", |
" 0000 PT80C826", |
" 0001 PT86C521 [Vesuvius v1] Host Bridge", |
" 0002 PT86C523 [Vesuvius v3] PCI-ISA Bridge Master", |
" 0003 PT86C524 [Nile] PCI-to-PCI Bridge", |
" 0004 PT86C525 [Nile-II] PCI-to-PCI Bridge", |
" 0005 National PC87550 System Controller", |
" 8002 PT86C523 [Vesuvius v3] PCI-ISA Bridge Slave", |
"1067 Mitsubishi Electric", |
" 0301 AccelGraphics AccelECLIPSE", |
" 0304 AccelGALAXY A2100 [OEM Evans & Sutherland]", |
" 0308 Tornado 3000 [OEM Evans & Sutherland]", |
" 1002 VG500 [VolumePro Volume Rendering Accelerator]", |
"1068 Diversified Technology", |
"1069 Mylex Corporation", |
" 0001 DAC960P", |
" 0002 DAC960PD", |
" 0010 DAC960PG", |
" 0020 DAC960LA", |
" 0050 AcceleRAID 352/170/160 support Device", |
" 1069 0050 AcceleRAID 352 support Device", |
" 1069 0052 AcceleRAID 170 support Device", |
" 1069 0054 AcceleRAID 160 support Device", |
" b166 AcceleRAID 600/500/400/Sapphire support Device", |
" 1014 0242 iSeries 2872 DASD IOA", |
" 1014 0266 Dual Channel PCI-X U320 SCSI Adapter", |
" 1014 0278 Dual Channel PCI-X U320 SCSI RAID Adapter", |
" 1014 02d3 Dual Channel PCI-X U320 SCSI Adapter", |
" 1014 02d4 Dual Channel PCI-X U320 SCSI RAID Adapter", |
" 1069 0200 AcceleRAID 400, Single Channel, PCI-X, U320, SCSI RAID", |
" 1069 0202 AcceleRAID Sapphire, Dual Channel, PCI-X, U320, SCSI RAID", |
" 1069 0204 AcceleRAID 500, Dual Channel, Low-Profile, PCI-X, U320, SCSI RAID", |
" 1069 0206 AcceleRAID 600, Dual Channel, PCI-X, U320, SCSI RAID", |
" ba55 eXtremeRAID 1100 support Device", |
" ba56 eXtremeRAID 2000/3000 support Device", |
" 1069 0030 eXtremeRAID 3000 support Device", |
" 1069 0040 eXtremeRAID 2000 support Device", |
" ba57 eXtremeRAID 4000/5000 support Device", |
" 1069 0072 eXtremeRAID 5000 support Device", |
"106a Aten Research Inc", |
"106b Apple Computer Inc.", |
" 0001 Bandit PowerPC host bridge", |
" 0002 Grand Central I/O", |
" 0003 Control Video", |
" 0004 PlanB Video-In", |
" 0007 O'Hare I/O", |
" 000c DOS on Mac", |
" 000e Hydra Mac I/O", |
" 0010 Heathrow Mac I/O", |
" 0017 Paddington Mac I/O", |
" 0018 UniNorth FireWire", |
" 0019 KeyLargo USB", |
" 001e UniNorth Internal PCI", |
" 001f UniNorth PCI", |
" 0020 UniNorth AGP", |
" 0021 UniNorth GMAC (Sun GEM)", |
" 0022 KeyLargo Mac I/O", |
" 0024 UniNorth/Pangea GMAC (Sun GEM)", |
" 0025 KeyLargo/Pangea Mac I/O", |
" 0026 KeyLargo/Pangea USB", |
" 0027 UniNorth/Pangea AGP", |
" 0028 UniNorth/Pangea PCI", |
" 0029 UniNorth/Pangea Internal PCI", |
" 002d UniNorth 1.5 AGP", |
" 002e UniNorth 1.5 PCI", |
" 002f UniNorth 1.5 Internal PCI", |
" 0030 UniNorth/Pangea FireWire", |
" 0031 UniNorth 2 FireWire", |
" 106b 5811 iBook G4 2004", |
" 0032 UniNorth 2 GMAC (Sun GEM)", |
" 0033 UniNorth 2 ATA/100", |
" 0034 UniNorth 2 AGP", |
" 0035 UniNorth 2 PCI", |
" 0036 UniNorth 2 Internal PCI", |
" 003b UniNorth/Intrepid ATA/100", |
" 003e KeyLargo/Intrepid Mac I/O", |
" 003f KeyLargo/Intrepid USB", |
" 0040 K2 KeyLargo USB", |
" 0041 K2 KeyLargo Mac/IO", |
" 0042 K2 FireWire", |
" 0043 K2 ATA/100", |
" 0045 K2 HT-PCI Bridge", |
" 0046 K2 HT-PCI Bridge", |
" 0047 K2 HT-PCI Bridge", |
" 0048 K2 HT-PCI Bridge", |
" 0049 K2 HT-PCI Bridge", |
" 004b U3 AGP", |
" 004c K2 GMAC (Sun GEM)", |
" 004f Shasta Mac I/O", |
" 0050 Shasta IDE", |
" 0051 Shasta (Sun GEM)", |
" 0052 Shasta Firewire", |
" 0053 Shasta PCI Bridge", |
" 0054 Shasta PCI Bridge", |
" 0055 Shasta PCI Bridge", |
" 0058 U3L AGP Bridge", |
" 0059 U3H AGP Bridge", |
" 0066 Intrepid2 AGP Bridge", |
" 0067 Intrepid2 PCI Bridge", |
" 0068 Intrepid2 PCI Bridge", |
" 0069 Intrepid2 ATA/100", |
" 006a Intrepid2 Firewire", |
" 006b Intrepid2 GMAC (Sun GEM)", |
" 1645 Tigon3 Gigabit Ethernet NIC (BCM5701)", |
"106c Hynix Semiconductor", |
" 8801 Dual Pentium ISA/PCI Motherboard", |
" 8802 PowerPC ISA/PCI Motherboard", |
" 8803 Dual Window Graphics Accelerator", |
" 8804 LAN Controller", |
" 8805 100-BaseT LAN", |
"106d Sequent Computer Systems", |
"106e DFI, Inc", |
"106f City Gate Development Ltd", |
"1070 Daewoo Telecom Ltd", |
"1071 Mitac", |
" 8160 Mitac 8060B Mobile Platform", |
"1072 GIT Co Ltd", |
"1073 Yamaha Corporation", |
" 0001 3D GUI Accelerator", |
" 0002 YGV615 [RPA3 3D-Graphics Controller]", |
" 0003 YMF-740", |
" 0004 YMF-724", |
" 1073 0004 YMF724-Based PCI Audio Adapter", |
" 0005 DS1 Audio", |
" 1073 0005 DS-XG PCI Audio CODEC", |
" 0006 DS1 Audio", |
" 0008 DS1 Audio", |
" 1073 0008 DS-XG PCI Audio CODEC", |
" 000a DS1L Audio", |
" 1073 0004 DS-XG PCI Audio CODEC", |
" 1073 000a DS-XG PCI Audio CODEC", |
" 000c YMF-740C [DS-1L Audio Controller]", |
" 107a 000c DS-XG PCI Audio CODEC", |
" 000d YMF-724F [DS-1 Audio Controller]", |
" 1073 000d DS-XG PCI Audio CODEC", |
" 0010 YMF-744B [DS-1S Audio Controller]", |
" 1073 0006 DS-XG PCI Audio CODEC", |
" 1073 0010 DS-XG PCI Audio CODEC", |
" 0012 YMF-754 [DS-1E Audio Controller]", |
" 1073 0012 DS-XG PCI Audio Codec", |
" 0020 DS-1 Audio", |
" 2000 DS2416 Digital Mixing Card", |
" 1073 2000 DS2416 Digital Mixing Card", |
"1074 NexGen Microsystems", |
" 4e78 82c500/1", |
"1075 Advanced Integrations Research", |
"1076 Chaintech Computer Co. Ltd", |
"1077 QLogic Corp.", |
" 1016 ISP10160 Single Channel Ultra3 SCSI Processor", |
" 1020 ISP1020 Fast-wide SCSI", |
" 1022 ISP1022 Fast-wide SCSI", |
" 1080 ISP1080 SCSI Host Adapter", |
" 1216 ISP12160 Dual Channel Ultra3 SCSI Processor", |
" 101e 8471 QLA12160 on AMI MegaRAID", |
" 101e 8493 QLA12160 on AMI MegaRAID", |
" 1240 ISP1240 SCSI Host Adapter", |
" 1280 ISP1280 SCSI Host Adapter", |
" 2020 ISP2020A Fast!SCSI Basic Adapter", |
" 2100 QLA2100 64-bit Fibre Channel Adapter", |
" 1077 0001 QLA2100 64-bit Fibre Channel Adapter", |
" 2200 QLA2200 64-bit Fibre Channel Adapter", |
" 1077 0002 QLA2200", |
" 2300 QLA2300 64-bit Fibre Channel Adapter", |
" 2312 QLA2312 Fibre Channel Adapter", |
" 2322 QLA2322 Fibre Channel Adapter", |
" 2422 QLA2422 Fibre Channel Adapter", |
" 2432 QLA2432 Fibre Channel Adapter", |
" 3010 QLA3010 Network Adapter", |
" 3022 QLA3022 Network Adapter", |
" 4010 QLA4010 iSCSI TOE Adapter", |
" 4022 QLA4022 iSCSI TOE Adapter", |
" 6312 QLA6312 Fibre Channel Adapter", |
" 6322 QLA6322 Fibre Channel Adapter", |
"1078 Cyrix Corporation", |
" 0000 5510 [Grappa]", |
" 0001 PCI Master", |
" 0002 5520 [Cognac]", |
" 0100 5530 Legacy [Kahlua]", |
" 0101 5530 SMI [Kahlua]", |
" 0102 5530 IDE [Kahlua]", |
" 0103 5530 Audio [Kahlua]", |
" 0104 5530 Video [Kahlua]", |
" 0400 ZFMicro PCI Bridge", |
" 0401 ZFMicro Chipset SMI", |
" 0402 ZFMicro Chipset IDE", |
" 0403 ZFMicro Expansion Bus", |
"1079 I-Bus", |
"107a NetWorth", |
"107b Gateway 2000", |
"107c LG Electronics [Lucky Goldstar Co. Ltd]", |
"107d LeadTek Research Inc.", |
" 0000 P86C850", |
" 204d [GeForce 7800 GTX] Winfast PX7800 GTX TDH", |
" 2134 WinFast 3D S320 II", |
" 2971 [GeForce FX 5900] WinFast A350 TDH MyViVo", |
"107e Interphase Corporation", |
" 0001 5515 ATM Adapter [Flipper]", |
" 0002 100 VG AnyLan Controller", |
" 0004 5526 Fibre Channel Host Adapter", |
" 0005 x526 Fibre Channel Host Adapter", |
" 0008 5525/5575 ATM Adapter (155 Mbit) [Atlantic]", |
" 9003 5535-4P-BRI-ST", |
" 9007 5535-4P-BRI-U", |
" 9008 5535-1P-SR", |
" 900c 5535-1P-SR-ST", |
" 900e 5535-1P-SR-U", |
" 9011 5535-1P-PRI", |
" 9013 5535-2P-PRI", |
" 9023 5536-4P-BRI-ST", |
" 9027 5536-4P-BRI-U", |
" 9031 5536-1P-PRI", |
" 9033 5536-2P-PRI", |
"107f Data Technology Corporation", |
" 0802 SL82C105", |
"1080 Contaq Microsystems", |
" 0600 82C599", |
" c691 Cypress CY82C691", |
" c693 82c693", |
"1081 Supermac Technology", |
" 0d47 Radius PCI to NuBUS Bridge", |
"1082 EFA Corporation of America", |
"1083 Forex Computer Corporation", |
" 0001 FR710", |
"1084 Parador", |
"1085 Tulip Computers Int.B.V.", |
"1086 J. Bond Computer Systems", |
"1087 Cache Computer", |
"1088 Microcomputer Systems (M) Son", |
"1089 Data General Corporation", |
"108a SBS Technologies", |
" 0001 VME Bridge Model 617", |
" 0010 VME Bridge Model 618", |
" 0040 dataBLIZZARD", |
" 3000 VME Bridge Model 2706", |
"108c Oakleigh Systems Inc.", |
"108d Olicom", |
" 0001 Token-Ring 16/4 PCI Adapter (3136/3137)", |
" 0002 16/4 Token Ring", |
" 0004 RapidFire 3139 Token-Ring 16/4 PCI Adapter", |
" 108d 0004 OC-3139/3140 RapidFire Token-Ring 16/4 Adapter", |
" 0005 GoCard 3250 Token-Ring 16/4 CardBus PC Card", |
" 0006 OC-3530 RapidFire Token-Ring 100", |
" 0007 RapidFire 3141 Token-Ring 16/4 PCI Fiber Adapter", |
" 108d 0007 OC-3141 RapidFire Token-Ring 16/4 Adapter", |
" 0008 RapidFire 3540 HSTR 100/16/4 PCI Adapter", |
" 108d 0008 OC-3540 RapidFire HSTR 100/16/4 Adapter", |
" 0011 OC-2315", |
" 0012 OC-2325", |
" 0013 OC-2183/2185", |
" 0014 OC-2326", |
" 0019 OC-2327/2250 10/100 Ethernet Adapter", |
" 108d 0016 OC-2327 Rapidfire 10/100 Ethernet Adapter", |
" 108d 0017 OC-2250 GoCard 10/100 Ethernet Adapter", |
" 0021 OC-6151/6152 [RapidFire ATM 155]", |
" 0022 ATM Adapter", |
"108e Sun Microsystems Computer Corp.", |
" 0001 EBUS", |
" 1000 EBUS", |
" 1001 Happy Meal", |
" 1100 RIO EBUS", |
" 1101 RIO GEM", |
" 1102 RIO 1394", |
" 1103 RIO USB", |
" 1648 [bge] Gigabit Ethernet", |
" 2bad GEM", |
" 5000 Simba Advanced PCI Bridge", |
" 5043 SunPCI Co-processor", |
" 8000 Psycho PCI Bus Module", |
" 8001 Schizo PCI Bus Module", |
" 8002 Schizo+ PCI Bus Module", |
" a000 Ultra IIi", |
" a001 Ultra IIe", |
" a801 Tomatillo PCI Bus Module", |
" abba Cassini 10/100/1000", |
"108f Systemsoft", |
"1090 Compro Computer Services, Inc.", |
"1091 Intergraph Corporation", |
" 0020 3D graphics processor", |
" 0021 3D graphics processor w/Texturing", |
" 0040 3D graphics frame buffer", |
" 0041 3D graphics frame buffer", |
" 0060 Proprietary bus bridge", |
" 00e4 Powerstorm 4D50T", |
" 0720 Motion JPEG codec", |
" 07a0 Sun Expert3D-Lite Graphics Accelerator", |
" 1091 Sun Expert3D Graphics Accelerator", |
"1092 Diamond Multimedia Systems", |
" 00a0 Speedstar Pro SE", |
" 00a8 Speedstar 64", |
" 0550 Viper V550", |
" 08d4 Supra 2260 Modem", |
" 094c SupraExpress 56i Pro", |
" 1092 Viper V330", |
" 6120 Maximum DVD", |
" 8810 Stealth SE", |
" 8811 Stealth 64/SE", |
" 8880 Stealth", |
" 8881 Stealth", |
" 88b0 Stealth 64", |
" 88b1 Stealth 64", |
" 88c0 Stealth 64", |
" 88c1 Stealth 64", |
" 88d0 Stealth 64", |
" 88d1 Stealth 64", |
" 88f0 Stealth 64", |
" 88f1 Stealth 64", |
" 9999 DMD-I0928-1 'Monster sound' sound chip", |
"1093 National Instruments", |
" 0160 PCI-DIO-96", |
" 0162 PCI-MIO-16XE-50", |
" 1150 PCI-DIO-32HS High Speed Digital I/O Board", |
" 1170 PCI-MIO-16XE-10", |
" 1180 PCI-MIO-16E-1", |
" 1190 PCI-MIO-16E-4", |
" 1310 PCI-6602", |
" 1330 PCI-6031E", |
" 1350 PCI-6071E", |
" 14e0 PCI-6110", |
" 14f0 PCI-6111", |
" 17d0 PCI-6503", |
" 1870 PCI-6713", |
" 1880 PCI-6711", |
" 18b0 PCI-6052E", |
" 2410 PCI-6733", |
" 2890 PCI-6036E", |
" 2a60 PCI-6023E", |
" 2a70 PCI-6024E", |
" 2a80 PCI-6025E", |
" 2c80 PCI-6035E", |
" 2ca0 PCI-6034E", |
" 70a9 PCI-6528 (Digital I/O at 60V)", |
" 70b8 PCI-6251 [M Series - High Speed Multifunction DAQ]", |
" b001 IMAQ-PCI-1408", |
" b011 IMAQ-PXI-1408", |
" b021 IMAQ-PCI-1424", |
" b031 IMAQ-PCI-1413", |
" b041 IMAQ-PCI-1407", |
" b051 IMAQ-PXI-1407", |
" b061 IMAQ-PCI-1411", |
" b071 IMAQ-PCI-1422", |
" b081 IMAQ-PXI-1422", |
" b091 IMAQ-PXI-1411", |
" c801 PCI-GPIB", |
" c831 PCI-GPIB bridge", |
"1094 First International Computers [FIC]", |
"1095 Silicon Image, Inc.", |
" 0240 Adaptec AAR-1210SA SATA HostRAID Controller", |
" 0640 PCI0640", |
" 0643 PCI0643", |
" 0646 PCI0646", |
" 0647 PCI0647", |
" 0648 PCI0648", |
" 1043 8025 CUBX motherboard", |
" 0649 SiI 0649 Ultra ATA/100 PCI to ATA Host Controller", |
" 0e11 005d Integrated Ultra ATA-100 Dual Channel Controller", |
" 0e11 007e Integrated Ultra ATA-100 IDE RAID Controller", |
" 101e 0649 AMI MegaRAID IDE 100 Controller", |
" 0650 PBC0650A", |
" 0670 USB0670", |
" 1095 0670 USB0670", |
" 0673 USB0673", |
" 0680 PCI0680 Ultra ATA-133 Host Controller", |
" 1095 3680 Winic W-680 (Silicon Image 680 based)", |
" 3112 SiI 3112 [SATALink/SATARaid] Serial ATA Controller", |
" 1095 3112 SiI 3112 SATALink Controller", |
" 1095 6112 SiI 3112 SATARaid Controller", |
" 9005 0250 SATAConnect 1205SA Host Controller", |
" 3114 SiI 3114 [SATALink/SATARaid] Serial ATA Controller", |
" 1095 3114 SiI 3114 SATALink Controller", |
" 1095 6114 SiI 3114 SATARaid Controller", |
" 3124 SiI 3124 PCI-X Serial ATA Controller", |
" 1095 3124 SiI 3124 PCI-X Serial ATA Controller", |
" 3132 SiI 3132 Serial ATA Raid II Controller", |
" 3512 SiI 3512 [SATALink/SATARaid] Serial ATA Controller", |
" 1095 3512 SiI 3512 SATALink Controller", |
" 1095 6512 SiI 3512 SATARaid Controller", |
"1096 Alacron", |
"1097 Appian Technology", |
"1098 Quantum Designs (H.K.) Ltd", |
" 0001 QD-8500", |
" 0002 QD-8580", |
"1099 Samsung Electronics Co., Ltd", |
"109a Packard Bell", |
"109b Gemlight Computer Ltd.", |
"109c Megachips Corporation", |
"109d Zida Technologies Ltd.", |
"109e Brooktree Corporation", |
" 032e Bt878 Video Capture", |
" 0350 Bt848 Video Capture", |
" 0351 Bt849A Video capture", |
" 0369 Bt878 Video Capture", |
" 1002 0001 TV-Wonder", |
" 1002 0003 TV-Wonder/VE", |
" 036c Bt879(??) Video Capture", |
" 13e9 0070 Win/TV (Video Section)", |
" 036e Bt878 Video Capture", |
" 0070 13eb WinTV Series", |
" 0070 ff01 Viewcast Osprey 200", |
" 0071 0101 DigiTV PCI", |
" 107d 6606 WinFast TV 2000", |
" 11bd 0012 PCTV pro (TV + FM stereo receiver)", |
" 11bd 001c PCTV Sat (DBC receiver)", |
" 127a 0001 Bt878 Mediastream Controller NTSC", |
" 127a 0002 Bt878 Mediastream Controller PAL BG", |
" 127a 0003 Bt878a Mediastream Controller PAL BG", |
" 127a 0048 Bt878/832 Mediastream Controller", |
" 144f 3000 MagicTView CPH060 - Video", |
" 1461 0002 TV98 Series (TV/No FM/Remote)", |
" 1461 0003 AverMedia UltraTV PCI 350", |
" 1461 0004 AVerTV WDM Video Capture", |
" 1461 0761 AverTV DVB-T", |
" 14f1 0001 Bt878 Mediastream Controller NTSC", |
" 14f1 0002 Bt878 Mediastream Controller PAL BG", |
" 14f1 0003 Bt878a Mediastream Controller PAL BG", |
" 14f1 0048 Bt878/832 Mediastream Controller", |
" 1822 0001 VisionPlus DVB card", |
" 1851 1850 FlyVideo'98 - Video", |
" 1851 1851 FlyVideo II", |
" 1852 1852 FlyVideo'98 - Video (with FM Tuner)", |
" 18ac d500 DViCO FusionHDTV5 Lite", |
" 270f fc00 Digitop DTT-1000", |
" bd11 1200 PCTV pro (TV + FM stereo receiver)", |
" 036f Bt879 Video Capture", |
" 127a 0044 Bt879 Video Capture NTSC", |
" 127a 0122 Bt879 Video Capture PAL I", |
" 127a 0144 Bt879 Video Capture NTSC", |
" 127a 0222 Bt879 Video Capture PAL BG", |
" 127a 0244 Bt879a Video Capture NTSC", |
" 127a 0322 Bt879 Video Capture NTSC", |
" 127a 0422 Bt879 Video Capture NTSC", |
" 127a 1122 Bt879 Video Capture PAL I", |
" 127a 1222 Bt879 Video Capture PAL BG", |
" 127a 1322 Bt879 Video Capture NTSC", |
" 127a 1522 Bt879a Video Capture PAL I", |
" 127a 1622 Bt879a Video Capture PAL BG", |
" 127a 1722 Bt879a Video Capture NTSC", |
" 14f1 0044 Bt879 Video Capture NTSC", |
" 14f1 0122 Bt879 Video Capture PAL I", |
" 14f1 0144 Bt879 Video Capture NTSC", |
" 14f1 0222 Bt879 Video Capture PAL BG", |
" 14f1 0244 Bt879a Video Capture NTSC", |
" 14f1 0322 Bt879 Video Capture NTSC", |
" 14f1 0422 Bt879 Video Capture NTSC", |
" 14f1 1122 Bt879 Video Capture PAL I", |
" 14f1 1222 Bt879 Video Capture PAL BG", |
" 14f1 1322 Bt879 Video Capture NTSC", |
" 14f1 1522 Bt879a Video Capture PAL I", |
" 14f1 1622 Bt879a Video Capture PAL BG", |
" 14f1 1722 Bt879a Video Capture NTSC", |
" 1851 1850 FlyVideo'98 - Video", |
" 1851 1851 FlyVideo II", |
" 1852 1852 FlyVideo'98 - Video (with FM Tuner)", |
" 0370 Bt880 Video Capture", |
" 1851 1850 FlyVideo'98", |
" 1851 1851 FlyVideo'98 EZ - video", |
" 1852 1852 FlyVideo'98 (with FM Tuner)", |
" 0878 Bt878 Audio Capture", |
" 0070 13eb WinTV Series", |
" 0070 ff01 Viewcast Osprey 200", |
" 0071 0101 DigiTV PCI", |
" 1002 0001 TV-Wonder", |
" 1002 0003 TV-Wonder/VE", |
" 11bd 0012 PCTV pro (TV + FM stereo receiver, audio section)", |
" 11bd 001c PCTV Sat (DBC receiver)", |
" 127a 0001 Bt878 Video Capture (Audio Section)", |
" 127a 0002 Bt878 Video Capture (Audio Section)", |
" 127a 0003 Bt878 Video Capture (Audio Section)", |
" 127a 0048 Bt878 Video Capture (Audio Section)", |
" 13e9 0070 Win/TV (Audio Section)", |
" 144f 3000 MagicTView CPH060 - Audio", |
" 1461 0002 Avermedia PCTV98 Audio Capture", |
" 1461 0004 AVerTV WDM Audio Capture", |
" 1461 0761 AVerTV DVB-T", |
" 14f1 0001 Bt878 Video Capture (Audio Section)", |
" 14f1 0002 Bt878 Video Capture (Audio Section)", |
" 14f1 0003 Bt878 Video Capture (Audio Section)", |
" 14f1 0048 Bt878 Video Capture (Audio Section)", |
" 1822 0001 VisionPlus DVB Card", |
" 18ac d500 DViCO FusionHDTV5 Lite", |
" 270f fc00 Digitop DTT-1000", |
" bd11 1200 PCTV pro (TV + FM stereo receiver, audio section)", |
" 0879 Bt879 Audio Capture", |
" 127a 0044 Bt879 Video Capture (Audio Section)", |
" 127a 0122 Bt879 Video Capture (Audio Section)", |
" 127a 0144 Bt879 Video Capture (Audio Section)", |
" 127a 0222 Bt879 Video Capture (Audio Section)", |
" 127a 0244 Bt879 Video Capture (Audio Section)", |
" 127a 0322 Bt879 Video Capture (Audio Section)", |
" 127a 0422 Bt879 Video Capture (Audio Section)", |
" 127a 1122 Bt879 Video Capture (Audio Section)", |
" 127a 1222 Bt879 Video Capture (Audio Section)", |
" 127a 1322 Bt879 Video Capture (Audio Section)", |
" 127a 1522 Bt879 Video Capture (Audio Section)", |
" 127a 1622 Bt879 Video Capture (Audio Section)", |
" 127a 1722 Bt879 Video Capture (Audio Section)", |
" 14f1 0044 Bt879 Video Capture (Audio Section)", |
" 14f1 0122 Bt879 Video Capture (Audio Section)", |
" 14f1 0144 Bt879 Video Capture (Audio Section)", |
" 14f1 0222 Bt879 Video Capture (Audio Section)", |
" 14f1 0244 Bt879 Video Capture (Audio Section)", |
" 14f1 0322 Bt879 Video Capture (Audio Section)", |
" 14f1 0422 Bt879 Video Capture (Audio Section)", |
" 14f1 1122 Bt879 Video Capture (Audio Section)", |
" 14f1 1222 Bt879 Video Capture (Audio Section)", |
" 14f1 1322 Bt879 Video Capture (Audio Section)", |
" 14f1 1522 Bt879 Video Capture (Audio Section)", |
" 14f1 1622 Bt879 Video Capture (Audio Section)", |
" 14f1 1722 Bt879 Video Capture (Audio Section)", |
" 0880 Bt880 Audio Capture", |
" 2115 BtV 2115 Mediastream controller", |
" 2125 BtV 2125 Mediastream controller", |
" 2164 BtV 2164", |
" 2165 BtV 2165", |
" 8230 Bt8230 ATM Segment/Reassembly Ctrlr (SRC)", |
" 8472 Bt8472", |
" 8474 Bt8474", |
"109f Trigem Computer Inc.", |
"10a0 Meidensha Corporation", |
"10a1 Juko Electronics Ind. Co. Ltd", |
"10a2 Quantum Corporation", |
"10a3 Everex Systems Inc", |
"10a4 Globe Manufacturing Sales", |
"10a5 Smart Link Ltd.", |
" 3052 SmartPCI562 56K Modem", |
" 5449 SmartPCI561 modem", |
"10a6 Informtech Industrial Ltd.", |
"10a7 Benchmarq Microelectronics", |
"10a8 Sierra Semiconductor", |
" 0000 STB Horizon 64", |
"10a9 Silicon Graphics, Inc.", |
" 0001 Crosstalk to PCI Bridge", |
" 0002 Linc I/O controller", |
" 0003 IOC3 I/O controller", |
" 0004 O2 MACE", |
" 0005 RAD Audio", |
" 0006 HPCEX", |
" 0007 RPCEX", |
" 0008 DiVO VIP", |
" 0009 AceNIC Gigabit Ethernet", |
" 10a9 8002 AceNIC Gigabit Ethernet", |
" 0010 AMP Video I/O", |
" 0011 GRIP", |
" 0012 SGH PSHAC GSN", |
" 1001 Magic Carpet", |
" 1002 Lithium", |
" 1003 Dual JPEG 1", |
" 1004 Dual JPEG 2", |
" 1005 Dual JPEG 3", |
" 1006 Dual JPEG 4", |
" 1007 Dual JPEG 5", |
" 1008 Cesium", |
" 100a IOC4 I/O controller", |
" 2001 Fibre Channel", |
" 2002 ASDE", |
" 4001 TIO-CE PCI Express Bridge", |
" 4002 TIO-CE PCI Express Port", |
" 8001 O2 1394", |
" 8002 G-net NT", |
" 8010 Broadcom e-net [SGI IO9/IO10 BaseIO]", |
" 8018 Broadcom e-net [SGI A330 Server BaseIO]", |
"10aa ACC Microelectronics", |
" 0000 ACCM 2188", |
"10ab Digicom", |
"10ac Honeywell IAC", |
"10ad Symphony Labs", |
" 0001 W83769F", |
" 0003 SL82C103", |
" 0005 SL82C105", |
" 0103 SL82c103", |
" 0105 SL82c105", |
" 0565 W83C553", |
"10ae Cornerstone Technology", |
"10af Micro Computer Systems Inc", |
"10b0 CardExpert Technology", |
"10b1 Cabletron Systems Inc", |
"10b2 Raytheon Company", |
"10b3 Databook Inc", |
" 3106 DB87144", |
" b106 DB87144", |
"10b4 STB Systems Inc", |
" 1b1d Velocity 128 3D", |
" 10b4 237e Velocity 4400", |
"10b5 PLX Technology, Inc.", |
" 0001 i960 PCI bus interface", |
" 1042 Brandywine / jxi2, Inc. - PMC-SyncClock32, IRIG A & B, Nasa 36", |
" 1076 VScom 800 8 port serial adaptor", |
" 1077 VScom 400 4 port serial adaptor", |
" 1078 VScom 210 2 port serial and 1 port parallel adaptor", |
" 1103 VScom 200 2 port serial adaptor", |
" 1146 VScom 010 1 port parallel adaptor", |
" 1147 VScom 020 2 port parallel adaptor", |
" 2540 IXXAT CAN-Interface PC-I 04/PCI", |
" 2724 Thales PCSM Security Card", |
" 6540 PCI6540/6466 PCI-PCI bridge (transparent mode)", |
" 4c53 10e0 PSL09 PrPMC", |
" 6541 PCI6540/6466 PCI-PCI bridge (non-transparent mode, primary side)", |
" 4c53 10e0 PSL09 PrPMC", |
" 6542 PCI6540/6466 PCI-PCI bridge (non-transparent mode, secondary side)", |
" 4c53 10e0 PSL09 PrPMC", |
" 8111 PEX 8111 PCI Express-to-PCI Bridge", |
" 8114 PEX 8114 PCI Express-to-PCI/PCI-X Bridge", |
" 8516 PEX 8516 Versatile PCI Express Switch", |
" 8532 PEX 8532 Versatile PCI Express Switch", |
" 9030 PCI <-> IOBus Bridge Hot Swap", |
" 10b5 2862 Alpermann+Velte PCL PCI LV (3V/5V): Timecode Reader Board", |
" 10b5 2906 Alpermann+Velte PCI TS (3V/5V): Time Synchronisation Board", |
" 10b5 2940 Alpermann+Velte PCL PCI D (3V/5V): Timecode Reader Board", |
" 10b5 2977 IXXAT iPC-I XC16/PCI CAN Board", |
" 10b5 2978 SH ARC-PCIu SOHARD ARCNET card", |
" 10b5 3025 Alpermann+Velte PCL PCI L (3V/5V): Timecode Reader Board", |
" 10b5 3068 Alpermann+Velte PCL PCI HD (3V/5V): Timecode Reader Board", |
" 1397 3136 4xS0-ISDN PCI Adapter", |
" 1397 3137 S2M-E1-ISDN PCI Adapter", |
" 1518 0200 Kontron ThinkIO-C", |
" 15ed 1002 MCCS 8-port Serial Hot Swap", |
" 15ed 1003 MCCS 16-port Serial Hot Swap", |
" 9036 9036", |
" 9050 PCI <-> IOBus Bridge", |
" 10b5 1067 IXXAT CAN i165", |
" 10b5 1172 IK220 (Heidenhain)", |
" 10b5 2036 SatPak GPS", |
" 10b5 2221 Alpermann+Velte PCL PCI LV: Timecode Reader Board", |
" 10b5 2273 SH ARC-PCI SOHARD ARCNET card", |
" 10b5 2431 Alpermann+Velte PCL PCI D: Timecode Reader Board", |
" 10b5 2905 Alpermann+Velte PCI TS: Time Synchronisation Board", |
" 10b5 9050 MP9050", |
" 1498 0362 TPMC866 8 Channel Serial Card", |
" 1522 0001 RockForce 4 Port V.90 Data/Fax/Voice Modem", |
" 1522 0002 RockForce 2 Port V.90 Data/Fax/Voice Modem", |
" 1522 0003 RockForce 6 Port V.90 Data/Fax/Voice Modem", |
" 1522 0004 RockForce 8 Port V.90 Data/Fax/Voice Modem", |
" 1522 0010 RockForce2000 4 Port V.90 Data/Fax/Voice Modem", |
" 1522 0020 RockForce2000 2 Port V.90 Data/Fax/Voice Modem", |
" 15ed 1000 Macrolink MCCS 8-port Serial", |
" 15ed 1001 Macrolink MCCS 16-port Serial", |
" 15ed 1002 Macrolink MCCS 8-port Serial Hot Swap", |
" 15ed 1003 Macrolink MCCS 16-port Serial Hot Swap", |
" 5654 2036 OpenSwitch 6 Telephony card", |
" 5654 3132 OpenSwitch 12 Telephony card", |
" 5654 5634 OpenLine4 Telephony Card", |
" d531 c002 PCIntelliCAN 2xSJA1000 CAN bus", |
" d84d 4006 EX-4006 1P", |
" d84d 4008 EX-4008 1P EPP/ECP", |
" d84d 4014 EX-4014 2P", |
" d84d 4018 EX-4018 3P EPP/ECP", |
" d84d 4025 EX-4025 1S(16C550) RS-232", |
" d84d 4027 EX-4027 1S(16C650) RS-232", |
" d84d 4028 EX-4028 1S(16C850) RS-232", |
" d84d 4036 EX-4036 2S(16C650) RS-232", |
" d84d 4037 EX-4037 2S(16C650) RS-232", |
" d84d 4038 EX-4038 2S(16C850) RS-232", |
" d84d 4052 EX-4052 1S(16C550) RS-422/485", |
" d84d 4053 EX-4053 2S(16C550) RS-422/485", |
" d84d 4055 EX-4055 4S(16C550) RS-232", |
" d84d 4058 EX-4055 4S(16C650) RS-232", |
" d84d 4065 EX-4065 8S(16C550) RS-232", |
" d84d 4068 EX-4068 8S(16C650) RS-232", |
" d84d 4078 EX-4078 2S(16C552) RS-232+1P", |
" 9054 PCI <-> IOBus Bridge", |
" 10b5 2455 Wessex Techology PHIL-PCI", |
" 10b5 2696 Innes Corp AM Radcap card", |
" 10b5 2717 Innes Corp Auricon card", |
" 10b5 2844 Innes Corp TVS Encoder card", |
" 12c7 4001 Intel Dialogic DM/V960-4T1 PCI", |
" 12d9 0002 PCI Prosody Card rev 1.5", |
" 16df 0011 PIKA PrimeNet MM PCI", |
" 16df 0012 PIKA PrimeNet MM cPCI 8", |
" 16df 0013 PIKA PrimeNet MM cPCI 8 (without CAS Signaling)", |
" 16df 0014 PIKA PrimeNet MM cPCI 4", |
" 16df 0015 PIKA Daytona MM", |
" 16df 0016 PIKA InLine MM", |
" 9056 Francois", |
" 10b5 2979 CellinkBlade 11 - CPCI board VoATM AAL1", |
" 9060 9060", |
" 906d 9060SD", |
" 125c 0640 Aries 16000P", |
" 906e 9060ES", |
" 9080 9080", |
" 103c 10eb (Agilent) E2777B 83K Series Optical Communication Interface", |
" 103c 10ec (Agilent) E6978-66442 PCI CIC", |
" 10b5 9080 9080 [real subsystem ID not set]", |
" 129d 0002 Aculab PCI Prosidy card", |
" 12d9 0002 PCI Prosody Card", |
" 12df 4422 4422PCI ['Do-All' Telemetry Data Aquisition System]", |
" bb04 B&B 3PCIOSD1A Isolated PCI Serial", |
"10b6 Madge Networks", |
" 0001 Smart 16/4 PCI Ringnode", |
" 0002 Smart 16/4 PCI Ringnode Mk2", |
" 10b6 0002 Smart 16/4 PCI Ringnode Mk2", |
" 10b6 0006 16/4 CardBus Adapter", |
" 0003 Smart 16/4 PCI Ringnode Mk3", |
" 0e11 b0fd Compaq NC4621 PCI, 4/16, WOL", |
" 10b6 0003 Smart 16/4 PCI Ringnode Mk3", |
" 10b6 0007 Presto PCI Plus Adapter", |
" 0004 Smart 16/4 PCI Ringnode Mk1", |
" 0006 16/4 Cardbus Adapter", |
" 10b6 0006 16/4 CardBus Adapter", |
" 0007 Presto PCI Adapter", |
" 10b6 0007 Presto PCI", |
" 0009 Smart 100/16/4 PCI-HS Ringnode", |
" 10b6 0009 Smart 100/16/4 PCI-HS Ringnode", |
" 000a Smart 100/16/4 PCI Ringnode", |
" 10b6 000a Smart 100/16/4 PCI Ringnode", |
" 000b 16/4 CardBus Adapter Mk2", |
" 10b6 0008 16/4 CardBus Adapter Mk2", |
" 10b6 000b 16/4 Cardbus Adapter Mk2", |
" 000c RapidFire 3140V2 16/4 TR Adapter", |
" 10b6 000c RapidFire 3140V2 16/4 TR Adapter", |
" 1000 Collage 25/155 ATM Client Adapter", |
" 1001 Collage 155 ATM Server Adapter", |
"10b7 3Com Corporation", |
" 0001 3c985 1000BaseSX (SX/TX)", |
" 0013 AR5212 802.11abg NIC (3CRDAG675)", |
" 10b7 2031 3CRDAG675 11a/b/g Wireless PCI Adapter", |
" 0910 3C910-A01", |
" 1006 MINI PCI type 3B Data Fax Modem", |
" 1007 Mini PCI 56k Winmodem", |
" 10b7 615c Mini PCI 56K Modem", |
" 1201 3c982-TXM 10/100baseTX Dual Port A [Hydra]", |
" 1202 3c982-TXM 10/100baseTX Dual Port B [Hydra]", |
" 1700 3c940 10/100/1000Base-T [Marvell]", |
" 1043 80eb A7V600/P4P800/K8V motherboard", |
" 10b7 0010 3C940 Gigabit LOM Ethernet Adapter", |
" 10b7 0020 3C941 Gigabit LOM Ethernet Adapter", |
" 147b 1407 KV8-MAX3 motherboard", |
" 3390 3c339 TokenLink Velocity", |
" 3590 3c359 TokenLink Velocity XL", |
" 10b7 3590 TokenLink Velocity XL Adapter (3C359/359B)", |
" 4500 3c450 HomePNA [Tornado]", |
" 5055 3c555 Laptop Hurricane", |
" 5057 3c575 Megahertz 10/100 LAN CardBus [Boomerang]", |
" 10b7 5a57 3C575 Megahertz 10/100 LAN Cardbus PC Card", |
" 5157 3cCFE575BT Megahertz 10/100 LAN CardBus [Cyclone]", |
" 10b7 5b57 3C575 Megahertz 10/100 LAN Cardbus PC Card", |
" 5257 3cCFE575CT CardBus [Cyclone]", |
" 10b7 5c57 FE575C-3Com 10/100 LAN CardBus-Fast Ethernet", |
" 5900 3c590 10BaseT [Vortex]", |
" 5920 3c592 EISA 10mbps Demon/Vortex", |
" 5950 3c595 100BaseTX [Vortex]", |
" 5951 3c595 100BaseT4 [Vortex]", |
" 5952 3c595 100Base-MII [Vortex]", |
" 5970 3c597 EISA Fast Demon/Vortex", |
" 5b57 3c595 Megahertz 10/100 LAN CardBus [Boomerang]", |
" 10b7 5b57 3C575 Megahertz 10/100 LAN Cardbus PC Card", |
" 6000 3CRSHPW796 [OfficeConnect Wireless CardBus]", |
" 6001 3com 3CRWE154G72 [Office Connect Wireless LAN Adapter]", |
" 6055 3c556 Hurricane CardBus [Cyclone]", |
" 6056 3c556B CardBus [Tornado]", |
" 10b7 6556 10/100 Mini PCI Ethernet Adapter", |
" 6560 3cCFE656 CardBus [Cyclone]", |
" 10b7 656a 3CCFEM656 10/100 LAN+56K Modem CardBus", |
" 6561 3cCFEM656 10/100 LAN+56K Modem CardBus", |
" 10b7 656b 3CCFEM656 10/100 LAN+56K Modem CardBus", |
" 6562 3cCFEM656B 10/100 LAN+Winmodem CardBus [Cyclone]", |
" 10b7 656b 3CCFEM656B 10/100 LAN+56K Modem CardBus", |
" 6563 3cCFEM656B 10/100 LAN+56K Modem CardBus", |
" 10b7 656b 3CCFEM656 10/100 LAN+56K Modem CardBus", |
" 6564 3cXFEM656C 10/100 LAN+Winmodem CardBus [Tornado]", |
" 7646 3cSOHO100-TX Hurricane", |
" 7770 3CRWE777 PCI(PLX) Wireless Adaptor [Airconnect]", |
" 7940 3c803 FDDILink UTP Controller", |
" 7980 3c804 FDDILink SAS Controller", |
" 7990 3c805 FDDILink DAS Controller", |
" 80eb 3c940B 10/100/1000Base-T", |
" 8811 Token ring", |
" 9000 3c900 10BaseT [Boomerang]", |
" 9001 3c900 10Mbps Combo [Boomerang]", |
" 9004 3c900B-TPO Etherlink XL [Cyclone]", |
" 10b7 9004 3C900B-TPO Etherlink XL TPO 10Mb", |
" 9005 3c900B-Combo Etherlink XL [Cyclone]", |
" 10b7 9005 3C900B-Combo Etherlink XL Combo", |
" 9006 3c900B-TPC Etherlink XL [Cyclone]", |
" 900a 3c900B-FL 10base-FL [Cyclone]", |
" 9050 3c905 100BaseTX [Boomerang]", |
" 9051 3c905 100BaseT4 [Boomerang]", |
" 9055 3c905B 100BaseTX [Cyclone]", |
" 1028 0080 3C905B Fast Etherlink XL 10/100", |
" 1028 0081 3C905B Fast Etherlink XL 10/100", |
" 1028 0082 3C905B Fast Etherlink XL 10/100", |
" 1028 0083 3C905B Fast Etherlink XL 10/100", |
" 1028 0084 3C905B Fast Etherlink XL 10/100", |
" 1028 0085 3C905B Fast Etherlink XL 10/100", |
" 1028 0086 3C905B Fast Etherlink XL 10/100", |
" 1028 0087 3C905B Fast Etherlink XL 10/100", |
" 1028 0088 3C905B Fast Etherlink XL 10/100", |
" 1028 0089 3C905B Fast Etherlink XL 10/100", |
" 1028 0090 3C905B Fast Etherlink XL 10/100", |
" 1028 0091 3C905B Fast Etherlink XL 10/100", |
" 1028 0092 3C905B Fast Etherlink XL 10/100", |
" 1028 0093 3C905B Fast Etherlink XL 10/100", |
" 1028 0094 3C905B Fast Etherlink XL 10/100", |
" 1028 0095 3C905B Fast Etherlink XL 10/100", |
" 1028 0096 3C905B Fast Etherlink XL 10/100", |
" 1028 0097 3C905B Fast Etherlink XL 10/100", |
" 1028 0098 3C905B Fast Etherlink XL 10/100", |
" 1028 0099 3C905B Fast Etherlink XL 10/100", |
" 10b7 9055 3C905B Fast Etherlink XL 10/100", |
" 9056 3c905B-T4 Fast EtherLink XL [Cyclone]", |
" 9058 3c905B Deluxe Etherlink 10/100/BNC [Cyclone]", |
" 905a 3c905B-FX Fast Etherlink XL FX 100baseFx [Cyclone]", |
" 9200 3c905C-TX/TX-M [Tornado]", |
" 1028 0095 3C920 Integrated Fast Ethernet Controller", |
" 1028 0097 3C920 Integrated Fast Ethernet Controller", |
" 1028 00fe Optiplex GX240", |
" 1028 012a 3C920 Integrated Fast Ethernet Controller [Latitude C640]", |
" 10b7 1000 3C905C-TX Fast Etherlink for PC Management NIC", |
" 10b7 7000 10/100 Mini PCI Ethernet Adapter", |
" 10f1 2466 Tiger MPX S2466 (3C920 Integrated Fast Ethernet Controller)", |
" 9201 3C920B-EMB Integrated Fast Ethernet Controller [Tornado]", |
" 1043 80ab A7N8X Deluxe onboard 3C920B-EMB Integrated Fast Ethernet Controller", |
" 9202 3Com 3C920B-EMB-WNM Integrated Fast Ethernet Controller", |
" 9210 3C920B-EMB-WNM Integrated Fast Ethernet Controller", |
" 9300 3CSOHO100B-TX 910-A01 [tulip]", |
" 9800 3c980-TX Fast Etherlink XL Server Adapter [Cyclone]", |
" 10b7 9800 3c980-TX Fast Etherlink XL Server Adapter", |
" 9805 3c980-C 10/100baseTX NIC [Python-T]", |
" 10b7 1201 EtherLink Server 10/100 Dual Port A", |
" 10b7 1202 EtherLink Server 10/100 Dual Port B", |
" 10b7 9805 3c980 10/100baseTX NIC [Python-T]", |
" 10f1 2462 Thunder K7 S2462", |
" 9900 3C990-TX [Typhoon]", |
" 9902 3CR990-TX-95 [Typhoon 56-bit]", |
" 9903 3CR990-TX-97 [Typhoon 168-bit]", |
" 9904 3C990B-TX-M/3C990BSVR [Typhoon2]", |
" 10b7 1000 3CR990B-TX-M [Typhoon2]", |
" 10b7 2000 3CR990BSVR [Typhoon2 Server]", |
" 9905 3CR990-FX-95/97/95 [Typhon Fiber]", |
" 10b7 1101 3CR990-FX-95 [Typhoon Fiber 56-bit]", |
" 10b7 1102 3CR990-FX-97 [Typhoon Fiber 168-bit]", |
" 10b7 2101 3CR990-FX-95 Server [Typhoon Fiber 56-bit]", |
" 10b7 2102 3CR990-FX-97 Server [Typhoon Fiber 168-bit]", |
" 9908 3CR990SVR95 [Typhoon Server 56-bit]", |
" 9909 3CR990SVR97 [Typhoon Server 168-bit]", |
" 990a 3C990SVR [Typhoon Server]", |
" 990b 3C990SVR [Typhoon Server]", |
"10b8 Standard Microsystems Corp [SMC]", |
" 0005 83c170 EPIC/100 Fast Ethernet Adapter", |
" 1055 e000 LANEPIC 10/100 [EVB171Q-PCI]", |
" 1055 e002 LANEPIC 10/100 [EVB171G-PCI]", |
" 10b8 a011 EtherPower II 10/100", |
" 10b8 a014 EtherPower II 10/100", |
" 10b8 a015 EtherPower II 10/100", |
" 10b8 a016 EtherPower II 10/100", |
" 10b8 a017 EtherPower II 10/100", |
" 0006 83c175 EPIC/100 Fast Ethernet Adapter", |
" 1055 e100 LANEPIC Cardbus Fast Ethernet Adapter", |
" 1055 e102 LANEPIC Cardbus Fast Ethernet Adapter", |
" 1055 e300 LANEPIC Cardbus Fast Ethernet Adapter", |
" 1055 e302 LANEPIC Cardbus Fast Ethernet Adapter", |
" 10b8 a012 LANEPIC Cardbus Fast Ethernet Adapter", |
" 13a2 8002 LANEPIC Cardbus Fast Ethernet Adapter", |
" 13a2 8006 LANEPIC Cardbus Fast Ethernet Adapter", |
" 1000 FDC 37c665", |
" 1001 FDC 37C922", |
" 2802 SMC2802W [EZ Connect g]", |
" a011 83C170QF", |
" b106 SMC34C90", |
"10b9 ALi Corporation", |
" 0101 CMI8338/C3DX PCI Audio Device", |
" 0111 C-Media CMI8738/C3DX Audio Device (OEM)", |
" 10b9 0111 C-Media CMI8738/C3DX Audio Device (OEM)", |
" 0780 Multi-IO Card", |
" 0782 Multi-IO Card", |
" 1435 M1435", |
" 1445 M1445", |
" 1449 M1449", |
" 1451 M1451", |
" 1461 M1461", |
" 1489 M1489", |
" 1511 M1511 [Aladdin]", |
" 1512 M1512 [Aladdin]", |
" 1513 M1513 [Aladdin]", |
" 1521 M1521 [Aladdin III]", |
" 10b9 1521 ALI M1521 Aladdin III CPU Bridge", |
" 1523 M1523", |
" 10b9 1523 ALI M1523 ISA Bridge", |
" 1531 M1531 [Aladdin IV]", |
" 1533 M1533/M1535 PCI to ISA Bridge [Aladdin IV/V/V+]", |
" 1014 053b ThinkPad R40e (2684-HVG) PCI to ISA Bridge", |
" 10b9 1533 ALi M1533 Aladdin IV/V ISA Bridge", |
" 1541 M1541", |
" 10b9 1541 ALI M1541 Aladdin V/V+ AGP System Controller", |
" 1543 M1543", |
" 1563 M1563 HyperTransport South Bridge", |
" 1573 PCI to LPC Controller", |
" 1621 M1621", |
" 1631 ALI M1631 PCI North Bridge Aladdin Pro III", |
" 1632 M1632M Northbridge+Trident", |
" 1641 ALI M1641 PCI North Bridge Aladdin Pro IV", |
" 1644 M1644/M1644T Northbridge+Trident", |
" 1646 M1646 Northbridge+Trident", |
" 1647 M1647 Northbridge [MAGiK 1 / MobileMAGiK 1]", |
" 1651 M1651/M1651T Northbridge [Aladdin-Pro 5/5M,Aladdin-Pro 5T/5TM]", |
" 1671 M1671 Super P4 Northbridge [AGP4X,PCI and SDR/DDR]", |
" 1672 M1672 Northbridge [CyberALADDiN-P4]", |
" 1681 M1681 P4 Northbridge [AGP8X,HyperTransport and SDR/DDR]", |
" 1687 M1687 K8 Northbridge [AGP8X and HyperTransport]", |
" 1689 M1689 K8 Northbridge [Super K8 Single Chip]", |
" 1695 M1695 K8 Northbridge [PCI Express and HyperTransport]", |
" 1697 M1697 HTT Host Bridge", |
" 3141 M3141", |
" 3143 M3143", |
" 3145 M3145", |
" 3147 M3147", |
" 3149 M3149", |
" 3151 M3151", |
" 3307 M3307", |
" 3309 M3309", |
" 3323 M3325 Video/Audio Decoder", |
" 5212 M4803", |
" 5215 MS4803", |
" 5217 M5217H", |
" 5219 M5219", |
" 5225 M5225", |
" 5228 M5228 ALi ATA/RAID Controller", |
" 5229 M5229 IDE", |
" 1014 050f ThinkPad R30", |
" 1014 053d ThinkPad R40e (2684-HVG) builtin IDE", |
" 103c 0024 Pavilion ze4400 builtin IDE", |
" 1043 8053 A7A266 Motherboard IDE", |
" 5235 M5225", |
" 5237 USB 1.1 Controller", |
" 1014 0540 ThinkPad R40e (2684-HVG) builtin USB", |
" 103c 0024 Pavilion ze4400 builtin USB", |
" 104d 810f VAIO PCG-U1 USB/OHCI Revision 1.0", |
" 5239 USB 2.0 Controller", |
" 5243 M1541 PCI to AGP Controller", |
" 5246 AGP8X Controller", |
" 5247 PCI to AGP Controller", |
" 5249 M5249 HTT to PCI Bridge", |
" 524b PCI Express Root Port", |
" 524c PCI Express Root Port", |
" 524d PCI Express Root Port", |
" 524e PCI Express Root Port", |
" 5251 M5251 P1394 OHCI 1.0 Controller", |
" 5253 M5253 P1394 OHCI 1.1 Controller", |
" 5261 M5261 Ethernet Controller", |
" 5263 M5263 Ethernet Controller", |
" 5281 ALi M5281 Serial ATA / RAID Host Controller", |
" 5287 ULi 5287 SATA", |
" 5288 ULi M5288 SATA", |
" 5289 ULi 5289 SATA", |
" 5450 Lucent Technologies Soft Modem AMR", |
" 5451 M5451 PCI AC-Link Controller Audio Device", |
" 1014 0506 ThinkPad R30", |
" 1014 053e ThinkPad R40e (2684-HVG) builtin Audio", |
" 103c 0024 Pavilion ze4400 builtin Audio", |
" 10b9 5451 HP Compaq nc4010 (DY885AA#ABN)", |
" 5453 M5453 PCI AC-Link Controller Modem Device", |
" 5455 M5455 PCI AC-Link Controller Audio Device", |
" 5457 M5457 AC'97 Modem Controller", |
" 1014 0535 ThinkPad R40e (2684-HVG) builtin modem", |
" 103c 0024 Pavilion ze4400 builtin Modem Device", |
" 5459 SmartLink SmartPCI561 56K Modem", |
" 545a SmartLink SmartPCI563 56K Modem", |
" 5461 High Definition Audio/AC'97 Host Controller", |
" 5471 M5471 Memory Stick Controller", |
" 5473 M5473 SD-MMC Controller", |
" 7101 M7101 Power Management Controller [PMU]", |
" 1014 0510 ThinkPad R30", |
" 1014 053c ThinkPad R40e (2684-HVG) Power Management Controller", |
" 103c 0024 Pavilion ze4400", |
"10ba Mitsubishi Electric Corp.", |
" 0301 AccelGraphics AccelECLIPSE", |
" 0304 AccelGALAXY A2100 [OEM Evans & Sutherland]", |
" 0308 Tornado 3000 [OEM Evans & Sutherland]", |
" 1002 VG500 [VolumePro Volume Rendering Accelerator]", |
"10bb Dapha Electronics Corporation", |
"10bc Advanced Logic Research", |
"10bd Surecom Technology", |
" 0e34 NE-34", |
"10be Tseng Labs International Co.", |
"10bf Most Inc", |
"10c0 Boca Research Inc.", |
"10c1 ICM Co., Ltd.", |
"10c2 Auspex Systems Inc.", |
"10c3 Samsung Semiconductors, Inc.", |
" 1100 Smartether100 SC1100 LAN Adapter (i82557B)", |
"10c4 Award Software International Inc.", |
"10c5 Xerox Corporation", |
"10c6 Rambus Inc.", |
"10c7 Media Vision", |
"10c8 Neomagic Corporation", |
" 0001 NM2070 [MagicGraph 128]", |
" 0002 NM2090 [MagicGraph 128V]", |
" 0003 NM2093 [MagicGraph 128ZV]", |
" 0004 NM2160 [MagicGraph 128XD]", |
" 1014 00ba MagicGraph 128XD", |
" 1025 1007 MagicGraph 128XD", |
" 1028 0074 MagicGraph 128XD", |
" 1028 0075 MagicGraph 128XD", |
" 1028 007d MagicGraph 128XD", |
" 1028 007e MagicGraph 128XD", |
" 1033 802f MagicGraph 128XD", |
" 104d 801b MagicGraph 128XD", |
" 104d 802f MagicGraph 128XD", |
" 104d 830b MagicGraph 128XD", |
" 10ba 0e00 MagicGraph 128XD", |
" 10c8 0004 MagicGraph 128XD", |
" 10cf 1029 MagicGraph 128XD", |
" 10f7 8308 MagicGraph 128XD", |
" 10f7 8309 MagicGraph 128XD", |
" 10f7 830b MagicGraph 128XD", |
" 10f7 830d MagicGraph 128XD", |
" 10f7 8312 MagicGraph 128XD", |
" 0005 NM2200 [MagicGraph 256AV]", |
" 1014 00dd ThinkPad 570", |
" 1028 0088 Latitude CPi A", |
" 0006 NM2360 [MagicMedia 256ZX]", |
" 0016 NM2380 [MagicMedia 256XL+]", |
" 10c8 0016 MagicMedia 256XL+", |
" 0025 NM2230 [MagicGraph 256AV+]", |
" 0083 NM2093 [MagicGraph 128ZV+]", |
" 8005 NM2200 [MagicMedia 256AV Audio]", |
" 0e11 b0d1 MagicMedia 256AV Audio Device on Discovery", |
" 0e11 b126 MagicMedia 256AV Audio Device on Durango", |
" 1014 00dd MagicMedia 256AV Audio Device on BlackTip Thinkpad", |
" 1025 1003 MagicMedia 256AV Audio Device on TravelMate 720", |
" 1028 0088 Latitude CPi A", |
" 1028 008f MagicMedia 256AV Audio Device on Colorado Inspiron", |
" 103c 0007 MagicMedia 256AV Audio Device on Voyager II", |
" 103c 0008 MagicMedia 256AV Audio Device on Voyager III", |
" 103c 000d MagicMedia 256AV Audio Device on Omnibook 900", |
" 10c8 8005 MagicMedia 256AV Audio Device on FireAnt", |
" 110a 8005 MagicMedia 256AV Audio Device", |
" 14c0 0004 MagicMedia 256AV Audio Device", |
" 8006 NM2360 [MagicMedia 256ZX Audio]", |
" 8016 NM2380 [MagicMedia 256XL+ Audio]", |
"10c9 Dataexpert Corporation", |
"10ca Fujitsu Microelectr., Inc.", |
"10cb Omron Corporation", |
"10cc Mai Logic Incorporated", |
" 0660 Articia S Host Bridge", |
" 0661 Articia S PCI Bridge", |
"10cd Advanced System Products, Inc", |
" 1100 ASC1100", |
" 1200 ASC1200 [(abp940) Fast SCSI-II]", |
" 1300 ABP940-U / ABP960-U", |
" 10cd 1310 ASC1300 SCSI Adapter", |
" 2300 ABP940-UW", |
" 2500 ABP940-U2W", |
"10ce Radius", |
"10cf Fujitsu Limited.", |
" 2001 mb86605", |
"10d1 FuturePlus Systems Corp.", |
"10d2 Molex Incorporated", |
"10d3 Jabil Circuit Inc", |
"10d4 Hualon Microelectronics", |
"10d5 Autologic Inc.", |
"10d6 Cetia", |
"10d7 BCM Advanced Research", |
"10d8 Advanced Peripherals Labs", |
"10d9 Macronix, Inc. [MXIC]", |
" 0431 MX98715", |
" 0512 MX98713", |
" 0531 MX987x5", |
" 1186 1200 DFE-540TX ProFAST 10/100 Adapter", |
" 8625 MX86250", |
" 8626 Macronix MX86251 + 3Dfx Voodoo Rush", |
" 8888 MX86200", |
"10da Compaq IPG-Austin", |
" 0508 TC4048 Token Ring 4/16", |
" 3390 Tl3c3x9", |
"10db Rohm LSI Systems, Inc.", |
"10dc CERN/ECP/EDU", |
" 0001 STAR/RD24 SCI-PCI (PMC)", |
" 0002 TAR/RD24 SCI-PCI (PMC)", |
" 0021 HIPPI destination", |
" 0022 HIPPI source", |
" 10dc ATT2C15-3 FPGA", |
"10dd Evans & Sutherland", |
" 0100 Lightning 1200", |
"10de nVidia Corporation", |
" 0008 NV1 [EDGE 3D]", |
" 0009 NV1 [EDGE 3D]", |
" 0010 NV2 [Mutara V08]", |
" 0020 NV4 [RIVA TNT]", |
" 1043 0200 V3400 TNT", |
" 1048 0c18 Erazor II SGRAM", |
" 1048 0c19 Erazor II", |
" 1048 0c1b Erazor II", |
" 1048 0c1c Erazor II", |
" 1092 0550 Viper V550", |
" 1092 0552 Viper V550", |
" 1092 4804 Viper V550", |
" 1092 4808 Viper V550", |
" 1092 4810 Viper V550", |
" 1092 4812 Viper V550", |
" 1092 4815 Viper V550", |
" 1092 4820 Viper V550 with TV out", |
" 1092 4822 Viper V550", |
" 1092 4904 Viper V550", |
" 1092 4914 Viper V550", |
" 1092 8225 Viper V550", |
" 10b4 273d Velocity 4400", |
" 10b4 273e Velocity 4400", |
" 10b4 2740 Velocity 4400", |
" 10de 0020 Riva TNT", |
" 1102 1015 Graphics Blaster CT6710", |
" 1102 1016 Graphics Blaster RIVA TNT", |
" 0028 NV5 [RIVA TNT2/TNT2 Pro]", |
" 1043 0200 AGP-V3800 SGRAM", |
" 1043 0201 AGP-V3800 SDRAM", |
" 1043 0205 PCI-V3800", |
" 1043 4000 AGP-V3800PRO", |
" 1048 0c21 Synergy II", |
" 1048 0c28 Erazor III", |
" 1048 0c29 Erazor III", |
" 1048 0c2a Erazor III", |
" 1048 0c2b Erazor III", |
" 1048 0c31 Erazor III Pro", |
" 1048 0c32 Erazor III Pro", |
" 1048 0c33 Erazor III Pro", |
" 1048 0c34 Erazor III Pro", |
" 107d 2134 WinFast 3D S320 II + TV-Out", |
" 1092 4804 Viper V770", |
" 1092 4a00 Viper V770", |
" 1092 4a02 Viper V770 Ultra", |
" 1092 5a00 RIVA TNT2/TNT2 Pro", |
" 1092 6a02 Viper V770 Ultra", |
" 1092 7a02 Viper V770 Ultra", |
" 10de 0005 RIVA TNT2 Pro", |
" 10de 000f Compaq NVIDIA TNT2 Pro", |
" 1102 1020 3D Blaster RIVA TNT2", |
" 1102 1026 3D Blaster RIVA TNT2 Digital", |
" 14af 5810 Maxi Gamer Xentor", |
" 0029 NV5 [RIVA TNT2 Ultra]", |
" 1043 0200 AGP-V3800 Deluxe", |
" 1043 0201 AGP-V3800 Ultra SDRAM", |
" 1043 0205 PCI-V3800 Ultra", |
" 1048 0c2e Erazor III Ultra", |
" 1048 0c2f Erazor III Ultra", |
" 1048 0c30 Erazor III Ultra", |
" 1102 1021 3D Blaster RIVA TNT2 Ultra", |
" 1102 1029 3D Blaster RIVA TNT2 Ultra", |
" 1102 102f 3D Blaster RIVA TNT2 Ultra", |
" 14af 5820 Maxi Gamer Xentor 32", |
" 002a NV5 [Riva TnT2]", |
" 002b NV5 [Riva TnT2]", |
" 002c NV6 [Vanta/Vanta LT]", |
" 1043 0200 AGP-V3800 Combat SDRAM", |
" 1043 0201 AGP-V3800 Combat", |
" 1048 0c20 TNT2 Vanta", |
" 1048 0c21 TNT2 Vanta", |
" 1092 6820 Viper V730", |
" 1102 1031 CT6938 VANTA 8MB", |
" 1102 1034 CT6894 VANTA 16MB", |
" 14af 5008 Maxi Gamer Phoenix 2", |
" 002d NV5M64 [RIVA TNT2 Model 64/Model 64 Pro]", |
" 1043 0200 AGP-V3800M", |
" 1043 0201 AGP-V3800M", |
" 1048 0c3a Erazor III LT", |
" 1048 0c3b Erazor III LT", |
" 10de 001e M64 AGP4x", |
" 1102 1023 CT6892 RIVA TNT2 Value", |
" 1102 1024 CT6932 RIVA TNT2 Value 32Mb", |
" 1102 102c CT6931 RIVA TNT2 Value [Jumper]", |
" 1462 8808 MSI-8808", |
" 1554 1041 Pixelview RIVA TNT2 M64", |
" 1569 002d Palit Microsystems Daytona TNT2 M64", |
" 002e NV6 [Vanta]", |
" 002f NV6 [Vanta]", |
" 0034 MCP04 SMBus", |
" 0035 MCP04 IDE", |
" 0036 MCP04 Serial ATA Controller", |
" 0037 MCP04 Ethernet Controller", |
" 0038 MCP04 Ethernet Controller", |
" 003a MCP04 AC'97 Audio Controller", |
" 003b MCP04 USB Controller", |
" 003c MCP04 USB Controller", |
" 003d MCP04 PCI Bridge", |
" 003e MCP04 Serial ATA Controller", |
" 0040 NV40 [GeForce 6800 Ultra]", |
" 0041 NV40 [GeForce 6800]", |
" 1043 817b V9999 Gamer Edition", |
" 0042 NV40.2 [GeForce 6800 LE]", |
" 0043 NV40.3", |
" 0044 NV40 [GeForce 6800 XT]", |
" 0045 NV40 [GeForce 6800 GT]", |
" 0047 NV40 [GeForce 6800 GS]", |
" 1682 2109 GeForce 6800 GS", |
" 0049 NV40GL", |
" 004e NV40GL [Quadro FX 4000]", |
" 0050 CK804 ISA Bridge", |
" 1043 815a K8N4-E Mainboard", |
" 1458 0c11 GA-K8N Ultra-9 Mainboard", |
" 1462 7100 MSI K8N Diamond", |
" 0051 CK804 ISA Bridge", |
" 0052 CK804 SMBus", |
" 1043 815a K8N4-E Mainboard", |
" 1458 0c11 GA-K8N Ultra-9 Mainboard", |
" 1462 7100 MSI K8N Diamond", |
" 0053 CK804 IDE", |
" 1043 815a K8N4-E Mainboard", |
" 1458 5002 GA-K8N Ultra-9 Mainboard", |
" 1462 7100 MSI K8N Diamond", |
" 0054 CK804 Serial ATA Controller", |
" 1458 b003 GA-K8N Ultra-9 Mainboard", |
" 1462 7100 MSI K8N Diamond", |
" 0055 CK804 Serial ATA Controller", |
" 1043 815a K8N4-E Mainboard", |
" 1458 b003 GA-K8N Ultra-9 Mainboard", |
" 0056 CK804 Ethernet Controller", |
" 0057 CK804 Ethernet Controller", |
" 1043 8141 K8N4-E Mainboard", |
" 1458 e000 GA-K8N Ultra-9 Mainboard", |
" 1462 7100 MSI K8N Diamond", |
" 0058 CK804 AC'97 Modem", |
" 0059 CK804 AC'97 Audio Controller", |
" 1043 812a K8N4-E Mainboard", |
" 005a CK804 USB Controller", |
" 1043 815a K8N4-E Mainboard", |
" 1458 5004 GA-K8N Ultra-9 Mainboard", |
" 1462 7100 MSI K8N Diamond", |
" 005b CK804 USB Controller", |
" 1043 815a K8N4-E Mainboard", |
" 1458 5004 GA-K8N Ultra-9 Mainboard", |
" 1462 7100 MSI K8N Diamond", |
" 005c CK804 PCI Bridge", |
" 005d CK804 PCIE Bridge", |
" 005e CK804 Memory Controller", |
" 10f1 2891 Thunder K8SRE Mainboard", |
" 1458 5000 GA-K8N Ultra-9 Mainboard", |
" 1462 7100 MSI K8N Diamond", |
" 005f CK804 Memory Controller", |
" 0060 nForce2 ISA Bridge", |
" 1043 80ad A7N8X Mainboard", |
" a0a0 03ba UK79G-1394 motherboard", |
" 0064 nForce2 SMBus (MCP)", |
" a0a0 03bb UK79G-1394 motherboard", |
" 0065 nForce2 IDE", |
" a0a0 03b2 UK79G-1394 motherboard", |
" 0066 nForce2 Ethernet Controller", |
" 1043 80a7 A7N8X Mainboard onboard nForce2 Ethernet", |
" 0067 nForce2 USB Controller", |
" 1043 0c11 A7N8X Mainboard", |
" 0068 nForce2 USB Controller", |
" 1043 0c11 A7N8X Mainboard", |
" a0a0 03b4 UK79G-1394 motherboard", |
" 006a nForce2 AC97 Audio Controler (MCP)", |
" a0a0 0304 UK79G-1394 motherboard", |
" 006b nForce Audio Processing Unit", |
" 10de 006b nForce2 MCP Audio Processing Unit", |
" 006c nForce2 External PCI Bridge", |
" 006d nForce2 PCI Bridge", |
" 006e nForce2 FireWire (IEEE 1394) Controller", |
" a0a0 0306 UK79G-1394 motherboard", |
" 0080 MCP2A ISA bridge", |
" 147b 1c09 NV7 Motherboard", |
" 0084 MCP2A SMBus", |
" 147b 1c09 NV7 Motherboard", |
" 0085 MCP2A IDE", |
" 147b 1c09 NV7 Motherboard", |
" 0086 MCP2A Ethernet Controller", |
" 0087 MCP2A USB Controller", |
" 147b 1c09 NV7 Motherboard", |
" 0088 MCP2A USB Controller", |
" 147b 1c09 NV7 Motherboard", |
" 008a MCP2S AC'97 Audio Controller", |
" 147b 1c09 NV7 Motherboard", |
" 008b MCP2A PCI Bridge", |
" 008c MCP2A Ethernet Controller", |
" 008e nForce2 Serial ATA Controller", |
" 0090 G70 [GeForce 7800 GTX]", |
" 0091 G70 [GeForce 7800 GTX]", |
" 0092 G70 [GeForce 7800 GT]", |
" 0093 G70 [GeForce 7800 GS]", |
" 0098 GeForce Go 7800", |
" 0099 GE Force Go 7800 GTX", |
" 009d G70GL [Quadro FX4500]", |
" 00a0 NV5 [Aladdin TNT2]", |
" 14af 5810 Maxi Gamer Xentor", |
" 00c0 NV41 [GeForce 6800 GS]", |
" 00c1 NV41.1 [GeForce 6800]", |
" 00c2 NV41.2 [GeForce 6800 LE]", |
" 00c3 NV42 [Geforce 6800 XT]", |
" 00c8 NV41.8 [GeForce Go 6800]", |
" 00c9 NV41.9 [GeForce Go 6800 Ultra]", |
" 00cc NV41 [Quadro FX Go1400]", |
" 00cd NV41 [Quadro FX 3450/4000 SDI]", |
" 00ce NV41GL [Quadro FX 1400]", |
" 00d0 nForce3 LPC Bridge", |
" 00d1 nForce3 Host Bridge", |
" 00d2 nForce3 AGP Bridge", |
" 00d3 CK804 Memory Controller", |
" 00d4 nForce3 SMBus", |
" 00d5 nForce3 IDE", |
" 00d6 nForce3 Ethernet", |
" 00d7 nForce3 USB 1.1", |
" 00d8 nForce3 USB 2.0", |
" 00d9 nForce3 Audio", |
" 00da nForce3 Audio", |
" 00dd nForce3 PCI Bridge", |
" 00df CK8S Ethernet Controller", |
" 147b 1c0b NF8 Mainboard", |
" 00e0 nForce3 250Gb LPC Bridge", |
" 147b 1c0b NF8 Mainboard", |
" 00e1 nForce3 250Gb Host Bridge", |
" 147b 1c0b NF8 Mainboard", |
" 00e2 nForce3 250Gb AGP Host to PCI Bridge", |
" 00e3 CK8S Serial ATA Controller (v2.5)", |
" 147b 1c0b NF8 Mainboard", |
" 00e4 nForce 250Gb PCI System Management", |
" 147b 1c0b NF8 Mainboard", |
" 00e5 CK8S Parallel ATA Controller (v2.5)", |
" 147b 1c0b NF8 Mainboard", |
" 00e6 CK8S Ethernet Controller", |
" 00e7 CK8S USB Controller", |
" 147b 1c0b NF8 Mainboard", |
" 00e8 nForce3 EHCI USB 2.0 Controller", |
" 147b 1c0b NF8 Mainboard", |
" 00ea nForce3 250Gb AC'97 Audio Controller", |
" 147b 1c0b NF8 Mainboard", |
" 00ed nForce3 250Gb PCI-to-PCI Bridge", |
" 00ee CK8S Serial ATA Controller (v2.5)", |
" 00f0 NV40 [GeForce 6800/GeForce 6800 Ultra]", |
" 00f1 NV43 [GeForce 6600/GeForce 6600 GT]", |
" 1043 81a6 N6600GT TD 128M AGP", |
" 1682 2119 GeForce 6600 GT AGP 128MB DDR3 DUAL DVI TV", |
" 00f2 NV43 [GeForce 6600/GeForce 6600 GT]", |
" 1682 211c GeForce 6600 256MB DDR DUAL DVI TV", |
" 00f3 NV43 [GeForce 6200]", |
" 00f4 NV43 [GeForce 6600 LE]", |
" 00f5 G70 [GeForce 7800 GS]", |
" 00f6 NV43 [GeForce 6600 GS]", |
" 00f8 NV45GL [Quadro FX 3400/4400]", |
" 00f9 NV40 [GeForce 6800 Ultra/GeForce 6800 GT]", |
" 1682 2120 GEFORCE 6800 GT PCI-E", |
" 00fa NV36 [GeForce PCX 5750]", |
" 00fb NV35 [GeForce PCX 5900]", |
" 00fc NV37GL [Quadro FX 330/GeForce PCX 5300]", |
" 00fd NV37GL [Quadro FX 330/Quadro NVS280]", |
" 00fe NV38GL [Quadro FX 1300]", |
" 00ff NV18 [GeForce PCX 4300]", |
" 0100 NV10 [GeForce 256 SDR]", |
" 1043 0200 AGP-V6600 SGRAM", |
" 1043 0201 AGP-V6600 SDRAM", |
" 1043 4008 AGP-V6600 SGRAM", |
" 1043 4009 AGP-V6600 SDRAM", |
" 1048 0c41 Erazor X", |
" 1048 0c43 ERAZOR X PCI", |
" 1048 0c48 Synergy Force", |
" 1102 102d CT6941 GeForce 256", |
" 14af 5022 3D Prophet SE", |
" 0101 NV10DDR [GeForce 256 DDR]", |
" 1043 0202 AGP-V6800 DDR", |
" 1043 400a AGP-V6800 DDR SGRAM", |
" 1043 400b AGP-V6800 DDR SDRAM", |
" 1048 0c42 Erazor X", |
" 107d 2822 WinFast GeForce 256", |
" 1102 102e CT6971 GeForce 256 DDR", |
" 14af 5021 3D Prophet DDR-DVI", |
" 0103 NV10GL [Quadro]", |
" 1048 0c40 GLoria II-64", |
" 1048 0c44 GLoria II", |
" 1048 0c45 GLoria II", |
" 1048 0c4a GLoria II-64 Pro", |
" 1048 0c4b GLoria II-64 Pro DVII", |
" 0110 NV11 [GeForce2 MX/MX 400]", |
" 1043 4015 AGP-V7100 Pro", |
" 1043 4031 V7100 Pro with TV output", |
" 1048 0c60 Gladiac MX", |
" 1048 0c61 Gladiac 511PCI", |
" 1048 0c63 Gladiac 511TV-OUT 32MB", |
" 1048 0c64 Gladiac 511TV-OUT 64MB", |
" 1048 0c65 Gladiac 511TWIN", |
" 1048 0c66 Gladiac 311", |
" 10de 0091 Dell OEM GeForce 2 MX 400", |
" 10de 00a1 Apple OEM GeForce2 MX", |
" 1462 8817 MSI GeForce2 MX400 Pro32S [MS-8817]", |
" 14af 7102 3D Prophet II MX", |
" 14af 7103 3D Prophet II MX Dual-Display", |
" 0111 NV11DDR [GeForce2 MX 100 DDR/200 DDR]", |
" 0112 NV11 [GeForce2 Go]", |
" 0113 NV11GL [Quadro2 MXR/EX/Go]", |
" 0140 NV43 [GeForce 6600 GT]", |
" 0141 NV43 [GeForce 6600]", |
" 1458 3124 GV-NX66128DP Turbo Force Edition", |
" 0142 NV43 [GeForce 6600 PCIe]", |
" 0144 NV43 [GeForce Go 6600]", |
" 0145 NV43 [GeForce 6610 XL]", |
" 0146 NV43 [Geforce Go 6600TE/6200TE]", |
" 0148 NV43 [GeForce Go 6600]", |
" 0149 NV43 [GeForce Go 6600 GT]", |
" 014a Quadro NVS 440", |
" 014c Quadro FX 550", |
" 014e NV43GL [Quadro FX 540]", |
" 014f NV43 [GeForce 6200]", |
" 0150 NV15 [GeForce2 GTS/Pro]", |
" 1043 4016 V7700 AGP Video Card", |
" 1048 0c50 Gladiac", |
" 1048 0c52 Gladiac-64", |
" 107d 2840 WinFast GeForce2 GTS with TV output", |
" 107d 2842 WinFast GeForce 2 Pro", |
" 1462 8831 Creative GeForce2 Pro", |
" 0151 NV15DDR [GeForce2 Ti]", |
" 1043 405f V7700Ti", |
" 1462 5506 Creative 3D Blaster Geforce2 Titanium", |
" 0152 NV15BR [GeForce2 Ultra, Bladerunner]", |
" 1048 0c56 GLADIAC Ultra", |
" 0153 NV15GL [Quadro2 Pro]", |
" 0161 GeForce 6200 TurboCache(TM)", |
" 0162 NV43 [GeForce 6200 SE]", |
" 0164 NV44 [GeForce Go 6200]", |
" 0165 NV44 [Quadro NVS 285]", |
" 0166 NV43 [GeForce Go 6400]", |
" 0167 GeForce Go 6200 TurboCache", |
" 0168 NV43 [GeForce Go 6200 TurboCache]", |
" 0170 NV17 [GeForce4 MX 460]", |
" 0171 NV17 [GeForce4 MX 440]", |
" 10b0 0002 Gainward Pro/600 TV", |
" 10de 0008 Apple OEM GeForce4 MX 440", |
" 1462 8661 G4MX440-VTP", |
" 1462 8730 MX440SES-T (MS-8873)", |
" 1462 8852 GeForce4 MX440 PCI", |
" 147b 8f00 Abit Siluro GeForce4MX440", |
" 0172 NV17 [GeForce4 MX 420]", |
" 0173 NV17 [GeForce4 MX 440-SE]", |
" 0174 NV17 [GeForce4 440 Go]", |
" 0175 NV17 [GeForce4 420 Go]", |
" 0176 NV17 [GeForce4 420 Go 32M]", |
" 4c53 1090 Cx9 / Vx9 mainboard", |
" 0177 NV17 [GeForce4 460 Go]", |
" 0178 NV17GL [Quadro4 550 XGL]", |
" 0179 NV17 [GeForce4 420 Go 32M]", |
" 10de 0179 GeForce4 MX (Mac)", |
" 017a NV17GL [Quadro4 200/400 NVS]", |
" 017b NV17GL [Quadro4 550 XGL]", |
" 017c NV17GL [Quadro4 500 GoGL]", |
" 017d NV17 [GeForce4 410 Go 16M]", |
" 0181 NV18 [GeForce4 MX 440 AGP 8x]", |
" 1043 806f V9180 Magic", |
" 1462 8880 MS-StarForce GeForce4 MX 440 with AGP8X", |
" 1462 8900 MS-8890 GeForce 4 MX440 AGP8X", |
" 1462 9350 MSI Geforce4 MX T8X with AGP8X", |
" 147b 8f0d Siluro GF4 MX-8X", |
" 0182 NV18 [GeForce4 MX 440SE AGP 8x]", |
" 0183 NV18 [GeForce4 MX 420 AGP 8x]", |
" 0185 NV18 [GeForce4 MX 4000 AGP 8x]", |
" 0186 NV18M [GeForce4 448 Go]", |
" 0187 NV18M [GeForce4 488 Go]", |
" 0188 NV18GL [Quadro4 580 XGL]", |
" 018a NV18GL [Quadro4 NVS AGP 8x]", |
" 018b NV18GL [Quadro4 380 XGL]", |
" 018c Quadro NVS 50 PCI", |
" 018d NV18M [GeForce4 448 Go]", |
" 01a0 NVCrush11 [GeForce2 MX Integrated Graphics]", |
" 01a4 nForce CPU bridge", |
" 01ab nForce 420 Memory Controller (DDR)", |
" 01ac nForce 220/420 Memory Controller", |
" 01ad nForce 220/420 Memory Controller", |
" 01b0 nForce Audio", |
" 01b1 nForce Audio", |
" 01b2 nForce ISA Bridge", |
" 01b4 nForce PCI System Management", |
" 01b7 nForce AGP to PCI Bridge", |
" 01b8 nForce PCI-to-PCI bridge", |
" 01bc nForce IDE", |
" 01c1 nForce AC'97 Modem Controller", |
" 01c2 nForce USB Controller", |
" 01c3 nForce Ethernet Controller", |
" 01d1 GeForce 7300 LE", |
" 01d7 Quadro NVS 110M / GeForce Go 7300", |
" 01d8 GeForce Go 7400", |
" 01da Quadro NVS 110M", |
" 01de Quadro FX 350", |
" 10de 01dc Quadro FX Go350M", |
" 01df GeForce 7300 GS", |
" 01e0 nForce2 AGP (different version?)", |
" 147b 1c09 NV7 Motherboard", |
" 01e8 nForce2 AGP", |
" 01ea nForce2 Memory Controller 0", |
" a0a0 03b9 UK79G-1394 motherboard", |
" 01eb nForce2 Memory Controller 1", |
" a0a0 03b9 UK79G-1394 motherboard", |
" 01ec nForce2 Memory Controller 2", |
" a0a0 03b9 UK79G-1394 motherboard", |
" 01ed nForce2 Memory Controller 3", |
" a0a0 03b9 UK79G-1394 motherboard", |
" 01ee nForce2 Memory Controller 4", |
" a0a0 03b9 UK79G-1394 motherboard", |
" 01ef nForce2 Memory Controller 5", |
" a0a0 03b9 UK79G-1394 motherboard", |
" 01f0 NV18 [GeForce4 MX - nForce GPU]", |
" a0a0 03b5 UK79G-1394 motherboard", |
" 0200 NV20 [GeForce3]", |
" 1043 402f AGP-V8200 DDR", |
" 1048 0c70 GLADIAC 920", |
" 0201 NV20 [GeForce3 Ti 200]", |
" 0202 NV20 [GeForce3 Ti 500]", |
" 1043 405b V8200 T5", |
" 1545 002f Xtasy 6964", |
" 0203 NV20DCC [Quadro DCC]", |
" 0211 NV40 [GeForce 6800]", |
" 0212 NV40 [GeForce 6800 LE]", |
" 0215 NV40 [GeForce 6800 GT]", |
" 0218 NV40 [GeForce 6800 XT]", |
" 0221 NV43 [GeForce 6200]", |
" 0240 C51PV [GeForce 6150]", |
" 1462 7207 K8NGM2 series", |
" 0241 C51 PCI Express Bridge", |
" 0242 C51G [GeForce 6100]", |
" 0243 C51 PCI Express Bridge", |
" 0244 C51 PCI Express Bridge", |
" 0245 C51 PCI Express Bridge", |
" 0246 C51 PCI Express Bridge", |
" 0247 C51 PCI Express Bridge", |
" 0248 C51 PCI Express Bridge", |
" 0249 C51 PCI Express Bridge", |
" 024a C51 PCI Express Bridge", |
" 024b C51 PCI Express Bridge", |
" 024c C51 PCI Express Bridge", |
" 024d C51 PCI Express Bridge", |
" 024e C51 PCI Express Bridge", |
" 024f C51 PCI Express Bridge", |
" 0250 NV25 [GeForce4 Ti 4600]", |
" 0251 NV25 [GeForce4 Ti 4400]", |
" 1043 8023 v8440 GeForce 4 Ti4400", |
" 0252 NV25 [GeForce4 Ti]", |
" 0253 NV25 [GeForce4 Ti 4200]", |
" 107d 2896 WinFast A250 LE TD (Dual VGA/TV-out/DVI)", |
" 147b 8f09 Siluro (Dual VGA/TV-out/DVI)", |
" 0258 NV25GL [Quadro4 900 XGL]", |
" 0259 NV25GL [Quadro4 750 XGL]", |
" 025b NV25GL [Quadro4 700 XGL]", |
" 0260 MCP51 LPC Bridge", |
" 1462 7207 K8NGM2 series", |
" 0261 MCP51 LPC Bridge", |
" 0262 MCP51 LPC Bridge", |
" 0263 MCP51 LPC Bridge", |
" 0264 MCP51 SMBus", |
" 1462 7207 K8NGM2 series", |
" 0265 MCP51 IDE", |
" 1462 7207 K8NGM2 series", |
" 0266 MCP51 Serial ATA Controller", |
" 1462 7207 K8NGM2 series", |
" 0267 MCP51 Serial ATA Controller", |
" 1462 7207 K8NGM2 series", |
" 0268 MCP51 Ethernet Controller", |
" 0269 MCP51 Ethernet Controller", |
" 1462 7207 K8NGM2 series", |
" 026a MCP51 MCI", |
" 026b MCP51 AC97 Audio Controller", |
" 026c MCP51 High Definition Audio", |
" 1462 7207 K8NGM2 series", |
" 026d MCP51 USB Controller", |
" 1462 7207 K8NGM2 series", |
" 026e MCP51 USB Controller", |
" 1462 7207 K8NGM2 series", |
" 026f MCP51 PCI Bridge", |
" 0270 MCP51 Host Bridge", |
" 1462 7207 K8NGM2 series", |
" 0271 MCP51 PMU", |
" 0272 MCP51 Memory Controller 0", |
" 027e C51 Memory Controller 2", |
" 1462 7207 K8NGM2 series", |
" 027f C51 Memory Controller 3", |
" 1462 7207 K8NGM2 series", |
" 0280 NV28 [GeForce4 Ti 4800]", |
" 0281 NV28 [GeForce4 Ti 4200 AGP 8x]", |
" 0282 NV28 [GeForce4 Ti 4800 SE]", |
" 0286 NV28 [GeForce4 Ti 4200 Go AGP 8x]", |
" 0288 NV28GL [Quadro4 980 XGL]", |
" 0289 NV28GL [Quadro4 780 XGL]", |
" 028c NV28GLM [Quadro4 700 GoGL]", |
" 0290 GeForce 7900 GTX", |
" 0291 GeForce 7900 GT", |
" 029a G71 [Quadro FX 2500M]", |
" 029b G71 [Quadro FX 1500M]", |
" 029c Quadro FX 5500", |
" 029d Quadro FX 3500", |
" 029e Quadro FX 1500", |
" 02a0 NV2A [XGPU]", |
" 02e1 GeForce 7600 GS", |
" 02f0 C51 Host Bridge", |
" 1462 7207 K8NGM2 series", |
" 02f1 C51 Host Bridge", |
" 02f2 C51 Host Bridge", |
" 02f3 C51 Host Bridge", |
" 02f4 C51 Host Bridge", |
" 02f5 C51 Host Bridge", |
" 02f6 C51 Host Bridge", |
" 02f7 C51 Host Bridge", |
" 02f8 C51 Memory Controller 5", |
" 1462 7207 K8NGM2 series", |
" 02f9 C51 Memory Controller 4", |
" 1462 7207 K8NGM2 series", |
" 02fa C51 Memory Controller 0", |
" 1462 7207 K8NGM2 series", |
" 02fb C51 PCI Express Bridge", |
" 02fc C51 PCI Express Bridge", |
" 02fd C51 PCI Express Bridge", |
" 02fe C51 Memory Controller 1", |
" 1462 7207 K8NGM2 series", |
" 02ff C51 Host Bridge", |
" 1462 7207 K8NGM2 series", |
" 0300 NV30 [GeForce FX]", |
" 0301 NV30 [GeForce FX 5800 Ultra]", |
" 0302 NV30 [GeForce FX 5800]", |
" 0308 NV30GL [Quadro FX 2000]", |
" 0309 NV30GL [Quadro FX 1000]", |
" 0311 NV31 [GeForce FX 5600 Ultra]", |
" 0312 NV31 [GeForce FX 5600]", |
" 0313 NV31", |
" 0314 NV31 [GeForce FX 5600XT]", |
" 1043 814a V9560XT/TD", |
" 0316 NV31M", |
" 0317 NV31M Pro", |
" 031a NV31M [GeForce FX Go5600]", |
" 031b NV31M [GeForce FX Go5650]", |
" 031c NVIDIA Quadro FX Go700", |
" 031d NV31GLM", |
" 031e NV31GLM Pro", |
" 031f NV31GLM Pro", |
" 0320 NV34 [GeForce FX 5200]", |
" 0321 NV34 [GeForce FX 5200 Ultra]", |
" 0322 NV34 [GeForce FX 5200]", |
" 1462 9171 MS-8917 (FX5200-T128)", |
" 1462 9360 MS-8936 (FX5200-T128)", |
" 0323 NV34 [GeForce FX 5200LE]", |
" 0324 NV34M [GeForce FX Go5200]", |
" 1028 0196 Inspiron 5160", |
" 1071 8160 MIM2000", |
" 0325 NV34M [GeForce FX Go5250]", |
" 0326 NV34 [GeForce FX 5500]", |
" 0327 NV34 [GeForce FX 5100]", |
" 0328 NV34M [GeForce FX Go5200 32M/64M]", |
" 0329 NV34M [GeForce FX Go5200]", |
" 032a NV34GL [Quadro NVS 280 PCI]", |
" 032b NV34GL [Quadro FX 500/600 PCI]", |
" 032c NV34GLM [GeForce FX Go 5300]", |
" 032d NV34 [GeForce FX Go5100]", |
" 032f NV34GL", |
" 0330 NV35 [GeForce FX 5900 Ultra]", |
" 0331 NV35 [GeForce FX 5900]", |
" 1043 8145 V9950GE", |
" 0332 NV35 [GeForce FX 5900XT]", |
" 0333 NV38 [GeForce FX 5950 Ultra]", |
" 0334 NV35 [GeForce FX 5900ZT]", |
" 0338 NV35GL [Quadro FX 3000]", |
" 033f NV35GL [Quadro FX 700]", |
" 0341 NV36.1 [GeForce FX 5700 Ultra]", |
" 0342 NV36.2 [GeForce FX 5700]", |
" 0343 NV36 [GeForce FX 5700LE]", |
" 0344 NV36.4 [GeForce FX 5700VE]", |
" 0345 NV36.5", |
" 0347 NV36 [GeForce FX Go5700]", |
" 103c 006a NX9500", |
" 0348 NV36 [GeForce FX Go5700]", |
" 0349 NV36M Pro", |
" 034b NV36MAP", |
" 034c NV36 [Quadro FX Go1000]", |
" 034e NV36GL [Quadro FX 1100]", |
" 034f NV36GL", |
" 0360 MCP55 LPC Bridge", |
" 0361 MCP55 LPC Bridge", |
" 0362 MCP55 LPC Bridge", |
" 0363 MCP55 LPC Bridge", |
" 0364 MCP55 LPC Bridge", |
" 0365 MCP55 LPC Bridge", |
" 0366 MCP55 LPC Bridge", |
" 0367 MCP55 LPC Bridge", |
" 0368 MCP55 SMBus", |
" 0369 MCP55 Memory Controller", |
" 036a MCP55 Memory Controller", |
" 036c MCP55 USB Controller", |
" 036d MCP55 USB Controller", |
" 036e MCP55 IDE", |
" 0371 MCP55 High Definition Audio", |
" 0372 MCP55 Ethernet", |
" 0373 MCP55 Ethernet", |
" 037a MCP55 Memory Controller", |
" 037e MCP55 SATA Controller", |
" 037f MCP55 SATA Controller", |
" 0391 G70 [GeForce 7600 GT]", |
" 0392 G70 [GeForce 7600 GS]", |
" 0398 G70 [GeForce Go 7600]", |
" 039e Quadro FX 560", |
" 03e0 MCP61 LPC Bridge", |
" 03e1 MCP61 LPC Bridge", |
" 03e2 MCP61 LPC Bridge", |
" 03e3 MCP61 LPC Bridge", |
" 03e4 MCP61 High Definition Audio", |
" 03e5 MCP61 Ethernet", |
" 03e6 MCP61 Ethernet", |
" 03e7 MCP61 SATA Controller", |
" 03ea MCP61 Memory Controller", |
" 03eb MCP61 SMBus", |
" 03ec MCP61 IDE", |
" 03ee MCP61 Ethernet", |
" 03ef MCP61 Ethernet", |
" 03f0 MCP61 High Definition Audio", |
" 03f1 MCP61 USB Controller", |
" 03f2 MCP61 USB Controller", |
" 03f5 MCP61 Memory Controller", |
" 03f6 MCP61 SATA Controller", |
" 03f7 MCP61 SATA Controller", |
"10df Emulex Corporation", |
" 1ae5 LP6000 Fibre Channel Host Adapter", |
" f085 LP850 Fibre Channel Host Adapter", |
" f095 LP952 Fibre Channel Host Adapter", |
" f098 LP982 Fibre Channel Host Adapter", |
" f0a1 Thor LightPulse Fibre Channel Host Adapter", |
" f0a5 Thor LightPulse Fibre Channel Host Adapter", |
" f0b5 Viper LightPulse Fibre Channel Host Adapter", |
" f0d1 Helios LightPulse Fibre Channel Host Adapter", |
" f0d5 Helios LightPulse Fibre Channel Host Adapter", |
" f0e1 Zephyr LightPulse Fibre Channel Host Adapter", |
" f0e5 Zephyr LightPulse Fibre Channel Host Adapter", |
" f0f5 Neptune LightPulse Fibre Channel Host Adapter", |
" f700 LP7000 Fibre Channel Host Adapter", |
" f701 LP7000 Fibre Channel Host Adapter Alternate ID (JX1:2-3, JX2:1-2)", |
" f800 LP8000 Fibre Channel Host Adapter", |
" f801 LP8000 Fibre Channel Host Adapter Alternate ID (JX1:2-3, JX2:1-2)", |
" f900 LP9000 Fibre Channel Host Adapter", |
" f901 LP9000 Fibre Channel Host Adapter Alternate ID (JX1:2-3, JX2:1-2)", |
" f980 LP9802 Fibre Channel Host Adapter", |
" f981 LP9802 Fibre Channel Host Adapter Alternate ID", |
" f982 LP9802 Fibre Channel Host Adapter Alternate ID", |
" fa00 Thor-X LightPulse Fibre Channel Host Adapter", |
" fb00 Viper LightPulse Fibre Channel Host Adapter", |
" fc00 Thor-X LightPulse Fibre Channel Host Adapter", |
" fc10 Helios-X LightPulse Fibre Channel Host Adapter", |
" fc20 Zephyr-X LightPulse Fibre Channel Host Adapter", |
" fd00 Helios-X LightPulse Fibre Channel Host Adapter", |
" fe00 Zephyr-X LightPulse Fibre Channel Host Adapter", |
" ff00 Neptune LightPulse Fibre Channel Host Adapter", |
"10e0 Integrated Micro Solutions Inc.", |
" 5026 IMS5026/27/28", |
" 5027 IMS5027", |
" 5028 IMS5028", |
" 8849 IMS8849", |
" 8853 IMS8853", |
" 9128 IMS9128 [Twin turbo 128]", |
"10e1 Tekram Technology Co.,Ltd.", |
" 0391 TRM-S1040", |
" 10e1 0391 DC-315U SCSI-3 Host Adapter", |
" 690c DC-690c", |
" dc29 DC-290", |
"10e2 Aptix Corporation", |
"10e3 Tundra Semiconductor Corp.", |
" 0000 CA91C042 [Universe]", |
" 0148 Tsi148 [Tempe]", |
" 0860 CA91C860 [QSpan]", |
" 0862 CA91C862A [QSpan-II]", |
" 8260 CA91L8200B [Dual PCI PowerSpan II]", |
" 8261 CA91L8260B [Single PCI PowerSpan II]", |
"10e4 Tandem Computers", |
" 8029 Realtek 8029 Network Card", |
"10e5 Micro Industries Corporation", |
"10e6 Gainbery Computer Products Inc.", |
"10e7 Vadem", |
"10e8 Applied Micro Circuits Corp.", |
" 1072 INES GPIB-PCI (AMCC5920 based)", |
" 2011 Q-Motion Video Capture/Edit board", |
" 4750 S5930 [Matchmaker]", |
" 5920 S5920", |
" 8043 LANai4.x [Myrinet LANai interface chip]", |
" 8062 S5933_PARASTATION", |
" 807d S5933 [Matchmaker]", |
" 8088 Kongsberg Spacetec Format Synchronizer", |
" 8089 Kongsberg Spacetec Serial Output Board", |
" 809c S5933_HEPC3", |
" 80d7 PCI-9112", |
" 80d9 PCI-9118", |
" 80da PCI-9812", |
" 811a PCI-IEEE1355-DS-DE Interface", |
" 814c Fastcom ESCC-PCI (Commtech, Inc.)", |
" 8170 S5933 [Matchmaker] (Chipset Development Tool)", |
" 81e6 Multimedia video controller", |
" 8291 Fastcom 232/8-PCI (Commtech, Inc.)", |
" 82c4 Fastcom 422/4-PCI (Commtech, Inc.)", |
" 82c5 Fastcom 422/2-PCI (Commtech, Inc.)", |
" 82c6 Fastcom IG422/1-PCI (Commtech, Inc.)", |
" 82c7 Fastcom IG232/2-PCI (Commtech, Inc.)", |
" 82ca Fastcom 232/4-PCI (Commtech, Inc.)", |
" 82db AJA HDNTV HD SDI Framestore", |
" 82e2 Fastcom DIO24H-PCI (Commtech, Inc.)", |
" 8851 S5933 on Innes Corp FM Radio Capture card", |
"10e9 Alps Electric Co., Ltd.", |
"10ea Intergraphics Systems", |
" 1680 IGA-1680", |
" 1682 IGA-1682", |
" 1683 IGA-1683", |
" 2000 CyberPro 2000", |
" 2010 CyberPro 2000A", |
" 5000 CyberPro 5000", |
" 5050 CyberPro 5050", |
" 5202 CyberPro 5202", |
" 5252 CyberPro5252", |
"10eb Artists Graphics", |
" 0101 3GA", |
" 8111 Twist3 Frame Grabber", |
"10ec Realtek Semiconductor Co., Ltd.", |
" 0139 Zonet Zen3200", |
" 8029 RTL-8029(AS)", |
" 10b8 2011 EZ-Card (SMC1208)", |
" 10ec 8029 RTL-8029(AS)", |
" 1113 1208 EN1208", |
" 1186 0300 DE-528", |
" 1259 2400 AT-2400", |
" 8129 RTL-8129", |
" 10ec 8129 RT8129 Fast Ethernet Adapter", |
" 8138 RT8139 (B/C) Cardbus Fast Ethernet Adapter", |
" 10ec 8138 RT8139 (B/C) Fast Ethernet Adapter", |
" 8139 RTL-8139/8139C/8139C+", |
" 0357 000a TTP-Monitoring Card V2.0", |
" 1025 005a TravelMate 290", |
" 1025 8920 ALN-325", |
" 1025 8921 ALN-325", |
" 103c 006a NX9500", |
" 1043 8109 P5P800-MX Mainboard", |
" 1071 8160 MIM2000", |
" 10bd 0320 EP-320X-R", |
" 10ec 8139 RT8139", |
" 1113 ec01 FNC-0107TX", |
" 1186 1300 DFE-538TX", |
" 1186 1320 SN5200", |
" 1186 8139 DRN-32TX", |
" 11f6 8139 FN22-3(A) LinxPRO Ethernet Adapter", |
" 1259 2500 AT-2500TX", |
" 1259 2503 AT-2500TX/ACPI", |
" 1429 d010 ND010", |
" 1432 9130 EN-9130TX", |
" 1436 8139 RT8139", |
" 1458 e000 GA-7VM400M/7VT600 Motherboard", |
" 1462 788c 865PE Neo2-V Mainboard", |
" 146c 1439 FE-1439TX", |
" 1489 6001 GF100TXRII", |
" 1489 6002 GF100TXRA", |
" 149c 139a LFE-8139ATX", |
" 149c 8139 LFE-8139TX", |
" 14cb 0200 LNR-100 Family 10/100 Base-TX Ethernet", |
" 1695 9001 Onboard RTL8101L 10/100 MBit", |
" 1799 5000 F5D5000 PCI Card/Desktop Network PCI Card", |
" 1904 8139 RTL8139D Fast Ethernet Adapter", |
" 2646 0001 EtheRx", |
" 8e2e 7000 KF-230TX", |
" 8e2e 7100 KF-230TX/2", |
" a0a0 0007 ALN-325C", |
" 8169 RTL-8169 Gigabit Ethernet", |
" 1025 0079 Aspire 5024WLMi", |
" 1259 c107 CG-LAPCIGT", |
" 1371 434e ProG-2000L", |
" 1458 e000 GA-8I915ME-G Mainboard", |
" 1462 702c K8T NEO 2 motherboard", |
" 8180 RTL8180L 802.11b MAC", |
" 8185 RTL-8185 IEEE 802.11a/b/g Wireless LAN Controller", |
" 8197 SmartLAN56 56K Modem", |
"10ed Ascii Corporation", |
" 7310 V7310", |
"10ee Xilinx Corporation", |
" 0205 Wildcard TE205P", |
" 0210 Wildcard TE210P", |
" 0314 Wildcard TE405P/TE410P (1st Gen)", |
" 0405 Wildcard TE405P (2nd Gen)", |
" 0410 Wildcard TE410P (2nd Gen)", |
" 3fc0 RME Digi96", |
" 3fc1 RME Digi96/8", |
" 3fc2 RME Digi96/8 Pro", |
" 3fc3 RME Digi96/8 Pad", |
" 3fc4 RME Digi9652 (Hammerfall)", |
" 3fc5 RME Hammerfall DSP", |
" 3fc6 RME Hammerfall DSP MADI", |
" 8381 Ellips Santos Frame Grabber", |
" d154 Copley Controls CAN card (PCI-CAN-02)", |
"10ef Racore Computer Products, Inc.", |
" 8154 M815x Token Ring Adapter", |
"10f0 Peritek Corporation", |
"10f1 Tyan Computer", |
" 2865 Tyan Thunder K8E S2865", |
"10f2 Achme Computer, Inc.", |
"10f3 Alaris, Inc.", |
"10f4 S-MOS Systems, Inc.", |
"10f5 NKK Corporation", |
" a001 NDR4000 [NR4600 Bridge]", |
"10f6 Creative Electronic Systems SA", |
"10f7 Matsushita Electric Industrial Co., Ltd.", |
"10f8 Altos India Ltd", |
"10f9 PC Direct", |
"10fa Truevision", |
" 000c TARGA 1000", |
"10fb Thesys Gesellschaft fuer Mikroelektronik mbH", |
" 186f TH 6255", |
"10fc I-O Data Device, Inc.", |
" 0003 Cardbus IDE Controller", |
" 0005 Cardbus SCSI CBSC II", |
"10fd Soyo Computer, Inc", |
"10fe Fast Multimedia AG", |
"10ff NCube", |
"1100 Jazz Multimedia", |
"1101 Initio Corporation", |
" 1060 INI-A100U2W", |
" 9100 INI-9100/9100W", |
" 9400 INI-940", |
" 9401 INI-950", |
" 9500 360P", |
" 9502 Initio INI-9100UW Ultra Wide SCSI Controller INIC-950P chip", |
"1102 Creative Labs", |
" 0002 SB Live! EMU10k1", |
" 1102 0020 CT4850 SBLive! Value", |
" 1102 0021 CT4620 SBLive!", |
" 1102 002f SBLive! mainboard implementation", |
" 1102 100a SB Live! 5.1 Digital OEM [SB0220]", |
" 1102 4001 E-mu APS", |
" 1102 8022 CT4780 SBLive! Value", |
" 1102 8023 CT4790 SoundBlaster PCI512", |
" 1102 8024 CT4760 SBLive!", |
" 1102 8025 SBLive! Mainboard Implementation", |
" 1102 8026 CT4830 SBLive! Value", |
" 1102 8027 CT4832 SBLive! Value", |
" 1102 8028 CT4760 SBLive! OEM version", |
" 1102 8031 CT4831 SBLive! Value", |
" 1102 8040 CT4760 SBLive!", |
" 1102 8051 CT4850 SBLive! Value", |
" 1102 8061 SBLive! Player 5.1", |
" 1102 8064 SBLive! 5.1 Model SB0100", |
" 1102 8065 SBLive! 5.1 Digital Model SB0220", |
" 1102 8067 SBLive! 5.1 eMicro 28028", |
" 0004 SB Audigy", |
" 1102 0051 SB0090 Audigy Player", |
" 1102 0053 SB0090 Audigy Player/OEM", |
" 1102 0058 SB0090 Audigy Player/OEM", |
" 1102 1007 SB0240 Audigy 2 Platinum 6.1", |
" 1102 2002 SB Audigy 2 ZS (SB0350)", |
" 0006 [SB Live! Value] EMU10k1X", |
" 0007 SB Audigy LS", |
" 1102 0007 SBLive! 24bit", |
" 1102 1001 SB0310 Audigy LS", |
" 1102 1002 SB0312 Audigy LS", |
" 1102 1006 SB0410 SBLive! 24-bit", |
" 1462 1009 K8N Diamond", |
" 0008 SB0400 Audigy2 Value", |
" 1102 0008 EMU0404 Digital Audio System", |
" 4001 SB Audigy FireWire Port", |
" 1102 0010 SB Audigy FireWire Port", |
" 7002 SB Live! Game Port", |
" 1102 0020 Gameport Joystick", |
" 7003 SB Audigy Game Port", |
" 1102 0040 SB Audigy MIDI/Game Port", |
" 7004 [SB Live! Value] Input device controller", |
" 7005 SB Audigy LS Game Port", |
" 1102 1001 SB0310 Audigy LS MIDI/Game port", |
" 1102 1002 SB0312 Audigy LS MIDI/Game port", |
" 8064 SB0100 [SBLive! 5.1 OEM]", |
" 8938 Ectiva EV1938", |
" 1033 80e5 SlimTower-Jim (NEC)", |
" 1071 7150 Mitac 7150", |
" 110a 5938 Siemens Scenic Mobile 510PIII", |
" 13bd 100c Ceres-C (Sharp, Intel BX)", |
" 13bd 100d Sharp, Intel Banister", |
" 13bd 100e TwinHead P09S/P09S3 (Sharp)", |
" 13bd f6f1 Marlin (Sharp)", |
" 14ff 0e70 P88TE (TWINHEAD INTERNATIONAL Corp)", |
" 14ff c401 Notebook 9100/9200/2000 (TWINHEAD INTERNATIONAL Corp)", |
" 156d b400 G400 - Geo (AlphaTop (Taiwan))", |
" 156d b550 G560 (AlphaTop (Taiwan))", |
" 156d b560 G560 (AlphaTop (Taiwan))", |
" 156d b700 G700/U700 (AlphaTop (Taiwan))", |
" 156d b795 G795 (AlphaTop (Taiwan))", |
" 156d b797 G797 (AlphaTop (Taiwan))", |
"1103 Triones Technologies, Inc.", |
" 0003 HPT343/345/346/363", |
" 0004 HPT366/368/370/370A/372/372N", |
" 1103 0001 HPT370A", |
" 1103 0004 HPT366 UDMA66 (r1) / HPT368 UDMA66 (r2) / HPT370 UDMA100 (r3) / HPT370 UDMA100 RAID (r4)", |
" 1103 0005 HPT370 UDMA100", |
" 0005 HPT372A/372N", |
" 0006 HPT302/302N", |
" 0007 HPT371/371N", |
" 0008 HPT374", |
" 0009 HPT372N", |
"1104 RasterOps Corp.", |
"1105 Sigma Designs, Inc.", |
" 1105 REALmagic Xcard MPEG 1/2/3/4 DVD Decoder", |
" 8300 REALmagic Hollywood Plus DVD Decoder", |
" 8400 EM840x REALmagic DVD/MPEG-2 Audio/Video Decoder", |
" 8401 EM8401 REALmagic DVD/MPEG-2 A/V Decoder", |
" 8470 EM8470 REALmagic DVD/MPEG-4 A/V Decoder", |
" 8471 EM8471 REALmagic DVD/MPEG-4 A/V Decoder", |
" 8475 EM8475 REALmagic DVD/MPEG-4 A/V Decoder", |
" 1105 0001 REALmagic X-Card", |
" 8476 EM8476 REALmagic DVD/MPEG-4 A/V Decoder", |
" 127d 0000 CineView II", |
" 8485 EM8485 REALmagic DVD/MPEG-4 A/V Decoder", |
" 8486 EM8486 REALmagic DVD/MPEG-4 A/V Decoder", |
"1106 VIA Technologies, Inc.", |
" 0102 Embedded VIA Ethernet Controller", |
" 0130 VT6305 1394.A Controller", |
" 0204 K8M800 Host Bridge", |
" 0208 PT890 Host Bridge", |
" 0238 K8T890 Host Bridge", |
" 0258 PT880 Host Bridge", |
" 0259 CN400/PM880 Host Bridge", |
" 0269 KT880 Host Bridge", |
" 0282 K8T800Pro Host Bridge", |
" 1043 80a3 A8V Deluxe", |
" 0290 K8M890 Host Bridge", |
" 0293 PM896 Host Bridge", |
" 0296 P4M800 Host Bridge", |
" 0305 VT8363/8365 [KT133/KM133]", |
" 1019 0987 K7VZA Mainboard", |
" 1043 8033 A7V Mainboard", |
" 1043 803e A7V-E Mainboard", |
" 1043 8042 A7V133/A7V133-C Mainboard", |
" 147b a401 KT7/KT7-RAID/KT7A/KT7A-RAID Mainboard", |
" 0308 PT894 Host Bridge", |
" 0314 CN700/VN800/P4M800CE/Pro Host Bridge", |
" 0324 CX700 Host Bridge", |
" 0327 P4M890 Host Bridge", |
" 0336 K8M890CE Host Bridge", |
" 0340 PT900 Host Bridge", |
" 0351 VT3351 Host Bridge", |
" 0364 P4M900 Host Bridge", |
" 0391 VT8371 [KX133]", |
" 0501 VT8501 [Apollo MVP4]", |
" 0505 VT82C505", |
" 0561 VT82C576MV", |
" 0571 VT82C586A/B/VT82C686/A/B/VT823x/A/C PIPC Bus Master IDE", |
" 1019 0985 P6VXA Motherboard", |
" 1019 0a81 L7VTA v1.0 Motherboard (KT400-8235)", |
" 1043 8052 VT8233A Bus Master ATA100/66/33 IDE", |
" 1043 808c A7V8X / A7V333 motherboard", |
" 1043 80a1 A7V8X-X motherboard rev. 1.01", |
" 1043 80ed A7V600/K8V-X/A8V Deluxe motherboard", |
" 1106 0571 VT82C586/B/VT82C686/A/B/VT8233/A/C/VT8235 PIPC Bus Master IDE", |
" 1179 0001 Magnia Z310", |
" 1297 f641 FX41 motherboard", |
" 1458 5002 GA-7VAX Mainboard", |
" 1462 7020 K8T NEO 2 motherboard", |
" 147b 1407 KV8-MAX3 motherboard", |
" 1849 0571 K7VT2/K7VT6 motherboard", |
" 0576 VT82C576 3V [Apollo Master]", |
" 0585 VT82C585VP [Apollo VP1/VPX]", |
" 0586 VT82C586/A/B PCI-to-ISA [Apollo VP]", |
" 1106 0000 MVP3 ISA Bridge", |
" 0591 VT8237A SATA 2-Port Controller", |
" 0595 VT82C595 [Apollo VP2]", |
" 0596 VT82C596 ISA [Mobile South]", |
" 1106 0000 VT82C596/A/B PCI to ISA Bridge", |
" 1458 0596 VT82C596/A/B PCI to ISA Bridge", |
" 0597 VT82C597 [Apollo VP3]", |
" 0598 VT82C598 [Apollo MVP3]", |
" 0601 VT8601 [Apollo ProMedia]", |
" 0605 VT8605 [ProSavage PM133]", |
" 1043 802c CUV4X mainboard", |
" 0680 VT82C680 [Apollo P6]", |
" 0686 VT82C686 [Apollo Super South]", |
" 1019 0985 P6VXA Motherboard", |
" 1043 802c CUV4X mainboard", |
" 1043 8033 A7V Mainboard", |
" 1043 803e A7V-E Mainboard", |
" 1043 8040 A7M266 Mainboard", |
" 1043 8042 A7V133/A7V133-C Mainboard", |
" 1106 0000 VT82C686/A PCI to ISA Bridge", |
" 1106 0686 VT82C686/A PCI to ISA Bridge", |
" 1179 0001 Magnia Z310", |
" 147b a702 KG7-Lite Mainboard", |
" 0691 VT82C693A/694x [Apollo PRO133x]", |
" 1019 0985 P6VXA Motherboard", |
" 1179 0001 Magnia Z310", |
" 1458 0691 VT82C691 Apollo Pro System Controller", |
" 0693 VT82C693 [Apollo Pro Plus]", |
" 0698 VT82C693A [Apollo Pro133 AGP]", |
" 0926 VT82C926 [Amazon]", |
" 1000 VT82C570MV", |
" 1106 VT82C570MV", |
" 1204 K8M800 Host Bridge", |
" 1208 PT890 Host Bridge", |
" 1238 K8T890 Host Bridge", |
" 1258 PT880 Host Bridge", |
" 1259 CN400/PM880 Host Bridge", |
" 1269 KT880 Host Bridge", |
" 1282 K8T800Pro Host Bridge", |
" 1290 K8M890 Host Bridge", |
" 1293 PM896 Host Bridge", |
" 1296 P4M800 Host Bridge", |
" 1308 PT894 Host Bridge", |
" 1314 CN700/VN800/P4M800CE/Pro Host Bridge", |
" 1324 CX700 Host Bridge", |
" 1327 P4M890 Host Bridge", |
" 1336 K8M890CE Host Bridge", |
" 1340 PT900 Host Bridge", |
" 1351 VT3351 Host Bridge", |
" 1364 P4M900 Host Bridge", |
" 1571 VT82C576M/VT82C586", |
" 1595 VT82C595/97 [Apollo VP2/97]", |
" 2204 K8M800 Host Bridge", |
" 2208 PT890 Host Bridge", |
" 2238 K8T890 Host Bridge", |
" 2258 PT880 Host Bridge", |
" 2259 CN400/PM880 Host Bridge", |
" 2269 KT880 Host Bridge", |
" 2282 K8T800Pro Host Bridge", |
" 2290 K8M890 Host Bridge", |
" 2293 PM896 Host Bridge", |
" 2296 P4M800 Host Bridge", |
" 2308 PT894 Host Bridge", |
" 2314 CN700/VN800/P4M800CE/Pro Host Bridge", |
" 2324 CX700 Host Bridge", |
" 2327 P4M890 Host Bridge", |
" 2336 K8M890CE Host Bridge", |
" 2340 PT900 Host Bridge", |
" 2351 VT3351 Host Bridge", |
" 2364 P4M900 Host Bridge", |
" 287a VT8251 PCI to PCI Bridge", |
" 287b VT8251 Host Bridge", |
" 287c VT8251 PCIE Root Port", |
" 287d VT8251 PCIE Root Port", |
" 287e VT8251 Ultra VLINK Controller", |
" 3022 CLE266", |
" 3038 VT82xxxxx UHCI USB 1.1 Controller", |
" 0925 1234 USB Controller", |
" 1019 0985 P6VXA Motherboard", |
" 1019 0a81 L7VTA v1.0 Motherboard (KT400-8235)", |
" 1043 8080 A7V333 motherboard", |
" 1043 808c VT6202 USB2.0 4 port controller", |
" 1043 80a1 A7V8X-X motherboard", |
" 1043 80ed A7V600/K8V-X/A8V Deluxe motherboard", |
" 1179 0001 Magnia Z310", |
" 1458 5004 GA-7VAX Mainboard", |
" 1462 7020 K8T NEO 2 motherboard", |
" 147b 1407 KV8-MAX3 motherboard", |
" 182d 201d CN-029 USB2.0 4 port PCI Card", |
" 1849 3038 K7VT6", |
" 3040 VT82C586B ACPI", |
" 3043 VT86C100A [Rhine]", |
" 10bd 0000 VT86C100A Fast Ethernet Adapter", |
" 1106 0100 VT86C100A Fast Ethernet Adapter", |
" 1186 1400 DFE-530TX rev A", |
" 3044 IEEE 1394 Host Controller", |
" 1025 005a TravelMate 290", |
" 1043 808a A8V Deluxe", |
" 1458 1000 GA-7VT600-1394 Motherboard", |
" 1462 207d K8NGM2 series motherboard", |
" 1462 702d K8T NEO 2 motherboard", |
" 1462 971d MS-6917", |
" 3050 VT82C596 Power Management", |
" 3051 VT82C596 Power Management", |
" 3053 VT6105M [Rhine-III]", |
" 3057 VT82C686 [Apollo Super ACPI]", |
" 1019 0985 P6VXA Motherboard", |
" 1019 0987 K7VZA Motherboard", |
" 1043 8033 A7V Mainboard", |
" 1043 803e A7V-E Mainboard", |
" 1043 8040 A7M266 Mainboard", |
" 1043 8042 A7V133/A7V133-C Mainboard", |
" 1179 0001 Magnia Z310", |
" 3058 VT82C686 AC97 Audio Controller", |
" 0e11 0097 SoundMax Digital Integrated Audio", |
" 0e11 b194 Soundmax integrated digital audio", |
" 1019 0985 P6VXA Motherboard", |
" 1019 0987 K7VZA Motherboard", |
" 1043 1106 A7V133/A7V133-C Mainboard", |
" 1106 4511 Onboard Audio on EP7KXA", |
" 1458 7600 Onboard Audio", |
" 1462 3091 MS-6309 Onboard Audio", |
" 1462 3300 MS-6330 Onboard Audio", |
" 15dd 7609 Onboard Audio", |
" 3059 VT8233/A/8235/8237 AC97 Audio Controller", |
" 1019 0a81 L7VTA v1.0 Motherboard (KT400-8235)", |
" 1043 8095 A7V8X Motherboard (Realtek ALC650 codec)", |
" 1043 80a1 A7V8X-X Motherboard", |
" 1043 80b0 A7V600/K8V Deluxe motherboard (ADI AD1980 codec [SoundMAX])", |
" 1043 812a A8V Deluxe motherboard (Realtek ALC850 codec)", |
" 1106 3059 L7VMM2 Motherboard", |
" 1106 4161 K7VT2 motherboard", |
" 1106 4170 PCPartner P4M800-8237R Motherboard", |
" 1106 4552 Soyo KT-600 Dragon Plus (Realtek ALC 650)", |
" 1297 c160 FX41 motherboard (Realtek ALC650 codec)", |
" 1458 a002 GA-7VAX Onboard Audio (Realtek ALC650)", |
" 1462 0080 K8T NEO 2 motherboard", |
" 1462 3800 KT266 onboard audio", |
" 147b 1407 KV8-MAX3 motherboard", |
" 1849 9761 K7VT6 motherboard", |
" 4005 4710 MSI K7T266 Pro2-RU (MSI-6380 v2) onboard audio (Realtek/ALC 200/200P)", |
" a0a0 01b6 AK77-8XN onboard audio", |
" 3065 VT6102 [Rhine-II]", |
" 1043 80a1 A7V8X-X Motherboard", |
" 1106 0102 VT6102 [Rhine II] Embeded Ethernet Controller on VT8235", |
" 1186 1400 DFE-530TX rev A", |
" 1186 1401 DFE-530TX rev B", |
" 13b9 1421 LD-10/100AL PCI Fast Ethernet Adapter (rev.B)", |
" 147b 1c09 NV7 Motherboard", |
" 1695 3005 VT6103", |
" 1695 300c Realtek ALC655 sound chip", |
" 1849 3065 K7VT6 motherboard", |
" 3068 AC'97 Modem Controller", |
" 1462 309e MS-6309 Saturn Motherboard", |
" 3074 VT8233 PCI to ISA Bridge", |
" 1043 8052 VT8233A", |
" 3091 VT8633 [Apollo Pro266]", |
" 3099 VT8366/A/7 [Apollo KT266/A/333]", |
" 1043 8064 A7V266-E Mainboard", |
" 1043 807f A7V333 Mainboard", |
" 1849 3099 K7VT2 motherboard", |
" 3101 VT8653 Host Bridge", |
" 3102 VT8662 Host Bridge", |
" 3103 VT8615 Host Bridge", |
" 3104 USB 2.0", |
" 1019 0a81 L7VTA v1.0 Motherboard (KT400-8235)", |
" 1043 808c A7V8X motherboard", |
" 1043 80a1 A7V8X-X motherboard rev 1.01", |
" 1043 80ed A7V600/K8V-X/A8V Deluxe motherboard", |
" 1297 f641 FX41 motherboard", |
" 1458 5004 GA-7VAX Mainboard", |
" 1462 7020 K8T NEO 2 motherboard", |
" 147b 1407 KV8-MAX3 motherboard", |
" 182d 201d CN-029 USB 2.0 4 port PCI Card", |
" 1849 3104 K7VT6 motherboard", |
" 3106 VT6105 [Rhine-III]", |
" 1186 1403 DFE-530TX rev C", |
" 3108 S3 Unichrome Pro VGA Adapter", |
" 3109 VT8233C PCI to ISA Bridge", |
" 3112 VT8361 [KLE133] Host Bridge", |
" 3113 VPX/VPX2 PCI to PCI Bridge Controller", |
" 3116 VT8375 [KM266/KL266] Host Bridge", |
" 1297 f641 FX41 motherboard", |
" 3118 S3 Unichrome Pro VGA Adapter", |
" 3119 VT6120/VT6121/VT6122 Gigabit Ethernet Adapter", |
" 3122 VT8623 [Apollo CLE266] integrated CastleRock graphics", |
" 3123 VT8623 [Apollo CLE266]", |
" 3128 VT8753 [P4X266 AGP]", |
" 3133 VT3133 Host Bridge", |
" 3147 VT8233A ISA Bridge", |
" 1043 808c A7V333 motherboard", |
" 3148 P4M266 Host Bridge", |
" 3149 VIA VT6420 SATA RAID Controller", |
" 1043 80ed A7V600/K8V Deluxe/K8V-X/A8V Deluxe motherboard", |
" 1458 b003 GA-7VM400AM(F) Motherboard", |
" 1462 7020 K8T Neo 2 Motherboard", |
" 147b 1407 KV8-MAX3 motherboard", |
" 147b 1408 KV7", |
" 1849 3149 K7VT6 motherboard", |
" 3156 P/KN266 Host Bridge", |
" 3164 VT6410 ATA133 RAID controller", |
" 1043 80f4 P4P800 Mainboard Deluxe ATX", |
" 1462 7028 915P/G Neo2", |
" 3168 VT8374 P4X400 Host Controller/AGP Bridge", |
" 3177 VT8235 ISA Bridge", |
" 1019 0a81 L7VTA v1.0 Motherboard (KT400-8235)", |
" 1043 808c A7V8X motherboard", |
" 1043 80a1 A7V8X-X motherboard", |
" 1297 f641 FX41 motherboard", |
" 1458 5001 GA-7VAX Mainboard", |
" 1849 3177 K7VT2 motherboard", |
" 3178 ProSavageDDR P4N333 Host Bridge", |
" 3188 VT8385 [K8T800 AGP] Host Bridge", |
" 1043 80a3 K8V Deluxe/K8V-X motherboard", |
" 147b 1407 KV8-MAX3 motherboard", |
" 3189 VT8377 [KT400/KT600 AGP] Host Bridge", |
" 1043 807f A7V8X motherboard", |
" 1458 5000 GA-7VAX Mainboard", |
" 1849 3189 K7VT6 motherboard", |
" 3204 K8M800 Host Bridge", |
" 3205 VT8378 [KM400/A] Chipset Host Bridge", |
" 1458 5000 GA-7VM400M Motherboard", |
" 3208 PT890 Host Bridge", |
" 3213 VPX/VPX2 PCI to PCI Bridge Controller", |
" 3218 K8T800M Host Bridge", |
" 3227 VT8237 ISA bridge [KT600/K8T800/K8T890 South]", |
" 1043 80ed A7V600/K8V-X/A8V Deluxe motherboard", |
" 1106 3227 DFI KT600-AL Motherboard", |
" 1458 5001 GA-7VT600 Motherboard", |
" 147b 1407 KV8-MAX3 motherboard", |
" 1849 3227 K7VT4 motherboard", |
" 3238 K8T890 Host Bridge", |
" 3249 VT6421 IDE RAID Controller", |
" 324a CX700 PCI to PCI Bridge", |
" 324b CX700 Host Bridge", |
" 324e CX700 Internal Module Bus", |
" 3258 PT880 Host Bridge", |
" 3259 CN400/PM880 Host Bridge", |
" 3269 KT880 Host Bridge", |
" 3282 K8T800Pro Host Bridge", |
" 3287 VT8251 PCI to ISA Bridge", |
" 3288 VIA High Definition Audio Controller", |
" 3290 K8M890 Host Bridge", |
" 3296 P4M800 Host Bridge", |
" 3324 CX700 Host Bridge", |
" 3327 P4M890 Host Bridge", |
" 3336 K8M890CE Host Bridge", |
" 3337 VT8237A PCI to ISA Bridge", |
" 3340 PT900 Host Bridge", |
" 3344 UniChrome Pro IGP", |
" 3349 VT8251 AHCI/SATA 4-Port Controller", |
" 3351 VT3351 Host Bridge", |
" 3364 P4M900 Host Bridge", |
" 337a VT8237A PCI to PCI Bridge", |
" 337b VT8237A Host Bridge", |
" 4149 VIA VT6420 (ATA133) Controller", |
" 4204 K8M800 Host Bridge", |
" 4208 PT890 Host Bridge", |
" 4238 K8T890 Host Bridge", |
" 4258 PT880 Host Bridge", |
" 4259 CN400/PM880 Host Bridge", |
" 4269 KT880 Host Bridge", |
" 4282 K8T800Pro Host Bridge", |
" 4290 K8M890 Host Bridge", |
" 4293 PM896 Host Bridge", |
" 4296 P4M800 Host Bridge", |
" 4308 PT894 Host Bridge", |
" 4314 CN700/VN800/P4M800CE/Pro Host Bridge", |
" 4324 CX700 Host Bridge", |
" 4327 P4M890 Host Bridge", |
" 4336 K8M890CE Host Bridge", |
" 4340 PT900 Host Bridge", |
" 4351 VT3351 Host Bridge", |
" 4364 P4M900 Host Bridge", |
" 5030 VT82C596 ACPI [Apollo PRO]", |
" 5208 PT890 I/O APIC Interrupt Controller", |
" 5238 K8T890 I/O APIC Interrupt Controller", |
" 5290 K8M890 I/O APIC Interrupt Controller", |
" 5308 PT894 I/O APIC Interrupt Controller", |
" 5327 P4M890 I/O APIC Interrupt Controller", |
" 5336 K8M890CE I/O APIC Interrupt Controller", |
" 5340 PT900 I/O APIC Interrupt Controller", |
" 5351 VT3351 I/O APIC Interrupt Controller", |
" 5364 P4M900 I/O APIC Interrupt Controller", |
" 6100 VT85C100A [Rhine II]", |
" 6327 P4M890 Security Device", |
" 7204 K8M800 Host Bridge", |
" 7205 VT8378 [S3 UniChrome] Integrated Video", |
" 1458 d000 Gigabyte GA-7VM400(A)M(F) Motherboard", |
" 7208 PT890 Host Bridge", |
" 7238 K8T890 Host Bridge", |
" 7258 PT880 Host Bridge", |
" 7259 CN400/PM880 Host Bridge", |
" 7269 KT880 Host Bridge", |
" 7282 K8T800Pro Host Bridge", |
" 7290 K8M890 Host Bridge", |
" 7293 PM896 Host Bridge", |
" 7296 P4M800 Host Bridge", |
" 7308 PT894 Host Bridge", |
" 7314 CN700/VN800/P4M800CE/Pro Host Bridge", |
" 7324 CX700 Host Bridge", |
" 7327 P4M890 Host Bridge", |
" 7336 K8M890CE Host Bridge", |
" 7340 PT900 Host Bridge", |
" 7351 VT3351 Host Bridge", |
" 7364 P4M900 Host Bridge", |
" 8231 VT8231 [PCI-to-ISA Bridge]", |
" 8235 VT8235 ACPI", |
" 8305 VT8363/8365 [KT133/KM133 AGP]", |
" 8324 CX700 PCI to ISA Bridge", |
" 8391 VT8371 [KX133 AGP]", |
" 8501 VT8501 [Apollo MVP4 AGP]", |
" 8596 VT82C596 [Apollo PRO AGP]", |
" 8597 VT82C597 [Apollo VP3 AGP]", |
" 8598 VT82C598/694x [Apollo MVP3/Pro133x AGP]", |
" 1019 0985 P6VXA Motherboard", |
" 8601 VT8601 [Apollo ProMedia AGP]", |
" 8605 VT8605 [PM133 AGP]", |
" 8691 VT82C691 [Apollo Pro]", |
" 8693 VT82C693 [Apollo Pro Plus] PCI Bridge", |
" a208 PT890 PCI to PCI Bridge Controller", |
" a238 K8T890 PCI to PCI Bridge Controller", |
" a327 P4M890 PCI to PCI Bridge Controller", |
" a364 P4M900 PCI to PCI Bridge Controller", |
" b091 VT8633 [Apollo Pro266 AGP]", |
" b099 VT8366/A/7 [Apollo KT266/A/333 AGP]", |
" b101 VT8653 AGP Bridge", |
" b102 VT8362 AGP Bridge", |
" b103 VT8615 AGP Bridge", |
" b112 VT8361 [KLE133] AGP Bridge", |
" b113 VPX/VPX2 I/O APIC Interrupt Controller", |
" b115 VT8363/8365 [KT133/KM133] PCI Bridge", |
" b168 VT8235 PCI Bridge", |
" b188 VT8237 PCI bridge [K8T800/K8T890 South]", |
" 147b 1407 KV8-MAX3 motherboard", |
" b198 VT8237 PCI Bridge", |
" b213 VPX/VPX2 I/O APIC Interrupt Controller", |
" b999 [K8T890 North / VT8237 South] PCI Bridge", |
" c208 PT890 PCI to PCI Bridge Controller", |
" c238 K8T890 PCI to PCI Bridge Controller", |
" c327 P4M890 PCI to PCI Bridge Controller", |
" c340 PT900 PCI to PCI Bridge Controller", |
" c364 P4M900 PCI to PCI Bridge Controller", |
" d104 VT8237 Integrated Fast Ethernet Controller", |
" d208 PT890 PCI to PCI Bridge Controller", |
" d213 VPX/VPX2 PCI to PCI Bridge Controller", |
" d238 K8T890 PCI to PCI Bridge Controller", |
" d340 PT900 PCI to PCI Bridge Controller", |
" e208 PT890 PCI to PCI Bridge Controller", |
" e238 K8T890 PCI to PCI Bridge Controller", |
" e340 PT900 PCI to PCI Bridge Controller", |
" f208 PT890 PCI to PCI Bridge Controller", |
" f238 K8T890 PCI to PCI Bridge Controller", |
" f340 PT900 PCI to PCI Bridge Controller", |
"1107 Stratus Computers", |
" 0576 VIA VT82C570MV [Apollo] (Wrong vendor ID!)", |
"1108 Proteon, Inc.", |
" 0100 p1690plus_AA", |
" 0101 p1690plus_AB", |
" 0105 P1690Plus", |
" 0108 P1690Plus", |
" 0138 P1690Plus", |
" 0139 P1690Plus", |
" 013c P1690Plus", |
" 013d P1690Plus", |
"1109 Cogent Data Technologies, Inc.", |
" 1400 EM110TX [EX110TX]", |
"110a Siemens Nixdorf AG", |
" 0002 Pirahna 2-port", |
" 0005 Tulip controller, power management, switch extender", |
" 0006 FSC PINC (I/O-APIC)", |
" 0015 FSC Multiprocessor Interrupt Controller", |
" 001d FSC Copernicus Management Controller", |
" 007b FSC Remote Service Controller, mailbox device", |
" 007c FSC Remote Service Controller, shared memory device", |
" 007d FSC Remote Service Controller, SMIC device", |
" 2101 HST SAPHIR V Primary PCI (ISDN/PMx)", |
" 2102 DSCC4 PEB/PEF 20534 DMA Supported Serial Communication Controller with 4 Channels", |
" 2104 Eicon Diva 2.02 compatible passive ISDN card", |
" 3142 SIMATIC NET CP 5613A1 (Profibus Adapter)", |
" 4021 SIMATIC NET CP 5512 (Profibus and MPI Cardbus Adapter)", |
" 4029 SIMATIC NET CP 5613A2 (Profibus Adapter)", |
" 4942 FPGA I-Bus Tracer for MBD", |
" 6120 SZB6120", |
"110b Chromatic Research Inc.", |
" 0001 Mpact Media Processor", |
" 0004 Mpact 2", |
"110c Mini-Max Technology, Inc.", |
"110d Znyx Advanced Systems", |
"110e CPU Technology", |
"110f Ross Technology", |
"1110 Powerhouse Systems", |
" 6037 Firepower Powerized SMP I/O ASIC", |
" 6073 Firepower Powerized SMP I/O ASIC", |
"1111 Santa Cruz Operation", |
"1112 Osicom Technologies Inc", |
" 2200 FDDI Adapter", |
" 2300 Fast Ethernet Adapter", |
" 2340 4 Port Fast Ethernet Adapter", |
" 2400 ATM Adapter", |
"1113 Accton Technology Corporation", |
" 1211 SMC2-1211TX", |
" 103c 1207 EN-1207D Fast Ethernet Adapter", |
" 1113 1211 EN-1207D Fast Ethernet Adapter", |
" 1216 EN-1216 Ethernet Adapter", |
" 1113 2242 EN2242 10/100 Ethernet Mini-PCI Card", |
" 111a 1020 SpeedStream 1020 PCI 10/100 Ethernet Adaptor [EN-1207F-TX ?]", |
" 1217 EN-1217 Ethernet Adapter", |
" 5105 10Mbps Network card", |
" 9211 EN-1207D Fast Ethernet Adapter", |
" 1113 9211 EN-1207D Fast Ethernet Adapter", |
" 9511 21x4x DEC-Tulip compatible Fast Ethernet", |
" d301 CPWNA100 (Philips wireless PCMCIA)", |
" ec02 SMC 1244TX v3", |
"1114 Atmel Corporation", |
" 0506 at76c506 802.11b Wireless Network Adaptor", |
"1115 3D Labs", |
"1116 Data Translation", |
" 0022 DT3001", |
" 0023 DT3002", |
" 0024 DT3003", |
" 0025 DT3004", |
" 0026 DT3005", |
" 0027 DT3001-PGL", |
" 0028 DT3003-PGL", |
"1117 Datacube, Inc", |
" 9500 Max-1C SVGA card", |
" 9501 Max-1C image processing", |
"1118 Berg Electronics", |
"1119 ICP Vortex Computersysteme GmbH", |
" 0000 GDT 6000/6020/6050", |
" 0001 GDT 6000B/6010", |
" 0002 GDT 6110/6510", |
" 0003 GDT 6120/6520", |
" 0004 GDT 6530", |
" 0005 GDT 6550", |
" 0006 GDT 6117/6517", |
" 0007 GDT 6127/6527", |
" 0008 GDT 6537", |
" 0009 GDT 6557/6557-ECC", |
" 000a GDT 6115/6515", |
" 000b GDT 6125/6525", |
" 000c GDT 6535", |
" 000d GDT 6555", |
" 0010 GDT 6115/6515", |
" 0011 GDT 6125/6525", |
" 0012 GDT 6535", |
" 0013 GDT 6555/6555-ECC", |
" 0100 GDT 6117RP/6517RP", |
" 0101 GDT 6127RP/6527RP", |
" 0102 GDT 6537RP", |
" 0103 GDT 6557RP", |
" 0104 GDT 6111RP/6511RP", |
" 0105 GDT 6121RP/6521RP", |
" 0110 GDT 6117RD/6517RD", |
" 0111 GDT 6127RD/6527RD", |
" 0112 GDT 6537RD", |
" 0113 GDT 6557RD", |
" 0114 GDT 6111RD/6511RD", |
" 0115 GDT 6121RD/6521RD", |
" 0118 GDT 6118RD/6518RD/6618RD", |
" 0119 GDT 6128RD/6528RD/6628RD", |
" 011a GDT 6538RD/6638RD", |
" 011b GDT 6558RD/6658RD", |
" 0120 GDT 6117RP2/6517RP2", |
" 0121 GDT 6127RP2/6527RP2", |
" 0122 GDT 6537RP2", |
" 0123 GDT 6557RP2", |
" 0124 GDT 6111RP2/6511RP2", |
" 0125 GDT 6121RP2/6521RP2", |
" 0136 GDT 6113RS/6513RS", |
" 0137 GDT 6123RS/6523RS", |
" 0138 GDT 6118RS/6518RS/6618RS", |
" 0139 GDT 6128RS/6528RS/6628RS", |
" 013a GDT 6538RS/6638RS", |
" 013b GDT 6558RS/6658RS", |
" 013c GDT 6533RS/6633RS", |
" 013d GDT 6543RS/6643RS", |
" 013e GDT 6553RS/6653RS", |
" 013f GDT 6563RS/6663RS", |
" 0166 GDT 7113RN/7513RN/7613RN", |
" 0167 GDT 7123RN/7523RN/7623RN", |
" 0168 GDT 7118RN/7518RN/7518RN", |
" 0169 GDT 7128RN/7528RN/7628RN", |
" 016a GDT 7538RN/7638RN", |
" 016b GDT 7558RN/7658RN", |
" 016c GDT 7533RN/7633RN", |
" 016d GDT 7543RN/7643RN", |
" 016e GDT 7553RN/7653RN", |
" 016f GDT 7563RN/7663RN", |
" 01d6 GDT 4x13RZ", |
" 01d7 GDT 4x23RZ", |
" 01f6 GDT 8x13RZ", |
" 01f7 GDT 8x23RZ", |
" 01fc GDT 8x33RZ", |
" 01fd GDT 8x43RZ", |
" 01fe GDT 8x53RZ", |
" 01ff GDT 8x63RZ", |
" 0210 GDT 6519RD/6619RD", |
" 0211 GDT 6529RD/6629RD", |
" 0260 GDT 7519RN/7619RN", |
" 0261 GDT 7529RN/7629RN", |
" 02ff GDT MAXRP", |
" 0300 GDT NEWRX", |
"111a Efficient Networks, Inc", |
" 0000 155P-MF1 (FPGA)", |
" 0002 155P-MF1 (ASIC)", |
" 0003 ENI-25P ATM", |
" 111a 0000 ENI-25p Miniport ATM Adapter", |
" 0005 SpeedStream (LANAI)", |
" 111a 0001 ENI-3010 ATM", |
" 111a 0009 ENI-3060 ADSL (VPI=0)", |
" 111a 0101 ENI-3010 ATM", |
" 111a 0109 ENI-3060CO ADSL (VPI=0)", |
" 111a 0809 ENI-3060 ADSL (VPI=0 or 8)", |
" 111a 0909 ENI-3060CO ADSL (VPI=0 or 8)", |
" 111a 0a09 ENI-3060 ADSL (VPI=<0..15>)", |
" 0007 SpeedStream ADSL", |
" 111a 1001 ENI-3061 ADSL [ASIC]", |
" 1203 SpeedStream 1023 Wireless PCI Adapter", |
"111b Teledyne Electronic Systems", |
"111c Tricord Systems Inc.", |
" 0001 Powerbis Bridge", |
"111d Integrated Device Technology, Inc.", |
" 0001 IDT77201/77211 155Mbps ATM SAR Controller [NICStAR]", |
" 0003 IDT77222/77252 155Mbps ATM MICRO ABR SAR Controller", |
" 0004 IDT77V252 155Mbps ATM MICRO ABR SAR Controller", |
" 0005 IDT77V222 155Mbps ATM MICRO ABR SAR Controller", |
"111e Eldec", |
"111f Precision Digital Images", |
" 4a47 Precision MX Video engine interface", |
" 5243 Frame capture bus interface", |
"1120 EMC Corporation", |
"1121 Zilog", |
"1122 Multi-tech Systems, Inc.", |
"1123 Excellent Design, Inc.", |
"1124 Leutron Vision AG", |
" 2581 Picport Monochrome", |
"1125 Eurocore", |
"1126 Vigra", |
"1127 FORE Systems Inc", |
" 0200 ForeRunner PCA-200 ATM", |
" 0210 PCA-200PC", |
" 0250 ATM", |
" 0300 ForeRunner PCA-200EPC ATM", |
" 0310 ATM", |
" 0400 ForeRunnerHE ATM Adapter", |
" 1127 0400 ForeRunnerHE ATM", |
"1129 Firmworks", |
"112a Hermes Electronics Company, Ltd.", |
"112b Linotype - Hell AG", |
"112c Zenith Data Systems", |
"112d Ravicad", |
"112e Infomedia Microelectronics Inc.", |
"112f Imaging Technology Inc", |
" 0000 MVC IC-PCI", |
" 0001 MVC IM-PCI Video frame grabber/processor", |
" 0008 PC-CamLink PCI framegrabber", |
"1130 Computervision", |
"1131 Philips Semiconductors", |
" 1561 USB 1.1 Host Controller", |
" 1562 USB 2.0 Host Controller", |
" 3400 SmartPCI56(UCB1500) 56K Modem", |
" 5400 TriMedia TM1000/1100", |
" 5402 TriMedia TM-1300", |
" 1244 0f00 Fritz!Card DSL", |
" 5405 TriMedia TM1500", |
" 5406 TriMedia TM1700", |
" 7130 SAA7130 Video Broadcast Decoder", |
" 102b 48d0 Matrox CronosPlus", |
" 1048 226b ELSA EX-VISION 300TV", |
" 1131 2001 10MOONS PCI TV CAPTURE CARD", |
" 1131 2005 Techcom (India) TV Tuner Card (SSD-TV-670)", |
" 1461 050c Nagase Sangyo TransGear 3000TV", |
" 1461 10ff AVerMedia DVD EZMaker", |
" 1461 2108 AverMedia AverTV/305", |
" 1461 2115 AverMedia AverTV Studio 305", |
" 153b 1152 Terratec Cinergy 200 TV", |
" 185b c100 Compro VideoMate TV PVR/FM", |
" 185b c901 Videomate DVB-T200", |
" 5168 0138 LifeView FlyVIDEO2000", |
" 7133 SAA7133/SAA7135 Video Broadcast Decoder", |
" 0000 4091 Beholder BeholdTV 409 FM", |
" 1019 4cb5 Elitegroup ECS TVP3XP FM1236 Tuner Card (NTSC,FM)", |
" 1043 0210 FlyTV mini Asus Digimatrix", |
" 1043 4843 ASUS TV-FM 7133", |
" 1043 4845 TV-FM 7135", |
" 1043 4862 P7131 Dual", |
" 1131 2001 Proteus Pro [philips reference design]", |
" 1131 2018 Tiger reference design", |
" 1131 4ee9 MonsterTV Mobile", |
" 11bd 002b PCTV Stereo", |
" 11bd 002e PCTV 110i (saa7133)", |
" 12ab 0800 PURPLE TV", |
" 1421 0335 Instant TV DVB-T Cardbus", |
" 1421 1370 Instant TV (saa7135)", |
" 1435 7330 VFG7330", |
" 1435 7350 VFG7350", |
" 1461 1044 AVerTVHD MCE A180", |
" 1461 f31f Avermedia AVerTV GO 007 FM", |
" 1462 6231 TV@Anywhere plus", |
" 1489 0214 LifeView FlyTV Platinum FM", |
" 14c0 1212 LifeView FlyTV Platinum Mini2", |
" 153b 1160 Cinergy 250 PCI TV", |
" 153b 1162 Terratec Cinergy 400 mobile", |
" 185b c100 VideoMate TV", |
" 5168 0306 LifeView FlyDVB-T DUO", |
" 5168 0319 LifeView FlyDVB Trio", |
" 7134 SAA7134/SAA7135HL Video Broadcast Decoder", |
" 1019 4cb4 Elitegroup ECS TVP3XP FM1216 Tuner Card(PAL-BG,FM)", |
" 1043 0210 Digimatrix TV", |
" 1043 4840 ASUS TV-FM 7134", |
" 1131 2004 EUROPA V3 reference design", |
" 1131 4e85 SKNet Monster TV", |
" 1131 6752 EMPRESS", |
" 11bd 002b PCTV Stereo", |
" 11bd 002d PCTV 300i DVB-T + PAL", |
" 1461 2c00 AverTV Hybrid+FM PCI", |
" 1461 9715 AVerTV Studio 307", |
" 1461 a70a Avermedia AVerTV 307", |
" 1461 a70b AverMedia M156 / Medion 2819", |
" 1461 d6ee Cardbus TV/Radio (E500)", |
" 1471 b7e9 AVerTV Cardbus plus", |
" 153b 1142 Terratec Cinergy 400 TV", |
" 153b 1143 Terratec Cinergy 600 TV", |
" 153b 1158 Terratec Cinergy 600 TV MK3", |
" 1540 9524 ProVideo PV952", |
" 16be 0003 Medion 7134", |
" 185b c200 Compro VideoMate Gold+ Pal", |
" 185b c900 Videomate DVB-T300", |
" 1894 a006 KNC One TV-Station DVR", |
" 1894 fe01 KNC One TV-Station RDS / Typhoon TV Tuner RDS", |
" 7145 SAA7145", |
" 7146 SAA7146", |
" 110a 0000 Fujitsu/Siemens DVB-C card rev1.5", |
" 110a ffff Fujitsu/Siemens DVB-C card rev1.5", |
" 1131 4f56 KNC1 DVB-S Budget", |
" 1131 4f60 Fujitsu-Siemens Activy DVB-S Budget Rev AL", |
" 1131 4f61 Activy DVB-S Budget Rev GR", |
" 1131 5f61 Activy DVB-T Budget", |
" 114b 2003 DVRaptor Video Edit/Capture Card", |
" 11bd 0006 DV500 Overlay", |
" 11bd 000a DV500 Overlay", |
" 11bd 000f DV500 Overlay", |
" 13c2 0000 Siemens/Technotrend/Hauppauge DVB card rev1.3 or rev1.5", |
" 13c2 0001 Technotrend/Hauppauge DVB card rev1.3 or rev1.6", |
" 13c2 0002 Technotrend/Hauppauge DVB card rev2.1", |
" 13c2 0003 Technotrend/Hauppauge DVB card rev2.1", |
" 13c2 0004 Technotrend/Hauppauge DVB card rev2.1", |
" 13c2 0006 Technotrend/Hauppauge DVB card rev1.3 or rev1.6", |
" 13c2 0008 Technotrend/Hauppauge DVB-T", |
" 13c2 000a Octal/Technotrend DVB-C for iTV", |
" 13c2 1003 Technotrend-Budget/Hauppauge WinTV-NOVA-S DVB card", |
" 13c2 1004 Technotrend-Budget/Hauppauge WinTV-NOVA-C DVB card", |
" 13c2 1005 Technotrend-Budget/Hauppauge WinTV-NOVA-T DVB card", |
" 13c2 100c Technotrend-Budget/Hauppauge WinTV-NOVA-CI DVB card", |
" 13c2 100f Technotrend-Budget/Hauppauge WinTV-NOVA-CI DVB card", |
" 13c2 1011 Technotrend-Budget/Hauppauge WinTV-NOVA-T DVB card", |
" 13c2 1013 SATELCO Multimedia DVB", |
" 13c2 1016 WinTV-NOVA-SE DVB card", |
" 13c2 1102 Technotrend/Hauppauge DVB card rev2.1", |
" 153b 1156 Terratec Cynergy 1200C", |
" 9730 SAA9730 Integrated Multimedia and Peripheral Controller", |
"1132 Mitel Corp.", |
"1133 Eicon Networks Corporation", |
" 7901 EiconCard S90", |
" 7902 EiconCard S90", |
" 7911 EiconCard S91", |
" 7912 EiconCard S91", |
" 7941 EiconCard S94", |
" 7942 EiconCard S94", |
" 7943 EiconCard S94", |
" 7944 EiconCard S94", |
" b921 EiconCard P92", |
" b922 EiconCard P92", |
" b923 EiconCard P92", |
" e001 Diva Pro 2.0 S/T", |
" e002 Diva 2.0 S/T PCI", |
" e003 Diva Pro 2.0 U", |
" e004 Diva 2.0 U PCI", |
" e005 Diva 2.01 S/T PCI", |
" e006 Diva CT S/T PCI", |
" e007 Diva CT U PCI", |
" e008 Diva CT Lite S/T PCI", |
" e009 Diva CT Lite U PCI", |
" e00a Diva ISDN+V.90 PCI", |
" e00b Diva 2.02 PCI S/T", |
" e00c Diva 2.02 PCI U", |
" e00d Diva ISDN Pro 3.0 PCI", |
" e00e Diva ISDN+CT S/T PCI Rev 2", |
" e010 Diva Server BRI-2M PCI", |
" 110a 0021 Fujitsu Siemens ISDN S0", |
" e011 Diva Server BRI S/T Rev 2", |
" e012 Diva Server 4BRI-8M PCI", |
" e013 Diva Server 4BRI Rev 2", |
" 1133 1300 Diva Server V-4BRI-8", |
" 1133 e013 Diva Server 4BRI-8M 2.0 PCI", |
" e014 Diva Server PRI-30M PCI", |
" e015 DIVA Server PRI Rev 2", |
" 1133 e015 Diva Server PRI 2.0 PCI", |
" e016 Diva Server Voice 4BRI PCI", |
" e017 Diva Server Voice 4BRI Rev 2", |
" 1133 e017 Diva Server Voice 4BRI-8M 2.0 PCI", |
" e018 Diva Server BRI-2M 2.0 PCI", |
" 1133 1800 Diva Server V-BRI-2", |
" 1133 e018 Diva Server BRI-2M 2.0 PCI", |
" e019 Diva Server Voice PRI Rev 2", |
" 1133 e019 Diva Server Voice PRI 2.0 PCI", |
" e01a Diva Server 2FX", |
" e01b Diva Server Voice BRI-2M 2.0 PCI", |
" 1133 e01b Diva Server Voice BRI-2M 2.0 PCI", |
" e01c Diva Server PRI Rev 3", |
" 1133 1c01 Diva Server PRI/E1/T1-8", |
" 1133 1c02 Diva Server PRI/T1-24", |
" 1133 1c03 Diva Server PRI/E1-30", |
" 1133 1c04 Diva Server PRI/E1/T1", |
" 1133 1c05 Diva Server V-PRI/T1-24", |
" 1133 1c06 Diva Server V-PRI/E1-30", |
" 1133 1c07 Diva Server PRI/E1/T1-8 Cornet NQ", |
" 1133 1c08 Diva Server PRI/T1-24 Cornet NQ", |
" 1133 1c09 Diva Server PRI/E1-30 Cornet NQ", |
" 1133 1c0a Diva Server PRI/E1/T1 Cornet NQ", |
" 1133 1c0b Diva Server V-PRI/T1-24 Cornet NQ", |
" 1133 1c0c Diva Server V-PRI/E1-30 Cornet NQ", |
" e01e Diva Server 2PRI", |
" e020 Diva Server 4PRI", |
" e022 Diva Server Analog-2P", |
" e024 Diva Server Analog-4P", |
" 1133 2400 Diva Server V-Analog-4P", |
" 1133 e024 Diva Server Analog-4P", |
" e028 Diva Server Analog-8P", |
" 1133 2800 Diva Server V-Analog-8P", |
" 1133 e028 Diva Server Analog-8P", |
" e02a Diva Server IPM-300", |
" e02c Diva Server IPM-600", |
"1134 Mercury Computer Systems", |
" 0001 Raceway Bridge", |
" 0002 Dual PCI to RapidIO Bridge", |
"1135 Fuji Xerox Co Ltd", |
" 0001 Printer controller", |
"1136 Momentum Data Systems", |
"1137 Cisco Systems Inc", |
"1138 Ziatech Corporation", |
" 8905 8905 [STD 32 Bridge]", |
"1139 Dynamic Pictures, Inc", |
" 0001 VGA Compatable 3D Graphics", |
"113a FWB Inc", |
"113b Network Computing Devices", |
"113c Cyclone Microsystems, Inc.", |
" 0000 PCI-9060 i960 Bridge", |
" 0001 PCI-SDK [PCI i960 Evaluation Platform]", |
" 0911 PCI-911 [i960Jx-based Intelligent I/O Controller]", |
" 0912 PCI-912 [i960CF-based Intelligent I/O Controller]", |
" 0913 PCI-913", |
" 0914 PCI-914 [I/O Controller w/ secondary PCI bus]", |
"113d Leading Edge Products Inc", |
"113e Sanyo Electric Co - Computer Engineering Dept", |
"113f Equinox Systems, Inc.", |
" 0808 SST-64P Adapter", |
" 1010 SST-128P Adapter", |
" 80c0 SST-16P DB Adapter", |
" 80c4 SST-16P RJ Adapter", |
" 80c8 SST-16P Adapter", |
" 8888 SST-4P Adapter", |
" 9090 SST-8P Adapter", |
"1140 Intervoice Inc", |
"1141 Crest Microsystem Inc", |
"1142 Alliance Semiconductor Corporation", |
" 3210 AP6410", |
" 6422 ProVideo 6422", |
" 6424 ProVideo 6424", |
" 6425 ProMotion AT25", |
" 643d ProMotion AT3D", |
"1143 NetPower, Inc", |
"1144 Cincinnati Milacron", |
" 0001 Noservo controller", |
"1145 Workbit Corporation", |
" 8007 NinjaSCSI-32 Workbit", |
" f007 NinjaSCSI-32 KME", |
" f010 NinjaSCSI-32 Workbit", |
" f012 NinjaSCSI-32 Logitec", |
" f013 NinjaSCSI-32 Logitec", |
" f015 NinjaSCSI-32 Melco", |
" f020 NinjaSCSI-32 Sony PCGA-DVD51", |
"1146 Force Computers", |
"1147 Interface Corp", |
"1148 SysKonnect", |
" 4000 FDDI Adapter", |
" 0e11 b03b Netelligent 100 FDDI DAS Fibre SC", |
" 0e11 b03c Netelligent 100 FDDI SAS Fibre SC", |
" 0e11 b03d Netelligent 100 FDDI DAS UTP", |
" 0e11 b03e Netelligent 100 FDDI SAS UTP", |
" 0e11 b03f Netelligent 100 FDDI SAS Fibre MIC", |
" 1148 5521 FDDI SK-5521 (SK-NET FDDI-UP)", |
" 1148 5522 FDDI SK-5522 (SK-NET FDDI-UP DAS)", |
" 1148 5541 FDDI SK-5541 (SK-NET FDDI-FP)", |
" 1148 5543 FDDI SK-5543 (SK-NET FDDI-LP)", |
" 1148 5544 FDDI SK-5544 (SK-NET FDDI-LP DAS)", |
" 1148 5821 FDDI SK-5821 (SK-NET FDDI-UP64)", |
" 1148 5822 FDDI SK-5822 (SK-NET FDDI-UP64 DAS)", |
" 1148 5841 FDDI SK-5841 (SK-NET FDDI-FP64)", |
" 1148 5843 FDDI SK-5843 (SK-NET FDDI-LP64)", |
" 1148 5844 FDDI SK-5844 (SK-NET FDDI-LP64 DAS)", |
" 4200 Token Ring adapter", |
" 4300 SK-9872 Gigabit Ethernet Server Adapter (SK-NET GE-ZX dual link)", |
" 1148 9821 SK-9821 Gigabit Ethernet Server Adapter (SK-NET GE-T)", |
" 1148 9822 SK-9822 Gigabit Ethernet Server Adapter (SK-NET GE-T dual link)", |
" 1148 9841 SK-9841 Gigabit Ethernet Server Adapter (SK-NET GE-LX)", |
" 1148 9842 SK-9842 Gigabit Ethernet Server Adapter (SK-NET GE-LX dual link)", |
" 1148 9843 SK-9843 Gigabit Ethernet Server Adapter (SK-NET GE-SX)", |
" 1148 9844 SK-9844 Gigabit Ethernet Server Adapter (SK-NET GE-SX dual link)", |
" 1148 9861 SK-9861 Gigabit Ethernet Server Adapter (SK-NET GE-SX Volition)", |
" 1148 9862 SK-9862 Gigabit Ethernet Server Adapter (SK-NET GE-SX Volition dual link)", |
" 1148 9871 SK-9871 Gigabit Ethernet Server Adapter (SK-NET GE-ZX)", |
" 1148 9872 SK-9872 Gigabit Ethernet Server Adapter (SK-NET GE-ZX dual link)", |
" 1259 2970 AT-2970SX Gigabit Ethernet Adapter", |
" 1259 2971 AT-2970LX Gigabit Ethernet Adapter", |
" 1259 2972 AT-2970TX Gigabit Ethernet Adapter", |
" 1259 2973 AT-2971SX Gigabit Ethernet Adapter", |
" 1259 2974 AT-2971T Gigabit Ethernet Adapter", |
" 1259 2975 AT-2970SX/2SC Gigabit Ethernet Adapter", |
" 1259 2976 AT-2970LX/2SC Gigabit Ethernet Adapter", |
" 1259 2977 AT-2970TX/2TX Gigabit Ethernet Adapter", |
" 4320 SK-9871 V2.0 Gigabit Ethernet 1000Base-ZX Adapter, PCI64, Fiber ZX/SC", |
" 1148 0121 Marvell RDK-8001 Adapter", |
" 1148 0221 Marvell RDK-8002 Adapter", |
" 1148 0321 Marvell RDK-8003 Adapter", |
" 1148 0421 Marvell RDK-8004 Adapter", |
" 1148 0621 Marvell RDK-8006 Adapter", |
" 1148 0721 Marvell RDK-8007 Adapter", |
" 1148 0821 Marvell RDK-8008 Adapter", |
" 1148 0921 Marvell RDK-8009 Adapter", |
" 1148 1121 Marvell RDK-8011 Adapter", |
" 1148 1221 Marvell RDK-8012 Adapter", |
" 1148 3221 SK-9521 V2.0 10/100/1000Base-T Adapter", |
" 1148 5021 SK-9821 V2.0 Gigabit Ethernet 10/100/1000Base-T Adapter", |
" 1148 5041 SK-9841 V2.0 Gigabit Ethernet 1000Base-LX Adapter", |
" 1148 5043 SK-9843 V2.0 Gigabit Ethernet 1000Base-SX Adapter", |
" 1148 5051 SK-9851 V2.0 Gigabit Ethernet 1000Base-SX Adapter", |
" 1148 5061 SK-9861 V2.0 Gigabit Ethernet 1000Base-SX Adapter", |
" 1148 5071 SK-9871 V2.0 Gigabit Ethernet 1000Base-ZX Adapter", |
" 1148 9521 SK-9521 10/100/1000Base-T Adapter", |
" 4400 SK-9Dxx Gigabit Ethernet Adapter", |
" 4500 SK-9Mxx Gigabit Ethernet Adapter", |
" 9000 SK-9S21 10/100/1000Base-T Server Adapter, PCI-X, Copper RJ-45", |
" 9843 [Fujitsu] Gigabit Ethernet", |
" 9e00 SK-9E21D 10/100/1000Base-T Adapter, Copper RJ-45", |
" 1148 2100 SK-9E21 Server Adapter", |
" 1148 21d0 SK-9E21D 10/100/1000Base-T Adapter", |
" 1148 2200 SK-9E22 Server Adapter", |
" 1148 8100 SK-9E81 Server Adapter", |
" 1148 8200 SK-9E82 Server Adapter", |
" 1148 9100 SK-9E91 Server Adapter", |
" 1148 9200 SK-9E92 Server Adapter", |
"1149 Win System Corporation", |
"114a VMIC", |
" 5579 VMIPCI-5579 (Reflective Memory Card)", |
" 5587 VMIPCI-5587 (Reflective Memory Card)", |
" 6504 VMIC PCI 7755 FPGA", |
" 7587 VMIVME-7587", |
"114b Canopus Co., Ltd", |
"114c Annabooks", |
"114d IC Corporation", |
"114e Nikon Systems Inc", |
"114f Digi International", |
" 0002 AccelePort EPC", |
" 0003 RightSwitch SE-6", |
" 0004 AccelePort Xem", |
" 0005 AccelePort Xr", |
" 0006 AccelePort Xr,C/X", |
" 0009 AccelePort Xr/J", |
" 000a AccelePort EPC/J", |
" 000c DataFirePRIme T1 (1-port)", |
" 000d SyncPort 2-Port (x.25/FR)", |
" 0011 AccelePort 8r EIA-232 (IBM)", |
" 0012 AccelePort 8r EIA-422", |
" 0014 AccelePort 8r EIA-422", |
" 0015 AccelePort Xem", |
" 0016 AccelePort EPC/X", |
" 0017 AccelePort C/X", |
" 001a DataFirePRIme E1 (1-port)", |
" 001b AccelePort C/X (IBM)", |
" 001d DataFire RAS T1/E1/PRI", |
" 114f 0050 DataFire RAS E1 Adapter", |
" 114f 0051 DataFire RAS Dual E1 Adapter", |
" 114f 0052 DataFire RAS T1 Adapter", |
" 114f 0053 DataFire RAS Dual T1 Adapter", |
" 0023 AccelePort RAS", |
" 0024 DataFire RAS B4 ST/U", |
" 114f 0030 DataFire RAS BRI U Adapter", |
" 114f 0031 DataFire RAS BRI S/T Adapter", |
" 0026 AccelePort 4r 920", |
" 0027 AccelePort Xr 920", |
" 0028 ClassicBoard 4", |
" 0029 ClassicBoard 8", |
" 0034 AccelePort 2r 920", |
" 0035 DataFire DSP T1/E1/PRI cPCI", |
" 0040 AccelePort Xp", |
" 0042 AccelePort 2p", |
" 0043 AccelePort 4p", |
" 0044 AccelePort 8p", |
" 0045 AccelePort 16p", |
" 004e AccelePort 32p", |
" 0070 Datafire Micro V IOM2 (Europe)", |
" 0071 Datafire Micro V (Europe)", |
" 0072 Datafire Micro V IOM2 (North America)", |
" 0073 Datafire Micro V (North America)", |
" 00b0 Digi Neo 4", |
" 00b1 Digi Neo 8", |
" 00c8 Digi Neo 2 DB9", |
" 00c9 Digi Neo 2 DB9 PRI", |
" 00ca Digi Neo 2 RJ45", |
" 00cb Digi Neo 2 RJ45 PRI", |
" 00d0 ClassicBoard 4 422", |
" 00d1 ClassicBoard 8 422", |
" 6001 Avanstar", |
"1150 Thinking Machines Corp", |
"1151 JAE Electronics Inc.", |
"1152 Megatek", |
"1153 Land Win Electronic Corp", |
"1154 Melco Inc", |
"1155 Pine Technology Ltd", |
"1156 Periscope Engineering", |
"1157 Avsys Corporation", |
"1158 Voarx R & D Inc", |
" 3011 Tokenet/vg 1001/10m anylan", |
" 9050 Lanfleet/Truevalue", |
" 9051 Lanfleet/Truevalue", |
"1159 Mutech Corp", |
" 0001 MV-1000", |
"115a Harlequin Ltd", |
"115b Parallax Graphics", |
"115c Photron Ltd.", |
"115d Xircom", |
" 0003 Cardbus Ethernet 10/100", |
" 1014 0181 10/100 EtherJet Cardbus Adapter", |
" 1014 1181 10/100 EtherJet Cardbus Adapter", |
" 1014 8181 10/100 EtherJet Cardbus Adapter", |
" 1014 9181 10/100 EtherJet Cardbus Adapter", |
" 115d 0181 Cardbus Ethernet 10/100", |
" 115d 0182 RealPort2 CardBus Ethernet 10/100 (R2BE-100)", |
" 115d 1181 Cardbus Ethernet 10/100", |
" 1179 0181 Cardbus Ethernet 10/100", |
" 8086 8181 EtherExpress PRO/100 Mobile CardBus 32 Adapter", |
" 8086 9181 EtherExpress PRO/100 Mobile CardBus 32 Adapter", |
" 0005 Cardbus Ethernet 10/100", |
" 1014 0182 10/100 EtherJet Cardbus Adapter", |
" 1014 1182 10/100 EtherJet Cardbus Adapter", |
" 115d 0182 Cardbus Ethernet 10/100", |
" 115d 1182 Cardbus Ethernet 10/100", |
" 0007 Cardbus Ethernet 10/100", |
" 1014 0182 10/100 EtherJet Cardbus Adapter", |
" 1014 1182 10/100 EtherJet Cardbus Adapter", |
" 115d 0182 Cardbus Ethernet 10/100", |
" 115d 1182 Cardbus Ethernet 10/100", |
" 000b Cardbus Ethernet 10/100", |
" 1014 0183 10/100 EtherJet Cardbus Adapter", |
" 115d 0183 Cardbus Ethernet 10/100", |
" 000c Mini-PCI V.90 56k Modem", |
" 000f Cardbus Ethernet 10/100", |
" 1014 0183 10/100 EtherJet Cardbus Adapter", |
" 115d 0183 Cardbus Ethernet 10/100", |
" 00d4 Mini-PCI K56Flex Modem", |
" 0101 Cardbus 56k modem", |
" 115d 1081 Cardbus 56k Modem", |
" 0103 Cardbus Ethernet + 56k Modem", |
" 1014 9181 Cardbus 56k Modem", |
" 1115 1181 Cardbus Ethernet 100 + 56k Modem", |
" 115d 1181 CBEM56G-100 Ethernet + 56k Modem", |
" 8086 9181 PRO/100 LAN + Modem56 CardBus", |
"115e Peer Protocols Inc", |
"115f Maxtor Corporation", |
"1160 Megasoft Inc", |
"1161 PFU Limited", |
"1162 OA Laboratory Co Ltd", |
"1163 Rendition", |
" 0001 Verite 1000", |
" 2000 Verite V2000/V2100/V2200", |
" 1092 2000 Stealth II S220", |
"1164 Advanced Peripherals Technologies", |
"1165 Imagraph Corporation", |
" 0001 Motion TPEG Recorder/Player with audio", |
"1166 Broadcom", |
" 0000 CMIC-LE", |
" 0005 CNB20-LE Host Bridge", |
" 0006 CNB20HE Host Bridge", |
" 0007 CNB20-LE Host Bridge", |
" 0008 CNB20HE Host Bridge", |
" 0009 CNB20LE Host Bridge", |
" 0010 CIOB30", |
" 0011 CMIC-HE", |
" 0012 CMIC-WS Host Bridge (GC-LE chipset)", |
" 0013 CNB20-HE Host Bridge", |
" 0014 CMIC-LE Host Bridge (GC-LE chipset)", |
" 0015 CMIC-GC Host Bridge", |
" 0016 CMIC-GC Host Bridge", |
" 0017 GCNB-LE Host Bridge", |
" 0036 HT1000 PCI/PCI-X bridge", |
" 0101 CIOB-X2 PCI-X I/O Bridge", |
" 0104 HT1000 PCI/PCI-X bridge", |
" 0110 CIOB-E I/O Bridge with Gigabit Ethernet", |
" 0130 HT1000 PCI-X bridge", |
" 0132 HT1000 PCI-Express bridge", |
" 0200 OSB4 South Bridge", |
" 0201 CSB5 South Bridge", |
" 4c53 1080 CT8 mainboard", |
" 0203 CSB6 South Bridge", |
" 1734 1012 Primergy RX300", |
" 0205 HT1000 Legacy South Bridge", |
" 0211 OSB4 IDE Controller", |
" 0212 CSB5 IDE Controller", |
" 4c53 1080 CT8 mainboard", |
" 0213 CSB6 RAID/IDE Controller", |
" 1028 c134 Poweredge SC600", |
" 1734 1012 Primergy RX300", |
" 0214 HT1000 Legacy IDE controller", |
" 0217 CSB6 IDE Controller", |
" 1028 4134 Poweredge SC600", |
" 0220 OSB4/CSB5 OHCI USB Controller", |
" 4c53 1080 CT8 mainboard", |
" 0221 CSB6 OHCI USB Controller", |
" 1734 1012 Primergy RX300", |
" 0223 HT1000 USB Controller", |
" 0225 CSB5 LPC bridge", |
" 0227 GCLE-2 Host Bridge", |
" 1734 1012 Primergy RX300", |
" 0230 CSB5 LPC bridge", |
" 4c53 1080 CT8 mainboard", |
" 0234 HT1000 LPC Bridge", |
" 0240 K2 SATA", |
" 0241 RAIDCore RC4000", |
" 0242 RAIDCore BC4000", |
" 024a BCM5785 (HT1000) SATA Native SATA Mode", |
" 024b BCM5785 (HT1000) PATA/IDE Mode", |
"1167 Mutoh Industries Inc", |
"1168 Thine Electronics Inc", |
"1169 Centre for Development of Advanced Computing", |
"116a Polaris Communications", |
" 6100 Bus/Tag Channel", |
" 6800 Escon Channel", |
" 7100 Bus/Tag Channel", |
" 7800 Escon Channel", |
"116b Connectware Inc", |
"116c Intelligent Resources Integrated Systems", |
"116d Martin-Marietta", |
"116e Electronics for Imaging", |
"116f Workstation Technology", |
"1170 Inventec Corporation", |
"1171 Loughborough Sound Images Plc", |
"1172 Altera Corporation", |
"1173 Adobe Systems, Inc", |
"1174 Bridgeport Machines", |
"1175 Mitron Computer Inc.", |
"1176 SBE Incorporated", |
"1177 Silicon Engineering", |
"1178 Alfa, Inc.", |
" afa1 Fast Ethernet Adapter", |
"1179 Toshiba America Info Systems", |
" 0102 Extended IDE Controller", |
" 0103 EX-IDE Type-B", |
" 0404 DVD Decoder card", |
" 0406 Tecra Video Capture device", |
" 0407 DVD Decoder card (Version 2)", |
" 0601 CPU to PCI bridge", |
" 1179 0001 Satellite Pro", |
" 0603 ToPIC95 PCI to CardBus Bridge for Notebooks", |
" 060a ToPIC95", |
" 1179 0001 Satellite Pro", |
" 060f ToPIC97", |
" 0617 ToPIC100 PCI to Cardbus Bridge with ZV Support", |
" 0618 CPU to PCI and PCI to ISA bridge", |
" 0701 FIR Port", |
" 0804 TC6371AF SmartMedia Controller", |
" 0805 SD TypA Controller", |
" 0d01 FIR Port Type-DO", |
" 1179 0001 FIR Port Type-DO", |
"117a A-Trend Technology", |
"117b L G Electronics, Inc.", |
"117c Atto Technology", |
" 0030 Ultra320 SCSI Host Adapter", |
" 117c 8013 ExpressPCI UL4D", |
" 117c 8014 ExpressPCI UL4S", |
"117d Becton & Dickinson", |
"117e T/R Systems", |
"117f Integrated Circuit Systems", |
"1180 Ricoh Co Ltd", |
" 0465 RL5c465", |
" 0466 RL5c466", |
" 0475 RL5c475", |
" 144d c006 vpr Matrix 170B4 CardBus bridge", |
" 0476 RL5c476 II", |
" 1014 0185 ThinkPad A/T/X Series", |
" 1028 0188 Inspiron 6000 laptop", |
" 1043 1967 V6800V", |
" 1043 1987 Asus A4K and Z81K notebooks, possibly others ( mid-2005 machines )", |
" 104d 80df Vaio PCG-FX403", |
" 104d 80e7 VAIO PCG-GR214EP/GR214MP/GR215MP/GR314MP/GR315MP", |
" 144d c00c P35 notebook", |
" 14ef 0220 PCD-RP-220S", |
" 17aa 201c Thinkpad X60s", |
" 0477 RL5c477", |
" 0478 RL5c478", |
" 1014 0184 ThinkPad A30p (2653-64G)", |
" 0511 R5C511", |
" 0522 R5C522 IEEE 1394 Controller", |
" 1014 01cf ThinkPad A30p (2653-64G)", |
" 1043 1967 V6800V", |
" 0551 R5C551 IEEE 1394 Controller", |
" 144d c006 vpr Matrix 170B4", |
" 0552 R5C552 IEEE 1394 Controller", |
" 1014 0511 ThinkPad A/T/X Series", |
" 1028 0188 Inspiron 6000 laptop", |
" 144d c00c P35 notebook", |
" 17aa 201e Thinkpad X60s", |
" 0554 R5C554", |
" 0575 R5C575 SD Bus Host Adapter", |
" 0576 R5C576 SD Bus Host Adapter", |
" 0592 R5C592 Memory Stick Bus Host Adapter", |
" 1043 1967 V6800V", |
" 144d c018 X20 IV", |
" 0811 R5C811", |
" 0822 R5C822 SD/SDIO/MMC/MS/MSPro Host Adapter", |
" 1014 0556 Thinkpad X40", |
" 1014 0598 Thinkpad Z60m", |
" 1028 0188 Inspiron 6000 laptop", |
" 1028 01a2 Inspiron 9200", |
" 1043 1967 ASUS V6800V", |
" 144d c018 X20 IV", |
" 17aa 201d Thinkpad X60s", |
" 0841 R5C841 CardBus/SD/SDIO/MMC/MS/MSPro/xD/IEEE1394", |
" 0852 xD-Picture Card Controller", |
" 1043 1967 V6800V", |
"1181 Telmatics International", |
"1183 Fujikura Ltd", |
"1184 Forks Inc", |
"1185 Dataworld International Ltd", |
"1186 D-Link System Inc", |
" 0100 DC21041", |
" 1002 DL10050 Sundance Ethernet", |
" 1186 1002 DFE-550TX", |
" 1186 1012 DFE-580TX", |
" 1025 AirPlus Xtreme G DWL-G650 Adapter", |
" 1026 AirXpert DWL-AG650 Wireless Cardbus Adapter", |
" 1043 AirXpert DWL-AG650 Wireless Cardbus Adapter", |
" 1300 RTL8139 Ethernet", |
" 1186 1300 DFE-538TX 10/100 Ethernet Adapter", |
" 1186 1301 DFE-530TX+ 10/100 Ethernet Adapter", |
" 1186 1303 DFE-528TX 10/100 Fast Ethernet PCI Adapter", |
" 1340 DFE-690TXD CardBus PC Card", |
" 1541 DFE-680TXD CardBus PC Card", |
" 1561 DRP-32TXD Cardbus PC Card", |
" 2027 AirPlus Xtreme G DWL-G520 Adapter", |
" 3203 AirPlus Xtreme G DWL-G520 Adapter", |
" 3300 DWL-510 2.4GHz Wireless PCI Adapter", |
" 3a03 AirPro DWL-A650 Wireless Cardbus Adapter(rev.B)", |
" 3a04 AirPro DWL-AB650 Multimode Wireless Cardbus Adapter", |
" 3a05 AirPro DWL-AB520 Multimode Wireless PCI Adapter", |
" 3a07 AirXpert DWL-AG650 Wireless Cardbus Adapter", |
" 3a08 AirXpert DWL-AG520 Wireless PCI Adapter", |
" 3a10 AirXpert DWL-AG650 Wireless Cardbus Adapter(rev.B)", |
" 3a11 AirXpert DWL-AG520 Wireless PCI Adapter(rev.B)", |
" 3a12 AirPlus DWL-G650 Wireless Cardbus Adapter(rev.C)", |
" 3a13 AirPlus DWL-G520 Wireless PCI Adapter(rev.B)", |
" 3a14 AirPremier DWL-AG530 Wireless PCI Adapter", |
" 3a63 AirXpert DWL-AG660 Wireless Cardbus Adapter", |
" 4000 DL2000-based Gigabit Ethernet", |
" 4300 DGE-528T Gigabit Ethernet Adapter", |
" 4b01 DGE-530T Gigabit Ethernet Adapter (rev 11)", |
" 4c00 Gigabit Ethernet Adapter", |
" 1186 4c00 DGE-530T Gigabit Ethernet Adapter", |
" 8400 D-Link DWL-650+ CardBus PC Card", |
"1187 Advanced Technology Laboratories, Inc.", |
"1188 Shima Seiki Manufacturing Ltd.", |
"1189 Matsushita Electronics Co Ltd", |
"118a Hilevel Technology", |
"118b Hypertec Pty Limited", |
"118c Corollary, Inc", |
" 0014 PCIB [C-bus II to PCI bus host bridge chip]", |
" 1117 Intel 8-way XEON Profusion Chipset [Cache Coherency Filter]", |
"118d BitFlow Inc", |
" 0001 Raptor-PCI framegrabber", |
" 0012 Model 12 Road Runner Frame Grabber", |
" 0014 Model 14 Road Runner Frame Grabber", |
" 0024 Model 24 Road Runner Frame Grabber", |
" 0044 Model 44 Road Runner Frame Grabber", |
" 0112 Model 12 Road Runner Frame Grabber", |
" 0114 Model 14 Road Runner Frame Grabber", |
" 0124 Model 24 Road Runner Frame Grabber", |
" 0144 Model 44 Road Runner Frame Grabber", |
" 0212 Model 12 Road Runner Frame Grabber", |
" 0214 Model 14 Road Runner Frame Grabber", |
" 0224 Model 24 Road Runner Frame Grabber", |
" 0244 Model 44 Road Runner Frame Grabber", |
" 0312 Model 12 Road Runner Frame Grabber", |
" 0314 Model 14 Road Runner Frame Grabber", |
" 0324 Model 24 Road Runner Frame Grabber", |
" 0344 Model 44 Road Runner Frame Grabber", |
"118e Hermstedt GmbH", |
"118f Green Logic", |
"1190 Tripace", |
" c731 TP-910/920/940 PCI Ultra(Wide) SCSI Adapter", |
"1191 Artop Electronic Corp", |
" 0003 SCSI Cache Host Adapter", |
" 0004 ATP8400", |
" 0005 ATP850UF", |
" 0006 ATP860 NO-BIOS", |
" 0007 ATP860", |
" 0008 ATP865 NO-ROM", |
" 0009 ATP865", |
" 8002 AEC6710 SCSI-2 Host Adapter", |
" 8010 AEC6712UW SCSI", |
" 8020 AEC6712U SCSI", |
" 8030 AEC6712S SCSI", |
" 8040 AEC6712D SCSI", |
" 8050 AEC6712SUW SCSI", |
" 8060 AEC6712 SCSI", |
" 8080 AEC67160 SCSI", |
" 8081 AEC67160S SCSI", |
" 808a AEC67162 2-ch. LVD SCSI", |
"1192 Densan Company Ltd", |
"1193 Zeitnet Inc.", |
" 0001 1221", |
" 0002 1225", |
"1194 Toucan Technology", |
"1195 Ratoc System Inc", |
"1196 Hytec Electronics Ltd", |
"1197 Gage Applied Sciences, Inc.", |
" 010c CompuScope 82G 8bit 2GS/s Analog Input Card", |
"1198 Lambda Systems Inc", |
"1199 Attachmate Corporation", |
"119a Mind Share, Inc.", |
"119b Omega Micro Inc.", |
" 1221 82C092G", |
"119c Information Technology Inst.", |
"119d Bug, Inc. Sapporo Japan", |
"119e Fujitsu Microelectronics Ltd.", |
" 0001 FireStream 155", |
" 0003 FireStream 50", |
"119f Bull HN Information Systems", |
"11a0 Convex Computer Corporation", |
"11a1 Hamamatsu Photonics K.K.", |
"11a2 Sierra Research and Technology", |
"11a3 Deuretzbacher GmbH & Co. Eng. KG", |
"11a4 Barco Graphics NV", |
"11a5 Microunity Systems Eng. Inc", |
"11a6 Pure Data Ltd.", |
"11a7 Power Computing Corp.", |
"11a8 Systech Corp.", |
"11a9 InnoSys Inc.", |
" 4240 AMCC S933Q Intelligent Serial Card", |
"11aa Actel", |
"11ab Marvell Technology Group Ltd.", |
" 0146 GT-64010/64010A System Controller", |
" 138f W8300 802.11 Adapter (rev 07)", |
" 1fa6 Marvell W8300 802.11 Adapter", |
" 1fa7 88W8310 and 88W8000G [Libertas] 802.11g client chipset", |
" 1faa 88w8335 [Libertas] 802.11b/g Wireless", |
" 1385 4e00 WG511 v2 54MBit/ Wireless PC-Card", |
" 4320 88E8001 Gigabit Ethernet Controller", |
" 1019 0f38 Marvell 88E8001 Gigabit Ethernet Controller (ECS)", |
" 1019 8001 Marvell 88E8001 Gigabit Ethernet Controller (ECS)", |
" 1043 173c Marvell 88E8001 Gigabit Ethernet Controller (Asus)", |
" 1043 811a Marvell 88E8001 Gigabit Ethernet Controller (Asus)", |
" 105b 0c19 Marvell 88E8001 Gigabit Ethernet Controller (Foxconn)", |
" 10b8 b452 EZ Card 1000 (SMC9452TXV.2)", |
" 11ab 0121 Marvell RDK-8001", |
" 11ab 0321 Marvell RDK-8003", |
" 11ab 1021 Marvell RDK-8010", |
" 11ab 4320 Marvell Yukon Gigabit Ethernet 10/100/1000Baset-T Constroller (Asus)", |
" 11ab 5021 Marvell Yukon Gigabit Ethernet 10/100/1000Base-T Controller (64 bit)", |
" 11ab 9521 Marvell Yukon Gigabit Ethernet 10/100/1000Base-T Controller (32 bit)", |
" 1458 e000 Marvell 88E8001 Gigabit Ethernet Controller (Gigabyte)", |
" 147b 1406 Marvell 88E8001 Gigabit Ethernet Controller (Abit)", |
" 15d4 0047 Marvell 88E8001 Gigabit Ethernet Controller (Iwill)", |
" 1695 9025 Marvell 88E8001 Gigabit Ethernet Controller (Epox)", |
" 17f2 1c03 Marvell 88E8001 Gigabit Ethernet Controller (Albatron)", |
" 270f 2803 Marvell 88E8001 Gigabit Ethernet Controller (Chaintech)", |
" 4340 88E8021 PCI-X IPMI Gigabit Ethernet Controller", |
" 4341 88E8022 PCI-X IPMI Gigabit Ethernet Controller", |
" 4342 88E8061 PCI-E IPMI Gigabit Ethernet Controller", |
" 4343 88E8062 PCI-E IPMI Gigabit Ethernet Controller", |
" 4344 88E8021 PCI-X IPMI Gigabit Ethernet Controller", |
" 4345 88E8022 PCI-X IPMI Gigabit Ethernet Controller", |
" 4346 88E8061 PCI-E IPMI Gigabit Ethernet Controller", |
" 4347 88E8062 PCI-E IPMI Gigabit Ethernet Controller", |
" 4350 88E8035 PCI-E Fast Ethernet Controller", |
" 1179 0001 Marvell 88E8035 Fast Ethernet Controller (Toshiba)", |
" 11ab 3521 Marvell RDK-8035", |
" 1854 000d Marvell 88E8035 Fast Ethernet Controller (LGE)", |
" 1854 000e Marvell 88E8035 Fast Ethernet Controller (LGE)", |
" 1854 000f Marvell 88E8035 Fast Ethernet Controller (LGE)", |
" 1854 0011 Marvell 88E8035 Fast Ethernet Controller (LGE)", |
" 1854 0012 Marvell 88E8035 Fast Ethernet Controller (LGE)", |
" 1854 0016 Marvell 88E8035 Fast Ethernet Controller (LGE)", |
" 1854 0017 Marvell 88E8035 Fast Ethernet Controller (LGE)", |
" 1854 0018 Marvell 88E8035 Fast Ethernet Controller (LGE)", |
" 1854 0019 Marvell 88E8035 Fast Ethernet Controller (LGE)", |
" 1854 001c Marvell 88E8035 Fast Ethernet Controller (LGE)", |
" 1854 001e Marvell 88E8035 Fast Ethernet Controller (LGE)", |
" 1854 0020 Marvell 88E8035 Fast Ethernet Controller (LGE)", |
" 4351 88E8036 PCI-E Fast Ethernet Controller", |
" 107b 4009 Marvell 88E8036 Fast Ethernet Controller (Wistron)", |
" 10f7 8338 Marvell 88E8036 Fast Ethernet Controller (Panasonic)", |
" 1179 0001 Marvell 88E8036 Fast Ethernet Controller (Toshiba)", |
" 1179 ff00 Marvell 88E8036 Fast Ethernet Controller (Compal)", |
" 1179 ff10 Marvell 88E8036 Fast Ethernet Controller (Inventec)", |
" 11ab 3621 Marvell RDK-8036", |
" 13d1 ac12 Abocom EFE3K - 10/100 Ethernet Expresscard", |
" 161f 203d Marvell 88E8036 Fast Ethernet Controller (Arima)", |
" 1854 000d Marvell 88E8036 Fast Ethernet Controller (LGE)", |
" 1854 000e Marvell 88E8036 Fast Ethernet Controller (LGE)", |
" 1854 000f Marvell 88E8036 Fast Ethernet Controller (LGE)", |
" 1854 0011 Marvell 88E8036 Fast Ethernet Controller (LGE)", |
" 1854 0012 Marvell 88E8036 Fast Ethernet Controller (LGE)", |
" 1854 0016 Marvell 88E8036 Fast Ethernet Controller (LGE)", |
" 1854 0017 Marvell 88E8036 Fast Ethernet Controller (LGE)", |
" 1854 0018 Marvell 88E8036 Fast Ethernet Controller (LGE)", |
" 1854 0019 Marvell 88E8036 Fast Ethernet Controller (LGE)", |
" 1854 001c Marvell 88E8036 Fast Ethernet Controller (LGE)", |
" 1854 001e Marvell 88E8036 Fast Ethernet Controller (LGE)", |
" 1854 0020 Marvell 88E8036 Fast Ethernet Controller (LGE)", |
" 4352 88E8038 PCI-E Fast Ethernet Controller", |
" 4360 88E8052 PCI-E ASF Gigabit Ethernet Controller", |
" 1043 8134 Marvell 88E8052 Gigabit Ethernet Controller (Asus)", |
" 107b 4009 Marvell 88E8052 Gigabit Ethernet Controller (Wistron)", |
" 11ab 5221 Marvell RDK-8052", |
" 1458 e000 Marvell 88E8052 Gigabit Ethernet Controller (Gigabyte)", |
" 1462 052c Marvell 88E8052 Gigabit Ethernet Controller (MSI)", |
" 1849 8052 Marvell 88E8052 Gigabit Ethernet Controller (ASRock)", |
" a0a0 0509 Marvell 88E8052 Gigabit Ethernet Controller (Aopen)", |
" 4361 88E8050 PCI-E ASF Gigabit Ethernet Controller", |
" 107b 3015 Marvell 88E8050 Gigabit Ethernet Controller (Gateway)", |
" 11ab 5021 Marvell 88E8050 Gigabit Ethernet Controller (Intel)", |
" 8086 3063 D925XCVLK mainboard", |
" 8086 3439 Marvell 88E8050 Gigabit Ethernet Controller (Intel)", |
" 4362 88E8053 PCI-E Gigabit Ethernet Controller", |
" 103c 2a0d Marvell 88E8053 Gigabit Ethernet Controller (Asus)", |
" 1043 8142 Marvell 88E8053 Gigabit Ethernet controller PCIe (Asus)", |
" 109f 3197 Marvell 88E8053 Gigabit Ethernet Controller (Trigem)", |
" 10f7 8338 Marvell 88E8053 Gigabit Ethernet Controller (Panasonic)", |
" 10fd a430 Marvell 88E8053 Gigabit Ethernet Controller (SOYO)", |
" 1179 0001 Marvell 88E8053 Gigabit Ethernet Controller (Toshiba)", |
" 1179 ff00 Marvell 88E8053 Gigabit Ethernet Controller (Compal)", |
" 1179 ff10 Marvell 88E8053 Gigabit Ethernet Controller (Inventec)", |
" 11ab 5321 Marvell RDK-8053", |
" 1297 c240 Marvell 88E8053 Gigabit Ethernet Controller (Shuttle)", |
" 1297 c241 Marvell 88E8053 Gigabit Ethernet Controller (Shuttle)", |
" 1297 c242 Marvell 88E8053 Gigabit Ethernet Controller (Shuttle)", |
" 1297 c243 Marvell 88E8053 Gigabit Ethernet Controller (Shuttle)", |
" 1297 c244 Marvell 88E8053 Gigabit Ethernet Controller (Shuttle)", |
" 13d1 ac11 EGE5K - Giga Ethernet Expresscard", |
" 1458 e000 Marvell 88E8053 Gigabit Ethernet Controller (Gigabyte)", |
" 1462 058c Marvell 88E8053 Gigabit Ethernet Controller (MSI)", |
" 14c0 0012 Marvell 88E8053 Gigabit Ethernet Controller (Compal)", |
" 1558 04a0 Marvell 88E8053 Gigabit Ethernet Controller (Clevo)", |
" 15bd 1003 Marvell 88E8053 Gigabit Ethernet Controller (DFI)", |
" 161f 203c Marvell 88E8053 Gigabit Ethernet Controller (Arima)", |
" 161f 203d Marvell 88E8053 Gigabit Ethernet Controller (Arima)", |
" 1695 9029 Marvell 88E8053 Gigabit Ethernet Controller (Epox)", |
" 17f2 2c08 Marvell 88E8053 Gigabit Ethernet Controller (Albatron)", |
" 17ff 0585 Marvell 88E8053 Gigabit Ethernet Controller (Quanta)", |
" 1849 8053 Marvell 88E8053 Gigabit Ethernet Controller (ASRock)", |
" 1854 000b Marvell 88E8053 Gigabit Ethernet Controller (LGE)", |
" 1854 000c Marvell 88E8053 Gigabit Ethernet Controller (LGE)", |
" 1854 0010 Marvell 88E8053 Gigabit Ethernet Controller (LGE)", |
" 1854 0013 Marvell 88E8053 Gigabit Ethernet Controller (LGE)", |
" 1854 0014 Marvell 88E8053 Gigabit Ethernet Controller (LGE)", |
" 1854 0015 Marvell 88E8053 Gigabit Ethernet Controller (LGE)", |
" 1854 001a Marvell 88E8053 Gigabit Ethernet Controller (LGE)", |
" 1854 001b Marvell 88E8053 Gigabit Ethernet Controller (LGE)", |
" 1854 001d Marvell 88E8053 Gigabit Ethernet Controller (LGE)", |
" 1854 001f Marvell 88E8053 Gigabit Ethernet Controller (LGE)", |
" 1854 0021 Marvell 88E8053 Gigabit Ethernet Controller (LGE)", |
" 1854 0022 Marvell 88E8053 Gigabit Ethernet Controller (LGE)", |
" 270f 2801 Marvell 88E8053 Gigabit Ethernet Controller (Chaintech)", |
" a0a0 0506 Marvell 88E8053 Gigabit Ethernet Controller (Aopen)", |
" 4363 88E8055 PCI-E Gigabit Ethernet Controller", |
" 4611 GT-64115 System Controller", |
" 4620 GT-64120/64120A/64121A System Controller", |
" 4801 GT-48001", |
" 5005 Belkin F5D5005 Gigabit Desktop Network PCI Card", |
" 5040 MV88SX5040 4-port SATA I PCI-X Controller", |
" 5041 MV88SX5041 4-port SATA I PCI-X Controller", |
" 5080 MV88SX5080 8-port SATA I PCI-X Controller", |
" 5081 MV88SX5081 8-port SATA I PCI-X Controller", |
" 6041 MV88SX6041 4-port SATA II PCI-X Controller", |
" 6081 MV88SX6081 8-port SATA II PCI-X Controller", |
" 6460 MV64360/64361/64362 System Controller", |
" 6480 MV64460/64461/64462 System Controller", |
" f003 GT-64010 Primary Image Piranha Image Generator", |
"11ac Canon Information Systems Research Aust.", |
"11ad Lite-On Communications Inc", |
" 0002 LNE100TX", |
" 11ad 0002 LNE100TX", |
" 11ad 0003 LNE100TX", |
" 11ad f003 LNE100TX", |
" 11ad ffff LNE100TX", |
" 1385 f004 FA310TX", |
" c115 LNE100TX [Linksys EtherFast 10/100]", |
" 11ad c001 LNE100TX [ver 2.0]", |
"11ae Aztech System Ltd", |
"11af Avid Technology Inc.", |
" 0001 Cinema", |
" ee40 Digidesign Audiomedia III", |
"11b0 V3 Semiconductor Inc.", |
" 0002 V300PSC", |
" 0292 V292PBC [Am29030/40 Bridge]", |
" 0960 V96xPBC", |
" c960 V96DPC", |
"11b1 Apricot Computers", |
"11b2 Eastman Kodak", |
"11b3 Barr Systems Inc.", |
"11b4 Leitch Technology International", |
"11b5 Radstone Technology Plc", |
"11b6 United Video Corp", |
"11b7 Motorola", |
"11b8 XPoint Technologies, Inc", |
" 0001 Quad PeerMaster", |
"11b9 Pathlight Technology Inc.", |
" c0ed SSA Controller", |
"11ba Videotron Corp", |
"11bb Pyramid Technology", |
"11bc Network Peripherals Inc", |
" 0001 NP-PCI", |
"11bd Pinnacle Systems Inc.", |
" 002e PCTV 40i", |
" bede AV/DV Studio Capture Card", |
"11be International Microcircuits Inc", |
"11bf Astrodesign, Inc.", |
"11c0 Hewlett Packard", |
"11c1 Agere Systems", |
" 0440 56k WinModem", |
" 1033 8015 LT WinModem 56k Data+Fax+Voice+Dsvd", |
" 1033 8047 LT WinModem 56k Data+Fax+Voice+Dsvd", |
" 1033 804f LT WinModem 56k Data+Fax+Voice+Dsvd", |
" 10cf 102c LB LT Modem V.90 56k", |
" 10cf 104a BIBLO LT Modem 56k", |
" 10cf 105f LB2 LT Modem V.90 56k", |
" 1179 0001 Internal V.90 Modem", |
" 11c1 0440 LT WinModem 56k Data+Fax+Voice+Dsvd", |
" 122d 4101 MDP7800-U Modem", |
" 122d 4102 MDP7800SP-U Modem", |
" 13e0 0040 LT WinModem 56k Data+Fax+Voice+Dsvd", |
" 13e0 0440 LT WinModem 56k Data+Fax+Voice+Dsvd", |
" 13e0 0441 LT WinModem 56k Data+Fax+Voice+Dsvd", |
" 13e0 0450 LT WinModem 56k Data+Fax+Voice+Dsvd", |
" 13e0 f100 LT WinModem 56k Data+Fax+Voice+Dsvd", |
" 13e0 f101 LT WinModem 56k Data+Fax+Voice+Dsvd", |
" 144d 2101 LT56PV Modem", |
" 149f 0440 LT WinModem 56k Data+Fax+Voice+Dsvd", |
" 0441 56k WinModem", |
" 1033 804d LT WinModem 56k Data+Fax", |
" 1033 8065 LT WinModem 56k Data+Fax", |
" 1092 0440 Supra 56i", |
" 1179 0001 Internal V.90 Modem", |
" 11c1 0440 LT WinModem 56k Data+Fax", |
" 11c1 0441 LT WinModem 56k Data+Fax", |
" 122d 4100 MDP7800-U Modem", |
" 13e0 0040 LT WinModem 56k Data+Fax", |
" 13e0 0100 LT WinModem 56k Data+Fax", |
" 13e0 0410 LT WinModem 56k Data+Fax", |
" 13e0 0420 TelePath Internet 56k WinModem", |
" 13e0 0440 LT WinModem 56k Data+Fax", |
" 13e0 0443 LT WinModem 56k Data+Fax", |
" 13e0 f102 LT WinModem 56k Data+Fax", |
" 1416 9804 CommWave 56k Modem", |
" 141d 0440 LT WinModem 56k Data+Fax", |
" 144f 0441 Lucent 56k V.90 DF Modem", |
" 144f 0449 Lucent 56k V.90 DF Modem", |
" 144f 110d Lucent Win Modem", |
" 1468 0441 Presario 56k V.90 DF Modem", |
" 1668 0440 Lucent Win Modem", |
" 0442 56k WinModem", |
" 11c1 0440 LT WinModem 56k Data+Fax+Voice+VoiceView+Dsvd", |
" 11c1 0442 LT WinModem 56k Data+Fax+Voice+VoiceView+Dsvd", |
" 13e0 0412 LT WinModem 56k Data+Fax+Voice+VoiceView+Dsvd", |
" 13e0 0442 LT WinModem 56k Data+Fax+Voice+VoiceView+Dsvd", |
" 13fc 2471 LT WinModem 56k Data+Fax+Voice+VoiceView+Dsvd", |
" 144d 2104 LT56PT Modem", |
" 144f 1104 LT WinModem 56k Data+Fax+Voice+VoiceView+Dsvd", |
" 149f 0440 LT WinModem 56k Data+Fax+Voice+VoiceView+Dsvd", |
" 1668 0440 LT WinModem 56k Data+Fax+Voice+VoiceView+Dsvd", |
" 0443 LT WinModem", |
" 0444 LT WinModem", |
" 0445 LT WinModem", |
" 8086 2203 PRO/100+ MiniPCI (probably an Ambit U98.003.C.00 combo card)", |
" 8086 2204 PRO/100+ MiniPCI on Armada E500", |
" 0446 LT WinModem", |
" 0447 LT WinModem", |
" 0448 WinModem 56k", |
" 1014 0131 Lucent Win Modem", |
" 1033 8066 LT WinModem 56k Data+Fax+Voice+Dsvd", |
" 13e0 0030 56k Voice Modem", |
" 13e0 0040 LT WinModem 56k Data+Fax+Voice+Dsvd", |
" 1668 2400 LT WinModem 56k (MiniPCI Ethernet+Modem)", |
" 0449 WinModem 56k", |
" 0e11 b14d 56k V.90 Modem", |
" 13e0 0020 LT WinModem 56k Data+Fax", |
" 13e0 0041 TelePath Internet 56k WinModem", |
" 1436 0440 Lucent Win Modem", |
" 144f 0449 Lucent 56k V.90 DFi Modem", |
" 1468 0410 IBM ThinkPad T23 (2647-4MG)", |
" 1468 0440 Lucent Win Modem", |
" 1468 0449 Presario 56k V.90 DFi Modem", |
" 044a F-1156IV WinModem (V90, 56KFlex)", |
" 10cf 1072 LB Global LT Modem", |
" 13e0 0012 LT WinModem 56k Data+Fax+Voice+VoiceView+Dsvd", |
" 13e0 0042 LT WinModem 56k Data+Fax+Voice+VoiceView+Dsvd", |
" 144f 1005 LT WinModem 56k Data+Fax+Voice+VoiceView+Dsvd", |
" 044b LT WinModem", |
" 044c LT WinModem", |
" 044d LT WinModem", |
" 044e LT WinModem", |
" 044f V90 WildWire Modem", |
" 0450 LT WinModem", |
" 1033 80a8 Versa Note Vxi", |
" 144f 4005 Magnia SG20", |
" 1468 0450 Evo N600c", |
" 4005 144f LifeBook C Series", |
" 0451 LT WinModem", |
" 0452 LT WinModem", |
" 0453 LT WinModem", |
" 0454 LT WinModem", |
" 0455 LT WinModem", |
" 0456 LT WinModem", |
" 0457 LT WinModem", |
" 0458 LT WinModem", |
" 0459 LT WinModem", |
" 045a LT WinModem", |
" 045c LT WinModem", |
" 0461 V90 WildWire Modem", |
" 0462 V90 WildWire Modem", |
" 0480 Venus Modem (V90, 56KFlex)", |
" 048c V.92 56K WinModem", |
" 048f V.92 56k WinModem", |
" 5801 USB", |
" 5802 USS-312 USB Controller", |
" 5803 USS-344S USB Controller", |
" 5811 FW323", |
" 8086 524c D865PERL mainboard", |
" dead 0800 FireWire Host Bus Adapter", |
" 8110 T8110 H.100/H.110 TDM switch", |
" 12d9 000c E1/T1 PMXc cPCI carrier card", |
" ab10 WL60010 Wireless LAN MAC", |
" ab11 WL60040 Multimode Wireles LAN MAC", |
" 11c1 ab12 WaveLAN 11abg Cardbus card (Model 1102)", |
" 11c1 ab13 WaveLAN 11abg MiniPCI card (Model 0512)", |
" 11c1 ab15 WaveLAN 11abg Cardbus card (Model 1106)", |
" 11c1 ab16 WaveLAN 11abg MiniPCI card (Model 0516)", |
" ab20 ORiNOCO PCI Adapter", |
" ab21 Agere Wireless PCI Adapter", |
" ab30 Hermes2 Mini-PCI WaveLAN a/b/g", |
" 14cd 2012 Hermes2 Mini-PCI WaveLAN a/b/g", |
" ed00 ET-131x PCI-E Ethernet Controller", |
"11c2 Sand Microelectronics", |
"11c3 NEC Corporation", |
"11c4 Document Technologies, Inc", |
"11c5 Shiva Corporation", |
"11c6 Dainippon Screen Mfg. Co. Ltd", |
"11c7 D.C.M. Data Systems", |
"11c8 Dolphin Interconnect Solutions AS", |
" 0658 PSB32 SCI-Adapter D31x", |
" d665 PSB64 SCI-Adapter D32x", |
" d667 PSB66 SCI-Adapter D33x", |
"11c9 Magma", |
" 0010 16-line serial port w/- DMA", |
" 0011 4-line serial port w/- DMA", |
"11ca LSI Systems, Inc", |
"11cb Specialix Research Ltd.", |
" 2000 PCI_9050", |
" 11cb 0200 SX", |
" 11cb b008 I/O8+", |
" 4000 SUPI_1", |
" 8000 T225", |
"11cc Michels & Kleberhoff Computer GmbH", |
"11cd HAL Computer Systems, Inc.", |
"11ce Netaccess", |
"11cf Pioneer Electronic Corporation", |
"11d0 Lockheed Martin Federal Systems-Manassas", |
"11d1 Auravision", |
" 01f7 VxP524", |
"11d2 Intercom Inc.", |
"11d3 Trancell Systems Inc", |
"11d4 Analog Devices", |
" 1535 Blackfin BF535 processor", |
" 1805 SM56 PCI modem", |
" 1889 AD1889 sound chip", |
" 1986 AD1986A sound chip", |
" 5340 AD1881 sound chip", |
"11d5 Ikon Corporation", |
" 0115 10115", |
" 0117 10117", |
"11d6 Tekelec Telecom", |
"11d7 Trenton Technology, Inc.", |
"11d8 Image Technologies Development", |
"11d9 TEC Corporation", |
"11da Novell", |
"11db Sega Enterprises Ltd", |
"11dc Questra Corporation", |
"11dd Crosfield Electronics Limited", |
"11de Zoran Corporation", |
" 6057 ZR36057PQC Video cutting chipset", |
" 1031 7efe DC10 Plus", |
" 1031 fc00 MiroVIDEO DC50, Motion JPEG Capture/CODEC Board", |
" 12f8 8a02 Tekram Video Kit", |
" 13ca 4231 JPEG/TV Card", |
" 6120 ZR36120", |
" 1328 f001 Cinemaster C DVD Decoder", |
" 13c2 0000 MediaFocus Satellite TV Card", |
" 1de1 9fff Video Kit C210", |
"11df New Wave PDG", |
"11e0 Cray Communications A/S", |
"11e1 GEC Plessey Semi Inc.", |
"11e2 Samsung Information Systems America", |
"11e3 Quicklogic Corporation", |
" 0001 COM-ON-AIR Dosch&Amand DECT", |
" 5030 PC Watchdog", |
"11e4 Second Wave Inc", |
"11e5 IIX Consulting", |
"11e6 Mitsui-Zosen System Research", |
"11e7 Toshiba America, Elec. Company", |
"11e8 Digital Processing Systems Inc.", |
"11e9 Highwater Designs Ltd.", |
"11ea Elsag Bailey", |
"11eb Formation Inc.", |
"11ec Coreco Inc", |
"11ed Mediamatics", |
"11ee Dome Imaging Systems Inc", |
"11ef Nicolet Technologies B.V.", |
"11f0 Compu-Shack", |
" 4231 FDDI", |
" 4232 FASTline UTP Quattro", |
" 4233 FASTline FO", |
" 4234 FASTline UTP", |
" 4235 FASTline-II UTP", |
" 4236 FASTline-II FO", |
" 4731 GIGAline", |
"11f1 Symbios Logic Inc", |
"11f2 Picture Tel Japan K.K.", |
"11f3 Keithley Metrabyte", |
"11f4 Kinetic Systems Corporation", |
" 2915 CAMAC controller", |
"11f5 Computing Devices International", |
"11f6 Compex", |
" 0112 ENet100VG4", |
" 0113 FreedomLine 100", |
" 1401 ReadyLink 2000", |
" 2011 RL100-ATX 10/100", |
" 11f6 2011 RL100-ATX", |
" 2201 ReadyLink 100TX (Winbond W89C840)", |
" 11f6 2011 ReadyLink 100TX", |
" 9881 RL100TX Fast Ethernet", |
"11f7 Scientific Atlanta", |
"11f8 PMC-Sierra Inc.", |
" 7375 PM7375 [LASAR-155 ATM SAR]", |
"11f9 I-Cube Inc", |
"11fa Kasan Electronics Company, Ltd.", |
"11fb Datel Inc", |
"11fc Silicon Magic", |
"11fd High Street Consultants", |
"11fe Comtrol Corporation", |
" 0001 RocketPort 32 port w/external I/F", |
" 0002 RocketPort 8 port w/external I/F", |
" 0003 RocketPort 16 port w/external I/F", |
" 0004 RocketPort 4 port w/quad cable", |
" 0005 RocketPort 8 port w/octa cable", |
" 0006 RocketPort 8 port w/RJ11 connectors", |
" 0007 RocketPort 4 port w/RJ11 connectors", |
" 0008 RocketPort 8 port w/ DB78 SNI (Siemens) connector", |
" 0009 RocketPort 16 port w/ DB78 SNI (Siemens) connector", |
" 000a RocketPort Plus 4 port", |
" 000b RocketPort Plus 8 port", |
" 000c RocketModem 6 port", |
" 000d RocketModem 4-port", |
" 000e RocketPort Plus 2 port RS232", |
" 000f RocketPort Plus 2 port RS422", |
" 0801 RocketPort UPCI 32 port w/external I/F", |
" 0802 RocketPort UPCI 8 port w/external I/F", |
" 0803 RocketPort UPCI 16 port w/external I/F", |
" 0805 RocketPort UPCI 8 port w/octa cable", |
" 080c RocketModem III 8 port", |
" 080d RocketModem III 4 port", |
" 0812 RocketPort UPCI Plus 8 port RS422", |
" 0903 RocketPort Compact PCI 16 port w/external I/F", |
" 8015 RocketPort 4-port UART 16954", |
"11ff Scion Corporation", |
" 0003 AG-5", |
"1200 CSS Corporation", |
"1201 Vista Controls Corp", |
"1202 Network General Corp.", |
" 4300 Gigabit Ethernet Adapter", |
" 1202 9841 SK-9841 LX", |
" 1202 9842 SK-9841 LX dual link", |
" 1202 9843 SK-9843 SX", |
" 1202 9844 SK-9843 SX dual link", |
"1203 Bayer Corporation, Agfa Division", |
"1204 Lattice Semiconductor Corporation", |
"1205 Array Corporation", |
"1206 Amdahl Corporation", |
"1208 Parsytec GmbH", |
" 4853 HS-Link Device", |
"1209 SCI Systems Inc", |
"120a Synaptel", |
"120b Adaptive Solutions", |
"120c Technical Corp.", |
"120d Compression Labs, Inc.", |
"120e Cyclades Corporation", |
" 0100 Cyclom-Y below first megabyte", |
" 0101 Cyclom-Y above first megabyte", |
" 0102 Cyclom-4Y below first megabyte", |
" 0103 Cyclom-4Y above first megabyte", |
" 0104 Cyclom-8Y below first megabyte", |
" 0105 Cyclom-8Y above first megabyte", |
" 0200 Cyclades-Z below first megabyte", |
" 0201 Cyclades-Z above first megabyte", |
" 0300 PC300/RSV or /X21 (2 ports)", |
" 0301 PC300/RSV or /X21 (1 port)", |
" 0310 PC300/TE (2 ports)", |
" 0311 PC300/TE (1 port)", |
" 0320 PC300/TE-M (2 ports)", |
" 0321 PC300/TE-M (1 port)", |
" 0400 PC400", |
"120f Essential Communications", |
" 0001 Roadrunner serial HIPPI", |
"1210 Hyperparallel Technologies", |
"1211 Braintech Inc", |
"1212 Kingston Technology Corp.", |
"1213 Applied Intelligent Systems, Inc.", |
"1214 Performance Technologies, Inc.", |
"1215 Interware Co., Ltd", |
"1216 Purup Prepress A/S", |
"1217 O2 Micro, Inc.", |
" 6729 OZ6729", |
" 673a OZ6730", |
" 6832 OZ6832/6833 CardBus Controller", |
" 6836 OZ6836/6860 CardBus Controller", |
" 6872 OZ6812 CardBus Controller", |
" 6925 OZ6922 CardBus Controller", |
" 6933 OZ6933/711E1 CardBus/SmartCardBus Controller", |
" 1025 1016 Travelmate 612 TX", |
" 6972 OZ601/6912/711E0 CardBus/SmartCardBus Controller", |
" 1014 020c ThinkPad R30", |
" 1179 0001 Magnia Z310", |
" 7110 OZ711Mx 4-in-1 MemoryCardBus Accelerator", |
" 103c 088c NC8000 laptop", |
" 103c 0890 NC6000 laptop", |
" 1734 106c Amilo A1645", |
" 7112 OZ711EC1/M1 SmartCardBus/MemoryCardBus Controller", |
" 7113 OZ711EC1 SmartCardBus Controller", |
" 7114 OZ711M1/MC1 4-in-1 MemoryCardBus Controller", |
" 7134 OZ711MP1/MS1 MemoryCardBus Controller", |
" 71e2 OZ711E2 SmartCardBus Controller", |
" 7212 OZ711M2 4-in-1 MemoryCardBus Controller", |
" 7213 OZ6933E CardBus Controller", |
" 7223 OZ711M3/MC3 4-in-1 MemoryCardBus Controller", |
" 103c 088c NC8000 laptop", |
" 103c 0890 NC6000 laptop", |
" 7233 OZ711MP3/MS3 4-in-1 MemoryCardBus Controller", |
"1218 Hybricon Corp.", |
"1219 First Virtual Corporation", |
"121a 3Dfx Interactive, Inc.", |
" 0001 Voodoo", |
" 0002 Voodoo 2", |
" 0003 Voodoo Banshee", |
" 1092 0003 Monster Fusion", |
" 1092 4000 Monster Fusion", |
" 1092 4002 Monster Fusion", |
" 1092 4801 Monster Fusion AGP", |
" 1092 4803 Monster Fusion AGP", |
" 1092 8030 Monster Fusion", |
" 1092 8035 Monster Fusion AGP", |
" 10b0 0001 Dragon 4000", |
" 1102 1018 3D Blaster Banshee VE", |
" 121a 0001 Voodoo Banshee AGP", |
" 121a 0003 Voodoo Banshee AGP SGRAM", |
" 121a 0004 Voodoo Banshee", |
" 139c 0016 Raven", |
" 139c 0017 Raven", |
" 14af 0002 Maxi Gamer Phoenix", |
" 0004 Voodoo Banshee [Velocity 100]", |
" 0005 Voodoo 3", |
" 121a 0004 Voodoo3 AGP", |
" 121a 0030 Voodoo3 AGP", |
" 121a 0031 Voodoo3 AGP", |
" 121a 0034 Voodoo3 AGP", |
" 121a 0036 Voodoo3 2000 PCI", |
" 121a 0037 Voodoo3 AGP", |
" 121a 0038 Voodoo3 AGP", |
" 121a 003a Voodoo3 AGP", |
" 121a 0044 Voodoo3", |
" 121a 004b Velocity 100", |
" 121a 004c Velocity 200", |
" 121a 004d Voodoo3 AGP", |
" 121a 004e Voodoo3 AGP", |
" 121a 0051 Voodoo3 AGP", |
" 121a 0052 Voodoo3 AGP", |
" 121a 0057 Voodoo3 3000 PCI", |
" 121a 0060 Voodoo3 3500 TV (NTSC)", |
" 121a 0061 Voodoo3 3500 TV (PAL)", |
" 121a 0062 Voodoo3 3500 TV (SECAM)", |
" 0009 Voodoo 4 / Voodoo 5", |
" 121a 0003 Voodoo5 PCI 5500", |
" 121a 0009 Voodoo5 AGP 5500/6000", |
" 0057 Voodoo 3/3000 [Avenger]", |
"121b Advanced Telecommunications Modules", |
"121c Nippon Texaco., Ltd", |
"121d Lippert Automationstechnik GmbH", |
"121e CSPI", |
" 0201 Myrinet 2000 Scalable Cluster Interconnect", |
"121f Arcus Technology, Inc.", |
"1220 Ariel Corporation", |
" 1220 AMCC 5933 TMS320C80 DSP/Imaging board", |
"1221 Contec Co., Ltd", |
"1222 Ancor Communications, Inc.", |
"1223 Artesyn Communication Products", |
" 0003 PM/Link", |
" 0004 PM/T1", |
" 0005 PM/E1", |
" 0008 PM/SLS", |
" 0009 BajaSpan Resource Target", |
" 000a BajaSpan Section 0", |
" 000b BajaSpan Section 1", |
" 000c BajaSpan Section 2", |
" 000d BajaSpan Section 3", |
" 000e PM/PPC", |
"1224 Interactive Images", |
"1225 Power I/O, Inc.", |
"1227 Tech-Source", |
" 0006 Raptor GFX 8P", |
" 0023 Raptor GFX [1100T]", |
"1228 Norsk Elektro Optikk A/S", |
"1229 Data Kinesis Inc.", |
"122a Integrated Telecom", |
"122b LG Industrial Systems Co., Ltd", |
"122c Sican GmbH", |
"122d Aztech System Ltd", |
" 1206 368DSP", |
" 1400 Trident PCI288-Q3DII (NX)", |
" 50dc 3328 Audio", |
" 122d 0001 3328 Audio", |
" 80da 3328 Audio", |
" 122d 0001 3328 Audio", |
"122e Xyratex", |
"122f Andrew Corporation", |
"1230 Fishcamp Engineering", |
"1231 Woodward McCoach, Inc.", |
"1232 GPT Limited", |
"1233 Bus-Tech, Inc.", |
"1234 Technical Corp.", |
"1235 Risq Modular Systems, Inc.", |
"1236 Sigma Designs Corporation", |
" 0000 RealMagic64/GX", |
" 6401 REALmagic 64/GX (SD 6425)", |
"1237 Alta Technology Corporation", |
"1238 Adtran", |
"1239 3DO Company", |
"123a Visicom Laboratories, Inc.", |
"123b Seeq Technology, Inc.", |
"123c Century Systems, Inc.", |
"123d Engineering Design Team, Inc.", |
" 0000 EasyConnect 8/32", |
" 0002 EasyConnect 8/64", |
" 0003 EasyIO", |
"123e Simutech, Inc.", |
"123f C-Cube Microsystems", |
" 00e4 MPEG", |
" 8120 E4?", |
" 11bd 0006 DV500 E4", |
" 11bd 000a DV500 E4", |
" 11bd 000f DV500 E4", |
" 1809 0016 Emuzed MAUI-III PCI PVR FM TV", |
" 8888 Cinemaster C 3.0 DVD Decoder", |
" 1002 0001 Cinemaster C 3.0 DVD Decoder", |
" 1002 0002 Cinemaster C 3.0 DVD Decoder", |
" 1328 0001 Cinemaster C 3.0 DVD Decoder", |
"1240 Marathon Technologies Corp.", |
"1241 DSC Communications", |
"1242 JNI Corporation", |
" 1560 JNIC-1560 PCI-X Fibre Channel Controller", |
" 1242 6562 FCX2-6562 Dual Channel PCI-X Fibre Channel Adapter", |
" 1242 656a FCX-6562 PCI-X Fibre Channel Adapter", |
" 4643 FCI-1063 Fibre Channel Adapter", |
" 6562 FCX2-6562 Dual Channel PCI-X Fibre Channel Adapter", |
" 656a FCX-6562 PCI-X Fibre Channel Adapter", |
"1243 Delphax", |
"1244 AVM Audiovisuelles MKTG & Computer System GmbH", |
" 0700 B1 ISDN", |
" 0800 C4 ISDN", |
" 0a00 A1 ISDN [Fritz]", |
" 1244 0a00 FRITZ!Card ISDN Controller", |
" 0e00 Fritz!PCI v2.0 ISDN", |
" 1100 C2 ISDN", |
" 1200 T1 ISDN", |
" 2700 Fritz!Card DSL SL", |
" 2900 Fritz!Card DSL v2.0", |
"1245 A.P.D., S.A.", |
"1246 Dipix Technologies, Inc.", |
"1247 Xylon Research, Inc.", |
"1248 Central Data Corporation", |
"1249 Samsung Electronics Co., Ltd.", |
"124a AEG Electrocom GmbH", |
"124b SBS/Greenspring Modular I/O", |
" 0040 PCI-40A or cPCI-200 Quad IndustryPack carrier", |
" 124b 9080 PCI9080 Bridge", |
"124c Solitron Technologies, Inc.", |
"124d Stallion Technologies, Inc.", |
" 0000 EasyConnection 8/32", |
" 0002 EasyConnection 8/64", |
" 0003 EasyIO", |
" 0004 EasyConnection/RA", |
"124e Cylink", |
"124f Infortrend Technology, Inc.", |
" 0041 IFT-2000 Series RAID Controller", |
"1250 Hitachi Microcomputer System Ltd", |
"1251 VLSI Solutions Oy", |
"1253 Guzik Technical Enterprises", |
"1254 Linear Systems Ltd.", |
"1255 Optibase Ltd", |
" 1110 MPEG Forge", |
" 1210 MPEG Fusion", |
" 2110 VideoPlex", |
" 2120 VideoPlex CC", |
" 2130 VideoQuest", |
"1256 Perceptive Solutions, Inc.", |
" 4201 PCI-2220I", |
" 4401 PCI-2240I", |
" 5201 PCI-2000", |
"1257 Vertex Networks, Inc.", |
"1258 Gilbarco, Inc.", |
"1259 Allied Telesyn International", |
" 2560 AT-2560 Fast Ethernet Adapter (i82557B)", |
" a117 RTL81xx Fast Ethernet", |
" a120 21x4x DEC-Tulip compatible 10/100 Ethernet", |
"125a ABB Power Systems", |
"125b Asix Electronics Corporation", |
" 1400 ALFA GFC2204 Fast Ethernet", |
" 1186 1100 AX8814X Based PCI Fast Ethernet Adapter", |
"125c Aurora Technologies, Inc.", |
" 0101 Saturn 4520P", |
" 0640 Aries 16000P", |
"125d ESS Technology", |
" 0000 ES336H Fax Modem (Early Model)", |
" 1948 Solo?", |
" 1968 ES1968 Maestro 2", |
" 1028 0085 ES1968 Maestro-2 PCI", |
" 1033 8051 ES1968 Maestro-2 Audiodrive", |
" 1969 ES1969 Solo-1 Audiodrive", |
" 1014 0166 ES1969 SOLO-1 AudioDrive on IBM Aptiva Mainboard", |
" 125d 8888 Solo-1 Audio Adapter", |
" 153b 111b Terratec 128i PCI", |
" 1978 ES1978 Maestro 2E", |
" 0e11 b112 Armada M700/E500", |
" 1033 803c ES1978 Maestro-2E Audiodrive", |
" 1033 8058 ES1978 Maestro-2E Audiodrive", |
" 1092 4000 Monster Sound MX400", |
" 1179 0001 ES1978 Maestro-2E Audiodrive", |
" 1988 ES1988 Allegro-1", |
" 0e11 0098 Evo N600c", |
" 1092 4100 Sonic Impact S100", |
" 125d 1988 ESS Allegro-1 Audiodrive", |
" 1989 ESS Modem", |
" 125d 1989 ESS Modem", |
" 1998 ES1983S Maestro-3i PCI Audio Accelerator", |
" 1028 00b1 Latitude C600", |
" 1028 00e6 ES1983S Maestro-3i (Dell Inspiron 8100)", |
" 1999 ES1983S Maestro-3i PCI Modem Accelerator", |
" 199a ES1983S Maestro-3i PCI Audio Accelerator", |
" 199b ES1983S Maestro-3i PCI Modem Accelerator", |
" 2808 ES336H Fax Modem (Later Model)", |
" 2838 ES2838/2839 SuperLink Modem", |
" 2898 ES2898 Modem", |
" 125d 0424 ES56-PI Data Fax Modem", |
" 125d 0425 ES56T-PI Data Fax Modem", |
" 125d 0426 ES56V-PI Data Fax Modem", |
" 125d 0427 VW-PI Data Fax Modem", |
" 125d 0428 ES56ST-PI Data Fax Modem", |
" 125d 0429 ES56SV-PI Data Fax Modem", |
" 147a c001 ES56-PI Data Fax Modem", |
" 14fe 0428 ES56-PI Data Fax Modem", |
" 14fe 0429 ES56-PI Data Fax Modem", |
"125e Specialvideo Engineering SRL", |
"125f Concurrent Technologies, Inc.", |
"1260 Intersil Corporation", |
" 3872 Prism 2.5 Wavelan chipset", |
" 1468 0202 LAN-Express IEEE 802.11b Wireless LAN", |
" 3873 Prism 2.5 Wavelan chipset", |
" 1186 3501 DWL-520 Wireless PCI Adapter", |
" 1186 3700 DWL-520 Wireless PCI Adapter, Rev E1", |
" 1385 4105 MA311 802.11b wireless adapter", |
" 1668 0414 HWP01170-01 802.11b PCI Wireless Adapter", |
" 16a5 1601 AIR.mate PC-400 PCI Wireless LAN Adapter", |
" 1737 3874 WMP11 Wireless 802.11b PCI Adapter", |
" 8086 2513 Wireless 802.11b MiniPCI Adapter", |
" 3886 ISL3886 [Prism Javelin/Prism Xbow]", |
" 17cf 0037 XG-901 and clones Wireless Adapter", |
" 3890 ISL3890 [Prism GT/Prism Duette]/ISL3886 [Prism Javelin/Prism Xbow]", |
" 10b8 2802 SMC2802W Wireless PCI Adapter", |
" 10b8 2835 SMC2835W Wireless Cardbus Adapter", |
" 10b8 a835 SMC2835W V2 Wireless Cardbus Adapter", |
" 1113 4203 WN4201B", |
" 1113 ee03 SMC2802W V2 Wireless PCI Adapter [ISL3886]", |
" 1113 ee08 SMC2835W V3 EU Wireless Cardbus Adapter", |
" 1186 3202 DWL-G650 A1 Wireless Adapter", |
" 1259 c104 CG-WLCB54GT Wireless Adapter", |
" 1385 4800 WG511 Wireless Adapter", |
" 16a5 1605 ALLNET ALL0271 Wireless PCI Adapter", |
" 17cf 0014 XG-600 and clones Wireless Adapter", |
" 17cf 0020 XG-900 and clones Wireless Adapter", |
" 8130 HMP8130 NTSC/PAL Video Decoder", |
" 8131 HMP8131 NTSC/PAL Video Decoder", |
" ffff ISL3886IK", |
" 1260 0000 Senao 3054MP+ (J) mini-PCI WLAN 802.11g adapter", |
"1261 Matsushita-Kotobuki Electronics Industries, Ltd.", |
"1262 ES Computer Company, Ltd.", |
"1263 Sonic Solutions", |
"1264 Aval Nagasaki Corporation", |
"1265 Casio Computer Co., Ltd.", |
"1266 Microdyne Corporation", |
" 0001 NE10/100 Adapter (i82557B)", |
" 1910 NE2000Plus (RT8029) Ethernet Adapter", |
" 1266 1910 NE2000Plus Ethernet Adapter", |
"1267 S. A. Telecommunications", |
" 5352 PCR2101", |
" 5a4b Telsat Turbo", |
"1268 Tektronix", |
"1269 Thomson-CSF/TTM", |
"126a Lexmark International, Inc.", |
"126b Adax, Inc.", |
"126c Northern Telecom", |
" 1211 10/100BaseTX [RTL81xx]", |
" 126c 802.11b Wireless Ethernet Adapter", |
"126d Splash Technology, Inc.", |
"126e Sumitomo Metal Industries, Ltd.", |
"126f Silicon Motion, Inc.", |
" 0501 SM501 VoyagerGX Rev. AA", |
" 0510 SM501 VoyagerGX Rev. B", |
" 0710 SM710 LynxEM", |
" 0712 SM712 LynxEM+", |
" 0720 SM720 Lynx3DM", |
" 0730 SM731 Cougar3DR", |
" 0810 SM810 LynxE", |
" 0811 SM811 LynxE", |
" 0820 SM820 Lynx3D", |
" 0910 SM910", |
"1270 Olympus Optical Co., Ltd.", |
"1271 GW Instruments", |
"1272 Telematics International", |
"1273 Hughes Network Systems", |
" 0002 DirecPC", |
"1274 Ensoniq", |
" 1171 ES1373 [AudioPCI] (also Creative Labs CT5803)", |
" 1371 ES1371 [AudioPCI-97]", |
" 0e11 0024 AudioPCI on Motherboard Compaq Deskpro", |
" 0e11 b1a7 ES1371, ES1373 AudioPCI", |
" 1033 80ac ES1371, ES1373 AudioPCI", |
" 1042 1854 Tazer", |
" 107b 8054 Tabor2", |
" 1274 1371 Creative Sound Blaster AudioPCI64V, AudioPCI128", |
" 1274 8001 CT4751 board", |
" 1462 6470 ES1371, ES1373 AudioPCI On Motherboard MS-6147 1.1A", |
" 1462 6560 ES1371, ES1373 AudioPCI On Motherboard MS-6156 1.10", |
" 1462 6630 ES1371, ES1373 AudioPCI On Motherboard MS-6163BX 1.0A", |
" 1462 6631 ES1371, ES1373 AudioPCI On Motherboard MS-6163VIA 1.0A", |
" 1462 6632 ES1371, ES1373 AudioPCI On Motherboard MS-6163BX 2.0A", |
" 1462 6633 ES1371, ES1373 AudioPCI On Motherboard MS-6163VIA 2.0A", |
" 1462 6820 ES1371, ES1373 AudioPCI On Motherboard MS-6182 1.00", |
" 1462 6822 ES1371, ES1373 AudioPCI On Motherboard MS-6182 1.00A", |
" 1462 6830 ES1371, ES1373 AudioPCI On Motherboard MS-6183 1.00", |
" 1462 6880 ES1371, ES1373 AudioPCI On Motherboard MS-6188 1.00", |
" 1462 6900 ES1371, ES1373 AudioPCI On Motherboard MS-6190 1.00", |
" 1462 6910 ES1371, ES1373 AudioPCI On Motherboard MS-6191", |
" 1462 6930 ES1371, ES1373 AudioPCI On Motherboard MS-6193", |
" 1462 6990 ES1371, ES1373 AudioPCI On Motherboard MS-6199BX 2.0A", |
" 1462 6991 ES1371, ES1373 AudioPCI On Motherboard MS-6199VIA 2.0A", |
" 14a4 2077 ES1371, ES1373 AudioPCI On Motherboard KR639", |
" 14a4 2105 ES1371, ES1373 AudioPCI On Motherboard MR800", |
" 14a4 2107 ES1371, ES1373 AudioPCI On Motherboard MR801", |
" 14a4 2172 ES1371, ES1373 AudioPCI On Motherboard DR739", |
" 1509 9902 ES1371, ES1373 AudioPCI On Motherboard KW11", |
" 1509 9903 ES1371, ES1373 AudioPCI On Motherboard KW31", |
" 1509 9904 ES1371, ES1373 AudioPCI On Motherboard KA11", |
" 1509 9905 ES1371, ES1373 AudioPCI On Motherboard KC13", |
" 152d 8801 ES1371, ES1373 AudioPCI On Motherboard CP810E", |
" 152d 8802 ES1371, ES1373 AudioPCI On Motherboard CP810", |
" 152d 8803 ES1371, ES1373 AudioPCI On Motherboard P3810E", |
" 152d 8804 ES1371, ES1373 AudioPCI On Motherboard P3810-S", |
" 152d 8805 ES1371, ES1373 AudioPCI On Motherboard P3820-S", |
" 270f 2001 ES1371, ES1373 AudioPCI On Motherboard 6CTR", |
" 270f 2200 ES1371, ES1373 AudioPCI On Motherboard 6WTX", |
" 270f 3000 ES1371, ES1373 AudioPCI On Motherboard 6WSV", |
" 270f 3100 ES1371, ES1373 AudioPCI On Motherboard 6WIV2", |
" 270f 3102 ES1371, ES1373 AudioPCI On Motherboard 6WIV", |
" 270f 7060 ES1371, ES1373 AudioPCI On Motherboard 6ASA2", |
" 8086 4249 ES1371, ES1373 AudioPCI On Motherboard BI440ZX", |
" 8086 424c ES1371, ES1373 AudioPCI On Motherboard BL440ZX", |
" 8086 425a ES1371, ES1373 AudioPCI On Motherboard BZ440ZX", |
" 8086 4341 ES1371, ES1373 AudioPCI On Motherboard Cayman", |
" 8086 4343 ES1371, ES1373 AudioPCI On Motherboard Cape Cod", |
" 8086 4541 D815EEA Motherboard", |
" 8086 4649 ES1371, ES1373 AudioPCI On Motherboard Fire Island", |
" 8086 464a ES1371, ES1373 AudioPCI On Motherboard FJ440ZX", |
" 8086 4d4f ES1371, ES1373 AudioPCI On Motherboard Montreal", |
" 8086 4f43 ES1371, ES1373 AudioPCI On Motherboard OC440LX", |
" 8086 5243 ES1371, ES1373 AudioPCI On Motherboard RC440BX", |
" 8086 5352 ES1371, ES1373 AudioPCI On Motherboard SunRiver", |
" 8086 5643 ES1371, ES1373 AudioPCI On Motherboard Vancouver", |
" 8086 5753 ES1371, ES1373 AudioPCI On Motherboard WS440BX", |
" 5000 ES1370 [AudioPCI]", |
" 5880 5880 AudioPCI", |
" 1274 2000 Creative Sound Blaster AudioPCI128", |
" 1274 2003 Creative SoundBlaster AudioPCI 128", |
" 1274 5880 Creative Sound Blaster AudioPCI128", |
" 1274 8001 Sound Blaster 16PCI 4.1ch", |
" 1458 a000 5880 AudioPCI On Motherboard 6OXET", |
" 1462 6880 5880 AudioPCI On Motherboard MS-6188 1.00", |
" 270f 2001 5880 AudioPCI On Motherboard 6CTR", |
" 270f 2200 5880 AudioPCI On Motherboard 6WTX", |
" 270f 7040 5880 AudioPCI On Motherboard 6ATA4", |
"1275 Network Appliance Corporation", |
"1276 Switched Network Technologies, Inc.", |
"1277 Comstream", |
"1278 Transtech Parallel Systems Ltd.", |
" 0701 TPE3/TM3 PowerPC Node", |
" 0710 TPE5 PowerPC PCI board", |
"1279 Transmeta Corporation", |
" 0060 TM8000 Northbridge", |
" 0061 TM8000 AGP bridge", |
" 0295 Northbridge", |
" 0395 LongRun Northbridge", |
" 0396 SDRAM controller", |
" 0397 BIOS scratchpad", |
"127a Rockwell International", |
" 1002 HCF 56k Data/Fax Modem", |
" 1092 094c SupraExpress 56i PRO [Diamond SUP2380]", |
" 122d 4002 HPG / MDP3858-U", |
" 122d 4005 MDP3858-E", |
" 122d 4007 MDP3858-A/-NZ", |
" 122d 4012 MDP3858-SA", |
" 122d 4017 MDP3858-W", |
" 122d 4018 MDP3858-W", |
" 127a 1002 Rockwell 56K D/F HCF Modem", |
" 1003 HCF 56k Data/Fax Modem", |
" 0e11 b0bc 229-DF Zephyr", |
" 0e11 b114 229-DF Cheetah", |
" 1033 802b 229-DF", |
" 13df 1003 PCI56RX Modem", |
" 13e0 0117 IBM", |
" 13e0 0147 IBM F-1156IV+/R3 Spain V.90 Modem", |
" 13e0 0197 IBM", |
" 13e0 01c7 IBM F-1156IV+/R3 WW V.90 Modem", |
" 13e0 01f7 IBM", |
" 1436 1003 IBM", |
" 1436 1103 IBM 5614PM3G V.90 Modem", |
" 1436 1602 Compaq 229-DF Ducati", |
" 1004 HCF 56k Data/Fax/Voice Modem", |
" 1048 1500 MicroLink 56k Modem", |
" 10cf 1059 Fujitsu 229-DFRT", |
" 1005 HCF 56k Data/Fax/Voice/Spkp (w/Handset) Modem", |
" 1005 127a AOpen FM56-P", |
" 1033 8029 229-DFSV", |
" 1033 8054 Modem", |
" 10cf 103c Fujitsu", |
" 10cf 1055 Fujitsu 229-DFSV", |
" 10cf 1056 Fujitsu 229-DFSV", |
" 122d 4003 MDP3858SP-U", |
" 122d 4006 Packard Bell MDP3858V-E", |
" 122d 4008 MDP3858SP-A/SP-NZ", |
" 122d 4009 MDP3858SP-E", |
" 122d 4010 MDP3858V-U", |
" 122d 4011 MDP3858SP-SA", |
" 122d 4013 MDP3858V-A/V-NZ", |
" 122d 4015 MDP3858SP-W", |
" 122d 4016 MDP3858V-W", |
" 122d 4019 MDP3858V-SA", |
" 13df 1005 PCI56RVP Modem", |
" 13e0 0187 IBM", |
" 13e0 01a7 IBM", |
" 13e0 01b7 IBM DF-1156IV+/R3 Spain V.90 Modem", |
" 13e0 01d7 IBM DF-1156IV+/R3 WW V.90 Modem", |
" 1436 1005 IBM", |
" 1436 1105 IBM", |
" 1437 1105 IBM 5614PS3G V.90 Modem", |
" 1022 HCF 56k Modem", |
" 1436 1303 M3-5614PM3G V.90 Modem", |
" 1023 HCF 56k Data/Fax Modem", |
" 122d 4020 Packard Bell MDP3858-WE", |
" 122d 4023 MDP3858-UE", |
" 13e0 0247 IBM F-1156IV+/R6 Spain V.90 Modem", |
" 13e0 0297 IBM", |
" 13e0 02c7 IBM F-1156IV+/R6 WW V.90 Modem", |
" 1436 1203 IBM", |
" 1436 1303 IBM", |
" 1024 HCF 56k Data/Fax/Voice Modem", |
" 1025 HCF 56k Data/Fax/Voice/Spkp (w/Handset) Modem", |
" 10cf 106a Fujitsu 235-DFSV", |
" 122d 4021 Packard Bell MDP3858V-WE", |
" 122d 4022 MDP3858SP-WE", |
" 122d 4024 MDP3858V-UE", |
" 122d 4025 MDP3858SP-UE", |
" 1026 HCF 56k PCI Speakerphone Modem", |
" 1032 HCF 56k Modem", |
" 1033 HCF 56k Modem", |
" 1034 HCF 56k Modem", |
" 1035 HCF 56k PCI Speakerphone Modem", |
" 1036 HCF 56k Modem", |
" 1085 HCF 56k Volcano PCI Modem", |
" 2005 HCF 56k Data/Fax Modem", |
" 104d 8044 229-DFSV", |
" 104d 8045 229-DFSV", |
" 104d 8055 PBE/Aztech 235W-DFSV", |
" 104d 8056 235-DFSV", |
" 104d 805a Modem", |
" 104d 805f Modem", |
" 104d 8074 Modem", |
" 2013 HSF 56k Data/Fax Modem", |
" 1179 0001 Modem", |
" 1179 ff00 Modem", |
" 2014 HSF 56k Data/Fax/Voice Modem", |
" 10cf 1057 Fujitsu Citicorp III", |
" 122d 4050 MSP3880-U", |
" 122d 4055 MSP3880-W", |
" 2015 HSF 56k Data/Fax/Voice/Spkp (w/Handset) Modem", |
" 10cf 1063 Fujitsu", |
" 10cf 1064 Fujitsu", |
" 1468 2015 Fujitsu", |
" 2016 HSF 56k Data/Fax/Voice/Spkp Modem", |
" 122d 4051 MSP3880V-W", |
" 122d 4052 MSP3880SP-W", |
" 122d 4054 MSP3880V-U", |
" 122d 4056 MSP3880SP-U", |
" 122d 4057 MSP3880SP-A", |
" 4311 Riptide HSF 56k PCI Modem", |
" 127a 4311 Ring Modular? Riptide HSF RT HP Dom", |
" 13e0 0210 HP-GVC", |
" 4320 Riptide PCI Audio Controller", |
" 1235 4320 Riptide PCI Audio Controller", |
" 4321 Riptide HCF 56k PCI Modem", |
" 1235 4321 Hewlett Packard DF", |
" 1235 4324 Hewlett Packard DF", |
" 13e0 0210 Hewlett Packard DF", |
" 144d 2321 Riptide", |
" 4322 Riptide PCI Game Controller", |
" 1235 4322 Riptide PCI Game Controller", |
" 8234 RapidFire 616X ATM155 Adapter", |
" 108d 0022 RapidFire 616X ATM155 Adapter", |
" 108d 0027 RapidFire 616X ATM155 Adapter", |
"127b Pixera Corporation", |
"127c Crosspoint Solutions, Inc.", |
"127d Vela Research", |
"127e Winnov, L.P.", |
"127f Fujifilm", |
"1280 Photoscript Group Ltd.", |
"1281 Yokogawa Electric Corporation", |
"1282 Davicom Semiconductor, Inc.", |
" 9009 Ethernet 100/10 MBit", |
" 9100 21x4x DEC-Tulip compatible 10/100 Ethernet", |
" 9102 21x4x DEC-Tulip compatible 10/100 Ethernet", |
" 9132 Ethernet 100/10 MBit", |
"1283 Integrated Technology Express, Inc.", |
" 673a IT8330G", |
" 8211 ITE 8211F Single Channel UDMA 133 (ASUS 8211 (ITE IT8212 ATA RAID Controller))", |
" 1043 8138 P5GD1-VW Mainboard", |
" 8212 IT/ITE8212 Dual channel ATA RAID controller (PCI version seems to be IT8212, embedded seems to be ITE8212)", |
" 1283 0001 IT/ITE8212 Dual channel ATA RAID controller", |
" 8330 IT8330G", |
" 8872 IT8874F PCI Dual Serial Port Controller", |
" 8888 IT8888F PCI to ISA Bridge with SMB", |
" 8889 IT8889F PCI to ISA Bridge", |
" e886 IT8330G", |
"1284 Sahara Networks, Inc.", |
"1285 Platform Technologies, Inc.", |
" 0100 AGOGO sound chip (aka ESS Maestro 1)", |
"1286 Mazet GmbH", |
"1287 M-Pact, Inc.", |
" 001e LS220D DVD Decoder", |
" 001f LS220C DVD Decoder", |
"1288 Timestep Corporation", |
"1289 AVC Technology, Inc.", |
"128a Asante Technologies, Inc.", |
"128b Transwitch Corporation", |
"128c Retix Corporation", |
"128d G2 Networks, Inc.", |
" 0021 ATM155 Adapter", |
"128e Hoontech Corporation/Samho Multi Tech Ltd.", |
" 0008 ST128 WSS/SB", |
" 0009 ST128 SAM9407", |
" 000a ST128 Game Port", |
" 000b ST128 MPU Port", |
" 000c ST128 Ctrl Port", |
"128f Tateno Dennou, Inc.", |
"1290 Sord Computer Corporation", |
"1291 NCS Computer Italia", |
"1292 Tritech Microelectronics Inc", |
"1293 Media Reality Technology", |
"1294 Rhetorex, Inc.", |
"1295 Imagenation Corporation", |
"1296 Kofax Image Products", |
"1297 Holco Enterprise Co, Ltd/Shuttle Computer", |
"1298 Spellcaster Telecommunications Inc.", |
"1299 Knowledge Technology Lab.", |
"129a VMetro, inc.", |
" 0615 PBT-615 PCI-X Bus Analyzer", |
"129b Image Access", |
"129c Jaycor", |
"129d Compcore Multimedia, Inc.", |
"129e Victor Company of Japan, Ltd.", |
"129f OEC Medical Systems, Inc.", |
"12a0 Allen-Bradley Company", |
"12a1 Simpact Associates, Inc.", |
"12a2 Newgen Systems Corporation", |
"12a3 Lucent Technologies", |
" 8105 T8105 H100 Digital Switch", |
"12a4 NTT Electronics Technology Company", |
"12a5 Vision Dynamics Ltd.", |
"12a6 Scalable Networks, Inc.", |
"12a7 AMO GmbH", |
"12a8 News Datacom", |
"12a9 Xiotech Corporation", |
"12aa SDL Communications, Inc.", |
"12ab Yuan Yuan Enterprise Co., Ltd.", |
" 0002 AU8830 [Vortex2] Based Sound Card With A3D Support", |
" 3000 MPG-200C PCI DVD Decoder Card", |
"12ac Measurex Corporation", |
"12ad Multidata GmbH", |
"12ae Alteon Networks Inc.", |
" 0001 AceNIC Gigabit Ethernet", |
" 1014 0104 Gigabit Ethernet-SX PCI Adapter", |
" 12ae 0001 Gigabit Ethernet-SX (Universal)", |
" 1410 0104 Gigabit Ethernet-SX PCI Adapter", |
" 0002 AceNIC Gigabit Ethernet (Copper)", |
" 10a9 8002 Acenic Gigabit Ethernet", |
" 12ae 0002 Gigabit Ethernet-T (3C986-T)", |
" 00fa Farallon PN9100-T Gigabit Ethernet", |
"12af TDK USA Corp", |
"12b0 Jorge Scientific Corp", |
"12b1 GammaLink", |
"12b2 General Signal Networks", |
"12b3 Inter-Face Co Ltd", |
"12b4 FutureTel Inc", |
"12b5 Granite Systems Inc.", |
"12b6 Natural Microsystems", |
"12b7 Cognex Modular Vision Systems Div. - Acumen Inc.", |
"12b8 Korg", |
"12b9 3Com Corp, Modem Division", |
" 1006 WinModem", |
" 12b9 005c USR 56k Internal Voice WinModem (Model 3472)", |
" 12b9 005e USR 56k Internal WinModem (Models 662975)", |
" 12b9 0062 USR 56k Internal Voice WinModem (Model 662978)", |
" 12b9 0068 USR 56k Internal Voice WinModem (Model 5690)", |
" 12b9 007a USR 56k Internal Voice WinModem (Model 662974)", |
" 12b9 007f USR 56k Internal WinModem (Models 5698, 5699)", |
" 12b9 0080 USR 56k Internal WinModem (Models 2975, 3528)", |
" 12b9 0081 USR 56k Internal Voice WinModem (Models 2974, 3529)", |
" 12b9 0091 USR 56k Internal Voice WinModem (Model 2978)", |
" 1007 USR 56k Internal WinModem", |
" 12b9 00a3 USR 56k Internal WinModem (Model 3595)", |
" 1008 56K FaxModem Model 5610", |
" 12b9 00a2 USR 56k Internal FAX Modem (Model 2977)", |
" 12b9 00aa USR 56k Internal Voice Modem (Model 2976)", |
" 12b9 00ab USR 56k Internal Voice Modem (Model 5609)", |
" 12b9 00ac USR 56k Internal Voice Modem (Model 3298)", |
" 12b9 00ad USR 56k Internal FAX Modem (Model 5610)", |
"12ba BittWare, Inc.", |
"12bb Nippon Unisoft Corporation", |
"12bc Array Microsystems", |
"12bd Computerm Corp.", |
"12be Anchor Chips Inc.", |
" 3041 AN3041Q CO-MEM", |
" 3042 AN3042Q CO-MEM Lite", |
" 12be 3042 Anchor Chips Lite Evaluation Board", |
"12bf Fujifilm Microdevices", |
"12c0 Infimed", |
"12c1 GMM Research Corp", |
"12c2 Mentec Limited", |
"12c3 Holtek Microelectronics Inc", |
" 0058 PCI NE2K Ethernet", |
" 5598 PCI NE2K Ethernet", |
"12c4 Connect Tech Inc", |
" 0001 Blue HEAT/PCI 8 (RS232/CL/RJ11)", |
" 0002 Blue HEAT/PCI 4 (RS232)", |
" 0003 Blue HEAT/PCI 2 (RS232)", |
" 0004 Blue HEAT/PCI 8 (UNIV, RS485)", |
" 0005 Blue HEAT/PCI 4+4/6+2 (UNIV, RS232/485)", |
" 0006 Blue HEAT/PCI 4 (OPTO, RS485)", |
" 0007 Blue HEAT/PCI 2+2 (RS232/485)", |
" 0008 Blue HEAT/PCI 2 (OPTO, Tx, RS485)", |
" 0009 Blue HEAT/PCI 2+6 (RS232/485)", |
" 000a Blue HEAT/PCI 8 (Tx, RS485)", |
" 000b Blue HEAT/PCI 4 (Tx, RS485)", |
" 000c Blue HEAT/PCI 2 (20 MHz, RS485)", |
" 000d Blue HEAT/PCI 2 PTM", |
" 0100 NT960/PCI", |
" 0201 cPCI Titan - 2 Port", |
" 0202 cPCI Titan - 4 Port", |
" 0300 CTI PCI UART 2 (RS232)", |
" 0301 CTI PCI UART 4 (RS232)", |
" 0302 CTI PCI UART 8 (RS232)", |
" 0310 CTI PCI UART 1+1 (RS232/485)", |
" 0311 CTI PCI UART 2+2 (RS232/485)", |
" 0312 CTI PCI UART 4+4 (RS232/485)", |
" 0320 CTI PCI UART 2", |
" 0321 CTI PCI UART 4", |
" 0322 CTI PCI UART 8", |
" 0330 CTI PCI UART 2 (RS485)", |
" 0331 CTI PCI UART 4 (RS485)", |
" 0332 CTI PCI UART 8 (RS485)", |
"12c5 Picture Elements Incorporated", |
" 007e Imaging/Scanning Subsystem Engine", |
" 007f Imaging/Scanning Subsystem Engine", |
" 0081 PCIVST [Grayscale Thresholding Engine]", |
" 0085 Video Simulator/Sender", |
" 0086 THR2 Multi-scale Thresholder", |
"12c6 Mitani Corporation", |
"12c7 Dialogic Corp", |
"12c8 G Force Co, Ltd", |
"12c9 Gigi Operations", |
"12ca Integrated Computing Engines", |
"12cb Antex Electronics Corporation", |
"12cc Pluto Technologies International", |
"12cd Aims Lab", |
"12ce Netspeed Inc.", |
"12cf Prophet Systems, Inc.", |
"12d0 GDE Systems, Inc.", |
"12d1 PSITech", |
"12d2 NVidia / SGS Thomson (Joint Venture)", |
" 0008 NV1", |
" 0009 DAC64", |
" 0018 Riva128", |
" 1048 0c10 VICTORY Erazor", |
" 107b 8030 STB Velocity 128", |
" 1092 0350 Viper V330", |
" 1092 1092 Viper V330", |
" 10b4 1b1b STB Velocity 128", |
" 10b4 1b1d STB Velocity 128", |
" 10b4 1b1e STB Velocity 128, PAL TV-Out", |
" 10b4 1b20 STB Velocity 128 Sapphire", |
" 10b4 1b21 STB Velocity 128", |
" 10b4 1b22 STB Velocity 128 AGP, NTSC TV-Out", |
" 10b4 1b23 STB Velocity 128 AGP, PAL TV-Out", |
" 10b4 1b27 STB Velocity 128 DVD", |
" 10b4 1b88 MVP Pro 128", |
" 10b4 222a STB Velocity 128 AGP", |
" 10b4 2230 STB Velocity 128", |
" 10b4 2232 STB Velocity 128", |
" 10b4 2235 STB Velocity 128 AGP", |
" 2a15 54a3 3DVision-SAGP / 3DexPlorer 3000", |
" 0019 Riva128ZX", |
" 0020 TNT", |
" 0028 TNT2", |
" 0029 UTNT2", |
" 002c VTNT2", |
" 00a0 ITNT2", |
"12d3 Vingmed Sound A/S", |
"12d4 Ulticom (Formerly DGM&S)", |
" 0200 T1 Card", |
"12d5 Equator Technologies Inc", |
" 0003 BSP16", |
" 1000 BSP15", |
"12d6 Analogic Corp", |
"12d7 Biotronic SRL", |
"12d8 Pericom Semiconductor", |
" 8150 PCI to PCI Bridge", |
"12d9 Aculab PLC", |
" 0002 PCI Prosody", |
" 0004 cPCI Prosody", |
" 0005 Aculab E1/T1 PCI card", |
" 1078 Prosody X class e1000 device", |
" 12d9 000d Prosody X PCI", |
"12da True Time Inc.", |
"12db Annapolis Micro Systems, Inc", |
"12dc Symicron Computer Communication Ltd.", |
"12dd Management Graphics", |
"12de Rainbow Technologies", |
" 0200 CryptoSwift CS200", |
"12df SBS Technologies Inc", |
"12e0 Chase Research", |
" 0010 ST16C654 Quad UART", |
" 0020 ST16C654 Quad UART", |
" 0030 ST16C654 Quad UART", |
"12e1 Nintendo Co, Ltd", |
"12e2 Datum Inc. Bancomm-Timing Division", |
"12e3 Imation Corp - Medical Imaging Systems", |
"12e4 Brooktrout Technology Inc", |
"12e5 Apex Semiconductor Inc", |
"12e6 Cirel Systems", |
"12e7 Sunsgroup Corporation", |
"12e8 Crisc Corp", |
"12e9 GE Spacenet", |
"12ea Zuken", |
"12eb Aureal Semiconductor", |
" 0001 Vortex 1", |
" 104d 8036 AU8820 Vortex Digital Audio Processor", |
" 1092 2000 Sonic Impact A3D", |
" 1092 2100 Sonic Impact A3D", |
" 1092 2110 Sonic Impact A3D", |
" 1092 2200 Sonic Impact A3D", |
" 122d 1002 AU8820 Vortex Digital Audio Processor", |
" 12eb 0001 AU8820 Vortex Digital Audio Processor", |
" 5053 3355 Montego", |
" 0002 Vortex 2", |
" 104d 8049 AU8830 Vortex 3D Digital Audio Processor", |
" 104d 807b AU8830 Vortex 3D Digital Audio Processor", |
" 1092 3000 Monster Sound II", |
" 1092 3001 Monster Sound II", |
" 1092 3002 Monster Sound II", |
" 1092 3003 Monster Sound II", |
" 1092 3004 Monster Sound II", |
" 12eb 0002 AU8830 Vortex 3D Digital Audio Processor", |
" 12eb 0088 AU8830 Vortex 3D Digital Audio Processor", |
" 144d 3510 AU8830 Vortex 3D Digital Audio Processor", |
" 5053 3356 Montego II", |
" 0003 AU8810 Vortex Digital Audio Processor", |
" 104d 8049 AU8810 Vortex Digital Audio Processor", |
" 104d 8077 AU8810 Vortex Digital Audio Processor", |
" 109f 1000 AU8810 Vortex Digital Audio Processor", |
" 12eb 0003 AU8810 Vortex Digital Audio Processor", |
" 1462 6780 AU8810 Vortex Digital Audio Processor", |
" 14a4 2073 AU8810 Vortex Digital Audio Processor", |
" 14a4 2091 AU8810 Vortex Digital Audio Processor", |
" 14a4 2104 AU8810 Vortex Digital Audio Processor", |
" 14a4 2106 AU8810 Vortex Digital Audio Processor", |
" 8803 Vortex 56k Software Modem", |
" 12eb 8803 Vortex 56k Software Modem", |
"12ec 3A International, Inc.", |
"12ed Optivision Inc.", |
"12ee Orange Micro", |
"12ef Vienna Systems", |
"12f0 Pentek", |
"12f1 Sorenson Vision Inc", |
"12f2 Gammagraphx, Inc.", |
"12f3 Radstone Technology", |
"12f4 Megatel", |
"12f5 Forks", |
"12f6 Dawson France", |
"12f7 Cognex", |
"12f8 Electronic Design GmbH", |
" 0002 VideoMaker", |
"12f9 Four Fold Ltd", |
"12fb Spectrum Signal Processing", |
" 0001 PMC-MAI", |
" 00f5 F5 Dakar", |
" 02ad PMC-2MAI", |
" 2adc ePMC-2ADC", |
" 3100 PRO-3100", |
" 3500 PRO-3500", |
" 4d4f Modena", |
" 8120 ePMC-8120", |
" da62 Daytona C6201 PCI (Hurricane)", |
" db62 Ingliston XBIF", |
" dc62 Ingliston PLX9054", |
" dd62 Ingliston JTAG/ISP", |
" eddc ePMC-MSDDC", |
" fa01 ePMC-FPGA", |
"12fc Capital Equipment Corp", |
"12fd I2S", |
"12fe ESD Electronic System Design GmbH", |
"12ff Lexicon", |
"1300 Harman International Industries Inc", |
"1302 Computer Sciences Corp", |
"1303 Innovative Integration", |
"1304 Juniper Networks", |
"1305 Netphone, Inc", |
"1306 Duet Technologies", |
"1307 Measurement Computing", |
" 0001 PCI-DAS1602/16", |
" 000b PCI-DIO48H", |
" 000c PCI-PDISO8", |
" 000d PCI-PDISO16", |
" 000f PCI-DAS1200", |
" 0010 PCI-DAS1602/12", |
" 0014 PCI-DIO24H", |
" 0015 PCI-DIO24H/CTR3", |
" 0016 PCI-DIO48H/CTR15", |
" 0017 PCI-DIO96H", |
" 0018 PCI-CTR05", |
" 0019 PCI-DAS1200/JR", |
" 001a PCI-DAS1001", |
" 001b PCI-DAS1002", |
" 001c PCI-DAS1602JR/16", |
" 001d PCI-DAS6402/16", |
" 001e PCI-DAS6402/12", |
" 001f PCI-DAS16/M1", |
" 0020 PCI-DDA02/12", |
" 0021 PCI-DDA04/12", |
" 0022 PCI-DDA08/12", |
" 0023 PCI-DDA02/16", |
" 0024 PCI-DDA04/16", |
" 0025 PCI-DDA08/16", |
" 0026 PCI-DAC04/12-HS", |
" 0027 PCI-DAC04/16-HS", |
" 0028 PCI-DIO24", |
" 0029 PCI-DAS08", |
" 002c PCI-INT32", |
" 0033 PCI-DUAL-AC5", |
" 0034 PCI-DAS-TC", |
" 0035 PCI-DAS64/M1/16", |
" 0036 PCI-DAS64/M2/16", |
" 0037 PCI-DAS64/M3/16", |
" 004c PCI-DAS1000", |
" 004d PCI-QUAD04", |
" 0052 PCI-DAS4020/12", |
" 0054 PCI-DIO96", |
" 005e PCI-DAS6025", |
"1308 Jato Technologies Inc.", |
" 0001 NetCelerator Adapter", |
" 1308 0001 NetCelerator Adapter", |
"1309 AB Semiconductor Ltd", |
"130a Mitsubishi Electric Microcomputer", |
"130b Colorgraphic Communications Corp", |
"130c Ambex Technologies, Inc", |
"130d Accelerix Inc", |
"130e Yamatake-Honeywell Co. Ltd", |
"130f Advanet Inc", |
"1310 Gespac", |
"1311 Videoserver, Inc", |
"1312 Acuity Imaging, Inc", |
"1313 Yaskawa Electric Co.", |
"1316 Teradyne Inc", |
"1317 Linksys", |
" 0981 21x4x DEC-Tulip compatible 10/100 Ethernet", |
" 0985 NC100 Network Everywhere Fast Ethernet 10/100", |
" 1734 100c Scenic N300 ADMtek AN983 10/100 Mbps PCI Adapter", |
" 1985 21x4x DEC-Tulip compatible 10/100 Ethernet", |
" 2850 HSP MicroModem 56", |
" 5120 ADMtek ADM5120 OpenGate System-on-Chip", |
" 8201 ADMtek ADM8211 802.11b Wireless Interface", |
" 10b8 2635 SMC2635W 802.11b (11Mbps) wireless lan pcmcia (cardbus) card", |
" 1317 8201 SMC2635W 802.11b (11mbps) wireless lan pcmcia (cardbus) card", |
" 8211 ADMtek ADM8211 802.11b Wireless Interface", |
" 9511 21x4x DEC-Tulip compatible 10/100 Ethernet", |
"1318 Packet Engines Inc.", |
" 0911 GNIC-II PCI Gigabit Ethernet [Hamachi]", |
"1319 Fortemedia, Inc", |
" 0801 Xwave QS3000A [FM801]", |
" 1319 1319 FM801 PCI Audio", |
" 0802 Xwave QS3000A [FM801 game port]", |
" 1319 1319 FM801 PCI Joystick", |
" 1000 FM801 PCI Audio", |
" 1001 FM801 PCI Joystick", |
"131a Finisar Corp.", |
"131c Nippon Electro-Sensory Devices Corp", |
"131d Sysmic, Inc.", |
"131e Xinex Networks Inc", |
"131f Siig Inc", |
" 1000 CyberSerial (1-port) 16550", |
" 1001 CyberSerial (1-port) 16650", |
" 1002 CyberSerial (1-port) 16850", |
" 1010 Duet 1S(16550)+1P", |
" 1011 Duet 1S(16650)+1P", |
" 1012 Duet 1S(16850)+1P", |
" 1020 CyberParallel (1-port)", |
" 1021 CyberParallel (2-port)", |
" 1030 CyberSerial (2-port) 16550", |
" 1031 CyberSerial (2-port) 16650", |
" 1032 CyberSerial (2-port) 16850", |
" 1034 Trio 2S(16550)+1P", |
" 1035 Trio 2S(16650)+1P", |
" 1036 Trio 2S(16850)+1P", |
" 1050 CyberSerial (4-port) 16550", |
" 1051 CyberSerial (4-port) 16650", |
" 1052 CyberSerial (4-port) 16850", |
" 2000 CyberSerial (1-port) 16550", |
" 2001 CyberSerial (1-port) 16650", |
" 2002 CyberSerial (1-port) 16850", |
" 2010 Duet 1S(16550)+1P", |
" 2011 Duet 1S(16650)+1P", |
" 2012 Duet 1S(16850)+1P", |
" 2020 CyberParallel (1-port)", |
" 2021 CyberParallel (2-port)", |
" 2030 CyberSerial (2-port) 16550", |
" 131f 2030 PCI Serial Card", |
" 2031 CyberSerial (2-port) 16650", |
" 2032 CyberSerial (2-port) 16850", |
" 2040 Trio 1S(16550)+2P", |
" 2041 Trio 1S(16650)+2P", |
" 2042 Trio 1S(16850)+2P", |
" 2050 CyberSerial (4-port) 16550", |
" 2051 CyberSerial (4-port) 16650", |
" 2052 CyberSerial (4-port) 16850", |
" 2060 Trio 2S(16550)+1P", |
" 2061 Trio 2S(16650)+1P", |
" 2062 Trio 2S(16850)+1P", |
" 2081 CyberSerial (8-port) ST16654", |
"1320 Crypto AG", |
"1321 Arcobel Graphics BV", |
"1322 MTT Co., Ltd", |
"1323 Dome Inc", |
"1324 Sphere Communications", |
"1325 Salix Technologies, Inc", |
"1326 Seachange international", |
"1327 Voss scientific", |
"1328 quadrant international", |
"1329 Productivity Enhancement", |
"132a Microcom Inc.", |
"132b Broadband Technologies", |
"132c Micrel Inc", |
"132d Integrated Silicon Solution, Inc.", |
"1330 MMC Networks", |
"1331 Radisys Corp.", |
" 0030 ENP-2611", |
" 8200 82600 Host Bridge", |
" 8201 82600 IDE", |
" 8202 82600 USB", |
" 8210 82600 PCI Bridge", |
"1332 Micro Memory", |
" 5415 MM-5415CN PCI Memory Module with Battery Backup", |
" 5425 MM-5425CN PCI 64/66 Memory Module with Battery Backup", |
" 6140 MM-6140D", |
"1334 Redcreek Communications, Inc", |
"1335 Videomail, Inc", |
"1337 Third Planet Publishing", |
"1338 BT Electronics", |
"133a Vtel Corp", |
"133b Softcom Microsystems", |
"133c Holontech Corp", |
"133d SS Technologies", |
"133e Virtual Computer Corp", |
"133f SCM Microsystems", |
"1340 Atalla Corp", |
"1341 Kyoto Microcomputer Co", |
"1342 Promax Systems Inc", |
"1343 Phylon Communications Inc", |
"1344 Crucial Technology", |
"1345 Arescom Inc", |
"1347 Odetics", |
"1349 Sumitomo Electric Industries, Ltd.", |
"134a DTC Technology Corp.", |
" 0001 Domex 536", |
" 0002 Domex DMX3194UP SCSI Adapter", |
"134b ARK Research Corp.", |
"134c Chori Joho System Co. Ltd", |
"134d PCTel Inc", |
" 2189 HSP56 MicroModem", |
" 2486 2304WT V.92 MDC Modem", |
" 7890 HSP MicroModem 56", |
" 134d 0001 PCT789 adapter", |
" 7891 HSP MicroModem 56", |
" 134d 0001 HSP MicroModem 56", |
" 7892 HSP MicroModem 56", |
" 7893 HSP MicroModem 56", |
" 7894 HSP MicroModem 56", |
" 7895 HSP MicroModem 56", |
" 7896 HSP MicroModem 56", |
" 7897 HSP MicroModem 56", |
"134e CSTI", |
"134f Algo System Co Ltd", |
"1350 Systec Co. Ltd", |
"1351 Sonix Inc", |
"1353 Thales Idatys", |
" 0002 Proserver", |
" 0003 PCI-FUT", |
" 0004 PCI-S0", |
" 0005 PCI-FUT-S0", |
"1354 Dwave System Inc", |
"1355 Kratos Analytical Ltd", |
"1356 The Logical Co", |
"1359 Prisa Networks", |
"135a Brain Boxes", |
"135b Giganet Inc", |
"135c Quatech Inc", |
" 0010 QSC-100", |
" 0020 DSC-100", |
" 0030 DSC-200/300", |
" 0040 QSC-200/300", |
" 0050 ESC-100D", |
" 0060 ESC-100M", |
" 00f0 MPAC-100 Syncronous Serial Card (Zilog 85230)", |
" 0170 QSCLP-100", |
" 0180 DSCLP-100", |
" 0190 SSCLP-100", |
" 01a0 QSCLP-200/300", |
" 01b0 DSCLP-200/300", |
" 01c0 SSCLP-200/300", |
"135d ABB Network Partner AB", |
"135e Sealevel Systems Inc", |
" 5101 Route 56.PCI - Multi-Protocol Serial Interface (Zilog Z16C32)", |
" 7101 Single Port RS-232/422/485/530", |
" 7201 Dual Port RS-232/422/485 Interface", |
" 7202 Dual Port RS-232 Interface", |
" 7401 Four Port RS-232 Interface", |
" 7402 Four Port RS-422/485 Interface", |
" 7801 Eight Port RS-232 Interface", |
" 7804 Eight Port RS-232/422/485 Interface", |
" 8001 8001 Digital I/O Adapter", |
"135f I-Data International A-S", |
"1360 Meinberg Funkuhren", |
" 0101 PCI32 DCF77 Radio Clock", |
" 0102 PCI509 DCF77 Radio Clock", |
" 0103 PCI510 DCF77 Radio Clock", |
" 0104 PCI511 DCF77 Radio Clock", |
" 0201 GPS167PCI GPS Receiver", |
" 0202 GPS168PCI GPS Receiver", |
" 0203 GPS169PCI GPS Receiver", |
" 0204 GPS170PCI GPS Receiver", |
" 0301 TCR510PCI IRIG Timecode Reader", |
" 0302 TCR167PCI IRIG Timecode Reader", |
"1361 Soliton Systems K.K.", |
"1362 Fujifacom Corporation", |
"1363 Phoenix Technology Ltd", |
"1364 ATM Communications Inc", |
"1365 Hypercope GmbH", |
"1366 Teijin Seiki Co. Ltd", |
"1367 Hitachi Zosen Corporation", |
"1368 Skyware Corporation", |
"1369 Digigram", |
"136a High Soft Tech", |
"136b Kawasaki Steel Corporation", |
" ff01 KL5A72002 Motion JPEG", |
"136c Adtek System Science Co Ltd", |
"136d Gigalabs Inc", |
"136f Applied Magic Inc", |
"1370 ATL Products", |
"1371 CNet Technology Inc", |
" 434e GigaCard Network Adapter", |
" 1371 434e N-Way PCI-Bus Giga-Card 1000/100/10Mbps(L)", |
"1373 Silicon Vision Inc", |
"1374 Silicom Ltd.", |
" 0024 Silicom Dual port Giga Ethernet BGE Bypass Server Adapter", |
" 0025 Silicom Quad port Giga Ethernet BGE Bypass Server Adapter", |
" 0026 Silicom Dual port Fiber Giga Ethernet 546 Bypass Server Adapter", |
" 0027 Silicom Dual port Fiber LX Giga Ethernet 546 Bypass Server Adapter", |
" 0029 Silicom Dual port Copper Giga Ethernet 546GB Bypass Server Adapter", |
" 002a Silicom Dual port Fiber Giga Ethernet 546 TAP/Bypass Server Adapter", |
" 002b Silicom Dual port Copper Fast Ethernet 546 TAP/Bypass Server Adapter (PXE2TBI)", |
" 002c Silicom Quad port Copper Giga Ethernet 546GB Bypass Server Adapter (PXG4BPI)", |
" 002d Silicom Quad port Fiber-SX Giga Ethernet 546GB Bypass Server Adapter (PXG4BPFI)", |
" 002e Silicom Quad port Fiber-LX Giga Ethernet 546GB Bypass Server Adapter (PXG4BPFI-LX)", |
" 002f Silicom Dual port Fiber-SX Giga Ethernet 546GB Low profile Bypass Server Adapter (PXG2BPFIL)", |
" 0030 Silicom Dual port Fiber-LX Giga Ethernet 546GB Low profile Bypass Server Adapter", |
" 0031 Silicom Quad port Copper Giga Ethernet PCI-E Bypass Server Adapter", |
" 0032 Silicom Dual port Copper Fast Ethernet 546 TAP/Bypass Server Adapter", |
" 0034 Silicom Dual port Copper Giga Ethernet PCI-E BGE Bypass Server Adapter", |
" 0035 Silicom Quad port Copper Giga Ethernet PCI-E BGE Bypass Server Adapter", |
" 0036 Silicom Dual port Fiber Giga Ethernet PCI-E BGE Bypass Server Adapter", |
" 0037 Silicom Quad port Copper Ethernet PCI-E Intel based Bypass Server Adapter", |
" 0038 Silicom Quad port Copper Ethernet PCI-E Intel based Bypass Server Adapter", |
" 0039 Silicom Dual port Fiber-SX Ethernet PCI-E Intel based Bypass Server Adapter", |
" 003a Silicom Dual port Fiber-LX Ethernet PCI-E Intel based Bypass Server Adapter", |
"1375 Argosystems Inc", |
"1376 LMC", |
"1377 Electronic Equipment Production & Distribution GmbH", |
"1378 Telemann Co. Ltd", |
"1379 Asahi Kasei Microsystems Co Ltd", |
"137a Mark of the Unicorn Inc", |
" 0001 PCI-324 Audiowire Interface", |
"137b PPT Vision", |
"137c Iwatsu Electric Co Ltd", |
"137d Dynachip Corporation", |
"137e Patriot Scientific Corporation", |
"137f Japan Satellite Systems Inc", |
"1380 Sanritz Automation Co Ltd", |
"1381 Brains Co. Ltd", |
"1382 Marian - Electronic & Software", |
" 0001 ARC88 audio recording card", |
" 2008 Prodif 96 Pro sound system", |
" 2048 Prodif Plus sound system", |
" 2088 Marc 8 Midi sound system", |
" 20c8 Marc A sound system", |
" 4008 Marc 2 sound system", |
" 4010 Marc 2 Pro sound system", |
" 4048 Marc 4 MIDI sound system", |
" 4088 Marc 4 Digi sound system", |
" 4248 Marc X sound system", |
" 4424 TRACE D4 Sound System", |
"1383 Controlnet Inc", |
"1384 Reality Simulation Systems Inc", |
"1385 Netgear", |
" 0013 WG311T 108 Mbps Wireless PCI Adapter", |
" 311a GA511 Gigabit Ethernet", |
" 4100 802.11b Wireless Adapter (MA301)", |
" 4105 MA311 802.11b wireless adapter", |
" 4251 WG111T 108 Mbps Wireless USB 2.0 Adapter", |
" 4400 WAG511 802.11a/b/g Dual Band Wireless PC Card", |
" 4600 WAG511 802.11a/b/g Dual Band Wireless PC Card", |
" 4601 WAG511 802.11a/b/g Dual Band Wireless PC Card", |
" 4610 WAG511 802.11a/b/g Dual Band Wireless PC Card", |
" 4800 WG511(v1) 54 Mbps Wireless PC Card", |
" 4900 WG311v1 54 Mbps Wireless PCI Adapter", |
" 4a00 WAG311 802.11a/g Wireless PCI Adapter", |
" 4b00 WG511T 108 Mbps Wireless PC Card", |
" 4c00 WG311v2 54 Mbps Wireless PCI Adapter", |
" 4d00 WG311T 108 Mbps Wireless PCI Adapter", |
" 4e00 WG511v2 54 Mbps Wireless PC Card", |
" 4f00 WG511U Double 108 Mbps Wireless PC Card", |
" 5200 GA511 Gigabit PC Card", |
" 620a GA620 Gigabit Ethernet", |
" 622a GA622", |
" 630a GA630 Gigabit Ethernet", |
" 6b00 WG311v3 54 Mbps Wireless PCI Adapter", |
" 6d00 WPNT511 RangeMax 240 Mbps Wireless PC Card", |
" f004 FA310TX", |
"1386 Video Domain Technologies", |
"1387 Systran Corp", |
"1388 Hitachi Information Technology Co Ltd", |
"1389 Applicom International", |
" 0001 PCI1500PFB [Intelligent fieldbus adaptor]", |
"138a Fusion Micromedia Corp", |
"138b Tokimec Inc", |
"138c Silicon Reality", |
"138d Future Techno Designs pte Ltd", |
"138e Basler GmbH", |
"138f Patapsco Designs Inc", |
"1390 Concept Development Inc", |
"1391 Development Concepts Inc", |
"1392 Medialight Inc", |
"1393 Moxa Technologies Co Ltd", |
" 1040 Smartio C104H/PCI", |
" 1141 Industrio CP-114", |
" 1680 Smartio C168H/PCI", |
" 2040 Intellio CP-204J", |
" 2180 Intellio C218 Turbo PCI", |
" 3200 Intellio C320 Turbo PCI", |
"1394 Level One Communications", |
" 0001 LXT1001 Gigabit Ethernet", |
" 1394 0001 NetCelerator Adapter", |
"1395 Ambicom Inc", |
"1396 Cipher Systems Inc", |
"1397 Cologne Chip Designs GmbH", |
" 08b4 ISDN network Controller [HFC-4S]", |
" 1397 b520 HFC-4S [IOB4ST]", |
" 1397 b540 HFC-4S [Swyx 4xS0 SX2 QuadBri]", |
" 16b8 ISDN network Controller [HFC-8S]", |
" 2bd0 ISDN network controller [HFC-PCI]", |
" 0675 1704 ISDN Adapter (PCI Bus, D, C)", |
" 0675 1708 ISDN Adapter (PCI Bus, D, C, ACPI)", |
" 1397 2bd0 ISDN Board", |
" e4bf 1000 CI1-1-Harp", |
"1398 Clarion co. Ltd", |
"1399 Rios systems Co Ltd", |
"139a Alacritech Inc", |
" 0001 Quad Port 10/100 Server Accelerator", |
" 0003 Single Port 10/100 Server Accelerator", |
" 0005 Single Port Gigabit Server Accelerator", |
"139b Mediasonic Multimedia Systems Ltd", |
"139c Quantum 3d Inc", |
"139d EPL limited", |
"139e Media4", |
"139f Aethra s.r.l.", |
"13a0 Crystal Group Inc", |
"13a1 Kawasaki Heavy Industries Ltd", |
"13a2 Ositech Communications Inc", |
"13a3 Hifn Inc.", |
" 0005 7751 Security Processor", |
" 0006 6500 Public Key Processor", |
" 0007 7811 Security Processor", |
" 0012 7951 Security Processor", |
" 0014 78XX Security Processor", |
" 0016 8065 Security Processor", |
" 0017 8165 Security Processor", |
" 0018 8154 Security Processor", |
" 001d 7956 Security Processor", |
" 0020 7955 Security Processor", |
" 0026 8155 Security Processor", |
"13a4 Rascom Inc", |
"13a5 Audio Digital Imaging Inc", |
"13a6 Videonics Inc", |
"13a7 Teles AG", |
"13a8 Exar Corp.", |
" 0152 XR17C/D152 Dual PCI UART", |
" 0154 XR17C154 Quad UART", |
" 0158 XR17C158 Octal UART", |
"13a9 Siemens Medical Systems, Ultrasound Group", |
"13aa Broadband Networks Inc", |
"13ab Arcom Control Systems Ltd", |
"13ac Motion Media Technology Ltd", |
"13ad Nexus Inc", |
"13ae ALD Technology Ltd", |
"13af T.Sqware", |
"13b0 Maxspeed Corp", |
"13b1 Tamura corporation", |
"13b2 Techno Chips Co. Ltd", |
"13b3 Lanart Corporation", |
"13b4 Wellbean Co Inc", |
"13b5 ARM", |
"13b6 Dlog GmbH", |
"13b7 Logic Devices Inc", |
"13b8 Nokia Telecommunications oy", |
"13b9 Elecom Co Ltd", |
"13ba Oxford Instruments", |
"13bb Sanyo Technosound Co Ltd", |
"13bc Bitran Corporation", |
"13bd Sharp corporation", |
"13be Miroku Jyoho Service Co. Ltd", |
"13bf Sharewave Inc", |
"13c0 Microgate Corporation", |
" 0010 SyncLink Adapter v1", |
" 0020 SyncLink SCC Adapter", |
" 0030 SyncLink Multiport Adapter", |
" 0210 SyncLink Adapter v2", |
"13c1 3ware Inc", |
" 1000 5xxx/6xxx-series PATA-RAID", |
" 1001 7xxx/8xxx-series PATA/SATA-RAID", |
" 13c1 1001 7xxx/8xxx-series PATA/SATA-RAID", |
" 1002 9xxx-series SATA-RAID", |
" 1003 9550SX SATA-RAID", |
"13c2 Technotrend Systemtechnik GmbH", |
" 000e Technotrend/Hauppauge DVB card rev2.3", |
"13c3 Janz Computer AG", |
"13c4 Phase Metrics", |
"13c5 Alphi Technology Corp", |
"13c6 Condor Engineering Inc", |
" 0520 CEI-520 A429 Card", |
" 0620 CEI-620 A429 Card", |
" 0820 CEI-820 A429 Card", |
"13c7 Blue Chip Technology Ltd", |
"13c8 Apptech Inc", |
"13c9 Eaton Corporation", |
"13ca Iomega Corporation", |
"13cb Yano Electric Co Ltd", |
"13cc Metheus Corporation", |
"13cd Compatible Systems Corporation", |
"13ce Cocom A/S", |
"13cf Studio Audio & Video Ltd", |
"13d0 Techsan Electronics Co Ltd", |
" 2103 B2C2 FlexCopII DVB chip / Technisat SkyStar2 DVB card", |
" 2200 B2C2 FlexCopIII DVB chip / Technisat SkyStar2 DVB card", |
"13d1 Abocom Systems Inc", |
" ab02 ADMtek Centaur-C rev 17 [D-Link DFE-680TX] CardBus Fast Ethernet Adapter", |
" ab03 21x4x DEC-Tulip compatible 10/100 Ethernet", |
" ab06 RTL8139 [FE2000VX] CardBus Fast Ethernet Attached Port Adapter", |
" ab08 21x4x DEC-Tulip compatible 10/100 Ethernet", |
"13d2 Shark Multimedia Inc", |
"13d3 IMC Networks", |
"13d4 Graphics Microsystems Inc", |
"13d5 Media 100 Inc", |
"13d6 K.I. Technology Co Ltd", |
"13d7 Toshiba Engineering Corporation", |
"13d8 Phobos corporation", |
"13d9 Apex PC Solutions Inc", |
"13da Intresource Systems pte Ltd", |
"13db Janich & Klass Computertechnik GmbH", |
"13dc Netboost Corporation", |
"13dd Multimedia Bundle Inc", |
"13de ABB Robotics Products AB", |
"13df E-Tech Inc", |
" 0001 PCI56RVP Modem", |
" 13df 0001 PCI56RVP Modem", |
"13e0 GVC Corporation", |
"13e1 Silicom Multimedia Systems Inc", |
"13e2 Dynamics Research Corporation", |
"13e3 Nest Inc", |
"13e4 Calculex Inc", |
"13e5 Telesoft Design Ltd", |
"13e6 Argosy research Inc", |
"13e7 NAC Incorporated", |
"13e8 Chip Express Corporation", |
"13e9 Intraserver Technology Inc", |
"13ea Dallas Semiconductor", |
"13eb Hauppauge Computer Works Inc", |
"13ec Zydacron Inc", |
" 000a NPC-RC01 Remote control receiver", |
"13ed Raytheion E-Systems", |
"13ee Hayes Microcomputer Products Inc", |
"13ef Coppercom Inc", |
"13f0 Sundance Technology Inc / IC Plus Corp", |
" 0200 IC Plus IP100A Integrated 10/100 Ethernet MAC + PHY", |
" 0201 ST201 Sundance Ethernet", |
" 1023 IC Plus IP1000 Family Gigabit Ethernet", |
"13f1 Oce' - Technologies B.V.", |
"13f2 Ford Microelectronics Inc", |
"13f3 Mcdata Corporation", |
"13f4 Troika Networks, Inc.", |
" 1401 Zentai Fibre Channel Adapter", |
"13f5 Kansai Electric Co. Ltd", |
"13f6 C-Media Electronics Inc", |
" 0011 CMI8738", |
" 0100 CM8338A", |
" 13f6 ffff CMI8338/C3DX PCI Audio Device", |
" 0101 CM8338B", |
" 13f6 0101 CMI8338-031 PCI Audio Device", |
" 0111 CM8738", |
" 1019 0970 P6STP-FL motherboard", |
" 1043 8035 CUSI-FX motherboard", |
" 1043 8077 CMI8738 6-channel audio controller", |
" 1043 80e2 CMI8738 6ch-MX", |
" 13f6 0111 CMI8738/C3DX PCI Audio Device", |
" 1681 a000 Gamesurround MUSE XL", |
" 0211 CM8738", |
"13f7 Wildfire Communications", |
"13f8 Ad Lib Multimedia Inc", |
"13f9 NTT Advanced Technology Corp.", |
"13fa Pentland Systems Ltd", |
"13fb Aydin Corp", |
"13fc Computer Peripherals International", |
"13fd Micro Science Inc", |
"13fe Advantech Co. Ltd", |
" 1240 PCI-1240 4-channel stepper motor controller card", |
" 1600 PCI-1612 4-port RS-232/422/485 PCI communication card", |
" 1733 PCI-1733 32-channel isolated digital input card", |
" 1752 PCI-1752", |
" 1754 PCI-1754", |
" 1756 PCI-1756", |
"13ff Silicon Spice Inc", |
"1400 Artx Inc", |
" 1401 9432 TX", |
"1401 CR-Systems A/S", |
"1402 Meilhaus Electronic GmbH", |
"1403 Ascor Inc", |
"1404 Fundamental Software Inc", |
"1405 Excalibur Systems Inc", |
"1406 Oce' Printing Systems GmbH", |
"1407 Lava Computer mfg Inc", |
" 0100 Lava Dual Serial", |
" 0101 Lava Quatro A", |
" 0102 Lava Quatro B", |
" 0110 Lava DSerial-PCI Port A", |
" 0111 Lava DSerial-PCI Port B", |
" 0120 Quattro-PCI A", |
" 0121 Quattro-PCI B", |
" 0180 Lava Octo A", |
" 0181 Lava Octo B", |
" 0200 Lava Port Plus", |
" 0201 Lava Quad A", |
" 0202 Lava Quad B", |
" 0220 Lava Quattro PCI Ports A/B", |
" 0221 Lava Quattro PCI Ports C/D", |
" 0500 Lava Single Serial", |
" 0600 Lava Port 650", |
" 8000 Lava Parallel", |
" 8001 Dual parallel port controller A", |
" 8002 Lava Dual Parallel port A", |
" 8003 Lava Dual Parallel port B", |
" 8800 BOCA Research IOPPAR", |
"1408 Aloka Co. Ltd", |
"1409 Timedia Technology Co Ltd", |
" 7168 PCI2S550 (Dual 16550 UART)", |
"140a DSP Research Inc", |
"140b Ramix Inc", |
"140c Elmic Systems Inc", |
"140d Matsushita Electric Works Ltd", |
"140e Goepel Electronic GmbH", |
"140f Salient Systems Corp", |
"1410 Midas lab Inc", |
"1411 Ikos Systems Inc", |
"1412 VIA Technologies Inc.", |
" 1712 ICE1712 [Envy24] PCI Multi-Channel I/O Controller", |
" 1412 1712 Hoontech ST Audio DSP 24", |
" 1412 d630 M-Audio Delta 1010", |
" 1412 d631 M-Audio Delta DiO", |
" 1412 d632 M-Audio Delta 66", |
" 1412 d633 M-Audio Delta 44", |
" 1412 d634 M-Audio Delta Audiophile", |
" 1412 d635 M-Audio Delta TDIF", |
" 1412 d637 M-Audio Delta RBUS", |
" 1412 d638 M-Audio Delta 410", |
" 1412 d63b M-Audio Delta 1010LT", |
" 1412 d63c Digigram VX442", |
" 1416 1712 Hoontech ST Audio DSP 24 Media 7.1", |
" 153b 1115 EWS88 MT", |
" 153b 1125 EWS88 MT (Master)", |
" 153b 112b EWS88 D", |
" 153b 112c EWS88 D (Master)", |
" 153b 1130 EWX 24/96", |
" 153b 1138 DMX 6fire 24/96", |
" 153b 1151 PHASE88", |
" 16ce 1040 Edirol DA-2496", |
" 1724 VT1720/24 [Envy24PT/HT] PCI Multi-Channel Audio Controller", |
" 1412 1724 Albatron PX865PE 7.1", |
" 1412 3630 M-Audio Revolution 7.1", |
" 1412 3631 M-Audio Revolution 5.1", |
" 153b 1145 Aureon 7.1 Space", |
" 153b 1147 Aureon 5.1 Sky", |
" 153b 1153 Aureon 7.1 Universe", |
" 270f f641 ZNF3-150", |
" 270f f645 ZNF3-250", |
"1413 Addonics", |
"1414 Microsoft Corporation", |
"1415 Oxford Semiconductor Ltd", |
" 8403 VScom 011H-EP1 1 port parallel adaptor", |
" 9501 OX16PCI954 (Quad 16950 UART) function 0", |
" 131f 2050 CyberPro (4-port)", |
" 131f 2051 CyberSerial 4S Plus", |
" 15ed 2000 MCCR Serial p0-3 of 8", |
" 15ed 2001 MCCR Serial p0-3 of 16", |
" 950a EXSYS EX-41092 Dual 16950 Serial adapter", |
" 950b OXCB950 Cardbus 16950 UART", |
" 9510 OX16PCI954 (Quad 16950 UART) function 1 (Disabled)", |
" 9511 OX16PCI954 (Quad 16950 UART) function 1", |
" 15ed 2000 MCCR Serial p4-7 of 8", |
" 15ed 2001 MCCR Serial p4-15 of 16", |
" 9521 OX16PCI952 (Dual 16950 UART)", |
" 9523 OX16PCI952 Integrated Parallel Port", |
"1416 Multiwave Innovation pte Ltd", |
"1417 Convergenet Technologies Inc", |
"1418 Kyushu electronics systems Inc", |
"1419 Excel Switching Corp", |
"141a Apache Micro Peripherals Inc", |
"141b Zoom Telephonics Inc", |
"141d Digitan Systems Inc", |
"141e Fanuc Ltd", |
"141f Visiontech Ltd", |
"1420 Psion Dacom plc", |
" 8002 Gold Card NetGlobal 56k+10/100Mb CardBus (Ethernet part)", |
" 8003 Gold Card NetGlobal 56k+10/100Mb CardBus (Modem part)", |
"1421 Ads Technologies Inc", |
"1422 Ygrec Systems Co Ltd", |
"1423 Custom Technology Corp.", |
"1424 Videoserver Connections", |
"1425 Chelsio Communications Inc", |
" 000b T210 Protocol Engine", |
"1426 Storage Technology Corp.", |
"1427 Better On-Line Solutions", |
"1428 Edec Co Ltd", |
"1429 Unex Technology Corp.", |
"142a Kingmax Technology Inc", |
"142b Radiolan", |
"142c Minton Optic Industry Co Ltd", |
"142d Pix stream Inc", |
"142e Vitec Multimedia", |
" 4020 VM2-2 [Video Maker 2] MPEG1/2 Encoder", |
" 4337 VM2-2-C7 [Video Maker 2 rev. C7] MPEG1/2 Encoder", |
"142f Radicom Research Inc", |
"1430 ITT Aerospace/Communications Division", |
"1431 Gilat Satellite Networks", |
"1432 Edimax Computer Co.", |
" 9130 RTL81xx Fast Ethernet", |
"1433 Eltec Elektronik GmbH", |
"1435 RTD Embedded Technologies, Inc.", |
"1436 CIS Technology Inc", |
"1437 Nissin Inc Co", |
"1438 Atmel-dream", |
"1439 Outsource Engineering & Mfg. Inc", |
"143a Stargate Solutions Inc", |
"143b Canon Research Center, America", |
"143c Amlogic Inc", |
"143d Tamarack Microelectronics Inc", |
"143e Jones Futurex Inc", |
"143f Lightwell Co Ltd - Zax Division", |
"1440 ALGOL Corp.", |
"1441 AGIE Ltd", |
"1442 Phoenix Contact GmbH & Co.", |
"1443 Unibrain S.A.", |
"1444 TRW", |
"1445 Logical DO Ltd", |
"1446 Graphin Co Ltd", |
"1447 AIM GmBH", |
"1448 Alesis Studio Electronics", |
"1449 TUT Systems Inc", |
"144a Adlink Technology", |
" 7296 PCI-7296", |
" 7432 PCI-7432", |
" 7433 PCI-7433", |
" 7434 PCI-7434", |
" 7841 PCI-7841", |
" 8133 PCI-8133", |
" 8164 PCI-8164", |
" 8554 PCI-8554", |
" 9111 PCI-9111", |
" 9113 PCI-9113", |
" 9114 PCI-9114", |
"144b Loronix Information Systems Inc", |
"144c Catalina Research Inc", |
"144d Samsung Electronics Co Ltd", |
" c00c P35 laptop", |
"144e OLITEC", |
"144f Askey Computer Corp.", |
"1450 Octave Communications Ind.", |
"1451 SP3D Chip Design GmBH", |
"1453 MYCOM Inc", |
"1454 Altiga Networks", |
"1455 Logic Plus Plus Inc", |
"1456 Advanced Hardware Architectures", |
"1457 Nuera Communications Inc", |
"1458 Giga-byte Technology", |
" 0c11 K8NS Pro Mainboard", |
" e911 GN-WIAG02", |
"1459 DOOIN Electronics", |
"145a Escalate Networks Inc", |
"145b PRAIM SRL", |
"145c Cryptek", |
"145d Gallant Computer Inc", |
"145e Aashima Technology B.V.", |
"145f Baldor Electric Company", |
" 0001 NextMove PCI", |
"1460 DYNARC INC", |
"1461 Avermedia Technologies Inc", |
" f436 AVerTV Hybrid+FM", |
"1462 Micro-Star International Co., Ltd.", |
" 5501 nVidia NV15DDR [GeForce2 Ti]", |
" 6819 Broadcom Corporation BCM4306 802.11b/g Wireless LAN Controller [MSI CB54G]", |
" 6825 PCI Card wireless 11g [PC54G]", |
" 6834 RaLink RT2500 802.11g [PC54G2]", |
" 7125 K8N motherboard", |
" 8725 NVIDIA NV25 [GeForce4 Ti 4600] VGA Adapter", |
" 9000 NVIDIA NV28 [GeForce4 Ti 4800] VGA Adapter", |
" 9110 GeFORCE FX5200", |
" 9119 NVIDIA NV31 [GeForce FX 5600XT] VGA Adapter", |
" 9123 NVIDIA NV31 [GeForce FX 5600] FX5600-VTDR128 [MS-8912]", |
" 9591 nVidia Corporation NV36 [GeForce FX 5700LE]", |
"1463 Fast Corporation", |
"1464 Interactive Circuits & Systems Ltd", |
"1465 GN NETTEST Telecom DIV.", |
"1466 Designpro Inc.", |
"1467 DIGICOM SPA", |
"1468 AMBIT Microsystem Corp.", |
"1469 Cleveland Motion Controls", |
"146a IFR", |
"146b Parascan Technologies Ltd", |
"146c Ruby Tech Corp.", |
" 1430 FE-1430TX Fast Ethernet PCI Adapter", |
"146d Tachyon, INC.", |
"146e Williams Electronics Games, Inc.", |
"146f Multi Dimensional Consulting Inc", |
"1470 Bay Networks", |
"1471 Integrated Telecom Express Inc", |
"1472 DAIKIN Industries, Ltd", |
"1473 ZAPEX Technologies Inc", |
"1474 Doug Carson & Associates", |
"1475 PICAZO Communications", |
"1476 MORTARA Instrument Inc", |
"1477 Net Insight", |
"1478 DIATREND Corporation", |
"1479 TORAY Industries Inc", |
"147a FORMOSA Industrial Computing", |
"147b ABIT Computer Corp.", |
"147c AWARE, Inc.", |
"147d Interworks Computer Products", |
"147e Matsushita Graphic Communication Systems, Inc.", |
"147f NIHON UNISYS, Ltd.", |
"1480 SCII Telecom", |
"1481 BIOPAC Systems Inc", |
"1482 ISYTEC - Integrierte Systemtechnik GmBH", |
"1483 LABWAY Corporation", |
"1484 Logic Corporation", |
"1485 ERMA - Electronic GmBH", |
"1486 L3 Communications Telemetry & Instrumentation", |
"1487 MARQUETTE Medical Systems", |
"1488 KONTRON Electronik GmBH", |
"1489 KYE Systems Corporation", |
"148a OPTO", |
"148b INNOMEDIALOGIC Inc.", |
"148c C.P. Technology Co. Ltd", |
"148d DIGICOM Systems, Inc.", |
" 1003 HCF 56k Data/Fax Modem", |
"148e OSI Plus Corporation", |
"148f Plant Equipment, Inc.", |
"1490 Stone Microsystems PTY Ltd.", |
"1491 ZEAL Corporation", |
"1492 Time Logic Corporation", |
"1493 MAKER Communications", |
"1494 WINTOP Technology, Inc.", |
"1495 TOKAI Communications Industry Co. Ltd", |
"1496 JOYTECH Computer Co., Ltd.", |
"1497 SMA Regelsysteme GmBH", |
" 1497 SMA Technologie AG", |
"1498 TEWS Datentechnik GmBH", |
" 0330 TPMC816 2 Channel CAN bus controller.", |
" 0385 TPMC901 Extended CAN bus with 2/4/6 CAN controller", |
" 21cd TCP461 CompactPCI 8 Channel Serial Interface RS232/RS422", |
" 30c8 TPCI200", |
"1499 EMTEC CO., Ltd", |
"149a ANDOR Technology Ltd", |
"149b SEIKO Instruments Inc", |
"149c OVISLINK Corp.", |
"149d NEWTEK Inc", |
" 0001 Video Toaster for PC", |
"149e Mapletree Networks Inc.", |
"149f LECTRON Co Ltd", |
"14a0 SOFTING GmBH", |
"14a1 Systembase Co Ltd", |
"14a2 Millennium Engineering Inc", |
"14a3 Maverick Networks", |
"14a4 GVC/BCM Advanced Research", |
"14a5 XIONICS Document Technologies Inc", |
"14a6 INOVA Computers GmBH & Co KG", |
"14a7 MYTHOS Systems Inc", |
"14a8 FEATRON Technologies Corporation", |
"14a9 HIVERTEC Inc", |
"14aa Advanced MOS Technology Inc", |
"14ab Mentor Graphics Corp.", |
"14ac Novaweb Technologies Inc", |
"14ad Time Space Radio AB", |
"14ae CTI, Inc", |
"14af Guillemot Corporation", |
" 7102 3D Prophet II MX", |
"14b0 BST Communication Technology Ltd", |
"14b1 Nextcom K.K.", |
"14b2 ENNOVATE Networks Inc", |
"14b3 XPEED Inc", |
" 0000 DSL NIC", |
"14b4 PHILIPS Business Electronics B.V.", |
"14b5 Creamware GmBH", |
" 0200 Scope", |
" 0300 Pulsar", |
" 0400 PulsarSRB", |
" 0600 Pulsar2", |
" 0800 DSP-Board", |
" 0900 DSP-Board", |
" 0a00 DSP-Board", |
" 0b00 DSP-Board", |
"14b6 Quantum Data Corp.", |
"14b7 PROXIM Inc", |
" 0001 Symphony 4110", |
"14b8 Techsoft Technology Co Ltd", |
"14b9 AIRONET Wireless Communications", |
" 0001 PC4800", |
" 0340 PC4800", |
" 0350 PC4800", |
" 4500 PC4500", |
" 4800 Cisco Aironet 340 802.11b Wireless LAN Adapter/Aironet PC4800", |
" a504 Cisco Aironet Wireless 802.11b", |
" a505 Cisco Aironet CB20a 802.11a Wireless LAN Adapter", |
" a506 Cisco Aironet Mini PCI b/g", |
"14ba INTERNIX Inc.", |
"14bb SEMTECH Corporation", |
"14bc Globespan Semiconductor Inc.", |
"14bd CARDIO Control N.V.", |
"14be L3 Communications", |
"14bf SPIDER Communications Inc.", |
"14c0 COMPAL Electronics Inc", |
"14c1 MYRICOM Inc.", |
" 0008 Myri-10G Dual-Protocol Interconnect", |
" 8043 Myrinet 2000 Scalable Cluster Interconnect", |
"14c2 DTK Computer", |
"14c3 MEDIATEK Corp.", |
"14c4 IWASAKI Information Systems Co Ltd", |
"14c5 Automation Products AB", |
"14c6 Data Race Inc", |
"14c7 Modular Technology Holdings Ltd", |
"14c8 Turbocomm Tech. Inc.", |
"14c9 ODIN Telesystems Inc", |
"14ca PE Logic Corp.", |
"14cb Billionton Systems Inc", |
"14cc NAKAYO Telecommunications Inc", |
"14cd Universal Scientific Ind.", |
"14ce Whistle Communications", |
"14cf TEK Microsystems Inc.", |
"14d0 Ericsson Axe R & D", |
"14d1 Computer Hi-Tech Co Ltd", |
"14d2 Titan Electronics Inc", |
" 8001 VScom 010L 1 port parallel adaptor", |
" 8002 VScom 020L 2 port parallel adaptor", |
" 8010 VScom 100L 1 port serial adaptor", |
" 8011 VScom 110L 1 port serial and 1 port parallel adaptor", |
" 8020 VScom 200L 1 port serial adaptor", |
" 8021 VScom 210L 2 port serial and 1 port parallel adaptor", |
" 8040 VScom 400L 4 port serial adaptor", |
" 8080 VScom 800L 8 port serial adaptor", |
" a000 VScom 010H 1 port parallel adaptor", |
" a001 VScom 100H 1 port serial adaptor", |
" a003 VScom 400H 4 port serial adaptor", |
" a004 VScom 400HF1 4 port serial adaptor", |
" a005 VScom 200H 2 port serial adaptor", |
" e001 VScom 010HV2 1 port parallel adaptor", |
" e010 VScom 100HV2 1 port serial adaptor", |
" e020 VScom 200HV2 2 port serial adaptor", |
"14d3 CIRTECH (UK) Ltd", |
"14d4 Panacom Technology Corp", |
"14d5 Nitsuko Corporation", |
"14d6 Accusys Inc", |
"14d7 Hirakawa Hewtech Corp", |
"14d8 HOPF Elektronik GmBH", |
"14d9 Alliance Semiconductor Corporation", |
" 0010 AP1011/SP1011 HyperTransport-PCI Bridge [Sturgeon]", |
" 9000 AS90L10204/10208 HyperTransport to PCI-X Bridge", |
"14da National Aerospace Laboratories", |
"14db AFAVLAB Technology Inc", |
" 2120 TK9902", |
" 2182 AFAVLAB Technology Inc. 8-port serial card", |
"14dc Amplicon Liveline Ltd", |
" 0000 PCI230", |
" 0001 PCI242", |
" 0002 PCI244", |
" 0003 PCI247", |
" 0004 PCI248", |
" 0005 PCI249", |
" 0006 PCI260", |
" 0007 PCI224", |
" 0008 PCI234", |
" 0009 PCI236", |
" 000a PCI272", |
" 000b PCI215", |
"14dd Boulder Design Labs Inc", |
"14de Applied Integration Corporation", |
"14df ASIC Communications Corp", |
"14e1 INVERTEX", |
"14e2 INFOLIBRIA", |
"14e3 AMTELCO", |
"14e4 Broadcom Corporation", |
" 0800 Sentry5 Chipcommon I/O Controller", |
" 0804 Sentry5 PCI Bridge", |
" 0805 Sentry5 MIPS32 CPU", |
" 0806 Sentry5 Ethernet Controller", |
" 080b Sentry5 Crypto Accelerator", |
" 080f Sentry5 DDR/SDR RAM Controller", |
" 0811 Sentry5 External Interface Core", |
" 0816 BCM3302 Sentry5 MIPS32 CPU", |
" 1600 NetXtreme BCM5752 Gigabit Ethernet PCI Express", |
" 1601 NetXtreme BCM5752M Gigabit Ethernet PCI Express", |
" 1644 NetXtreme BCM5700 Gigabit Ethernet", |
" 1014 0277 Broadcom Vigil B5700 1000Base-T", |
" 1028 00d1 Broadcom BCM5700", |
" 1028 0106 Broadcom BCM5700", |
" 1028 0109 Broadcom BCM5700 1000Base-T", |
" 1028 010a Broadcom BCM5700 1000BaseTX", |
" 10b7 1000 3C996-T 1000Base-T", |
" 10b7 1001 3C996B-T 1000Base-T", |
" 10b7 1002 3C996C-T 1000Base-T", |
" 10b7 1003 3C997-T 1000Base-T Dual Port", |
" 10b7 1004 3C996-SX 1000Base-SX", |
" 10b7 1005 3C997-SX 1000Base-SX Dual Port", |
" 10b7 1008 3C942 Gigabit LOM (31X31)", |
" 14e4 0002 NetXtreme 1000Base-SX", |
" 14e4 0003 NetXtreme 1000Base-SX", |
" 14e4 0004 NetXtreme 1000Base-T", |
" 14e4 1028 NetXtreme 1000BaseTX", |
" 14e4 1644 BCM5700 1000Base-T", |
" 1645 NetXtreme BCM5701 Gigabit Ethernet", |
" 0e11 007c NC7770 Gigabit Server Adapter (PCI-X, 10/100/1000-T)", |
" 0e11 007d NC6770 Gigabit Server Adapter (PCI-X, 1000-SX)", |
" 0e11 0085 NC7780 Gigabit Server Adapter (embedded, WOL)", |
" 0e11 0099 NC7780 Gigabit Server Adapter (embedded, WOL)", |
" 0e11 009a NC7770 Gigabit Server Adapter (PCI-X, 10/100/1000-T)", |
" 0e11 00c1 NC6770 Gigabit Server Adapter (PCI-X, 1000-SX)", |
" 1028 0121 Broadcom BCM5701 1000Base-T", |
" 103c 128a 1000Base-T (PCI) [A7061A]", |
" 103c 128b 1000Base-SX (PCI) [A7073A]", |
" 103c 12a4 Core Lan 1000Base-T", |
" 103c 12c1 IOX Core Lan 1000Base-T [A7109AX]", |
" 103c 1300 Core LAN/SCSI Combo [A6794A]", |
" 10a9 8010 IO9/IO10 Gigabit Ethernet (Copper)", |
" 10a9 8011 Gigabit Ethernet (Copper)", |
" 10a9 8012 Gigabit Ethernet (Fiber)", |
" 10b7 1004 3C996-SX 1000Base-SX", |
" 10b7 1006 3C996B-T 1000Base-T", |
" 10b7 1007 3C1000-T 1000Base-T", |
" 10b7 1008 3C940-BR01 1000Base-T", |
" 14e4 0001 BCM5701 1000Base-T", |
" 14e4 0005 BCM5701 1000Base-T", |
" 14e4 0006 BCM5701 1000Base-T", |
" 14e4 0007 BCM5701 1000Base-SX", |
" 14e4 0008 BCM5701 1000Base-T", |
" 14e4 8008 BCM5701 1000Base-T", |
" 1646 NetXtreme BCM5702 Gigabit Ethernet", |
" 0e11 00bb NC7760 1000BaseTX", |
" 1028 0126 Broadcom BCM5702 1000BaseTX", |
" 14e4 8009 BCM5702 1000BaseTX", |
" 1647 NetXtreme BCM5703 Gigabit Ethernet", |
" 0e11 0099 NC7780 1000BaseTX", |
" 0e11 009a NC7770 1000BaseTX", |
" 10a9 8010 SGI IO9 Gigabit Ethernet (Copper)", |
" 14e4 0009 BCM5703 1000BaseTX", |
" 14e4 000a BCM5703 1000BaseSX", |
" 14e4 000b BCM5703 1000BaseTX", |
" 14e4 8009 BCM5703 1000BaseTX", |
" 14e4 800a BCM5703 1000BaseTX", |
" 1648 NetXtreme BCM5704 Gigabit Ethernet", |
" 0e11 00cf NC7772 Gigabit Server Adapter (PCI-X, 10,100,1000-T)", |
" 0e11 00d0 NC7782 Gigabit Server Adapter (PCI-X, 10,100,1000-T)", |
" 0e11 00d1 NC7783 Gigabit Server Adapter (PCI-X, 10,100,1000-T)", |
" 10b7 2000 3C998-T Dual Port 10/100/1000 PCI-X", |
" 10b7 3000 3C999-T Quad Port 10/100/1000 PCI-X", |
" 1166 1648 NetXtreme CIOB-E 1000Base-T", |
" 1734 100b Primergy RX300", |
" 164a NetXtreme II BCM5706 Gigabit Ethernet", |
" 103c 3101 NC370T MultifuNCtion Gigabit Server Adapter", |
" 164c NetXtreme II BCM5708 Gigabit Ethernet", |
" 164d NetXtreme BCM5702FE Gigabit Ethernet", |
" 1653 NetXtreme BCM5705 Gigabit Ethernet", |
" 0e11 00e3 NC7761 Gigabit Server Adapter", |
" 1654 NetXtreme BCM5705_2 Gigabit Ethernet", |
" 0e11 00e3 NC7761 Gigabit Server Adapter", |
" 103c 3100 NC1020 HP ProLiant Gigabit Server Adapter 32 PCI", |
" 103c 3226 NC150T 4-port Gigabit Combo Switch & Adapter", |
" 1659 NetXtreme BCM5721 Gigabit Ethernet PCI Express", |
" 1014 02c6 eServer xSeries server mainboard", |
" 103c 7031 NC320T PCIe Gigabit Server Adapter", |
" 103c 7032 NC320i PCIe Gigabit Server Adapter", |
" 1734 1061 Primergy RX300 S2", |
" 165d NetXtreme BCM5705M Gigabit Ethernet", |
" 1028 865d Latitude D400", |
" 165e NetXtreme BCM5705M_2 Gigabit Ethernet", |
" 103c 088c NC8000 laptop", |
" 103c 0890 NC6000 laptop", |
" 103c 099c NX6110/NC6120", |
" 1668 NetXtreme BCM5714 Gigabit Ethernet", |
" 103c 7039 NC324i PCIe Dual Port Gigabit Server Adapter", |
" 1669 NetXtreme 5714S Gigabit Ethernet", |
" 166a NetXtreme BCM5780 Gigabit Ethernet", |
" 166b NetXtreme BCM5780S Gigabit Ethernet", |
" 166e 570x 10/100 Integrated Controller", |
" 1672 NetXtreme BCM5754M Gigabit Ethernet PCI Express", |
" 1673 NetXtreme BCM5755M Gigabit Ethernet PCI Express", |
" 1677 NetXtreme BCM5751 Gigabit Ethernet PCI Express", |
" 1028 0179 Optiplex GX280", |
" 1028 0182 Latitude D610", |
" 1028 0187 Precision M70", |
" 1028 01ad Optiplex GX620", |
" 103c 3006 DC7100 SFF(DX878AV)", |
" 1734 105d Scenic W620", |
" 1678 NetXtreme BCM5715 Gigabit Ethernet", |
" 1679 NetXtreme 5715S Gigabit Ethernet", |
" 103c 703c NC326i PCIe Dual Port Gigabit Server Adapter", |
" 167a NetXtreme BCM5754 Gigabit Ethernet PCI Express", |
" 167b NetXtreme BCM5755 Gigabit Ethernet PCI Express", |
" 167d NetXtreme BCM5751M Gigabit Ethernet PCI Express", |
" 167e NetXtreme BCM5751F Fast Ethernet PCI Express", |
" 1693 NetLink BCM5787M Gigabit Ethernet PCI Express", |
" 1696 NetXtreme BCM5782 Gigabit Ethernet", |
" 103c 12bc HP d530 CMT (DG746A)", |
" 14e4 000d NetXtreme BCM5782 1000Base-T", |
" 169b NetLink BCM5787 Gigabit Ethernet PCI Express", |
" 169c NetXtreme BCM5788 Gigabit Ethernet", |
" 103c 308b MX6125", |
" 169d NetLink BCM5789 Gigabit Ethernet PCI Express", |
" 16a6 NetXtreme BCM5702X Gigabit Ethernet", |
" 0e11 00bb NC7760 Gigabit Server Adapter (PCI-X, 10/100/1000-T)", |
" 1028 0126 BCM5702 1000Base-T", |
" 14e4 000c BCM5702 1000Base-T", |
" 14e4 8009 BCM5702 1000Base-T", |
" 16a7 NetXtreme BCM5703X Gigabit Ethernet", |
" 0e11 00ca NC7771 Gigabit Server Adapter (PCI-X, 10,100,1000-T)", |
" 0e11 00cb NC7781 Gigabit Server Adapter (PCI-X, 10,100,1000-T)", |
" 14e4 0009 NetXtreme BCM5703 1000Base-T", |
" 14e4 000a NetXtreme BCM5703 1000Base-SX", |
" 14e4 000b NetXtreme BCM5703 1000Base-T", |
" 14e4 800a NetXtreme BCM5703 1000Base-T", |
" 16a8 NetXtreme BCM5704S Gigabit Ethernet", |
" 10b7 2001 3C998-SX Dual Port 1000-SX PCI-X", |
" 16aa NetXtreme II BCM5706S Gigabit Ethernet", |
" 103c 3102 NC370F MultifuNCtion Gigabit Server Adapter", |
" 16ac NetXtreme II BCM5708S Gigabit Ethernet", |
" 16c6 NetXtreme BCM5702A3 Gigabit Ethernet", |
" 10b7 1100 3C1000B-T 10/100/1000 PCI", |
" 14e4 000c BCM5702 1000Base-T", |
" 14e4 8009 BCM5702 1000Base-T", |
" 16c7 NetXtreme BCM5703 Gigabit Ethernet", |
" 0e11 00ca NC7771 Gigabit Server Adapter (PCI-X, 10,100,1000-T)", |
" 0e11 00cb NC7781 Gigabit Server Adapter (PCI-X, 10,100,1000-T)", |
" 103c 12c3 Combo FC/GigE-SX [A9782A]", |
" 103c 12ca Combo FC/GigE-T [A9784A]", |
" 14e4 0009 NetXtreme BCM5703 1000Base-T", |
" 14e4 000a NetXtreme BCM5703 1000Base-SX", |
" 16dd NetLink BCM5781 Gigabit Ethernet PCI Express", |
" 16f7 NetXtreme BCM5753 Gigabit Ethernet PCI Express", |
" 16fd NetXtreme BCM5753M Gigabit Ethernet PCI Express", |
" 16fe NetXtreme BCM5753F Fast Ethernet PCI Express", |
" 170c BCM4401-B0 100Base-TX", |
" 1028 0188 Inspiron 6000 laptop", |
" 1028 0196 Inspiron 5160", |
" 103c 099c NX6110/NC6120", |
" 170d NetXtreme BCM5901 100Base-TX", |
" 1014 0545 ThinkPad R40e (2684-HVG) builtin ethernet controller", |
" 170e NetXtreme BCM5901 100Base-TX", |
" 3352 BCM3352", |
" 3360 BCM3360", |
" 4210 BCM4210 iLine10 HomePNA 2.0", |
" 4211 BCM4211 iLine10 HomePNA 2.0 + V.90 56k modem", |
" 4212 BCM4212 v.90 56k modem", |
" 4301 BCM4303 802.11b Wireless LAN Controller", |
" 1028 0407 TrueMobile 1180 Onboard WLAN", |
" 1043 0120 WL-103b Wireless LAN PC Card", |
" 4305 BCM4307 V.90 56k Modem", |
" 4306 BCM4307 Ethernet Controller", |
" 4307 BCM4307 802.11b Wireless LAN Controller", |
" 4310 BCM4310 Chipcommon I/OController", |
" 4312 BCM4310 UART", |
" 4313 BCM4310 Ethernet Controller", |
" 4315 BCM4310 USB Controller", |
" 4318 BCM4318 [AirForce One 54g] 802.11g Wireless LAN Controller", |
" 103c 1356 MX6125", |
" 1043 120f A6U notebook embedded card", |
" 1468 0311 Aspire 3022WLMi, 5024WLMi", |
" 1468 0312 TravelMate 2410", |
" 14e4 0449 Gateway 7510GX", |
" 14e4 4318 WPC54G version 3 [Wireless-G Notebook Adapter] 802.11g Wireless Lan Controller", |
" 16ec 0119 U.S.Robotics Wireless MAXg PC Card", |
" 1737 0048 WPC54G-EU version 3 [Wireless-G Notebook Adapter]", |
" 4319 Dell Wireless 1470 DualBand WLAN", |
" 4320 BCM4306 802.11b/g Wireless LAN Controller", |
" 1028 0001 TrueMobile 1300 WLAN Mini-PCI Card", |
" 1028 0003 Wireless 1350 WLAN Mini-PCI Card", |
" 103c 12f4 NX9500 Built-in Wireless", |
" 103c 12fa Presario R3000 802.11b/g", |
" 1043 100f WL-100G", |
" 1057 7025 WN825G", |
" 106b 004e AirPort Extreme", |
" 1154 0330 Buffalo WLI2-PCI-G54S High Speed Mode Wireless Desktop Adapter", |
" 144f 7050 eMachines M6805 802.11g Built-in Wireless", |
" 14e4 4320 Linksys WMP54G PCI", |
" 1737 4320 WPC54G", |
" 1799 7001 Belkin F5D7001 High-Speed Mode Wireless G Network Card", |
" 1799 7010 Belkin F5D7010 54g Wireless Network card", |
" 185f 1220 TravelMate 290E WLAN Mini-PCI Card", |
" 4321 BCM4306 802.11a Wireless LAN Controller", |
" 4322 BCM4306 UART", |
" 4324 BCM4309 802.11a/b/g", |
" 1028 0001 Truemobile 1400", |
" 1028 0003 Truemobile 1450 MiniPCI", |
" 4325 BCM43xG 802.11b/g", |
" 1414 0003 Wireless Notebook Adapter MN-720", |
" 1414 0004 Wireless PCI Adapter MN-730", |
" 4326 BCM4307 Chipcommon I/O Controller?", |
" 4401 BCM4401 100Base-T", |
" 1043 80a8 A7V8X motherboard", |
" 4402 BCM4402 Integrated 10/100BaseT", |
" 4403 BCM4402 V.90 56k Modem", |
" 4410 BCM4413 iLine32 HomePNA 2.0", |
" 4411 BCM4413 V.90 56k modem", |
" 4412 BCM4412 10/100BaseT", |
" 4430 BCM44xx CardBus iLine32 HomePNA 2.0", |
" 4432 BCM4432 CardBus 10/100BaseT", |
" 4610 BCM4610 Sentry5 PCI to SB Bridge", |
" 4611 BCM4610 Sentry5 iLine32 HomePNA 1.0", |
" 4612 BCM4610 Sentry5 V.90 56k Modem", |
" 4613 BCM4610 Sentry5 Ethernet Controller", |
" 4614 BCM4610 Sentry5 External Interface", |
" 4615 BCM4610 Sentry5 USB Controller", |
" 4704 BCM4704 PCI to SB Bridge", |
" 4705 BCM4704 Sentry5 802.11b Wireless LAN Controller", |
" 4706 BCM4704 Sentry5 Ethernet Controller", |
" 4707 BCM4704 Sentry5 USB Controller", |
" 4708 BCM4704 Crypto Accelerator", |
" 4710 BCM4710 Sentry5 PCI to SB Bridge", |
" 4711 BCM47xx Sentry5 iLine32 HomePNA 2.0", |
" 4712 BCM47xx V.92 56k modem", |
" 4713 Sentry5 Ethernet Controller", |
" 4714 BCM47xx Sentry5 External Interface", |
" 4715 Sentry5 USB Controller", |
" 4716 BCM47xx Sentry5 USB Host Controller", |
" 4717 BCM47xx Sentry5 USB Device Controller", |
" 4718 Sentry5 Crypto Accelerator", |
" 4719 BCM47xx/53xx RoboSwitch Core", |
" 4720 BCM4712 MIPS CPU", |
" 5365 BCM5365P Sentry5 Host Bridge", |
" 5600 BCM5600 StrataSwitch 24+2 Ethernet Switch Controller", |
" 5605 BCM5605 StrataSwitch 24+2 Ethernet Switch Controller", |
" 5615 BCM5615 StrataSwitch 24+2 Ethernet Switch Controller", |
" 5625 BCM5625 StrataSwitch 24+2 Ethernet Switch Controller", |
" 5645 BCM5645 StrataSwitch 24+2 Ethernet Switch Controller", |
" 5670 BCM5670 8-Port 10GE Ethernet Switch Fabric", |
" 5680 BCM5680 G-Switch 8 Port Gigabit Ethernet Switch Controller", |
" 5690 BCM5690 12-port Multi-Layer Gigabit Ethernet Switch", |
" 5691 BCM5691 GE/10GE 8+2 Gigabit Ethernet Switch Controller", |
" 5692 BCM5692 12-port Multi-Layer Gigabit Ethernet Switch", |
" 5820 BCM5820 Crypto Accelerator", |
" 5821 BCM5821 Crypto Accelerator", |
" 5822 BCM5822 Crypto Accelerator", |
" 5823 BCM5823 Crypto Accelerator", |
" 5824 BCM5824 Crypto Accelerator", |
" 5840 BCM5840 Crypto Accelerator", |
" 5841 BCM5841 Crypto Accelerator", |
" 5850 BCM5850 Crypto Accelerator", |
"14e5 Pixelfusion Ltd", |
"14e6 SHINING Technology Inc", |
"14e7 3CX", |
"14e8 RAYCER Inc", |
"14e9 GARNETS System CO Ltd", |
"14ea Planex Communications, Inc", |
" ab06 FNW-3603-TX CardBus Fast Ethernet", |
" ab07 RTL81xx RealTek Ethernet", |
" ab08 FNW-3602-TX CardBus Fast Ethernet", |
"14eb SEIKO EPSON Corp", |
"14ec ACQIRIS", |
"14ed DATAKINETICS Ltd", |
"14ee MASPRO KENKOH Corp", |
"14ef CARRY Computer ENG. CO Ltd", |
"14f0 CANON RESEACH CENTRE FRANCE", |
"14f1 Conexant", |
" 1002 HCF 56k Modem", |
" 1003 HCF 56k Modem", |
" 1004 HCF 56k Modem", |
" 1005 HCF 56k Modem", |
" 1006 HCF 56k Modem", |
" 1022 HCF 56k Modem", |
" 1023 HCF 56k Modem", |
" 1024 HCF 56k Modem", |
" 1025 HCF 56k Modem", |
" 1026 HCF 56k Modem", |
" 1032 HCF 56k Modem", |
" 1033 HCF 56k Data/Fax Modem", |
" 1033 8077 NEC", |
" 122d 4027 Dell Zeus - MDP3880-W(B) Data Fax Modem", |
" 122d 4030 Dell Mercury - MDP3880-U(B) Data Fax Modem", |
" 122d 4034 Dell Thor - MDP3880-W(U) Data Fax Modem", |
" 13e0 020d Dell Copper", |
" 13e0 020e Dell Silver", |
" 13e0 0261 IBM", |
" 13e0 0290 Compaq Goldwing", |
" 13e0 02a0 IBM", |
" 13e0 02b0 IBM", |
" 13e0 02c0 Compaq Scooter", |
" 13e0 02d0 IBM", |
" 144f 1500 IBM P85-DF (1)", |
" 144f 1501 IBM P85-DF (2)", |
" 144f 150a IBM P85-DF (3)", |
" 144f 150b IBM P85-DF Low Profile (1)", |
" 144f 1510 IBM P85-DF Low Profile (2)", |
" 1034 HCF 56k Data/Fax/Voice Modem", |
" 1035 HCF 56k Data/Fax/Voice/Spkp (w/Handset) Modem", |
" 10cf 1098 Fujitsu P85-DFSV", |
" 1036 HCF 56k Data/Fax/Voice/Spkp Modem", |
" 104d 8067 HCF 56k Modem", |
" 122d 4029 MDP3880SP-W", |
" 122d 4031 MDP3880SP-U", |
" 13e0 0209 Dell Titanium", |
" 13e0 020a Dell Graphite", |
" 13e0 0260 Gateway Red Owl", |
" 13e0 0270 Gateway White Horse", |
" 1052 HCF 56k Data/Fax Modem (Worldwide)", |
" 1053 HCF 56k Data/Fax Modem (Worldwide)", |
" 1054 HCF 56k Data/Fax/Voice Modem (Worldwide)", |
" 1055 HCF 56k Data/Fax/Voice/Spkp (w/Handset) Modem (Worldwide)", |
" 1056 HCF 56k Data/Fax/Voice/Spkp Modem (Worldwide)", |
" 1057 HCF 56k Data/Fax/Voice/Spkp Modem (Worldwide)", |
" 1059 HCF 56k Data/Fax/Voice Modem (Worldwide)", |
" 1063 HCF 56k Data/Fax Modem", |
" 1064 HCF 56k Data/Fax/Voice Modem", |
" 1065 HCF 56k Data/Fax/Voice/Spkp (w/Handset) Modem", |
" 1066 HCF 56k Data/Fax/Voice/Spkp Modem", |
" 122d 4033 Dell Athena - MDP3900V-U", |
" 1085 HCF V90 56k Data/Fax/Voice/Spkp PCI Modem", |
" 1433 HCF 56k Data/Fax Modem", |
" 1434 HCF 56k Data/Fax/Voice Modem", |
" 1435 HCF 56k Data/Fax/Voice/Spkp (w/Handset) Modem", |
" 1436 HCF 56k Data/Fax Modem", |
" 1453 HCF 56k Data/Fax Modem", |
" 13e0 0240 IBM", |
" 13e0 0250 IBM", |
" 144f 1502 IBM P95-DF (1)", |
" 144f 1503 IBM P95-DF (2)", |
" 1454 HCF 56k Data/Fax/Voice Modem", |
" 1455 HCF 56k Data/Fax/Voice/Spkp (w/Handset) Modem", |
" 1456 HCF 56k Data/Fax/Voice/Spkp Modem", |
" 122d 4035 Dell Europa - MDP3900V-W", |
" 122d 4302 Dell MP3930V-W(C) MiniPCI", |
" 1610 ADSL AccessRunner PCI Arbitration Device", |
" 1611 AccessRunner PCI ADSL Interface Device", |
" 1620 AccessRunner V2 PCI ADSL Arbitration Device", |
" 1621 AccessRunner V2 PCI ADSL Interface Device", |
" 1622 AccessRunner V2 PCI ADSL Yukon WAN Adapter", |
" 1803 HCF 56k Modem", |
" 0e11 0023 623-LAN Grizzly", |
" 0e11 0043 623-LAN Yogi", |
" 1811 Conextant MiniPCI Network Adapter", |
" 1815 HCF 56k Modem", |
" 0e11 0022 Grizzly", |
" 0e11 0042 Yogi", |
" 2003 HSF 56k Data/Fax Modem", |
" 2004 HSF 56k Data/Fax/Voice Modem", |
" 2005 HSF 56k Data/Fax/Voice/Spkp (w/Handset) Modem", |
" 2006 HSF 56k Data/Fax/Voice/Spkp Modem", |
" 2013 HSF 56k Data/Fax Modem", |
" 0e11 b195 Bear", |
" 0e11 b196 Seminole 1", |
" 0e11 b1be Seminole 2", |
" 1025 8013 Acer", |
" 1033 809d NEC", |
" 1033 80bc NEC", |
" 155d 6793 HP", |
" 155d 8850 E Machines", |
" 2014 HSF 56k Data/Fax/Voice Modem", |
" 2015 HSF 56k Data/Fax/Voice/Spkp (w/Handset) Modem", |
" 2016 HSF 56k Data/Fax/Voice/Spkp Modem", |
" 2043 HSF 56k Data/Fax Modem (WorldW SmartDAA)", |
" 2044 HSF 56k Data/Fax/Voice Modem (WorldW SmartDAA)", |
" 2045 HSF 56k Data/Fax/Voice/Spkp (w/Handset) Modem (WorldW SmartDAA)", |
" 14f1 2045 Generic SoftK56", |
" 2046 HSF 56k Data/Fax/Voice/Spkp Modem (WorldW SmartDAA)", |
" 2063 HSF 56k Data/Fax Modem (SmartDAA)", |
" 2064 HSF 56k Data/Fax/Voice Modem (SmartDAA)", |
" 2065 HSF 56k Data/Fax/Voice/Spkp (w/Handset) Modem (SmartDAA)", |
" 2066 HSF 56k Data/Fax/Voice/Spkp Modem (SmartDAA)", |
" 2093 HSF 56k Modem", |
" 155d 2f07 Legend", |
" 2143 HSF 56k Data/Fax/Cell Modem (Mob WorldW SmartDAA)", |
" 2144 HSF 56k Data/Fax/Voice/Cell Modem (Mob WorldW SmartDAA)", |
" 2145 HSF 56k Data/Fax/Voice/Spkp (w/HS)/Cell Modem (Mob WorldW SmartDAA)", |
" 2146 HSF 56k Data/Fax/Voice/Spkp/Cell Modem (Mob WorldW SmartDAA)", |
" 2163 HSF 56k Data/Fax/Cell Modem (Mob SmartDAA)", |
" 2164 HSF 56k Data/Fax/Voice/Cell Modem (Mob SmartDAA)", |
" 2165 HSF 56k Data/Fax/Voice/Spkp (w/HS)/Cell Modem (Mob SmartDAA)", |
" 2166 HSF 56k Data/Fax/Voice/Spkp/Cell Modem (Mob SmartDAA)", |
" 2343 HSF 56k Data/Fax CardBus Modem (Mob WorldW SmartDAA)", |
" 2344 HSF 56k Data/Fax/Voice CardBus Modem (Mob WorldW SmartDAA)", |
" 2345 HSF 56k Data/Fax/Voice/Spkp (w/HS) CardBus Modem (Mob WorldW SmartDAA)", |
" 2346 HSF 56k Data/Fax/Voice/Spkp CardBus Modem (Mob WorldW SmartDAA)", |
" 2363 HSF 56k Data/Fax CardBus Modem (Mob SmartDAA)", |
" 2364 HSF 56k Data/Fax/Voice CardBus Modem (Mob SmartDAA)", |
" 2365 HSF 56k Data/Fax/Voice/Spkp (w/HS) CardBus Modem (Mob SmartDAA)", |
" 2366 HSF 56k Data/Fax/Voice/Spkp CardBus Modem (Mob SmartDAA)", |
" 2443 HSF 56k Data/Fax Modem (Mob WorldW SmartDAA)", |
" 104d 8075 Modem", |
" 104d 8083 Modem", |
" 104d 8097 Modem", |
" 2444 HSF 56k Data/Fax/Voice Modem (Mob WorldW SmartDAA)", |
" 2445 HSF 56k Data/Fax/Voice/Spkp (w/HS) Modem (Mob WorldW SmartDAA)", |
" 2446 HSF 56k Data/Fax/Voice/Spkp Modem (Mob WorldW SmartDAA)", |
" 2463 HSF 56k Data/Fax Modem (Mob SmartDAA)", |
" 2464 HSF 56k Data/Fax/Voice Modem (Mob SmartDAA)", |
" 2465 HSF 56k Data/Fax/Voice/Spkp (w/HS) Modem (Mob SmartDAA)", |
" 2466 HSF 56k Data/Fax/Voice/Spkp Modem (Mob SmartDAA)", |
" 2bfa HDAudio Soft Data Fax Modem with SmartCP", |
" 2f00 HSF 56k HSFi Modem", |
" 13e0 8d84 IBM HSFi V.90", |
" 13e0 8d85 Compaq Stinger", |
" 14f1 2004 Dynalink 56PMi", |
" 2f02 HSF 56k HSFi Data/Fax", |
" 2f11 HSF 56k HSFi Modem", |
" 2f20 HSF 56k Data/Fax Modem", |
" 8234 RS8234 ATM SAR Controller [ServiceSAR Plus]", |
" 8800 CX23880/1/2/3 PCI Video and Audio Decoder", |
" 0070 2801 Hauppauge WinTV 28xxx (Roslyn) models", |
" 0070 3401 Hauppauge WinTV 34xxx models", |
" 0070 9001 Nova-T DVB-T", |
" 0070 9200 Nova-SE2 DVB-S", |
" 0070 9202 Nova-S-Plus DVB-S", |
" 0070 9402 WinTV-HVR1100 DVB-T/Hybrid", |
" 0070 9802 WinTV-HVR1100 DVB-T/Hybrid (Low Profile)", |
" 1002 00f8 ATI TV Wonder Pro", |
" 1002 a101 HDTV Wonder", |
" 1043 4823 ASUS PVR-416", |
" 107d 6613 Leadtek Winfast 2000XP Expert", |
" 107d 6620 Leadtek Winfast DV2000", |
" 107d 663c Leadtek PVR 2000", |
" 107d 665f WinFast DTV1000-T", |
" 10fc d003 IODATA GV-VCP3/PCI", |
" 10fc d035 IODATA GV/BCTV7E", |
" 1421 0334 Instant TV DVB-T PCI", |
" 1461 000a AVerTV 303 (M126)", |
" 1461 000b AverTV Studio 303 (M126)", |
" 1461 8011 UltraTV Media Center PCI 550", |
" 1462 8606 MSI TV-@nywhere Master", |
" 14c7 0107 GDI Black Gold", |
" 14f1 0187 Conexant DVB-T reference design", |
" 14f1 0342 Digital-Logic MICROSPACE Entertainment Center (MEC)", |
" 153b 1166 Cinergy 1400 DVB-T", |
" 1540 2580 Provideo PV259", |
" 1554 4811 PixelView", |
" 1554 4813 Club 3D ZAP1000 MCE Edition", |
" 17de 08a1 KWorld/VStream XPert DVB-T with cx22702", |
" 17de 08a6 KWorld/VStream XPert DVB-T", |
" 17de 08b2 KWorld DVB-S 100", |
" 17de a8a6 digitalnow DNTV Live! DVB-T", |
" 1822 0025 digitalnow DNTV Live! DVB-T Pro", |
" 18ac d500 FusionHDTV 5 Gold", |
" 18ac d810 FusionHDTV 3 Gold-Q", |
" 18ac d820 FusionHDTV 3 Gold-T", |
" 18ac db00 FusionHDTV DVB-T1", |
" 18ac db11 FusionHDTV DVB-T Plus", |
" 18ac db50 FusionHDTV DVB-T Dual Digital", |
" 7063 3000 pcHDTV HD3000 HDTV", |
" 8801 CX23880/1/2/3 PCI Video and Audio Decoder [Audio Port]", |
" 0070 2801 Hauppauge WinTV 28xxx (Roslyn) models", |
" 8802 CX23880/1/2/3 PCI Video and Audio Decoder [MPEG Port]", |
" 0070 2801 Hauppauge WinTV 28xxx (Roslyn) models", |
" 0070 9002 Nova-T DVB-T Model 909", |
" 1043 4823 ASUS PVR-416", |
" 107d 663c Leadtek PVR 2000", |
" 14f1 0187 Conexant DVB-T reference design", |
" 17de 08a1 XPert DVB-T PCI BDA DVBT 23880 Transport Stream Capture", |
" 17de 08a6 KWorld/VStream XPert DVB-T", |
" 18ac d500 DViCO FusionHDTV5 Gold", |
" 18ac d810 DViCO FusionHDTV3 Gold-Q", |
" 18ac d820 DViCO FusionHDTV3 Gold-T", |
" 18ac db00 DVICO FusionHDTV DVB-T1", |
" 18ac db10 DVICO FusionHDTV DVB-T Plus", |
" 7063 3000 pcHDTV HD3000 HDTV", |
" 8804 CX23880/1/2/3 PCI Video and Audio Decoder [IR Port]", |
" 0070 9002 Nova-T DVB-T Model 909", |
" 8811 CX23880/1/2/3 PCI Video and Audio Decoder [Audio Port]", |
" 0070 3401 Hauppauge WinTV 34xxx models", |
" 1462 8606 MSI TV-@nywhere Master", |
" 18ac d500 DViCO FusionHDTV5 Gold", |
" 18ac d810 DViCO FusionHDTV3 Gold-Q", |
" 18ac d820 DViCO FusionHDTV3 Gold-T", |
" 18ac db00 DVICO FusionHDTV DVB-T1", |
"14f2 MOBILITY Electronics", |
" 0120 EV1000 bridge", |
" 0121 EV1000 Parallel port", |
" 0122 EV1000 Serial port", |
" 0123 EV1000 Keyboard controller", |
" 0124 EV1000 Mouse controller", |
"14f3 BroadLogic", |
" 2030 2030 DVB-S Satellite Reciever", |
" 2050 2050 DVB-T Terrestrial (Cable) Reciever", |
" 2060 2060 ATSC Terrestrial (Cable) Reciever", |
"14f4 TOKYO Electronic Industry CO Ltd", |
"14f5 SOPAC Ltd", |
"14f6 COYOTE Technologies LLC", |
"14f7 WOLF Technology Inc", |
"14f8 AUDIOCODES Inc", |
" 2077 TP-240 dual span E1 VoIP PCI card", |
"14f9 AG COMMUNICATIONS", |
"14fa WANDEL & GOLTERMANN", |
"14fb TRANSAS MARINE (UK) Ltd", |
"14fc Quadrics Ltd", |
" 0000 QsNet Elan3 Network Adapter", |
" 0001 QsNetII Elan4 Network Adapter", |
" 0002 QsNetIII Elan5 Network Adapter", |
"14fd JAPAN Computer Industry Inc", |
"14fe ARCHTEK TELECOM Corp", |
"14ff TWINHEAD INTERNATIONAL Corp", |
"1500 DELTA Electronics, Inc", |
" 1360 RTL81xx RealTek Ethernet", |
"1501 BANKSOFT CANADA Ltd", |
"1502 MITSUBISHI ELECTRIC LOGISTICS SUPPORT Co Ltd", |
"1503 KAWASAKI LSI USA Inc", |
"1504 KAISER Electronics", |
"1505 ITA INGENIEURBURO FUR TESTAUFGABEN GmbH", |
"1506 CHAMELEON Systems Inc", |
"1507 Motorola ?? / HTEC", |
" 0001 MPC105 [Eagle]", |
" 0002 MPC106 [Grackle]", |
" 0003 MPC8240 [Kahlua]", |
" 0100 MC145575 [HFC-PCI]", |
" 0431 KTI829c 100VG", |
" 4801 Raven", |
" 4802 Falcon", |
" 4803 Hawk", |
" 4806 CPX8216", |
"1508 HONDA CONNECTORS/MHOTRONICS Inc", |
"1509 FIRST INTERNATIONAL Computer Inc", |
"150a FORVUS RESEARCH Inc", |
"150b YAMASHITA Systems Corp", |
"150c KYOPAL CO Ltd", |
"150d WARPSPPED Inc", |
"150e C-PORT Corp", |
"150f INTEC GmbH", |
"1510 BEHAVIOR TECH Computer Corp", |
"1511 CENTILLIUM Technology Corp", |
"1512 ROSUN Technologies Inc", |
"1513 Raychem", |
"1514 TFL LAN Inc", |
"1515 Advent design", |
"1516 MYSON Technology Inc", |
" 0800 MTD-8xx 100/10M Ethernet PCI Adapter", |
" 0803 SURECOM EP-320X-S 100/10M Ethernet PCI Adapter", |
" 1320 10bd SURECOM EP-320X-S 100/10M Ethernet PCI Adapter", |
" 0891 MTD-8xx 100/10M Ethernet PCI Adapter", |
"1517 ECHOTEK Corp", |
"1518 PEP MODULAR Computers GmbH", |
"1519 TELEFON AKTIEBOLAGET LM Ericsson", |
"151a Globetek", |
" 1002 PCI-1002", |
" 1004 PCI-1004", |
" 1008 PCI-1008", |
"151b COMBOX Ltd", |
"151c DIGITAL AUDIO LABS Inc", |
" 0003 Prodif T 2496", |
" 4000 Prodif 88", |
"151d Fujitsu Computer Products Of America", |
"151e MATRIX Corp", |
"151f TOPIC SEMICONDUCTOR Corp", |
" 0000 TP560 Data/Fax/Voice 56k modem", |
"1520 CHAPLET System Inc", |
"1521 BELL Corp", |
"1522 MainPine Ltd", |
" 0100 PCI <-> IOBus Bridge", |
" 1522 0200 RockForceDUO 2 Port V.92/V.44 Data/Fax/Voice Modem", |
" 1522 0300 RockForceQUATRO 4 Port V.92/V.44 Data/Fax/Voice Modem", |
" 1522 0400 RockForceDUO+ 2 Port V.92/V.44 Data/Fax/Voice Modem", |
" 1522 0500 RockForceQUATRO+ 4 Port V.92/V.44 Data/Fax/Voice Modem", |
" 1522 0600 RockForce+ 2 Port V.90 Data/Fax/Voice Modem", |
" 1522 0700 RockForce+ 4 Port V.90 Data/Fax/Voice Modem", |
" 1522 0800 RockForceOCTO+ 8 Port V.92/V.44 Data/Fax/Voice Modem", |
" 1522 0c00 RockForceDUO+ 2 Port V.92/V.44 Data, V.34 Super-G3 Fax, Voice Modem", |
" 1522 0d00 RockForceQUATRO+ 4 Port V.92/V.44 Data, V.34 Super-G3 Fax, Voice Modem", |
" 1522 1d00 RockForceOCTO+ 8 Port V.92/V.44 Data, V.34 Super-G3 Fax, Voice Modem", |
" 1522 2000 RockForceD1 1 Port V.90 Data Modem", |
" 1522 2100 RockForceF1 1 Port V.34 Super-G3 Fax Modem", |
" 1522 2200 RockForceD2 2 Port V.90 Data Modem", |
" 1522 2300 RockForceF2 2 Port V.34 Super-G3 Fax Modem", |
" 1522 2400 RockForceD4 4 Port V.90 Data Modem", |
" 1522 2500 RockForceF4 4 Port V.34 Super-G3 Fax Modem", |
" 1522 2600 RockForceD8 8 Port V.90 Data Modem", |
" 1522 2700 RockForceF8 8 Port V.34 Super-G3 Fax Modem", |
"1523 MUSIC Semiconductors", |
"1524 ENE Technology Inc", |
" 0510 CB710 Memory Card Reader Controller", |
" 103c 006a NX9500", |
" 0520 FLASH memory: ENE Technology Inc:", |
" 0530 ENE PCI Memory Stick Card Reader Controller", |
" 0550 ENE PCI Secure Digital Card Reader Controller", |
" 0610 PCI Smart Card Reader Controller", |
" 1211 CB1211 Cardbus Controller", |
" 1225 CB1225 Cardbus Controller", |
" 1410 CB1410 Cardbus Controller", |
" 1025 003c CL50 motherboard", |
" 1025 005a TravelMate 290", |
" 1411 CB-710/2/4 Cardbus Controller", |
" 103c 006a NX9500", |
" 1412 CB-712/4 Cardbus Controller", |
" 1420 CB1420 Cardbus Controller", |
" 1421 CB-720/2/4 Cardbus Controller", |
" 1422 CB-722/4 Cardbus Controller", |
"1525 IMPACT Technologies", |
"1526 ISS, Inc", |
"1527 SOLECTRON", |
"1528 ACKSYS", |
"1529 AMERICAN MICROSystems Inc", |
"152a QUICKTURN DESIGN Systems", |
"152b FLYTECH Technology CO Ltd", |
"152c MACRAIGOR Systems LLC", |
"152d QUANTA Computer Inc", |
"152e MELEC Inc", |
"152f PHILIPS - CRYPTO", |
"1530 ACQIS Technology Inc", |
"1531 CHRYON Corp", |
"1532 ECHELON Corp", |
" 0020 LonWorks PCLTA-20 PCI LonTalk Adapter", |
"1533 BALTIMORE", |
"1534 ROAD Corp", |
"1535 EVERGREEN Technologies Inc", |
"1537 DATALEX COMMUNCATIONS", |
"1538 ARALION Inc", |
" 0303 ARS106S Ultra ATA 133/100/66 Host Controller", |
"1539 ATELIER INFORMATIQUES et ELECTRONIQUE ETUDES S.A.", |
"153a ONO SOKKI", |
"153b TERRATEC Electronic GmbH", |
" 1144 Aureon 5.1", |
" 1147 Aureon 5.1 Sky", |
" 1158 Philips Semiconductors SAA7134 (rev 01) [Terratec Cinergy 600 TV]", |
"153c ANTAL Electronic", |
"153d FILANET Corp", |
"153e TECHWELL Inc", |
"153f MIPS Technologies, Inc.", |
" 0001 SOC-it 101 System Controller", |
"1540 PROVIDEO MULTIMEDIA Co Ltd", |
"1541 MACHONE Communications", |
"1542 Concurrent Computer Corporation", |
"1543 SILICON Laboratories", |
" 3052 Intel 537 [Winmodem]", |
" 4c22 Si3036 MC'97 DAA", |
"1544 DCM DATA Systems", |
"1545 VISIONTEK", |
"1546 IOI Technology Corp", |
"1547 MITUTOYO Corp", |
"1548 JET PROPULSION Laboratory", |
"1549 INTERCONNECT Systems Solutions", |
"154a MAX Technologies Inc", |
"154b COMPUTEX Co Ltd", |
"154c VISUAL Technology Inc", |
"154d PAN INTERNATIONAL Industrial Corp", |
"154e SERVOTEST Ltd", |
"154f STRATABEAM Technology", |
"1550 OPEN NETWORK Co Ltd", |
"1551 SMART Electronic DEVELOPMENT GmBH", |
"1552 RACAL AIRTECH Ltd", |
"1553 CHICONY Electronics Co Ltd", |
"1554 PROLINK Microsystems Corp", |
"1555 GESYTEC GmBH", |
"1556 PLD APPLICATIONS", |
"1557 MEDIASTAR Co Ltd", |
"1558 CLEVO/KAPOK Computer", |
"1559 SI LOGIC Ltd", |
"155a INNOMEDIA Inc", |
"155b PROTAC INTERNATIONAL Corp", |
"155c Cemax-Icon Inc", |
"155d Mac System Co Ltd", |
"155e LP Elektronik GmbH", |
"155f Perle Systems Ltd", |
"1560 Terayon Communications Systems", |
"1561 Viewgraphics Inc", |
"1562 Symbol Technologies", |
"1563 A-Trend Technology Co Ltd", |
"1564 Yamakatsu Electronics Industry Co Ltd", |
"1565 Biostar Microtech Int'l Corp", |
"1566 Ardent Technologies Inc", |
"1567 Jungsoft", |
"1568 DDK Electronics Inc", |
"1569 Palit Microsystems Inc.", |
"156a Avtec Systems", |
"156b 2wire Inc", |
"156c Vidac Electronics GmbH", |
"156d Alpha-Top Corp", |
"156e Alfa Inc", |
"156f M-Systems Flash Disk Pioneers Ltd", |
"1570 Lecroy Corp", |
"1571 Contemporary Controls", |
" a001 CCSI PCI20-485 ARCnet", |
" a002 CCSI PCI20-485D ARCnet", |
" a003 CCSI PCI20-485X ARCnet", |
" a004 CCSI PCI20-CXB ARCnet", |
" a005 CCSI PCI20-CXS ARCnet", |
" a006 CCSI PCI20-FOG-SMA ARCnet", |
" a007 CCSI PCI20-FOG-ST ARCnet", |
" a008 CCSI PCI20-TB5 ARCnet", |
" a009 CCSI PCI20-5-485 5Mbit ARCnet", |
" a00a CCSI PCI20-5-485D 5Mbit ARCnet", |
" a00b CCSI PCI20-5-485X 5Mbit ARCnet", |
" a00c CCSI PCI20-5-FOG-ST 5Mbit ARCnet", |
" a00d CCSI PCI20-5-FOG-SMA 5Mbit ARCnet", |
" a201 CCSI PCI22-485 10Mbit ARCnet", |
" a202 CCSI PCI22-485D 10Mbit ARCnet", |
" a203 CCSI PCI22-485X 10Mbit ARCnet", |
" a204 CCSI PCI22-CHB 10Mbit ARCnet", |
" a205 CCSI PCI22-FOG_ST 10Mbit ARCnet", |
" a206 CCSI PCI22-THB 10Mbit ARCnet", |
"1572 Otis Elevator Company", |
"1573 Lattice - Vantis", |
"1574 Fairchild Semiconductor", |
"1575 Voltaire Advanced Data Security Ltd", |
"1576 Viewcast COM", |
"1578 HITT", |
" 5615 VPMK3 [Video Processor Mk III]", |
"1579 Dual Technology Corp", |
"157a Japan Elecronics Ind Inc", |
"157b Star Multimedia Corp", |
"157c Eurosoft (UK)", |
" 8001 Fix2000 PCI Y2K Compliance Card", |
"157d Gemflex Networks", |
"157e Transition Networks", |
"157f PX Instruments Technology Ltd", |
"1580 Primex Aerospace Co", |
"1581 SEH Computertechnik GmbH", |
"1582 Cytec Corp", |
"1583 Inet Technologies Inc", |
"1584 Uniwill Computer Corp", |
"1585 Logitron", |
"1586 Lancast Inc", |
"1587 Konica Corp", |
"1588 Solidum Systems Corp", |
"1589 Atlantek Microsystems Pty Ltd", |
"158a Digalog Systems Inc", |
"158b Allied Data Technologies", |
"158c Hitachi Semiconductor & Devices Sales Co Ltd", |
"158d Point Multimedia Systems", |
"158e Lara Technology Inc", |
"158f Ditect Coop", |
"1590 3pardata Inc", |
"1591 ARN", |
"1592 Syba Tech Ltd", |
" 0781 Multi-IO Card", |
" 0782 Parallel Port Card 2xEPP", |
" 0783 Multi-IO Card", |
" 0785 Multi-IO Card", |
" 0786 Multi-IO Card", |
" 0787 Multi-IO Card", |
" 0788 Multi-IO Card", |
" 078a Multi-IO Card", |
"1593 Bops Inc", |
"1594 Netgame Ltd", |
"1595 Diva Systems Corp", |
"1596 Folsom Research Inc", |
"1597 Memec Design Services", |
"1598 Granite Microsystems", |
"1599 Delta Electronics Inc", |
"159a General Instrument", |
"159b Faraday Technology Corp", |
"159c Stratus Computer Systems", |
"159d Ningbo Harrison Electronics Co Ltd", |
"159e A-Max Technology Co Ltd", |
"159f Galea Network Security", |
"15a0 Compumaster SRL", |
"15a1 Geocast Network Systems", |
"15a2 Catalyst Enterprises Inc", |
" 0001 TA700 PCI Bus Analyzer/Exerciser", |
"15a3 Italtel", |
"15a4 X-Net OY", |
"15a5 Toyota Macs Inc", |
"15a6 Sunlight Ultrasound Technologies Ltd", |
"15a7 SSE Telecom Inc", |
"15a8 Shanghai Communications Technologies Center", |
"15aa Moreton Bay", |
"15ab Bluesteel Networks Inc", |
"15ac North Atlantic Instruments", |
"15ad VMware Inc", |
" 0405 [VMware SVGA II] PCI Display Adapter", |
" 0710 Virtual SVGA", |
" 0720 VMware High-Speed Virtual NIC [vmxnet]", |
"15ae Amersham Pharmacia Biotech", |
"15b0 Zoltrix International Ltd", |
"15b1 Source Technology Inc", |
"15b2 Mosaid Technologies Inc", |
"15b3 Mellanox Technologies", |
" 5274 MT21108 InfiniBridge", |
" 5a44 MT23108 InfiniHost", |
" 5a45 MT23108 [Infinihost HCA Flash Recovery]", |
" 5a46 MT23108 PCI Bridge", |
" 5e8d MT25204 [InfiniHost III Lx HCA Flash Recovery]", |
" 6274 MT25204 [InfiniHost III Lx HCA]", |
" 6278 MT25208 InfiniHost III Ex (Tavor compatibility mode)", |
" 6279 MT25208 [InfiniHost III Ex HCA Flash Recovery]", |
" 6282 MT25208 InfiniHost III Ex", |
"15b4 CCI/TRIAD", |
"15b5 Cimetrics Inc", |
"15b6 Texas Memory Systems Inc", |
"15b7 Sandisk Corp", |
"15b8 ADDI-DATA GmbH", |
"15b9 Maestro Digital Communications", |
"15ba Impacct Technology Corp", |
"15bb Portwell Inc", |
"15bc Agilent Technologies", |
" 1100 E8001-66442 PCI Express CIC", |
" 2922 64 Bit, 133MHz PCI-X Exerciser & Protocol Checker", |
" 2928 64 Bit, 66MHz PCI Exerciser & Analyzer", |
" 2929 64 Bit, 133MHz PCI-X Analyzer & Exerciser", |
"15bd DFI Inc", |
"15be Sola Electronics", |
"15bf High Tech Computer Corp (HTC)", |
"15c0 BVM Ltd", |
"15c1 Quantel", |
"15c2 Newer Technology Inc", |
"15c3 Taiwan Mycomp Co Ltd", |
"15c4 EVSX Inc", |
"15c5 Procomp Informatics Ltd", |
" 8010 1394b - 1394 Firewire 3-Port Host Adapter Card", |
"15c6 Technical University of Budapest", |
"15c7 Tateyama System Laboratory Co Ltd", |
" 0349 Tateyama C-PCI PLC/NC card Rev.01A", |
"15c8 Penta Media Co Ltd", |
"15c9 Serome Technology Inc", |
"15ca Bitboys OY", |
"15cb AG Electronics Ltd", |
"15cc Hotrail Inc", |
"15cd Dreamtech Co Ltd", |
"15ce Genrad Inc", |
"15cf Hilscher GmbH", |
"15d1 Infineon Technologies AG", |
"15d2 FIC (First International Computer Inc)", |
"15d3 NDS Technologies Israel Ltd", |
"15d4 Iwill Corp", |
"15d5 Tatung Co", |
"15d6 Entridia Corp", |
"15d7 Rockwell-Collins Inc", |
"15d8 Cybernetics Technology Co Ltd", |
"15d9 Super Micro Computer Inc", |
"15da Cyberfirm Inc", |
"15db Applied Computing Systems Inc", |
"15dc Litronic Inc", |
" 0001 Argus 300 PCI Cryptography Module", |
"15dd Sigmatel Inc", |
"15de Malleable Technologies Inc", |
"15df Infinilink Corp", |
"15e0 Cacheflow Inc", |
"15e1 Voice Technologies Group Inc", |
"15e2 Quicknet Technologies Inc", |
"15e3 Networth Technologies Inc", |
"15e4 VSN Systemen BV", |
"15e5 Valley technologies Inc", |
"15e6 Agere Inc", |
"15e7 Get Engineering Corp", |
"15e8 National Datacomm Corp", |
" 0130 Wireless PCI Card", |
"15e9 Pacific Digital Corp", |
" 1841 ADMA-100 DiscStaQ ATA Controller", |
"15ea Tokyo Denshi Sekei K.K.", |
"15eb Drsearch GmbH", |
"15ec Beckhoff GmbH", |
" 3101 FC3101 Profibus DP 1 Channel PCI", |
" 5102 FC5102", |
"15ed Macrolink Inc", |
"15ee In Win Development Inc", |
"15ef Intelligent Paradigm Inc", |
"15f0 B-Tree Systems Inc", |
"15f1 Times N Systems Inc", |
"15f2 Diagnostic Instruments Inc", |
"15f3 Digitmedia Corp", |
"15f4 Valuesoft", |
"15f5 Power Micro Research", |
"15f6 Extreme Packet Device Inc", |
"15f7 Banctec", |
"15f8 Koga Electronics Co", |
"15f9 Zenith Electronics Corp", |
"15fa J.P. Axzam Corp", |
"15fb Zilog Inc", |
"15fc Techsan Electronics Co Ltd", |
"15fd N-CUBED.NET", |
"15fe Kinpo Electronics Inc", |
"15ff Fastpoint Technologies Inc", |
"1600 Northrop Grumman - Canada Ltd", |
"1601 Tenta Technology", |
"1602 Prosys-tec Inc", |
"1603 Nokia Wireless Communications", |
"1604 Central System Research Co Ltd", |
"1605 Pairgain Technologies", |
"1606 Europop AG", |
"1607 Lava Semiconductor Manufacturing Inc", |
"1608 Automated Wagering International", |
"1609 Scimetric Instruments Inc", |
"1612 Telesynergy Research Inc.", |
"1619 FarSite Communications Ltd", |
" 0400 FarSync T2P (2 port X.21/V.35/V.24)", |
" 0440 FarSync T4P (4 port X.21/V.35/V.24)", |
" 0610 FarSync T1U (1 port X.21/V.35/V.24)", |
" 0620 FarSync T2U (2 port X.21/V.35/V.24)", |
" 0640 FarSync T4U (4 port X.21/V.35/V.24)", |
" 1610 FarSync TE1 (T1,E1)", |
" 2610 FarSync DSL-S1 (SHDSL)", |
"161f Rioworks", |
"1626 TDK Semiconductor Corp.", |
" 8410 RTL81xx Fast Ethernet", |
"1629 Kongsberg Spacetec AS", |
" 1003 Format synchronizer v3.0", |
" 2002 Fast Universal Data Output", |
"1637 Linksys", |
" 3874 Linksys 802.11b WMP11 PCI Wireless card", |
"1638 Standard Microsystems Corp [SMC]", |
" 1100 SMC2602W EZConnect / Addtron AWA-100 / Eumitcom PCI WL11000", |
"163c Smart Link Ltd.", |
" 3052 SmartLink SmartPCI562 56K Modem", |
" 5449 SmartPCI561 Modem", |
"1657 Brocade Communications Systems, Inc.", |
"165a Epix Inc", |
" c100 PIXCI(R) CL1 Camera Link Video Capture Board [custom QL5232]", |
" d200 PIXCI(R) D2X Digital Video Capture Board [custom QL5232]", |
" d300 PIXCI(R) D3X Digital Video Capture Board [custom QL5232]", |
"165d Hsing Tech. Enterprise Co., Ltd.", |
"165f Linux Media Labs, LLC", |
" 1020 LMLM4 MPEG-4 encoder", |
"1661 Worldspace Corp.", |
"1668 Actiontec Electronics Inc", |
" 0100 Mini-PCI bridge", |
"166d Broadcom Corporation", |
" 0001 SiByte BCM1125/1125H/1250 System-on-a-Chip PCI", |
" 0002 SiByte BCM1125H/1250 System-on-a-Chip HyperTransport", |
"1677 Bernecker + Rainer", |
" 104e 5LS172.6 B&R Dual CAN Interface Card", |
" 12d7 5LS172.61 B&R Dual CAN Interface Card", |
"167b ZyDAS Technology Corp.", |
" 2102 ZyDAS ZD1202", |
" 187e 3406 ZyAIR B-122 CardBus 11Mbs Wireless LAN Card", |
"1681 Hercules", |
" 0010 Hercules 3d Prophet II Ultra 64MB (350 MHz NV15BR core)", |
"1682 XFX Pine Group Inc.", |
"1688 CastleNet Technology Inc.", |
" 1170 WLAN 802.11b card", |
"168c Atheros Communications, Inc.", |
" 0007 AR5000 802.11a Wireless Adapter", |
" 0011 AR5210 802.11a NIC", |
" 0012 AR5211 802.11ab NIC", |
" 0013 AR5212 802.11abg NIC", |
" 1113 d301 Philips CPWNA100 Wireless CardBus adapter", |
" 1186 3202 D-link DWL-G650 (Rev B3,B5) Wireless cardbus adapter", |
" 1186 3203 DWL-G520 Wireless PCI Adapter", |
" 1186 3a12 D-Link AirPlus DWL-G650 Wireless Cardbus Adapter(rev.C)", |
" 1186 3a13 D-Link AirPlus DWL-G520 Wireless PCI Adapter(rev.B)", |
" 1186 3a14 D-Link AirPremier DWL-AG530 Wireless PCI Adapter", |
" 1186 3a17 D-Link AirPremier DWL-G680 Wireless Cardbus Adapter", |
" 1186 3a18 D-Link AirPremier DWL-G550 Wireless PCI Adapter", |
" 1186 3a63 D-Link AirPremier DWL-AG660 Wireless Cardbus Adapter", |
" 1186 3a94 C54C Wireless 801.11g cardbus", |
" 1186 3ab0 Allnet ALL0281 Wireless PCI Card", |
" 1385 4d00 Netgear WG311T Wireless PCI Adapter", |
" 1458 e911 Gigabyte GN-WIAG02", |
" 14b7 0a60 8482-WD ORiNOCO 11a/b/g Wireless PCI Adapter", |
" 168c 0013 AirPlus XtremeG DWL-G650 Wireless PCMCIA Adapter", |
" 168c 1025 DWL-G650B2 Wireless CardBus Adapter", |
" 168c 1027 Netgate NL-3054CB ARIES b/g CardBus Adapter", |
" 168c 2026 Netgate 5354MP ARIES a(108Mb turbo)/b/g MiniPCI Adapter", |
" 168c 2041 Netgate 5354MP Plus ARIES2 b/g MiniPCI Adapter", |
" 168c 2042 Netgate 5354MP Plus ARIES2 a/b/g MiniPCI Adapter", |
" 16ab 7302 Trust Speedshare Turbo Pro Wireless PCI Adapter", |
" 185f 2012 Wistron NeWeb WLAN a+b+g model CB9", |
" 001a AR5005G 802.11abg NIC", |
" 1113 ee20 SMC Wireless CardBus Adapter 802.11g (SMCWCB-G EU)", |
" 1113 ee24 SMC Wireless PCI Card WPCI-G", |
" 1186 3a15 D-Link AirPlus G DWL-G630 Wireless Cardbus Adapter(rev.D)", |
" 1186 3a16 D-Link AirPlus G DWL-G510 Wireless PCI Adapter(rev.B)", |
" 1186 3a23 D-Link AirPlus G DWL-G520+A Wireless PCI Adapter", |
" 1186 3a24 D-Link AirPlus G DWL-G650+A Wireless Cardbus Adapter", |
" 168c 1052 TP-Link TL-WN510G Wireless CardBus Adapter", |
" 001b AR5006X 802.11abg NIC", |
" 1186 3a19 D-Link AirPremier AG DWL-AG660 Wireless Cardbus Adapter", |
" 1186 3a22 D-Link AirPremier AG DWL-AG530 Wireless PCI Adapter", |
" 168c 2062 EnGenius EMP-8602 (400mw)", |
" 168c 2063 EnGenius EMP-8602 (400mw)", |
" 0020 AR5005VL 802.11bg Wireless NIC", |
" 1014 AR5212 802.11abg NIC", |
"1695 EPoX Computer Co., Ltd.", |
"169c Netcell Corporation", |
" 0044 Revolution Storage Processing Card", |
"16a5 Tekram Technology Co.,Ltd.", |
"16ab Global Sun Technology Inc", |
" 1100 GL24110P", |
" 1101 PLX9052 PCMCIA-to-PCI Wireless LAN", |
" 1102 PCMCIA-to-PCI Wireless Network Bridge", |
" 8501 WL-8305 Wireless LAN PCI Adapter", |
"16ae Safenet Inc", |
" 1141 SafeXcel-1141", |
"16af SparkLAN Communications, Inc.", |
"16b4 Aspex Semiconductor Ltd", |
"16b8 Sonnet Technologies, Inc.", |
"16be Creatix Polymedia GmbH", |
"16c6 Micrel-Kendin", |
" 8695 Centaur KS8695 ARM processor", |
"16c8 Octasic Inc.", |
"16c9 EONIC B.V. The Netherlands", |
"16ca CENATEK Inc", |
" 0001 Rocket Drive DL", |
"16cd Densitron Technologies", |
"16ce Roland Corp.", |
"16d5 Acromag, Inc.", |
" 4d4e PMC482, APC482, AcPC482 Counter Timer Board", |
"16df PIKA Technologies Inc.", |
"16e3 European Space Agency", |
" 1e0f LEON2FT Processor", |
"16ec U.S. Robotics", |
" 00ff USR997900 10/100 Mbps PCI Network Card", |
" 0116 USR997902 10/100/1000 Mbps PCI Network Card", |
" 3685 Wireless Access PCI Adapter Model 022415", |
"16ed Sycron N. V.", |
" 1001 UMIO communication card", |
"16f3 Jetway Information Co., Ltd.", |
"16f4 Vweb Corp", |
" 8000 VW2010", |
"16f6 VideoTele.com, Inc.", |
"1702 Internet Machines Corporation (IMC)", |
"1705 Digital First, Inc.", |
"170b NetOctave", |
" 0100 NSP2000-SSL crypto accelerator", |
"170c YottaYotta Inc.", |
"1725 Vitesse Semiconductor", |
" 7174 VSC7174 PCI/PCI-X Serial ATA Host Bus Controller", |
"172a Accelerated Encryption", |
" 13c8 AEP SureWare Runner 1000V3", |
"1734 Fujitsu Siemens Computer GmbH", |
" 1078 Amilo Pro v2010", |
"1737 Linksys", |
" 0013 WMP54G Wireless Pci Card", |
" 0015 WMP54GS Wireless Pci Card", |
" 1032 Gigabit Network Adapter", |
" 1737 0015 EG1032 v2 Instant Gigabit Network Adapter", |
" 1737 0024 EG1032 v3 Instant Gigabit Network Adapter", |
" 1064 Gigabit Network Adapter", |
" 1737 0016 EG1064 v2 Instant Gigabit Network Adapter", |
" ab08 21x4x DEC-Tulip compatible 10/100 Ethernet", |
" ab09 21x4x DEC-Tulip compatible 10/100 Ethernet", |
"173b Altima (nee Broadcom)", |
" 03e8 AC1000 Gigabit Ethernet", |
" 03e9 AC1001 Gigabit Ethernet", |
" 03ea AC9100 Gigabit Ethernet", |
" 173b 0001 AC1002", |
" 03eb AC1003 Gigabit Ethernet", |
"1743 Peppercon AG", |
" 8139 ROL/F-100 Fast Ethernet Adapter with ROL", |
"1749 RLX Technologies", |
"174b PC Partner Limited", |
"174d WellX Telecom SA", |
"175c AudioScience Inc", |
"175e Sanera Systems, Inc.", |
"1775 SBS Technologies", |
"1787 Hightech Information System Ltd.", |
"1796 Research Centre Juelich", |
" 0001 SIS1100 [Gigabit link]", |
" 0002 HOTlink", |
" 0003 Counter Timer", |
" 0004 CAMAC Controller", |
" 0005 PROFIBUS", |
" 0006 AMCC HOTlink", |
"1797 JumpTec h, GMBH", |
"1799 Belkin", |
" 6001 Wireless PCI Card - F5D6001", |
" 6020 Wireless PCMCIA Card - F5D6020", |
" 6060 Wireless PDA Card - F5D6060", |
" 7000 Wireless PCI Card - F5D7000", |
" 7010 BCM4306 802.11b/g Wireless Lan Controller F5D7010", |
"179c Data Patterns", |
" 0557 DP-PCI-557 [PCI 1553B]", |
" 0566 DP-PCI-566 [Intelligent PCI 1553B]", |
" 5031 DP-CPCI-5031-Synchro Module", |
" 5121 DP-CPCI-5121-IP Carrier", |
" 5211 DP-CPCI-5211-IP Carrier", |
" 5679 AGE Display Module", |
"17a0 Genesys Logic, Inc", |
" 8033 GL880S USB 1.1 controller", |
" 8034 GL880S USB 2.0 controller", |
"17aa Lenovo", |
"17af Hightech Information System Ltd.", |
"17b3 Hawking Technologies", |
" ab08 PN672TX 10/100 Ethernet", |
"17b4 Indra Networks, Inc.", |
" 0011 WebEnhance 100 GZIP Compression Card", |
"17c0 Wistron Corp.", |
"17c2 Newisys, Inc.", |
"17cb Airgo Networks Inc", |
"17cc NetChip Technology, Inc", |
" 2280 USB 2.0", |
"17cf Z-Com, Inc.", |
"17d3 Areca Technology Corp.", |
" 1110 ARC-1110 4-Port PCI-X to SATA RAID Controller", |
" 1120 ARC-1120 8-Port PCI-X to SATA RAID Controller", |
" 1130 ARC-1130 12-Port PCI-X to SATA RAID Controller", |
" 1160 ARC-1160 16-Port PCI-X to SATA RAID Controller", |
" 1210 ARC-1210 4-Port PCI-Express to SATA RAID Controller", |
" 1220 ARC-1220 8-Port PCI-Express to SATA RAID Controller", |
" 1230 ARC-1230 12-Port PCI-Express to SATA RAID Controller", |
" 1260 ARC-1260 16-Port PCI-Express to SATA RAID Controller", |
"17d5 S2io Inc.", |
" 5831 Xframe 10 Gigabit Ethernet PCI-X", |
" 103c 12d5 HP PCI-X 133MHz 10GbE SR Fiber", |
" 5832 Xframe II 10Gbps Ethernet", |
"17de KWorld Computer Co. Ltd.", |
"17ee Connect Components Ltd", |
"17f2 Albatron Corp.", |
"17fe Linksys, A Division of Cisco Systems", |
" 2120 WMP11v4 802.11b PCI card", |
" 2220 [AirConn] INPROCOMM IPN 2220 Wireless LAN Adapter (rev 01)", |
" 17fe 2220 WPC54G ver. 4", |
"17ff Benq Corporation", |
"1809 Lumanate, Inc.", |
"1813 Ambient Technologies Inc", |
" 4000 HaM controllerless modem", |
" 16be 0001 V9x HAM Data Fax Modem", |
" 4100 HaM plus Data Fax Modem", |
" 16be 0002 V9x HAM 1394", |
"1814 RaLink", |
" 0101 Wireless PCI Adapter RT2400 / RT2460", |
" 1043 0127 WiFi-b add-on Card", |
" 1462 6828 PC11B2 (MS-6828) Wireless 11b PCI Card", |
" 0200 RT2500 802.11g PCI [PC54G2]", |
" 0201 RT2500 802.11g Cardbus/mini-PCI", |
" 1043 130f WL-130g", |
" 1371 001e CWC-854 Wireless-G CardBus Adapter", |
" 1371 001f CWM-854 Wireless-G Mini PCI Adapter", |
" 1371 0020 CWP-854 Wireless-G PCI Adapter", |
" 1458 e381 GN-WMKG 802.11b/g Wireless CardBus Adapter", |
" 1458 e931 GN-WIKG 802.11b/g mini-PCI Adapter", |
" 1462 6835 Wireless 11G CardBus CB54G2", |
" 1737 0032 WMP54G 2.0 PCI Adapter", |
" 1799 700a F5D7000 Wireless G Desktop Network Card", |
" 1799 701a F5D7010 Wireless G Notebook Network Card", |
" 185f 22a0 CN-WF513 Wireless Cardbus Adapter", |
" 0301 RT2561/RT61 802.11g PCI", |
" 1186 3c08 DWL-G630 Rev E", |
" 1186 3c09 DWL-G510 Rev C", |
" 0302 RT2561/RT61 rev B 802.11g", |
" 1186 3c08 DWL-G630 Rev E", |
" 1186 3c09 DWL-G510 Rev C", |
" 0401 Ralink RT2600 802.11 MIMO", |
"1820 InfiniCon Systems Inc.", |
"1822 Twinhan Technology Co. Ltd", |
" 4e35 Mantis DTV PCI Bridge Controller [Ver 1.0]", |
"182d SiteCom Europe BV", |
" 3069 ISDN PCI DC-105V2", |
" 9790 WL-121 Wireless Network Adapter 100g+ [Ver.3]", |
"1830 Credence Systems Corporation", |
"183b MikroM GmbH", |
" 08a7 MVC100 DVI", |
" 08a8 MVC101 SDI", |
" 08a9 MVC102 DVI+Audio", |
"1849 ASRock Incorporation", |
"1851 Microtune, Inc.", |
"1852 Anritsu Corp.", |
"1853 SMSC Automotive Infotainment System Group", |
"1854 LG Electronics, Inc.", |
"185b Compro Technology, Inc.", |
"185f Wistron NeWeb Corp.", |
"1864 SilverBack", |
" 2110 ISNAP 2110", |
"1867 Topspin Communications", |
" 5a44 MT23108 InfiniHost HCA", |
" 5a45 MT23108 InfiniHost HCA flash recovery", |
" 5a46 MT23108 InfiniHost HCA bridge", |
" 6278 MT25208 InfiniHost III Ex (Tavor compatibility mode)", |
" 6282 MT25208 InfiniHost III Ex", |
"187e ZyXEL Communication Corporation", |
" 3403 ZyAir G-110 802.11g", |
" 340e M-302 802.11g XtremeMIMO", |
"1888 Varisys Ltd", |
" 0301 VMFX1 FPGA PMC module", |
" 0601 VSM2 dual PMC carrier", |
" 0710 VS14x series PowerPC PCI board", |
" 0720 VS24x series PowerPC PCI board", |
"188a Ample Communications, Inc", |
"1890 Egenera, Inc.", |
"1894 KNC One", |
"1896 B&B Electronics Manufacturing Company, Inc.", |
"18a1 Astute Networks Inc.", |
"18ac DViCO Corporation", |
" d500 FusionHDTV 5", |
" d810 FusionHDTV 3 Gold", |
" d820 FusionHDTV 3 Gold-T", |
"18b8 Ammasso", |
" b001 AMSO 1100 iWARP/RDMA Gigabit Ethernet Coprocessor", |
"18bc Info-Tek Corp.", |
"18c3 Micronas Semiconductor Holding AG", |
"18c8 Cray Inc", |
"18c9 ARVOO Engineering BV", |
"18ca XGI - Xabre Graphics Inc", |
" 0020 Volari Z7", |
" 0040 Volari V3XT/V5/V8", |
"18d2 Sitecom", |
" 3069 DC-105v2 ISDN controller", |
"18dd Artimi Inc", |
" 4c6f Artimi RTMI-100 UWB adapter", |
"18e6 MPL AG", |
" 0001 OSCI [Octal Serial Communication Interface]", |
"18ec Cesnet, z.s.p.o.", |
" c006 COMBO6", |
" 18ec d001 COMBO-4MTX", |
" 18ec d002 COMBO-4SFP", |
" 18ec d003 COMBO-4SFPRO", |
" 18ec d004 COMBO-2XFP", |
" c045 COMBO6E", |
" c050 COMBO-PTM", |
" c058 COMBO6X", |
" 18ec d001 COMBO-4MTX", |
" 18ec d002 COMBO-4SFP", |
" 18ec d003 COMBO-4SFPRO", |
" 18ec d004 COMBO-2XFP", |
"18f7 Commtech, Inc.", |
" 0001 Fastcom ESCC-PCI-335", |
" 0002 Fastcom 422/4-PCI-335", |
" 0004 Fastcom 422/2-PCI-335", |
" 0005 Fastcom IGESCC-PCI-ISO/1", |
" 000a Fastcom 232/4-PCI-335", |
"18fb Resilience Corporation", |
"1904 Hangzhou Silan Microelectronics Co., Ltd.", |
"1923 Sangoma Technologies Corp.", |
" 0100 A104d QUAD T1/E1 AFT card", |
" 0400 A104u Quad T1/E1 AFT", |
"1924 Level 5 Networks Inc.", |
"192e TransDimension", |
"1931 Option N.V.", |
" 000c Qualcomm MSM6275 UMTS chip", |
"1942 ClearSpeed Technology plc", |
" e511 CSX600 Advance Accelerator Board", |
"1957 Freescale Semiconductor Inc", |
" 0080 MPC8349E", |
" 0081 MPC8349", |
" 0082 MPC8347E TBGA", |
" 0083 MPC8347 TBGA", |
" 0084 MPC8347E PBGA", |
" 0085 MPC8347 PBGA", |
" 0086 MPC8343E", |
" 0087 MPC8343", |
"1958 Faster Technology, LLC.", |
"1966 Orad Hi-Tec Systems", |
" 1975 DVG64 family", |
"196a Sensory Networks Inc.", |
" 0101 NodalCore C-1000 Content Classification Accelerator", |
" 0102 NodalCore C-2000 Content Classification Accelerator", |
"197b JMicron Technologies, Inc.", |
" 2360 JMicron 20360/20363 AHCI Controller", |
" 2361 JMB361 AHCI/IDE", |
" 2363 JMicron 20360/20363 AHCI Controller", |
" 2365 JMB365 AHCI/IDE", |
" 2366 JMB366 AHCI/IDE", |
"1989 Montilio Inc.", |
" 0001 RapidFile Bridge", |
" 8001 RapidFile", |
"1993 Innominate Security Technologies AG", |
"199a Pulse-LINK, Inc.", |
"19a8 DAQDATA GmbH", |
"19ac Kasten Chase Applied Research", |
" 0001 ACA2400 Crypto Accelerator", |
"19ae Progeny Systems Corporation", |
" 0520 4135 HFT Interface Controller", |
"19d4 Quixant Limited", |
"19e2 Vector Informatik GmbH", |
"1a03 ASPEED Technology, Inc.", |
" 2000 AST2000", |
"1a08 Sierra semiconductor", |
" 0000 SC15064", |
"1a1d GFaI e.V.", |
"1a29 Fortinet, Inc.", |
"1b13 Jaton Corp", |
"1c1c Symphony", |
" 0001 82C101", |
"1d44 DPT", |
" a400 PM2x24/PM3224", |
"1de1 Tekram Technology Co.,Ltd.", |
" 0391 TRM-S1040", |
" 2020 DC-390", |
" 690c 690c", |
" dc29 DC290", |
"1fc0 Tumsan Oy", |
" 0300 E2200 Dual E1/Rawpipe Card", |
"1fc1 PathScale, Inc", |
" 000d InfiniPath HT-400", |
" 0010 InfiniPath PE-800", |
"1fce Cognio Inc.", |
" 0001 Spectrum Analyzer PC Card (SAgE)", |
"2000 Smart Link Ltd.", |
"2001 Temporal Research Ltd", |
"2003 Smart Link Ltd.", |
"2004 Smart Link Ltd.", |
"21c3 21st Century Computer Corp.", |
"22b8 Motorola, Inc.", |
"2348 Racore", |
" 2010 8142 100VG/AnyLAN", |
"2646 Kingston Technologies", |
"270b Xantel Corporation", |
"270f Chaintech Computer Co. Ltd", |
"2711 AVID Technology Inc.", |
"2a15 3D Vision(???)", |
"3000 Hansol Electronics Inc.", |
"3142 Post Impression Systems.", |
"3388 Hint Corp", |
" 0013 HiNT HC4 PCI to ISDN bridge, Multimedia audio controller", |
" 0014 HiNT HC4 PCI to ISDN bridge, Network controller", |
" 0020 HB6 Universal PCI-PCI bridge (transparent mode)", |
" 0021 HB6 Universal PCI-PCI bridge (non-transparent mode)", |
" 4c53 1050 CT7 mainboard", |
" 4c53 1080 CT8 mainboard", |
" 4c53 1090 Cx9 mainboard", |
" 4c53 10a0 CA3/CR3 mainboard", |
" 4c53 3010 PPCI mezzanine (32-bit PMC)", |
" 4c53 3011 PPCI mezzanine (64-bit PMC)", |
" 4c53 4000 PMCCARR1 carrier board", |
" 0022 HiNT HB4 PCI-PCI Bridge (PCI6150)", |
" 0026 HB2 PCI-PCI Bridge", |
" 101a E.Band [AudioTrak Inca88]", |
" 101b E.Band [AudioTrak Inca88]", |
" 8011 VXPro II Chipset", |
" 3388 8011 VXPro II Chipset CPU to PCI Bridge", |
" 8012 VXPro II Chipset", |
" 3388 8012 VXPro II Chipset PCI to ISA Bridge", |
" 8013 VXPro II IDE", |
" 3388 8013 VXPro II Chipset EIDE Controller", |
"3411 Quantum Designs (H.K.) Inc", |
"3513 ARCOM Control Systems Ltd", |
"3842 eVga.com. Corp.", |
" c370 e-GeFORCE 6600 256 DDR PCI-e", |
"38ef 4Links", |
"3d3d 3DLabs", |
" 0001 GLINT 300SX", |
" 0002 GLINT 500TX", |
" 0000 0000 GLoria L", |
" 0003 GLINT Delta", |
" 0000 0000 GLoria XL", |
" 0004 Permedia", |
" 0005 Permedia", |
" 0006 GLINT MX", |
" 0000 0000 GLoria XL", |
" 1048 0a42 GLoria XXL", |
" 0007 3D Extreme", |
" 0008 GLINT Gamma G1", |
" 1048 0a42 GLoria XXL", |
" 0009 Permedia II 2D+3D", |
" 1040 0011 AccelStar II", |
" 1048 0a42 GLoria XXL", |
" 13e9 1000 6221L-4U", |
" 3d3d 0100 AccelStar II 3D Accelerator", |
" 3d3d 0111 Permedia 3:16", |
" 3d3d 0114 Santa Ana", |
" 3d3d 0116 Oxygen GVX1", |
" 3d3d 0119 Scirocco", |
" 3d3d 0120 Santa Ana PCL", |
" 3d3d 0125 Oxygen VX1", |
" 3d3d 0127 Permedia3 Create!", |
" 000a GLINT R3", |
" 3d3d 0121 Oxygen VX1", |
" 000c GLINT R3 [Oxygen VX1]", |
" 3d3d 0144 Oxygen VX1-4X AGP [Permedia 4]", |
" 000d GLint R4 rev A", |
" 0011 GLint R4 rev B", |
" 0012 GLint R5 rev A", |
" 0013 GLint R5 rev B", |
" 0020 VP10 visual processor", |
" 0022 VP10 visual processor", |
" 0024 VP9 visual processor", |
" 0100 Permedia II 2D+3D", |
" 07a1 Wildcat III 6210", |
" 07a2 Sun XVR-500 Graphics Accelerator", |
" 07a3 Wildcat IV 7210", |
" 1004 Permedia", |
" 3d04 Permedia", |
" ffff Glint VGA", |
"4005 Avance Logic Inc.", |
" 0300 ALS300 PCI Audio Device", |
" 0308 ALS300+ PCI Audio Device", |
" 0309 PCI Input Controller", |
" 1064 ALG-2064", |
" 2064 ALG-2064i", |
" 2128 ALG-2364A GUI Accelerator", |
" 2301 ALG-2301", |
" 2302 ALG-2302", |
" 2303 AVG-2302 GUI Accelerator", |
" 2364 ALG-2364A", |
" 2464 ALG-2464", |
" 2501 ALG-2564A/25128A", |
" 4000 ALS4000 Audio Chipset", |
" 4005 4000 ALS4000 Audio Chipset", |
" 4710 ALC200/200P", |
"4033 Addtron Technology Co, Inc.", |
" 1360 RTL8139 Ethernet", |
"4143 Digital Equipment Corp", |
"4144 Alpha Data", |
" 0044 ADM-XRCIIPro", |
"416c Aladdin Knowledge Systems", |
" 0100 AladdinCARD", |
" 0200 CPC", |
"4321 Tata Power Strategic Electronics Division", |
"4444 Internext Compression Inc", |
" 0016 iTVC16 (CX23416) MPEG-2 Encoder", |
" 0070 0003 WinTV PVR 250", |
" 0070 0009 WinTV PVR 150", |
" 0070 0801 WinTV PVR 150", |
" 0070 0807 WinTV PVR 150", |
" 0070 4001 WinTV PVR 250", |
" 0070 4009 WinTV PVR 250", |
" 0070 4801 WinTV PVR 250", |
" 0070 4803 WinTV PVR 250", |
" 0070 8003 WinTV PVR 150", |
" 0070 8801 WinTV PVR 150", |
" 0070 c801 WinTV PVR 150", |
" 0070 e807 WinTV PVR 500 (1st unit)", |
" 0070 e817 WinTV PVR 500 (2nd unit)", |
" 0070 ff92 WiNTV PVR-550", |
" 0270 0801 WinTV PVR 150", |
" 12ab fff3 MPG600", |
" 12ab ffff MPG600", |
" 9005 0092 VideOh! AVC-2010", |
" 9005 0093 VideOh! AVC-2410", |
" 0803 iTVC15 MPEG-2 Encoder", |
" 0070 4000 WinTV PVR-350", |
" 0070 4001 WinTV PVR-250", |
" 0070 4800 WinTV PVR-350 (V1)", |
" 12ab 0000 MPG160", |
" 1461 a3ce M179", |
" 1461 a3cf M179", |
"4468 Bridgeport machines", |
"4594 Cogetec Informatique Inc", |
"45fb Baldor Electric Company", |
"4680 Umax Computer Corp", |
"4843 Hercules Computer Technology Inc", |
"4916 RedCreek Communications Inc", |
" 1960 RedCreek PCI adapter", |
"4943 Growth Networks", |
"494f ACCES I/O Products, Inc.", |
" 10e8 LPCI-COM-8SM", |
"4978 Axil Computer Inc", |
"4a14 NetVin", |
" 5000 NV5000SC", |
" 4a14 5000 RT8029-Based Ethernet Adapter", |
"4b10 Buslogic Inc.", |
"4c48 LUNG HWA Electronics", |
"4c53 SBS Technologies", |
" 0000 PLUSTEST device", |
" 4c53 3000 PLUSTEST card (PC104+)", |
" 4c53 3001 PLUSTEST card (PMC)", |
" 0001 PLUSTEST-MM device", |
" 4c53 3002 PLUSTEST-MM card (PMC)", |
"4ca1 Seanix Technology Inc", |
"4d51 MediaQ Inc.", |
" 0200 MQ-200", |
"4d54 Microtechnica Co Ltd", |
"4ddc ILC Data Device Corp", |
" 0100 DD-42924I5-300 (ARINC 429 Data Bus)", |
" 0801 BU-65570I1 MIL-STD-1553 Test and Simulation", |
" 0802 BU-65570I2 MIL-STD-1553 Test and Simulation", |
" 0811 BU-65572I1 MIL-STD-1553 Test and Simulation", |
" 0812 BU-65572I2 MIL-STD-1553 Test and Simulation", |
" 0881 BU-65570T1 MIL-STD-1553 Test and Simulation", |
" 0882 BU-65570T2 MIL-STD-1553 Test and Simulation", |
" 0891 BU-65572T1 MIL-STD-1553 Test and Simulation", |
" 0892 BU-65572T2 MIL-STD-1553 Test and Simulation", |
" 0901 BU-65565C1 MIL-STD-1553 Data Bus", |
" 0902 BU-65565C2 MIL-STD-1553 Data Bus", |
" 0903 BU-65565C3 MIL-STD-1553 Data Bus", |
" 0904 BU-65565C4 MIL-STD-1553 Data Bus", |
" 0b01 BU-65569I1 MIL-STD-1553 Data Bus", |
" 0b02 BU-65569I2 MIL-STD-1553 Data Bus", |
" 0b03 BU-65569I3 MIL-STD-1553 Data Bus", |
" 0b04 BU-65569I4 MIL-STD-1553 Data Bus", |
"5046 GemTek Technology Corporation", |
" 1001 PCI Radio", |
"5053 Voyetra Technologies", |
" 2010 Daytona Audio Adapter", |
"5136 S S Technologies", |
"5143 Qualcomm Inc", |
"5145 Ensoniq (Old)", |
" 3031 Concert AudioPCI", |
"5168 Animation Technologies Inc.", |
" 0300 FlyDVB-S", |
" 0301 FlyDVB-T", |
"5301 Alliance Semiconductor Corp.", |
" 0001 ProMotion aT3D", |
"5333 S3 Inc.", |
" 0551 Plato/PX (system)", |
" 5631 86c325 [ViRGE]", |
" 8800 86c866 [Vision 866]", |
" 8801 86c964 [Vision 964]", |
" 8810 86c764_0 [Trio 32 vers 0]", |
" 8811 86c764/765 [Trio32/64/64V+]", |
" 8812 86cM65 [Aurora64V+]", |
" 8813 86c764_3 [Trio 32/64 vers 3]", |
" 8814 86c767 [Trio 64UV+]", |
" 8815 86cM65 [Aurora 128]", |
" 883d 86c988 [ViRGE/VX]", |
" 8870 FireGL", |
" 8880 86c868 [Vision 868 VRAM] vers 0", |
" 8881 86c868 [Vision 868 VRAM] vers 1", |
" 8882 86c868 [Vision 868 VRAM] vers 2", |
" 8883 86c868 [Vision 868 VRAM] vers 3", |
" 88b0 86c928 [Vision 928 VRAM] vers 0", |
" 88b1 86c928 [Vision 928 VRAM] vers 1", |
" 88b2 86c928 [Vision 928 VRAM] vers 2", |
" 88b3 86c928 [Vision 928 VRAM] vers 3", |
" 88c0 86c864 [Vision 864 DRAM] vers 0", |
" 88c1 86c864 [Vision 864 DRAM] vers 1", |
" 88c2 86c864 [Vision 864-P DRAM] vers 2", |
" 88c3 86c864 [Vision 864-P DRAM] vers 3", |
" 88d0 86c964 [Vision 964 VRAM] vers 0", |
" 88d1 86c964 [Vision 964 VRAM] vers 1", |
" 88d2 86c964 [Vision 964-P VRAM] vers 2", |
" 88d3 86c964 [Vision 964-P VRAM] vers 3", |
" 88f0 86c968 [Vision 968 VRAM] rev 0", |
" 88f1 86c968 [Vision 968 VRAM] rev 1", |
" 88f2 86c968 [Vision 968 VRAM] rev 2", |
" 88f3 86c968 [Vision 968 VRAM] rev 3", |
" 8900 86c755 [Trio 64V2/DX]", |
" 5333 8900 86C775 Trio64V2/DX", |
" 8901 86c775/86c785 [Trio 64V2/DX or /GX]", |
" 5333 8901 86C775 Trio64V2/DX, 86C785 Trio64V2/GX", |
" 8902 Plato/PX", |
" 8903 Trio 3D business multimedia", |
" 8904 Trio 64 3D", |
" 1014 00db Integrated Trio3D", |
" 5333 8904 86C365 Trio3D AGP", |
" 8905 Trio 64V+ family", |
" 8906 Trio 64V+ family", |
" 8907 Trio 64V+ family", |
" 8908 Trio 64V+ family", |
" 8909 Trio 64V+ family", |
" 890a Trio 64V+ family", |
" 890b Trio 64V+ family", |
" 890c Trio 64V+ family", |
" 890d Trio 64V+ family", |
" 890e Trio 64V+ family", |
" 890f Trio 64V+ family", |
" 8a01 ViRGE/DX or /GX", |
" 0e11 b032 ViRGE/GX", |
" 10b4 1617 Nitro 3D", |
" 10b4 1717 Nitro 3D", |
" 5333 8a01 ViRGE/DX", |
" 8a10 ViRGE/GX2", |
" 1092 8a10 Stealth 3D 4000", |
" 8a13 86c368 [Trio 3D/2X]", |
" 5333 8a13 Trio3D/2X", |
" 8a20 86c794 [Savage 3D]", |
" 5333 8a20 86C391 Savage3D", |
" 8a21 86c390 [Savage 3D/MV]", |
" 5333 8a21 86C390 Savage3D/MV", |
" 8a22 Savage 4", |
" 1033 8068 Savage 4", |
" 1033 8069 Savage 4", |
" 1033 8110 Savage 4 LT", |
" 105d 0018 SR9 8Mb SDRAM", |
" 105d 002a SR9 Pro 16Mb SDRAM", |
" 105d 003a SR9 Pro 32Mb SDRAM", |
" 105d 092f SR9 Pro+ 16Mb SGRAM", |
" 1092 4207 Stealth III S540", |
" 1092 4800 Stealth III S540", |
" 1092 4807 SpeedStar A90", |
" 1092 4808 Stealth III S540", |
" 1092 4809 Stealth III S540", |
" 1092 480e Stealth III S540", |
" 1092 4904 Stealth III S520", |
" 1092 4905 SpeedStar A200", |
" 1092 4a09 Stealth III S540", |
" 1092 4a0b Stealth III S540 Xtreme", |
" 1092 4a0f Stealth III S540", |
" 1092 4e01 Stealth III S540", |
" 1102 101d 3d Blaster Savage 4", |
" 1102 101e 3d Blaster Savage 4", |
" 5333 8100 86C394-397 Savage4 SDRAM 100", |
" 5333 8110 86C394-397 Savage4 SDRAM 110", |
" 5333 8125 86C394-397 Savage4 SDRAM 125", |
" 5333 8143 86C394-397 Savage4 SDRAM 143", |
" 5333 8a22 86C394-397 Savage4", |
" 5333 8a2e 86C394-397 Savage4 32bit", |
" 5333 9125 86C394-397 Savage4 SGRAM 125", |
" 5333 9143 86C394-397 Savage4 SGRAM 143", |
" 8a23 Savage 4", |
" 8a25 ProSavage PM133", |
" 8a26 ProSavage KM133", |
" 8c00 ViRGE/M3", |
" 8c01 ViRGE/MX", |
" 1179 0001 ViRGE/MX", |
" 8c02 ViRGE/MX+", |
" 8c03 ViRGE/MX+MV", |
" 8c10 86C270-294 Savage/MX-MV", |
" 8c11 82C270-294 Savage/MX", |
" 8c12 86C270-294 Savage/IX-MV", |
" 1014 017f Thinkpad T20/T22", |
" 1179 0001 86C584 SuperSavage/IXC Toshiba", |
" 8c13 86C270-294 Savage/IX", |
" 1179 0001 Magnia Z310", |
" 8c22 SuperSavage MX/128", |
" 8c24 SuperSavage MX/64", |
" 8c26 SuperSavage MX/64C", |
" 8c2a SuperSavage IX/128 SDR", |
" 8c2b SuperSavage IX/128 DDR", |
" 8c2c SuperSavage IX/64 SDR", |
" 8c2d SuperSavage IX/64 DDR", |
" 8c2e SuperSavage IX/C SDR", |
" 1014 01fc ThinkPad T23 (2647-4MG)", |
" 8c2f SuperSavage IX/C DDR", |
" 8d01 86C380 [ProSavageDDR K4M266]", |
" 8d02 VT8636A [ProSavage KN133] AGP4X VGA Controller (TwisterK)", |
" 8d03 VT8751 [ProSavageDDR P4M266]", |
" 8d04 VT8375 [ProSavage8 KM266/KL266]", |
" 9102 86C410 Savage 2000", |
" 1092 5932 Viper II Z200", |
" 1092 5934 Viper II Z200", |
" 1092 5952 Viper II Z200", |
" 1092 5954 Viper II Z200", |
" 1092 5a35 Viper II Z200", |
" 1092 5a37 Viper II Z200", |
" 1092 5a55 Viper II Z200", |
" 1092 5a57 Viper II Z200", |
" ca00 SonicVibes", |
"544c Teralogic Inc", |
" 0350 TL880-based HDTV/ATSC tuner", |
"5455 Technische University Berlin", |
" 4458 S5933", |
"5519 Cnet Technologies, Inc.", |
"5544 Dunord Technologies", |
" 0001 I-30xx Scanner Interface", |
"5555 Genroco, Inc", |
" 0003 TURBOstor HFP-832 [HiPPI NIC]", |
"5654 VoiceTronix Pty Ltd", |
" 3132 OpenSwitch12", |
"5700 Netpower", |
"5851 Exacq Technologies", |
"6356 UltraStor", |
"6374 c't Magazin fuer Computertechnik", |
" 6773 GPPCI", |
"6409 Logitec Corp.", |
"6666 Decision Computer International Co.", |
" 0001 PCCOM4", |
" 0002 PCCOM8", |
" 0004 PCCOM2", |
" 0101 PCI 8255/8254 I/O Card", |
"7063 pcHDTV", |
" 2000 HD-2000", |
" 3000 HD-3000", |
"7604 O.N. Electronic Co Ltd.", |
"7bde MIDAC Corporation", |
"7fed PowerTV", |
"8008 Quancom Electronic GmbH", |
" 0010 WDOG1 [PCI-Watchdog 1]", |
" 0011 PWDOG2 [PCI-Watchdog 2]", |
"807d Asustek Computer, Inc.", |
"8086 Intel Corporation", |
" 0007 82379AB", |
" 0008 Extended Express System Support Controller", |
" 0039 21145 Fast Ethernet", |
" 0122 82437FX", |
" 0309 80303 I/O Processor PCI-to-PCI Bridge", |
" 030d 80312 I/O Companion Chip PCI-to-PCI Bridge", |
" 0326 6700/6702PXH I/OxAPIC Interrupt Controller A", |
" 0327 6700PXH I/OxAPIC Interrupt Controller B", |
" 0329 6700PXH PCI Express-to-PCI Bridge A", |
" 032a 6700PXH PCI Express-to-PCI Bridge B", |
" 032c 6702PXH PCI Express-to-PCI Bridge A", |
" 0330 80332 [Dobson] I/O processor (A-Segment Bridge)", |
" 0331 80332 [Dobson] I/O processor (A-Segment IOAPIC)", |
" 0332 80332 [Dobson] I/O processor (B-Segment Bridge)", |
" 0333 80332 [Dobson] I/O processor (B-Segment IOAPIC)", |
" 0334 80332 [Dobson] I/O processor (ATU)", |
" 0335 80331 [Lindsay] I/O processor (PCI-X Bridge)", |
" 0336 80331 [Lindsay] I/O processor (ATU)", |
" 0340 41210 [Lanai] Serial to Parallel PCI Bridge (A-Segment Bridge)", |
" 0341 41210 [Lanai] Serial to Parallel PCI Bridge (B-Segment Bridge)", |
" 0370 80333 Segment-A PCI Express-to-PCI Express Bridge", |
" 0371 80333 A-Bus IOAPIC", |
" 0372 80333 Segment-B PCI Express-to-PCI Express Bridge", |
" 0373 80333 B-Bus IOAPIC", |
" 0374 80333 Address Translation Unit", |
" 0482 82375EB/SB PCI to EISA Bridge", |
" 0483 82424TX/ZX [Saturn] CPU to PCI bridge", |
" 0484 82378ZB/IB, 82379AB (SIO, SIO.A) PCI to ISA Bridge", |
" 0486 82425EX/ZX [Aries] PCIset with ISA bridge", |
" 04a3 82434LX/NX [Mercury/Neptune] Processor to PCI bridge", |
" 04d0 82437FX [Triton FX]", |
" 0500 E8870 Processor bus control", |
" 0501 E8870 Memory controller", |
" 0502 E8870 Scalability Port 0", |
" 0503 E8870 Scalability Port 1", |
" 0510 E8870IO Hub Interface Port 0 registers (8-bit compatibility port)", |
" 0511 E8870IO Hub Interface Port 1 registers", |
" 0512 E8870IO Hub Interface Port 2 registers", |
" 0513 E8870IO Hub Interface Port 3 registers", |
" 0514 E8870IO Hub Interface Port 4 registers", |
" 0515 E8870IO General SIOH registers", |
" 0516 E8870IO RAS registers", |
" 0530 E8870SP Scalability Port 0 registers", |
" 0531 E8870SP Scalability Port 1 registers", |
" 0532 E8870SP Scalability Port 2 registers", |
" 0533 E8870SP Scalability Port 3 registers", |
" 0534 E8870SP Scalability Port 4 registers", |
" 0535 E8870SP Scalability Port 5 registers", |
" 0536 E8870SP Interleave registers 0 and 1", |
" 0537 E8870SP Interleave registers 2 and 3", |
" 0600 RAID Controller", |
" 8086 01af SRCZCR", |
" 8086 01c1 ICP Vortex GDT8546RZ", |
" 8086 01f7 SCRU32", |
" 061f 80303 I/O Processor", |
" 0960 80960RP [i960 RP Microprocessor/Bridge]", |
" 0962 80960RM [i960RM Bridge]", |
" 0964 80960RP [i960 RP Microprocessor/Bridge]", |
" 1000 82542 Gigabit Ethernet Controller", |
" 0e11 b0df NC1632 Gigabit Ethernet Adapter (1000-SX)", |
" 0e11 b0e0 NC1633 Gigabit Ethernet Adapter (1000-LX)", |
" 0e11 b123 NC1634 Gigabit Ethernet Adapter (1000-SX)", |
" 1014 0119 Netfinity Gigabit Ethernet SX Adapter", |
" 8086 1000 PRO/1000 Gigabit Server Adapter", |
" 1001 82543GC Gigabit Ethernet Controller (Fiber)", |
" 0e11 004a NC6136 Gigabit Server Adapter", |
" 1014 01ea Netfinity Gigabit Ethernet SX Adapter", |
" 8086 1002 PRO/1000 F Server Adapter", |
" 8086 1003 PRO/1000 F Server Adapter", |
" 1002 Pro 100 LAN+Modem 56 Cardbus II", |
" 8086 200e Pro 100 LAN+Modem 56 Cardbus II", |
" 8086 2013 Pro 100 SR Mobile Combo Adapter", |
" 8086 2017 Pro 100 S Combo Mobile Adapter", |
" 1004 82543GC Gigabit Ethernet Controller (Copper)", |
" 0e11 0049 NC7132 Gigabit Upgrade Module", |
" 0e11 b1a4 NC7131 Gigabit Server Adapter", |
" 1014 10f2 Gigabit Ethernet Server Adapter", |
" 8086 1004 PRO/1000 T Server Adapter", |
" 8086 2004 PRO/1000 T Server Adapter", |
" 1008 82544EI Gigabit Ethernet Controller (Copper)", |
" 1014 0269 iSeries 1000/100/10 Ethernet Adapter", |
" 1028 011c PRO/1000 XT Network Connection", |
" 8086 1107 PRO/1000 XT Server Adapter", |
" 8086 2107 PRO/1000 XT Server Adapter", |
" 8086 2110 PRO/1000 XT Server Adapter", |
" 8086 3108 PRO/1000 XT Network Connection", |
" 1009 82544EI Gigabit Ethernet Controller (Fiber)", |
" 1014 0268 iSeries Gigabit Ethernet Adapter", |
" 8086 1109 PRO/1000 XF Server Adapter", |
" 8086 2109 PRO/1000 XF Server Adapter", |
" 100a 82540EM Gigabit Ethernet Controller", |
" 100c 82544GC Gigabit Ethernet Controller (Copper)", |
" 8086 1112 PRO/1000 T Desktop Adapter", |
" 8086 2112 PRO/1000 T Desktop Adapter", |
" 100d 82544GC Gigabit Ethernet Controller (LOM)", |
" 1028 0123 PRO/1000 XT Network Connection", |
" 1079 891f 82544GC Based Network Connection", |
" 4c53 1080 CT8 mainboard", |
" 8086 110d 82544GC Based Network Connection", |
" 100e 82540EM Gigabit Ethernet Controller", |
" 1014 0265 PRO/1000 MT Network Connection", |
" 1014 0267 PRO/1000 MT Network Connection", |
" 1014 026a PRO/1000 MT Network Connection", |
" 1024 0134 Poweredge SC600", |
" 1028 002e Optiplex GX260", |
" 1028 0151 PRO/1000 MT Network Connection", |
" 107b 8920 PRO/1000 MT Desktop Adapter", |
" 8086 001e PRO/1000 MT Desktop Adapter", |
" 8086 002e PRO/1000 MT Desktop Adapter", |
" 8086 1376 PRO/1000 GT Desktop Adapter", |
" 8086 1476 PRO/1000 GT Desktop Adapter", |
" 100f 82545EM Gigabit Ethernet Controller (Copper)", |
" 1014 0269 iSeries 1000/100/10 Ethernet Adapter", |
" 1014 028e PRO/1000 MT Network Connection", |
" 8086 1000 PRO/1000 MT Network Connection", |
" 8086 1001 PRO/1000 MT Server Adapter", |
" 1010 82546EB Gigabit Ethernet Controller (Copper)", |
" 0e11 00db NC7170 Gigabit Server Adapter", |
" 1014 027c PRO/1000 MT Dual Port Network Adapter", |
" 18fb 7872 RESlink-X", |
" 1fc1 0026 Niagara 2260 Bypass Card", |
" 4c53 1080 CT8 mainboard", |
" 4c53 10a0 CA3/CR3 mainboard", |
" 8086 1011 PRO/1000 MT Dual Port Server Adapter", |
" 8086 1012 Primergy RX300", |
" 8086 101a PRO/1000 MT Dual Port Network Adapter", |
" 8086 3424 SE7501HG2 Mainboard", |
" 1011 82545EM Gigabit Ethernet Controller (Fiber)", |
" 1014 0268 iSeries Gigabit Ethernet Adapter", |
" 8086 1002 PRO/1000 MF Server Adapter", |
" 8086 1003 PRO/1000 MF Server Adapter (LX)", |
" 1012 82546EB Gigabit Ethernet Controller (Fiber)", |
" 0e11 00dc NC6170 Gigabit Server Adapter", |
" 8086 1012 PRO/1000 MF Dual Port Server Adapter", |
" 1013 82541EI Gigabit Ethernet Controller (Copper)", |
" 8086 0013 PRO/1000 MT Network Connection", |
" 8086 1013 IBM ThinkCentre Network Card", |
" 8086 1113 PRO/1000 MT Desktop Adapter", |
" 1014 82541ER Gigabit Ethernet Controller", |
" 1015 82540EM Gigabit Ethernet Controller (LOM)", |
" 1016 82540EP Gigabit Ethernet Controller (LOM)", |
" 1014 052c PRO/1000 MT Mobile Connection", |
" 1179 0001 PRO/1000 MT Mobile Connection", |
" 8086 1016 PRO/1000 MT Mobile Connection", |
" 1017 82540EP Gigabit Ethernet Controller (LOM)", |
" 8086 1017 PR0/1000 MT Desktop Connection", |
" 1018 82541EI Gigabit Ethernet Controller", |
" 8086 1018 PRO/1000 MT Desktop Adapter", |
" 1019 82547EI Gigabit Ethernet Controller (LOM)", |
" 1458 1019 GA-8IPE1000 Pro2 motherboard (865PE)", |
" 1458 e000 Intel Gigabit Ethernet (Kenai II)", |
" 8086 1019 PRO/1000 CT Desktop Connection", |
" 8086 301f D865PERL mainboard", |
" 8086 302c Intel 82865G Mainboard (D865GBF)", |
" 8086 3427 S875WP1-E mainboard", |
" 101a 82547EI Gigabit Ethernet Controller (Mobile)", |
" 101d 82546EB Gigabit Ethernet Controller", |
" 8086 1000 PRO/1000 MT Quad Port Server Adapter", |
" 101e 82540EP Gigabit Ethernet Controller (Mobile)", |
" 1014 0549 PRO/1000 MT Mobile Connection", |
" 1179 0001 PRO/1000 MT Mobile Connection", |
" 8086 101e PRO/1000 MT Mobile Connection", |
" 1026 82545GM Gigabit Ethernet Controller", |
" 1028 0169 Precision 470", |
" 8086 1000 PRO/1000 MT Server Connection", |
" 8086 1001 PRO/1000 MT Server Adapter", |
" 8086 1002 PRO/1000 MT Server Adapter", |
" 8086 1026 PRO/1000 MT Server Connection", |
" 1027 82545GM Gigabit Ethernet Controller", |
" 103c 3103 NC310F PCI-X Gigabit Server Adapter", |
" 8086 1001 PRO/1000 MF Server Adapter(LX)", |
" 8086 1002 PRO/1000 MF Server Adapter(LX)", |
" 8086 1003 PRO/1000 MF Server Adapter(LX)", |
" 8086 1027 PRO/1000 MF Server Adapter", |
" 1028 82545GM Gigabit Ethernet Controller", |
" 8086 1028 PRO/1000 MB Server Adapter", |
" 1029 82559 Ethernet Controller", |
" 1030 82559 InBusiness 10/100", |
" 1031 82801CAM (ICH3) PRO/100 VE (LOM) Ethernet Controller", |
" 1014 0209 ThinkPad A/T/X Series", |
" 104d 80e7 Vaio PCG-GR214EP/GR214MP/GR215MP/GR314MP/GR315MP", |
" 104d 813c Vaio PCG-GRV616G", |
" 107b 5350 EtherExpress PRO/100 VE", |
" 1179 0001 EtherExpress PRO/100 VE", |
" 144d c000 EtherExpress PRO/100 VE", |
" 144d c001 EtherExpress PRO/100 VE", |
" 144d c003 EtherExpress PRO/100 VE", |
" 144d c006 vpr Matrix 170B4", |
" 1032 82801CAM (ICH3) PRO/100 VE Ethernet Controller", |
" 1033 82801CAM (ICH3) PRO/100 VM (LOM) Ethernet Controller", |
" 1034 82801CAM (ICH3) PRO/100 VM Ethernet Controller", |
" 1035 82801CAM (ICH3)/82562EH (LOM) Ethernet Controller", |
" 1036 82801CAM (ICH3) 82562EH Ethernet Controller", |
" 1037 82801CAM (ICH3) Chipset Ethernet Controller", |
" 1038 82801CAM (ICH3) PRO/100 VM (KM) Ethernet Controller", |
" 0e11 0098 Evo N600c", |
" 1039 82801DB PRO/100 VE (LOM) Ethernet Controller", |
" 1014 0267 NetVista A30p", |
" 103a 82801DB PRO/100 VE (CNR) Ethernet Controller", |
" 103b 82801DB PRO/100 VM (LOM) Ethernet Controller", |
" 103c 82801DB PRO/100 VM (CNR) Ethernet Controller", |
" 103d 82801DB PRO/100 VE (MOB) Ethernet Controller", |
" 103e 82801DB PRO/100 VM (MOB) Ethernet Controller", |
" 1040 536EP Data Fax Modem", |
" 16be 1040 V.9X DSP Data Fax Modem", |
" 1043 PRO/Wireless LAN 2100 3B Mini PCI Adapter", |
" 8086 2527 MIM2000/Centrino", |
" 1048 PRO/10GbE LR Server Adapter", |
" 8086 a01f PRO/10GbE LR Server Adapter", |
" 8086 a11f PRO/10GbE LR Server Adapter", |
" 104b Ethernet Controller", |
" 1050 82562EZ 10/100 Ethernet Controller", |
" 1462 728c 865PE Neo2 (MS-6728)", |
" 1462 758c MS-6758 (875P Neo)", |
" 8086 3020 D865PERL mainboard", |
" 8086 302f Desktop Board D865GBF", |
" 8086 3427 S875WP1-E mainboard", |
" 1051 82801EB/ER (ICH5/ICH5R) integrated LAN Controller", |
" 1052 PRO/100 VM Network Connection", |
" 1053 PRO/100 VM Network Connection", |
" 1059 82551QM Ethernet Controller", |
" 105e 82571EB Gigabit Ethernet Controller", |
" 1775 6003 Telum GE-QT", |
" 105f 82571EB Gigabit Ethernet Controller", |
" 1060 82571EB Gigabit Ethernet Controller", |
" 1064 82562ET/EZ/GT/GZ - PRO/100 VE (LOM) Ethernet Controller", |
" 1043 80f8 P5GD1-VW Mainboard", |
" 1065 82562ET/EZ/GT/GZ - PRO/100 VE Ethernet Controller", |
" 1066 82562 EM/EX/GX - PRO/100 VM (LOM) Ethernet Controller", |
" 1067 82562 EM/EX/GX - PRO/100 VM Ethernet Controller", |
" 1068 82562ET/EZ/GT/GZ - PRO/100 VE (LOM) Ethernet Controller Mobile", |
" 1069 82562EM/EX/GX - PRO/100 VM (LOM) Ethernet Controller Mobile", |
" 106a 82562G - PRO/100 VE (LOM) Ethernet Controller", |
" 106b 82562G - PRO/100 VE Ethernet Controller Mobile", |
" 1075 82547GI Gigabit Ethernet Controller", |
" 1028 0165 PowerEdge 750", |
" 8086 0075 PRO/1000 CT Network Connection", |
" 8086 1075 PRO/1000 CT Network Connection", |
" 1076 82541GI/PI Gigabit Ethernet Controller", |
" 1028 0165 PowerEdge 750", |
" 1028 019a PowerEdge SC1425", |
" 8086 0076 PRO/1000 MT Network Connection", |
" 8086 1076 PRO/1000 MT Network Connection", |
" 8086 1176 PRO/1000 MT Desktop Adapter", |
" 8086 1276 PRO/1000 MT Desktop Adapter", |
" 1077 82541GI Gigabit Ethernet Controller", |
" 1179 0001 PRO/1000 MT Mobile Connection", |
" 8086 0077 PRO/1000 MT Mobile Connection", |
" 8086 1077 PRO/1000 MT Mobile Connection", |
" 1078 82541EI Gigabit Ethernet Controller", |
" 8086 1078 PRO/1000 MT Network Connection", |
" 1079 82546GB Gigabit Ethernet Controller", |
" 103c 12a6 HP Dual Port 1000Base-T [A9900A]", |
" 103c 12cf HP Core Dual Port 1000Base-T [AB352A]", |
" 1fc1 0027 Niagara 2261 Failover NIC", |
" 4c53 1090 Cx9 / Vx9 mainboard", |
" 4c53 10b0 CL9 mainboard", |
" 8086 0079 PRO/1000 MT Dual Port Network Connection", |
" 8086 1079 PRO/1000 MT Dual Port Network Connection", |
" 8086 1179 PRO/1000 MT Dual Port Network Connection", |
" 8086 117a PRO/1000 MT Dual Port Server Adapter", |
" 107a 82546GB Gigabit Ethernet Controller", |
" 103c 12a8 HP Dual Port 1000base-SX [A9899A]", |
" 8086 107a PRO/1000 MF Dual Port Server Adapter", |
" 8086 127a PRO/1000 MF Dual Port Server Adapter", |
" 107b 82546GB Gigabit Ethernet Controller", |
" 8086 007b PRO/1000 MB Dual Port Server Connection", |
" 8086 107b PRO/1000 MB Dual Port Server Connection", |
" 107c 82541PI Gigabit Ethernet Controller", |
" 107d 82572EI Gigabit Ethernet Controller", |
" 107e 82572EI Gigabit Ethernet Controller", |
" 107f 82572EI Gigabit Ethernet Controller", |
" 1080 FA82537EP 56K V.92 Data/Fax Modem PCI", |
" 1081 Enterprise Southbridge LAN Copper", |
" 1082 Enterprise Southbridge LAN fiber", |
" 1083 Enterprise Southbridge LAN SERDES", |
" 1084 Enterprise Southbridge IDE Redirection", |
" 1085 Enterprise Southbridge Serial Port Redirection", |
" 1086 Enterprise Southbridge IPMI/KCS0", |
" 1087 Enterprise Southbridge UHCI Redirection", |
" 1089 Enterprise Southbridge BT", |
" 108a 82546EB Gigabit Ethernet Controller", |
" 108b 82573V Gigabit Ethernet Controller (Copper)", |
" 108c 82573E Gigabit Ethernet Controller (Copper)", |
" 108e 82573E KCS (Active Management)", |
" 108f Intel(R) Active Management Technology - SOL", |
" 1092 Intel(R) PRO/100 VE Network Connection", |
" 1096 PRO/1000 EB Network Connection with I/O Acceleration", |
" 1097 Enterprise Southbridge DPT LAN fiber", |
" 1098 PRO/1000 EB Backplane Connection with I/O Acceleration", |
" 1099 82546GB Quad Port Server Adapter", |
" 109a 82573L Gigabit Ethernet Controller", |
" 17aa 207e Thinkpad X60s", |
" 109b 82546GB PRO/1000 GF Quad Port Server Adapter", |
" 10a0 82571EB PRO/1000 AT Quad Port Bypass Adapter", |
" 10a1 82571EB PRO/1000 AF Quad Port Bypass Adapter", |
" 10b0 82573L PRO/1000 PL Network Connection", |
" 10b2 82573V PRO/1000 PM Network Connection", |
" 10b3 82573E PRO/1000 PM Network Connection", |
" 10b4 82573L PRO/1000 PL Network Connection", |
" 10b5 82546GB PRO/1000 GT Quad Port Server Adapter", |
" 103c 3109 NC340T PCI-X Quad-port Gigabit Server Adapter", |
" 1107 PRO/1000 MF Server Adapter (LX)", |
" 1130 82815 815 Chipset Host Bridge and Memory Controller Hub", |
" 1025 1016 Travelmate 612 TX", |
" 1043 8027 TUSL2-C Mainboard", |
" 104d 80df Vaio PCG-FX403", |
" 8086 4532 D815EEA2 mainboard", |
" 8086 4557 D815EGEW Mainboard", |
" 1131 82815 815 Chipset AGP Bridge", |
" 1132 82815 CGC [Chipset Graphics Controller]", |
" 1025 1016 Travelmate 612 TX", |
" 104d 80df Vaio PCG-FX403", |
" 8086 4532 D815EEA2 Mainboard", |
" 8086 4541 D815EEA Motherboard", |
" 8086 4557 D815EGEW Mainboard", |
" 1161 82806AA PCI64 Hub Advanced Programmable Interrupt Controller", |
" 8086 1161 82806AA PCI64 Hub APIC", |
" 1162 Xscale 80200 Big Endian Companion Chip", |
" 1200 Intel IXP1200 Network Processor", |
" 172a 0000 AEP SSL Accelerator", |
" 1209 8255xER/82551IT Fast Ethernet Controller", |
" 4c53 1050 CT7 mainboard", |
" 4c53 1051 CE7 mainboard", |
" 4c53 1070 PC6 mainboard", |
" 1221 82092AA PCI to PCMCIA Bridge", |
" 1222 82092AA IDE Controller", |
" 1223 SAA7116", |
" 1225 82452KX/GX [Orion]", |
" 1226 82596 PRO/10 PCI", |
" 1227 82865 EtherExpress PRO/100A", |
" 1228 82556 EtherExpress PRO/100 Smart", |
" 1229 82557/8/9 [Ethernet Pro 100]", |
" 0e11 3001 82559 Fast Ethernet LOM with Alert on LAN*", |
" 0e11 3002 82559 Fast Ethernet LOM with Alert on LAN*", |
" 0e11 3003 82559 Fast Ethernet LOM with Alert on LAN*", |
" 0e11 3004 82559 Fast Ethernet LOM with Alert on LAN*", |
" 0e11 3005 82559 Fast Ethernet LOM with Alert on LAN*", |
" 0e11 3006 82559 Fast Ethernet LOM with Alert on LAN*", |
" 0e11 3007 82559 Fast Ethernet LOM with Alert on LAN*", |
" 0e11 b01e NC3120 Fast Ethernet NIC", |
" 0e11 b01f NC3122 Fast Ethernet NIC (dual port)", |
" 0e11 b02f NC1120 Ethernet NIC", |
" 0e11 b04a Netelligent 10/100TX NIC with Wake on LAN", |
" 0e11 b0c6 NC3161 Fast Ethernet NIC (embedded, WOL)", |
" 0e11 b0c7 NC3160 Fast Ethernet NIC (embedded)", |
" 0e11 b0d7 NC3121 Fast Ethernet NIC (WOL)", |
" 0e11 b0dd NC3131 Fast Ethernet NIC (dual port)", |
" 0e11 b0de NC3132 Fast Ethernet Module (dual port)", |
" 0e11 b0e1 NC3133 Fast Ethernet Module (100-FX)", |
" 0e11 b134 NC3163 Fast Ethernet NIC (embedded, WOL)", |
" 0e11 b13c NC3162 Fast Ethernet NIC (embedded)", |
" 0e11 b144 NC3123 Fast Ethernet NIC (WOL)", |
" 0e11 b163 NC3134 Fast Ethernet NIC (dual port)", |
" 0e11 b164 NC3135 Fast Ethernet Upgrade Module (dual port)", |
" 0e11 b1a4 NC7131 Gigabit Server Adapter", |
" 1014 005c 82558B Ethernet Pro 10/100", |
" 1014 01bc 82559 Fast Ethernet LAN On Motherboard", |
" 1014 01f1 10/100 Ethernet Server Adapter", |
" 1014 01f2 10/100 Ethernet Server Adapter", |
" 1014 0207 Ethernet Pro/100 S", |
" 1014 0232 10/100 Dual Port Server Adapter", |
" 1014 023a ThinkPad R30", |
" 1014 105c Netfinity 10/100", |
" 1014 2205 ThinkPad A22p", |
" 1014 305c 10/100 EtherJet Management Adapter", |
" 1014 405c 10/100 EtherJet Adapter with Alert on LAN", |
" 1014 505c 10/100 EtherJet Secure Management Adapter", |
" 1014 605c 10/100 EtherJet Secure Management Adapter", |
" 1014 705c 10/100 Netfinity 10/100 Ethernet Security Adapter", |
" 1014 805c 10/100 Netfinity 10/100 Ethernet Security Adapter", |
" 1028 009b PowerEdge 2500/2550", |
" 1028 00ce PowerEdge 1400", |
" 1033 8000 PC-9821X-B06", |
" 1033 8016 PK-UG-X006", |
" 1033 801f PK-UG-X006", |
" 1033 8026 PK-UG-X006", |
" 1033 8063 82559-based Fast Ethernet Adapter", |
" 1033 8064 82559-based Fast Ethernet Adapter", |
" 103c 10c0 NetServer 10/100TX", |
" 103c 10c3 NetServer 10/100TX", |
" 103c 10ca NetServer 10/100TX", |
" 103c 10cb NetServer 10/100TX", |
" 103c 10e3 NetServer 10/100TX", |
" 103c 10e4 NetServer 10/100TX", |
" 103c 1200 NetServer 10/100TX", |
" 108e 10cf EtherExpress PRO/100(B)", |
" 10c3 1100 SmartEther100 SC1100", |
" 10cf 1115 8255x-based Ethernet Adapter (10/100)", |
" 10cf 1143 8255x-based Ethernet Adapter (10/100)", |
" 110a 008b 82551QM Fast Ethernet Multifuction PCI/CardBus Controller", |
" 1179 0001 8255x-based Ethernet Adapter (10/100)", |
" 1179 0002 PCI FastEther LAN on Docker", |
" 1179 0003 8255x-based Fast Ethernet", |
" 1259 2560 AT-2560 100", |
" 1259 2561 AT-2560 100 FX Ethernet Adapter", |
" 1266 0001 NE10/100 Adapter", |
" 13e9 1000 6221L-4U", |
" 144d 2501 SEM-2000 MiniPCI LAN Adapter", |
" 144d 2502 SEM-2100IL MiniPCI LAN Adapter", |
" 1668 1100 EtherExpress PRO/100B (TX) (MiniPCI Ethernet+Modem)", |
" 4c53 1080 CT8 mainboard", |
" 4c53 10e0 PSL09 PrPMC", |
" 8086 0001 EtherExpress PRO/100B (TX)", |
" 8086 0002 EtherExpress PRO/100B (T4)", |
" 8086 0003 EtherExpress PRO/10+", |
" 8086 0004 EtherExpress PRO/100 WfM", |
" 8086 0005 82557 10/100", |
" 8086 0006 82557 10/100 with Wake on LAN", |
" 8086 0007 82558 10/100 Adapter", |
" 8086 0008 82558 10/100 with Wake on LAN", |
" 8086 000a EtherExpress PRO/100+ Management Adapter", |
" 8086 000b EtherExpress PRO/100+", |
" 8086 000c EtherExpress PRO/100+ Management Adapter", |
" 8086 000d EtherExpress PRO/100+ Alert On LAN II* Adapter", |
" 8086 000e EtherExpress PRO/100+ Management Adapter with Alert On LAN*", |
" 8086 000f EtherExpress PRO/100 Desktop Adapter", |
" 8086 0010 EtherExpress PRO/100 S Management Adapter", |
" 8086 0011 EtherExpress PRO/100 S Management Adapter", |
" 8086 0012 EtherExpress PRO/100 S Advanced Management Adapter (D)", |
" 8086 0013 EtherExpress PRO/100 S Advanced Management Adapter (E)", |
" 8086 0030 EtherExpress PRO/100 Management Adapter with Alert On LAN* GC", |
" 8086 0031 EtherExpress PRO/100 Desktop Adapter", |
" 8086 0040 EtherExpress PRO/100 S Desktop Adapter", |
" 8086 0041 EtherExpress PRO/100 S Desktop Adapter", |
" 8086 0042 EtherExpress PRO/100 Desktop Adapter", |
" 8086 0050 EtherExpress PRO/100 S Desktop Adapter", |
" 8086 1009 EtherExpress PRO/100+ Server Adapter", |
" 8086 100c EtherExpress PRO/100+ Server Adapter (PILA8470B)", |
" 8086 1012 EtherExpress PRO/100 S Server Adapter (D)", |
" 8086 1013 EtherExpress PRO/100 S Server Adapter (E)", |
" 8086 1015 EtherExpress PRO/100 S Dual Port Server Adapter", |
" 8086 1017 EtherExpress PRO/100+ Dual Port Server Adapter", |
" 8086 1030 EtherExpress PRO/100+ Management Adapter with Alert On LAN* G Server", |
" 8086 1040 EtherExpress PRO/100 S Server Adapter", |
" 8086 1041 EtherExpress PRO/100 S Server Adapter", |
" 8086 1042 EtherExpress PRO/100 Server Adapter", |
" 8086 1050 EtherExpress PRO/100 S Server Adapter", |
" 8086 1051 EtherExpress PRO/100 Server Adapter", |
" 8086 1052 EtherExpress PRO/100 Server Adapter", |
" 8086 10f0 EtherExpress PRO/100+ Dual Port Adapter", |
" 8086 2009 EtherExpress PRO/100 S Mobile Adapter", |
" 8086 200d EtherExpress PRO/100 Cardbus", |
" 8086 200e EtherExpress PRO/100 LAN+V90 Cardbus Modem", |
" 8086 200f EtherExpress PRO/100 SR Mobile Adapter", |
" 8086 2010 EtherExpress PRO/100 S Mobile Combo Adapter", |
" 8086 2013 EtherExpress PRO/100 SR Mobile Combo Adapter", |
" 8086 2016 EtherExpress PRO/100 S Mobile Adapter", |
" 8086 2017 EtherExpress PRO/100 S Combo Mobile Adapter", |
" 8086 2018 EtherExpress PRO/100 SR Mobile Adapter", |
" 8086 2019 EtherExpress PRO/100 SR Combo Mobile Adapter", |
" 8086 2101 EtherExpress PRO/100 P Mobile Adapter", |
" 8086 2102 EtherExpress PRO/100 SP Mobile Adapter", |
" 8086 2103 EtherExpress PRO/100 SP Mobile Adapter", |
" 8086 2104 EtherExpress PRO/100 SP Mobile Adapter", |
" 8086 2105 EtherExpress PRO/100 SP Mobile Adapter", |
" 8086 2106 EtherExpress PRO/100 P Mobile Adapter", |
" 8086 2107 EtherExpress PRO/100 Network Connection", |
" 8086 2108 EtherExpress PRO/100 Network Connection", |
" 8086 2200 EtherExpress PRO/100 P Mobile Combo Adapter", |
" 8086 2201 EtherExpress PRO/100 P Mobile Combo Adapter", |
" 8086 2202 EtherExpress PRO/100 SP Mobile Combo Adapter", |
" 8086 2203 EtherExpress PRO/100+ MiniPCI", |
" 8086 2204 EtherExpress PRO/100+ MiniPCI", |
" 8086 2205 EtherExpress PRO/100 SP Mobile Combo Adapter", |
" 8086 2206 EtherExpress PRO/100 SP Mobile Combo Adapter", |
" 8086 2207 EtherExpress PRO/100 SP Mobile Combo Adapter", |
" 8086 2208 EtherExpress PRO/100 P Mobile Combo Adapter", |
" 8086 2402 EtherExpress PRO/100+ MiniPCI", |
" 8086 2407 EtherExpress PRO/100+ MiniPCI", |
" 8086 2408 EtherExpress PRO/100+ MiniPCI", |
" 8086 2409 EtherExpress PRO/100+ MiniPCI", |
" 8086 240f EtherExpress PRO/100+ MiniPCI", |
" 8086 2410 EtherExpress PRO/100+ MiniPCI", |
" 8086 2411 EtherExpress PRO/100+ MiniPCI", |
" 8086 2412 EtherExpress PRO/100+ MiniPCI", |
" 8086 2413 EtherExpress PRO/100+ MiniPCI", |
" 8086 3000 82559 Fast Ethernet LAN on Motherboard", |
" 8086 3001 82559 Fast Ethernet LOM with Basic Alert on LAN*", |
" 8086 3002 82559 Fast Ethernet LOM with Alert on LAN II*", |
" 8086 3006 EtherExpress PRO/100 S Network Connection", |
" 8086 3007 EtherExpress PRO/100 S Network Connection", |
" 8086 3008 EtherExpress PRO/100 Network Connection", |
" 8086 3010 EtherExpress PRO/100 S Network Connection", |
" 8086 3011 EtherExpress PRO/100 S Network Connection", |
" 8086 3012 EtherExpress PRO/100 Network Connection", |
" 8086 3411 SDS2 Mainboard", |
" 122d 430FX - 82437FX TSC [Triton I]", |
" 122e 82371FB PIIX ISA [Triton I]", |
" 1230 82371FB PIIX IDE [Triton I]", |
" 1231 DSVD Modem", |
" 1234 430MX - 82371MX Mobile PCI I/O IDE Xcelerator (MPIIX)", |
" 1235 430MX - 82437MX Mob. System Ctrlr (MTSC) & 82438MX Data Path (MTDP)", |
" 1237 440FX - 82441FX PMC [Natoma]", |
" 1239 82371FB PIIX IDE Interface", |
" 123b 82380PB PCI to PCI Docking Bridge", |
" 123c 82380AB (MISA) Mobile PCI-to-ISA Bridge", |
" 123d 683053 Programmable Interrupt Device", |
" 123e 82466GX (IHPC) Integrated Hot-Plug Controller", |
" 123f 82466GX Integrated Hot-Plug Controller (IHPC)", |
" 1240 82752 (752) AGP Graphics Accelerator", |
" 124b 82380FB (MPCI2) Mobile Docking Controller", |
" 1250 430HX - 82439HX TXC [Triton II]", |
" 1360 82806AA PCI64 Hub PCI Bridge", |
" 1361 82806AA PCI64 Hub Controller (HRes)", |
" 8086 1361 82806AA PCI64 Hub Controller (HRes)", |
" 8086 8000 82806AA PCI64 Hub Controller (HRes)", |
" 1460 82870P2 P64H2 Hub PCI Bridge", |
" 1461 82870P2 P64H2 I/OxAPIC", |
" 15d9 3480 P4DP6", |
" 4c53 1090 Cx9/Vx9 mainboard", |
" 1462 82870P2 P64H2 Hot Plug Controller", |
" 1960 80960RP [i960RP Microprocessor]", |
" 101e 0431 MegaRAID 431 RAID Controller", |
" 101e 0438 MegaRAID 438 Ultra2 LVD RAID Controller", |
" 101e 0466 MegaRAID 466 Express Plus RAID Controller", |
" 101e 0467 MegaRAID 467 Enterprise 1500 RAID Controller", |
" 101e 0490 MegaRAID 490 Express 300 RAID Controller", |
" 101e 0762 MegaRAID 762 Express RAID Controller", |
" 101e 09a0 PowerEdge Expandable RAID Controller 2/SC", |
" 1028 0467 PowerEdge Expandable RAID Controller 2/DC", |
" 1028 1111 PowerEdge Expandable RAID Controller 2/SC", |
" 103c 03a2 MegaRAID", |
" 103c 10c6 MegaRAID 438, HP NetRAID-3Si", |
" 103c 10c7 MegaRAID T5, Integrated HP NetRAID", |
" 103c 10cc MegaRAID, Integrated HP NetRAID", |
" 103c 10cd HP NetRAID-1Si", |
" 105a 0000 SuperTrak", |
" 105a 2168 SuperTrak Pro", |
" 105a 5168 SuperTrak66/100", |
" 1111 1111 MegaRAID 466, PowerEdge Expandable RAID Controller 2/SC", |
" 1111 1112 PowerEdge Expandable RAID Controller 2/SC", |
" 113c 03a2 MegaRAID", |
" e4bf 1010 CG1-RADIO", |
" e4bf 1020 CU2-QUARTET", |
" e4bf 1040 CU1-CHORUS", |
" e4bf 3100 CX1-BAND", |
" 1962 80960RM [i960RM Microprocessor]", |
" 105a 0000 SuperTrak SX6000 I2O CPU", |
" 1a21 82840 840 (Carmel) Chipset Host Bridge (Hub A)", |
" 1a23 82840 840 (Carmel) Chipset AGP Bridge", |
" 1a24 82840 840 (Carmel) Chipset PCI Bridge (Hub B)", |
" 1a30 82845 845 (Brookdale) Chipset Host Bridge", |
" 1028 010e Optiplex GX240", |
" 1a31 82845 845 (Brookdale) Chipset AGP Bridge", |
" 1a38 Server DMA Engine", |
" 1a48 PRO/10GbE SR Server Adapter", |
" 2410 82801AA ISA Bridge (LPC)", |
" 2411 82801AA IDE", |
" 2412 82801AA USB", |
" 2413 82801AA SMBus", |
" 2415 82801AA AC'97 Audio", |
" 1028 0095 Precision Workstation 220 Integrated Digital Audio", |
" 110a 0051 Activy 2xx", |
" 11d4 0040 SoundMAX Integrated Digital Audio", |
" 11d4 0048 SoundMAX Integrated Digital Audio", |
" 11d4 5340 SoundMAX Integrated Digital Audio", |
" 1734 1025 Activy 3xx", |
" 2416 82801AA AC'97 Modem", |
" 2418 82801AA PCI Bridge", |
" 2420 82801AB ISA Bridge (LPC)", |
" 2421 82801AB IDE", |
" 2422 82801AB USB", |
" 2423 82801AB SMBus", |
" 2425 82801AB AC'97 Audio", |
" 11d4 0040 SoundMAX Integrated Digital Audio", |
" 11d4 0048 SoundMAX Integrated Digital Audio", |
" 2426 82801AB AC'97 Modem", |
" 2428 82801AB PCI Bridge", |
" 2440 82801BA ISA Bridge (LPC)", |
" 2442 82801BA/BAM USB (Hub #1)", |
" 1014 01c6 Netvista A40/A40p", |
" 1025 1016 Travelmate 612 TX", |
" 1028 010e Optiplex GX240", |
" 1043 8027 TUSL2-C Mainboard", |
" 104d 80df Vaio PCG-FX403", |
" 147b 0507 TH7II-RAID", |
" 8086 4532 D815EEA2 mainboard", |
" 8086 4557 D815EGEW Mainboard", |
" 2443 82801BA/BAM SMBus", |
" 1014 01c6 Netvista A40/A40p", |
" 1025 1016 Travelmate 612 TX", |
" 1028 010e Optiplex GX240", |
" 1043 8027 TUSL2-C Mainboard", |
" 104d 80df Vaio PCG-FX403", |
" 147b 0507 TH7II-RAID", |
" 8086 4532 D815EEA2 mainboard", |
" 8086 4557 D815EGEW Mainboard", |
" 2444 82801BA/BAM USB (Hub #2)", |
" 1025 1016 Travelmate 612 TX", |
" 1028 010e Optiplex GX240", |
" 1043 8027 TUSL2-C Mainboard", |
" 104d 80df Vaio PCG-FX403", |
" 147b 0507 TH7II-RAID", |
" 8086 4532 D815EEA2 mainboard", |
" 2445 82801BA/BAM AC'97 Audio", |
" 0e11 0088 Evo D500", |
" 1014 01c6 Netvista A40/A40p", |
" 1025 1016 Travelmate 612 TX", |
" 104d 80df Vaio PCG-FX403", |
" 1462 3370 STAC9721 AC", |
" 147b 0507 TH7II-RAID", |
" 8086 4557 D815EGEW Mainboard", |
" 2446 82801BA/BAM AC'97 Modem", |
" 1025 1016 Travelmate 612 TX", |
" 104d 80df Vaio PCG-FX403", |
" 2448 82801 Mobile PCI Bridge", |
" 103c 099c NX6110/NC6120", |
" 1734 1055 Amilo M1420", |
" 2449 82801BA/BAM/CA/CAM Ethernet Controller", |
" 0e11 0012 EtherExpress PRO/100 VM", |
" 0e11 0091 EtherExpress PRO/100 VE", |
" 1014 01ce EtherExpress PRO/100 VE", |
" 1014 01dc EtherExpress PRO/100 VE", |
" 1014 01eb EtherExpress PRO/100 VE", |
" 1014 01ec EtherExpress PRO/100 VE", |
" 1014 0202 EtherExpress PRO/100 VE", |
" 1014 0205 EtherExpress PRO/100 VE", |
" 1014 0217 EtherExpress PRO/100 VE", |
" 1014 0234 EtherExpress PRO/100 VE", |
" 1014 023d EtherExpress PRO/100 VE", |
" 1014 0244 EtherExpress PRO/100 VE", |
" 1014 0245 EtherExpress PRO/100 VE", |
" 1014 0265 PRO/100 VE Desktop Connection", |
" 1014 0267 PRO/100 VE Desktop Connection", |
" 1014 026a PRO/100 VE Desktop Connection", |
" 109f 315d EtherExpress PRO/100 VE", |
" 109f 3181 EtherExpress PRO/100 VE", |
" 1179 ff01 PRO/100 VE Network Connection", |
" 1186 7801 EtherExpress PRO/100 VE", |
" 144d 2602 HomePNA 1M CNR", |
" 8086 3010 EtherExpress PRO/100 VE", |
" 8086 3011 EtherExpress PRO/100 VM", |
" 8086 3012 82562EH based Phoneline", |
" 8086 3013 EtherExpress PRO/100 VE", |
" 8086 3014 EtherExpress PRO/100 VM", |
" 8086 3015 82562EH based Phoneline", |
" 8086 3016 EtherExpress PRO/100 P Mobile Combo", |
" 8086 3017 EtherExpress PRO/100 P Mobile", |
" 8086 3018 EtherExpress PRO/100", |
" 244a 82801BAM IDE U100", |
" 1025 1016 Travelmate 612TX", |
" 104d 80df Vaio PCG-FX403", |
" 244b 82801BA IDE U100", |
" 1014 01c6 Netvista A40/A40p", |
" 1028 010e Optiplex GX240", |
" 1043 8027 TUSL2-C Mainboard", |
" 147b 0507 TH7II-RAID", |
" 8086 4532 D815EEA2 mainboard", |
" 8086 4557 D815EGEW Mainboard", |
" 244c 82801BAM ISA Bridge (LPC)", |
" 244e 82801 PCI Bridge", |
" 1014 0267 NetVista A30p", |
" 2450 82801E ISA Bridge (LPC)", |
" 2452 82801E USB", |
" 2453 82801E SMBus", |
" 2459 82801E Ethernet Controller 0", |
" 245b 82801E IDE U100", |
" 245d 82801E Ethernet Controller 1", |
" 245e 82801E PCI Bridge", |
" 2480 82801CA LPC Interface Controller", |
" 2482 82801CA/CAM USB (Hub #1)", |
" 0e11 0030 Evo N600c", |
" 1014 0220 ThinkPad A/T/X Series", |
" 104d 80e7 VAIO PCG-GR214EP/GR214MP/GR215MP/GR314MP/GR315MP", |
" 15d9 3480 P4DP6", |
" 8086 1958 vpr Matrix 170B4", |
" 8086 3424 SE7501HG2 Mainboard", |
" 8086 4541 Latitude C640", |
" 2483 82801CA/CAM SMBus Controller", |
" 1014 0220 ThinkPad A/T/X Series", |
" 104d 80e7 VAIO PCG-GR214EP/GR214MP/GR215MP/GR314MP/GR315MP", |
" 15d9 3480 P4DP6", |
" 8086 1958 vpr Matrix 170B4", |
" 2484 82801CA/CAM USB (Hub #2)", |
" 0e11 0030 Evo N600c", |
" 1014 0220 ThinkPad A/T/X Series", |
" 104d 80e7 VAIO PCG-GR214EP/GR214MP/GR215MP/GR314MP/GR315MP", |
" 15d9 3480 P4DP6", |
" 8086 1958 vpr Matrix 170B4", |
" 2485 82801CA/CAM AC'97 Audio Controller", |
" 1013 5959 Crystal WMD Audio Codec", |
" 1014 0222 ThinkPad T23 (2647-4MG) or A30/A30p (2652/2653)", |
" 1014 0508 ThinkPad T30", |
" 1014 051c ThinkPad A/T/X Series", |
" 104d 80e7 VAIO PCG-GR214EP/GR214MP/GR215MP/GR314MP/GR315MP", |
" 144d c006 vpr Matrix 170B4", |
" 2486 82801CA/CAM AC'97 Modem Controller", |
" 1014 0223 ThinkPad A/T/X Series", |
" 1014 0503 ThinkPad R31 2656BBG", |
" 1014 051a ThinkPad A/T/X Series", |
" 101f 1025 620 Series", |
" 104d 80e7 VAIO PCG-GR214EP/GR214MP/GR215MP/GR314MP/GR315MP", |
" 134d 4c21 Dell Inspiron 2100 internal modem", |
" 144d 2115 vpr Matrix 170B4 internal modem", |
" 14f1 5421 MD56ORD V.92 MDC Modem", |
" 2487 82801CA/CAM USB (Hub #3)", |
" 0e11 0030 Evo N600c", |
" 1014 0220 ThinkPad A/T/X Series", |
" 104d 80e7 VAIO PCG-GR214EP/GR214MP/GR215MP/GR314MP/GR315MP", |
" 15d9 3480 P4DP6", |
" 8086 1958 vpr Matrix 170B4", |
" 248a 82801CAM IDE U100", |
" 0e11 0030 Evo N600c", |
" 1014 0220 ThinkPad A/T/X Series", |
" 104d 80e7 VAIO PCG-GR214EP/GR214MP/GR215MP/GR314MP/GR315MP", |
" 8086 1958 vpr Matrix 170B4", |
" 8086 4541 Latitude C640", |
" 248b 82801CA Ultra ATA Storage Controller", |
" 15d9 3480 P4DP6", |
" 248c 82801CAM ISA Bridge (LPC)", |
" 24c0 82801DB/DBL (ICH4/ICH4-L) LPC Interface Bridge", |
" 1014 0267 NetVista A30p", |
" 1462 5800 845PE Max (MS-6580)", |
" 24c1 82801DBL (ICH4-L) IDE Controller", |
" 24c2 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) USB UHCI Controller #1", |
" 1014 0267 NetVista A30p", |
" 1025 005a TravelMate 290", |
" 1028 0126 Optiplex GX260", |
" 1028 0163 Latitude D505", |
" 1028 0196 Inspiron 5160", |
" 103c 088c NC8000 laptop", |
" 103c 0890 NC6000 laptop", |
" 1071 8160 MIM2000", |
" 1462 5800 845PE Max (MS-6580)", |
" 1509 2990 Averatec 5110H laptop", |
" 1734 1004 D1451 Mainboard (SCENIC N300, i845GV)", |
" 1734 1055 Amilo M1420", |
" 4c53 1090 Cx9 / Vx9 mainboard", |
" 8086 4541 Latitude D400", |
" 24c3 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) SMBus Controller", |
" 1014 0267 NetVista A30p", |
" 1025 005a TravelMate 290", |
" 1028 0126 Optiplex GX260", |
" 103c 088c NC8000 laptop", |
" 103c 0890 NC6000 laptop", |
" 1071 8160 MIM2000", |
" 1458 24c2 GA-8PE667 Ultra", |
" 1462 5800 845PE Max (MS-6580)", |
" 1734 1004 D1451 Mainboard (SCENIC N300, i845GV)", |
" 1734 1055 Amilo M1420", |
" 4c53 1090 Cx9 / Vx9 mainboard", |
" 24c4 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) USB UHCI Controller #2", |
" 1014 0267 NetVista A30p", |
" 1025 005a TravelMate 290", |
" 1028 0126 Optiplex GX260", |
" 1028 0163 Latitude D505", |
" 1028 0196 Inspiron 5160", |
" 103c 088c NC8000 laptop", |
" 103c 0890 NC6000 laptop", |
" 1071 8160 MIM2000", |
" 1462 5800 845PE Max (MS-6580)", |
" 1509 2990 Averatec 5110H", |
" 1734 1004 D1451 Mainboard (SCENIC N300, i845GV)", |
" 4c53 1090 Cx9 / Vx9 mainboard", |
" 8086 4541 Latitude D400", |
" 24c5 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) AC'97 Audio Controller", |
" 0e11 00b8 Analog Devices Inc. codec [SoundMAX]", |
" 1014 0267 NetVista A30p", |
" 1025 005a TravelMate 290", |
" 1028 0139 Latitude D400", |
" 1028 0163 Latitude D505", |
" 1028 0196 Inspiron 5160", |
" 103c 088c NC8000 laptop", |
" 103c 0890 NC6000 laptop", |
" 1071 8160 MIM2000", |
" 1458 a002 GA-8PE667 Ultra", |
" 1462 5800 845PE Max (MS-6580)", |
" 1734 1005 D1451 (SCENIC N300, i845GV) Sigmatel STAC9750T", |
" 1734 1055 Amilo M1420", |
" 24c6 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) AC'97 Modem Controller", |
" 1025 003c Aspire 2001WLCi (Compal CL50 motherboard) implementation", |
" 1025 005a TravelMate 290", |
" 1028 0196 Inspiron 5160", |
" 103c 088c NC8000 laptop", |
" 103c 0890 NC6000 laptop", |
" 1071 8160 MIM2000", |
" 24c7 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) USB UHCI Controller #3", |
" 1014 0267 NetVista A30p", |
" 1025 005a TravelMate 290", |
" 1028 0126 Optiplex GX260", |
" 1028 0163 Latitude D505", |
" 1028 0196 Inspiron 5160", |
" 103c 088c NC8000 laptop", |
" 103c 0890 NC6000 laptop", |
" 1071 8160 MIM2000", |
" 1462 5800 845PE Max (MS-6580)", |
" 1509 2990 Averatec 5110H", |
" 1734 1004 D1451 Mainboard (SCENIC N300, i845GV)", |
" 4c53 1090 Cx9 / Vx9 mainboard", |
" 8086 4541 Latitude D400", |
" 24ca 82801DBM (ICH4-M) IDE Controller", |
" 1025 005a TravelMate 290", |
" 1028 0163 Latitude D505", |
" 1028 0196 Inspiron 5160", |
" 103c 088c NC8000 laptop", |
" 103c 0890 NC6000 laptop", |
" 1071 8160 MIM2000", |
" 1734 1055 Amilo M1420", |
" 8086 4541 Latitude D400", |
" 24cb 82801DB (ICH4) IDE Controller", |
" 1014 0267 NetVista A30p", |
" 1028 0126 Optiplex GX260", |
" 1458 24c2 GA-8PE667 Ultra", |
" 1462 5800 845PE Max (MS-6580)", |
" 1734 1004 D1451 Mainboard (SCENIC N300, i845GV)", |
" 4c53 1090 Cx9 / Vx9 mainboard", |
" 24cc 82801DBM (ICH4-M) LPC Interface Bridge", |
" 1734 1055 Amilo M1420", |
" 24cd 82801DB/DBM (ICH4/ICH4-M) USB2 EHCI Controller", |
" 1014 0267 NetVista A30p", |
" 1025 005a TravelMate 290", |
" 1028 011d Latitude D600", |
" 1028 0126 Optiplex GX260", |
" 1028 0139 Latitude D400", |
" 1028 0163 Latitude D505", |
" 1028 0196 Inspiron 5160", |
" 103c 088c NC8000 laptop", |
" 103c 0890 NC6000 laptop", |
" 1071 8160 MIM2000", |
" 1462 3981 845PE Max (MS-6580)", |
" 1509 1968 Averatec 5110H", |
" 1734 1004 D1451 Mainboard (SCENIC N300, i845GV)", |
" 1734 1055 Amilo M1420", |
" 4c53 1090 Cx9 / Vx9 mainboard", |
" 24d0 82801EB/ER (ICH5/ICH5R) LPC Interface Bridge", |
" 24d1 82801EB (ICH5) SATA Controller", |
" 1028 0169 Precision 470", |
" 1028 019a PowerEdge SC1425", |
" 103c 12bc d530 CMT (DG746A)", |
" 1043 80a6 P4P800 SE Mainboard", |
" 1458 24d1 GA-8IPE1000 Pro2 motherboard (865PE)", |
" 1462 7280 865PE Neo2 (MS-6728)", |
" 15d9 4580 P4SCE Mainboard", |
" 8086 3427 S875WP1-E mainboard", |
" 8086 4246 Desktop Board D865GBF", |
" 8086 524c D865PERL mainboard", |
" 24d2 82801EB/ER (ICH5/ICH5R) USB UHCI Controller #1", |
" 1014 02ed xSeries server mainboard", |
" 1028 0169 Precision 470", |
" 1028 0183 PowerEdge 1800", |
" 1028 019a PowerEdge SC1425", |
" 103c 006a NX9500", |
" 103c 12bc d530 CMT (DG746A)", |
" 1043 80a6 P5P800-MX Mainboard", |
" 1458 24d2 GA-8IPE1000/8KNXP motherboard", |
" 1462 7280 865PE Neo2 (MS-6728)", |
" 15d9 4580 P4SCE Mainboard", |
" 1734 101c Primergy RX300 S2", |
" 8086 3427 S875WP1-E mainboard", |
" 8086 4246 Desktop Board D865GBF", |
" 8086 524c D865PERL mainboard", |
" 24d3 82801EB/ER (ICH5/ICH5R) SMBus Controller", |
" 1014 02ed xSeries server mainboard", |
" 1028 0156 Precision 360", |
" 1028 0169 Precision 470", |
" 1043 80a6 P4P800 Mainboard", |
" 1458 24d2 GA-8IPE1000 Pro2 motherboard (865PE)", |
" 1462 7280 865PE Neo2 (MS-6728)", |
" 15d9 4580 P4SCE Mainboard", |
" 1734 101c Primergy RX300 S2", |
" 8086 3427 S875WP1-E mainboard", |
" 8086 4246 Desktop Board D865GBF", |
" 8086 524c D865PERL mainboard", |
" 24d4 82801EB/ER (ICH5/ICH5R) USB UHCI Controller #2", |
" 1014 02ed xSeries server mainboard", |
" 1028 0169 Precision 470", |
" 1028 0183 PowerEdge 1800", |
" 1028 019a PowerEdge SC1425", |
" 103c 006a NX9500", |
" 103c 12bc d530 CMT (DG746A)", |
" 1043 80a6 P5P800-MX Mainboard", |
" 1458 24d2 GA-8IPE1000 Pro2 motherboard (865PE)", |
" 1462 7280 865PE Neo2 (MS-6728)", |
" 15d9 4580 P4SCE Mainboard", |
" 1734 101c Primergy RX300 S2", |
" 8086 3427 S875WP1-E mainboard", |
" 8086 4246 Desktop Board D865GBF", |
" 8086 524c D865PERL mainboard", |
" 24d5 82801EB/ER (ICH5/ICH5R) AC'97 Audio Controller", |
" 1028 0169 Precision 470", |
" 103c 006a NX9500", |
" 103c 12bc d330 uT", |
" 1043 80f3 P4P800 Mainboard", |
" 1043 810f P5P800-MX Mainboard", |
" 1458 a002 GA-8IPE1000/8KNXP motherboard", |
" 1462 0080 65PE Neo2-V (MS-6788) mainboard", |
" 1462 7280 865PE Neo2 (MS-6728)", |
" 8086 a000 D865PERL mainboard", |
" 8086 e000 D865PERL mainboard", |
" 8086 e001 Desktop Board D865GBF", |
" 24d6 82801EB/ER (ICH5/ICH5R) AC'97 Modem Controller", |
" 103c 006a NX9500", |
" 24d7 82801EB/ER (ICH5/ICH5R) USB UHCI Controller #3", |
" 1014 02ed xSeries server mainboard", |
" 1028 0169 Precision 470", |
" 1028 0183 PowerEdge 1800", |
" 103c 006a NX9500", |
" 103c 12bc d530 CMT (DG746A)", |
" 1043 80a6 P5P800-MX Mainboard", |
" 1458 24d2 GA-8IPE1000 Pro2 motherboard (865PE)", |
" 1462 7280 865PE Neo2 (MS-6728)", |
" 15d9 4580 P4SCE Mainboard", |
" 1734 101c Primergy RX300 S2", |
" 8086 3427 S875WP1-E mainboard", |
" 8086 4246 Desktop Board D865GBF", |
" 8086 524c D865PERL mainboard", |
" 24db 82801EB/ER (ICH5/ICH5R) IDE Controller", |
" 1014 02ed xSeries server mainboard", |
" 1028 0169 Precision 470", |
" 1028 019a PowerEdge SC1425", |
" 103c 006a NX9500", |
" 103c 12bc d530 CMT (DG746A)", |
" 1043 80a6 P5P800-MX Mainboard", |
" 1458 24d2 GA-8IPE1000 Pro2 motherboard (865PE)", |
" 1462 7280 865PE Neo2 (MS-6728)", |
" 1462 7580 MSI 875P", |
" 15d9 4580 P4SCE Mainboard", |
" 1734 101c Primergy RX300 S2", |
" 8086 24db P4C800 Mainboard", |
" 8086 3427 S875WP1-E mainboard", |
" 8086 4246 Desktop Board D865GBF", |
" 8086 524c D865PERL mainboard", |
" 24dc 82801EB (ICH5) LPC Interface Bridge", |
" 24dd 82801EB/ER (ICH5/ICH5R) USB2 EHCI Controller", |
" 1014 02ed xSeries server mainboard", |
" 1028 0169 Precision 470", |
" 1028 0183 PowerEdge 1800", |
" 1028 019a PowerEdge SC1425", |
" 103c 006a NX9500", |
" 103c 12bc d530 CMT (DG746A)", |
" 1043 80a6 P5P800-MX Mainboard", |
" 1458 5006 GA-8IPE1000 Pro2 motherboard (865PE)", |
" 1462 7280 865PE Neo2 (MS-6728)", |
" 8086 3427 S875WP1-E mainboard", |
" 8086 4246 Desktop Board D865GBF", |
" 8086 524c D865PERL mainboard", |
" 24de 82801EB/ER (ICH5/ICH5R) USB UHCI Controller #4", |
" 1014 02ed xSeries server mainboard", |
" 1028 0169 Precision 470", |
" 1043 80a6 P5P800-MX Mainboard", |
" 1458 24d2 GA-8IPE1000 Pro2 motherboard (865PE)", |
" 1462 7280 865PE Neo2 (MS-6728)", |
" 15d9 4580 P4SCE Mainboard", |
" 1734 101c Primergy RX300 S2", |
" 8086 3427 S875WP1-E mainboard", |
" 8086 4246 Desktop Board D865GBF", |
" 8086 524c D865PERL mainboard", |
" 24df 82801ER (ICH5R) SATA Controller", |
" 2500 82820 820 (Camino) Chipset Host Bridge (MCH)", |
" 1028 0095 Precision Workstation 220 Chipset", |
" 1043 801c P3C-2000 system chipset", |
" 2501 82820 820 (Camino) Chipset Host Bridge (MCH)", |
" 1043 801c P3C-2000 system chipset", |
" 250b 82820 820 (Camino) Chipset Host Bridge", |
" 250f 82820 820 (Camino) Chipset AGP Bridge", |
" 2520 82805AA MTH Memory Translator Hub", |
" 2521 82804AA MRH-S Memory Repeater Hub for SDRAM", |
" 2530 82850 850 (Tehama) Chipset Host Bridge (MCH)", |
" 147b 0507 TH7II-RAID", |
" 2531 82860 860 (Wombat) Chipset Host Bridge (MCH)", |
" 2532 82850 850 (Tehama) Chipset AGP Bridge", |
" 2533 82860 860 (Wombat) Chipset AGP Bridge", |
" 2534 82860 860 (Wombat) Chipset PCI Bridge", |
" 2540 E7500 Memory Controller Hub", |
" 15d9 3480 P4DP6", |
" 2541 E7500/E7501 Host RASUM Controller", |
" 15d9 3480 P4DP6", |
" 4c53 1090 Cx9 / Vx9 mainboard", |
" 8086 3424 SE7501HG2 Mainboard", |
" 2543 E7500/E7501 Hub Interface B PCI-to-PCI Bridge", |
" 2544 E7500/E7501 Hub Interface B RASUM Controller", |
" 4c53 1090 Cx9 / Vx9 mainboard", |
" 2545 E7500/E7501 Hub Interface C PCI-to-PCI Bridge", |
" 2546 E7500/E7501 Hub Interface C RASUM Controller", |
" 2547 E7500/E7501 Hub Interface D PCI-to-PCI Bridge", |
" 2548 E7500/E7501 Hub Interface D RASUM Controller", |
" 254c E7501 Memory Controller Hub", |
" 4c53 1090 Cx9 / Vx9 mainboard", |
" 8086 3424 SE7501HG2 Mainboard", |
" 2550 E7505 Memory Controller Hub", |
" 2551 E7505/E7205 Series RAS Controller", |
" 2552 E7505/E7205 PCI-to-AGP Bridge", |
" 2553 E7505 Hub Interface B PCI-to-PCI Bridge", |
" 2554 E7505 Hub Interface B PCI-to-PCI Bridge RAS Controller", |
" 255d E7205 Memory Controller Hub", |
" 2560 82845G/GL[Brookdale-G]/GE/PE DRAM Controller/Host-Hub Interface", |
" 1028 0126 Optiplex GX260", |
" 1458 2560 GA-8PE667 Ultra", |
" 1462 5800 845PE Max (MS-6580)", |
" 2561 82845G/GL[Brookdale-G]/GE/PE Host-to-AGP Bridge", |
" 2562 82845G/GL[Brookdale-G]/GE Chipset Integrated Graphics Device", |
" 0e11 00b9 Evo D510 SFF", |
" 1014 0267 NetVista A30p", |
" 1734 1004 D1451 Mainboard (SCENIC N300, i845GV)", |
" 2570 82865G/PE/P DRAM Controller/Host-Hub Interface", |
" 103c 006a NX9500", |
" 1043 80f2 P5P800-MX Mainboard", |
" 1458 2570 GA-8IPE1000 Pro2 motherboard (865PE)", |
" 2571 82865G/PE/P PCI to AGP Controller", |
" 2572 82865G Integrated Graphics Controller", |
" 1028 019d Dimension 3000", |
" 103c 12bc D530 sff(dc578av)", |
" 1043 80a5 P5P800-MX Mainboard", |
" 8086 4246 Desktop Board D865GBF", |
" 2573 82865G/PE/P PCI to CSA Bridge", |
" 2576 82865G/PE/P Processor to I/O Memory Interface", |
" 2578 82875P/E7210 Memory Controller Hub", |
" 1458 2578 GA-8KNXP motherboard (875P)", |
" 1462 7580 MS-6758 (875P Neo)", |
" 15d9 4580 P4SCE Motherboard", |
" 2579 82875P Processor to AGP Controller", |
" 257b 82875P/E7210 Processor to PCI to CSA Bridge", |
" 257e 82875P/E7210 Processor to I/O Memory Interface", |
" 2580 915G/P/GV/GL/PL/910GL Express Memory Controller Hub", |
" 1458 2580 GA-8I915ME-G Mainboard", |
" 1462 7028 915P/G Neo2", |
" 1734 105b Scenic W620", |
" 2581 915G/P/GV/GL/PL/910GL Express PCI Express Root Port", |
" 2582 82915G/GV/910GL Express Chipset Family Graphics Controller", |
" 1028 1079 Optiplex GX280", |
" 103c 3006 DC7100 SFF(DX878AV)", |
" 1043 2582 P5GD1-VW Mainboard", |
" 1458 2582 GA-8I915ME-G Mainboard", |
" 1734 105b Scenic W620", |
" 2584 925X/XE Express Memory Controller Hub", |
" 2585 925X/XE Express PCI Express Root Port", |
" 2588 E7220/E7221 Memory Controller Hub", |
" 2589 E7220/E7221 PCI Express Root Port", |
" 258a E7221 Integrated Graphics Controller", |
" 2590 Mobile 915GM/PM/GMS/910GML Express Processor to DRAM Controller", |
" 1028 0182 Dell Latidude C610", |
" 103c 099c NX6110/NC6120", |
" a304 81b7 Vaio VGN-S3XP", |
" 2591 Mobile 915GM/PM Express PCI Express Root Port", |
" 2592 Mobile 915GM/GMS/910GML Express Graphics Controller", |
" 103c 099c NX6110/NC6120", |
" 103c 308a NC6220", |
" 1043 1881 GMA 900 915GM Integrated Graphics", |
" 25a1 6300ESB LPC Interface Controller", |
" 25a2 6300ESB PATA Storage Controller", |
" 4c53 10b0 CL9 mainboard", |
" 4c53 10e0 PSL09 PrPMC", |
" 25a3 6300ESB SATA Storage Controller", |
" 4c53 10b0 CL9 mainboard", |
" 4c53 10d0 Telum ASLP10 Processor AMC", |
" 4c53 10e0 PSL09 PrPMC", |
" 25a4 6300ESB SMBus Controller", |
" 4c53 10b0 CL9 mainboard", |
" 4c53 10d0 Telum ASLP10 Processor AMC", |
" 4c53 10e0 PSL09 PrPMC", |
" 25a6 6300ESB AC'97 Audio Controller", |
" 4c53 10b0 CL9 mainboard", |
" 25a7 6300ESB AC'97 Modem Controller", |
" 25a9 6300ESB USB Universal Host Controller", |
" 4c53 10b0 CL9 mainboard", |
" 4c53 10d0 Telum ASLP10 Processor AMC", |
" 4c53 10e0 PSL09 PrPMC", |
" 25aa 6300ESB USB Universal Host Controller", |
" 4c53 10b0 CL9 mainboard", |
" 4c53 10e0 PSL09 PrPMC", |
" 25ab 6300ESB Watchdog Timer", |
" 4c53 10b0 CL9 mainboard", |
" 4c53 10d0 Telum ASLP10 Processor AMC", |
" 4c53 10e0 PSL09 PrPMC", |
" 25ac 6300ESB I/O Advanced Programmable Interrupt Controller", |
" 4c53 10b0 CL9 mainboard", |
" 4c53 10d0 Telum ASLP10 Processor AMC", |
" 4c53 10e0 PSL09 PrPMC", |
" 25ad 6300ESB USB2 Enhanced Host Controller", |
" 4c53 10b0 CL9 mainboard", |
" 4c53 10d0 Telum ASLP10 Processor AMC", |
" 4c53 10e0 PSL09 PrPMC", |
" 25ae 6300ESB 64-bit PCI-X Bridge", |
" 25b0 6300ESB SATA RAID Controller", |
" 4c53 10d0 Telum ASLP10 Processor AMC", |
" 4c53 10e0 PSL09 PrPMC", |
" 25c0 Workstation Memory Controller Hub", |
" 25d0 Server Memory Controller Hub", |
" 25d4 Server Memory Contoller Hub", |
" 25d8 Server Memory Controller Hub", |
" 25e2 Server PCI Express x4 Port 2", |
" 25e3 Server PCI Express x4 Port 3", |
" 25e4 Server PCI Express x4 Port 4", |
" 25e5 Server PCI Express x4 Port 5", |
" 25e6 Server PCI Express x4 Port 6", |
" 25e7 Server PCI Express x4 Port 7", |
" 25e8 Server AMB Memory Mapped Registers", |
" 25f0 Server Error Reporting Registers", |
" 25f1 Reserved Registers", |
" 25f3 Reserved Registers", |
" 25f5 Server FBD Registers", |
" 25f6 Server FBD Registers", |
" 25f7 Server PCI Express x8 Port 2-3", |
" 25f8 Server PCI Express x8 Port 4-5", |
" 25f9 Server PCI Express x8 Port 6-7", |
" 25fa Server PCI Express x16 Port 4-7", |
" 2600 E8500/E8501 Hub Interface 1.5", |
" 2601 E8500/E8501 PCI Express x4 Port D", |
" 2602 E8500/E8501 PCI Express x4 Port C0", |
" 2603 E8500/E8501 PCI Express x4 Port C1", |
" 2604 E8500/E8501 PCI Express x4 Port B0", |
" 2605 E8500/E8501 PCI Express x4 Port B1", |
" 2606 E8500/E8501 PCI Express x4 Port A0", |
" 2607 E8500/E8501 PCI Express x4 Port A1", |
" 2608 E8500/E8501 PCI Express x8 Port C", |
" 2609 E8500/E8501 PCI Express x8 Port B", |
" 260a E8500/E8501 PCI Express x8 Port A", |
" 260c E8500/E8501 IMI Registers", |
" 2610 E8500/E8501 Front Side Bus, Boot, and Interrupt Registers", |
" 2611 E8500/E8501 Address Mapping Registers", |
" 2612 E8500/E8501 RAS Registers", |
" 2613 E8500/E8501 Reserved Registers", |
" 2614 E8500/E8501 Reserved Registers", |
" 2615 E8500/E8501 Miscellaneous Registers", |
" 2617 E8500/E8501 Reserved Registers", |
" 2618 E8500/E8501 Reserved Registers", |
" 2619 E8500/E8501 Reserved Registers", |
" 261a E8500/E8501 Reserved Registers", |
" 261b E8500/E8501 Reserved Registers", |
" 261c E8500/E8501 Reserved Registers", |
" 261d E8500/E8501 Reserved Registers", |
" 261e E8500/E8501 Reserved Registers", |
" 2620 E8500/E8501 eXternal Memory Bridge", |
" 2621 E8500/E8501 XMB Miscellaneous Registers", |
" 2622 E8500/E8501 XMB Memory Interleaving Registers", |
" 2623 E8500/E8501 XMB DDR Initialization and Calibration", |
" 2624 E8500/E8501 XMB Reserved Registers", |
" 2625 E8500/E8501 XMB Reserved Registers", |
" 2626 E8500/E8501 XMB Reserved Registers", |
" 2627 E8500/E8501 XMB Reserved Registers", |
" 2640 82801FB/FR (ICH6/ICH6R) LPC Interface Bridge", |
" 1462 7028 915P/G Neo2", |
" 1734 105c Scenic W620", |
" 2641 82801FBM (ICH6M) LPC Interface Bridge", |
" 103c 099c NX6110/NC6120", |
" 2642 82801FW/FRW (ICH6W/ICH6RW) LPC Interface Bridge", |
" 2651 82801FB/FW (ICH6/ICH6W) SATA Controller", |
" 1028 0179 Optiplex GX280", |
" 1043 2601 P5GD1-VW Mainboard", |
" 1734 105c Scenic W620", |
" 8086 4147 D915GAG Motherboard", |
" 2652 82801FR/FRW (ICH6R/ICH6RW) SATA Controller", |
" 1462 7028 915P/G Neo2", |
" 2653 82801FBM (ICH6M) SATA Controller", |
" 2658 82801FB/FBM/FR/FW/FRW (ICH6 Family) USB UHCI #1", |
" 1028 0179 Optiplex GX280", |
" 103c 099c NX6110/NC6120", |
" 1043 80a6 P5GD1-VW Mainboard", |
" 1458 2558 GA-8I915ME-G Mainboard", |
" 1462 7028 915P/G Neo2", |
" 1734 105c Scenic W620", |
" 2659 82801FB/FBM/FR/FW/FRW (ICH6 Family) USB UHCI #2", |
" 1028 0179 Optiplex GX280", |
" 103c 099c NX6110/NC6120", |
" 1043 80a6 P5GD1-VW Mainboard", |
" 1458 2659 GA-8I915ME-G Mainboard", |
" 1462 7028 915P/G Neo2", |
" 1734 105c Scenic W620", |
" 265a 82801FB/FBM/FR/FW/FRW (ICH6 Family) USB UHCI #3", |
" 1028 0179 Optiplex GX280", |
" 103c 099c NX6110/NC6120", |
" 1043 80a6 P5GD1-VW Mainboard", |
" 1458 265a GA-8I915ME-G Mainboard", |
" 1462 7028 915P/G Neo2", |
" 1734 105c Scenic W620", |
" 265b 82801FB/FBM/FR/FW/FRW (ICH6 Family) USB UHCI #4", |
" 1028 0179 Optiplex GX280", |
" 103c 099c NX6110/NC6120", |
" 1043 80a6 P5GD1-VW Mainboard", |
" 1458 265a GA-8I915ME-G Mainboard", |
" 1462 7028 915P/G Neo2", |
" 1734 105c Scenic W620", |
" 265c 82801FB/FBM/FR/FW/FRW (ICH6 Family) USB2 EHCI Controller", |
" 1028 0179 Optiplex GX280", |
" 103c 099c NX6110/NC6120", |
" 1043 80a6 P5GD1-VW Mainboard", |
" 1458 5006 GA-8I915ME-G Mainboard", |
" 1462 7028 915P/G Neo2", |
" 1734 105c Scenic W620", |
" 2660 82801FB/FBM/FR/FW/FRW (ICH6 Family) PCI Express Port 1", |
" 103c 099c NX6110/NC6120", |
" 2662 82801FB/FBM/FR/FW/FRW (ICH6 Family) PCI Express Port 2", |
" 2664 82801FB/FBM/FR/FW/FRW (ICH6 Family) PCI Express Port 3", |
" 2666 82801FB/FBM/FR/FW/FRW (ICH6 Family) PCI Express Port 4", |
" 2668 82801FB/FBM/FR/FW/FRW (ICH6 Family) High Definition Audio Controller", |
" 1043 814e P5GD1-VW Mainboard", |
" 266a 82801FB/FBM/FR/FW/FRW (ICH6 Family) SMBus Controller", |
" 1028 0179 Optiplex GX280", |
" 1043 80a6 P5GD1-VW Mainboard", |
" 1458 266a GA-8I915ME-G Mainboard", |
" 1462 7028 915P/G Neo2", |
" 1734 105c Scenic W620", |
" 266c 82801FB/FBM/FR/FW/FRW (ICH6 Family) LAN Controller", |
" 266d 82801FB/FBM/FR/FW/FRW (ICH6 Family) AC'97 Modem Controller", |
" 1025 006a Conexant AC'97 CoDec (in Acer TravelMate 2410 serie laptop)", |
" 103c 099c NX6110/NC6120", |
" 266e 82801FB/FBM/FR/FW/FRW (ICH6 Family) AC'97 Audio Controller", |
" 1025 006a Realtek ALC 655 codec (in Acer TravelMate 2410 serie laptop)", |
" 1028 0179 Optiplex GX280", |
" 1028 0182 Latitude D610 Laptop", |
" 1028 0188 Inspiron 6000 laptop", |
" 103c 0944 Compaq NC6220", |
" 103c 099c NX6110/NC6120", |
" 103c 3006 DC7100 SFF(DX878AV)", |
" 1458 a002 GA-8I915ME-G Mainboard", |
" 152d 0745 Packard Bell A8550 Laptop", |
" 1734 105a Scenic W620", |
" 266f 82801FB/FBM/FR/FW/FRW (ICH6 Family) IDE Controller", |
" 103c 099c NX6110/NC6120", |
" 1043 80a6 P5GD1-VW Mainboard", |
" 1458 266f GA-8I915ME-G Mainboard", |
" 1462 7028 915P/G Neo2", |
" 1734 105c Scenic W620", |
" 2670 Enterprise Southbridge LPC", |
" 2680 Enterprise Southbridge SATA IDE", |
" 2681 Enterprise Southbridge SATA AHCI", |
" 2682 Enterprise Southbridge SATA RAID", |
" 2683 Enterprise Southbridge SATA RAID", |
" 2688 Enterprise Southbridge UHCI USB #1", |
" 2689 Enterprise Southbridge UHCI USB #2", |
" 268a Enterprise Southbridge UHCI USB #3", |
" 268b Enterprise Southbridge UHCI USB #4", |
" 268c Enterprise Southbridge EHCI USB", |
" 2690 Enterprise Southbridge PCI Express Root Port 1", |
" 2692 Enterprise Southbridge PCI Express Root Port 2", |
" 2694 Enterprise Southbridge PCI Express Root Port 3", |
" 2696 Enterprise Southbridge PCI Express Root Port 4", |
" 2698 Enterprise Southbridge AC '97 Audio", |
" 2699 Enterprise Southbridge AC '97 Modem", |
" 269a Enterprise Southbridge High Definition Audio", |
" 269b Enterprise Southbridge SMBus", |
" 269e Enterprise Southbridge PATA", |
" 2770 945G/GZ/P/PL Express Memory Controller Hub", |
" 8086 544e DeskTop Board D945GTP", |
" 2771 945G/GZ/P/PL Express PCI Express Root Port", |
" 2772 945G/GZ Express Integrated Graphics Controller", |
" 8086 544e DeskTop Board D945GTP", |
" 2774 955X Express Memory Controller Hub", |
" 2775 955X Express PCI Express Root Port", |
" 2776 945G/GZ Express Integrated Graphics Controller", |
" 2778 E7230 Memory Controller Hub", |
" 2779 E7230 PCI Express Root Port", |
" 277a 975X Express PCI Express Root Port", |
" 277c 975X Express Memory Controller Hub", |
" 277d 975X Express PCI Express Root Port", |
" 2782 82915G Express Chipset Family Graphics Controller", |
" 1043 2582 P5GD1-VW Mainboard", |
" 1734 105b Scenic W620", |
" 2792 Mobile 915GM/GMS/910GML Express Graphics Controller", |
" 103c 099c NX6110/NC6120", |
" 1043 1881 GMA 900 915GM Integrated Graphics", |
" 27a0 Mobile 945GM/PM/GMS/940GML and 945GT Express Memory Controller Hub", |
" 27a1 Mobile 945GM/PM/GMS/940GML and 945GT Express PCI Express Root Port", |
" 27a2 Mobile 945GM/GMS/940GML Express Integrated Graphics Controller", |
" 27a6 Mobile 945GM/GMS/940GML Express Integrated Graphics Controller", |
" 27b0 82801GH (ICH7DH) LPC Interface Bridge", |
" 27b8 82801GB/GR (ICH7 Family) LPC Interface Bridge", |
" 8086 544e DeskTop Board D945GTP", |
" 27b9 82801GBM (ICH7-M) LPC Interface Bridge", |
" 27bd 82801GHM (ICH7-M DH) LPC Interface Bridge", |
" 27c0 82801GB/GR/GH (ICH7 Family) Serial ATA Storage Controller IDE", |
" 8086 544e DeskTop Board D945GTP", |
" 27c1 82801GR/GH (ICH7 Family) Serial ATA Storage Controller AHCI", |
" 27c3 82801GR/GH (ICH7 Family) Serial ATA Storage Controller RAID", |
" 27c4 82801GBM/GHM (ICH7 Family) Serial ATA Storage Controller IDE", |
" 27c5 82801GBM/GHM (ICH7 Family) Serial ATA Storage Controller AHCI", |
" 27c6 82801GHM (ICH7-M DH) Serial ATA Storage Controller RAID", |
" 27c8 82801G (ICH7 Family) USB UHCI #1", |
" 8086 544e DeskTop Board D945GTP", |
" 27c9 82801G (ICH7 Family) USB UHCI #2", |
" 8086 544e DeskTop Board D945GTP", |
" 27ca 82801G (ICH7 Family) USB UHCI #3", |
" 8086 544e DeskTop Board D945GTP", |
" 27cb 82801G (ICH7 Family) USB UHCI #4", |
" 8086 544e DeskTop Board D945GTP", |
" 27cc 82801G (ICH7 Family) USB2 EHCI Controller", |
" 8086 544e DeskTop Board D945GTP", |
" 27d0 82801G (ICH7 Family) PCI Express Port 1", |
" 27d2 82801G (ICH7 Family) PCI Express Port 2", |
" 27d4 82801G (ICH7 Family) PCI Express Port 3", |
" 27d6 82801G (ICH7 Family) PCI Express Port 4", |
" 27d8 82801G (ICH7 Family) High Definition Audio Controller", |
" 27da 82801G (ICH7 Family) SMBus Controller", |
" 8086 544e DeskTop Board D945GTP", |
" 27dc 82801G (ICH7 Family) LAN Controller", |
" 8086 308d DeskTop Board D945GTP", |
" 27dd 82801G (ICH7 Family) AC'97 Modem Controller", |
" 27de 82801G (ICH7 Family) AC'97 Audio Controller", |
" 27df 82801G (ICH7 Family) IDE Controller", |
" 8086 544e DeskTop Board D945GTP", |
" 27e0 82801GR/GH/GHM (ICH7 Family) PCI Express Port 5", |
" 27e2 82801GR/GH/GHM (ICH7 Family) PCI Express Port 6", |
" 2810 LPC Interface Controller", |
" 2811 Mobile LPC Interface Controller", |
" 2812 LPC Interface Controller", |
" 2814 LPC Interface Controller", |
" 2815 Mobile LPC Interface Controller", |
" 2820 SATA Controller 1 IDE", |
" 2821 SATA Controller AHCI", |
" 2822 SATA Controller RAID", |
" 2824 SATA Controller AHCI", |
" 2825 SATA Controller 2 IDE", |
" 2828 Mobile SATA Controller IDE", |
" 2829 Mobile SATA Controller AHCI", |
" 282a Mobile SATA Controller RAID", |
" 2830 USB UHCI Controller #1", |
" 2831 USB UHCI Controller #2", |
" 2832 USB UHCI Controller #3", |
" 2834 USB UHCI Controller #4", |
" 2835 USB UHCI Controller #5", |
" 2836 USB2 EHCI Controller #1", |
" 283a USB2 EHCI Controller #2", |
" 283e SMBus Controller", |
" 283f PCI Express Port 1", |
" 2841 PCI Express Port 2", |
" 2843 PCI Express Port 3", |
" 2845 PCI Express Port 4", |
" 2847 PCI Express Port 5", |
" 2849 PCI Express Port 6", |
" 284b HD Audio Controller", |
" 284f Thermal Subsystem", |
" 2850 Mobile IDE Controller", |
" 2970 Memory Controller Hub", |
" 2971 PCI Express Root Port", |
" 2972 Integrated Graphics Controller", |
" 2973 Integrated Graphics Controller", |
" 2974 HECI Controller", |
" 2976 PT IDER Controller", |
" 2977 KT Controller", |
" 2990 Memory Controller Hub", |
" 2991 PCI Express Root Port", |
" 2992 Integrated Graphics Controller", |
" 2993 Integrated Graphics Controller", |
" 2994 HECI Controller", |
" 2995 HECI Controller", |
" 2996 PT IDER Controller", |
" 2997 KT Controller", |
" 29a0 Memory Controller Hub", |
" 29a1 PCI Express Root Port", |
" 29a2 Integrated Graphics Controller", |
" 29a3 Integrated Graphics Controller", |
" 29a4 HECI Controller", |
" 29a5 HECI Controller", |
" 29a6 PT IDER Controller", |
" 29a7 KT Controller", |
" 2a00 Mobile Memory Controller Hub", |
" 2a01 Mobile PCI Express Root Port", |
" 2a02 Mobile Integrated Graphics Controller", |
" 2a03 Mobile Integrated Graphics Controller", |
" 3092 Integrated RAID", |
" 3200 GD31244 PCI-X SATA HBA", |
" 3340 82855PM Processor to I/O Controller", |
" 1025 005a TravelMate 290", |
" 103c 088c NC8000 laptop", |
" 103c 0890 NC6000 laptop", |
" 3341 82855PM Processor to AGP Controller", |
" 3500 Enterprise Southbridge PCI Express Upstream Port", |
" 3501 Enterprise Southbridge PCI Express Upstream Port", |
" 3504 Enterprise Southbridge IOxAPIC", |
" 3505 Enterprise Southbridge IOxAPIC", |
" 350c Enterprise Southbridge PCI Express to PCI-X Bridge", |
" 350d Enterprise Southbridge PCI Express to PCI-X Bridge", |
" 3510 Enterprise Southbridge PCI Express Downstream Port E1", |
" 3511 Enterprise Southbridge PCI Express Downstream Port E1", |
" 3514 Enterprise Southbridge PCI Express Downstream Port E2", |
" 3515 Enterprise Southbridge PCI Express Downstream Port E2", |
" 3518 Enterprise Southbridge PCI Express Downstream Port E3", |
" 3519 Enterprise Southbridge PCI Express Downstream Port E3", |
" 3575 82830 830 Chipset Host Bridge", |
" 0e11 0030 Evo N600c", |
" 1014 021d ThinkPad A/T/X Series", |
" 104d 80e7 VAIO PCG-GR214EP/GR214MP/GR215MP/GR314MP/GR315MP", |
" 3576 82830 830 Chipset AGP Bridge", |
" 3577 82830 CGC [Chipset Graphics Controller]", |
" 1014 0513 ThinkPad A/T/X Series", |
" 3578 82830 830 Chipset Host Bridge", |
" 3580 82852/82855 GM/GME/PM/GMV Processor to I/O Controller", |
" 1028 0139 Latitude D400", |
" 1028 0163 Latitude D505", |
" 1028 0196 Inspiron 5160", |
" 1734 1055 Amilo M1420", |
" 4c53 10b0 CL9 mainboard", |
" 4c53 10e0 PSL09 PrPMC", |
" 3581 82852/82855 GM/GME/PM/GMV Processor to AGP Controller", |
" 1734 1055 Amilo M1420", |
" 3582 82852/855GM Integrated Graphics Device", |
" 1028 0139 Latitude D400", |
" 1028 0163 Latitude D505", |
" 4c53 10b0 CL9 mainboard", |
" 4c53 10e0 PSL09 PrPMC", |
" 3584 82852/82855 GM/GME/PM/GMV Processor to I/O Controller", |
" 1028 0139 Latitude D400", |
" 1028 0163 Latitude D505", |
" 1028 0196 Inspiron 5160", |
" 1734 1055 Amilo M1420", |
" 4c53 10b0 CL9 mainboard", |
" 4c53 10e0 PSL09 PrPMC", |
" 3585 82852/82855 GM/GME/PM/GMV Processor to I/O Controller", |
" 1028 0139 Latitude D400", |
" 1028 0163 Latitude D505", |
" 1028 0196 Inspiron 5160", |
" 1734 1055 Amilo M1420", |
" 4c53 10b0 CL9 mainboard", |
" 4c53 10e0 PSL09 PrPMC", |
" 3590 E7520 Memory Controller Hub", |
" 1028 019a PowerEdge SC1425", |
" 1734 103e Primergy RX300 S2", |
" 4c53 10d0 Telum ASLP10 Processor AMC", |
" 3591 E7525/E7520 Error Reporting Registers", |
" 1028 0169 Precision 470", |
" 4c53 10d0 Telum ASLP10 Processor AMC", |
" 3592 E7320 Memory Controller Hub", |
" 3593 E7320 Error Reporting Registers", |
" 3594 E7520 DMA Controller", |
" 4c53 10d0 Telum ASLP10 Processor AMC", |
" 3595 E7525/E7520/E7320 PCI Express Port A", |
" 3596 E7525/E7520/E7320 PCI Express Port A1", |
" 3597 E7525/E7520 PCI Express Port B", |
" 3598 E7520 PCI Express Port B1", |
" 3599 E7520 PCI Express Port C", |
" 359a E7520 PCI Express Port C1", |
" 359b E7525/E7520/E7320 Extended Configuration Registers", |
" 359e E7525 Memory Controller Hub", |
" 1028 0169 Precision 470", |
" 4220 PRO/Wireless 2200BG Network Connection", |
" 4222 PRO/Wireless 3945ABG Network Connection", |
" 8086 1005 PRO/Wireless 3945BG Network Connection", |
" 8086 1034 PRO/Wireless 3945BG Network Connection", |
" 8086 1044 PRO/Wireless 3945BG Network Connection", |
" 4223 PRO/Wireless 2915ABG Network Connection", |
" 1351 103c Compaq NC6220", |
" 4224 PRO/Wireless 2915ABG Network Connection", |
" 4227 PRO/Wireless 3945ABG Network Connection", |
" 8086 1011 Thinkpad X60s", |
" 8086 1014 PRO/Wireless 3945BG Network Connection", |
" 5200 EtherExpress PRO/100 Intelligent Server", |
" 5201 EtherExpress PRO/100 Intelligent Server", |
" 8086 0001 EtherExpress PRO/100 Server Ethernet Adapter", |
" 530d 80310 IOP [IO Processor]", |
" 7000 82371SB PIIX3 ISA [Natoma/Triton II]", |
" 7010 82371SB PIIX3 IDE [Natoma/Triton II]", |
" 7020 82371SB PIIX3 USB [Natoma/Triton II]", |
" 7030 430VX - 82437VX TVX [Triton VX]", |
" 7050 Intercast Video Capture Card", |
" 7051 PB 642365-003 (Business Video Conferencing Card)", |
" 7100 430TX - 82439TX MTXC", |
" 7110 82371AB/EB/MB PIIX4 ISA", |
" 15ad 1976 virtualHW v3", |
" 7111 82371AB/EB/MB PIIX4 IDE", |
" 15ad 1976 virtualHW v3", |
" 7112 82371AB/EB/MB PIIX4 USB", |
" 15ad 1976 virtualHW v3", |
" 7113 82371AB/EB/MB PIIX4 ACPI", |
" 15ad 1976 virtualHW v3", |
" 7120 82810 GMCH [Graphics Memory Controller Hub]", |
" 4c53 1040 CL7 mainboard", |
" 4c53 1060 PC7 mainboard", |
" 7121 82810 CGC [Chipset Graphics Controller]", |
" 4c53 1040 CL7 mainboard", |
" 4c53 1060 PC7 mainboard", |
" 8086 4341 Cayman (CA810) Mainboard", |
" 7122 82810 DC-100 GMCH [Graphics Memory Controller Hub]", |
" 7123 82810 DC-100 CGC [Chipset Graphics Controller]", |
" 7124 82810E DC-133 GMCH [Graphics Memory Controller Hub]", |
" 7125 82810E DC-133 CGC [Chipset Graphics Controller]", |
" 7126 82810 DC-133 System and Graphics Controller", |
" 7128 82810-M DC-100 System and Graphics Controller", |
" 712a 82810-M DC-133 System and Graphics Controller", |
" 7180 440LX/EX - 82443LX/EX Host bridge", |
" 7181 440LX/EX - 82443LX/EX AGP bridge", |
" 7190 440BX/ZX/DX - 82443BX/ZX/DX Host bridge", |
" 0e11 0500 Armada 1750 Laptop System Chipset", |
" 0e11 b110 Armada M700/E500", |
" 1028 008e PowerEdge 1300 mainboard", |
" 1179 0001 Toshiba Tecra 8100 Laptop System Chipset", |
" 15ad 1976 virtualHW v3", |
" 4c53 1050 CT7 mainboard", |
" 4c53 1051 CE7 mainboard", |
" 7191 440BX/ZX/DX - 82443BX/ZX/DX AGP bridge", |
" 1028 008e PowerEdge 1300 mainboard", |
" 7192 440BX/ZX/DX - 82443BX/ZX/DX Host bridge (AGP disabled)", |
" 0e11 0460 Armada 1700 Laptop System Chipset", |
" 4c53 1000 CC7/CR7/CP7/VC7/VP7/VR7 mainboard", |
" 7194 82440MX Host Bridge", |
" 1033 0000 Versa Note Vxi", |
" 4c53 10a0 CA3/CR3 mainboard", |
" 7195 82440MX AC'97 Audio Controller", |
" 1033 80cc Versa Note VXi", |
" 10cf 1099 QSound_SigmaTel Stac97 PCI Audio", |
" 11d4 0040 SoundMAX Integrated Digital Audio", |
" 11d4 0048 SoundMAX Integrated Digital Audio", |
" 7196 82440MX AC'97 Modem Controller", |
" 7198 82440MX ISA Bridge", |
" 7199 82440MX EIDE Controller", |
" 719a 82440MX USB Universal Host Controller", |
" 719b 82440MX Power Management Controller", |
" 71a0 440GX - 82443GX Host bridge", |
" 4c53 1050 CT7 mainboard", |
" 4c53 1051 CE7 mainboard", |
" 71a1 440GX - 82443GX AGP bridge", |
" 71a2 440GX - 82443GX Host bridge (AGP disabled)", |
" 4c53 1000 CC7/CR7/CP7/VC7/VP7/VR7 mainboard", |
" 7600 82372FB PIIX5 ISA", |
" 7601 82372FB PIIX5 IDE", |
" 7602 82372FB PIIX5 USB", |
" 7603 82372FB PIIX5 SMBus", |
" 7800 82740 (i740) AGP Graphics Accelerator", |
" 003d 0008 Starfighter AGP", |
" 003d 000b Starfighter AGP", |
" 1092 0100 Stealth II G460", |
" 10b4 201a Lightspeed 740", |
" 10b4 202f Lightspeed 740", |
" 8086 0000 Terminator 2x/i", |
" 8086 0100 Intel740 Graphics Accelerator", |
" 84c4 450KX/GX [Orion] - 82454KX/GX PCI bridge", |
" 84c5 450KX/GX [Orion] - 82453KX/GX Memory controller", |
" 84ca 450NX - 82451NX Memory & I/O Controller", |
" 84cb 450NX - 82454NX/84460GX PCI Expander Bridge", |
" 84e0 460GX - 84460GX System Address Controller (SAC)", |
" 84e1 460GX - 84460GX System Data Controller (SDC)", |
" 84e2 460GX - 84460GX AGP Bridge (GXB function 2)", |
" 84e3 460GX - 84460GX Memory Address Controller (MAC)", |
" 84e4 460GX - 84460GX Memory Data Controller (MDC)", |
" 84e6 460GX - 82466GX Wide and fast PCI eXpander Bridge (WXB)", |
" 84ea 460GX - 84460GX AGP Bridge (GXB function 1)", |
" 8500 IXP4XX Intel Network Processor (IXP420/421/422/425/IXC1100)", |
" 1993 0ded mGuard-PCI AV#2", |
" 1993 0dee mGuard-PCI AV#1", |
" 1993 0def mGuard-PCI AV#0", |
" 9000 IXP2000 Family Network Processor", |
" 9001 IXP2400 Network Processor", |
" 9002 IXP2300 Network Processor", |
" 9004 IXP2800 Network Processor", |
" 9621 Integrated RAID", |
" 9622 Integrated RAID", |
" 9641 Integrated RAID", |
" 96a1 Integrated RAID", |
" b152 21152 PCI-to-PCI Bridge", |
" b154 21154 PCI-to-PCI Bridge", |
" b555 21555 Non transparent PCI-to-PCI Bridge", |
" 12d9 000a PCI VoIP Gateway", |
" 4c53 1050 CT7 mainboard", |
" 4c53 1051 CE7 mainboard", |
" e4bf 1000 CC8-1-BLUES", |
"8401 TRENDware International Inc.", |
"8800 Trigem Computer Inc.", |
" 2008 Video assistent component", |
"8866 T-Square Design Inc.", |
"8888 Silicon Magic", |
"8912 TRX", |
"8c4a Winbond", |
" 1980 W89C940 misprogrammed [ne2k]", |
"8e0e Computone Corporation", |
"8e2e KTI", |
" 3000 ET32P2", |
"9004 Adaptec", |
" 0078 AHA-2940U_CN", |
" 1078 AIC-7810", |
" 1160 AIC-1160 [Family Fibre Channel Adapter]", |
" 2178 AIC-7821", |
" 3860 AHA-2930CU", |
" 3b78 AHA-4844W/4844UW", |
" 5075 AIC-755x", |
" 5078 AHA-7850", |
" 9004 7850 AHA-2904/Integrated AIC-7850", |
" 5175 AIC-755x", |
" 5178 AIC-7851", |
" 5275 AIC-755x", |
" 5278 AIC-7852", |
" 5375 AIC-755x", |
" 5378 AIC-7850", |
" 5475 AIC-755x", |
" 5478 AIC-7850", |
" 5575 AVA-2930", |
" 5578 AIC-7855", |
" 5647 ANA-7711 TCP Offload Engine", |
" 9004 7710 ANA-7711F TCP Offload Engine - Optical", |
" 9004 7711 ANA-7711LP TCP Offload Engine - Copper", |
" 5675 AIC-755x", |
" 5678 AIC-7856", |
" 5775 AIC-755x", |
" 5778 AIC-7850", |
" 5800 AIC-5800", |
" 5900 ANA-5910/5930/5940 ATM155 & 25 LAN Adapter", |
" 5905 ANA-5910A/5930A/5940A ATM Adapter", |
" 6038 AIC-3860", |
" 6075 AIC-1480 / APA-1480", |
" 9004 7560 AIC-1480 / APA-1480 Cardbus", |
" 6078 AIC-7860", |
" 6178 AIC-7861", |
" 9004 7861 AHA-2940AU Single", |
" 6278 AIC-7860", |
" 6378 AIC-7860", |
" 6478 AIC-786x", |
" 6578 AIC-786x", |
" 6678 AIC-786x", |
" 6778 AIC-786x", |
" 6915 ANA620xx/ANA69011A", |
" 9004 0008 ANA69011A/TX 10/100", |
" 9004 0009 ANA69011A/TX 10/100", |
" 9004 0010 ANA62022 2-port 10/100", |
" 9004 0018 ANA62044 4-port 10/100", |
" 9004 0019 ANA62044 4-port 10/100", |
" 9004 0020 ANA62022 2-port 10/100", |
" 9004 0028 ANA69011A/TX 10/100", |
" 9004 8008 ANA69011A/TX 64 bit 10/100", |
" 9004 8009 ANA69011A/TX 64 bit 10/100", |
" 9004 8010 ANA62022 2-port 64 bit 10/100", |
" 9004 8018 ANA62044 4-port 64 bit 10/100", |
" 9004 8019 ANA62044 4-port 64 bit 10/100", |
" 9004 8020 ANA62022 2-port 64 bit 10/100", |
" 9004 8028 ANA69011A/TX 64 bit 10/100", |
" 7078 AHA-294x / AIC-7870", |
" 7178 AHA-2940/2940W / AIC-7871", |
" 7278 AHA-3940/3940W / AIC-7872", |
" 7378 AHA-3985 / AIC-7873", |
" 7478 AHA-2944/2944W / AIC-7874", |
" 7578 AHA-3944/3944W / AIC-7875", |
" 7678 AHA-4944W/UW / AIC-7876", |
" 7710 ANA-7711F Network Accelerator Card (NAC) - Optical", |
" 7711 ANA-7711C Network Accelerator Card (NAC) - Copper", |
" 7778 AIC-787x", |
" 7810 AIC-7810", |
" 7815 AIC-7815 RAID+Memory Controller IC", |
" 9004 7815 ARO-1130U2 RAID Controller", |
" 9004 7840 AIC-7815 RAID+Memory Controller IC", |
" 7850 AIC-7850", |
" 7855 AHA-2930", |
" 7860 AIC-7860", |
" 7870 AIC-7870", |
" 7871 AHA-2940", |
" 7872 AHA-3940", |
" 7873 AHA-3980", |
" 7874 AHA-2944", |
" 7880 AIC-7880P", |
" 7890 AIC-7890", |
" 7891 AIC-789x", |
" 7892 AIC-789x", |
" 7893 AIC-789x", |
" 7894 AIC-789x", |
" 7895 AHA-2940U/UW / AHA-39xx / AIC-7895", |
" 9004 7890 AHA-2940U/2940UW Dual AHA-394xAU/AUW/AUWD AIC-7895B", |
" 9004 7891 AHA-2940U/2940UW Dual", |
" 9004 7892 AHA-3940AU/AUW/AUWD/UWD", |
" 9004 7894 AHA-3944AUWD", |
" 9004 7895 AHA-2940U/2940UW Dual AHA-394xAU/AUW/AUWD AIC-7895B", |
" 9004 7896 AHA-2940U/2940UW Dual AHA-394xAU/AUW/AUWD AIC-7895B", |
" 9004 7897 AHA-2940U/2940UW Dual AHA-394xAU/AUW/AUWD AIC-7895B", |
" 7896 AIC-789x", |
" 7897 AIC-789x", |
" 8078 AIC-7880U", |
" 9004 7880 AIC-7880P Ultra/Ultra Wide SCSI Chipset", |
" 8178 AHA-2940U/UW/D / AIC-7881U", |
" 9004 7881 AHA-2940UW SCSI Host Adapter", |
" 8278 AHA-3940U/UW/UWD / AIC-7882U", |
" 8378 AHA-3940U/UW / AIC-7883U", |
" 8478 AHA-2944UW / AIC-7884U", |
" 8578 AHA-3944U/UWD / AIC-7885", |
" 8678 AHA-4944UW / AIC-7886", |
" 8778 AHA-2940UW Pro / AIC-788x", |
" 9004 7887 2940UW Pro Ultra-Wide SCSI Controller", |
" 8878 AHA-2930UW / AIC-7888", |
" 9004 7888 AHA-2930UW SCSI Controller", |
" 8b78 ABA-1030", |
" ec78 AHA-4944W/UW", |
"9005 Adaptec", |
" 0010 AHA-2940U2/U2W", |
" 9005 2180 AHA-2940U2 SCSI Controller", |
" 9005 8100 AHA-2940U2B SCSI Controller", |
" 9005 a100 AHA-2940U2B SCSI Controller", |
" 9005 a180 AHA-2940U2W SCSI Controller", |
" 9005 e100 AHA-2950U2B SCSI Controller", |
" 0011 AHA-2930U2", |
" 0013 78902", |
" 9005 0003 AAA-131U2 Array1000 1 Channel RAID Controller", |
" 9005 000f AIC7890_ARO", |
" 001f AHA-2940U2/U2W / 7890/7891", |
" 9005 000f 2940U2W SCSI Controller", |
" 9005 a180 2940U2W SCSI Controller", |
" 0020 AIC-7890", |
" 002f AIC-7890", |
" 0030 AIC-7890", |
" 003f AIC-7890", |
" 0050 AHA-3940U2x/395U2x", |
" 9005 f500 AHA-3950U2B", |
" 9005 ffff AHA-3950U2B", |
" 0051 AHA-3950U2D", |
" 9005 b500 AHA-3950U2D", |
" 0053 AIC-7896 SCSI Controller", |
" 9005 ffff AIC-7896 SCSI Controller mainboard implementation", |
" 005f AIC-7896U2/7897U2", |
" 0080 AIC-7892A U160/m", |
" 0e11 e2a0 Compaq 64-Bit/66MHz Wide Ultra3 SCSI Adapter", |
" 9005 6220 AHA-29160C", |
" 9005 62a0 29160N Ultra160 SCSI Controller", |
" 9005 e220 29160LP Low Profile Ultra160 SCSI Controller", |
" 9005 e2a0 29160 Ultra160 SCSI Controller", |
" 0081 AIC-7892B U160/m", |
" 9005 62a1 19160 Ultra160 SCSI Controller", |
" 0083 AIC-7892D U160/m", |
" 008f AIC-7892P U160/m", |
" 1179 0001 Magnia Z310", |
" 15d9 9005 Onboard SCSI Host Adapter", |
" 00c0 AHA-3960D / AIC-7899A U160/m", |
" 0e11 f620 Compaq 64-Bit/66MHz Dual Channel Wide Ultra3 SCSI Adapter", |
" 9005 f620 AHA-3960D U160/m", |
" 00c1 AIC-7899B U160/m", |
" 00c3 AIC-7899D U160/m", |
" 00c5 RAID subsystem HBA", |
" 1028 00c5 PowerEdge 2400,2500,2550,4400", |
" 00cf AIC-7899P U160/m", |
" 1028 00ce PowerEdge 1400", |
" 1028 00d1 PowerEdge 2550", |
" 1028 00d9 PowerEdge 2500", |
" 10f1 2462 Thunder K7 S2462", |
" 15d9 9005 Onboard SCSI Host Adapter", |
" 8086 3411 SDS2 Mainboard", |
" 0241 Serial ATA II RAID 1420SA", |
" 0250 ServeRAID Controller", |
" 1014 0279 ServeRAID-xx", |
" 1014 028c ServeRAID-xx", |
" 0279 ServeRAID 6M", |
" 0283 AAC-RAID", |
" 9005 0283 Catapult", |
" 0284 AAC-RAID", |
" 9005 0284 Tomcat", |
" 0285 AAC-RAID", |
" 0e11 0295 SATA 6Ch (Bearcat)", |
" 1014 02f2 ServeRAID 8i", |
" 1028 0287 PowerEdge Expandable RAID Controller 320/DC", |
" 1028 0291 CERC SATA RAID 2 PCI SATA 6ch (DellCorsair)", |
" 103c 3227 AAR-2610SA", |
" 17aa 0286 Legend S220 (Legend Crusader)", |
" 17aa 0287 Legend S230 (Legend Vulcan)", |
" 9005 0285 2200S (Vulcan)", |
" 9005 0286 2120S (Crusader)", |
" 9005 0287 2200S (Vulcan-2m)", |
" 9005 0288 3230S (Harrier)", |
" 9005 0289 3240S (Tornado)", |
" 9005 028a ASR-2020ZCR", |
" 9005 028b ASR-2025ZCR (Terminator)", |
" 9005 028e ASR-2020SA (Skyhawk)", |
" 9005 028f ASR-2025SA", |
" 9005 0290 AAR-2410SA PCI SATA 4ch (Jaguar II)", |
" 9005 0292 AAR-2810SA PCI SATA 8ch (Corsair-8)", |
" 9005 0293 AAR-21610SA PCI SATA 16ch (Corsair-16)", |
" 9005 0294 ESD SO-DIMM PCI-X SATA ZCR (Prowler)", |
" 9005 0296 ASR-2240S", |
" 9005 0297 ASR-4005SAS", |
" 9005 0298 ASR-4000SAS", |
" 9005 0299 ASR-4800SAS", |
" 9005 029a 4805SAS", |
" 0286 AAC-RAID (Rocket)", |
" 1014 9540 ServeRAID 8k/8k-l4", |
" 1014 9580 ServeRAID 8k/8k-l8", |
" 9005 028c ASR-2230S + ASR-2230SLP PCI-X (Lancer)", |
" 9005 028d ASR-2130S", |
" 9005 029b ASR-2820SA", |
" 9005 029c ASR-2620SA", |
" 9005 029d ASR-2420SA", |
" 9005 029e ICP ICP9024R0", |
" 9005 029f ICP ICP9014R0", |
" 9005 02a0 ICP ICP9047MA", |
" 9005 02a1 ICP ICP9087MA", |
" 9005 02a2 3800SAS", |
" 9005 02a3 ICP ICP5445AU", |
" 9005 02a4 ICP ICP5085LI", |
" 9005 02a5 ICP ICP5085BR", |
" 9005 02a6 ICP9067MA", |
" 9005 02a7 AAR-2830SA", |
" 9005 02a8 AAR-2430SA", |
" 9005 02a9 ICP5087AU", |
" 9005 02aa ICP5047AU", |
" 9005 0800 Callisto", |
" 0500 Obsidian chipset SCSI controller", |
" 1014 02c1 PCI-X DDR 3Gb SAS Adapter (572A/572C)", |
" 1014 02c2 PCI-X DDR 3Gb SAS RAID Adapter (572B/572D)", |
" 0503 Scamp chipset SCSI controller", |
" 1014 02bf Quad Channel PCI-X DDR U320 SCSI RAID Adapter (571E)", |
" 1014 02d5 Quad Channel PCI-X DDR U320 SCSI RAID Adapter (571F)", |
" 0910 AUA-3100B", |
" 091e AUA-3100B", |
" 8000 ASC-29320A U320", |
" 800f AIC-7901 U320", |
" 8010 ASC-39320 U320", |
" 8011 ASC-39320D", |
" 0e11 00ac ASC-39320D U320", |
" 9005 0041 ASC-39320D U320", |
" 8012 ASC-29320 U320", |
" 8013 ASC-29320B U320", |
" 8014 ASC-29320LP U320", |
" 8015 ASC-39320B U320", |
" 8016 ASC-39320A U320", |
" 8017 ASC-29320ALP U320", |
" 801c ASC-39320D U320", |
" 801d AIC-7902B U320", |
" 801e AIC-7901A U320", |
" 801f AIC-7902 U320", |
" 1734 1011 Primergy RX300", |
" 8080 ASC-29320A U320 w/HostRAID", |
" 808f AIC-7901 U320 w/HostRAID", |
" 8090 ASC-39320 U320 w/HostRAID", |
" 8091 ASC-39320D U320 w/HostRAID", |
" 8092 ASC-29320 U320 w/HostRAID", |
" 8093 ASC-29320B U320 w/HostRAID", |
" 8094 ASC-29320LP U320 w/HostRAID", |
" 8095 ASC-39320(B) U320 w/HostRAID", |
" 8096 ASC-39320A U320 w/HostRAID", |
" 8097 ASC-29320ALP U320 w/HostRAID", |
" 809c ASC-39320D(B) U320 w/HostRAID", |
" 809d AIC-7902(B) U320 w/HostRAID", |
" 809e AIC-7901A U320 w/HostRAID", |
" 809f AIC-7902 U320 w/HostRAID", |
"907f Atronics", |
" 2015 IDE-2015PL", |
"919a Gigapixel Corp", |
"9412 Holtek", |
" 6565 6565", |
"9699 Omni Media Technology Inc", |
" 6565 6565", |
"9710 NetMos Technology", |
" 7780 USB IRDA-port", |
" 9805 PCI 1 port parallel adapter", |
" 9815 PCI 9815 Multi-I/O Controller", |
" 1000 0020 2P0S (2 port parallel adaptor)", |
" 9835 PCI 9835 Multi-I/O Controller", |
" 1000 0002 2S (16C550 UART)", |
" 1000 0012 1P2S", |
" 9845 PCI 9845 Multi-I/O Controller", |
" 1000 0004 0P4S (4 port 16550A serial card)", |
" 1000 0006 0P6S (6 port 16550a serial card)", |
" 9855 PCI 9855 Multi-I/O Controller", |
" 1000 0014 1P4S", |
"9902 Stargen Inc.", |
" 0001 SG2010 PCI over Starfabric Bridge", |
" 0002 SG2010 PCI to Starfabric Gateway", |
" 0003 SG1010 Starfabric Switch and PCI Bridge", |
"a0a0 AOPEN Inc.", |
"a0f1 UNISYS Corporation", |
"a200 NEC Corporation", |
"a259 Hewlett Packard", |
"a25b Hewlett Packard GmbH PL24-MKT", |
"a304 Sony", |
"a727 3Com Corporation", |
" 0013 3CRPAG175 Wireless PC Card", |
"aa42 Scitex Digital Video", |
"ac1e Digital Receiver Technology Inc", |
"ac3d Actuality Systems", |
"aecb Adrienne Electronics Corporation", |
" 6250 VITC/LTC Timecode Reader card [PCI-VLTC/RDR]", |
"affe Sirrix AG security technologies", |
" dead Sirrix.PCI4S0 4-port ISDN S0 interface", |
"b1b3 Shiva Europe Limited", |
"bd11 Pinnacle Systems, Inc. (Wrong ID)", |
"c001 TSI Telsys", |
"c0a9 Micron/Crucial Technology", |
"c0de Motorola", |
"c0fe Motion Engineering, Inc.", |
"ca50 Varian Australia Pty Ltd", |
"cafe Chrysalis-ITS", |
" 0003 Luna K3 Hardware Security Module", |
"cccc Catapult Communications", |
"cddd Tyzx, Inc.", |
" 0101 DeepSea 1 High Speed Stereo Vision Frame Grabber", |
" 0200 DeepSea 2 High Speed Stereo Vision Frame Grabber", |
"d161 Digium, Inc.", |
" 0205 Wildcard TE205P", |
" 0210 Wildcard TE210P", |
" 0405 Wildcard TE405P Quad-Span togglable E1/T1/J1 card 5.0v", |
" 0406 Wildcard TE406P Quad-Span togglable E1/T1/J1 echo cancellation card 5.0v", |
" 0410 Wildcard TE410P Quad-Span togglable E1/T1/J1 card 3.3v", |
" 0411 Wildcard TE411P Quad-Span togglable E1/T1/J1 echo cancellation card 3.3v", |
" 2400 Wildcard TDM2400P", |
"d4d4 Dy4 Systems Inc", |
" 0601 PCI Mezzanine Card", |
"d531 I+ME ACTIA GmbH", |
"d84d Exsys", |
"dead Indigita Corporation", |
"deaf Middle Digital Inc.", |
" 9050 PC Weasel Virtual VGA", |
" 9051 PC Weasel Serial Port", |
" 9052 PC Weasel Watchdog Timer", |
"e000 Winbond", |
" e000 W89C940", |
"e159 Tiger Jet Network Inc.", |
" 0001 Tiger3XX Modem/ISDN interface", |
" 0059 0001 128k ISDN-S/T Adapter", |
" 0059 0003 128k ISDN-U Adapter", |
" 00a7 0001 TELES.S0/PCI 2.x ISDN Adapter", |
" 8086 0003 Digium X100P/X101P analogue PSTN FXO interface", |
" 0002 Tiger100APC ISDN chipset", |
"e4bf EKF Elektronik GmbH", |
"e55e Essence Technology, Inc.", |
"ea01 Eagle Technology", |
" 000a PCI-773 Temperature Card", |
" 0032 PCI-730 & PC104P-30 Card", |
" 003e PCI-762 Opto-Isolator Card", |
" 0041 PCI-763 Reed Relay Card", |
" 0043 PCI-769 Opto-Isolator Reed Relay Combo Card", |
" 0046 PCI-766 Analog Output Card", |
" 0052 PCI-703 Analog I/O Card", |
" 0800 PCI-800 Digital I/O Card", |
"ea60 RME", |
" 9896 Digi32", |
" 9897 Digi32 Pro", |
" 9898 Digi32/8", |
"eabb Aashima Technology B.V.", |
"eace Endace Measurement Systems, Ltd", |
" 3100 DAG 3.10 OC-3/OC-12", |
" 3200 DAG 3.2x OC-3/OC-12", |
" 320e DAG 3.2E Fast Ethernet", |
" 340e DAG 3.4E Fast Ethernet", |
" 341e DAG 3.41E Fast Ethernet", |
" 3500 DAG 3.5 OC-3/OC-12", |
" 351c DAG 3.5ECM Fast Ethernet", |
" 4100 DAG 4.10 OC-48", |
" 4110 DAG 4.11 OC-48", |
" 4220 DAG 4.2 OC-48", |
" 422e DAG 4.2E Dual Gigabit Ethernet", |
"ec80 Belkin Corporation", |
" ec00 F5D6000", |
"ecc0 Echo Digital Audio Corporation", |
"edd8 ARK Logic Inc", |
" a091 1000PV [Stingray]", |
" a099 2000PV [Stingray]", |
" a0a1 2000MT", |
" a0a9 2000MI", |
"f1d0 AJA Video", |
" c0fe Xena HS/HD-R", |
" c0ff Kona/Xena 2", |
" cafe Kona SD", |
" cfee Xena LS/SD-22-DA/SD-DA", |
" dcaf Kona HD", |
" dfee Xena HD-DA", |
" efac Xena SD-MM/SD-22-MM", |
" facd Xena HD-MM", |
"fa57 Interagon AS", |
" 0001 PMC [Pattern Matching Chip]", |
"fab7 Fabric7 Systems, Inc.", |
"febd Ultraview Corp.", |
"feda Broadcom Inc", |
" a0fa BCM4210 iLine10 HomePNA 2.0", |
" a10e BCM4230 iLine10 HomePNA 2.0", |
"fede Fedetec Inc.", |
" 0003 TABIC PCI v3", |
"fffd XenSource, Inc.", |
" 0101 PCI Event Channel Controller", |
"fffe VMWare Inc", |
" 0405 Virtual SVGA 4.0", |
" 0710 Virtual SVGA", |
"ffff Illegal Vendor ID", |
"C 00 Unclassified device", |
" 00 Non-VGA unclassified device", |
" 01 VGA compatible unclassified device", |
"C 01 Mass storage controller", |
" 00 SCSI storage controller", |
" 01 IDE interface", |
" 02 Floppy disk controller", |
" 03 IPI bus controller", |
" 04 RAID bus controller", |
" 05 ATA controller", |
" 20 ADMA single stepping", |
" 40 ADMA continuous operation", |
" 06 SATA controller", |
" 00 Vendor specific", |
" 01 AHCI 1.0", |
" 07 Serial Attached SCSI controller", |
" 80 Mass storage controller", |
"C 02 Network controller", |
" 00 Ethernet controller", |
" 01 Token ring network controller", |
" 02 FDDI network controller", |
" 03 ATM network controller", |
" 04 ISDN controller", |
" 80 Network controller", |
"C 03 Display controller", |
" 00 VGA compatible controller", |
" 00 VGA", |
" 01 8514", |
" 01 XGA compatible controller", |
" 02 3D controller", |
" 80 Display controller", |
"C 04 Multimedia controller", |
" 00 Multimedia video controller", |
" 01 Multimedia audio controller", |
" 02 Computer telephony device", |
" 03 Audio device", |
" 80 Multimedia controller", |
"C 05 Memory controller", |
" 00 RAM memory", |
" 01 FLASH memory", |
" 80 Memory controller", |
"C 06 Bridge", |
" 00 Host bridge", |
" 01 ISA bridge", |
" 02 EISA bridge", |
" 03 MicroChannel bridge", |
" 04 PCI bridge", |
" 00 Normal decode", |
" 01 Subtractive decode", |
" 05 PCMCIA bridge", |
" 06 NuBus bridge", |
" 07 CardBus bridge", |
" 08 RACEway bridge", |
" 00 Transparent mode", |
" 01 Endpoint mode", |
" 09 Semi-transparent PCI-to-PCI bridge", |
" 40 Primary bus towards host CPU", |
" 80 Secondary bus towards host CPU", |
" 0a InfiniBand to PCI host bridge", |
" 80 Bridge", |
"C 07 Communication controller", |
" 00 Serial controller", |
" 00 8250", |
" 01 16450", |
" 02 16550", |
" 03 16650", |
" 04 16750", |
" 05 16850", |
" 06 16950", |
" 01 Parallel controller", |
" 00 SPP", |
" 01 BiDir", |
" 02 ECP", |
" 03 IEEE1284", |
" fe IEEE1284 Target", |
" 02 Multiport serial controller", |
" 03 Modem", |
" 00 Generic", |
" 01 Hayes/16450", |
" 02 Hayes/16550", |
" 03 Hayes/16650", |
" 04 Hayes/16750", |
" 80 Communication controller", |
"C 08 Generic system peripheral", |
" 00 PIC", |
" 00 8259", |
" 01 ISA PIC", |
" 02 EISA PIC", |
" 10 IO-APIC", |
" 20 IO(X)-APIC", |
" 01 DMA controller", |
" 00 8237", |
" 01 ISA DMA", |
" 02 EISA DMA", |
" 02 Timer", |
" 00 8254", |
" 01 ISA Timer", |
" 02 EISA Timers", |
" 03 RTC", |
" 00 Generic", |
" 01 ISA RTC", |
" 04 PCI Hot-plug controller", |
" 80 System peripheral", |
"C 09 Input device controller", |
" 00 Keyboard controller", |
" 01 Digitizer Pen", |
" 02 Mouse controller", |
" 03 Scanner controller", |
" 04 Gameport controller", |
" 00 Generic", |
" 10 Extended", |
" 80 Input device controller", |
"C 0a Docking station", |
" 00 Generic Docking Station", |
" 80 Docking Station", |
"C 0b Processor", |
" 00 386", |
" 01 486", |
" 02 Pentium", |
" 10 Alpha", |
" 20 Power PC", |
" 30 MIPS", |
" 40 Co-processor", |
"C 0c Serial bus controller", |
" 00 FireWire (IEEE 1394)", |
" 00 Generic", |
" 10 OHCI", |
" 01 ACCESS Bus", |
" 02 SSA", |
" 03 USB Controller", |
" 00 UHCI", |
" 10 OHCI", |
" 20 EHCI", |
" 80 Unspecified", |
" fe USB Device", |
" 04 Fibre Channel", |
" 05 SMBus", |
" 06 InfiniBand", |
"C 0d Wireless controller", |
" 00 IRDA controller", |
" 01 Consumer IR controller", |
" 10 RF controller", |
" 80 Wireless controller", |
"C 0e Intelligent controller", |
" 00 I2O", |
"C 0f Satellite communications controller", |
" 00 Satellite TV controller", |
" 01 Satellite audio communication controller", |
" 03 Satellite voice communication controller", |
" 04 Satellite data communication controller", |
"C 10 Encryption controller", |
" 00 Network and computing encryption device", |
" 10 Entertainment encryption device", |
" 80 Encryption controller", |
"C 11 Signal processing controller", |
" 00 DPIO module", |
" 01 Performance counters", |
" 10 Communication synchronizer", |
" 80 Signal processing controller", |
"" |
}; |
//branches/snapshot/uspace/srv/pci/Makefile |
---|
0,0 → 1,79 |
# |
# Copyright (c) 2005 Martin Decky |
# All rights reserved. |
# |
# Redistribution and use in source and binary forms, with or without |
# modification, are permitted provided that the following conditions |
# are met: |
# |
# - Redistributions of source code must retain the above copyright |
# notice, this list of conditions and the following disclaimer. |
# - 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. |
# - The name of the author may not be used to endorse or promote products |
# derived from this software without specific prior written permission. |
# |
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
# |
## Setup toolchain |
# |
LIBC_PREFIX = ../../lib/libc |
SOFTINT_PREFIX = ../../lib/softint |
include $(LIBC_PREFIX)/Makefile.toolchain |
LIBS = libpci/libpci.a $(LIBC_PREFIX)/libc.a |
## Sources |
# |
OUTPUT = pci |
SOURCES = \ |
pci.c |
OBJECTS := $(addsuffix .o,$(basename $(SOURCES))) |
.PHONY: all clean depend disasm |
all: $(OUTPUT) disasm |
-include Makefile.depend |
clean: |
-rm -f $(OUTPUT) $(OUTPUT).map $(OUTPUT).disasm Makefile.depend $(OBJECTS) |
$(MAKE) -C libpci clean |
depend: |
$(CC) $(DEFS) $(CFLAGS) -M $(SOURCES) > Makefile.depend |
$(OUTPUT): $(OBJECTS) $(LIBS) |
$(MAKE) -C libpci |
$(LD) -T $(LIBC_PREFIX)/arch/$(UARCH)/_link.ld $(OBJECTS) $(LIBS) $(LFLAGS) -o $@ -Map $(OUTPUT).map |
disasm: |
$(OBJDUMP) -d $(OUTPUT) >$(OUTPUT).disasm |
%.o: %.S |
$(CC) $(DEFS) $(AFLAGS) $(CFLAGS) -D__ASM__ -c $< -o $@ |
%.o: %.s |
$(AS) $(AFLAGS) $< -o $@ |
%.o: %.c |
$(CC) $(DEFS) $(CFLAGS) -c $< -o $@ |
libpci/libpci.a: |
$(MAKE) -C libpci |
//branches/snapshot/uspace/srv/pci/update-ids |
---|
0,0 → 1,15 |
#! /bin/bash |
wget http://pciids.sourceforge.net/v2.2/pci.ids |
cat > pci_ids.h <<EOF |
/* DO NOT EDIT, THIS FILE IS AUTOMATICALLY GENERATED */ |
char *pci_ids[] = { |
EOF |
cat pci.ids | grep -v '^#.*' | grep -v '^$' | tr \" \' | sed -n 's/\(.*\)/"\1",/p' >> pci_ids.h |
cat >> pci_ids.h <<EOF |
"" |
}; |
EOF |
Property changes: |
Added: svn:executable |
+* |
\ No newline at end of property |
//branches/snapshot/uspace/srv/pci/pci.c |
---|
0,0 → 1,88 |
/* |
* HelenOS PCI driver. |
* |
* (Based on public domain libpci example.c written by Martin Mares.) |
* Copyright (c) 2006 Jakub Jermar |
* |
* Can be freely distributed and used under the terms of the GNU GPL. |
*/ |
/** |
* @addtogroup pci |
* @{ |
*/ |
#include <stdio.h> |
#include <ddi.h> |
#include <task.h> |
#include <stdlib.h> |
#include <ipc/ipc.h> |
#include <ipc/services.h> |
#include <errno.h> |
#include "libpci/pci.h" |
#define PCI_CONF1 0xcf8 |
#define PCI_CONF1_SIZE 8 |
#define NAME "PCI" |
static struct pci_access *pacc; |
int main(int argc, char *argv[]) |
{ |
struct pci_dev *dev; |
unsigned int c; |
char buf[80]; |
ipcarg_t ns_in_phone_hash; |
printf("%s: HelenOS PCI driver\n", NAME); |
/* |
* Gain control over PCI configuration ports. |
*/ |
iospace_enable(task_get_id(), (void *) PCI_CONF1, PCI_CONF1_SIZE); |
pacc = pci_alloc(); /* Get the pci_access structure */ |
pci_init(pacc); /* Initialize the PCI library */ |
pci_scan_bus(pacc); /* We want to get the list of devices */ |
for(dev=pacc->devices; dev; dev=dev->next) { /* Iterate over all devices */ |
pci_fill_info(dev, PCI_FILL_IDENT | PCI_FILL_BASES | PCI_FILL_IRQ); |
c = pci_read_word(dev, PCI_CLASS_DEVICE); /* Read config register directly */ |
printf("%02x:%02x.%d vendor=%04x device=%04x class=%04x irq=%d base0=%lx\n", |
dev->bus, dev->dev, dev->func, dev->vendor_id, dev->device_id, |
c, dev->irq, dev->base_addr[0]); |
printf("\t%s\n", pci_lookup_name(pacc, buf, sizeof(buf), PCI_LOOKUP_VENDOR | PCI_LOOKUP_DEVICE, |
dev->vendor_id, dev->device_id)); |
} |
printf("%s: registering at naming service.\n", NAME); |
if (ipc_connect_to_me(PHONE_NS, SERVICE_PCI, 0, 0, &ns_in_phone_hash) != 0) { |
printf("Failed to register %s at naming service.\n", NAME); |
return -1; |
} |
printf("%s: accepting connections\n", NAME); |
while (1) { |
ipc_call_t call; |
ipc_callid_t callid; |
ipcarg_t retval = ENOTSUP; |
callid = ipc_wait_for_call(&call); |
switch(IPC_GET_METHOD(call)) { |
case IPC_M_CONNECT_ME_TO: |
retval = EOK; |
break; |
} |
ipc_answer_0(callid, retval); |
printf("%s: received call from %lX\n", NAME, |
call.in_phone_hash); |
} |
pci_cleanup(pacc); |
return 0; |
} |
/** |
* @} |
*/ |
//branches/snapshot/uspace/srv/pci/COPYING |
---|
0,0 → 1,340 |
GNU GENERAL PUBLIC LICENSE |
Version 2, June 1991 |
Copyright (C) 1989, 1991 Free Software Foundation, Inc. |
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
Everyone is permitted to copy and distribute verbatim copies |
of this license document, but changing it is not allowed. |
Preamble |
The licenses for most software are designed to take away your |
freedom to share and change it. By contrast, the GNU General Public |
License is intended to guarantee your freedom to share and change free |
software--to make sure the software is free for all its users. This |
General Public License applies to most of the Free Software |
Foundation's software and to any other program whose authors commit to |
using it. (Some other Free Software Foundation software is covered by |
the GNU Library General Public License instead.) You can apply it to |
your programs, too. |
When we speak of free software, we are referring to freedom, not |
price. Our General Public Licenses are designed to make sure that you |
have the freedom to distribute copies of free software (and charge for |
this service if you wish), that you receive source code or can get it |
if you want it, that you can change the software or use pieces of it |
in new free programs; and that you know you can do these things. |
To protect your rights, we need to make restrictions that forbid |
anyone to deny you these rights or to ask you to surrender the rights. |
These restrictions translate to certain responsibilities for you if you |
distribute copies of the software, or if you modify it. |
For example, if you distribute copies of such a program, whether |
gratis or for a fee, you must give the recipients all the rights that |
you have. You must make sure that they, too, receive or can get the |
source code. And you must show them these terms so they know their |
rights. |
We protect your rights with two steps: (1) copyright the software, and |
(2) offer you this license which gives you legal permission to copy, |
distribute and/or modify the software. |
Also, for each author's protection and ours, we want to make certain |
that everyone understands that there is no warranty for this free |
software. If the software is modified by someone else and passed on, we |
want its recipients to know that what they have is not the original, so |
that any problems introduced by others will not reflect on the original |
authors' reputations. |
Finally, any free program is threatened constantly by software |
patents. We wish to avoid the danger that redistributors of a free |
program will individually obtain patent licenses, in effect making the |
program proprietary. To prevent this, we have made it clear that any |
patent must be licensed for everyone's free use or not licensed at all. |
The precise terms and conditions for copying, distribution and |
modification follow. |
GNU GENERAL PUBLIC LICENSE |
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION |
0. This License applies to any program or other work which contains |
a notice placed by the copyright holder saying it may be distributed |
under the terms of this General Public License. The "Program", below, |
refers to any such program or work, and a "work based on the Program" |
means either the Program or any derivative work under copyright law: |
that is to say, a work containing the Program or a portion of it, |
either verbatim or with modifications and/or translated into another |
language. (Hereinafter, translation is included without limitation in |
the term "modification".) Each licensee is addressed as "you". |
Activities other than copying, distribution and modification are not |
covered by this License; they are outside its scope. The act of |
running the Program is not restricted, and the output from the Program |
is covered only if its contents constitute a work based on the |
Program (independent of having been made by running the Program). |
Whether that is true depends on what the Program does. |
1. You may copy and distribute verbatim copies of the Program's |
source code as you receive it, in any medium, provided that you |
conspicuously and appropriately publish on each copy an appropriate |
copyright notice and disclaimer of warranty; keep intact all the |
notices that refer to this License and to the absence of any warranty; |
and give any other recipients of the Program a copy of this License |
along with the Program. |
You may charge a fee for the physical act of transferring a copy, and |
you may at your option offer warranty protection in exchange for a fee. |
2. You may modify your copy or copies of the Program or any portion |
of it, thus forming a work based on the Program, and copy and |
distribute such modifications or work under the terms of Section 1 |
above, provided that you also meet all of these conditions: |
a) You must cause the modified files to carry prominent notices |
stating that you changed the files and the date of any change. |
b) You must cause any work that you distribute or publish, that in |
whole or in part contains or is derived from the Program or any |
part thereof, to be licensed as a whole at no charge to all third |
parties under the terms of this License. |
c) If the modified program normally reads commands interactively |
when run, you must cause it, when started running for such |
interactive use in the most ordinary way, to print or display an |
announcement including an appropriate copyright notice and a |
notice that there is no warranty (or else, saying that you provide |
a warranty) and that users may redistribute the program under |
these conditions, and telling the user how to view a copy of this |
License. (Exception: if the Program itself is interactive but |
does not normally print such an announcement, your work based on |
the Program is not required to print an announcement.) |
These requirements apply to the modified work as a whole. If |
identifiable sections of that work are not derived from the Program, |
and can be reasonably considered independent and separate works in |
themselves, then this License, and its terms, do not apply to those |
sections when you distribute them as separate works. But when you |
distribute the same sections as part of a whole which is a work based |
on the Program, the distribution of the whole must be on the terms of |
this License, whose permissions for other licensees extend to the |
entire whole, and thus to each and every part regardless of who wrote it. |
Thus, it is not the intent of this section to claim rights or contest |
your rights to work written entirely by you; rather, the intent is to |
exercise the right to control the distribution of derivative or |
collective works based on the Program. |
In addition, mere aggregation of another work not based on the Program |
with the Program (or with a work based on the Program) on a volume of |
a storage or distribution medium does not bring the other work under |
the scope of this License. |
3. You may copy and distribute the Program (or a work based on it, |
under Section 2) in object code or executable form under the terms of |
Sections 1 and 2 above provided that you also do one of the following: |
a) Accompany it with the complete corresponding machine-readable |
source code, which must be distributed under the terms of Sections |
1 and 2 above on a medium customarily used for software interchange; or, |
b) Accompany it with a written offer, valid for at least three |
years, to give any third party, for a charge no more than your |
cost of physically performing source distribution, a complete |
machine-readable copy of the corresponding source code, to be |
distributed under the terms of Sections 1 and 2 above on a medium |
customarily used for software interchange; or, |
c) Accompany it with the information you received as to the offer |
to distribute corresponding source code. (This alternative is |
allowed only for noncommercial distribution and only if you |
received the program in object code or executable form with such |
an offer, in accord with Subsection b above.) |
The source code for a work means the preferred form of the work for |
making modifications to it. For an executable work, complete source |
code means all the source code for all modules it contains, plus any |
associated interface definition files, plus the scripts used to |
control compilation and installation of the executable. However, as a |
special exception, the source code distributed need not include |
anything that is normally distributed (in either source or binary |
form) with the major components (compiler, kernel, and so on) of the |
operating system on which the executable runs, unless that component |
itself accompanies the executable. |
If distribution of executable or object code is made by offering |
access to copy from a designated place, then offering equivalent |
access to copy the source code from the same place counts as |
distribution of the source code, even though third parties are not |
compelled to copy the source along with the object code. |
4. You may not copy, modify, sublicense, or distribute the Program |
except as expressly provided under this License. Any attempt |
otherwise to copy, modify, sublicense or distribute the Program is |
void, and will automatically terminate your rights under this License. |
However, parties who have received copies, or rights, from you under |
this License will not have their licenses terminated so long as such |
parties remain in full compliance. |
5. You are not required to accept this License, since you have not |
signed it. However, nothing else grants you permission to modify or |
distribute the Program or its derivative works. These actions are |
prohibited by law if you do not accept this License. Therefore, by |
modifying or distributing the Program (or any work based on the |
Program), you indicate your acceptance of this License to do so, and |
all its terms and conditions for copying, distributing or modifying |
the Program or works based on it. |
6. Each time you redistribute the Program (or any work based on the |
Program), the recipient automatically receives a license from the |
original licensor to copy, distribute or modify the Program subject to |
these terms and conditions. You may not impose any further |
restrictions on the recipients' exercise of the rights granted herein. |
You are not responsible for enforcing compliance by third parties to |
this License. |
7. If, as a consequence of a court judgment or allegation of patent |
infringement or for any other reason (not limited to patent issues), |
conditions are imposed on you (whether by court order, agreement or |
otherwise) that contradict the conditions of this License, they do not |
excuse you from the conditions of this License. If you cannot |
distribute so as to satisfy simultaneously your obligations under this |
License and any other pertinent obligations, then as a consequence you |
may not distribute the Program at all. For example, if a patent |
license would not permit royalty-free redistribution of the Program by |
all those who receive copies directly or indirectly through you, then |
the only way you could satisfy both it and this License would be to |
refrain entirely from distribution of the Program. |
If any portion of this section is held invalid or unenforceable under |
any particular circumstance, the balance of the section is intended to |
apply and the section as a whole is intended to apply in other |
circumstances. |
It is not the purpose of this section to induce you to infringe any |
patents or other property right claims or to contest validity of any |
such claims; this section has the sole purpose of protecting the |
integrity of the free software distribution system, which is |
implemented by public license practices. Many people have made |
generous contributions to the wide range of software distributed |
through that system in reliance on consistent application of that |
system; it is up to the author/donor to decide if he or she is willing |
to distribute software through any other system and a licensee cannot |
impose that choice. |
This section is intended to make thoroughly clear what is believed to |
be a consequence of the rest of this License. |
8. If the distribution and/or use of the Program is restricted in |
certain countries either by patents or by copyrighted interfaces, the |
original copyright holder who places the Program under this License |
may add an explicit geographical distribution limitation excluding |
those countries, so that distribution is permitted only in or among |
countries not thus excluded. In such case, this License incorporates |
the limitation as if written in the body of this License. |
9. The Free Software Foundation may publish revised and/or new versions |
of the General Public License from time to time. Such new versions will |
be similar in spirit to the present version, but may differ in detail to |
address new problems or concerns. |
Each version is given a distinguishing version number. If the Program |
specifies a version number of this License which applies to it and "any |
later version", you have the option of following the terms and conditions |
either of that version or of any later version published by the Free |
Software Foundation. If the Program does not specify a version number of |
this License, you may choose any version ever published by the Free Software |
Foundation. |
10. If you wish to incorporate parts of the Program into other free |
programs whose distribution conditions are different, write to the author |
to ask for permission. For software which is copyrighted by the Free |
Software Foundation, write to the Free Software Foundation; we sometimes |
make exceptions for this. Our decision will be guided by the two goals |
of preserving the free status of all derivatives of our free software and |
of promoting the sharing and reuse of software generally. |
NO WARRANTY |
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY |
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN |
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES |
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED |
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF |
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS |
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE |
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, |
REPAIR OR CORRECTION. |
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING |
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR |
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, |
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING |
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED |
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY |
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER |
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE |
POSSIBILITY OF SUCH DAMAGES. |
END OF TERMS AND CONDITIONS |
How to Apply These Terms to Your New Programs |
If you develop a new program, and you want it to be of the greatest |
possible use to the public, the best way to achieve this is to make it |
free software which everyone can redistribute and change under these terms. |
To do so, attach the following notices to the program. It is safest |
to attach them to the start of each source file to most effectively |
convey the exclusion of warranty; and each file should have at least |
the "copyright" line and a pointer to where the full notice is found. |
<one line to give the program's name and a brief idea of what it does.> |
Copyright (C) <year> <name of author> |
This program is free software; you can redistribute it and/or modify |
it under the terms of the GNU General Public License as published by |
the Free Software Foundation; either version 2 of the License, or |
(at your option) any later version. |
This program is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
GNU General Public License for more details. |
You should have received a copy of the GNU General Public License |
along with this program; if not, write to the Free Software |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
Also add information on how to contact you by electronic and paper mail. |
If the program is interactive, make it output a short notice like this |
when it starts in an interactive mode: |
Gnomovision version 69, Copyright (C) year name of author |
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. |
This is free software, and you are welcome to redistribute it |
under certain conditions; type `show c' for details. |
The hypothetical commands `show w' and `show c' should show the appropriate |
parts of the General Public License. Of course, the commands you use may |
be called something other than `show w' and `show c'; they could even be |
mouse-clicks or menu items--whatever suits your program. |
You should also get your employer (if you work as a programmer) or your |
school, if any, to sign a "copyright disclaimer" for the program, if |
necessary. Here is a sample; alter the names: |
Yoyodyne, Inc., hereby disclaims all copyright interest in the program |
`Gnomovision' (which makes passes at compilers) written by James Hacker. |
<signature of Ty Coon>, 1 April 1989 |
Ty Coon, President of Vice |
This General Public License does not permit incorporating your program into |
proprietary programs. If your program is a subroutine library, you may |
consider it more useful to permit linking proprietary applications with the |
library. If this is what you want to do, use the GNU Library General |
Public License instead of this License. |
//branches/snapshot/uspace/app/tester/console/console1.c |
---|
0,0 → 1,123 |
/* |
* Copyright (c) 2008 Jiri Svoboda |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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 <stdio.h> |
#include <stdlib.h> |
#include <io/console.h> |
#include <io/color.h> |
#include <io/style.h> |
#include <vfs/vfs.h> |
#include <async.h> |
#include "../tester.h" |
const char *color_name[] = { |
[COLOR_BLACK] = "black", |
[COLOR_BLUE] = "blue", |
[COLOR_GREEN] = "green", |
[COLOR_CYAN] = "cyan", |
[COLOR_RED] = "red", |
[COLOR_MAGENTA] = "magenta", |
[COLOR_YELLOW] = "yellow", |
[COLOR_WHITE] = "white" |
}; |
char *test_console1(void) |
{ |
if (!test_quiet) { |
printf("Style test: "); |
fflush(stdout); |
console_set_style(fphone(stdout), STYLE_NORMAL); |
printf("normal "); |
fflush(stdout); |
console_set_style(fphone(stdout), STYLE_EMPHASIS); |
printf("emphasized"); |
fflush(stdout); |
console_set_style(fphone(stdout), STYLE_NORMAL); |
printf(".\n"); |
unsigned int i; |
unsigned int j; |
printf("\nForeground color test:\n"); |
for (j = 0; j < 2; j++) { |
for (i = COLOR_BLACK; i <= COLOR_WHITE; i++) { |
fflush(stdout); |
console_set_color(fphone(stdout), i, COLOR_WHITE, |
j ? CATTR_BRIGHT : 0); |
printf(" %s ", color_name[i]); |
} |
fflush(stdout); |
console_set_color(fphone(stdout), COLOR_BLACK, COLOR_WHITE, 0); |
putchar('\n'); |
} |
printf("\nBackground color test:\n"); |
for (j = 0; j < 2; j++) { |
for (i = COLOR_BLACK; i <= COLOR_WHITE; i++) { |
fflush(stdout); |
console_set_color(fphone(stdout), COLOR_WHITE, i, |
j ? CATTR_BRIGHT : 0); |
printf(" %s ", color_name[i]); |
} |
fflush(stdout); |
console_set_color(fphone(stdout), COLOR_BLACK, COLOR_WHITE, 0); |
putchar('\n'); |
} |
printf("\nRGB colors test:\n"); |
for (i = 0; i < 255; i += 16) { |
fflush(stdout); |
console_set_rgb_color(fphone(stdout), 0xffffff, i << 16); |
putchar('X'); |
} |
fflush(stdout); |
console_set_color(fphone(stdout), COLOR_BLACK, COLOR_WHITE, 0); |
putchar('\n'); |
for (i = 0; i < 255; i += 16) { |
fflush(stdout); |
console_set_rgb_color(fphone(stdout), 0xffffff, i << 8); |
putchar('X'); |
} |
fflush(stdout); |
console_set_color(fphone(stdout), COLOR_BLACK, COLOR_WHITE, 0); |
putchar('\n'); |
for (i = 0; i < 255; i += 16) { |
fflush(stdout); |
console_set_rgb_color(fphone(stdout), 0xffffff, i); |
putchar('X'); |
} |
fflush(stdout); |
console_set_color(fphone(stdout), COLOR_BLACK, COLOR_WHITE, 0); |
putchar('\n'); |
} |
return NULL; |
} |
//branches/snapshot/uspace/app/tester/console/console1.def |
---|
0,0 → 1,6 |
{ |
"console1", |
"Console color test", |
&test_console1, |
true |
}, |
//branches/snapshot/uspace/app/tester/stdio/stdio1.c |
---|
0,0 → 1,90 |
/* |
* Copyright (c) 2008 Jiri Svoboda |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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 <stdio.h> |
#include <stdlib.h> |
#include <errno.h> |
#include "../tester.h" |
#define BUF_SIZE 32 |
static char buf[BUF_SIZE + 1]; |
char *test_stdio1(void) |
{ |
FILE *file; |
char *file_name = "/readme"; |
TPRINTF("Open file \"%s\"...", file_name); |
errno = 0; |
file = fopen(file_name, "rt"); |
if (file == NULL) { |
TPRINTF("errno = %d\n", errno); |
return "Failed opening file"; |
} else |
TPRINTF("OK\n"); |
TPRINTF("Read file..."); |
size_t cnt = fread(buf, 1, BUF_SIZE, file); |
if (ferror(file)) { |
TPRINTF("errno = %d\n", errno); |
fclose(file); |
return "Failed reading file"; |
} else |
TPRINTF("OK\n"); |
buf[cnt] = '\0'; |
TPRINTF("Read %u bytes, string \"%s\"\n", cnt, buf); |
TPRINTF("Seek to beginning..."); |
if (fseek(file, 0, SEEK_SET) != 0) { |
TPRINTF("errno = %d\n", errno); |
fclose(file); |
return "Failed seeking in file"; |
} else |
TPRINTF("OK\n"); |
TPRINTF("Read using fgetc()..."); |
while (true) { |
int c = fgetc(file); |
if (c == EOF) |
break; |
TPRINTF("."); |
} |
TPRINTF("[EOF]\n"); |
TPRINTF("Close..."); |
if (fclose(file) != 0) { |
TPRINTF("errno = %d\n", errno); |
return "Failed closing file"; |
} else |
TPRINTF("OK\n"); |
return NULL; |
} |
//branches/snapshot/uspace/app/tester/stdio/stdio2.c |
---|
0,0 → 1,83 |
/* |
* Copyright (c) 2008 Jiri Svoboda |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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 <stdio.h> |
#include <stdlib.h> |
#include <errno.h> |
#include "../tester.h" |
char *test_stdio2(void) |
{ |
FILE *file; |
char *file_name = "/test"; |
TPRINTF("Open file \"%s\" for writing...", file_name); |
errno = 0; |
file = fopen(file_name, "wt"); |
if (file == NULL) { |
TPRINTF("errno = %d\n", errno); |
return "Failed opening file"; |
} else |
TPRINTF("OK\n"); |
TPRINTF("Write to file..."); |
fprintf(file, "integer: %u, string: \"%s\"", 42, "Hello!"); |
TPRINTF("OK\n"); |
TPRINTF("Close..."); |
if (fclose(file) != 0) { |
TPRINTF("errno = %d\n", errno); |
return "Failed closing file"; |
} else |
TPRINTF("OK\n"); |
TPRINTF("Open file \"%s\" for reading...", file_name); |
file = fopen(file_name, "rt"); |
if (file == NULL) { |
TPRINTF("errno = %d\n", errno); |
return "Failed opening file"; |
} else |
TPRINTF("OK\n"); |
TPRINTF("File contains:\n"); |
while (true) { |
int c = fgetc(file); |
if (c == EOF) |
break; |
TPRINTF("%c", c); |
} |
TPRINTF("\nClose..."); |
if (fclose(file) != 0) { |
TPRINTF("errno = %d\n", errno); |
return "Failed closing file"; |
} else |
TPRINTF("OK\n"); |
return NULL; |
} |
//branches/snapshot/uspace/app/tester/stdio/stdio1.def |
---|
0,0 → 1,6 |
{ |
"stdio1", |
"ANSI C streams reading test", |
&test_stdio1, |
true |
}, |
//branches/snapshot/uspace/app/tester/stdio/stdio2.def |
---|
0,0 → 1,6 |
{ |
"stdio2", |
"ANSI C streams writing test", |
&test_stdio2, |
true |
}, |
//branches/snapshot/uspace/app/tester/tester.c |
---|
0,0 → 1,147 |
/* |
* Copyright (c) 2006 Ondrej Palkovsky |
* Copyright (c) 2007 Martin Decky |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup tester User space tester |
* @brief User space testing infrastructure. |
* @{ |
*/ |
/** |
* @file |
*/ |
#include <unistd.h> |
#include <stdio.h> |
#include <string.h> |
#include "tester.h" |
bool test_quiet; |
int test_argc; |
char **test_argv; |
test_t tests[] = { |
#include "thread/thread1.def" |
#include "print/print1.def" |
#include "print/print2.def" |
#include "print/print3.def" |
#include "print/print4.def" |
#include "console/console1.def" |
#include "stdio/stdio1.def" |
#include "stdio/stdio2.def" |
#include "fault/fault1.def" |
#include "fault/fault2.def" |
#include "vfs/vfs1.def" |
#include "ipc/ping_pong.def" |
#include "ipc/register.def" |
#include "ipc/connect.def" |
#include "loop/loop1.def" |
#include "mm/malloc1.def" |
{NULL, NULL, NULL, false} |
}; |
static bool run_test(test_t *test) |
{ |
/* Execute the test */ |
char *ret = test->entry(); |
if (ret == NULL) { |
printf("\nTest passed\n"); |
return true; |
} |
printf("\n%s\n", ret); |
return false; |
} |
static void run_safe_tests(void) |
{ |
test_t *test; |
unsigned int i = 0; |
unsigned int n = 0; |
printf("\n*** Running all safe tests ***\n\n"); |
for (test = tests; test->name != NULL; test++) { |
if (test->safe) { |
printf("%s (%s)\n", test->name, test->desc); |
if (run_test(test)) |
i++; |
else |
n++; |
} |
} |
printf("\nCompleted, %u tests run, %u passed.\n", i + n, i); |
} |
static void list_tests(void) |
{ |
size_t len = 0; |
test_t *test; |
for (test = tests; test->name != NULL; test++) { |
if (str_length(test->name) > len) |
len = str_length(test->name); |
} |
for (test = tests; test->name != NULL; test++) |
printf("%-*s %s%s\n", len, test->name, test->desc, (test->safe ? "" : " (unsafe)")); |
printf("%-*s Run all safe tests\n", len, "*"); |
} |
int main(int argc, char *argv[]) |
{ |
if (argc < 2) { |
printf("Usage:\n\n"); |
printf("%s <test> [args ...]\n\n", argv[0]); |
list_tests(); |
return 0; |
} |
test_quiet = false; |
test_argc = argc - 2; |
test_argv = argv + 2; |
if (str_cmp(argv[1], "*") == 0) { |
run_safe_tests(); |
return 0; |
} |
test_t *test; |
for (test = tests; test->name != NULL; test++) { |
if (str_cmp(argv[1], test->name) == 0) { |
return (run_test(test) ? 0 : -1); |
} |
} |
printf("Unknown test \"%s\"\n", argv[1]); |
return -2; |
} |
/** @} |
*/ |
//branches/snapshot/uspace/app/tester/thread/thread1.c |
---|
0,0 → 1,82 |
/* |
* Copyright (c) 2005 Jakub Vana |
* Copyright (c) 2005 Jakub Jermar |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
#define THREADS 20 |
#define DELAY 10 |
#include <atomic.h> |
#include <thread.h> |
#include <stdio.h> |
#include <unistd.h> |
#include "../tester.h" |
static atomic_t finish; |
static atomic_t threads_finished; |
static bool sh_quiet; |
static void threadtest(void *data) |
{ |
thread_detach(thread_get_id()); |
while (atomic_get(&finish)) |
usleep(100000); |
atomic_inc(&threads_finished); |
} |
char *test_thread1(void) |
{ |
unsigned int i; |
unsigned int total = 0; |
atomic_set(&finish, 1); |
atomic_set(&threads_finished, 0); |
TPRINTF("Creating threads"); |
for (i = 0; i < THREADS; i++) { |
if (thread_create(threadtest, NULL, "threadtest", NULL) < 0) { |
TPRINTF("\nCould not create thread %u\n", i); |
break; |
} |
TPRINTF("."); |
total++; |
} |
TPRINTF("\nRunning threads for %u seconds...", DELAY); |
sleep(DELAY); |
TPRINTF("\n"); |
atomic_set(&finish, 0); |
while (atomic_get(&threads_finished) < total) { |
TPRINTF("Threads left: %u\n", total - atomic_get(&threads_finished)); |
sleep(1); |
} |
return NULL; |
} |
//branches/snapshot/uspace/app/tester/thread/thread1.def |
---|
0,0 → 1,6 |
{ |
"thread1", |
"Thread test", |
&test_thread1, |
true |
}, |
//branches/snapshot/uspace/app/tester/loop/loop1.c |
---|
0,0 → 1,40 |
/* |
* Copyright (c) 2008 Jiri Svoboda |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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 <stdio.h> |
#include <stdlib.h> |
#include "../tester.h" |
char *test_loop1(void) |
{ |
TPRINTF("Looping..."); |
while (true); |
TPRINTF("\n"); |
return "Survived endless loop"; |
} |
//branches/snapshot/uspace/app/tester/loop/loop1.def |
---|
0,0 → 1,6 |
{ |
"loop1", |
"Endless loop", |
&test_loop1, |
false |
}, |
//branches/snapshot/uspace/app/tester/fault/fault1.c |
---|
0,0 → 1,37 |
/* |
* Copyright (c) 2005 Jakub Vana |
* Copyright (c) 2005 Jakub Jermar |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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 "../tester.h" |
char *test_fault1(void) |
{ |
((int *)(0))[1] = 0; |
return "Survived write to NULL"; |
} |
//branches/snapshot/uspace/app/tester/fault/fault2.c |
---|
0,0 → 1,40 |
/* |
* Copyright (c) 2005 Jakub Vana |
* Copyright (c) 2005 Jakub Jermar |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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 "../tester.h" |
char *test_fault2(void) |
{ |
volatile long long var; |
volatile int var1; |
var1 = *((int *) (((char *) (&var)) + 1)); |
return "Survived unaligned read"; |
} |
//branches/snapshot/uspace/app/tester/fault/fault1.def |
---|
0,0 → 1,6 |
{ |
"fault1", |
"Write to NULL", |
&test_fault1, |
false |
}, |
//branches/snapshot/uspace/app/tester/fault/fault2.def |
---|
0,0 → 1,6 |
{ |
"fault2", |
"Unaligned read", |
&test_fault2, |
false |
}, |
//branches/snapshot/uspace/app/tester/ipc/ping_pong.c |
---|
0,0 → 1,78 |
/* |
* Copyright (c) 2009 Jiri Svoboda |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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 <stdio.h> |
#include <stdlib.h> |
#include <sys/time.h> |
#include <ipc/ns.h> |
#include <async.h> |
#include <errno.h> |
#include "../tester.h" |
#define DURATION_SECS 10 |
#define COUNT_GRANULARITY 100 |
char *test_ping_pong(void) |
{ |
TPRINTF("Pinging ns server for %d seconds...", DURATION_SECS); |
struct timeval start; |
if (gettimeofday(&start, NULL) != 0) { |
TPRINTF("\n"); |
return "Failed getting the time"; |
} |
uint64_t count = 0; |
while (true) { |
struct timeval now; |
if (gettimeofday(&now, NULL) != 0) { |
TPRINTF("\n"); |
return "Failed getting the time"; |
} |
if (tv_sub(&now, &start) >= DURATION_SECS * 1000000L) |
break; |
size_t i; |
for (i = 0; i < COUNT_GRANULARITY; i++) { |
int retval = async_req_0_0(PHONE_NS, NS_PING); |
if (retval != EOK) { |
TPRINTF("\n"); |
return "Failed to send ping message"; |
} |
} |
count += COUNT_GRANULARITY; |
} |
TPRINTF("OK\nCompleted %llu round trips in %u seconds, %llu rt/s.\n", |
count, DURATION_SECS, count / DURATION_SECS); |
return NULL; |
} |
//branches/snapshot/uspace/app/tester/ipc/register.c |
---|
0,0 → 1,89 |
/* |
* Copyright (c) 2006 Ondrej Palkovsky |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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 <stdio.h> |
#include <unistd.h> |
#include <async.h> |
#include <errno.h> |
#include "../tester.h" |
#define MAX_CONNECTIONS 50 |
static int connections[MAX_CONNECTIONS]; |
static void client_connection(ipc_callid_t iid, ipc_call_t *icall) |
{ |
unsigned int i; |
TPRINTF("Connected phone %#x accepting\n", icall->in_phone_hash); |
ipc_answer_0(iid, EOK); |
for (i = 0; i < MAX_CONNECTIONS; i++) { |
if (!connections[i]) { |
connections[i] = icall->in_phone_hash; |
break; |
} |
} |
while (true) { |
ipc_call_t call; |
ipc_callid_t callid = async_get_call(&call); |
int retval; |
switch (IPC_GET_METHOD(call)) { |
case IPC_M_PHONE_HUNGUP: |
TPRINTF("Phone %#x hung up\n", icall->in_phone_hash); |
retval = 0; |
break; |
case IPC_TEST_METHOD: |
TPRINTF("Received well known message from %#x: %#x\n", |
icall->in_phone_hash, callid); |
ipc_answer_0(callid, EOK); |
break; |
default: |
TPRINTF("Received unknown message from %#x: %#x\n", |
icall->in_phone_hash, callid); |
ipc_answer_0(callid, ENOENT); |
break; |
} |
} |
} |
char *test_register(void) |
{ |
async_set_client_connection(client_connection); |
ipcarg_t phonead; |
int res = ipc_connect_to_me(PHONE_NS, IPC_TEST_SERVICE, 0, 0, &phonead); |
if (res != 0) |
return "Failed registering IPC service"; |
TPRINTF("Registered as service %u, accepting connections\n", IPC_TEST_SERVICE); |
async_manager(); |
return NULL; |
} |
//branches/snapshot/uspace/app/tester/ipc/connect.c |
---|
0,0 → 1,73 |
/* |
* Copyright (c) 2006 Ondrej Palkovsky |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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 <stdio.h> |
#include <unistd.h> |
#include <atomic.h> |
#include "../tester.h" |
static atomic_t finish; |
static void callback(void *priv, int retval, ipc_call_t *data) |
{ |
atomic_set(&finish, 1); |
} |
char *test_connect(void) |
{ |
TPRINTF("Connecting to %u...", IPC_TEST_SERVICE); |
int phone = ipc_connect_me_to(PHONE_NS, IPC_TEST_SERVICE, 0, 0); |
if (phone > 0) { |
TPRINTF("phoneid %d\n", phone); |
} else { |
TPRINTF("\n"); |
return "ipc_connect_me_to() failed"; |
} |
printf("Sending synchronous message...\n"); |
int retval = ipc_call_sync_0_0(phone, IPC_TEST_METHOD); |
TPRINTF("Received response to synchronous message\n"); |
TPRINTF("Sending asynchronous message...\n"); |
atomic_set(&finish, 0); |
ipc_call_async_0(phone, IPC_TEST_METHOD, NULL, callback, 1); |
while (atomic_get(&finish) != 1) |
TPRINTF("."); |
TPRINTF("Received response to asynchronous message\n"); |
TPRINTF("Hanging up..."); |
retval = ipc_hangup(phone); |
if (retval == 0) { |
TPRINTF("OK\n"); |
} else { |
TPRINTF("\n"); |
return "ipc_hangup() failed"; |
} |
return NULL; |
} |
//branches/snapshot/uspace/app/tester/ipc/ping_pong.def |
---|
0,0 → 1,6 |
{ |
"ping_pong", |
"IPC ping-pong benchmark", |
&test_ping_pong, |
true |
}, |
//branches/snapshot/uspace/app/tester/ipc/register.def |
---|
0,0 → 1,6 |
{ |
"register", |
"IPC registration test", |
&test_register, |
true |
}, |
//branches/snapshot/uspace/app/tester/ipc/connect.def |
---|
0,0 → 1,6 |
{ |
"connect", |
"IPC connection test (connect to other service)", |
&test_connect, |
true |
}, |
//branches/snapshot/uspace/app/tester/print/print2.c |
---|
0,0 → 1,52 |
/* |
* Copyright (c) 2005 Josef Cejka |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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 <stdio.h> |
#include <unistd.h> |
#include "../tester.h" |
char *test_print2(void) |
{ |
TPRINTF("Testing printf(\"%%c %%3.2c %%-3.2c %%2.3c %%-2.3c\", 'a', 'b', 'c', 'd', 'e'):\n"); |
TPRINTF("Expected output: [a] [ b] [c ] [ d] [e ]\n"); |
TPRINTF("Real output: [%c] [%3.2c] [%-3.2c] [%2.3c] [%-2.3c]\n\n", 'a', 'b', 'c', 'd', 'e'); |
TPRINTF("Testing printf(\"%%d %%3.2d %%-3.2d %%2.3d %%-2.3d\", 1, 2, 3, 4, 5):\n"); |
TPRINTF("Expected output: [1] [ 02] [03 ] [004] [005]\n"); |
TPRINTF("Real output: [%d] [%3.2d] [%-3.2d] [%2.3d] [%-2.3d]\n\n", 1, 2, 3, 4, 5); |
TPRINTF("Testing printf(\"%%d %%3.2d %%-3.2d %%2.3d %%-2.3d\", -1, -2, -3, -4, -5):\n"); |
TPRINTF("Expected output: [-1] [-02] [-03] [-004] [-005]\n"); |
TPRINTF("Real output: [%d] [%3.2d] [%-3.2d] [%2.3d] [%-2.3d]\n\n", -1, -2, -3, -4, -5); |
TPRINTF("Testing printf(\"%%#x %%5.3#x %%-5.3#x %%3.5#x %%-3.5#x\", 17, 18, 19, 20, 21):\n"); |
TPRINTF("Expected output: [0x11] [0x012] [0x013] [0x00014] [0x00015]\n"); |
TPRINTF("Real output: [%#x] [%#5.3x] [%#-5.3x] [%#3.5x] [%#-3.5x]\n\n", 17, 18, 19, 20, 21); |
return NULL; |
} |
//branches/snapshot/uspace/app/tester/print/print3.c |
---|
0,0 → 1,62 |
/* |
* Copyright (c) 2005 Josef Cejka |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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 <stdio.h> |
#include <unistd.h> |
#include <macros.h> |
#include "../tester.h" |
#define BUFFER_SIZE 32 |
char *test_print3(void) |
{ |
char buffer[BUFFER_SIZE]; |
int retval; |
TPRINTF("Testing snprintf(buffer, " STRING(BUFFER_SIZE) ", \"Short text without parameters.\"):\n"); |
TPRINTF("Expected result: retval=30 buffer=\"Short text without parameters.\"\n"); |
retval = snprintf(buffer, BUFFER_SIZE, "Short text without parameters."); |
TPRINTF("Real result: retval=%d buffer=\"%s\"\n\n", retval, buffer); |
TPRINTF("Testing snprintf(buffer, " STRING(BUFFER_SIZE) ", \"Very very very long text without parameters.\"):\n"); |
TPRINTF("Expected result: retval=44 buffer=\"Very very very long text withou\"\n"); |
retval = snprintf(buffer, BUFFER_SIZE, "Very very very long text without parameters."); |
TPRINTF("Real result: retval=%d buffer=\"%s\"\n\n", retval, buffer); |
TPRINTF("Testing snprintf(buffer, " STRING(BUFFER_SIZE) ", \"Short %%s.\", \"text\"):\n"); |
TPRINTF("Expected result: retval=11 buffer=\"Short text.\"\n"); |
retval = snprintf(buffer, BUFFER_SIZE, "Short %s.", "text"); |
TPRINTF("Real result: retval=%d buffer=\"%s\"\n\n", retval, buffer); |
TPRINTF("Testing snprintf(buffer, " STRING(BUFFER_SIZE) ", \"Very long %%s. This text's length is more than %%d. We are interested in the result.\", \"text\", " STRING(BUFFER_SIZE) "):\n"); |
TPRINTF("Expected result: retval=84 buffer=\"Very long text. This text's len\"\n"); |
retval = snprintf(buffer, BUFFER_SIZE, "Very long %s. This text's length is more than %d. We are interested in the result.", "text", BUFFER_SIZE); |
TPRINTF("Real result: retval=%d buffer=\"%s\"\n\n", retval, buffer); |
return NULL; |
} |
//branches/snapshot/uspace/app/tester/print/print4.c |
---|
0,0 → 1,83 |
/* |
* Copyright (c) 2009 Martin Decky |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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 <stdio.h> |
#include <unistd.h> |
#include "../tester.h" |
char *test_print4(void) |
{ |
TPRINTF("ASCII printable characters (32 - 127) using printf(\"%%c\") and printf(\"%%lc\"):\n"); |
uint8_t group; |
for (group = 1; group < 4; group++) { |
TPRINTF("%#x: ", group << 5); |
uint8_t index; |
for (index = 0; index < 32; index++) |
TPRINTF("%c", (char) ((group << 5) + index)); |
TPRINTF(" "); |
for (index = 0; index < 32; index++) |
TPRINTF("%lc", (wchar_t) ((group << 5) + index)); |
TPRINTF("\n"); |
} |
TPRINTF("\nExtended ASCII characters (128 - 255) using printf(\"%%lc\"):\n"); |
for (group = 4; group < 8; group++) { |
TPRINTF("%#x: ", group << 5); |
uint8_t index; |
for (index = 0; index < 32; index++) |
TPRINTF("%lc", (wchar_t) ((group << 5) + index)); |
TPRINTF("\n"); |
} |
TPRINTF("\nUTF-8 strings using printf(\"%%s\"):\n"); |
TPRINTF("English: %s\n", "Quick brown fox jumps over the lazy dog"); |
TPRINTF("Czech: %s\n", "Příliš žluťoučký kůň úpěl ďábelské ódy"); |
TPRINTF("Greek: %s\n", "á½® ξεῖν’, ἀγγÎλλειν Λακεδαιμονίοις ὅτι τῇδε"); |
TPRINTF("Hebrew: %s\n", "משוואת ברנולי היא משוואה בהידרודינמיקה"); |
TPRINTF("Arabic: %s\n", "التوزيع الجغرافي للحمل العنقودي"); |
TPRINTF("Russian: %s\n", "Леннон познакомился с художницей-авангардисткой"); |
TPRINTF("Armenian: %s\n", "ÕÕ¯Õ½Õ¥Ö Õ°Ö€Õ¡Õ¿Õ¡Ö€Õ¡Õ¯Õ¾Õ¥Õ¬ ÔµÖ€Õ¸Ö‚Õ½Õ¡Õ²Õ¥Õ´Õ« Õ°Õ¡ÕµÕ¯Õ¡Õ¯Õ¡Õ¶"); |
TPRINTF("\nUTF-32 strings using printf(\"%%ls\"):\n"); |
TPRINTF("English: %ls\n", L"Quick brown fox jumps over the lazy dog"); |
TPRINTF("Czech: %ls\n", L"Příliš žluťoučký kůň úpěl ďábelské ódy"); |
TPRINTF("Greek: %ls\n", L"á½® ξεῖν’, ἀγγÎλλειν Λακεδαιμονίοις ὅτι τῇδε"); |
TPRINTF("Hebrew: %ls\n", L"משוואת ברנולי היא משוואה בהידרודינמיקה"); |
TPRINTF("Arabic: %ls\n", L"التوزيع الجغرافي للحمل العنقودي"); |
TPRINTF("Russian: %ls\n", L"Леннон познакомился с художницей-авангардисткой"); |
TPRINTF("Armenian: %ls\n", L"ÕÕ¯Õ½Õ¥Ö Õ°Ö€Õ¡Õ¿Õ¡Ö€Õ¡Õ¯Õ¾Õ¥Õ¬ ÔµÖ€Õ¸Ö‚Õ½Õ¡Õ²Õ¥Õ´Õ« Õ°Õ¡ÕµÕ¯Õ¡Õ¯Õ¡Õ¶"); |
return NULL; |
} |
Property changes: |
Added: svn:mergeinfo |
//branches/snapshot/uspace/app/tester/print/print1.def |
---|
0,0 → 1,6 |
{ |
"print1", |
"String printf test", |
&test_print1, |
true |
}, |
//branches/snapshot/uspace/app/tester/print/print2.def |
---|
0,0 → 1,6 |
{ |
"print2", |
"Numeric printf test", |
&test_print2, |
true |
}, |
//branches/snapshot/uspace/app/tester/print/print3.def |
---|
0,0 → 1,6 |
{ |
"print3", |
"Buffered printf test", |
&test_print3, |
true |
}, |
//branches/snapshot/uspace/app/tester/print/print1.c |
---|
0,0 → 1,56 |
/* |
* Copyright (c) 2005 Josef Cejka |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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 <stdio.h> |
#include <unistd.h> |
#include "../tester.h" |
char *test_print1(void) |
{ |
TPRINTF("Testing printf(\"%%*.*s\", 5, 3, \"text\"):\n"); |
TPRINTF("Expected output: \" tex\"\n"); |
TPRINTF("Real output: \"%*.*s\"\n\n", 5, 3, "text"); |
TPRINTF("Testing printf(\"%%10.8s\", \"very long text\"):\n"); |
TPRINTF("Expected output: \" very lon\"\n"); |
TPRINTF("Real output: \"%10.8s\"\n\n", "very long text"); |
TPRINTF("Testing printf(\"%%8.10s\", \"text\"):\n"); |
TPRINTF("Expected output: \"text\"\n"); |
TPRINTF("Real output: \"%8.10s\"\n\n", "text"); |
TPRINTF("Testing printf(\"%%8.10s\", \"very long text\"):\n"); |
TPRINTF("Expected output: \"very long \"\n"); |
TPRINTF("Real output: \"%8.10s\"\n\n", "very long text"); |
TPRINTF("Testing printf(\"%%s\", NULL):\n"); |
TPRINTF("Expected output: \"(NULL)\"\n"); |
TPRINTF("Real output: \"%s\"\n\n", NULL); |
return NULL; |
} |
//branches/snapshot/uspace/app/tester/print/print4.def |
---|
0,0 → 1,6 |
{ |
"print4", |
"Unicode test", |
&test_print4, |
true |
}, |
Property changes: |
Added: svn:mergeinfo |
//branches/snapshot/uspace/app/tester/tester.h |
---|
0,0 → 1,87 |
/* |
* Copyright (c) 2007 Martin Decky |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup tester |
* @{ |
*/ |
/** @file |
*/ |
#ifndef TESTER_H_ |
#define TESTER_H_ |
#include <sys/types.h> |
#include <bool.h> |
#include <ipc/ipc.h> |
#define IPC_TEST_SERVICE 10240 |
#define IPC_TEST_METHOD 2000 |
extern bool test_quiet; |
extern int test_argc; |
extern char **test_argv; |
#define TPRINTF(format, ...) \ |
{ \ |
if (!test_quiet) { \ |
fprintf(stderr, format, ##__VA_ARGS__); \ |
} \ |
} |
typedef char *(*test_entry_t)(void); |
typedef struct { |
char *name; |
char *desc; |
test_entry_t entry; |
bool safe; |
} test_t; |
extern char *test_thread1(void); |
extern char *test_print1(void); |
extern char *test_print2(void); |
extern char *test_print3(void); |
extern char *test_print4(void); |
extern char *test_console1(void); |
extern char *test_stdio1(void); |
extern char *test_stdio2(void); |
extern char *test_fault1(void); |
extern char *test_fault2(void); |
extern char *test_vfs1(void); |
extern char *test_ping_pong(void); |
extern char *test_register(void); |
extern char *test_connect(void); |
extern char *test_loop1(void); |
extern char *test_malloc1(void); |
extern test_t tests[]; |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/app/tester/Makefile |
---|
0,0 → 1,92 |
# |
# Copyright (c) 2005 Martin Decky |
# All rights reserved. |
# |
# Redistribution and use in source and binary forms, with or without |
# modification, are permitted provided that the following conditions |
# are met: |
# |
# - Redistributions of source code must retain the above copyright |
# notice, this list of conditions and the following disclaimer. |
# - 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. |
# - The name of the author may not be used to endorse or promote products |
# derived from this software without specific prior written permission. |
# |
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
# |
## Setup toolchain |
# |
LIBC_PREFIX = ../../lib/libc |
SOFTINT_PREFIX = ../../lib/softint |
include $(LIBC_PREFIX)/Makefile.toolchain |
CFLAGS += -I../../srv/kbd/include |
LIBS = $(LIBC_PREFIX)/libc.a |
## Sources |
# |
OUTPUT = tester |
SOURCES = tester.c \ |
thread/thread1.c \ |
print/print1.c \ |
print/print2.c \ |
print/print3.c \ |
print/print4.c \ |
console/console1.c \ |
stdio/stdio1.c \ |
stdio/stdio2.c \ |
fault/fault1.c \ |
fault/fault2.c \ |
vfs/vfs1.c \ |
ipc/ping_pong.c \ |
ipc/register.c \ |
ipc/connect.c \ |
loop/loop1.c \ |
mm/malloc1.c |
OBJECTS := $(addsuffix .o,$(basename $(SOURCES))) |
.PHONY: all clean depend disasm |
all: $(OUTPUT) $(OUTPUT).disasm |
-include Makefile.depend |
clean: |
-rm -f $(OUTPUT) $(OUTPUT).map $(OUTPUT).disasm Makefile.depend $(OBJECTS) |
depend: |
$(CC) $(DEFS) $(CFLAGS) -M $(SOURCES) > Makefile.depend |
$(OUTPUT): $(OBJECTS) $(LIBS) |
$(LD) -T $(LIBC_PREFIX)/arch/$(UARCH)/_link.ld $(OBJECTS) $(LIBS) $(LFLAGS) -o $@ -Map $(OUTPUT).map |
disasm: $(OUTPUT).disasm |
$(OUTPUT).disasm: $(OUTPUT) |
$(OBJDUMP) -d $< > $@ |
%.o: %.S |
$(CC) $(DEFS) $(AFLAGS) $(CFLAGS) -D__ASM__ -c $< -o $@ |
%.o: %.s |
$(AS) $(AFLAGS) $< -o $@ |
%.o: %.c |
$(CC) $(DEFS) $(CFLAGS) -c $< -o $@ |
//branches/snapshot/uspace/app/tester/vfs/vfs1.c |
---|
0,0 → 1,151 |
/* |
* Copyright (c) 2008 Jakub Jermar |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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 <errno.h> |
#include <stdio.h> |
#include <stdlib.h> |
#include <string.h> |
#include <vfs/vfs.h> |
#include <unistd.h> |
#include <fcntl.h> |
#include <dirent.h> |
#include <devmap.h> |
#include <sys/types.h> |
#include <sys/stat.h> |
#include "../tester.h" |
#define FS_TYPE "tmpfs" |
#define MOUNT_POINT "/tmp" |
#define OPTIONS "" |
#define FLAGS 0 |
#define TEST_DIRECTORY MOUNT_POINT "/testdir" |
#define TEST_FILE TEST_DIRECTORY "/testfile" |
#define TEST_FILE2 TEST_DIRECTORY "/nextfile" |
#define MAX_DEVICE_NAME 32 |
#define BUF_SIZE 16 |
static char text[] = "Lorem ipsum dolor sit amet, consectetur adipisicing elit"; |
static char *read_root(void) |
{ |
TPRINTF("Opening the root directory..."); |
DIR *dirp = opendir("/"); |
if (!dirp) { |
TPRINTF("\n"); |
return "opendir() failed"; |
} else |
TPRINTF("OK\n"); |
struct dirent *dp; |
while ((dp = readdir(dirp))) |
TPRINTF(" node \"%s\"\n", dp->d_name); |
closedir(dirp); |
return NULL; |
} |
char *test_vfs1(void) |
{ |
if (mkdir(MOUNT_POINT, 0) != 0) |
return "mkdir() failed"; |
TPRINTF("Created directory %s\n", MOUNT_POINT); |
char null[MAX_DEVICE_NAME]; |
int null_id = devmap_null_create(); |
if (null_id == -1) |
return "Unable to create null device"; |
snprintf(null, MAX_DEVICE_NAME, "null%d", null_id); |
int rc = mount(FS_TYPE, MOUNT_POINT, null, OPTIONS, FLAGS); |
switch (rc) { |
case EOK: |
TPRINTF("Mounted /dev/%s as %s on %s\n", null, FS_TYPE, MOUNT_POINT); |
break; |
case EBUSY: |
TPRINTF("(INFO) Filesystem already mounted on %s\n", MOUNT_POINT); |
break; |
default: |
TPRINTF("(ERR) IPC returned errno %d (is tmpfs loaded?)\n", rc); |
return "mount() failed"; |
} |
if (mkdir(TEST_DIRECTORY, 0) != 0) |
return "mkdir() failed"; |
TPRINTF("Created directory %s\n", TEST_DIRECTORY); |
int fd0 = open(TEST_FILE, O_CREAT); |
if (fd0 < 0) |
return "open() failed"; |
TPRINTF("Created file %s (fd=%d)\n", TEST_FILE, fd0); |
size_t size = sizeof(text); |
ssize_t cnt = write(fd0, text, size); |
if (cnt < 0) |
return "write() failed"; |
TPRINTF("Written %d bytes\n", cnt); |
if (lseek(fd0, 0, SEEK_SET) != 0) |
return "lseek() failed"; |
TPRINTF("Sought to position 0\n"); |
char buf[BUF_SIZE]; |
while ((cnt = read(fd0, buf, BUF_SIZE))) { |
if (cnt < 0) |
return "read() failed"; |
TPRINTF("Read %d bytes: \".*s\"\n", cnt, cnt, buf); |
} |
close(fd0); |
char *rv = read_root(); |
if (rv != NULL) |
return rv; |
if (rename(TEST_FILE, TEST_FILE2)) |
return "rename() failed"; |
TPRINTF("Renamed %s to %s\n", TEST_FILE, TEST_FILE2); |
if (unlink(TEST_FILE2)) |
return "unlink() failed"; |
TPRINTF("Unlinked %s\n", TEST_FILE2); |
if (rmdir(TEST_DIRECTORY)) |
return "rmdir() failed"; |
TPRINTF("Removed directory %s\n", TEST_DIRECTORY); |
rv = read_root(); |
if (rv != NULL) |
return rv; |
return NULL; |
} |
//branches/snapshot/uspace/app/tester/vfs/vfs1.def |
---|
0,0 → 1,6 |
{ |
"vfs1", |
"VFS test", |
&test_vfs1, |
true |
}, |
//branches/snapshot/uspace/app/tester/mm/malloc1.def |
---|
0,0 → 1,6 |
{ |
"malloc1", |
"Memory allocator test", |
&test_malloc1, |
true |
}, |
//branches/snapshot/uspace/app/tester/mm/malloc1.c |
---|
0,0 → 1,651 |
/* |
* Copyright (c) 2009 Martin Decky |
* Copyright (c) 2009 Tomas Bures |
* Copyright (c) 2009 Lubomir Bulej |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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 <stdio.h> |
#include <unistd.h> |
#include <stdlib.h> |
#include <malloc.h> |
#include "../tester.h" |
/* |
* The test consists of several phases which differ in the size of blocks |
* they allocate. The size of blocks is given as a range of minimum and |
* maximum allowed size. Each of the phases is divided into 3 subphases which |
* differ in the probability of free and alloc actions. Second subphase is |
* started when malloc returns 'out of memory' or when MAX_ALLOC is reached. |
* Third subphase is started after a given number of cycles. The third subphase |
* as well as the whole phase ends when all memory blocks are released. |
*/ |
/** |
* sizeof_array |
* @array array to determine the size of |
* |
* Returns the size of @array in array elements. |
*/ |
#define sizeof_array(array) \ |
(sizeof(array) / sizeof((array)[0])) |
#define MAX_ALLOC (16 * 1024 * 1024) |
/* |
* Subphase control structures: subphase termination conditions, |
* probabilities of individual actions, subphase control structure. |
*/ |
typedef struct { |
unsigned int max_cycles; |
unsigned int no_memory; |
unsigned int no_allocated; |
} sp_term_cond_s; |
typedef struct { |
unsigned int alloc; |
unsigned int free; |
} sp_action_prob_s; |
typedef struct { |
char *name; |
sp_term_cond_s cond; |
sp_action_prob_s prob; |
} subphase_s; |
/* |
* Phase control structures: The minimum and maximum block size that |
* can be allocated during the phase execution, phase control structure. |
*/ |
typedef struct { |
size_t min_block_size; |
size_t max_block_size; |
} ph_alloc_size_s; |
typedef struct { |
char *name; |
ph_alloc_size_s alloc; |
subphase_s *subphases; |
} phase_s; |
/* |
* Subphases are defined separately here. This is for two reasons: |
* 1) data are not duplicated, 2) we don't have to state beforehand |
* how many subphases a phase contains. |
*/ |
static subphase_s subphases_32B[] = { |
{ |
.name = "Allocation", |
.cond = { |
.max_cycles = 200, |
.no_memory = 1, |
.no_allocated = 0, |
}, |
.prob = { |
.alloc = 90, |
.free = 100 |
} |
}, |
{ |
.name = "Alloc/Dealloc", |
.cond = { |
.max_cycles = 200, |
.no_memory = 0, |
.no_allocated = 0, |
}, |
.prob = { |
.alloc = 50, |
.free = 100 |
} |
}, |
{ |
.name = "Deallocation", |
.cond = { |
.max_cycles = 0, |
.no_memory = 0, |
.no_allocated = 1, |
}, |
.prob = { |
.alloc = 10, |
.free = 100 |
} |
} |
}; |
static subphase_s subphases_128K[] = { |
{ |
.name = "Allocation", |
.cond = { |
.max_cycles = 0, |
.no_memory = 1, |
.no_allocated = 0, |
}, |
.prob = { |
.alloc = 70, |
.free = 100 |
} |
}, |
{ |
.name = "Alloc/Dealloc", |
.cond = { |
.max_cycles = 30, |
.no_memory = 0, |
.no_allocated = 0, |
}, |
.prob = { |
.alloc = 50, |
.free = 100 |
} |
}, |
{ |
.name = "Deallocation", |
.cond = { |
.max_cycles = 0, |
.no_memory = 0, |
.no_allocated = 1, |
}, |
.prob = { |
.alloc = 30, |
.free = 100 |
} |
} |
}; |
static subphase_s subphases_default[] = { |
{ |
.name = "Allocation", |
.cond = { |
.max_cycles = 0, |
.no_memory = 1, |
.no_allocated = 0, |
}, |
.prob = { |
.alloc = 90, |
.free = 100 |
} |
}, |
{ |
.name = "Alloc/Dealloc", |
.cond = { |
.max_cycles = 200, |
.no_memory = 0, |
.no_allocated = 0, |
}, |
.prob = { |
.alloc = 50, |
.free = 100 |
} |
}, |
{ |
.name = "Deallocation", |
.cond = { |
.max_cycles = 0, |
.no_memory = 0, |
.no_allocated = 1, |
}, |
.prob = { |
.alloc = 10, |
.free = 100 |
} |
} |
}; |
/* |
* Phase definitions. |
*/ |
static phase_s phases[] = { |
{ |
.name = "32 B memory blocks", |
.alloc = { |
.min_block_size = 32, |
.max_block_size = 32 |
}, |
.subphases = subphases_32B |
}, |
{ |
.name = "128 KB memory blocks", |
.alloc = { |
.min_block_size = 128 * 1024, |
.max_block_size = 128 * 1024 |
}, |
.subphases = subphases_128K |
}, |
{ |
.name = "2500 B memory blocks", |
.alloc = { |
.min_block_size = 2500, |
.max_block_size = 2500 |
}, |
.subphases = subphases_default |
}, |
{ |
.name = "1 B .. 250000 B memory blocks", |
.alloc = { |
.min_block_size = 1, |
.max_block_size = 250000 |
}, |
.subphases = subphases_default |
} |
}; |
/* |
* Global error flag. The flag is set if an error |
* is encountered (overlapping blocks, inconsistent |
* block data, etc.) |
*/ |
static bool error_flag = false; |
/* |
* Memory accounting: the amount of allocated memory and the |
* number and list of allocated blocks. |
*/ |
static size_t mem_allocated; |
static size_t mem_blocks_count; |
static LIST_INITIALIZE(mem_blocks); |
typedef struct { |
/* Address of the start of the block */ |
void *addr; |
/* Size of the memory block */ |
size_t size; |
/* link to other blocks */ |
link_t link; |
} mem_block_s; |
typedef mem_block_s *mem_block_t; |
/** init_mem |
* |
* Initializes the memory accounting structures. |
* |
*/ |
static void init_mem(void) |
{ |
mem_allocated = 0; |
mem_blocks_count = 0; |
} |
static bool overlap_match(link_t *entry, void *addr, size_t size) |
{ |
mem_block_t mblk = list_get_instance(entry, mem_block_s, link); |
/* Entry block control structure <mbeg, mend) */ |
uint8_t *mbeg = (uint8_t *) mblk; |
uint8_t *mend = (uint8_t *) mblk + sizeof(mem_block_s); |
/* Entry block memory <bbeg, bend) */ |
uint8_t *bbeg = (uint8_t *) mblk->addr; |
uint8_t *bend = (uint8_t *) mblk->addr + mblk->size; |
/* Data block <dbeg, dend) */ |
uint8_t *dbeg = (uint8_t *) addr; |
uint8_t *dend = (uint8_t *) addr + size; |
/* Check for overlaps */ |
if (((mbeg >= dbeg) && (mbeg < dend)) || |
((mend > dbeg) && (mend <= dend)) || |
((bbeg >= dbeg) && (bbeg < dend)) || |
((bend > dbeg) && (bend <= dend))) |
return true; |
return false; |
} |
/** test_overlap |
* |
* Test whether a block starting at @addr overlaps with another, previously |
* allocated memory block or its control structure. |
* |
* @param addr Initial address of the block |
* @param size Size of the block |
* |
* @return false if the block does not overlap. |
* |
*/ |
static int test_overlap(void *addr, size_t size) |
{ |
link_t *entry; |
bool fnd = false; |
for (entry = mem_blocks.next; entry != &mem_blocks; entry = entry->next) { |
if (overlap_match(entry, addr, size)) { |
fnd = true; |
break; |
} |
} |
return fnd; |
} |
/** checked_malloc |
* |
* Allocate @size bytes of memory and check whether the chunk comes |
* from the non-mapped memory region and whether the chunk overlaps |
* with other, previously allocated, chunks. |
* |
* @param size Amount of memory to allocate |
* |
* @return NULL if the allocation failed. Sets the global error_flag to |
* true if the allocation succeeded but is illegal. |
* |
*/ |
static void *checked_malloc(size_t size) |
{ |
void *data; |
/* Allocate the chunk of memory */ |
data = malloc(size); |
if (data == NULL) |
return NULL; |
/* Check for overlaps with other chunks */ |
if (test_overlap(data, size)) { |
TPRINTF("\nError: Allocated block overlaps with another " |
"previously allocated block.\n"); |
error_flag = true; |
} |
return data; |
} |
/** alloc_block |
* |
* Allocate a block of memory of @size bytes and add record about it into |
* the mem_blocks list. Return a pointer to the block holder structure or |
* NULL if the allocation failed. |
* |
* If the allocation is illegal (e.g. the memory does not come from the |
* right region or some of the allocated blocks overlap with others), |
* set the global error_flag. |
* |
* @param size Size of the memory block |
* |
*/ |
static mem_block_t alloc_block(size_t size) |
{ |
/* Check for allocation limit */ |
if (mem_allocated >= MAX_ALLOC) |
return NULL; |
/* Allocate the block holder */ |
mem_block_t block = (mem_block_t) checked_malloc(sizeof(mem_block_s)); |
if (block == NULL) |
return NULL; |
link_initialize(&block->link); |
/* Allocate the block memory */ |
block->addr = checked_malloc(size); |
if (block->addr == NULL) { |
free(block); |
return NULL; |
} |
block->size = size; |
/* Register the allocated block */ |
list_append(&block->link, &mem_blocks); |
mem_allocated += size + sizeof(mem_block_s); |
mem_blocks_count++; |
return block; |
} |
/** free_block |
* |
* Free the block of memory and the block control structure allocated by |
* alloc_block. Set the global error_flag if an error occurs. |
* |
* @param block Block control structure |
* |
*/ |
static void free_block(mem_block_t block) |
{ |
/* Unregister the block */ |
list_remove(&block->link); |
mem_allocated -= block->size + sizeof(mem_block_s); |
mem_blocks_count--; |
/* Free the memory */ |
free(block->addr); |
free(block); |
} |
/** expected_value |
* |
* Compute the expected value of a byte located at @pos in memory |
* block described by @blk. |
* |
* @param blk Memory block control structure |
* @param pos Position in the memory block data area |
* |
*/ |
static inline uint8_t expected_value(mem_block_t blk, uint8_t *pos) |
{ |
return ((unsigned long) blk ^ (unsigned long) pos) & 0xff; |
} |
/** fill_block |
* |
* Fill the memory block controlled by @blk with data. |
* |
* @param blk Memory block control structure |
* |
*/ |
static void fill_block(mem_block_t blk) |
{ |
uint8_t *pos; |
uint8_t *end; |
for (pos = blk->addr, end = pos + blk->size; pos < end; pos++) |
*pos = expected_value(blk, pos); |
} |
/** check_block |
* |
* Check whether the block @blk contains the data it was filled with. |
* Set global error_flag if an error occurs. |
* |
* @param blk Memory block control structure |
* |
*/ |
static void check_block(mem_block_t blk) |
{ |
uint8_t *pos; |
uint8_t *end; |
for (pos = blk->addr, end = pos + blk->size; pos < end; pos++) { |
if (*pos != expected_value (blk, pos)) { |
TPRINTF("\nError: Corrupted content of a data block.\n"); |
error_flag = true; |
return; |
} |
} |
} |
static link_t *list_get_nth(link_t *list, unsigned int i) |
{ |
unsigned int cnt = 0; |
link_t *entry; |
for (entry = list->next; entry != list; entry = entry->next) { |
if (cnt == i) |
return entry; |
cnt++; |
} |
return NULL; |
} |
/** get_random_block |
* |
* Select a random memory block from the list of allocated blocks. |
* |
* @return Block control structure or NULL if the list is empty. |
* |
*/ |
static mem_block_t get_random_block(void) |
{ |
if (mem_blocks_count == 0) |
return NULL; |
unsigned int blkidx = rand() % mem_blocks_count; |
link_t *entry = list_get_nth(&mem_blocks, blkidx); |
if (entry == NULL) { |
TPRINTF("\nError: Corrupted list of allocated memory blocks.\n"); |
error_flag = true; |
} |
return list_get_instance(entry, mem_block_s, link); |
} |
#define RETURN_IF_ERROR \ |
{ \ |
if (error_flag) \ |
return; \ |
} |
static void do_subphase(phase_s *phase, subphase_s *subphase) |
{ |
unsigned int cycles; |
for (cycles = 0; /* always */; cycles++) { |
if (subphase->cond.max_cycles && |
cycles >= subphase->cond.max_cycles) { |
/* |
* We have performed the required number of |
* cycles. End the current subphase. |
*/ |
break; |
} |
/* |
* Decide whether we alloc or free memory in this step. |
*/ |
unsigned int rnd = rand() % 100; |
if (rnd < subphase->prob.alloc) { |
/* Compute a random number lying in interval <min_block_size, max_block_size> */ |
int alloc = phase->alloc.min_block_size + |
(rand() % (phase->alloc.max_block_size - phase->alloc.min_block_size + 1)); |
mem_block_t blk = alloc_block(alloc); |
RETURN_IF_ERROR; |
if (blk == NULL) { |
TPRINTF("F(A)"); |
if (subphase->cond.no_memory) { |
/* We filled the memory. Proceed to next subphase */ |
break; |
} |
} else { |
TPRINTF("A"); |
fill_block(blk); |
} |
} else if (rnd < subphase->prob.free) { |
mem_block_t blk = get_random_block(); |
if (blk == NULL) { |
TPRINTF("F(R)"); |
if (subphase->cond.no_allocated) { |
/* We free all the memory. Proceed to next subphase. */ |
break; |
} |
} else { |
TPRINTF("R"); |
check_block(blk); |
RETURN_IF_ERROR; |
free_block(blk); |
RETURN_IF_ERROR; |
} |
} |
} |
TPRINTF("\n.. finished.\n"); |
} |
static void do_phase(phase_s *phase) |
{ |
unsigned int subno; |
for (subno = 0; subno < 3; subno++) { |
subphase_s *subphase = & phase->subphases [subno]; |
TPRINTF(".. Sub-phase %u (%s)\n", subno + 1, subphase->name); |
do_subphase(phase, subphase); |
RETURN_IF_ERROR; |
} |
} |
char *test_malloc1(void) |
{ |
init_mem(); |
unsigned int phaseno; |
for (phaseno = 0; phaseno < sizeof_array(phases); phaseno++) { |
phase_s *phase = &phases[phaseno]; |
TPRINTF("Entering phase %u (%s)\n", phaseno + 1, phase->name); |
do_phase(phase); |
if (error_flag) |
break; |
TPRINTF("Phase finished.\n"); |
} |
if (error_flag) |
return "Test failed"; |
return NULL; |
} |
//branches/snapshot/uspace/app/init/init.c |
---|
0,0 → 1,218 |
/* |
* Copyright (c) 2005 Martin Decky |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup init Init |
* @brief Init process for user space environment configuration. |
* @{ |
*/ |
/** |
* @file |
*/ |
#include <stdio.h> |
#include <unistd.h> |
#include <ipc/ipc.h> |
#include <vfs/vfs.h> |
#include <bool.h> |
#include <errno.h> |
#include <fcntl.h> |
#include <task.h> |
#include <malloc.h> |
#include <macros.h> |
#include <string.h> |
#include <devmap.h> |
#include "init.h" |
static void info_print(void) |
{ |
printf(NAME ": HelenOS init\n"); |
} |
static bool mount_root(const char *fstype) |
{ |
char *opts = ""; |
const char *root_dev = "initrd"; |
if (str_cmp(fstype, "tmpfs") == 0) |
opts = "restore"; |
int rc = mount(fstype, "/", root_dev, opts, IPC_FLAG_BLOCKING); |
switch (rc) { |
case EOK: |
printf(NAME ": Root filesystem mounted, %s at %s\n", |
fstype, root_dev); |
break; |
case EBUSY: |
printf(NAME ": Root filesystem already mounted\n"); |
return false; |
case ELIMIT: |
printf(NAME ": Unable to mount root filesystem\n"); |
return false; |
case ENOENT: |
printf(NAME ": Unknown filesystem type (%s)\n", fstype); |
return false; |
default: |
printf(NAME ": Error mounting root filesystem (%d)\n", rc); |
return false; |
} |
return true; |
} |
static bool mount_devfs(void) |
{ |
char null[MAX_DEVICE_NAME]; |
int null_id = devmap_null_create(); |
if (null_id == -1) { |
printf(NAME ": Unable to create null device\n"); |
return false; |
} |
snprintf(null, MAX_DEVICE_NAME, "null%d", null_id); |
int rc = mount("devfs", "/dev", null, "", IPC_FLAG_BLOCKING); |
switch (rc) { |
case EOK: |
printf(NAME ": Device filesystem mounted\n"); |
break; |
case EBUSY: |
printf(NAME ": Device filesystem already mounted\n"); |
devmap_null_destroy(null_id); |
return false; |
case ELIMIT: |
printf(NAME ": Unable to mount device filesystem\n"); |
devmap_null_destroy(null_id); |
return false; |
case ENOENT: |
printf(NAME ": Unknown filesystem type (devfs)\n"); |
devmap_null_destroy(null_id); |
return false; |
default: |
printf(NAME ": Error mounting device filesystem (%d)\n", rc); |
devmap_null_destroy(null_id); |
return false; |
} |
return true; |
} |
static void spawn(char *fname) |
{ |
char *argv[2]; |
printf(NAME ": Spawning %s\n", fname); |
argv[0] = fname; |
argv[1] = NULL; |
if (!task_spawn(fname, argv)) |
printf(NAME ": Error spawning %s\n", fname); |
} |
static void getvc(char *dev, char *app) |
{ |
char *argv[4]; |
char vc[MAX_DEVICE_NAME]; |
int rc; |
snprintf(vc, MAX_DEVICE_NAME, "/dev/%s", dev); |
printf(NAME ": Spawning getvc on %s\n", vc); |
dev_handle_t handle; |
rc = devmap_device_get_handle(dev, &handle, IPC_FLAG_BLOCKING); |
if (rc == EOK) { |
argv[0] = "/app/getvc"; |
argv[1] = vc; |
argv[2] = app; |
argv[3] = NULL; |
if (!task_spawn("/app/getvc", argv)) |
printf(NAME ": Error spawning getvc on %s\n", vc); |
} else { |
printf(NAME ": Error waiting on %s\n", vc); |
} |
} |
void mount_data(void) |
{ |
int rc; |
printf("Trying to mount disk0 on /data... "); |
fflush(stdout); |
rc = mount("fat", "/data", "disk0", "wtcache", 0); |
if (rc == EOK) |
printf("OK\n"); |
else |
printf("Failed\n"); |
} |
int main(int argc, char *argv[]) |
{ |
info_print(); |
if (!mount_root(STRING(RDFMT))) { |
printf(NAME ": Exiting\n"); |
return -1; |
} |
spawn("/srv/devfs"); |
if (!mount_devfs()) { |
printf(NAME ": Exiting\n"); |
return -2; |
} |
spawn("/srv/fb"); |
spawn("/srv/kbd"); |
spawn("/srv/console"); |
spawn("/srv/fhc"); |
spawn("/srv/obio"); |
spawn("/srv/ata_bd"); |
spawn("/srv/gxe_bd"); |
usleep(250000); // FIXME |
mount_data(); |
getvc("vc0", "/app/bdsh"); |
getvc("vc1", "/app/bdsh"); |
getvc("vc2", "/app/bdsh"); |
getvc("vc3", "/app/bdsh"); |
getvc("vc4", "/app/bdsh"); |
getvc("vc5", "/app/bdsh"); |
getvc("vc6", "/app/klog"); |
return 0; |
} |
/** @} |
*/ |
//branches/snapshot/uspace/app/init/init.h |
---|
0,0 → 1,46 |
/* |
* Copyright (c) 2006 Martin Decky |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup init |
* @{ |
*/ |
/** |
* @file |
*/ |
#ifndef __INIT_H__ |
#define __INIT_H__ |
#define NAME "init" |
#define MAX_DEVICE_NAME 32 |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/app/init/Makefile |
---|
0,0 → 1,75 |
# |
# Copyright (c) 2005 Martin Decky |
# All rights reserved. |
# |
# Redistribution and use in source and binary forms, with or without |
# modification, are permitted provided that the following conditions |
# are met: |
# |
# - Redistributions of source code must retain the above copyright |
# notice, this list of conditions and the following disclaimer. |
# - 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. |
# - The name of the author may not be used to endorse or promote products |
# derived from this software without specific prior written permission. |
# |
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
# |
## Setup toolchain |
# |
LIBC_PREFIX = ../../lib/libc |
SOFTINT_PREFIX = ../../lib/softint |
include $(LIBC_PREFIX)/Makefile.toolchain |
LIBS = $(LIBC_PREFIX)/libc.a |
## Sources |
# |
OUTPUT = init |
SOURCES = \ |
init.c |
OBJECTS := $(addsuffix .o,$(basename $(SOURCES))) |
.PHONY: all clean depend disasm |
all: $(OUTPUT) $(OUTPUT).disasm |
-include Makefile.depend |
clean: |
-rm -f $(OUTPUT) $(OUTPUT).map $(OUTPUT).disasm Makefile.depend $(OBJECTS) |
depend: |
$(CC) $(DEFS) $(CFLAGS) -M $(SOURCES) > Makefile.depend |
$(OUTPUT): $(OBJECTS) $(LIBS) |
$(LD) -T $(LIBC_PREFIX)/arch/$(UARCH)/_link.ld $(OBJECTS) $(LIBS) $(LFLAGS) -o $@ -Map $(OUTPUT).map |
disasm: $(OUTPUT).disasm |
$(OUTPUT).disasm: $(OUTPUT) |
$(OBJDUMP) -d $< > $@ |
%.o: %.S |
$(CC) $(DEFS) $(AFLAGS) $(CFLAGS) -D__ASM__ -c $< -o $@ |
%.o: %.s |
$(AS) $(AFLAGS) $< -o $@ |
%.o: %.c |
$(CC) $(DEFS) $(CFLAGS) -c $< -o $@ |
//branches/snapshot/uspace/app/bdsh/cmds/modules/ls/ls.c |
---|
0,0 → 1,165 |
/* Copyright (c) 2008, Tim Post <tinkertim@gmail.com> |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions are met: |
* |
* Redistributions of source code must retain the above copyright notice, this |
* list of conditions and the following disclaimer. |
* |
* 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. |
* |
* Neither the name of the original program's authors 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 OWNER 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. |
*/ |
/* NOTE: |
* This is a bit of an ugly hack, working around the absence of fstat / etc. |
* As more stuff is completed and exposed in libc, this will improve */ |
#include <stdio.h> |
#include <stdlib.h> |
#include <unistd.h> |
#include <dirent.h> |
#include <fcntl.h> |
#include <sys/types.h> |
#include <sys/stat.h> |
#include <string.h> |
#include "errors.h" |
#include "config.h" |
#include "util.h" |
#include "entry.h" |
#include "ls.h" |
#include "cmds.h" |
static char *cmdname = "ls"; |
static void ls_scan_dir(const char *d, DIR *dirp) |
{ |
struct dirent *dp; |
char *buff; |
if (! dirp) |
return; |
buff = (char *)malloc(PATH_MAX); |
if (NULL == buff) { |
cli_error(CL_ENOMEM, "ls: failed to scan %s", d); |
return; |
} |
while ((dp = readdir(dirp))) { |
memset(buff, 0, sizeof(buff)); |
/* Don't worry if inserting a double slash, this will be fixed by |
* absolutize() later with subsequent calls to open() or readdir() */ |
snprintf(buff, PATH_MAX - 1, "%s/%s", d, dp->d_name); |
ls_print(dp->d_name, buff); |
} |
free(buff); |
return; |
} |
/* ls_print currently does nothing more than print the entry. |
* in the future, we will likely pass the absolute path, and |
* some sort of ls_options structure that controls how each |
* entry is printed and what is printed about it. |
* |
* Now we just print basic DOS style lists */ |
static void ls_print(const char *name, const char *pathname) |
{ |
struct stat s; |
int rc; |
if (rc = stat(pathname, &s)) { |
/* Odd chance it was deleted from the time readdir() found it */ |
printf("ls: skipping bogus node %s\n", pathname); |
printf("rc=%d\n", rc); |
return; |
} |
if (s.is_file) |
printf("%-40s\t%llu\n", name, (long long) s.size); |
else |
printf("%-40s\n", name); |
return; |
} |
void help_cmd_ls(unsigned int level) |
{ |
if (level == HELP_SHORT) { |
printf("`%s' lists files and directories.\n", cmdname); |
} else { |
help_cmd_ls(HELP_SHORT); |
printf(" `%s' [path], if no path is given the current " |
"working directory is used.\n", cmdname); |
} |
return; |
} |
int cmd_ls(char **argv) |
{ |
unsigned int argc; |
struct stat s; |
char *buff; |
DIR *dirp; |
argc = cli_count_args(argv); |
buff = (char *) malloc(PATH_MAX); |
if (NULL == buff) { |
cli_error(CL_ENOMEM, "%s: ", cmdname); |
return CMD_FAILURE; |
} |
memset(buff, 0, sizeof(buff)); |
if (argc == 1) |
getcwd(buff, PATH_MAX); |
else |
str_cpy(buff, PATH_MAX, argv[1]); |
if (stat(buff, &s)) { |
cli_error(CL_ENOENT, buff); |
free(buff); |
return CMD_FAILURE; |
} |
if (s.is_file) { |
ls_print(buff, buff); |
} else { |
dirp = opendir(buff); |
if (!dirp) { |
/* May have been deleted between scoping it and opening it */ |
cli_error(CL_EFAIL, "Could not stat %s", buff); |
free(buff); |
return CMD_FAILURE; |
} |
ls_scan_dir(buff, dirp); |
closedir(dirp); |
} |
free(buff); |
return CMD_SUCCESS; |
} |
//branches/snapshot/uspace/app/bdsh/cmds/modules/ls/ls.h |
---|
0,0 → 1,15 |
#ifndef LS_H |
#define LS_H |
/* Various values that can be returned by ls_scope() */ |
#define LS_BOGUS 0 |
#define LS_FILE 1 |
#define LS_DIR 2 |
static unsigned int ls_scope(const char *); |
static void ls_scan_dir(const char *, DIR *); |
static void ls_print(const char *, const char *); |
#endif /* LS_H */ |
//branches/snapshot/uspace/app/bdsh/cmds/modules/ls/ls_def.h |
---|
0,0 → 1,6 |
{ |
"ls", |
"List files and directories", |
&cmd_ls, |
&help_cmd_ls, |
}, |
//branches/snapshot/uspace/app/bdsh/cmds/modules/ls/entry.h |
---|
0,0 → 1,9 |
#ifndef LS_ENTRY_H |
#define LS_ENTRY_H |
/* Entry points for the ls command */ |
extern int cmd_ls(char **); |
extern void help_cmd_ls(unsigned int); |
#endif /* LS_ENTRY_H */ |
//branches/snapshot/uspace/app/bdsh/cmds/modules/bdd/bdd.c |
---|
0,0 → 1,154 |
/* |
* Copyright (c) 2009 Jiri Svoboda |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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 <stdio.h> |
#include <stdlib.h> |
#include <string.h> |
#include "config.h" |
#include "util.h" |
#include "errors.h" |
#include "entry.h" |
#include "bdd.h" |
#include "cmds.h" |
#include <libblock.h> |
#include <devmap.h> |
#include <errno.h> |
#define BLOCK_SIZE 512 |
#define BPR 16 |
static const char *cmdname = "bdd"; |
/* Dispays help for bdd in various levels */ |
void help_cmd_bdd(unsigned int level) |
{ |
static char helpfmt[] = |
"Usage: %s <device> [<block_number> [<bytes>]]\n"; |
if (level == HELP_SHORT) { |
printf("'%s' dump block device contents.\n", cmdname); |
} else { |
help_cmd_bdd(HELP_SHORT); |
printf(helpfmt, cmdname); |
} |
return; |
} |
/* Main entry point for bdd, accepts an array of arguments */ |
int cmd_bdd(char **argv) |
{ |
unsigned int argc; |
unsigned int i, j; |
dev_handle_t handle; |
block_t *block; |
uint8_t *blk; |
size_t size, bytes, rows; |
int rc; |
bn_t boff; |
uint8_t b; |
/* Count the arguments */ |
for (argc = 0; argv[argc] != NULL; argc ++); |
if (argc < 2 || argc > 4) { |
printf("%s - incorrect number of arguments.\n", cmdname); |
return CMD_FAILURE; |
} |
if (argc >= 3) |
boff = strtol(argv[2], NULL, 0); |
else |
boff = 0; |
if (argc >= 4) |
size = strtol(argv[3], NULL, 0); |
else |
size = 256; |
rc = devmap_device_get_handle(argv[1], &handle, 0); |
if (rc != EOK) { |
printf("Error: could not resolve device `%s'.\n", argv[1]); |
return CMD_FAILURE; |
} |
rc = block_init(handle, BLOCK_SIZE); |
if (rc != EOK) { |
printf("Error: could not init libblock.\n"); |
return CMD_FAILURE; |
} |
rc = block_cache_init(handle, BLOCK_SIZE, 2, CACHE_MODE_WB); |
if (rc != EOK) { |
printf("Error: could not init block cache.\n"); |
return CMD_FAILURE; |
} |
while (size > 0) { |
block = block_get(handle, boff, 0); |
blk = (uint8_t *) block->data; |
bytes = (size < BLOCK_SIZE) ? size : BLOCK_SIZE; |
rows = (bytes + BPR - 1) / BPR; |
for (j = 0; j < rows; j++) { |
for (i = 0; i < BPR; i++) { |
if (j * BPR + i < bytes) |
printf("%02x ", blk[j * BPR + i]); |
else |
printf(" "); |
} |
putchar('\t'); |
for (i = 0; i < BPR; i++) { |
if (j * BPR + i < bytes) { |
b = blk[j * BPR + i]; |
if (b >= 32 && b < 127) |
putchar(b); |
else |
putchar(' '); |
} else { |
putchar(' '); |
} |
} |
putchar('\n'); |
} |
block_put(block); |
if (size > rows * BPR) |
size -= rows * BPR; |
else |
size = 0; |
boff += rows * BPR; |
} |
block_fini(handle); |
return CMD_SUCCESS; |
} |
//branches/snapshot/uspace/app/bdsh/cmds/modules/bdd/bdd.h |
---|
0,0 → 1,8 |
#ifndef BDD_H |
#define BDD_H |
/* Prototypes for the bdd command, excluding entry points */ |
#endif /* BDD_H */ |
//branches/snapshot/uspace/app/bdsh/cmds/modules/bdd/entry.h |
---|
0,0 → 1,9 |
#ifndef BDD_ENTRY_H |
#define BDD_ENTRY_H |
/* Entry points for the bdd command */ |
extern int cmd_bdd(char **); |
extern void help_cmd_bdd(unsigned int); |
#endif /* BDD_ENTRY_H */ |
//branches/snapshot/uspace/app/bdsh/cmds/modules/bdd/bdd_def.h |
---|
0,0 → 1,7 |
{ |
"bdd", |
"Dump block device contents", |
&cmd_bdd, |
&help_cmd_bdd, |
}, |
//branches/snapshot/uspace/app/bdsh/cmds/modules/kcon/kcon.c |
---|
0,0 → 1,73 |
/* Copyright (c) 2008, Tim Post <tinkertim@gmail.com> |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions are met: |
* |
* Redistributions of source code must retain the above copyright notice, this |
* list of conditions and the following disclaimer. |
* |
* 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. |
* |
* Neither the name of the original program's authors 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 OWNER 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 <stdio.h> |
#include <stdlib.h> |
#include <io/console.h> |
#include <vfs/vfs.h> |
#include "config.h" |
#include "util.h" |
#include "errors.h" |
#include "entry.h" |
#include "kcon.h" |
#include "cmds.h" |
static char *cmdname = "kcon"; |
/* Dispays help for kcon in various levels */ |
void help_cmd_kcon(unsigned int level) |
{ |
printf("`kcon' switches to the kernel debug console.\n"); |
if (level != HELP_SHORT) { |
printf("Usage: %s\n", cmdname); |
} |
return; |
} |
/* Main entry point for kcon, accepts an array of arguments */ |
int cmd_kcon(char **argv) |
{ |
unsigned int argc; |
argc = cli_count_args(argv); |
if (argc != 1) { |
printf("%s - incorrect number of arguments. Try `%s --help'\n", |
cmdname, cmdname); |
return CMD_FAILURE; |
} |
console_kcon_enable(fphone(stdout)); |
return CMD_SUCCESS; |
} |
//branches/snapshot/uspace/app/bdsh/cmds/modules/kcon/kcon.h |
---|
0,0 → 1,8 |
#ifndef KCON_H |
#define KCON_H |
/* Prototypes for the kcon command, excluding entry points */ |
#endif /* KCON_H */ |
//branches/snapshot/uspace/app/bdsh/cmds/modules/kcon/entry.h |
---|
0,0 → 1,9 |
#ifndef KCON_ENTRY_H |
#define KCON_ENTRY_H |
/* Entry points for the kcon command */ |
extern int cmd_kcon(char **); |
extern void help_cmd_kcon(unsigned int); |
#endif /* KCON_ENTRY_H */ |
//branches/snapshot/uspace/app/bdsh/cmds/modules/kcon/kcon_def.h |
---|
0,0 → 1,7 |
{ |
"kcon", |
"Switch to kernel console", |
&cmd_kcon, |
&help_cmd_kcon, |
}, |
//branches/snapshot/uspace/app/bdsh/cmds/modules/pwd/pwd.c |
---|
0,0 → 1,72 |
/* Copyright (c) 2008, Tim Post <tinkertim@gmail.com> |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions are met: |
* |
* Redistributions of source code must retain the above copyright notice, this |
* list of conditions and the following disclaimer. |
* |
* 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. |
* |
* Neither the name of the original program's authors 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 OWNER 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 <stdio.h> |
#include <stdlib.h> |
#include <mem.h> |
#include "config.h" |
#include "errors.h" |
#include "entry.h" |
#include "cmds.h" |
#include "pwd.h" |
static char * cmdname = "pwd"; |
void help_cmd_pwd(unsigned int level) |
{ |
printf("`%s' prints your current working directory.\n", cmdname); |
return; |
} |
int cmd_pwd(char *argv[]) |
{ |
char *buff; |
buff = (char *) malloc(PATH_MAX); |
if (NULL == buff) { |
cli_error(CL_ENOMEM, "%s:", cmdname); |
return CMD_FAILURE; |
} |
memset(buff, 0, sizeof(buff)); |
getcwd(buff, PATH_MAX); |
if (! buff) { |
cli_error(CL_EFAIL, |
"Unable to determine the current working directory"); |
free(buff); |
return CMD_FAILURE; |
} else { |
printf("%s\n", buff); |
free(buff); |
return CMD_SUCCESS; |
} |
} |
//branches/snapshot/uspace/app/bdsh/cmds/modules/pwd/pwd_def.h |
---|
0,0 → 1,6 |
{ |
"pwd", |
"Prints the current working directory", |
&cmd_pwd, |
&help_cmd_pwd, |
}, |
//branches/snapshot/uspace/app/bdsh/cmds/modules/pwd/entry.h |
---|
0,0 → 1,12 |
#ifndef PWD_ENTRY_H |
#define PWD_ENTRY_H |
#include "scli.h" |
/* Entry points for the pwd command */ |
extern void help_cmd_pwd(unsigned int); |
extern int cmd_pwd(char **); |
#endif |
//branches/snapshot/uspace/app/bdsh/cmds/modules/pwd/pwd.h |
---|
0,0 → 1,6 |
#ifndef PWD_H_ |
#define PWD_H_ |
/* Prototypes for the pwd command (excluding entry points) */ |
#endif |
//branches/snapshot/uspace/app/bdsh/cmds/modules/mkdir/mkdir.c |
---|
0,0 → 1,252 |
/* Copyright (c) 2008, Tim Post <tinkertim@gmail.com> |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions are met: |
* |
* Redistributions of source code must retain the above copyright notice, this |
* list of conditions and the following disclaimer. |
* |
* 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. |
* |
* Neither the name of the original program's authors 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 OWNER 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 <stdio.h> |
#include <stdlib.h> |
#include <dirent.h> |
#include <fcntl.h> |
#include <sys/types.h> |
#include <sys/stat.h> |
#include <getopt.h> |
#include <stdarg.h> |
#include <string.h> |
#include "config.h" |
#include "errors.h" |
#include "util.h" |
#include "entry.h" |
#include "mkdir.h" |
#include "cmds.h" |
#define MKDIR_VERSION "0.0.1" |
static char *cmdname = "mkdir"; |
static struct option const long_options[] = { |
{"parents", no_argument, 0, 'p'}, |
{"verbose", no_argument, 0, 'v'}, |
{"mode", required_argument, 0, 'm'}, |
{"help", no_argument, 0, 'h'}, |
{"version", no_argument, 0, 'V'}, |
{"follow", no_argument, 0, 'f'}, |
{0, 0, 0, 0} |
}; |
void help_cmd_mkdir(unsigned int level) |
{ |
if (level == HELP_SHORT) { |
printf("`%s' creates a new directory\n", cmdname); |
} else { |
help_cmd_mkdir(HELP_SHORT); |
printf( |
"Usage: %s [options] <path>\n" |
"Options:\n" |
" -h, --help A short option summary\n" |
" -V, --version Print version information and exit\n" |
" -p, --parents Create needed parents for <path>\n" |
" -m, --mode Set permissions to [mode] (UNUSED)\n" |
" -v, --verbose Be extremely noisy about what is happening\n" |
" -f, --follow Go to the new directory once created\n" |
"Currently, %s is under development, some options don't work.\n", |
cmdname, cmdname); |
} |
return; |
} |
/* This is kind of clunky, but effective for now */ |
static unsigned int |
create_directory(const char *path, unsigned int p) |
{ |
DIR *dirp; |
char *tmp = NULL, *buff = NULL, *wdp = NULL; |
char *dirs[255]; |
unsigned int absolute = 0, i = 0, ret = 0; |
/* Its a good idea to allocate path, plus we (may) need a copy of |
* path to tokenize if parents are specified */ |
if (NULL == (tmp = str_dup(path))) { |
cli_error(CL_ENOMEM, "%s: path too big?", cmdname); |
return 1; |
} |
if (NULL == (wdp = (char *) malloc(PATH_MAX))) { |
cli_error(CL_ENOMEM, "%s: could not alloc cwd", cmdname); |
free(tmp); |
return 1; |
} |
/* The only reason for wdp is to be (optionally) verbose */ |
getcwd(wdp, PATH_MAX); |
/* Typical use without specifying the creation of parents */ |
if (p == 0) { |
dirp = opendir(tmp); |
if (dirp) { |
cli_error(CL_EEXISTS, "%s: can not create %s, try -p", cmdname, path); |
closedir(dirp); |
goto finit; |
} |
if (-1 == (mkdir(tmp, 0))) { |
cli_error(CL_EFAIL, "%s: could not create %s", cmdname, path); |
goto finit; |
} |
} |
/* Parents need to be created, path has to be broken up */ |
/* See if path[0] is a slash, if so we have to remember to append it */ |
if (tmp[0] == '/') |
absolute = 1; |
/* TODO: Canonify the path prior to tokenizing it, see below */ |
dirs[i] = strtok(tmp, "/"); |
while (dirs[i] && i < 255) |
dirs[++i] = strtok(NULL, "/"); |
if (NULL == dirs[0]) |
return 1; |
if (absolute == 1) { |
asprintf(&buff, "/%s", dirs[0]); |
mkdir(buff, 0); |
chdir(buff); |
free(buff); |
getcwd(wdp, PATH_MAX); |
i = 1; |
} else { |
i = 0; |
} |
while (dirs[i] != NULL) { |
/* Sometimes make or scripts conjoin odd paths. Account for something |
* like this: ../../foo/bar/../foo/foofoo/./bar */ |
if (!str_cmp(dirs[i], "..") || !str_cmp(dirs[i], ".")) { |
if (0 != (chdir(dirs[i]))) { |
cli_error(CL_EFAIL, "%s: impossible path: %s", |
cmdname, path); |
ret ++; |
goto finit; |
} |
getcwd(wdp, PATH_MAX); |
} else { |
if (-1 == (mkdir(dirs[i], 0))) { |
cli_error(CL_EFAIL, |
"%s: failed at %s/%s", wdp, dirs[i]); |
ret ++; |
goto finit; |
} |
if (0 != (chdir(dirs[i]))) { |
cli_error(CL_EFAIL, "%s: failed creating %s\n", |
cmdname, dirs[i]); |
ret ++; |
break; |
} |
} |
i++; |
} |
goto finit; |
finit: |
free(wdp); |
free(tmp); |
return ret; |
} |
int cmd_mkdir(char **argv) |
{ |
unsigned int argc, create_parents = 0, i, ret = 0, follow = 0; |
unsigned int verbose = 0; |
int c, opt_ind; |
char *cwd; |
argc = cli_count_args(argv); |
for (c = 0, optind = 0, opt_ind = 0; c != -1;) { |
c = getopt_long(argc, argv, "pvhVfm:", long_options, &opt_ind); |
switch (c) { |
case 'p': |
create_parents = 1; |
break; |
case 'v': |
verbose = 1; |
break; |
case 'h': |
help_cmd_mkdir(HELP_LONG); |
return CMD_SUCCESS; |
case 'V': |
printf("%s\n", MKDIR_VERSION); |
return CMD_SUCCESS; |
case 'f': |
follow = 1; |
break; |
case 'm': |
printf("%s: [W] Ignoring mode %s\n", cmdname, optarg); |
break; |
} |
} |
argc -= optind; |
if (argc < 1) { |
printf("%s - incorrect number of arguments. Try `%s --help'\n", |
cmdname, cmdname); |
return CMD_FAILURE; |
} |
if (NULL == (cwd = (char *) malloc(PATH_MAX))) { |
cli_error(CL_ENOMEM, "%s: could not allocate cwd", cmdname); |
return CMD_FAILURE; |
} |
memset(cwd, 0, sizeof(cwd)); |
getcwd(cwd, PATH_MAX); |
for (i = optind; argv[i] != NULL; i++) { |
if (verbose == 1) |
printf("%s: creating %s%s\n", |
cmdname, argv[i], |
create_parents ? " (and all parents)" : ""); |
ret += create_directory(argv[i], create_parents); |
} |
if (follow == 0) |
chdir(cwd); |
free(cwd); |
if (ret) |
return CMD_FAILURE; |
else |
return CMD_SUCCESS; |
} |
//branches/snapshot/uspace/app/bdsh/cmds/modules/mkdir/mkdir_def.h |
---|
0,0 → 1,8 |
{ |
"mkdir", |
"Create new directories", |
&cmd_mkdir, |
&help_cmd_mkdir, |
}, |
//branches/snapshot/uspace/app/bdsh/cmds/modules/mkdir/entry.h |
---|
0,0 → 1,9 |
#ifndef MKDIR_ENTRY_H |
#define MKDIR_ENTRY_H |
/* Entry points for the mkdir command */ |
extern int cmd_mkdir(char **); |
extern void help_cmd_mkdir(unsigned int); |
#endif /* MKDIR_ENTRY_H */ |
//branches/snapshot/uspace/app/bdsh/cmds/modules/mkdir/mkdir.h |
---|
0,0 → 1,8 |
#ifndef MKDIR_H |
#define MKDIR_H |
/* Prototypes for the mkdir command, excluding entry points */ |
static unsigned int create_directory(const char *, unsigned int); |
#endif /* MKDIR_H */ |
//branches/snapshot/uspace/app/bdsh/cmds/modules/rm/rm.c |
---|
0,0 → 1,259 |
/* Copyright (c) 2008, Tim Post <tinkertim@gmail.com> |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions are met: |
* |
* Redistributions of source code must retain the above copyright notice, this |
* list of conditions and the following disclaimer. |
* |
* 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. |
* |
* Neither the name of the original program's authors 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 OWNER 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 <stdio.h> |
#include <stdlib.h> |
#include <unistd.h> |
#include <fcntl.h> |
#include <dirent.h> |
#include <getopt.h> |
#include <mem.h> |
#include <string.h> |
#include "config.h" |
#include "errors.h" |
#include "util.h" |
#include "entry.h" |
#include "rm.h" |
#include "cmds.h" |
static char *cmdname = "rm"; |
#define RM_VERSION "0.0.1" |
static rm_job_t rm; |
static struct option const long_options[] = { |
{ "help", no_argument, 0, 'h' }, |
{ "version", no_argument, 0, 'v' }, |
{ "recursive", no_argument, 0, 'r' }, |
{ "force", no_argument, 0, 'f' }, |
{ "safe", no_argument, 0, 's' }, |
{ 0, 0, 0, 0 } |
}; |
static unsigned int rm_start(rm_job_t *rm) |
{ |
rm->recursive = 0; |
rm->force = 0; |
rm->safe = 0; |
/* Make sure we can allocate enough memory to store |
* what is needed in the job structure */ |
if (NULL == (rm->nwd = (char *) malloc(PATH_MAX))) |
return 0; |
memset(rm->nwd, 0, sizeof(rm->nwd)); |
if (NULL == (rm->owd = (char *) malloc(PATH_MAX))) |
return 0; |
memset(rm->owd, 0, sizeof(rm->owd)); |
if (NULL == (rm->cwd = (char *) malloc(PATH_MAX))) |
return 0; |
memset(rm->cwd, 0, sizeof(rm->cwd)); |
chdir("."); |
if (NULL == (getcwd(rm->owd, PATH_MAX))) |
return 0; |
return 1; |
} |
static void rm_end(rm_job_t *rm) |
{ |
if (NULL != rm->nwd) |
free(rm->nwd); |
if (NULL != rm->owd) |
free(rm->owd); |
if (NULL != rm->cwd) |
free(rm->cwd); |
return; |
} |
static unsigned int rm_recursive(const char *path) |
{ |
int rc; |
/* First see if it will just go away */ |
rc = rmdir(path); |
if (rc == 0) |
return 0; |
/* Its not empty, recursively scan it */ |
cli_error(CL_ENOTSUP, |
"Can not remove %s, directory not empty", path); |
return 1; |
} |
static unsigned int rm_single(const char *path) |
{ |
if (unlink(path)) { |
cli_error(CL_EFAIL, "rm: could not remove file %s", path); |
return 1; |
} |
return 0; |
} |
static unsigned int rm_scope(const char *path) |
{ |
int fd; |
DIR *dirp; |
dirp = opendir(path); |
if (dirp) { |
closedir(dirp); |
return RM_DIR; |
} |
fd = open(path, O_RDONLY); |
if (fd > 0) { |
close(fd); |
return RM_FILE; |
} |
return RM_BOGUS; |
} |
/* Dispays help for rm in various levels */ |
void help_cmd_rm(unsigned int level) |
{ |
if (level == HELP_SHORT) { |
printf("`%s' removes files and directories.\n", cmdname); |
} else { |
help_cmd_rm(HELP_SHORT); |
printf( |
"Usage: %s [options] <path>\n" |
"Options:\n" |
" -h, --help A short option summary\n" |
" -v, --version Print version information and exit\n" |
" -r, --recursive Recursively remove sub directories\n" |
" -f, --force Do not prompt prior to removing files\n" |
" -s, --safe Stop if directories change during removal\n\n" |
"Currently, %s is under development, some options don't work.\n", |
cmdname, cmdname); |
} |
return; |
} |
/* Main entry point for rm, accepts an array of arguments */ |
int cmd_rm(char **argv) |
{ |
unsigned int argc; |
unsigned int i, scope, ret = 0; |
int c, opt_ind; |
size_t len; |
char *buff = NULL; |
argc = cli_count_args(argv); |
if (argc < 2) { |
cli_error(CL_EFAIL, |
"%s: insufficient arguments. Try %s --help", cmdname, cmdname); |
return CMD_FAILURE; |
} |
if (!rm_start(&rm)) { |
cli_error(CL_ENOMEM, "%s: could not initialize", cmdname); |
rm_end(&rm); |
return CMD_FAILURE; |
} |
for (c = 0, optind = 0, opt_ind = 0; c != -1;) { |
c = getopt_long(argc, argv, "hvrfs", long_options, &opt_ind); |
switch (c) { |
case 'h': |
help_cmd_rm(HELP_LONG); |
return CMD_SUCCESS; |
case 'v': |
printf("%s\n", RM_VERSION); |
return CMD_SUCCESS; |
case 'r': |
rm.recursive = 1; |
break; |
case 'f': |
rm.force = 1; |
break; |
case 's': |
rm.safe = 1; |
break; |
} |
} |
if (optind == argc) { |
cli_error(CL_EFAIL, |
"%s: insufficient arguments. Try %s --help", cmdname, cmdname); |
rm_end(&rm); |
return CMD_FAILURE; |
} |
i = optind; |
while (NULL != argv[i]) { |
len = str_size(argv[i]) + 2; |
buff = (char *) realloc(buff, len); |
if (buff == NULL) { |
printf("rm: out of memory\n"); |
ret = 1; |
break; |
} |
memset(buff, 0, sizeof(buff)); |
snprintf(buff, len, argv[i]); |
scope = rm_scope(buff); |
switch (scope) { |
case RM_BOGUS: /* FIXME */ |
case RM_FILE: |
ret += rm_single(buff); |
break; |
case RM_DIR: |
if (! rm.recursive) { |
printf("%s is a directory, use -r to remove it.\n", buff); |
ret ++; |
} else { |
ret += rm_recursive(buff); |
} |
break; |
} |
i++; |
} |
if (NULL != buff) |
free(buff); |
rm_end(&rm); |
if (ret) |
return CMD_FAILURE; |
else |
return CMD_SUCCESS; |
} |
//branches/snapshot/uspace/app/bdsh/cmds/modules/rm/rm_def.h |
---|
0,0 → 1,7 |
{ |
"rm", |
"Remove files and directories", |
&cmd_rm, |
&help_cmd_rm, |
}, |
//branches/snapshot/uspace/app/bdsh/cmds/modules/rm/entry.h |
---|
0,0 → 1,9 |
#ifndef RM_ENTRY_H |
#define RM_ENTRY_H |
/* Entry points for the rm command */ |
extern int cmd_rm(char **); |
extern void help_cmd_rm(unsigned int); |
#endif /* RM_ENTRY_H */ |
//branches/snapshot/uspace/app/bdsh/cmds/modules/rm/rm.h |
---|
0,0 → 1,43 |
#ifndef RM_H |
#define RM_H |
/* Return values for rm_scope() */ |
#define RM_BOGUS 0 |
#define RM_FILE 1 |
#define RM_DIR 2 |
/* Flags for rm_update() */ |
#define _RM_ENTRY 0 |
#define _RM_ADVANCE 1 |
#define _RM_REWIND 2 |
#define _RM_EXIT 3 |
/* A simple job structure */ |
typedef struct { |
/* Options set at run time */ |
unsigned int force; /* -f option */ |
unsigned int recursive; /* -r option */ |
unsigned int safe; /* -s option */ |
/* Keeps track of the job in progress */ |
int advance; /* How far deep we've gone since entering */ |
DIR *entry; /* Entry point to the tree being removed */ |
char *owd; /* Where we were when we invoked rm */ |
char *cwd; /* Current directory being transversed */ |
char *nwd; /* Next directory to be transversed */ |
/* Counters */ |
int f_removed; /* Number of files unlinked */ |
int d_removed; /* Number of directories unlinked */ |
} rm_job_t; |
/* Prototypes for the rm command, excluding entry points */ |
static unsigned int rm_start(rm_job_t *); |
static void rm_end(rm_job_t *rm); |
static unsigned int rm_recursive(const char *); |
static unsigned int rm_single(const char *); |
static unsigned int rm_scope(const char *); |
#endif /* RM_H */ |
//branches/snapshot/uspace/app/bdsh/cmds/modules/modules.h |
---|
0,0 → 1,56 |
#ifndef MODULES_H |
#define MODULES_H |
/* Each built in function has two files, one being an entry.h file which |
* prototypes the run/help entry functions, the other being a .def file |
* which fills the modules[] array according to the cmd_t structure |
* defined in cmds.h. |
* |
* To add or remove a module, just make a new directory in cmds/modules |
* for it and copy the 'show' example for basics, then include it here. |
* (or reverse the process to remove one) |
* |
* NOTE: See module_ aliases.h as well, this is where aliases (commands that |
* share an entry point with others) are indexed */ |
#include "config.h" |
/* Prototypes for each module's entry (help/exec) points */ |
#include "help/entry.h" |
#include "mkdir/entry.h" |
#include "rm/entry.h" |
#include "bdd/entry.h" |
#include "cat/entry.h" |
#include "touch/entry.h" |
#include "ls/entry.h" |
#include "pwd/entry.h" |
#include "sleep/entry.h" |
#include "cp/entry.h" |
#include "mv/entry.h" |
#include "mount/entry.h" |
#include "kcon/entry.h" |
/* Each .def function fills the module_t struct with the individual name, entry |
* point, help entry point, etc. You can use config.h to control what modules |
* are loaded based on what libraries exist on the system. */ |
module_t modules[] = { |
#include "help/help_def.h" |
#include "mkdir/mkdir_def.h" |
#include "rm/rm_def.h" |
#include "bdd/bdd_def.h" |
#include "cat/cat_def.h" |
#include "touch/touch_def.h" |
#include "ls/ls_def.h" |
#include "pwd/pwd_def.h" |
#include "sleep/sleep_def.h" |
#include "cp/cp_def.h" |
#include "mv/mv_def.h" |
#include "mount/mount_def.h" |
#include "kcon/kcon_def.h" |
{NULL, NULL, NULL, NULL} |
}; |
#endif |
//branches/snapshot/uspace/app/bdsh/cmds/modules/mount/mount.c |
---|
0,0 → 1,82 |
/* |
* Copyright (c) 2009 Jakub Jermar |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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 <stdio.h> |
#include <stdlib.h> |
#include <vfs/vfs.h> |
#include <errno.h> |
#include "config.h" |
#include "util.h" |
#include "errors.h" |
#include "entry.h" |
#include "mount.h" |
#include "cmds.h" |
static const char *cmdname = "mount"; |
/* Dispays help for mount in various levels */ |
void help_cmd_mount(unsigned int level) |
{ |
static char helpfmt[] = |
"Usage: %s <fstype> <mp> <dev> [<moptions>]\n"; |
if (level == HELP_SHORT) { |
printf("'%s' mounts a file system.\n", cmdname); |
} else { |
help_cmd_mount(HELP_SHORT); |
printf(helpfmt, cmdname); |
} |
return; |
} |
/* Main entry point for mount, accepts an array of arguments */ |
int cmd_mount(char **argv) |
{ |
unsigned int argc; |
char *mopts = ""; |
int rc; |
argc = cli_count_args(argv); |
if ((argc < 4) || (argc > 5)) { |
printf("%s: invalid number of arguments.\n", |
cmdname); |
return CMD_FAILURE; |
} |
if (argc == 5) |
mopts = argv[4]; |
rc = mount(argv[1], argv[2], argv[3], mopts, 0); |
if (rc != EOK) { |
printf("Unable to mount %s filesystem to %s on %s (rc=%d)\n", |
argv[1], argv[2], argv[3], rc); |
return CMD_FAILURE; |
} |
return CMD_SUCCESS; |
} |
//branches/snapshot/uspace/app/bdsh/cmds/modules/mount/mount_def.h |
---|
0,0 → 1,7 |
{ |
"mount", |
"The mount command", |
&cmd_mount, |
&help_cmd_mount, |
}, |
//branches/snapshot/uspace/app/bdsh/cmds/modules/mount/entry.h |
---|
0,0 → 1,9 |
#ifndef MOUNT_ENTRY_H |
#define MOUNT_ENTRY_H |
/* Entry points for the mount command */ |
extern int cmd_mount(char **); |
extern void help_cmd_mount(unsigned int); |
#endif /* MOUNT_ENTRY_H */ |
//branches/snapshot/uspace/app/bdsh/cmds/modules/mount/mount.h |
---|
0,0 → 1,8 |
#ifndef MOUNT_H |
#define MOUNT_H |
/* Prototypes for the mount command, excluding entry points */ |
#endif /* MOUNT_H */ |
//branches/snapshot/uspace/app/bdsh/cmds/modules/mv/mv.c |
---|
0,0 → 1,70 |
/* |
* Copyright (c) 2009 Jakub Jermar |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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 <stdio.h> |
#include <stdlib.h> |
#include <errno.h> |
#include "config.h" |
#include "util.h" |
#include "errors.h" |
#include "entry.h" |
#include "mv.h" |
#include "cmds.h" |
static const char *cmdname = "mv"; |
/* Dispays help for mv in various levels */ |
void help_cmd_mv(unsigned int level) |
{ |
printf("'%s' renames files\n", cmdname); |
return; |
} |
/* Main entry point for mv, accepts an array of arguments */ |
int cmd_mv(char **argv) |
{ |
unsigned int argc; |
int rc; |
argc = cli_count_args(argv); |
if (argc != 3) { |
printf("%s: invalid number of arguments.\n", |
cmdname); |
return CMD_FAILURE; |
} |
rc = rename(argv[1], argv[2]); |
if (rc != EOK) { |
printf("Unable to rename %s to %s (rc=%d)\n", |
argv[1], argv[2], rc); |
return CMD_FAILURE; |
} |
return CMD_SUCCESS; |
} |
//branches/snapshot/uspace/app/bdsh/cmds/modules/mv/mv_def.h |
---|
0,0 → 1,14 |
{ |
"mv", |
"The mv command", |
&cmd_mv, |
&help_cmd_mv, |
}, |
{ |
"ren", |
NULL, |
&cmd_mv, |
&help_cmd_mv, |
}, |
//branches/snapshot/uspace/app/bdsh/cmds/modules/mv/entry.h |
---|
0,0 → 1,9 |
#ifndef MV_ENTRY_H |
#define MV_ENTRY_H |
/* Entry points for the mv command */ |
extern int cmd_mv(char **); |
extern void help_cmd_mv(unsigned int); |
#endif /* MV_ENTRY_H */ |
//branches/snapshot/uspace/app/bdsh/cmds/modules/mv/mv.h |
---|
0,0 → 1,8 |
#ifndef MV_H |
#define MV_H |
/* Prototypes for the mv command, excluding entry points */ |
#endif /* MV_H */ |
//branches/snapshot/uspace/app/bdsh/cmds/modules/module_aliases.h |
---|
0,0 → 1,19 |
#ifndef MODULE_ALIASES_H |
#define MODULE_ALIASES_H |
/* Modules that declare multiple names for themselves but use the |
* same entry functions are aliases. This array helps to determine if |
* a module is an alias, as such it can be invoked differently. |
* format is alias , real_name */ |
/* So far, this is only used in the help display but could be used to |
* handle a module differently even prior to reaching its entry code. |
* For instance, 'exit' could behave differently than 'quit', prior to |
* the entry point being reached. */ |
char *mod_aliases[] = { |
"ren", "mv", |
NULL, NULL |
}; |
#endif |
//branches/snapshot/uspace/app/bdsh/cmds/modules/cat/cat.c |
---|
0,0 → 1,179 |
/* Copyright (c) 2008, Tim Post <tinkertim@gmail.com> |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions are met: |
* |
* Redistributions of source code must retain the above copyright notice, this |
* list of conditions and the following disclaimer. |
* |
* 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. |
* |
* Neither the name of the original program's authors 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 OWNER 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 <stdio.h> |
#include <stdlib.h> |
#include <unistd.h> |
#include <getopt.h> |
#include <string.h> |
#include <fcntl.h> |
#include "config.h" |
#include "util.h" |
#include "errors.h" |
#include "entry.h" |
#include "cat.h" |
#include "cmds.h" |
static char *cmdname = "cat"; |
#define CAT_VERSION "0.0.1" |
#define CAT_DEFAULT_BUFLEN 1024 |
static char *cat_oops = "That option is not yet supported\n"; |
static struct option const long_options[] = { |
{ "help", no_argument, 0, 'h' }, |
{ "version", no_argument, 0, 'v' }, |
{ "head", required_argument, 0, 'H' }, |
{ "tail", required_argument, 0, 't' }, |
{ "buffer", required_argument, 0, 'b' }, |
{ "more", no_argument, 0, 'm' }, |
{ 0, 0, 0, 0 } |
}; |
/* Dispays help for cat in various levels */ |
void help_cmd_cat(unsigned int level) |
{ |
if (level == HELP_SHORT) { |
printf("`%s' shows the contents of files\n", cmdname); |
} else { |
help_cmd_cat(HELP_SHORT); |
printf( |
"Usage: %s [options] <file1> [file2] [...]\n" |
"Options:\n" |
" -h, --help A short option summary\n" |
" -v, --version Print version information and exit\n" |
" -H, --head ## Print only the first ## bytes\n" |
" -t, --tail ## Print only the last ## bytes\n" |
" -b, --buffer ## Set the read buffer size to ##\n" |
" -m, --more Pause after each screen full\n" |
"Currently, %s is under development, some options don't work.\n", |
cmdname, cmdname); |
} |
return; |
} |
static unsigned int cat_file(const char *fname, size_t blen) |
{ |
int fd, bytes = 0, count = 0, reads = 0; |
off_t total = 0; |
char *buff = NULL; |
fd = open(fname, O_RDONLY); |
if (fd < 0) { |
printf("Unable to open %s\n", fname); |
return 1; |
} |
total = lseek(fd, 0, SEEK_END); |
lseek(fd, 0, SEEK_SET); |
if (NULL == (buff = (char *) malloc(blen + 1))) { |
close(fd); |
printf("Unable to allocate enough memory to read %s\n", |
fname); |
return 1; |
} |
do { |
bytes = read(fd, buff, blen); |
if (bytes > 0) { |
count += bytes; |
buff[bytes] = '\0'; |
printf("%s", buff); |
reads++; |
} |
} while (bytes > 0); |
close(fd); |
if (bytes == -1) { |
printf("Error reading %s\n", fname); |
free(buff); |
return 1; |
} |
free(buff); |
return 0; |
} |
/* Main entry point for cat, accepts an array of arguments */ |
int cmd_cat(char **argv) |
{ |
unsigned int argc, i, ret = 0, buffer = 0; |
int c, opt_ind; |
argc = cli_count_args(argv); |
for (c = 0, optind = 0, opt_ind = 0; c != -1;) { |
c = getopt_long(argc, argv, "hvmH:t:b:", long_options, &opt_ind); |
switch (c) { |
case 'h': |
help_cmd_cat(HELP_LONG); |
return CMD_SUCCESS; |
case 'v': |
printf("%s\n", CAT_VERSION); |
return CMD_SUCCESS; |
case 'H': |
printf(cat_oops); |
return CMD_FAILURE; |
case 't': |
printf(cat_oops); |
return CMD_FAILURE; |
case 'b': |
printf(cat_oops); |
break; |
case 'm': |
printf(cat_oops); |
return CMD_FAILURE; |
} |
} |
argc -= optind; |
if (argc < 1) { |
printf("%s - incorrect number of arguments. Try `%s --help'\n", |
cmdname, cmdname); |
return CMD_FAILURE; |
} |
if (buffer <= 0) |
buffer = CAT_DEFAULT_BUFLEN; |
for (i = optind; argv[i] != NULL; i++) |
ret += cat_file(argv[i], buffer); |
if (ret) |
return CMD_FAILURE; |
else |
return CMD_SUCCESS; |
} |
//branches/snapshot/uspace/app/bdsh/cmds/modules/cat/cat_def.h |
---|
0,0 → 1,7 |
{ |
"cat", |
"Show the contents of a file", |
&cmd_cat, |
&help_cmd_cat, |
}, |
//branches/snapshot/uspace/app/bdsh/cmds/modules/cat/entry.h |
---|
0,0 → 1,9 |
#ifndef CAT_ENTRY_H |
#define CAT_ENTRY_H |
/* Entry points for the cat command */ |
extern int cmd_cat(char **); |
extern void help_cmd_cat(unsigned int); |
#endif /* CAT_ENTRY_H */ |
//branches/snapshot/uspace/app/bdsh/cmds/modules/cat/cat.h |
---|
0,0 → 1,9 |
#ifndef CAT_H |
#define CAT_H |
/* Prototypes for the cat command, excluding entry points */ |
static unsigned int cat_file(const char *, size_t); |
#endif /* CAT_H */ |
//branches/snapshot/uspace/app/bdsh/cmds/modules/touch/touch.c |
---|
0,0 → 1,108 |
/* Copyright (c) 2008, Tim Post <tinkertim@gmail.com> |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions are met: |
* |
* Redistributions of source code must retain the above copyright notice, this |
* list of conditions and the following disclaimer. |
* |
* 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. |
* |
* Neither the name of the original program's authors 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 OWNER 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. |
*/ |
/* TODO: Options that people would expect, such as not creating the file if |
* it doesn't exist, specifying the access time, etc */ |
#include <stdio.h> |
#include <stdlib.h> |
#include <unistd.h> |
#include <fcntl.h> |
#include <dirent.h> |
#include <sys/types.h> |
#include <string.h> |
#include "config.h" |
#include "errors.h" |
#include "util.h" |
#include "entry.h" |
#include "touch.h" |
#include "cmds.h" |
static char *cmdname = "touch"; |
/* Dispays help for touch in various levels */ |
void help_cmd_touch(unsigned int level) |
{ |
if (level == HELP_SHORT) { |
printf("`%s' updates access times for files\n", cmdname); |
} else { |
help_cmd_touch(HELP_SHORT); |
printf(" `%s' <file>, if the file does not exist it will be " |
"created\n", cmdname); |
} |
return; |
} |
/* Main entry point for touch, accepts an array of arguments */ |
int cmd_touch(char **argv) |
{ |
unsigned int argc, i = 0, ret = 0; |
int fd; |
char *buff = NULL; |
DIR *dirp; |
argc = cli_count_args(argv); |
if (argc == 1) { |
printf("%s - incorrect number of arguments. Try `help %s extended'\n", |
cmdname, cmdname); |
return CMD_FAILURE; |
} |
for (i = 1; i < argc; i ++) { |
buff = str_dup(argv[i]); |
dirp = opendir(buff); |
if (dirp) { |
cli_error(CL_ENOTSUP, "%s is a directory", buff); |
closedir(dirp); |
ret ++; |
continue; |
} |
fd = open(buff, O_RDWR | O_CREAT); |
if (fd < 0) { |
cli_error(CL_EFAIL, "Could not update / create %s ", buff); |
ret ++; |
continue; |
} else |
close(fd); |
free(buff); |
} |
if (ret) |
return CMD_FAILURE; |
else |
return CMD_SUCCESS; |
} |
//branches/snapshot/uspace/app/bdsh/cmds/modules/touch/touch_def.h |
---|
0,0 → 1,7 |
{ |
"touch", |
"Create files or update access times", |
&cmd_touch, |
&help_cmd_touch, |
}, |
//branches/snapshot/uspace/app/bdsh/cmds/modules/touch/entry.h |
---|
0,0 → 1,9 |
#ifndef TOUCH_ENTRY_H |
#define TOUCH_ENTRY_H |
/* Entry points for the touch command */ |
extern int cmd_touch(char **); |
extern void help_cmd_touch(unsigned int); |
#endif /* TOUCH_ENTRY_H */ |
//branches/snapshot/uspace/app/bdsh/cmds/modules/touch/touch.h |
---|
0,0 → 1,8 |
#ifndef TOUCH_H |
#define TOUCH_H |
/* Prototypes for the touch command, excluding entry points */ |
#endif /* TOUCH_H */ |
//branches/snapshot/uspace/app/bdsh/cmds/modules/help/help.c |
---|
0,0 → 1,158 |
/* Copyright (c) 2008, Tim Post <tinkertim@gmail.com> |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions are met: |
* |
* Redistributions of source code must retain the above copyright notice, this |
* list of conditions and the following disclaimer. |
* |
* 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. |
* |
* Neither the name of the original program's authors 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 OWNER 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 <stdio.h> |
#include <stdlib.h> |
#include <string.h> |
#include "config.h" |
#include "entry.h" |
#include "help.h" |
#include "cmds.h" |
#include "modules.h" |
#include "builtins.h" |
#include "errors.h" |
#include "util.h" |
static char *cmdname = "help"; |
extern const char *progname; |
#define HELP_IS_MODULE 1 |
#define HELP_IS_BUILTIN 0 |
#define HELP_IS_RUBBISH -1 |
volatile int mod_switch = -1; |
/* Just use a pointer here, no need for mod_switch */ |
static int is_mod_or_builtin(char *cmd) |
{ |
int rc = HELP_IS_RUBBISH; |
rc = is_builtin(cmd); |
if (rc > -1) { |
mod_switch = rc; |
return HELP_IS_BUILTIN; |
} |
rc = is_module(cmd); |
if (rc > -1) { |
mod_switch = rc; |
return HELP_IS_MODULE; |
} |
return HELP_IS_RUBBISH; |
} |
void help_cmd_help(unsigned int level) |
{ |
if (level == HELP_SHORT) { |
printf( |
"\n %s [command] <extended>\n" |
" Use help [command] extended for detailed help on [command] " |
", even `help'\n\n", cmdname); |
} else { |
printf( |
"\n `%s' - shows help for commands\n" |
" Examples:\n" |
" %s [command] Show help for [command]\n" |
" %s [command] extended Show extended help for [command]\n" |
"\n If no argument is given to %s, a list of commands are shown\n\n", |
cmdname, cmdname, cmdname, cmdname); |
} |
return; |
} |
int cmd_help(char *argv[]) |
{ |
module_t *mod; |
builtin_t *cmd; |
unsigned int i = 0; |
int rc = 0; |
int argc; |
int level = HELP_SHORT; |
argc = cli_count_args(argv); |
if (argc > 3) { |
printf("\nToo many arguments to `%s', try:\n", cmdname); |
help_cmd_help(HELP_SHORT); |
return CMD_FAILURE; |
} |
if (argc == 3) { |
if (!str_cmp("extended", argv[2])) |
level = HELP_LONG; |
else |
level = HELP_SHORT; |
} |
if (argc > 1) { |
rc = is_mod_or_builtin(argv[1]); |
switch (rc) { |
case HELP_IS_RUBBISH: |
printf("Invalid command %s\n", argv[1]); |
return CMD_FAILURE; |
case HELP_IS_MODULE: |
help_module(mod_switch, level); |
return CMD_SUCCESS; |
case HELP_IS_BUILTIN: |
help_builtin(mod_switch, level); |
return CMD_SUCCESS; |
} |
} |
printf("\n Available commands are:\n"); |
printf(" ------------------------------------------------------------\n"); |
/* First, show a list of built in commands that are available in this mode */ |
for (cmd = builtins; cmd->name != NULL; cmd++, i++) { |
if (is_builtin_alias(cmd->name)) |
printf(" %-16s\tAlias for `%s'\n", cmd->name, |
alias_for_builtin(cmd->name)); |
else |
printf(" %-16s\t%s\n", cmd->name, cmd->desc); |
} |
i = 0; |
/* Now, show a list of module commands that are available in this mode */ |
for (mod = modules; mod->name != NULL; mod++, i++) { |
if (is_module_alias(mod->name)) |
printf(" %-16s\tAlias for `%s'\n", mod->name, |
alias_for_module(mod->name)); |
else |
printf(" %-16s\t%s\n", mod->name, mod->desc); |
} |
printf("\n Try %s %s for more information on how `%s' works.\n\n", |
cmdname, cmdname, cmdname); |
return CMD_SUCCESS; |
} |
//branches/snapshot/uspace/app/bdsh/cmds/modules/help/help_def.h |
---|
0,0 → 1,6 |
{ |
"help", |
"Show help for commands", |
&cmd_help, |
&help_cmd_help, |
}, |
//branches/snapshot/uspace/app/bdsh/cmds/modules/help/entry.h |
---|
0,0 → 1,8 |
#ifndef HELP_ENTRY_H_ |
#define HELP_ENTRY_H_ |
/* Entry points for the help command */ |
extern void help_cmd_help(unsigned int); |
extern int cmd_help(char *[]); |
#endif |
//branches/snapshot/uspace/app/bdsh/cmds/modules/help/help.h |
---|
0,0 → 1,7 |
#ifndef HELP_H |
#define HELP_H |
/* Prototypes for the help command (excluding entry points) */ |
static int is_mod_or_builtin(char *); |
#endif |
//branches/snapshot/uspace/app/bdsh/cmds/modules/cp/cp.c |
---|
0,0 → 1,231 |
/* Copyright (c) 2008, Tim Post <tinkertim@gmail.com> |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions are met: |
* |
* Redistributions of source code must retain the above copyright notice, this |
* list of conditions and the following disclaimer. |
* |
* 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. |
* |
* Neither the name of the original program's authors 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 OWNER 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 <stdio.h> |
#include <stdlib.h> |
#include <unistd.h> |
#include <getopt.h> |
#include <string.h> |
#include <fcntl.h> |
#include "config.h" |
#include "util.h" |
#include "errors.h" |
#include "entry.h" |
#include "cp.h" |
#include "cmds.h" |
#define CP_VERSION "0.0.1" |
#define CP_DEFAULT_BUFLEN 1024 |
static const char *cmdname = "cp"; |
static struct option const long_options[] = { |
{ "buffer", required_argument, 0, 'b' }, |
{ "force", no_argument, 0, 'f' }, |
{ "recursive", no_argument, 0, 'r' }, |
{ "help", no_argument, 0, 'h' }, |
{ "version", no_argument, 0, 'v' }, |
{ "verbose", no_argument, 0, 'V' }, |
{ 0, 0, 0, 0 } |
}; |
static int strtoint(const char *s1) |
{ |
long t1; |
if (-1 == (t1 = strtol(s1, (char **) NULL, 10))) |
return -1; |
if (t1 <= 0) |
return -1; |
return (int) t1; |
} |
static int64_t copy_file(const char *src, const char *dest, |
size_t blen, int vb) |
{ |
int fd1, fd2, bytes = 0; |
off_t total = 0; |
int64_t copied = 0; |
char *buff = NULL; |
if (vb) |
printf("Copying %s to %s\n", src, dest); |
if (-1 == (fd1 = open(src, O_RDONLY))) { |
printf("Unable to open source file %s\n", src); |
return -1; |
} |
if (-1 == (fd2 = open(dest, O_CREAT))) { |
printf("Unable to open destination file %s\n", dest); |
close(fd1); |
return -1; |
} |
total = lseek(fd1, 0, SEEK_END); |
if (vb) |
printf("%d bytes to copy\n", total); |
lseek(fd1, 0, SEEK_SET); |
if (NULL == (buff = (char *) malloc(blen))) { |
printf("Unable to allocate enough memory to read %s\n", |
src); |
copied = -1; |
goto out; |
} |
for (;;) { |
ssize_t res; |
bytes = read(fd1, buff, blen); |
if (bytes <= 0) |
break; |
copied += bytes; |
res = bytes; |
do { |
/* |
* Theoretically, it may not be enough to call write() |
* only once. Also the previous read() may have |
* returned less data than requested. |
*/ |
bytes = write(fd2, buff, res); |
if (bytes < 0) |
goto err; |
res -= bytes; |
} while (res > 0); |
/* TODO: re-insert assert() once this is stand alone, |
* removed as abort() exits the entire shell |
*/ |
if (res != 0) { |
printf("\n%d more bytes than actually exist were copied\n", res); |
goto err; |
} |
} |
if (bytes < 0) { |
err: |
printf("\nError copying %s, (%d)\n", src, bytes); |
copied = bytes; |
} |
out: |
close(fd1); |
close(fd2); |
if (buff) |
free(buff); |
return copied; |
} |
void help_cmd_cp(unsigned int level) |
{ |
static char helpfmt[] = |
"Usage: %s [options] <source> <dest>\n" |
"Options: (* indicates not yet implemented)\n" |
" -h, --help A short option summary\n" |
" -v, --version Print version information and exit\n" |
"* -V, --verbose Be annoyingly noisy about what's being done\n" |
"* -f, --force Do not complain when <dest> exists\n" |
"* -r, --recursive Copy entire directories\n" |
" -b, --buffer ## Set the read buffer size to ##\n" |
"Currently, %s is under development, some options may not work.\n"; |
if (level == HELP_SHORT) { |
printf("`%s' copies files and directories\n", cmdname); |
} else { |
help_cmd_cp(HELP_SHORT); |
printf(helpfmt, cmdname, cmdname); |
} |
return; |
} |
int cmd_cp(char **argv) |
{ |
unsigned int argc, buffer = 0, verbose = 0; |
int c, opt_ind; |
int64_t ret; |
argc = cli_count_args(argv); |
for (c = 0, optind = 0, opt_ind = 0; c != -1;) { |
c = getopt_long(argc, argv, "hvVfrb:", long_options, &opt_ind); |
switch (c) { |
case 'h': |
help_cmd_cp(1); |
return CMD_SUCCESS; |
case 'v': |
printf("%d\n", CP_VERSION); |
return CMD_SUCCESS; |
case 'V': |
verbose = 1; |
break; |
case 'f': |
break; |
case 'r': |
break; |
case 'b': |
if (-1 == (buffer = strtoint(optarg))) { |
printf("%s: Invalid buffer specification, " |
"(should be a number greater than zero)\n", |
cmdname); |
return CMD_FAILURE; |
} |
if (verbose) |
printf("Buffer = %d\n", buffer); |
break; |
} |
} |
if (buffer == 0) |
buffer = CP_DEFAULT_BUFLEN; |
argc -= optind; |
if (argc != 2) { |
printf("%s: invalid number of arguments. Try %s --help\n", |
cmdname, cmdname); |
return CMD_FAILURE; |
} |
ret = copy_file(argv[optind], argv[optind + 1], buffer, verbose); |
if (verbose) |
printf("%d bytes copied\n", ret); |
if (ret >= 0) |
return CMD_SUCCESS; |
else |
return CMD_FAILURE; |
} |
//branches/snapshot/uspace/app/bdsh/cmds/modules/cp/cp_def.h |
---|
0,0 → 1,7 |
{ |
"cp", |
"Copy files and directories", |
&cmd_cp, |
&help_cmd_cp, |
}, |
//branches/snapshot/uspace/app/bdsh/cmds/modules/cp/entry.h |
---|
0,0 → 1,9 |
#ifndef CP_ENTRY_H |
#define CP_ENTRY_H |
/* Entry points for the cp command */ |
extern int cmd_cp(char **); |
extern void help_cmd_cp(unsigned int); |
#endif /* CP_ENTRY_H */ |
//branches/snapshot/uspace/app/bdsh/cmds/modules/cp/cp.h |
---|
0,0 → 1,8 |
#ifndef CP_H |
#define CP_H |
/* Prototypes for the cp command, excluding entry points */ |
#endif /* CP_H */ |
//branches/snapshot/uspace/app/bdsh/cmds/modules/sleep/sleep_def.h |
---|
0,0 → 1,7 |
{ |
"sleep", |
"Pause for given time interval (in seconds)", |
&cmd_sleep, |
&help_cmd_sleep, |
}, |
//branches/snapshot/uspace/app/bdsh/cmds/modules/sleep/entry.h |
---|
0,0 → 1,9 |
#ifndef SLEEP_ENTRY_H |
#define SLEEP_ENTRY_H |
/* Entry points for the sleep command */ |
extern int cmd_sleep(char **); |
extern void help_cmd_sleep(unsigned int); |
#endif /* SLEEP_ENTRY_H */ |
//branches/snapshot/uspace/app/bdsh/cmds/modules/sleep/sleep.c |
---|
0,0 → 1,73 |
/* Copyright (c) 2008, Tim Post <tinkertim@gmail.com> |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions are met: |
* |
* Redistributions of source code must retain the above copyright notice, this |
* list of conditions and the following disclaimer. |
* |
* 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. |
* |
* Neither the name of the original program's authors 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 OWNER 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 <stdio.h> |
#include <stdlib.h> |
#include "config.h" |
#include "util.h" |
#include "errors.h" |
#include "entry.h" |
#include "sleep.h" |
#include "cmds.h" |
static char *cmdname = "sleep"; |
/* Dispays help for sleep in various levels */ |
void help_cmd_sleep(unsigned int level) |
{ |
printf("This is the %s help for '%s'.\n", |
level ? EXT_HELP : SHORT_HELP, cmdname); |
return; |
} |
/* Main entry point for sleep, accepts an array of arguments */ |
int cmd_sleep(char **argv) |
{ |
unsigned int argc; |
unsigned int i; |
/* Count the arguments */ |
for (argc = 0; argv[argc] != NULL; argc ++); |
printf("%s %s\n", TEST_ANNOUNCE, cmdname); |
printf("%d arguments passed to %s", argc - 1, cmdname); |
if (argc < 2) { |
printf("\n"); |
return CMD_SUCCESS; |
} |
printf(":\n"); |
for (i = 1; i < argc; i++) |
printf("[%d] -> %s\n", i, argv[i]); |
return CMD_SUCCESS; |
} |
//branches/snapshot/uspace/app/bdsh/cmds/modules/sleep/sleep.h |
---|
0,0 → 1,8 |
#ifndef SLEEP_H |
#define SLEEP_H |
/* Prototypes for the sleep command, excluding entry points */ |
#endif /* SLEEP_H */ |
//branches/snapshot/uspace/app/bdsh/cmds/modules/README |
---|
0,0 → 1,15 |
Modules are commands or full programs (anything can be made into a module |
that can return int type) should go here. Note, modules do not (can not) |
update or read cliuser_t. |
Stuff that needs to write to the user structures contained in scli.h should |
be made as built-in commands, not modules, but there are very few times when |
you would want to do that. |
See the README file in the bdsh root directory for a quick overview of how to |
write a new command, or convert an existig stand-alone program into a module |
for BDSH. |
//branches/snapshot/uspace/app/bdsh/cmds/mod_cmds.c |
---|
0,0 → 1,136 |
/* Copyright (c) 2008, Tim Post <tinkertim@gmail.com> |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions are met: |
* |
* Redistributions of source code must retain the above copyright notice, this |
* list of conditions and the following disclaimer. |
* |
* 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. |
* |
* Neither the name of the original program's authors 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 OWNER 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. |
*/ |
/* NOTES: |
* module_* functions are pretty much identical to builtin_* functions at this |
* point. On the surface, it would appear that making each function dual purpose |
* would be economical. |
* |
* These are kept separate because the structures (module_t and builtin_t) may |
* grow apart and become rather different, even though they're identical at this |
* point. |
* |
* To keep things easy to hack, everything is separated. In reality this only adds |
* 6 - 8 extra functions, but keeps each function very easy to read and modify. */ |
/* TODO: |
* Many of these could be unsigned, provided the modules and builtins themselves |
* can follow suit. Long term goal. */ |
#include <stdio.h> |
#include <stdlib.h> |
#include <string.h> |
#include "errors.h" |
#include "cmds.h" |
#include "module_aliases.h" |
extern volatile unsigned int cli_interactive; |
/* Checks if an entry function matching command exists in modules[], if so |
* its position in the array is returned */ |
int is_module(const char *command) |
{ |
module_t *mod; |
unsigned int i = 0; |
if (NULL == command) |
return -2; |
for (mod = modules; mod->name != NULL; mod++, i++) { |
if (!str_cmp(mod->name, command)) |
return i; |
} |
return -1; |
} |
/* Checks if a module is an alias (sharing an entry point with another |
* module). Returns 1 if so */ |
int is_module_alias(const char *command) |
{ |
unsigned int i = 0; |
if (NULL == command) |
return -1; |
for(i=0; mod_aliases[i] != NULL; i+=2) { |
if (!str_cmp(mod_aliases[i], command)) |
return 1; |
} |
return 0; |
} |
/* Returns the name of the module that an alias points to */ |
char *alias_for_module(const char *command) |
{ |
unsigned int i = 0; |
if (NULL == command) |
return (char *)NULL; |
for(i=0; mod_aliases[i] != NULL; i++) { |
if (!str_cmp(mod_aliases[i], command)) |
return (char *)mod_aliases[++i]; |
i++; |
} |
return (char *)NULL; |
} |
/* Invokes the 'help' entry function for the module at position (int) module, |
* which wants an unsigned int to determine brief or extended display. */ |
int help_module(int module, unsigned int extended) |
{ |
module_t *mod = modules; |
mod += module; |
if (NULL != mod->help) { |
mod->help(extended); |
return CL_EOK; |
} else |
return CL_ENOENT; |
} |
/* Invokes the module entry point modules[module], passing argv[] as an argument |
* stack. */ |
int run_module(int module, char *argv[]) |
{ |
module_t *mod = modules; |
mod += module; |
if (NULL != mod->entry) |
return ((int)mod->entry(argv)); |
return CL_ENOENT; |
} |
//branches/snapshot/uspace/app/bdsh/cmds/builtin_cmds.c |
---|
0,0 → 1,113 |
/* Copyright (c) 2008, Tim Post <tinkertim@gmail.com> |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions are met: |
* |
* Redistributions of source code must retain the above copyright notice, this |
* list of conditions and the following disclaimer. |
* |
* 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. |
* |
* Neither the name of the original program's authors 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 OWNER 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. |
*/ |
/* Almost identical (for now) to mod_cmds.c , however this will not be the case |
* soon as builtin_t is going to grow way beyond module_t */ |
#include <stdio.h> |
#include <stdlib.h> |
#include <string.h> |
#include "errors.h" |
#include "cmds.h" |
#include "builtin_aliases.h" |
extern volatile unsigned int cli_interactive; |
int is_builtin(const char *command) |
{ |
builtin_t *cmd; |
unsigned int i = 0; |
if (NULL == command) |
return -2; |
for (cmd = builtins; cmd->name != NULL; cmd++, i++) { |
if (!str_cmp(cmd->name, command)) |
return i; |
} |
return -1; |
} |
int is_builtin_alias(const char *command) |
{ |
unsigned int i = 0; |
if (NULL == command) |
return -1; |
for(i=0; builtin_aliases[i] != NULL; i+=2) { |
if (!str_cmp(builtin_aliases[i], command)) |
return 1; |
} |
return 0; |
} |
char *alias_for_builtin(const char *command) |
{ |
unsigned int i = 0; |
if (NULL == command) |
return (char *)NULL; |
for(i=0; builtin_aliases[i] != NULL; i++) { |
if (!str_cmp(builtin_aliases[i], command)) |
return (char *)builtin_aliases[++i]; |
i++; |
} |
return (char *)NULL; |
} |
int help_builtin(int builtin, unsigned int extended) |
{ |
builtin_t *cmd = builtins; |
cmd += builtin; |
if (NULL != cmd->help) { |
cmd->help(extended); |
return CL_EOK; |
} else |
return CL_ENOENT; |
} |
int run_builtin(int builtin, char *argv[], cliuser_t *usr) |
{ |
builtin_t *cmd = builtins; |
cmd += builtin; |
if (NULL != cmd->entry) |
return((int)cmd->entry(argv, usr)); |
return CL_ENOENT; |
} |
//branches/snapshot/uspace/app/bdsh/cmds/builtins/builtins.h |
---|
0,0 → 1,15 |
#ifndef BUILTINS_H |
#define BUILTINS_H |
#include "config.h" |
#include "cd/entry.h" |
#include "exit/entry.h" |
builtin_t builtins[] = { |
#include "cd/cd_def.h" |
#include "exit/exit_def.h" |
{NULL, NULL, NULL, NULL} |
}; |
#endif |
//branches/snapshot/uspace/app/bdsh/cmds/builtins/exit/exit.h |
---|
0,0 → 1,6 |
#ifndef EXIT_H |
#define EXIT_H |
/* Prototypes for the quit command (excluding entry points) */ |
#endif |
//branches/snapshot/uspace/app/bdsh/cmds/builtins/exit/entry.h |
---|
0,0 → 1,12 |
#ifndef EXIT_ENTRY_H_ |
#define EXIT_ENTRY_H_ |
#include "scli.h" |
/* Entry points for the quit command */ |
extern void help_cmd_exit(unsigned int); |
extern int cmd_exit(char *[], cliuser_t *); |
#endif |
//branches/snapshot/uspace/app/bdsh/cmds/builtins/exit/exit.c |
---|
0,0 → 1,55 |
/* Copyright (c) 2008, Tim Post <tinkertim@gmail.com> |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions are met: |
* |
* Redistributions of source code must retain the above copyright notice, this |
* list of conditions and the following disclaimer. |
* |
* 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. |
* |
* Neither the name of the original program's authors 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 OWNER 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 <stdio.h> |
#include <stdlib.h> |
#include "entry.h" |
#include "exit.h" |
#include "cmds.h" |
static const char *cmdname = "exit"; |
extern volatile unsigned int cli_quit; |
extern const char *progname; |
void help_cmd_exit(unsigned int level) |
{ |
printf("Type `%s' to exit %s\n", cmdname, progname); |
return; |
} |
/* Quits the program and returns the status of whatever command |
* came before invoking 'quit' */ |
int cmd_exit(char *argv[], cliuser_t *usr) |
{ |
/* Inform that we're outta here */ |
cli_quit = 1; |
return CMD_SUCCESS; |
} |
//branches/snapshot/uspace/app/bdsh/cmds/builtins/exit/exit_def.h |
---|
0,0 → 1,6 |
{ |
"exit", |
"Exit the shell", |
&cmd_exit, |
&help_cmd_exit, |
}, |
//branches/snapshot/uspace/app/bdsh/cmds/builtins/cd/cd_def.h |
---|
0,0 → 1,6 |
{ |
"cd", |
"Change the current working directory", |
&cmd_cd, |
&help_cmd_cd, |
}, |
//branches/snapshot/uspace/app/bdsh/cmds/builtins/cd/cd.c |
---|
0,0 → 1,106 |
/* Copyright (c) 2008, Tim Post <tinkertim@gmail.com> |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions are met: |
* |
* Redistributions of source code must retain the above copyright notice, this |
* list of conditions and the following disclaimer. |
* |
* 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. |
* |
* Neither the name of the original program's authors 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 OWNER 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 <stdio.h> |
#include <stdlib.h> |
#include <unistd.h> |
#include <string.h> |
#include <errno.h> |
#include "util.h" |
#include "errors.h" |
#include "entry.h" |
#include "cmds.h" |
#include "cd.h" |
static char * cmdname = "cd"; |
void help_cmd_cd(unsigned int level) |
{ |
if (level == HELP_SHORT) { |
printf("`%s' changes the current working directory.\n", cmdname); |
} else { |
printf( |
" %s <directory>\n" |
" Change directory to <directory>, e.g `%s /sbin'\n", |
cmdname, cmdname); |
} |
return; |
} |
/* This is a very rudamentary 'cd' command. It is not 'link smart' (yet) */ |
int cmd_cd(char **argv, cliuser_t *usr) |
{ |
int argc, rc = 0; |
argc = cli_count_args(argv); |
/* We don't yet play nice with whitespace, a getopt implementation should |
* protect "quoted\ destination" as a single argument. Its not our job to |
* look for && || or redirection as the tokenizer should have done that |
* (currently, it does not) */ |
if (argc > 2) { |
cli_error(CL_EFAIL, "Too many arguments to `%s'", cmdname); |
return CMD_FAILURE; |
} |
if (argc < 2) { |
printf("%s - no directory specified. Try `help %s extended'\n", |
cmdname, cmdname); |
return CMD_FAILURE; |
} |
/* We have the correct # of arguments |
* TODO: handle tidle (~) expansion? */ |
rc = chdir(argv[1]); |
if (rc == 0) { |
cli_set_prompt(usr); |
return CMD_SUCCESS; |
} else { |
switch (rc) { |
case ENOMEM: |
cli_error(CL_EFAIL, "Destination path too long"); |
break; |
case ENOENT: |
cli_error(CL_ENOENT, "Invalid directory `%s'", argv[1]); |
break; |
default: |
cli_error(CL_EFAIL, "Unable to change to `%s'", argv[1]); |
break; |
} |
} |
return CMD_FAILURE; |
} |
//branches/snapshot/uspace/app/bdsh/cmds/builtins/cd/entry.h |
---|
0,0 → 1,12 |
#ifndef CD_ENTRY_H_ |
#define CD_ENTRY_H_ |
#include "scli.h" |
/* Entry points for the cd command */ |
extern void help_cmd_cd(unsigned int); |
extern int cmd_cd(char **, cliuser_t *); |
#endif |
//branches/snapshot/uspace/app/bdsh/cmds/builtins/cd/cd.h |
---|
0,0 → 1,7 |
#ifndef CD_H |
#define CD_H |
/* Prototypes for the cd command (excluding entry points) */ |
#endif |
//branches/snapshot/uspace/app/bdsh/cmds/builtins/builtin_aliases.h |
---|
0,0 → 1,10 |
#ifndef BUILTIN_ALIASES_H |
#define BUILTIN_ALIASES_H |
/* See modules/module_aliases.h for an explanation of this file */ |
char *builtin_aliases[] = { |
NULL, NULL |
}; |
#endif |
//branches/snapshot/uspace/app/bdsh/cmds/builtins/README |
---|
0,0 → 1,21 |
Commands that need to modify the running user structure defined in scli.h |
should reside here. They (will) have a slightly different prototype that |
allows passing the user structure to them for ease of modifications. |
Examples of what should be a built-in and not a module would be: |
cd (cliuser_t->cwd needs to be updated) |
In the future, more user preferences will be set via built-in commands, |
such as the formatting of the prompt string (HelenOS doesn't yet have |
an environment, much less PS*, even if it did we'd likely do it a little |
differently). |
.... etc. |
Anything that does _not_ need to use this structure should be included |
as a module, not a built in. If you want to include a new command, there |
is a 99% chance that you want it to be a module. |
//branches/snapshot/uspace/app/bdsh/cmds/mknewcmd |
---|
0,0 → 1,314 |
#!/bin/sh |
# Copyright (C) 2008 Tim Post - All Rights Reserved |
# Redistribution and use in source and binary forms, with or without |
# modification, are permitted provided that the following conditions are met: |
# |
# Redistributions of source code must retain the above copyright notice, this |
# list of conditions and the following disclaimer. |
# |
# 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. |
# |
# Neither the name of the original program's authors 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 OWNER 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. |
# Script to generate skeletal files for a new command |
# Uses `getopt', not quite a bash-ism but might be |
# lacking on some legacy systems. |
# If your shell does not support eval, shift (x) or |
# here-now documents, sorry :) |
usage() |
{ |
def="$DEFAULT_COMMAND" |
cat << EOF |
\`$PROGNAME' generates skeletal command files to simplify adding commands |
Usage: $PROGNAME [options] <location> |
Options: |
-n, --name Name of the command (default: ${def}) |
-d, --desc Short (20 30 chars) description of the command |
(def: "The $def command") |
-e, --entry Entry function of the command (def: cmd_${def}) |
-h, --help-entry Entry function for command help (def: help_cmd_${def}) |
-a, --alias Alias (nickname) for this command (def: none) |
-t, --type Type of command (module or builtin) (def: module) |
-H, --help This help summary |
-V, --version Print $PROGNAME version and exit normally |
Notes: |
You must supply at least the name of the command. |
If you do not specify a location (i.e. modules/foo), the command will be |
created in modules/command_name or builtins/command_name depending on your |
selection. |
This script will only create skeletal files and inform you what headers |
need to be modified to incorporate the command. You will also have to |
manually update the main Makefile. |
This script is intended only to be a convenience for developers. Example use: |
$PROGNAME -n foo -d "Foo power" -a bar -r both -t module modules/foo |
The example would generate a modular command named 'foo', which is also |
reached by typing 'bar'. |
Skeletal files do *not* depend on the autoconf generated "config.h" unless you |
include it. This may or may not be desirable depending on your use. |
Report bugs to $PROGMAINT |
EOF |
} |
# Convert a string to all uppercase |
toupper() |
{ |
local str="$1" |
echo "${str}" | tr 'a-z' 'A-Z' |
} |
# Template stored `here-now' style, this generates all files needed |
# for a new command according to arguments passed. |
generate_code() |
{ |
echo "Creating ${OUTDIR}/${CMDNAME}_def.h ..." |
cat << EOF > ${OUTDIR}/${CMDNAME}_def.h |
{ |
"${CMDNAME}", |
"${CMDDESC}", |
&${CMDENTRY}, |
&${HELPENTRY}, |
}, |
EOF |
[ -n "${CMDALIAS}" ] && cat << EOF >> ${OUTDIR}/${CMDNAME}_def.h |
{ |
"${CMDALIAS}", |
NULL, |
&${CMDENTRY}, |
&${HELPENTRY}, |
}, |
EOF |
local defname=$(toupper "${CMDNAME}") |
echo "Creating ${OUTDIR}/entry.h ..." |
cat << EOF > ${OUTDIR}/entry.h |
#ifndef ${defname}_ENTRY_H |
#define ${defname}_ENTRY_H |
EOF |
[ "${CMDTYPE}" = "module" ] && cat << EOF >> ${OUTDIR}/entry.h |
/* Entry points for the ${CMDNAME} command */ |
extern int ${CMDENTRY}(char **); |
extern void ${HELPENTRY}(unsigned int); |
#endif /* ${defname}_ENTRY_H */ |
EOF |
[ "${CMDTYPE}" = "builtin" ] && cat << EOF >> ${OUTDIR}/entry.h |
/* Pick up cliuser_t */ |
#include "scli.h" |
/* Entry points for the ${CMDNAME} command */ |
extern int * ${CMDENTRY}(char **, cliuser_t *); |
extern void * ${HELPENTRY}(unsigned int); |
#endif /* ${defname}_ENTRY_H */ |
EOF |
echo "Creating ${OUTDIR}/${CMDNAME}.h ..." |
cat << EOF > ${OUTDIR}/${CMDNAME}.h |
#ifndef ${defname}_H |
#define ${defname}_H |
/* Prototypes for the ${CMDNAME} command, excluding entry points */ |
#endif /* ${defname}_H */ |
EOF |
echo "Creating ${OUTDIR}/${CMDNAME}.c ..." |
cat << EOF > ${OUTDIR}/${CMDNAME}.c |
/* Automatically generated by ${PROGNAME} on ${TIMESTAMP} |
* This is machine generated output. The author of ${PROGNAME} claims no |
* copyright over the contents of this file. Where legally permitted, the |
* contents herein are donated to the public domain. |
* |
* You should apply any license and copyright that you wish to this file, |
* replacing this header in its entirety. */ |
#include <stdio.h> |
#include <stdlib.h> |
#include "config.h" |
#include "util.h" |
#include "errors.h" |
#include "entry.h" |
#include "${CMDNAME}.h" |
#include "cmds.h" |
static const char *cmdname = "${CMDNAME}"; |
/* Dispays help for ${CMDNAME} in various levels */ |
void ${HELPENTRY}(unsigned int level) |
{ |
printf("This is the %s help for '%s'.\n", |
level ? EXT_HELP : SHORT_HELP, cmdname); |
return; |
} |
EOF |
[ "${CMDTYPE}" = "module" ] && cat << EOF >> ${OUTDIR}/${CMDNAME}.c |
/* Main entry point for ${CMDNAME}, accepts an array of arguments */ |
int ${CMDENTRY}(char **argv) |
EOF |
[ "${CMDTYPE}" = "builtin" ] && cat << EOF >> ${OUTDIR}/${CMDNAME}.c |
/* Main entry point for ${CMDNAME}, accepts an array of arguments and a |
* pointer to the cliuser_t structure */ |
int ${CMDENTRY}(char **argv, cliuser_t *usr) |
EOF |
cat << EOF >> ${OUTDIR}/${CMDNAME}.c |
{ |
unsigned int argc; |
unsigned int i; |
/* Count the arguments */ |
for (argc = 0; argv[argc] != NULL; argc ++); |
printf("%s %s\n", TEST_ANNOUNCE, cmdname); |
printf("%d arguments passed to %s", argc - 1, cmdname); |
if (argc < 2) { |
printf("\n"); |
return CMD_SUCCESS; |
} |
printf(":\n"); |
for (i = 1; i < argc; i++) |
printf("[%d] -> %s\n", i, argv[i]); |
return CMD_SUCCESS; |
} |
EOF |
printf "Done.\n\nYou should now modify %ss/%ss.h and ../Makefile" \ |
"${CMDTYPE}" "${CMDTYPE}" |
printf " to include your new command.\n" |
[ -n "$CMDALIAS" ] && { |
printf "\nYou should also modify %ss/%s_aliases.h and " \ |
"${CMDTYPE}" "${CMDTYPE}" |
printf "add %s as an alias for %s\n" \ |
"${CMDALIAS}" "${CMDNAME}" |
} |
printf "\nOnce completed, re-run make\n\n" |
} |
# Main program |
TIMESTAMP="$(date)" |
PROGNAME=$(basename $0) |
PROGVER="0.0.1" |
PROGMAINT="Tim Post <echo@echoreply.us>" |
DEFAULT_COMMAND="cmdname" |
# We need at least one |
[ $# = 0 ] && usage && exit 1; |
TEMP=$(getopt -o n:d:e:h:a:t:HV \ |
--long name:,desc:,entry:,help-entry:,alias:,type:,help,version \ |
-- "$@") || { |
echo "Try $PROGNAME --help for help" |
} |
eval set -- "$TEMP" |
while true; do |
case "$1" in |
-n | --name) |
CMDNAME="$2" |
shift 2 |
continue |
;; |
-d | --desc) |
CMDDESC="$2" |
shift 2 |
continue |
;; |
-e | --entry) |
CMDENTRY="$2" |
shift 2 |
continue |
;; |
-h | --help-entry) |
HELPENTRY="$2" |
shift 2 |
continue |
;; |
-a | --alias) |
CMDALIAS="$2" |
shift 2 |
continue |
;; |
-t | --type) |
CMDTYPE="$2" |
shift 2 |
continue |
;; |
-H | --help) |
usage |
exit 0 |
;; |
-V | --version) |
echo "$PROGVER" |
exit 0 |
;; |
--) |
break |
;; |
esac |
done |
# Pick up a location if one was specified |
eval set -- "$*" |
[ -n "$2" ] && OUTDIR="$2" |
# Fill in defaults for whatever was not specified |
[ -n "$CMDNAME" ] || CMDNAME="$DEFAULT_COMMAND" |
[ -n "$CMDDESC" ] || CMDDESC="The $CMDNAME command" |
[ -n "$CMDENTRY" ] || CMDENTRY="cmd_${CMDNAME}" |
[ -n "$HELPENTRY" ] || HELPENTRY="help_cmd_${CMDNAME}" |
[ -n "$CMDTYPE" ] || CMDTYPE="module" |
[ -n "$OUTDIR" ] || OUTDIR="${CMDTYPE}s/${CMDNAME}" |
# Do a little sanity |
[ -d $OUTDIR ] && { |
echo "$OUTDIR already exists, remove it to proceed." |
exit 1 |
} |
mkdir -p ${OUTDIR} >/dev/null 2>&1 || { |
echo "Could not create ${OUTDIR}, aborting!" |
exit 1 |
} |
# Generate the files and inform on how to include them based on options |
generate_code |
exit 0 |
Property changes: |
Added: svn:executable |
+* |
\ No newline at end of property |
//branches/snapshot/uspace/app/bdsh/cmds/cmds.h |
---|
0,0 → 1,71 |
#ifndef CMDS_H |
#define CMDS_H |
#include "config.h" |
#include "scli.h" |
/* Temporary to store strings */ |
#define EXT_HELP "extended" |
#define SHORT_HELP "short" |
#define TEST_ANNOUNCE "Hello, this is :" |
/* Simple levels of help displays */ |
#define HELP_SHORT 0 |
#define HELP_LONG 1 |
/* Acceptable buffer sizes (for strn functions) */ |
/* TODO: Move me, other files duplicate these needlessly */ |
#define BUFF_LARGE 1024 |
#define BUFF_SMALL 255 |
/* Return macros for int type entry points */ |
#define CMD_FAILURE 1 |
#define CMD_SUCCESS 0 |
/* Types for module command entry and help */ |
typedef int (* mod_entry_t)(char **); |
typedef void (* mod_help_t)(unsigned int); |
/* Built-in commands need to be able to modify cliuser_t */ |
typedef int (* builtin_entry_t)(char **, cliuser_t *); |
typedef void (* builtin_help_t)(unsigned int); |
/* Module structure */ |
typedef struct { |
char *name; /* Name of the command */ |
char *desc; /* Description of the command */ |
mod_entry_t entry; /* Command (exec) entry function */ |
mod_help_t help; /* Command (help) entry function */ |
} module_t; |
/* Builtin structure, same as modules except different types of entry points */ |
typedef struct { |
char *name; |
char *desc; |
builtin_entry_t entry; |
builtin_help_t help; |
int restricted; |
} builtin_t; |
/* Declared in cmds/modules/modules.h and cmds/builtins/builtins.h |
* respectively */ |
extern module_t modules[]; |
extern builtin_t builtins[]; |
/* Prototypes for module launchers */ |
extern int module_is_restricted(int); |
extern int is_module(const char *); |
extern int is_module_alias(const char *); |
extern char * alias_for_module(const char *); |
extern int help_module(int, unsigned int); |
extern int run_module(int, char *[]); |
/* Prototypes for builtin launchers */ |
extern int builtin_is_restricted(int); |
extern int is_builtin(const char *); |
extern int is_builtin_alias(const char *); |
extern char * alias_for_builtin(const char *); |
extern int help_builtin(int, unsigned int); |
extern int run_builtin(int, char *[], cliuser_t *); |
#endif |
//branches/snapshot/uspace/app/bdsh/input.c |
---|
0,0 → 1,164 |
/* Copyright (c) 2008, Tim Post <tinkertim@gmail.com> |
* All rights reserved. |
* Copyright (c) 2008, Jiri Svoboda - All Rights Reserved |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions are met: |
* |
* Redistributions of source code must retain the above copyright notice, this |
* list of conditions and the following disclaimer. |
* |
* 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. |
* |
* Neither the name of the original program's authors 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 OWNER 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 <stdio.h> |
#include <stdlib.h> |
#include <string.h> |
#include <io/console.h> |
#include <io/keycode.h> |
#include <io/style.h> |
#include <vfs/vfs.h> |
#include <errno.h> |
#include <bool.h> |
#include "config.h" |
#include "util.h" |
#include "scli.h" |
#include "input.h" |
#include "errors.h" |
#include "exec.h" |
static void read_line(char *, int); |
/* Tokenizes input from console, sees if the first word is a built-in, if so |
* invokes the built-in entry point (a[0]) passing all arguments in a[] to |
* the handler */ |
int tok_input(cliuser_t *usr) |
{ |
char *cmd[WORD_MAX]; |
int n = 0, i = 0; |
int rc = 0; |
char *tmp; |
if (NULL == usr->line) |
return CL_EFAIL; |
tmp = str_dup(usr->line); |
cmd[n] = strtok(tmp, " "); |
while (cmd[n] && n < WORD_MAX) { |
cmd[++n] = strtok(NULL, " "); |
} |
/* We have rubbish */ |
if (NULL == cmd[0]) { |
rc = CL_ENOENT; |
goto finit; |
} |
/* Its a builtin command ? */ |
if ((i = (is_builtin(cmd[0]))) > -1) { |
rc = run_builtin(i, cmd, usr); |
goto finit; |
/* Its a module ? */ |
} else if ((i = (is_module(cmd[0]))) > -1) { |
rc = run_module(i, cmd); |
goto finit; |
} |
/* See what try_exec thinks of it */ |
rc = try_exec(cmd[0], cmd); |
finit: |
if (NULL != usr->line) { |
free(usr->line); |
usr->line = (char *) NULL; |
} |
if (NULL != tmp) |
free(tmp); |
return rc; |
} |
static void read_line(char *buffer, int n) |
{ |
console_event_t ev; |
size_t offs, otmp; |
wchar_t dec; |
offs = 0; |
while (true) { |
fflush(stdout); |
if (!console_get_event(fphone(stdin), &ev)) |
return; |
if (ev.type != KEY_PRESS) |
continue; |
if (ev.key == KC_ENTER || ev.key == KC_NENTER) |
break; |
if (ev.key == KC_BACKSPACE) { |
if (offs > 0) { |
/* |
* Back up until we reach valid start of |
* character. |
*/ |
while (offs > 0) { |
--offs; otmp = offs; |
dec = str_decode(buffer, &otmp, n); |
if (dec != U_SPECIAL) |
break; |
} |
putchar('\b'); |
} |
continue; |
} |
if (ev.c >= ' ') { |
if (chr_encode(ev.c, buffer, &offs, n - 1) == EOK) |
putchar(ev.c); |
} |
} |
putchar('\n'); |
buffer[offs] = '\0'; |
} |
/* TODO: |
* Implement something like editline() / readline(), if even |
* just for command history and making arrows work. */ |
void get_input(cliuser_t *usr) |
{ |
char line[INPUT_MAX]; |
fflush(stdout); |
console_set_style(fphone(stdout), STYLE_EMPHASIS); |
printf("%s", usr->prompt); |
fflush(stdout); |
console_set_style(fphone(stdout), STYLE_NORMAL); |
read_line(line, INPUT_MAX); |
/* Make sure we don't have rubbish or a C/R happy user */ |
if (str_cmp(line, "") == 0 || str_cmp(line, "\n") == 0) |
return; |
usr->line = str_dup(line); |
return; |
} |
//branches/snapshot/uspace/app/bdsh/exec.c |
---|
0,0 → 1,130 |
/* Copyright (c) 2008, Tim Post <tinkertim@gmail.com> |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions are met: |
* |
* Redistributions of source code must retain the above copyright notice, this |
* list of conditions and the following disclaimer. |
* |
* 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. |
* |
* Neither the name of the original program's authors 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 OWNER 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. |
*/ |
/* The VERY basics of execute in place support. These are buggy, leaky |
* and not nearly done. Only here for beta testing!! You were warned!! |
* TODO: |
* Hash command lookups to save time |
* Create a running pointer to **path and advance/rewind it as we go */ |
#include <stdio.h> |
#include <stdlib.h> |
#include <unistd.h> |
#include <string.h> |
#include <fcntl.h> |
#include "config.h" |
#include "util.h" |
#include "exec.h" |
#include "errors.h" |
/* FIXME: Just have find_command() return an allocated string */ |
static char *found; |
static char *find_command(char *); |
static int try_access(const char *); |
/* work-around for access() */ |
static int try_access(const char *f) |
{ |
int fd; |
fd = open(f, O_RDONLY); |
if (fd > -1) { |
close(fd); |
return 0; |
} else |
return -1; |
} |
/* Returns the full path of "cmd" if cmd is found, else just hand back |
* cmd as it was presented */ |
static char *find_command(char *cmd) |
{ |
char *path_tok; |
char *path[PATH_MAX]; |
int n = 0, i = 0; |
size_t x = str_size(cmd) + 2; |
found = (char *)malloc(PATH_MAX); |
/* The user has specified a full or relative path, just give it back. */ |
if (-1 != try_access(cmd)) { |
return (char *) cmd; |
} |
path_tok = str_dup(PATH); |
/* Extract the PATH env to a path[] array */ |
path[n] = strtok(path_tok, PATH_DELIM); |
while (NULL != path[n]) { |
if ((str_size(path[n]) + x ) > PATH_MAX) { |
cli_error(CL_ENOTSUP, |
"Segment %d of path is too large, search ends at segment %d", |
n, n-1); |
break; |
} |
path[++n] = strtok(NULL, PATH_DELIM); |
} |
/* We now have n places to look for the command */ |
for (i=0; path[i]; i++) { |
memset(found, 0, sizeof(found)); |
snprintf(found, PATH_MAX, "%s/%s", path[i], cmd); |
if (-1 != try_access(found)) { |
free(path_tok); |
return (char *) found; |
} |
} |
/* We didn't find it, just give it back as-is. */ |
free(path_tok); |
return (char *) cmd; |
} |
unsigned int try_exec(char *cmd, char **argv) |
{ |
task_id_t tid; |
char *tmp; |
tmp = str_dup(find_command(cmd)); |
free(found); |
tid = task_spawn((const char *)tmp, argv); |
free(tmp); |
if (tid == 0) { |
cli_error(CL_EEXEC, "Cannot spawn `%s'.", cmd); |
return 1; |
} |
task_wait(tid); |
return 0; |
} |
//branches/snapshot/uspace/app/bdsh/Makefile |
---|
0,0 → 1,139 |
# Copyright (c) 2005, Martin Decky |
# All rights reserved. |
# Copyright (c) 2008, Tim Post <tinkertim@gmail.com> |
# All rights reserved. |
# |
# Redistribution and use in source and binary forms, with or without |
# modification, are permitted provided that the following conditions are met: |
# |
# Redistributions of source code must retain the above copyright notice, this |
# list of conditions and the following disclaimer. |
# |
# 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. |
# |
# Neither the name of the original program's authors 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 OWNER 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 ../../../version |
LIBC_PREFIX = ../../lib/libc |
SOFTINT_PREFIX = ../../lib/softint |
LIBBLOCK_PREFIX = ../../lib/libblock |
include $(LIBC_PREFIX)/Makefile.toolchain |
CFLAGS += -I../../srv/kbd/include -I$(LIBBLOCK_PREFIX) |
LIBS = $(LIBBLOCK_PREFIX)/libblock.a $(LIBC_PREFIX)/libc.a |
DEFS += -DRELEASE=$(RELEASE) |
PROGRAM = bdsh |
# Any directory that cleaning targets should know about |
SUBDIRS = \ |
./ \ |
cmds/ \ |
cmds/modules/ \ |
cmds/modules/help/ \ |
cmds/modules/mkdir/ \ |
cmds/modules/rm/ \ |
cmds/modules/bdd/ \ |
cmds/modules/cat/ \ |
cmds/modules/touch/ \ |
cmds/modules/ls/ \ |
cmds/modules/pwd/ \ |
cmds/modules/sleep/ \ |
cmds/modules/cp/ \ |
cmds/modules/mv/ \ |
cmds/modules/mount/ \ |
cmds/modules/kcon/ \ |
cmds/builtins/ \ |
cmds/builtins/exit/\ |
cmds/builtins/cd/ |
SOURCES = \ |
cmds/modules/help/help.c \ |
cmds/modules/mkdir/mkdir.c \ |
cmds/modules/rm/rm.c \ |
cmds/modules/bdd/bdd.c \ |
cmds/modules/cat/cat.c \ |
cmds/modules/touch/touch.c \ |
cmds/modules/ls/ls.c \ |
cmds/modules/pwd/pwd.c \ |
cmds/modules/sleep/sleep.c \ |
cmds/modules/cp/cp.c \ |
cmds/modules/mv/mv.c \ |
cmds/modules/mount/mount.c \ |
cmds/modules/kcon/kcon.c \ |
cmds/builtins/exit/exit.c \ |
cmds/builtins/cd/cd.c \ |
cmds/mod_cmds.c \ |
cmds/builtin_cmds.c \ |
errors.c \ |
input.c \ |
util.c \ |
exec.c \ |
scli.c |
CFLAGS += -I. -Icmds/ -Icmds/builtins -Icmds/modules |
OBJECTS = $(SOURCES:.c=.o) |
# For easy cleaning, *.o is already handled |
CLEANDIRS := $(addsuffix *~,$(SUBDIRS)) |
CLEANDIRS += $(addsuffix *.bak,$(SUBDIRS)) |
CLEANDIRS += $(addsuffix *.tmp,$(SUBDIRS)) |
CLEANDIRS += $(addsuffix *.out,$(SUBDIRS)) |
CLEANDIRS += $(addsuffix *.d,$(SUBDIRS)) |
CLEANDIRS += $(addsuffix *.gch,$(SUBDIRS) ) |
%.o: %.S |
$(CC) $(DEFS) $(AFLAGS) $(CFLAGS) -D__ASM__ -c $< -o $@ |
%.o: %.s |
$(AS) $(AFLAGS) $< -o $@ |
%.o: %.c |
$(CC) $(CFLAGS) $(INC) -c $< -o $@ |
@$(CC) -M $(CFLAGS) $(INC) $*.c > $*.d |
$(PROGRAM): $(OBJECTS) $(LIBS) |
$(LD) -T $(LIBC_PREFIX)/arch/$(UARCH)/_link.ld $(OBJECTS) $(LIBS) $(LFLAGS) -o $@ -Map $(PROGRAM).map |
# Everything else is a phony target |
.PHONY: all clean distclean depend disasm |
all: $(PROGRAM) disasm |
clean: |
@-rm -f $(OBJECTS) |
@-rm -f $(PROGRAM) |
@-rm -f $(PROGRAM).map |
@-rm -f $(PROGRAM).disasm |
@-rm -f $(CLEANDIRS) |
depend: |
@echo '' |
disasm: |
$(OBJDUMP) -d $(PROGRAM) >$(PROGRAM).disasm |
distclean: clean |
# Do not delete - dependencies |
-include $(OBJECTS:.o=.d) |
//branches/snapshot/uspace/app/bdsh/AUTHORS |
---|
0,0 → 1,14 |
Written by Tim Post <echo@echoreply.us> to serve as a primitive shell |
for HelenOS, or as a template to make a command line interface that |
offers shell like creature comforts. |
This program was mostly written from scratch, some existing code was |
used from other various free software projects: |
* Based on the HelenOS testing sub-system written by Martin Decky |
* read_line() (input.c) was written by Jiri Svoboda |
Individual author copyrights are listed in the headers of each file. |
//branches/snapshot/uspace/app/bdsh/util.c |
---|
0,0 → 1,82 |
/* Copyright (c) 2008, Tim Post <tinkertim@gmail.com> - All rights reserved |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions are met: |
* |
* Redistributions of source code must retain the above copyright notice, this |
* list of conditions and the following disclaimer. |
* |
* 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. |
* |
* Neither the name of the original program's authors 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 OWNER 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 <stdio.h> |
#include <string.h> |
#include <stdarg.h> |
#include <stdlib.h> |
#include <stdarg.h> |
#include "config.h" |
#include "errors.h" |
#include "util.h" |
extern volatile int cli_errno; |
/* Count and return the # of elements in an array */ |
unsigned int cli_count_args(char **args) |
{ |
unsigned int i; |
for (i=0; args[i] != NULL; i++); |
return i; |
} |
/* (re)allocates memory to store the current working directory, gets |
* and updates the current working directory, formats the prompt |
* string */ |
unsigned int cli_set_prompt(cliuser_t *usr) |
{ |
usr->prompt = (char *) realloc(usr->prompt, PATH_MAX); |
if (NULL == usr->prompt) { |
cli_error(CL_ENOMEM, "Can not allocate prompt"); |
cli_errno = CL_ENOMEM; |
return 1; |
} |
memset(usr->prompt, 0, sizeof(usr->prompt)); |
usr->cwd = (char *) realloc(usr->cwd, PATH_MAX); |
if (NULL == usr->cwd) { |
cli_error(CL_ENOMEM, "Can not allocate cwd"); |
cli_errno = CL_ENOMEM; |
return 1; |
} |
memset(usr->cwd, 0, sizeof(usr->cwd)); |
usr->cwd = getcwd(usr->cwd, PATH_MAX - 1); |
if (NULL == usr->cwd) |
snprintf(usr->cwd, PATH_MAX, "(unknown)"); |
asprintf(&usr->prompt, "%s # ", usr->cwd); |
return 0; |
} |
//branches/snapshot/uspace/app/bdsh/util.h |
---|
0,0 → 1,10 |
#ifndef UTIL_H |
#define UTIL_H |
#include "scli.h" |
/* Utility functions */ |
extern unsigned int cli_count_args(char **); |
extern unsigned int cli_set_prompt(cliuser_t *usr); |
#endif |
//branches/snapshot/uspace/app/bdsh/scli.c |
---|
0,0 → 1,105 |
/* Copyright (c) 2008, Tim Post <tinkertim@gmail.com> |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions are met: |
* |
* Redistributions of source code must retain the above copyright notice, this |
* list of conditions and the following disclaimer. |
* |
* 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. |
* |
* Neither the name of the original program's authors 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 OWNER 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 <stdio.h> |
#include <stdlib.h> |
#include <string.h> |
#include <unistd.h> |
#include "config.h" |
#include "scli.h" |
#include "input.h" |
#include "util.h" |
#include "errors.h" |
#include "cmds/cmds.h" |
/* See scli.h */ |
static cliuser_t usr; |
/* Globals that are modified during start-up that modules/builtins |
* should be aware of. */ |
volatile unsigned int cli_quit = 0; |
volatile unsigned int cli_verbocity = 1; |
/* The official name of this program |
* (change to your liking in configure.ac and re-run autoconf) */ |
const char *progname = PACKAGE_NAME; |
/* These are not exposed, even to builtins */ |
static int cli_init(cliuser_t *); |
static void cli_finit(cliuser_t *); |
/* Constructor */ |
static int cli_init(cliuser_t *usr) |
{ |
usr->line = (char *) NULL; |
usr->name = "root"; |
usr->home = "/"; |
usr->cwd = (char *) NULL; |
usr->prompt = (char *) NULL; |
chdir(usr->home); |
usr->lasterr = 0; |
return (int) cli_set_prompt(usr); |
} |
/* Destructor */ |
static void cli_finit(cliuser_t *usr) |
{ |
if (NULL != usr->line) |
free(usr->line); |
if (NULL != usr->prompt) |
free(usr->prompt); |
if (NULL != usr->cwd) |
free(usr->cwd); |
} |
int main(int argc, char *argv[]) |
{ |
int ret = 0; |
if (cli_init(&usr)) |
exit(EXIT_FAILURE); |
printf("Welcome to %s - %s\nType `help' at any time for usage information.\n", |
progname, PACKAGE_STRING); |
while (!cli_quit) { |
get_input(&usr); |
if (NULL != usr.line) { |
ret = tok_input(&usr); |
cli_set_prompt(&usr); |
usr.lasterr = ret; |
} |
} |
goto finit; |
finit: |
cli_finit(&usr); |
return ret; |
} |
//branches/snapshot/uspace/app/bdsh/config.h |
---|
0,0 → 1,36 |
/* Various things that are used in many places including a few |
* tidbits left over from autoconf prior to the HelenOS port */ |
/* Specific port work-arounds : */ |
#ifndef PATH_MAX |
#define PATH_MAX 255 |
#endif |
#ifndef EXIT_SUCCESS |
#define EXIT_SUCCESS 0 |
#define EXIT_FAILURE 1 |
#endif |
/* Work around for getenv() */ |
#define PATH "/srv:/app" |
#define PATH_DELIM ":" |
/* Used in many places */ |
#define SMALL_BUFLEN 256 |
#define LARGE_BUFLEN 1024 |
/* How many words (arguments) are permitted, how big can a whole |
* sentence be? Similar to ARG_MAX */ |
#define WORD_MAX 255 |
#define INPUT_MAX 1024 |
/* Leftovers from Autoconf */ |
#define PACKAGE_MAINTAINER "Tim Post" |
#define PACKAGE_BUGREPORT "echo@echoreply.us" |
#define PACKAGE_NAME "bdsh" |
#define PACKAGE_STRING "The brain dead shell" |
#define PACKAGE_TARNAME "bdsh" |
#define PACKAGE_VERSION "0.0.1" |
//branches/snapshot/uspace/app/bdsh/README |
---|
0,0 → 1,252 |
BDSH - The Brain Dead Shell | Design Documentation |
-------------------------------------------------- |
Overview: |
========= |
BDSH was written as a drop in command line interface for HelenOS to permit |
interactive access to persistent file systems in development. BDSH was |
written from scratch with a very limited userspace standard C library in |
mind. Much like the popular Busybox program, BDSH provides a very limited |
shell with limited common UNIX creature comforts built in. |
Porting Busybox (and by extension ASH) would have taken much longer to |
complete, much less make stable due to stark differences between Linux and |
Spartan with regards to IPC, term I/O and process creation. BDSH was written |
and made stable within the space of less than 30 days. |
BDSH will eventually evolve and be refined into the HelenOS equivalent |
of Busybox. While BDSH is now very intrinsic to HelenOS, its structure and |
use of strictly lower level functions makes it extremely easy to port. |
Design: |
======= |
BDSH is made up of three basic components: |
1. Main i/o, error handling and task management |
2. The builtin sub system |
3. The module sub system |
The main part handles user input, reports errors, spawns external tasks and |
provides a convenient entry point for built-in and modular commands. A simple |
structure, cliuser_t keeps track of the user's vitals, such as their current |
working directory (and eventually uid, home directory, etc if they apply). |
This part defines and exposes all functions that are not intrinsic to a |
certain built in or modular command. For instance: string handlers, |
module/builtin search and launch functions, error handlers and other things |
can be found here. |
Builtin commands are commands that must have access to cliuser_t, which is |
not exposed to modular commands. For instance, the 'cd' command must update |
the current working directory, which is stored in cliuser_t. As such, the |
entry types for builtin commands are slightly different. |
Modular commands do not need anything more than the basic functions that are |
exposed by default. They do not need to modify cliuser_t, they are just self |
contained. A modular command could very easily be made into a stand alone |
program, likewise any stand alone program could easily become a modular |
command. |
Both modular and builtin commands share two things in common. Both must have |
two entry points, one to invoke the command and one to invoke a help display |
for the command. Exec (main()) entry points are int * and are expected to |
return a value. Help entry points are void *, no return value is expected. |
They are typed as such (from cmds.h): |
/* Types for module command entry and help */ |
typedef int (* mod_entry_t)(char **); |
typedef void (* mod_help_t)(unsigned int); |
/* Built-in commands need to be able to modify cliuser_t */ |
typedef int (* builtin_entry_t)(char **, cliuser_t *); |
typedef void (* builtin_help_t)(unsigned int); |
As you can see, both modular and builtin commands expect an array of |
arguments, however bulitins also expect to be pointed to cliuser_t. |
Both are defined with the same simple structure: |
/* Module structure */ |
typedef struct { |
char *name; /* Name of the command */ |
char *desc; /* Description of the command */ |
mod_entry_t entry; /* Command (exec) entry function */ |
mod_help_t help; /* Command (help) entry function */ |
int restricted; /* Restricts to interactive/non-interactive only */ |
} module_t; |
NOTE: Builtin commands may grow in this respect, that is why they are |
defined separately. |
Builtins, of course, would use the builtin_entry_t type. The name of the |
command is used to associate user input to a possible entry point. The |
description is a short (40 - 60 chars) summary of what the command does. Both |
entry points are then defined, and the restrict value is used to determine a |
commands availability. |
Restriction levels are easy, a command is either available exclusively within |
interactive mode, exclusively within non-interactive mode or both. If you are |
looking at a prompt, you are in interactive mode. If you issue a command like |
this: |
/sbin/bdsh command [arg1] [arg2] |
... you are in non interactive mode. This is done when you need to force the |
parent shell to be the one who actually handles the command, or ensure that |
/sbin/ls was used in lieu of the built in 'ls' when in non-interactive mode. |
The values are: |
0 : Unrestricted |
-1 : Interactive only |
1 : Non-interactive only |
A script to generate skeletal files for a new command is included, it can be |
found in cmds/mknewcmd. To generate a new modular command named 'foo', which |
should also be reachable by typing 'f00', you would issue this command: |
./mknewcmd -n foo -a f00 -t module |
This generates all needed files and instructs you on how to include your new |
command in the build and make it accessible. By default, the command will be |
unrestricted. Builtin commands can be created by changing 'module' to |
'builtin' |
There are more options to mknewcmd, which allow you to specify the |
description, entry point, help entry point, or restriction. By default, names |
just follow the command such as cmd_foo(), help_cmd_foo(), 'The foo command', |
etc. If you want to see the options and explanations in detail, use |
./mknewcmd --help. |
When working with commands, keep in mind that only the main and help entry |
points need to be exposed. If commands share the same functions, put them |
where they are exposed to all commands, without the potential oops of those |
functions going away if the command is eliminated in favor of a stand alone |
external program. |
The util.c file is a great place to put those types of functions. |
Also, be careful with globals, option structures, etc. The compiler will |
generally tell you if you've made a mistake, however declaring: |
volatile int foo |
... in a command will allow for anything else to pick it up. Sometimes |
this could be desirable .. other times not. When communicating between |
builtins and the main system, try to use cliuser_t. The one exception |
for this is the cli_quit global, since everything may at some point |
need to check it. Modules should only communicate their return value. |
Symbolic constants that everything needs should go in the config.h file, |
however this is not the place to define shared macros. |
Making a program into a module |
============================== |
If you have some neat program that would be useful as a modular command, |
converting it is not very hard. The following steps should get you through |
the process easily (assuming your program is named 'foo'): |
1: Use mknewcmd to generate the skeletal files. |
2: Change your "usage()" command as shown: |
-- void usage(...) |
++ void help_cmd_foo(unsigned int level) |
'level' is either 0 or 1, indicating the level of help requested. |
If the help / usage function currently exits based on how it is |
called, you'll need to change it. |
3: Change the programs "main()" as shown: |
-- int main(int argc, char **argv) |
++ int cmd_foo(char **argv) |
-- return 1; |
++ return CMD_FAILURE; |
-- return 0; |
++ return CMD_SUCCESS; |
NOTE: If main is void, you'll need to change it and ensure that its |
expecting an array of arguments, even if they'll never be read or |
used. I.e.: |
-- void main(void) |
++ int cmd_foo(char **argv) |
4: Don't expose more than the entry and help points: |
-- void my_function(int n) |
++ static void my_function(int n) |
5: Copy/paste to the stub generated by mknewcmd then add your files to the |
Makefile. Be sure to add any directories that you made to the SUBDIRS so |
that a 'make clean' will clean them. |
Provided that all functions that your calling are available in the |
userspace C library, your program should compile just fine and appear |
as a modular command. |
Overcoming userspace libc obstacles |
=================================== |
A quick glance through the util.c file will reveal functions like |
cli_strdup(), cli_strtok(), cli_strtok_r() and more. Those are functions |
that were missing from userspace libc when BDSH was born. Later, after |
porting what was needed from FBSD/NBSD, the real functions appeared in |
the userspace libc after being tested in their cli_* implementations. |
Those functions remain because they guarantee that bdsh will work even |
on systems that lack them. Additionally, more BDSH specific stuff can |
go into them, such as error handling and reporting when malloc() fails. |
You will also notice that FILE, fopen() (and all friends), ato*() and |
other common things might be missing. The HelenOS userspace C library is |
still very young, you are sure to run into something that you want/need |
which is missing. |
When that happens, you have three options: |
1 - Implement it internally in util.c , when its tested and stable send a |
patch to HelenOS asking for your function to be included in libc. This is |
the best option, as you not only improve BDSH .. but HelenOS as a whole. |
2 - Work around it. Not everyone can implement / port fopen() and all of |
its friends. Make open(), read(), write() (etc) work if at all possible. |
3 - Send an e-mail to the HelenOS development mailing list. Explain why you |
need the function and what its absence is holding up. |
If what you need is part of a library that is typically a shared object, try |
to implement a 'mini' version of it. Currently, all userspace applications |
are statically linked. Giving up creature comforts for size while avoiding |
temporary 'band aids' is never frowned upon. |
Most of all, don't get discouraged .. ask for some help prior to giving up |
if you just can't accomplish something with the limited means provided. |
Contributing |
============ |
I will take any well written patch that sanely improves or expands BDSH. Send |
me a patch against the trunk revision, or, if you like a Mercurial repository |
is also maintained at http://echoreply.us/hg/bdsh.hg and kept in sync with |
the trunk. |
Please be sure to follow the simple coding standards outlined at |
http://www.helenos.eu/cstyle (mostly just regarding formatting), test your |
changes and make sure your patch applies cleanly against the latest revision. |
All patches submitted must be your original code, or a derivative work of |
something licensed under the same 3 clause BSD license as BDSH. See LICENSE |
for more information. |
When sending patches, you agree that your work will be published under the |
same 3 clause BSD license as BDSH itself. Failure to ensure that anything |
you used is not under the same or less restrictive license could cause major |
issues for BDSH in the future .. please be sure. Also, please don't forget |
to add yourself in the AUTHORS file, as I am horrible about keeping such |
things up to date. |
//branches/snapshot/uspace/app/bdsh/scli.h |
---|
0,0 → 1,16 |
#ifndef SCLI_H |
#define SCLI_H |
#include "config.h" |
#include <stdint.h> |
typedef struct { |
char *name; |
char *home; |
char *line; |
char *cwd; |
char *prompt; |
int lasterr; |
} cliuser_t; |
#endif |
//branches/snapshot/uspace/app/bdsh/input.h |
---|
0,0 → 1,11 |
#ifndef INPUT_H |
#define INPUT_H |
#include "cmds/cmds.h" |
/* prototypes */ |
extern void get_input(cliuser_t *); |
extern int tok_input(cliuser_t *); |
#endif |
//branches/snapshot/uspace/app/bdsh/exec.h |
---|
0,0 → 1,7 |
#ifndef EXEC_H |
#define EXEC_H |
#include <task.h> |
extern unsigned int try_exec(char *, char **); |
#endif |
//branches/snapshot/uspace/app/bdsh/errors.c |
---|
0,0 → 1,87 |
/* Copyright (c) 2008, Tim Post <tinkertim@gmail.com> |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions are met: |
* |
* Redistributions of source code must retain the above copyright notice, this |
* list of conditions and the following disclaimer. |
* |
* 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. |
* |
* Neither the name of the original program's authors 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 OWNER 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 <stdio.h> |
#include <string.h> |
#include <stdlib.h> |
#include <unistd.h> |
#include <stdarg.h> |
#include "config.h" |
#include "errors.h" |
#include "errstr.h" |
volatile int cli_errno = CL_EOK; |
extern volatile unsigned int cli_quit; |
/* Error printing, translation and handling functions */ |
/* Look up errno in cl_errors and return the corresponding string. |
* Return NULL if not found */ |
static char *err2str(int err) |
{ |
if (NULL != cl_errors[err]) |
return cl_errors[err]; |
return (char *)NULL; |
} |
/* Print an error report signifying errno, which is translated to |
* its corresponding human readable string. If errno > 0, raise the |
* cli_quit int that tells the main program loop to exit immediately */ |
void cli_error(int err, const char *fmt, ...) |
{ |
va_list vargs; |
va_start(vargs, fmt); |
vprintf(fmt, vargs); |
va_end(vargs); |
if (NULL != err2str(err)) |
printf(" (%s)\n", err2str(err)); |
else |
printf(" (Unknown Error %d)\n", err); |
/* If fatal, raise cli_quit so that we try to exit |
* gracefully. This will break the main loop and |
* invoke the destructor */ |
if (err == CL_EFATAL) |
cli_quit = 1; |
return; |
} |
//branches/snapshot/uspace/app/bdsh/errors.h |
---|
0,0 → 1,22 |
#ifndef ERRORS_H |
#define ERRORS_H |
/* Various error levels */ |
#define CL_EFATAL -1 |
#define CL_EOK 0 |
#define CL_EFAIL 1 |
#define CL_EBUSY 2 |
#define CL_ENOENT 3 |
#define CL_ENOMEM 4 |
#define CL_EPERM 5 |
#define CL_ENOTSUP 6 |
#define CL_EEXEC 7 |
#define CL_EEXISTS 8 |
#define CL_ETOOBIG 9 |
/* Just like 'errno' */ |
extern volatile int cli_errno; |
extern void cli_error(int, const char *, ...); |
#endif |
//branches/snapshot/uspace/app/bdsh/errstr.h |
---|
0,0 → 1,23 |
#ifndef ERRSTR_H |
#define ERRSTR_H |
/* Simple array to translate error codes to meaningful strings */ |
static char *cl_errors[] = { |
"Success", |
"Failure", |
"Busy", |
"No Such Entry", |
"Not Enough Memory", |
"Permission Denied", |
"Method Not Supported", |
"Bad command or file name", |
"Entry already exists", |
"Object too large", |
NULL |
}; |
static char *err2str(int); |
#endif |
//branches/snapshot/uspace/app/bdsh/TODO |
---|
0,0 → 1,57 |
This is a very brain dead shell. It needs some love, coffee or perhaps beer. |
Currently, you can't even really call it a shell, its more of a CLI that |
offers some shell like creature comforts. |
This was written in a hurry to provide some means of testing persistent file |
systems in HelenOS. It does its job, its nowhere near complete but it is |
actively developed. If your reading this, its likely that you're looking for |
some functionality that is not yet present. Prior to filing a bug report, |
please make sure that what you want is not on the list below. |
A list of things to do: |
----------------------- |
* rm: add support for recursively removing directories and files therein |
* Port an editor (vim?) |
* Finish cat / cp |
* Support basic redirection (i.e ls > foo.txt) |
* Expand wildcards (i.e. *.txt), don't worry about variables for now |
* Basic scripting |
* Hash previously found commands |
* Improve input, add history / etc (port libedit?) |
* Add wrappers for signal, sigaction to make ports to modules easier |
* Add 'echo' and 'printf' modules. |
Regarding POSIX: |
---------------- |
POSIX is a standard for Unix-like operating systems. HelenOS is (mostly) just |
a kernel at this point with a few userspace programs that facilitate testing |
of the kernel and file systems. |
HelenOS is not a Unix-like operating system. HelenOS is its own thing, a modern |
microkernel OS and many directions are not yet set. |
Please do not e-mail me to point out that modular implementations that resemble |
typical core utilities do not conform to some POSIX standard, these are temporary |
and serve the useful purpose of testing persistent file systems. |
Contributing: |
------------- |
If you feel like doing any of the above to-do items, I am echo@echoreply.us. Please |
e-mail me and let me know your working on something so that I do not unwittingly |
duplicate your efforts. You can also e-mail the HelenOS list directly: |
HelenOS development mailing list <helenos-devel@lists.modry.cz> |
Subscribe here if you like: http://lists.modry.cz/cgi-bin/listinfo/helenos-devel |
Cheers and happy hacking! |
--Tim |
//branches/snapshot/uspace/app/bdsh/LICENSE |
---|
0,0 → 1,28 |
Copyright (c) 2008, Tim Post <tinkertim@gmail.com> |
All rights reserved. |
Redistribution and use in source and binary forms, with or without |
modification, are permitted provided that the following conditions are met: |
Redistributions of source code must retain the above copyright notice, this |
list of conditions and the following disclaimer. |
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. |
Neither the name of the original program's authors 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 OWNER 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. |
//branches/snapshot/uspace/app/trace/trace.c |
---|
0,0 → 1,828 |
/* |
* Copyright (c) 2008 Jiri Svoboda |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup trace |
* @{ |
*/ |
/** @file |
*/ |
#include <stdio.h> |
#include <stdlib.h> |
#include <unistd.h> |
#include <ipc/ipc.h> |
#include <fibril.h> |
#include <errno.h> |
#include <udebug.h> |
#include <async.h> |
#include <task.h> |
#include <mem.h> |
#include <string.h> |
#include <loader/loader.h> |
#include <libc.h> |
// Temporary: service and method names |
#include "proto.h" |
#include <ipc/services.h> |
#include "../../srv/vfs/vfs.h" |
#include <ipc/console.h> |
#include "syscalls.h" |
#include "ipcp.h" |
#include "errors.h" |
#include "trace.h" |
#define THBUF_SIZE 64 |
uintptr_t thread_hash_buf[THBUF_SIZE]; |
int n_threads; |
int next_thread_id; |
int phoneid; |
int abort_trace; |
uintptr_t thash; |
volatile int paused; |
void thread_trace_start(uintptr_t thread_hash); |
static proto_t *proto_console; |
static task_id_t task_id; |
static loader_t *task_ldr; |
/** Combination of events/data to print. */ |
display_mask_t display_mask; |
static int program_run_fibril(void *arg); |
static void program_run(void) |
{ |
fid_t fid; |
fid = fibril_create(program_run_fibril, NULL); |
if (fid == 0) { |
printf("Error creating fibril\n"); |
exit(1); |
} |
fibril_add_ready(fid); |
} |
static int program_run_fibril(void *arg) |
{ |
int rc; |
/* |
* This must be done in background as it will block until |
* we let the task reply to this call. |
*/ |
rc = loader_run(task_ldr); |
if (rc != 0) { |
printf("Error running program\n"); |
exit(1); |
} |
free(task_ldr); |
task_ldr = NULL; |
printf("program_run_fibril exiting\n"); |
return 0; |
} |
static int connect_task(task_id_t task_id) |
{ |
int rc; |
rc = ipc_connect_kbox(task_id); |
if (rc == ENOTSUP) { |
printf("You do not have userspace debugging support " |
"compiled in the kernel.\n"); |
printf("Compile kernel with 'Support for userspace debuggers' " |
"(CONFIG_UDEBUG) enabled.\n"); |
return rc; |
} |
if (rc < 0) { |
printf("Error connecting\n"); |
printf("ipc_connect_task(%lld) -> %d ", task_id, rc); |
return rc; |
} |
phoneid = rc; |
rc = udebug_begin(phoneid); |
if (rc < 0) { |
printf("udebug_begin() -> %d\n", rc); |
return rc; |
} |
rc = udebug_set_evmask(phoneid, UDEBUG_EM_ALL); |
if (rc < 0) { |
printf("udebug_set_evmask(0x%x) -> %d\n ", UDEBUG_EM_ALL, rc); |
return rc; |
} |
return 0; |
} |
static int get_thread_list(void) |
{ |
int rc; |
size_t tb_copied; |
size_t tb_needed; |
int i; |
rc = udebug_thread_read(phoneid, thread_hash_buf, |
THBUF_SIZE*sizeof(unsigned), &tb_copied, &tb_needed); |
if (rc < 0) { |
printf("udebug_thread_read() -> %d\n", rc); |
return rc; |
} |
n_threads = tb_copied / sizeof(uintptr_t); |
printf("Threads:"); |
for (i = 0; i < n_threads; i++) { |
printf(" [%d] (hash 0x%lx)", 1+i, thread_hash_buf[i]); |
} |
printf("\ntotal of %u threads\n", tb_needed / sizeof(uintptr_t)); |
return 0; |
} |
void val_print(sysarg_t val, val_type_t v_type) |
{ |
switch (v_type) { |
case V_VOID: |
printf("<void>"); |
break; |
case V_INTEGER: |
printf("%ld", val); |
break; |
case V_HASH: |
case V_PTR: |
printf("0x%08lx", val); |
break; |
case V_ERRNO: |
if (val >= -15 && val <= 0) { |
printf("%ld %s (%s)", val, |
err_desc[-val].name, |
err_desc[-val].desc); |
} else { |
printf("%ld", val); |
} |
break; |
case V_INT_ERRNO: |
if (val >= -15 && val < 0) { |
printf("%ld %s (%s)", val, |
err_desc[-val].name, |
err_desc[-val].desc); |
} else { |
printf("%ld", val); |
} |
break; |
case V_CHAR: |
if (val >= 0x20 && val < 0x7f) { |
printf("'%c'", val); |
} else { |
switch (val) { |
case '\a': printf("'\\a'"); break; |
case '\b': printf("'\\b'"); break; |
case '\n': printf("'\\n'"); break; |
case '\r': printf("'\\r'"); break; |
case '\t': printf("'\\t'"); break; |
case '\\': printf("'\\\\'"); break; |
default: printf("'\\x%02lX'", val); break; |
} |
} |
break; |
} |
} |
static void print_sc_retval(sysarg_t retval, val_type_t val_type) |
{ |
printf(" -> "); |
val_print(retval, val_type); |
putchar('\n'); |
} |
static void print_sc_args(sysarg_t *sc_args, int n) |
{ |
int i; |
putchar('('); |
if (n > 0) printf("%ld", sc_args[0]); |
for (i = 1; i < n; i++) { |
printf(", %ld", sc_args[i]); |
} |
putchar(')'); |
} |
static void sc_ipc_call_async_fast(sysarg_t *sc_args, sysarg_t sc_rc) |
{ |
ipc_call_t call; |
ipcarg_t phoneid; |
if (sc_rc == IPC_CALLRET_FATAL || sc_rc == IPC_CALLRET_TEMPORARY) |
return; |
phoneid = sc_args[0]; |
IPC_SET_METHOD(call, sc_args[1]); |
IPC_SET_ARG1(call, sc_args[2]); |
IPC_SET_ARG2(call, sc_args[3]); |
IPC_SET_ARG3(call, sc_args[4]); |
IPC_SET_ARG4(call, sc_args[5]); |
IPC_SET_ARG5(call, 0); |
ipcp_call_out(phoneid, &call, sc_rc); |
} |
static void sc_ipc_call_async_slow(sysarg_t *sc_args, sysarg_t sc_rc) |
{ |
ipc_call_t call; |
int rc; |
if (sc_rc == IPC_CALLRET_FATAL || sc_rc == IPC_CALLRET_TEMPORARY) |
return; |
memset(&call, 0, sizeof(call)); |
rc = udebug_mem_read(phoneid, &call.args, sc_args[1], sizeof(call.args)); |
if (rc >= 0) { |
ipcp_call_out(sc_args[0], &call, sc_rc); |
} |
} |
static void sc_ipc_call_sync_fast(sysarg_t *sc_args) |
{ |
ipc_call_t question, reply; |
int rc; |
int phoneidx; |
// printf("sc_ipc_call_sync_fast()\n"); |
phoneidx = sc_args[0]; |
IPC_SET_METHOD(question, sc_args[1]); |
IPC_SET_ARG1(question, sc_args[2]); |
IPC_SET_ARG2(question, sc_args[3]); |
IPC_SET_ARG3(question, sc_args[4]); |
IPC_SET_ARG4(question, 0); |
IPC_SET_ARG5(question, 0); |
// printf("memset\n"); |
memset(&reply, 0, sizeof(reply)); |
// printf("udebug_mem_read(phone=%d, buffer_ptr=%u, src_addr=%d, n=%d\n", |
// phoneid, &reply.args, sc_args[5], sizeof(reply.args)); |
rc = udebug_mem_read(phoneid, &reply.args, sc_args[5], sizeof(reply.args)); |
// printf("dmr->%d\n", rc); |
if (rc < 0) return; |
// printf("call ipc_call_sync\n"); |
ipcp_call_sync(phoneidx, &question, &reply); |
} |
static void sc_ipc_call_sync_slow(sysarg_t *sc_args) |
{ |
ipc_call_t question, reply; |
int rc; |
memset(&question, 0, sizeof(question)); |
rc = udebug_mem_read(phoneid, &question.args, sc_args[1], sizeof(question.args)); |
printf("dmr->%d\n", rc); |
if (rc < 0) return; |
memset(&reply, 0, sizeof(reply)); |
rc = udebug_mem_read(phoneid, &reply.args, sc_args[2], sizeof(reply.args)); |
printf("dmr->%d\n", rc); |
if (rc < 0) return; |
ipcp_call_sync(sc_args[0], &question, &reply); |
} |
static void sc_ipc_wait(sysarg_t *sc_args, int sc_rc) |
{ |
ipc_call_t call; |
int rc; |
if (sc_rc == 0) return; |
memset(&call, 0, sizeof(call)); |
rc = udebug_mem_read(phoneid, &call, sc_args[0], sizeof(call)); |
// printf("udebug_mem_read(phone %d, dest %d, app-mem src %d, size %d -> %d\n", |
// phoneid, (int)&call, sc_args[0], sizeof(call), rc); |
if (rc >= 0) { |
ipcp_call_in(&call, sc_rc); |
} |
} |
static void event_syscall_b(unsigned thread_id, uintptr_t thread_hash, |
unsigned sc_id, sysarg_t sc_rc) |
{ |
sysarg_t sc_args[6]; |
int rc; |
/* Read syscall arguments */ |
rc = udebug_args_read(phoneid, thread_hash, sc_args); |
async_serialize_start(); |
// printf("[%d] ", thread_id); |
if (rc < 0) { |
printf("error\n"); |
async_serialize_end(); |
return; |
} |
if ((display_mask & DM_SYSCALL) != 0) { |
/* Print syscall name and arguments */ |
printf("%s", syscall_desc[sc_id].name); |
print_sc_args(sc_args, syscall_desc[sc_id].n_args); |
} |
async_serialize_end(); |
} |
static void event_syscall_e(unsigned thread_id, uintptr_t thread_hash, |
unsigned sc_id, sysarg_t sc_rc) |
{ |
sysarg_t sc_args[6]; |
int rv_type; |
int rc; |
/* Read syscall arguments */ |
rc = udebug_args_read(phoneid, thread_hash, sc_args); |
async_serialize_start(); |
// printf("[%d] ", thread_id); |
if (rc < 0) { |
printf("error\n"); |
async_serialize_end(); |
return; |
} |
if ((display_mask & DM_SYSCALL) != 0) { |
/* Print syscall return value */ |
rv_type = syscall_desc[sc_id].rv_type; |
print_sc_retval(sc_rc, rv_type); |
} |
switch (sc_id) { |
case SYS_IPC_CALL_ASYNC_FAST: |
sc_ipc_call_async_fast(sc_args, sc_rc); |
break; |
case SYS_IPC_CALL_ASYNC_SLOW: |
sc_ipc_call_async_slow(sc_args, sc_rc); |
break; |
case SYS_IPC_CALL_SYNC_FAST: |
sc_ipc_call_sync_fast(sc_args); |
break; |
case SYS_IPC_CALL_SYNC_SLOW: |
sc_ipc_call_sync_slow(sc_args); |
break; |
case SYS_IPC_WAIT: |
sc_ipc_wait(sc_args, sc_rc); |
break; |
default: |
break; |
} |
async_serialize_end(); |
} |
static void event_thread_b(uintptr_t hash) |
{ |
async_serialize_start(); |
printf("New thread, hash 0x%lx\n", hash); |
async_serialize_end(); |
thread_trace_start(hash); |
} |
static int trace_loop(void *thread_hash_arg) |
{ |
int rc; |
unsigned ev_type; |
uintptr_t thread_hash; |
unsigned thread_id; |
sysarg_t val0, val1; |
thread_hash = (uintptr_t)thread_hash_arg; |
thread_id = next_thread_id++; |
printf("Start tracing thread [%d] (hash 0x%lx).\n", thread_id, thread_hash); |
while (!abort_trace) { |
if (paused) { |
printf("Press R to resume (and be patient).\n"); |
while (paused) { |
usleep(1000000); |
fibril_yield(); |
printf("."); |
} |
printf("Resumed\n"); |
} |
/* Run thread until an event occurs */ |
rc = udebug_go(phoneid, thread_hash, |
&ev_type, &val0, &val1); |
// printf("rc = %d, ev_type=%d\n", rc, ev_type); |
if (ev_type == UDEBUG_EVENT_FINISHED) { |
/* Done tracing this thread */ |
break; |
} |
if (rc >= 0) { |
switch (ev_type) { |
case UDEBUG_EVENT_SYSCALL_B: |
event_syscall_b(thread_id, thread_hash, val0, (int)val1); |
break; |
case UDEBUG_EVENT_SYSCALL_E: |
event_syscall_e(thread_id, thread_hash, val0, (int)val1); |
break; |
case UDEBUG_EVENT_STOP: |
printf("Stop event\n"); |
break; |
case UDEBUG_EVENT_THREAD_B: |
event_thread_b(val0); |
break; |
case UDEBUG_EVENT_THREAD_E: |
printf("Thread 0x%lx exited.\n", val0); |
abort_trace = 1; |
break; |
default: |
printf("Unknown event type %d.\n", ev_type); |
break; |
} |
} |
} |
printf("Finished tracing thread [%d].\n", thread_id); |
return 0; |
} |
void thread_trace_start(uintptr_t thread_hash) |
{ |
fid_t fid; |
thash = thread_hash; |
fid = fibril_create(trace_loop, (void *)thread_hash); |
if (fid == 0) { |
printf("Warning: Failed creating fibril\n"); |
} |
fibril_add_ready(fid); |
} |
static loader_t *preload_task(const char *path, char *const argv[], |
task_id_t *task_id) |
{ |
loader_t *ldr; |
int rc; |
/* Spawn a program loader */ |
ldr = loader_connect(); |
if (ldr == NULL) |
return 0; |
/* Get task ID. */ |
rc = loader_get_task_id(ldr, task_id); |
if (rc != EOK) |
goto error; |
/* Send program pathname */ |
rc = loader_set_pathname(ldr, path); |
if (rc != EOK) |
goto error; |
/* Send arguments */ |
rc = loader_set_args(ldr, argv); |
if (rc != EOK) |
goto error; |
/* Load the program. */ |
rc = loader_load_program(ldr); |
if (rc != EOK) |
goto error; |
/* Success */ |
return ldr; |
/* Error exit */ |
error: |
loader_abort(ldr); |
free(ldr); |
return NULL; |
} |
static void trace_task(task_id_t task_id) |
{ |
int i; |
int rc; |
int c; |
ipcp_init(); |
/* |
* User apps now typically have console on phone 3. |
* (Phones 1 and 2 are used by the loader). |
*/ |
ipcp_connection_set(3, 0, proto_console); |
rc = get_thread_list(); |
if (rc < 0) { |
printf("Failed to get thread list (error %d)\n", rc); |
return; |
} |
abort_trace = 0; |
for (i = 0; i < n_threads; i++) { |
thread_trace_start(thread_hash_buf[i]); |
} |
while(1) { |
c = getchar(); |
if (c == 'q') break; |
if (c == 'p') { |
printf("Pause...\n"); |
paused = 1; |
rc = udebug_stop(phoneid, thash); |
printf("stop -> %d\n", rc); |
} |
if (c == 'r') { |
paused = 0; |
printf("Resume...\n"); |
} |
} |
printf("\nTerminate debugging session...\n"); |
abort_trace = 1; |
udebug_end(phoneid); |
ipc_hangup(phoneid); |
ipcp_cleanup(); |
printf("Done\n"); |
return; |
} |
static void main_init(void) |
{ |
proto_t *p; |
oper_t *o; |
val_type_t arg_def[OPER_MAX_ARGS] = { |
V_INTEGER, |
V_INTEGER, |
V_INTEGER, |
V_INTEGER, |
V_INTEGER |
}; |
val_type_t resp_def[OPER_MAX_ARGS] = { |
V_INTEGER, |
V_INTEGER, |
V_INTEGER, |
V_INTEGER, |
V_INTEGER |
}; |
next_thread_id = 1; |
paused = 0; |
proto_init(); |
p = proto_new("vfs"); |
o = oper_new("read", 1, arg_def, V_ERRNO, 1, resp_def); |
proto_add_oper(p, VFS_IN_READ, o); |
o = oper_new("write", 1, arg_def, V_ERRNO, 1, resp_def); |
proto_add_oper(p, VFS_IN_WRITE, o); |
o = oper_new("truncate", 5, arg_def, V_ERRNO, 0, resp_def); |
proto_add_oper(p, VFS_IN_TRUNCATE, o); |
o = oper_new("mount", 2, arg_def, V_ERRNO, 0, resp_def); |
proto_add_oper(p, VFS_IN_MOUNT, o); |
/* o = oper_new("unmount", 0, arg_def); |
proto_add_oper(p, VFS_IN_UNMOUNT, o);*/ |
o = oper_new("open", 2, arg_def, V_INT_ERRNO, 0, resp_def); |
proto_add_oper(p, VFS_IN_OPEN, o); |
o = oper_new("close", 1, arg_def, V_ERRNO, 0, resp_def); |
proto_add_oper(p, VFS_IN_CLOSE, o); |
o = oper_new("seek", 3, arg_def, V_ERRNO, 0, resp_def); |
proto_add_oper(p, VFS_IN_SEEK, o); |
o = oper_new("mkdir", 1, arg_def, V_ERRNO, 0, resp_def); |
proto_add_oper(p, VFS_IN_MKDIR, o); |
o = oper_new("unlink", 0, arg_def, V_ERRNO, 0, resp_def); |
proto_add_oper(p, VFS_IN_UNLINK, o); |
o = oper_new("rename", 0, arg_def, V_ERRNO, 0, resp_def); |
proto_add_oper(p, VFS_IN_RENAME, o); |
proto_register(SERVICE_VFS, p); |
p = proto_new("console"); |
resp_def[0] = V_INTEGER; resp_def[1] = V_INTEGER; |
resp_def[2] = V_INTEGER; resp_def[3] = V_CHAR; |
o = oper_new("getkey", 0, arg_def, V_ERRNO, 4, resp_def); |
arg_def[0] = V_CHAR; |
o = oper_new("clear", 0, arg_def, V_VOID, 0, resp_def); |
proto_add_oper(p, CONSOLE_CLEAR, o); |
arg_def[0] = V_INTEGER; arg_def[1] = V_INTEGER; |
o = oper_new("goto", 2, arg_def, V_VOID, 0, resp_def); |
proto_add_oper(p, CONSOLE_GOTO, o); |
resp_def[0] = V_INTEGER; resp_def[1] = V_INTEGER; |
o = oper_new("getsize", 0, arg_def, V_INTEGER, 2, resp_def); |
proto_add_oper(p, CONSOLE_GET_SIZE, o); |
arg_def[0] = V_INTEGER; |
o = oper_new("set_style", 1, arg_def, V_VOID, 0, resp_def); |
proto_add_oper(p, CONSOLE_SET_STYLE, o); |
arg_def[0] = V_INTEGER; arg_def[1] = V_INTEGER; arg_def[2] = V_INTEGER; |
o = oper_new("set_color", 3, arg_def, V_VOID, 0, resp_def); |
proto_add_oper(p, CONSOLE_SET_COLOR, o); |
arg_def[0] = V_INTEGER; arg_def[1] = V_INTEGER; |
o = oper_new("set_rgb_color", 2, arg_def, V_VOID, 0, resp_def); |
proto_add_oper(p, CONSOLE_SET_RGB_COLOR, o); |
o = oper_new("cursor_visibility", 1, arg_def, V_VOID, 0, resp_def); |
proto_add_oper(p, CONSOLE_CURSOR_VISIBILITY, o); |
proto_console = p; |
proto_register(SERVICE_CONSOLE, p); |
} |
static void print_syntax() |
{ |
printf("Syntax:\n"); |
printf("\ttrace [+<events>] <executable> [<arg1> [...]]\n"); |
printf("or\ttrace [+<events>] -t <task_id>\n"); |
printf("Events: (default is +tp)\n"); |
printf("\n"); |
printf("\tt ... Thread creation and termination\n"); |
printf("\ts ... System calls\n"); |
printf("\ti ... Low-level IPC\n"); |
printf("\tp ... Protocol level\n"); |
printf("\n"); |
printf("Examples:\n"); |
printf("\ttrace +s /app/tetris\n"); |
printf("\ttrace +tsip -t 12\n"); |
} |
static display_mask_t parse_display_mask(char *text) |
{ |
display_mask_t dm; |
char *c; |
c = text; |
while (*c) { |
switch (*c) { |
case 't': dm = dm | DM_THREAD; break; |
case 's': dm = dm | DM_SYSCALL; break; |
case 'i': dm = dm | DM_IPC; break; |
case 'p': dm = dm | DM_SYSTEM | DM_USER; break; |
default: |
printf("Unexpected event type '%c'.\n", *c); |
exit(1); |
} |
++c; |
} |
return dm; |
} |
static int parse_args(int argc, char *argv[]) |
{ |
char *arg; |
char *err_p; |
task_id = 0; |
--argc; ++argv; |
while (argc > 0) { |
arg = *argv; |
if (arg[0] == '+') { |
display_mask = parse_display_mask(&arg[1]); |
} else if (arg[0] == '-') { |
if (arg[1] == 't') { |
/* Trace an already running task */ |
--argc; ++argv; |
task_id = strtol(*argv, &err_p, 10); |
task_ldr = NULL; |
if (*err_p) { |
printf("Task ID syntax error\n"); |
print_syntax(); |
return -1; |
} |
} else { |
printf("Uknown option '%s'\n", arg[0]); |
print_syntax(); |
return -1; |
} |
} else { |
break; |
} |
--argc; ++argv; |
} |
if (task_id != 0) { |
if (argc == 0) return 0; |
printf("Extra arguments\n"); |
print_syntax(); |
return -1; |
} |
if (argc < 1) { |
printf("Missing argument\n"); |
print_syntax(); |
return -1; |
} |
/* Preload the specified program file. */ |
printf("Spawning '%s' with arguments:\n", *argv); |
{ |
char **cp = argv; |
while (*cp) printf("'%s'\n", *cp++); |
} |
task_ldr = preload_task(*argv, argv, &task_id); |
return 0; |
} |
int main(int argc, char *argv[]) |
{ |
int rc; |
printf("System Call / IPC Tracer\n"); |
printf("Controls: Q - Quit, P - Pause, R - Resume\n"); |
display_mask = DM_THREAD | DM_SYSTEM | DM_USER; |
if (parse_args(argc, argv) < 0) |
return 1; |
main_init(); |
rc = connect_task(task_id); |
if (rc < 0) { |
printf("Failed connecting to task %lld.\n", task_id); |
return 1; |
} |
printf("Connected to task %lld.\n", task_id); |
if (task_ldr != NULL) { |
program_run(); |
} |
trace_task(task_id); |
return 0; |
} |
/** @} |
*/ |
//branches/snapshot/uspace/app/trace/proto.c |
---|
0,0 → 1,236 |
/* |
* Copyright (c) 2008 Jiri Svoboda |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup trace |
* @{ |
*/ |
/** @file |
*/ |
#include <stdio.h> |
#include <stdlib.h> |
#include <ipc/ipc.h> |
#include <adt/hash_table.h> |
#include "trace.h" |
#include "proto.h" |
#define SRV_PROTO_TABLE_CHAINS 32 |
#define METHOD_OPER_TABLE_CHAINS 32 |
hash_table_t srv_proto; |
typedef struct { |
int srv; |
proto_t *proto; |
link_t link; |
} srv_proto_t; |
typedef struct { |
ipcarg_t method; |
oper_t *oper; |
link_t link; |
} method_oper_t; |
static hash_index_t srv_proto_hash(unsigned long key[]); |
static int srv_proto_compare(unsigned long key[], hash_count_t keys, |
link_t *item); |
static void srv_proto_remove_callback(link_t *item); |
hash_table_operations_t srv_proto_ops = { |
.hash = srv_proto_hash, |
.compare = srv_proto_compare, |
.remove_callback = srv_proto_remove_callback |
}; |
static hash_index_t method_oper_hash(unsigned long key[]); |
static int method_oper_compare(unsigned long key[], hash_count_t keys, |
link_t *item); |
static void method_oper_remove_callback(link_t *item); |
hash_table_operations_t method_oper_ops = { |
.hash = method_oper_hash, |
.compare = method_oper_compare, |
.remove_callback = method_oper_remove_callback |
}; |
static hash_index_t srv_proto_hash(unsigned long key[]) |
{ |
return key[0] % SRV_PROTO_TABLE_CHAINS; |
} |
static int srv_proto_compare(unsigned long key[], hash_count_t keys, |
link_t *item) |
{ |
srv_proto_t *sp; |
sp = hash_table_get_instance(item, srv_proto_t, link); |
return key[0] == sp->srv; |
} |
static void srv_proto_remove_callback(link_t *item) |
{ |
} |
static hash_index_t method_oper_hash(unsigned long key[]) |
{ |
return key[0] % METHOD_OPER_TABLE_CHAINS; |
} |
static int method_oper_compare(unsigned long key[], hash_count_t keys, |
link_t *item) |
{ |
method_oper_t *mo; |
mo = hash_table_get_instance(item, method_oper_t, link); |
return key[0] == mo->method; |
} |
static void method_oper_remove_callback(link_t *item) |
{ |
} |
void proto_init(void) |
{ |
hash_table_create(&srv_proto, SRV_PROTO_TABLE_CHAINS, 1, |
&srv_proto_ops); |
} |
void proto_cleanup(void) |
{ |
hash_table_destroy(&srv_proto); |
} |
void proto_register(int srv, proto_t *proto) |
{ |
srv_proto_t *sp; |
unsigned long key; |
sp = malloc(sizeof(srv_proto_t)); |
sp->srv = srv; |
sp->proto = proto; |
key = srv; |
hash_table_insert(&srv_proto, &key, &sp->link); |
} |
proto_t *proto_get_by_srv(int srv) |
{ |
unsigned long key; |
link_t *item; |
srv_proto_t *sp; |
key = srv; |
item = hash_table_find(&srv_proto, &key); |
if (item == NULL) return NULL; |
sp = hash_table_get_instance(item, srv_proto_t, link); |
return sp->proto; |
} |
static void proto_struct_init(proto_t *proto, char *name) |
{ |
proto->name = name; |
hash_table_create(&proto->method_oper, SRV_PROTO_TABLE_CHAINS, 1, |
&method_oper_ops); |
} |
proto_t *proto_new(char *name) |
{ |
proto_t *p; |
p = malloc(sizeof(proto_t)); |
proto_struct_init(p, name); |
return p; |
} |
void proto_delete(proto_t *proto) |
{ |
free(proto); |
} |
void proto_add_oper(proto_t *proto, int method, oper_t *oper) |
{ |
method_oper_t *mo; |
unsigned long key; |
mo = malloc(sizeof(method_oper_t)); |
mo->method = method; |
mo->oper = oper; |
key = method; |
hash_table_insert(&proto->method_oper, &key, &mo->link); |
} |
oper_t *proto_get_oper(proto_t *proto, int method) |
{ |
unsigned long key; |
link_t *item; |
method_oper_t *mo; |
key = method; |
item = hash_table_find(&proto->method_oper, &key); |
if (item == NULL) return NULL; |
mo = hash_table_get_instance(item, method_oper_t, link); |
return mo->oper; |
} |
static void oper_struct_init(oper_t *oper, char *name) |
{ |
oper->name = name; |
} |
oper_t *oper_new(char *name, int argc, val_type_t *arg_types, |
val_type_t rv_type, int respc, val_type_t *resp_types) |
{ |
oper_t *o; |
int i; |
o = malloc(sizeof(oper_t)); |
oper_struct_init(o, name); |
o->argc = argc; |
for (i = 0; i < argc; i++) |
o->arg_type[i] = arg_types[i]; |
o->rv_type = rv_type; |
o->respc = respc; |
for (i = 0; i < respc; i++) |
o->resp_type[i] = resp_types[i]; |
return o; |
} |
/** @} |
*/ |
//branches/snapshot/uspace/app/trace/proto.h |
---|
0,0 → 1,85 |
/* |
* Copyright (c) 2008 Jiri Svoboda |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup trace |
* @{ |
*/ |
/** @file |
*/ |
#ifndef PROTO_H_ |
#define PROTO_H_ |
#include <adt/hash_table.h> |
#include <ipc/ipc.h> |
#include "trace.h" |
#define OPER_MAX_ARGS (IPC_CALL_LEN - 1) |
typedef struct { |
char *name; |
int argc; |
val_type_t arg_type[OPER_MAX_ARGS]; |
val_type_t rv_type; |
int respc; |
val_type_t resp_type[OPER_MAX_ARGS]; |
} oper_t; |
typedef struct { |
/** Protocol name */ |
char *name; |
/** Maps method number to operation */ |
hash_table_t method_oper; |
} proto_t; |
/* Maps service number to protocol */ |
extern hash_table_t srv_proto; |
void proto_init(void); |
void proto_cleanup(void); |
void proto_register(int srv, proto_t *proto); |
proto_t *proto_get_by_srv(int srv); |
proto_t *proto_new(char *name); |
void proto_delete(proto_t *proto); |
void proto_add_oper(proto_t *proto, int method, oper_t *oper); |
oper_t *proto_get_oper(proto_t *proto, int method); |
oper_t *oper_new(char *name, int argc, val_type_t *arg_types, |
val_type_t rv_type, int respc, val_type_t *resp_types); |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/app/trace/ipcp.c |
---|
0,0 → 1,375 |
/* |
* Copyright (c) 2008 Jiri Svoboda |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup trace |
* @{ |
*/ |
/** @file |
*/ |
#include <stdio.h> |
#include <stdlib.h> |
#include <adt/hash_table.h> |
#include "ipc_desc.h" |
#include "proto.h" |
#include "trace.h" |
#include "ipcp.h" |
#define IPCP_CALLID_SYNC 0 |
typedef struct { |
ipcarg_t phone_hash; |
ipc_call_t question; |
oper_t *oper; |
ipc_callid_t call_hash; |
link_t link; |
} pending_call_t; |
typedef struct { |
int server; |
proto_t *proto; |
} connection_t; |
#define MAX_PHONE 64 |
connection_t connections[MAX_PHONE]; |
int have_conn[MAX_PHONE]; |
#define PCALL_TABLE_CHAINS 32 |
hash_table_t pending_calls; |
/* |
* Pseudo-protocols |
*/ |
proto_t *proto_system; /**< Protocol describing system IPC methods. */ |
proto_t *proto_unknown; /**< Protocol with no known methods. */ |
static hash_index_t pending_call_hash(unsigned long key[]); |
static int pending_call_compare(unsigned long key[], hash_count_t keys, |
link_t *item); |
static void pending_call_remove_callback(link_t *item); |
hash_table_operations_t pending_call_ops = { |
.hash = pending_call_hash, |
.compare = pending_call_compare, |
.remove_callback = pending_call_remove_callback |
}; |
static hash_index_t pending_call_hash(unsigned long key[]) |
{ |
// printf("pending_call_hash\n"); |
return key[0] % PCALL_TABLE_CHAINS; |
} |
static int pending_call_compare(unsigned long key[], hash_count_t keys, |
link_t *item) |
{ |
pending_call_t *hs; |
// printf("pending_call_compare\n"); |
hs = hash_table_get_instance(item, pending_call_t, link); |
// FIXME: this will fail if sizeof(long) < sizeof(void *). |
return key[0] == hs->call_hash; |
} |
static void pending_call_remove_callback(link_t *item) |
{ |
// printf("pending_call_remove_callback\n"); |
} |
void ipcp_connection_set(int phone, int server, proto_t *proto) |
{ |
if (phone <0 || phone >= MAX_PHONE) return; |
connections[phone].server = server; |
connections[phone].proto = proto; |
have_conn[phone] = 1; |
} |
void ipcp_connection_clear(int phone) |
{ |
have_conn[phone] = 0; |
connections[phone].server = 0; |
connections[phone].proto = NULL; |
} |
static void ipc_m_print(proto_t *proto, ipcarg_t method) |
{ |
oper_t *oper; |
/* Try system methods first */ |
oper = proto_get_oper(proto_system, method); |
if (oper == NULL && proto != NULL) { |
/* Not a system method, try the user protocol. */ |
oper = proto_get_oper(proto, method); |
} |
if (oper != NULL) { |
printf("%s (%ld)", oper->name, method); |
return; |
} |
printf("%ld", method); |
} |
void ipcp_init(void) |
{ |
ipc_m_desc_t *desc; |
oper_t *oper; |
val_type_t arg_def[OPER_MAX_ARGS] = { |
V_INTEGER, |
V_INTEGER, |
V_INTEGER, |
V_INTEGER, |
V_INTEGER |
}; |
/* |
* Create a pseudo-protocol 'unknown' that has no known methods. |
*/ |
proto_unknown = proto_new("unknown"); |
/* |
* Create a pseudo-protocol 'system' defining names of system IPC |
* methods. |
*/ |
proto_system = proto_new("system"); |
desc = ipc_methods; |
while (desc->number != 0) { |
oper = oper_new(desc->name, OPER_MAX_ARGS, arg_def, V_INTEGER, |
OPER_MAX_ARGS, arg_def); |
proto_add_oper(proto_system, desc->number, oper); |
++desc; |
} |
hash_table_create(&pending_calls, PCALL_TABLE_CHAINS, 1, &pending_call_ops); |
} |
void ipcp_cleanup(void) |
{ |
proto_delete(proto_system); |
hash_table_destroy(&pending_calls); |
} |
void ipcp_call_out(int phone, ipc_call_t *call, ipc_callid_t hash) |
{ |
pending_call_t *pcall; |
proto_t *proto; |
unsigned long key[1]; |
oper_t *oper; |
ipcarg_t *args; |
int i; |
if (have_conn[phone]) proto = connections[phone].proto; |
else proto = NULL; |
args = call->args; |
if ((display_mask & DM_IPC) != 0) { |
printf("Call ID: 0x%lx, phone: %d, proto: %s, method: ", hash, |
phone, (proto ? proto->name : "n/a")); |
ipc_m_print(proto, IPC_GET_METHOD(*call)); |
printf(" args: (%lu, %lu, %lu, %lu, %lu)\n", args[1], args[2], |
args[3], args[4], args[5]); |
} |
if ((display_mask & DM_USER) != 0) { |
if (proto != NULL) { |
oper = proto_get_oper(proto, IPC_GET_METHOD(*call)); |
} else { |
oper = NULL; |
} |
if (oper != NULL) { |
printf("%s(%d).%s", (proto ? proto->name : "n/a"), |
phone, (oper ? oper->name : "unknown")); |
putchar('('); |
for (i = 1; i <= oper->argc; ++i) { |
if (i > 1) printf(", "); |
val_print(args[i], oper->arg_type[i - 1]); |
} |
putchar(')'); |
if (oper->rv_type == V_VOID && oper->respc == 0) { |
/* |
* No response data (typically the task will |
* not be interested in the response). |
* We will not display response. |
*/ |
putchar('.'); |
} |
putchar('\n'); |
} |
} else { |
oper = NULL; |
} |
/* Store call in hash table for response matching */ |
pcall = malloc(sizeof(pending_call_t)); |
pcall->phone_hash = phone; |
pcall->question = *call; |
pcall->call_hash = hash; |
pcall->oper = oper; |
key[0] = hash; |
hash_table_insert(&pending_calls, key, &pcall->link); |
} |
static void parse_answer(ipc_callid_t hash, pending_call_t *pcall, |
ipc_call_t *answer) |
{ |
ipcarg_t phone; |
ipcarg_t method; |
ipcarg_t service; |
ipcarg_t retval; |
proto_t *proto; |
int cphone; |
ipcarg_t *resp; |
oper_t *oper; |
int i; |
// printf("parse_answer\n"); |
phone = pcall->phone_hash; |
method = IPC_GET_METHOD(pcall->question); |
retval = IPC_GET_RETVAL(*answer); |
resp = answer->args; |
if ((display_mask & DM_IPC) != 0) { |
printf("Response to 0x%lx: retval=%ld, args = (%lu, %lu, %lu, %lu, %lu)\n", |
hash, retval, IPC_GET_ARG1(*answer), |
IPC_GET_ARG2(*answer), IPC_GET_ARG3(*answer), |
IPC_GET_ARG4(*answer), IPC_GET_ARG5(*answer)); |
} |
if ((display_mask & DM_USER) != 0) { |
oper = pcall->oper; |
if (oper != NULL && (oper->rv_type != V_VOID || oper->respc > 0)) { |
printf("->"); |
if (oper->rv_type != V_VOID) { |
putchar(' '); |
val_print(retval, oper->rv_type); |
} |
if (oper->respc > 0) { |
putchar(' '); |
putchar('('); |
for (i = 1; i <= oper->respc; ++i) { |
if (i > 1) printf(", "); |
val_print(resp[i], oper->resp_type[i - 1]); |
} |
putchar(')'); |
} |
putchar('\n'); |
} |
} |
if (phone == 0 && method == IPC_M_CONNECT_ME_TO && retval == 0) { |
/* Connected to a service (through NS) */ |
service = IPC_GET_ARG1(pcall->question); |
proto = proto_get_by_srv(service); |
if (proto == NULL) proto = proto_unknown; |
cphone = IPC_GET_ARG5(*answer); |
if ((display_mask & DM_SYSTEM) != 0) { |
printf("Registering connection (phone %d, protocol: %s)\n", cphone, |
proto->name); |
} |
ipcp_connection_set(cphone, 0, proto); |
} |
} |
void ipcp_call_in(ipc_call_t *call, ipc_callid_t hash) |
{ |
link_t *item; |
pending_call_t *pcall; |
unsigned long key[1]; |
// printf("ipcp_call_in()\n"); |
if ((hash & IPC_CALLID_ANSWERED) == 0 && hash != IPCP_CALLID_SYNC) { |
/* Not a response */ |
if ((display_mask & DM_IPC) != 0) { |
printf("Not a response (hash 0x%lx)\n", hash); |
} |
return; |
} |
hash = hash & ~IPC_CALLID_ANSWERED; |
key[0] = hash; |
item = hash_table_find(&pending_calls, key); |
if (item == NULL) return; // No matching question found |
/* |
* Response matched to question. |
*/ |
pcall = hash_table_get_instance(item, pending_call_t, link); |
hash_table_remove(&pending_calls, key, 1); |
parse_answer(hash, pcall, call); |
free(pcall); |
} |
void ipcp_call_sync(int phone, ipc_call_t *call, ipc_call_t *answer) |
{ |
ipcp_call_out(phone, call, IPCP_CALLID_SYNC); |
ipcp_call_in(answer, IPCP_CALLID_SYNC); |
} |
void ipcp_hangup(int phone, int rc) |
{ |
if ((display_mask & DM_SYSTEM) != 0) { |
printf("Hang phone %d up -> %d\n", phone, rc); |
ipcp_connection_clear(phone); |
} |
} |
/** @} |
*/ |
//branches/snapshot/uspace/app/trace/syscalls.c |
---|
0,0 → 1,83 |
/* |
* Copyright (c) 2008 Jiri Svoboda |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup trace |
* @{ |
*/ |
/** @file |
*/ |
#include <kernel/syscall/syscall.h> |
#include "syscalls.h" |
#include "trace.h" |
const sc_desc_t syscall_desc[] = { |
[SYS_KLOG] ={ "klog", 3, V_INT_ERRNO }, |
[SYS_TLS_SET] = { "tls_set", 1, V_ERRNO }, |
[SYS_THREAD_CREATE] = { "thread_create", 3, V_ERRNO }, |
[SYS_THREAD_EXIT] = { "thread_exit", 1, V_ERRNO }, |
[SYS_THREAD_GET_ID] = { "thread_get_id", 1, V_ERRNO }, |
[SYS_TASK_GET_ID] = { "task_get_id", 1, V_ERRNO }, |
[SYS_FUTEX_SLEEP] = { "futex_sleep_timeout", 3, V_ERRNO }, |
[SYS_FUTEX_WAKEUP] = { "futex_wakeup", 1, V_ERRNO }, |
[SYS_AS_AREA_CREATE] = { "as_area_create", 3, V_ERRNO }, |
[SYS_AS_AREA_RESIZE] = { "as_area_resize", 3, V_ERRNO }, |
[SYS_AS_AREA_DESTROY] = { "as_area_destroy", 1, V_ERRNO }, |
[SYS_IPC_CALL_SYNC_FAST] = { "ipc_call_sync_fast", 6, V_ERRNO }, |
[SYS_IPC_CALL_SYNC_SLOW] = { "ipc_call_sync_slow", 3, V_ERRNO }, |
[SYS_IPC_CALL_ASYNC_FAST] = { "ipc_call_async_fast", 6, V_HASH }, |
[SYS_IPC_CALL_ASYNC_SLOW] = { "ipc_call_async_slow", 2, V_HASH }, |
[SYS_IPC_ANSWER_FAST] = { "ipc_answer_fast", 6, V_ERRNO }, |
[SYS_IPC_ANSWER_SLOW] = { "ipc_answer_slow", 2, V_ERRNO }, |
[SYS_IPC_FORWARD_FAST] = { "ipc_forward_fast", 6, V_ERRNO }, |
[SYS_IPC_FORWARD_SLOW] = { "ipc_forward_slow", 3, V_ERRNO }, |
[SYS_IPC_WAIT] = { "ipc_wait_for_call", 3, V_HASH }, |
[SYS_IPC_HANGUP] = { "ipc_hangup", 1, V_ERRNO }, |
[SYS_IPC_REGISTER_IRQ] = { "ipc_register_irq", 4, V_ERRNO }, |
[SYS_IPC_UNREGISTER_IRQ] = { "ipc_unregister_irq", 2, V_ERRNO }, |
[SYS_EVENT_SUBSCRIBE] = { "event_subscribe", 2, V_ERRNO }, |
[SYS_CAP_GRANT] = { "cap_grant", 2, V_ERRNO }, |
[SYS_CAP_REVOKE] = { "cap_revoke", 2, V_ERRNO }, |
[SYS_PHYSMEM_MAP] = { "physmem_map", 4, V_ERRNO }, |
[SYS_IOSPACE_ENABLE] = { "iospace_enable", 1, V_ERRNO }, |
[SYS_PREEMPT_CONTROL] = { "preempt_control", 1, V_ERRNO }, |
[SYS_SYSINFO_VALID] = { "sysinfo_valid", 2, V_HASH }, |
[SYS_SYSINFO_VALUE] = { "sysinfo_value", 2, V_HASH }, |
[SYS_DEBUG_ENABLE_CONSOLE] = { "debug_enable_console", 0, V_ERRNO }, |
[SYS_IPC_CONNECT_KBOX] = { "ipc_connect_kbox", 1, V_ERRNO } |
}; |
/** @} |
*/ |
//branches/snapshot/uspace/app/trace/Makefile |
---|
0,0 → 1,79 |
# |
# Copyright (c) 2005 Martin Decky |
# All rights reserved. |
# |
# Redistribution and use in source and binary forms, with or without |
# modification, are permitted provided that the following conditions |
# are met: |
# |
# - Redistributions of source code must retain the above copyright |
# notice, this list of conditions and the following disclaimer. |
# - 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. |
# - The name of the author may not be used to endorse or promote products |
# derived from this software without specific prior written permission. |
# |
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
# |
## Setup toolchain |
# |
LIBC_PREFIX = ../../lib/libc |
SOFTINT_PREFIX = ../../lib/softint |
include $(LIBC_PREFIX)/Makefile.toolchain |
CFLAGS += -I../../srv/kbd/include |
LIBS = $(LIBC_PREFIX)/libc.a |
## Sources |
# |
OUTPUT = trace |
SOURCES = trace.c \ |
syscalls.c \ |
ipcp.c \ |
ipc_desc.c \ |
proto.c \ |
errors.c |
OBJECTS := $(addsuffix .o,$(basename $(SOURCES))) |
.PHONY: all clean depend disasm |
all: $(OUTPUT) disasm |
-include Makefile.depend |
clean: |
-rm -f $(OUTPUT) $(OBJECTS) $(OUTPUT).map $(OUTPUT).disasm Makefile.depend |
depend: |
$(CC) $(DEFS) $(CFLAGS) -M $(SOURCES) > Makefile.depend |
$(OUTPUT): $(OBJECTS) $(LIBS) |
$(LD) -T $(LIBC_PREFIX)/arch/$(UARCH)/_link.ld $(OBJECTS) $(LIBS) $(LFLAGS) -o $@ -Map $(OUTPUT).map |
disasm: |
$(OBJDUMP) -d $(OUTPUT) >$(OUTPUT).disasm |
%.o: %.S |
$(CC) $(DEFS) $(AFLAGS) $(CFLAGS) -D__ASM__ -c $< -o $@ |
%.o: %.s |
$(AS) $(AFLAGS) $< -o $@ |
%.o: %.c |
$(CC) $(DEFS) $(CFLAGS) -c $< -o $@ |
//branches/snapshot/uspace/app/trace/trace.h |
---|
0,0 → 1,71 |
/* |
* Copyright (c) 2008 Jiri Svoboda |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup trace |
* @{ |
*/ |
/** @file |
*/ |
#ifndef TRACE_H_ |
#define TRACE_H_ |
#include <sys/types.h> |
/** |
* Classes of events that can be displayed. Can be or-ed together. |
*/ |
typedef enum { |
DM_THREAD = 1, /**< Thread creation and termination events */ |
DM_SYSCALL = 2, /**< System calls */ |
DM_IPC = 4, /**< Low-level IPC */ |
DM_SYSTEM = 8, /**< Sysipc protocol */ |
DM_USER = 16 /**< User IPC protocols */ |
} display_mask_t; |
typedef enum { |
V_VOID, |
V_INTEGER, |
V_PTR, |
V_HASH, |
V_ERRNO, |
V_INT_ERRNO, |
V_CHAR |
} val_type_t; |
/** Combination of events to print. */ |
extern display_mask_t display_mask; |
void val_print(sysarg_t val, val_type_t v_type); |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/app/trace/syscalls.h |
---|
0,0 → 1,51 |
/* |
* Copyright (c) 2008 Jiri Svoboda |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup trace |
* @{ |
*/ |
/** @file |
*/ |
#ifndef SYSCALLS_H_ |
#define SYSCALLS_H_ |
#include "trace.h" |
typedef struct { |
char *name; |
int n_args; |
val_type_t rv_type; |
} sc_desc_t; |
extern const sc_desc_t syscall_desc[]; |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/app/trace/ipc_desc.h |
---|
0,0 → 1,48 |
/* |
* Copyright (c) 2008 Jiri Svoboda |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup trace |
* @{ |
*/ |
/** @file |
*/ |
#ifndef IPC_DESC_H_ |
#define IPC_DESC_H_ |
typedef struct { |
int number; |
char *name; |
} ipc_m_desc_t; |
extern ipc_m_desc_t ipc_methods[]; |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/app/trace/ipcp.h |
---|
0,0 → 1,55 |
/* |
* Copyright (c) 2008 Jiri Svoboda |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup trace |
* @{ |
*/ |
/** @file |
*/ |
#ifndef IPCP_H_ |
#define IPCP_H_ |
#include <ipc/ipc.h> |
#include "proto.h" |
void ipcp_init(void); |
void ipcp_cleanup(void); |
void ipcp_call_out(int phone, ipc_call_t *call, ipc_callid_t hash); |
void ipcp_call_sync(int phone, ipc_call_t *call, ipc_call_t *answer); |
void ipcp_call_in(ipc_call_t *call, ipc_callid_t hash); |
void ipcp_hangup(int phone, int rc); |
void ipcp_connection_set(int phone, int server, proto_t *proto); |
void ipcp_connection_clear(int phone); |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/app/trace/errors.h |
---|
0,0 → 1,48 |
/* |
* Copyright (c) 2008 Jiri Svoboda |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup trace |
* @{ |
*/ |
/** @file |
*/ |
#ifndef ERRORS_H_ |
#define ERRORS_H_ |
typedef struct { |
char *name; /**< Error value name (Exx) */ |
char *desc; /**< Error description */ |
} err_desc_t; |
extern const err_desc_t err_desc[]; |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/app/trace/ipc_desc.c |
---|
0,0 → 1,58 |
/* |
* Copyright (c) 2008 Jiri Svoboda |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup trace |
* @{ |
*/ |
/** @file |
*/ |
#include <stdlib.h> |
#include <ipc/ipc.h> |
#include "ipc_desc.h" |
ipc_m_desc_t ipc_methods[] = { |
/* System methods */ |
{ IPC_M_CONNECT_TO_ME, "CONNECT_TO_ME" }, |
{ IPC_M_CONNECT_ME_TO, "CONNECT_ME_TO" }, |
{ IPC_M_PHONE_HUNGUP, "PHONE_HUNGUP" }, |
{ IPC_M_SHARE_OUT, "SHARE_OUT" }, |
{ IPC_M_SHARE_IN, "SHARE_IN" }, |
{ IPC_M_DATA_WRITE, "DATA_WRITE" }, |
{ IPC_M_DATA_READ, "DATA_READ" }, |
{ IPC_M_DEBUG_ALL, "DEBUG_ALL" }, |
/* Well-known methods */ |
{ IPC_M_PING, "PING" }, |
/* Terminating entry */ |
{ 0, NULL } |
}; |
/** @} |
*/ |
//branches/snapshot/uspace/app/trace/errors.c |
---|
0,0 → 1,61 |
/* |
* Copyright (c) 2008 Jiri Svoboda |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup trace |
* @{ |
*/ |
/** @file |
*/ |
#include <errno.h> |
#include "errors.h" |
const err_desc_t err_desc[] = { |
[-EOK] = { "EOK", "No error" }, |
[-ENOENT] = { "ENOENT", "No such entry" }, |
[-ENOMEM] = { "ENOMEM", "Not enough memory" }, |
[-ELIMIT] = { "ELIMIT", "Limit exceeded" }, |
[-EREFUSED] = { "EREFUSED", "Connection refused" }, |
[-EFORWARD] = { "EFORWARD", "Forward error" }, |
[-EPERM] = { "EPERM", "Permission denied" }, |
[-EHANGUP] = { "EHANGUP", "Answerbox closed connection" }, |
[-EEXISTS] = { "EEXISTS", "Entry already exists" }, |
[-EBADMEM] = { "EBADMEM", "Bad memory pointer" }, |
[-ENOTSUP] = { "ENOTSUP", "Not supported" }, |
[-EADDRNOTAVAIL] = { "EADDRNOTAVAIL", "Address not available." }, |
[-ETIMEOUT] = { "ETIMEOUT", "Timeout expired" }, |
[-EINVAL] = { "EINVAL", "Invalid value" }, |
[-EBUSY] = { "EBUSY", "Resource is busy" }, |
[-EOVERFLOW] = { "EOVERFLOW", "The result does not fit its size." } |
}; |
/** @} |
*/ |
//branches/snapshot/uspace/app/tetris/scores.c |
---|
0,0 → 1,233 |
/* $OpenBSD: scores.c,v 1.11 2006/04/20 03:25:36 ray Exp $ */ |
/* $NetBSD: scores.c,v 1.2 1995/04/22 07:42:38 cgd Exp $ */ |
/*- |
* Copyright (c) 1992, 1993 |
* The Regents of the University of California. All rights reserved. |
* |
* This code is derived from software contributed to Berkeley by |
* Chris Torek and Darren F. Provine. |
* |
* 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 University 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 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. |
* |
* @(#)scores.c 8.1 (Berkeley) 5/31/93 |
*/ |
/** @addtogroup tetris |
* @{ |
*/ |
/** @file |
*/ |
/* |
* Score code for Tetris, by Darren Provine (kilroy@gboro.glassboro.edu) |
* modified 22 January 1992, to limit the number of entries any one |
* person has. |
* |
* Major whacks since then. |
*/ |
#include <errno.h> |
#include <stdio.h> |
#include <string.h> |
#include <io/console.h> |
#include <io/keycode.h> |
#include <vfs/vfs.h> |
#include <stdlib.h> |
#include <fcntl.h> |
#include <err.h> |
#include <time.h> |
#include "screen.h" |
#include "tetris.h" |
#include "scores.h" |
/* |
* Within this code, we can hang onto one extra "high score", leaving |
* room for our current score (whether or not it is high). |
* |
* We also sometimes keep tabs on the "highest" score on each level. |
* As long as the scores are kept sorted, this is simply the first one at |
* that level. |
*/ |
#define NUMSPOTS (MAXHISCORES + 1) |
#define NLEVELS (MAXLEVEL + 1) |
static struct highscore scores[NUMSPOTS]; |
/** Copy from hiscore table score with index src to dest |
* |
*/ |
static void copyhiscore(int dest, int src) |
{ |
str_cpy(scores[dest].hs_name, STR_BOUNDS(MAXLOGNAME) + 1, |
scores[src].hs_name); |
scores[dest].hs_score = scores[src].hs_score; |
scores[dest].hs_level = scores[src].hs_level; |
} |
void showscores(int firstgame) |
{ |
int i; |
clear_screen(); |
moveto(10, 0); |
printf("\tRank \tLevel \tName\t points\n"); |
printf("\t========================================================\n"); |
for (i = 0; i < NUMSPOTS - 1; i++) |
printf("\t%6d %6d %-16s %20d\n", |
i + 1, scores[i].hs_level, scores[i].hs_name, scores[i].hs_score); |
if (!firstgame) { |
printf("\t========================================================\n"); |
printf("\t Last %6d %-16s %20d\n", |
scores[NUMSPOTS - 1].hs_level, scores[NUMSPOTS - 1].hs_name, scores[NUMSPOTS - 1].hs_score); |
} |
printf("\n\n\n\n\tPress any key to return to main menu."); |
getchar(); |
} |
void insertscore(int score, int level) |
{ |
int i; |
int j; |
size_t off; |
console_event_t ev; |
clear_screen(); |
moveto(10, 10); |
puts("Insert your name: "); |
str_cpy(scores[NUMSPOTS - 1].hs_name, STR_BOUNDS(MAXLOGNAME) + 1, |
"Player"); |
i = 6; |
off = 6; |
moveto(10 , 28); |
printf("%s%.*s", scores[NUMSPOTS - 1].hs_name, MAXLOGNAME-i, |
"........................................"); |
while (1) { |
fflush(stdout); |
if (!console_get_event(fphone(stdin), &ev)) |
exit(1); |
if (ev.type == KEY_RELEASE) |
continue; |
if (ev.key == KC_ENTER || ev.key == KC_NENTER) |
break; |
if (ev.key == KC_BACKSPACE) { |
if (i > 0) { |
wchar_t uc; |
--i; |
while (off > 0) { |
--off; |
size_t otmp = off; |
uc = str_decode(scores[NUMSPOTS - 1].hs_name, |
&otmp, STR_BOUNDS(MAXLOGNAME) + 1); |
if (uc != U_SPECIAL) |
break; |
} |
scores[NUMSPOTS - 1].hs_name[off] = '\0'; |
} |
} else if (ev.c != '\0') { |
if (i < (MAXLOGNAME - 1)) { |
if (chr_encode(ev.c, scores[NUMSPOTS - 1].hs_name, |
&off, STR_BOUNDS(MAXLOGNAME) + 1) == EOK) { |
++i; |
} |
scores[NUMSPOTS - 1].hs_name[off] = '\0'; |
} |
} |
moveto(10, 28); |
printf("%s%.*s", scores[NUMSPOTS - 1].hs_name, MAXLOGNAME - i, |
"........................................"); |
} |
scores[NUMSPOTS - 1].hs_score = score; |
scores[NUMSPOTS - 1].hs_level = level; |
i = NUMSPOTS - 1; |
while ((i > 0) && (scores[i - 1].hs_score < score)) |
i--; |
for (j = NUMSPOTS - 2; j > i; j--) |
copyhiscore(j, j-1); |
copyhiscore(i, NUMSPOTS - 1); |
} |
void initscores(void) |
{ |
int i; |
for (i = 0; i < NUMSPOTS; i++) { |
str_cpy(scores[i].hs_name, STR_BOUNDS(MAXLOGNAME) + 1, "HelenOS Team"); |
scores[i].hs_score = (NUMSPOTS - i) * 200; |
scores[i].hs_level = (i + 1 > MAXLEVEL ? MAXLEVEL : i + 1); |
} |
} |
int loadscores(void) |
{ |
FILE *f; |
size_t cnt; |
int rc; |
f = fopen("/data/tetris.sco", "rb"); |
if (f == NULL) |
return ENOENT; |
cnt = fread(scores, sizeof(struct highscore), NUMSPOTS, f); |
rc = fclose(f); |
if (cnt != NUMSPOTS || rc != 0) |
return EIO; |
return EOK; |
} |
void savescores(void) |
{ |
FILE *f; |
size_t cnt; |
int rc; |
f = fopen("/data/tetris.sco", "wb"); |
cnt = fwrite(scores, sizeof(struct highscore), NUMSPOTS, f); |
rc = fclose(f); |
if (cnt != NUMSPOTS || rc != 0) |
printf("Error saving score table\n"); |
} |
/** @} |
*/ |
//branches/snapshot/uspace/app/tetris/scores.h |
---|
0,0 → 1,71 |
/* $OpenBSD: scores.h,v 1.5 2003/06/03 03:01:41 millert Exp $ */ |
/* $NetBSD: scores.h,v 1.2 1995/04/22 07:42:40 cgd Exp $ */ |
/*- |
* Copyright (c) 1992, 1993 |
* The Regents of the University of California. All rights reserved. |
* |
* This code is derived from software contributed to Berkeley by |
* Chris Torek and Darren F. Provine. |
* |
* 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 University 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 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. |
* |
* @(#)scores.h 8.1 (Berkeley) 5/31/93 |
*/ |
/** @addtogroup tetris |
* @{ |
*/ |
/** @file |
*/ |
/* |
* Tetris scores. |
*/ |
#include <sys/time.h> |
#include <string.h> |
#define MAXLOGNAME 16 |
#define MAXHISCORES 10 |
#define MAXSCORES 9 /* maximum high score entries per person */ |
#define EXPIRATION (5L * 365 * 24 * 60 * 60) |
struct highscore { |
char hs_name[STR_BOUNDS(MAXLOGNAME) + 1]; /* login name */ |
int hs_score; /* raw score */ |
int hs_level; /* play level */ |
time_t hs_time; /* time at game end */ |
}; |
extern void showscores(int); |
extern void initscores(void); |
extern void insertscore(int score, int level); |
extern int loadscores(void); |
extern void savescores(void); |
/** @} |
*/ |
//branches/snapshot/uspace/app/tetris/tetris.c |
---|
0,0 → 1,442 |
/* $OpenBSD: tetris.c,v 1.21 2006/04/20 03:24:12 ray Exp $ */ |
/* $NetBSD: tetris.c,v 1.2 1995/04/22 07:42:47 cgd Exp $ */ |
/*- |
* Copyright (c) 1992, 1993 |
* The Regents of the University of California. All rights reserved. |
* |
* This code is derived from software contributed to Berkeley by |
* Chris Torek and Darren F. Provine. |
* |
* 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 University 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 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. |
* |
* @(#)tetris.c 8.1 (Berkeley) 5/31/93 |
*/ |
/** @addtogroup tetris Tetris |
* @brief Tetris ported from OpenBSD |
* @{ |
*/ |
/** @file |
*/ |
static const char copyright[] = |
"@(#) Copyright (c) 1992, 1993\n" |
"\tThe Regents of the University of California. All rights reserved.\n"; |
#include <sys/time.h> |
#include <sys/types.h> |
#include <err.h> |
#include <errno.h> |
#include <stdio.h> |
#include <stdlib.h> |
#include <string.h> |
#include <unistd.h> |
#include <getopt.h> |
#include "input.h" |
#include "scores.h" |
#include "screen.h" |
#include "tetris.h" |
cell board[B_SIZE]; |
int Rows; |
int Cols; |
const struct shape *curshape; |
const struct shape *nextshape; |
long fallrate; |
int score; |
char key_msg[100]; |
int showpreview; |
int classic; |
static void elide(void); |
static void setup_board(void); |
static const struct shape *randshape(void); |
static void usage(void); |
static int firstgame = 1; |
/* |
* Set up the initial board. The bottom display row is completely set, |
* along with another (hidden) row underneath that. Also, the left and |
* right edges are set. |
*/ |
static void setup_board(void) |
{ |
int i; |
cell *p = board; |
for (i = B_SIZE; i; i--) |
*p++ = (i <= (2 * B_COLS) || (i % B_COLS) < 2) ? 0x0000ff : 0x000000; |
} |
/* |
* Elide any full active rows. |
*/ |
static void elide(void) |
{ |
int rows = 0; |
int i; |
int j; |
int base; |
cell *p; |
for (i = A_FIRST; i < A_LAST; i++) { |
base = i * B_COLS + 1; |
p = &board[base]; |
for (j = B_COLS - 2; *p++ != 0;) { |
if (--j <= 0) { |
/* This row is to be elided */ |
rows++; |
memset(&board[base], 0, sizeof(cell) * (B_COLS - 2)); |
scr_update(); |
tsleep(); |
while (--base != 0) |
board[base + B_COLS] = board[base]; |
scr_update(); |
tsleep(); |
break; |
} |
} |
} |
switch (rows) { |
case 1: |
score += 10; |
break; |
case 2: |
score += 30; |
break; |
case 3: |
score += 70; |
break; |
case 4: |
score += 150; |
break; |
default: |
break; |
} |
} |
const struct shape *randshape(void) |
{ |
const struct shape *tmp = &shapes[random() % 7]; |
int i; |
int j = random() % 4; |
for (i = 0; i < j; i++) |
tmp = &shapes[classic ? tmp->rotc : tmp->rot]; |
return (tmp); |
} |
static void srandomdev(void) |
{ |
struct timeval tv; |
gettimeofday(&tv, NULL); |
srandom(tv.tv_sec + tv.tv_usec / 100000); |
} |
static void tetris_menu_draw(int level) |
{ |
clear_screen(); |
moveto(5, 10); |
puts("Tetris\n\n"); |
moveto(8, 10); |
printf("Level = %d (press keys 1 - 9 to change)", level); |
moveto(9, 10); |
printf("Preview is %s (press 'p' to change)", (showpreview ? "on ": "off")); |
moveto(12, 10); |
printf("Press 'h' to show hiscore table."); |
moveto(13, 10); |
printf("Press 's' to start game."); |
moveto(14, 10); |
printf("Press 'q' to quit game."); |
moveto(20, 10); |
printf("In game controls:"); |
moveto(21, 0); |
puts(key_msg); |
} |
static int tetris_menu(int *level) |
{ |
tetris_menu_draw(*level); |
while (1) { |
int i = getchar(); |
switch(i) { |
case 'p': |
showpreview = !showpreview; |
moveto(9, 21); |
if (showpreview) |
printf("on "); |
else |
printf("off"); |
break; |
case 'h': |
loadscores(); |
showscores(firstgame); |
tetris_menu_draw(*level); |
break; |
case 's': |
firstgame = 0; |
return 1; |
case 'q': |
return 0; |
case '1': |
case '2': |
case '3': |
case '4': |
case '5': |
case '6': |
case '7': |
case '8': |
case '9': |
*level = i - '0'; |
moveto(8, 18); |
printf("%d", *level); |
break; |
} |
} |
} |
int main(int argc, char *argv[]) |
{ |
int pos; |
int c; |
char *keys; |
int level = 2; |
char key_write[6][10]; |
int i; |
int j; |
int ch; |
keys = "jkl pq"; |
classic = 0; |
showpreview = 1; |
while ((ch = getopt(argc, argv, "ck:ps")) != -1) |
switch(ch) { |
case 'c': |
/* |
* this means: |
* - rotate the other way |
* - no reverse video |
*/ |
classic = 1; |
break; |
case 'k': |
if (str_size(keys = optarg) != 6) |
usage(); |
break; |
case 'p': |
showpreview = 1; |
break; |
case 's': |
showscores(0); |
exit(0); |
default: |
usage(); |
} |
argc -= optind; |
argv += optind; |
if (argc) |
usage(); |
for (i = 0; i <= 5; i++) { |
for (j = i + 1; j <= 5; j++) { |
if (keys[i] == keys[j]) |
errx(1, "duplicate command keys specified."); |
} |
if (keys[i] == ' ') |
str_cpy(key_write[i], sizeof(key_write[i]), "<space>"); |
else { |
key_write[i][0] = keys[i]; |
key_write[i][1] = '\0'; |
} |
} |
snprintf(key_msg, sizeof(key_msg), |
"%s - left %s - rotate %s - right %s - drop %s - pause %s - quit", |
key_write[0], key_write[1], key_write[2], key_write[3], |
key_write[4], key_write[5]); |
scr_init(); |
if (loadscores() != EOK) |
initscores(); |
while (tetris_menu(&level)) { |
fallrate = 1000000 / level; |
scr_clear(); |
setup_board(); |
srandomdev(); |
scr_set(); |
pos = A_FIRST * B_COLS + (B_COLS / 2) - 1; |
nextshape = randshape(); |
curshape = randshape(); |
scr_msg(key_msg, 1); |
while (1) { |
place(curshape, pos, 1); |
scr_update(); |
place(curshape, pos, 0); |
c = tgetchar(); |
if (c < 0) { |
/* |
* Timeout. Move down if possible. |
*/ |
if (fits_in(curshape, pos + B_COLS)) { |
pos += B_COLS; |
continue; |
} |
/* |
* Put up the current shape `permanently', |
* bump score, and elide any full rows. |
*/ |
place(curshape, pos, 1); |
score++; |
elide(); |
/* |
* Choose a new shape. If it does not fit, |
* the game is over. |
*/ |
curshape = nextshape; |
nextshape = randshape(); |
pos = A_FIRST * B_COLS + (B_COLS / 2) - 1; |
if (!fits_in(curshape, pos)) |
break; |
continue; |
} |
/* |
* Handle command keys. |
*/ |
if (c == keys[5]) { |
/* quit */ |
break; |
} |
if (c == keys[4]) { |
static char msg[] = |
"paused - press RETURN to continue"; |
place(curshape, pos, 1); |
do { |
scr_update(); |
scr_msg(key_msg, 0); |
scr_msg(msg, 1); |
(void) fflush(stdout); |
} while (rwait((struct timeval *) NULL) == -1); |
scr_msg(msg, 0); |
scr_msg(key_msg, 1); |
place(curshape, pos, 0); |
continue; |
} |
if (c == keys[0]) { |
/* move left */ |
if (fits_in(curshape, pos - 1)) |
pos--; |
continue; |
} |
if (c == keys[1]) { |
/* turn */ |
const struct shape *new = |
&shapes[classic ? curshape->rotc : curshape->rot]; |
if (fits_in(new, pos)) |
curshape = new; |
continue; |
} |
if (c == keys[2]) { |
/* move right */ |
if (fits_in(curshape, pos + 1)) |
pos++; |
continue; |
} |
if (c == keys[3]) { |
/* move to bottom */ |
while (fits_in(curshape, pos + B_COLS)) { |
pos += B_COLS; |
score++; |
} |
continue; |
} |
if (c == '\f') { |
scr_clear(); |
scr_msg(key_msg, 1); |
} |
} |
scr_clear(); |
loadscores(); |
insertscore(score, level); |
savescores(); |
score = 0; |
} |
scr_clear(); |
printf("\nGame over.\n"); |
scr_end(); |
return 0; |
} |
void usage(void) |
{ |
fprintf(stderr, "usage: tetris [-ps] [-k keys]\n"); |
exit(1); |
} |
/** @} |
*/ |
//branches/snapshot/uspace/app/tetris/screen.c |
---|
0,0 → 1,307 |
/* $OpenBSD: screen.c,v 1.13 2006/04/20 03:25:36 ray Exp $ */ |
/* $NetBSD: screen.c,v 1.4 1995/04/29 01:11:36 mycroft Exp $ */ |
/*- |
* Copyright (c) 1992, 1993 |
* The Regents of the University of California. All rights reserved. |
* |
* This code is derived from software contributed to Berkeley by |
* Chris Torek and Darren F. Provine. |
* |
* 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 University 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 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. |
* |
* @(#)screen.c 8.1 (Berkeley) 5/31/93 |
*/ |
/** @addtogroup tetris |
* @{ |
*/ |
/** @file |
*/ |
/* |
* Tetris screen control. |
*/ |
#include <err.h> |
#include <stdio.h> |
#include <stdlib.h> |
#include <string.h> |
#include <unistd.h> |
#include <vfs/vfs.h> |
#include <async.h> |
#include "screen.h" |
#include "tetris.h" |
#include <io/console.h> |
#define STOP (B_COLS - 3) |
static cell curscreen[B_SIZE]; /* non-zero => standout (or otherwise marked) */ |
static int curscore; |
static int isset; /* true => terminal is in game mode */ |
static const struct shape *lastshape; |
/* |
* putstr() is for unpadded strings (either as in termcap(5) or |
* simply literal strings); |
*/ |
static inline void putstr(char *s) |
{ |
while (*s) |
putchar(*(s++)); |
} |
static void start_standout(uint32_t color) |
{ |
fflush(stdout); |
console_set_rgb_color(fphone(stdout), 0xf0f0f0, color); |
} |
static void resume_normal(void) |
{ |
fflush(stdout); |
console_set_rgb_color(fphone(stdout), 0, 0xf0f0f0); |
} |
void clear_screen(void) |
{ |
console_clear(fphone(stdout)); |
moveto(0, 0); |
} |
/* |
* Clear the screen, forgetting the current contents in the process. |
*/ |
void scr_clear(void) |
{ |
resume_normal(); |
console_clear(fphone(stdout)); |
curscore = -1; |
memset(curscreen, 0, sizeof(curscreen)); |
} |
/* |
* Set up screen |
*/ |
void scr_init(void) |
{ |
console_cursor_visibility(fphone(stdout), 0); |
resume_normal(); |
scr_clear(); |
} |
void moveto(int r, int c) |
{ |
fflush(stdout); |
console_goto(fphone(stdout), c, r); |
} |
winsize_t winsize; |
static int get_display_size(winsize_t *ws) |
{ |
return console_get_size(fphone(stdout), &ws->ws_col, &ws->ws_row); |
} |
/* |
* Set up screen mode. |
*/ |
void scr_set(void) |
{ |
winsize_t ws; |
Rows = 0; |
Cols = 0; |
if (get_display_size(&ws) == 0) { |
Rows = ws.ws_row; |
Cols = ws.ws_col; |
} |
if ((Rows < MINROWS) || (Cols < MINCOLS)) { |
char smallscr[55]; |
snprintf(smallscr, sizeof(smallscr), |
"the screen is too small (must be at least %dx%d)", |
MINROWS, MINCOLS); |
stop(smallscr); |
} |
isset = 1; |
scr_clear(); |
} |
/* |
* End screen mode. |
*/ |
void scr_end(void) |
{ |
console_cursor_visibility(fphone(stdout), 1); |
} |
void stop(char *why) |
{ |
if (isset) |
scr_end(); |
errx(1, "aborting: %s", why); |
} |
/* |
* Update the screen. |
*/ |
void scr_update(void) |
{ |
cell *bp; |
cell *sp; |
cell so; |
cell cur_so = 0; |
int i; |
int j; |
int ccol; |
/* Always leave cursor after last displayed point */ |
curscreen[D_LAST * B_COLS - 1] = -1; |
if (score != curscore) { |
moveto(0, 0); |
printf("Score: %d", score); |
curscore = score; |
} |
/* Draw preview of next pattern */ |
if ((showpreview) && (nextshape != lastshape)) { |
int i; |
static int r = 5, c = 2; |
int tr, tc, t; |
lastshape = nextshape; |
/* Clean */ |
resume_normal(); |
moveto(r - 1, c - 1); |
putstr(" "); |
moveto(r, c - 1); |
putstr(" "); |
moveto(r + 1, c - 1); |
putstr(" "); |
moveto(r + 2, c - 1); |
putstr(" "); |
moveto(r - 3, c - 2); |
putstr("Next shape:"); |
/* Draw */ |
start_standout(nextshape->color); |
moveto(r, 2 * c); |
putstr(" "); |
for (i = 0; i < 3; i++) { |
t = c + r * B_COLS; |
t += nextshape->off[i]; |
tr = t / B_COLS; |
tc = t % B_COLS; |
moveto(tr, 2*tc); |
putstr(" "); |
} |
resume_normal(); |
} |
bp = &board[D_FIRST * B_COLS]; |
sp = &curscreen[D_FIRST * B_COLS]; |
for (j = D_FIRST; j < D_LAST; j++) { |
ccol = -1; |
for (i = 0; i < B_COLS; bp++, sp++, i++) { |
if (*sp == (so = *bp)) |
continue; |
*sp = so; |
if (i != ccol) { |
if (cur_so) { |
resume_normal(); |
cur_so = 0; |
} |
moveto(RTOD(j), CTOD(i)); |
} |
if (so != cur_so) { |
if (so) |
start_standout(so); |
else |
resume_normal(); |
cur_so = so; |
} |
putstr(" "); |
ccol = i + 1; |
/* |
* Look ahead a bit, to avoid extra motion if |
* we will be redrawing the cell after the next. |
* Motion probably takes four or more characters, |
* so we save even if we rewrite two cells |
* `unnecessarily'. Skip it all, though, if |
* the next cell is a different color. |
*/ |
if ((i > STOP) || (sp[1] != bp[1]) || (so != bp[1])) |
continue; |
if (sp[2] != bp[2]) |
sp[1] = -1; |
else if ((i < STOP) && (so == bp[2]) && (sp[3] != bp[3])) { |
sp[2] = -1; |
sp[1] = -1; |
} |
} |
} |
if (cur_so) |
resume_normal(); |
fflush(stdout); |
} |
/* |
* Write a message (set != 0), or clear the same message (set == 0). |
* (We need its length in case we have to overwrite with blanks.) |
*/ |
void scr_msg(char *s, int set) |
{ |
int l = str_size(s); |
moveto(Rows - 2, ((Cols - l) >> 1) - 1); |
if (set) |
putstr(s); |
else |
while (--l >= 0) |
(void) putchar(' '); |
} |
/** @} |
*/ |
//branches/snapshot/uspace/app/tetris/input.c |
---|
0,0 → 1,197 |
/* $OpenBSD: input.c,v 1.12 2005/04/13 02:33:08 deraadt Exp $ */ |
/* $NetBSD: input.c,v 1.3 1996/02/06 22:47:33 jtc Exp $ */ |
/*- |
* Copyright (c) 1992, 1993 |
* The Regents of the University of California. All rights reserved. |
* |
* This code is derived from software contributed to Berkeley by |
* Chris Torek and Darren F. Provine. |
* |
* 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 University 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 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. |
* |
* @(#)input.c 8.1 (Berkeley) 5/31/93 |
*/ |
/** @addtogroup tetris |
* @{ |
*/ |
/** @file |
*/ |
/* |
* Tetris input. |
*/ |
#include <sys/types.h> |
#include <sys/time.h> |
#include <stdio.h> |
#include <errno.h> |
#include <unistd.h> |
#include <string.h> |
#include "input.h" |
#include "tetris.h" |
#include <async.h> |
#include <vfs/vfs.h> |
#include <io/console.h> |
#include <ipc/console.h> |
/* return true iff the given timeval is positive */ |
#define TV_POS(tv) \ |
((tv)->tv_sec > 0 || ((tv)->tv_sec == 0 && (tv)->tv_usec > 0)) |
/* subtract timeval `sub' from `res' */ |
#define TV_SUB(res, sub) \ |
(res)->tv_sec -= (sub)->tv_sec; \ |
(res)->tv_usec -= (sub)->tv_usec; \ |
if ((res)->tv_usec < 0) { \ |
(res)->tv_usec += 1000000; \ |
(res)->tv_sec--; \ |
} |
/* We will use a hack here - if lastchar is non-zero, it is |
* the last character read. We will somehow simulate the select |
* semantics. |
*/ |
static aid_t getchar_inprog = 0; |
static char lastchar = '\0'; |
/* |
* Do a `read wait': select for reading from stdin, with timeout *tvp. |
* On return, modify *tvp to reflect the amount of time spent waiting. |
* It will be positive only if input appeared before the time ran out; |
* otherwise it will be zero or perhaps negative. |
* |
* If tvp is nil, wait forever, but return if select is interrupted. |
* |
* Return 0 => no input, 1 => can read() from stdin |
* |
*/ |
int rwait(struct timeval *tvp) |
{ |
struct timeval starttv, endtv, *s; |
static ipc_call_t charcall; |
ipcarg_t rc; |
/* |
* Someday, select() will do this for us. |
* Just in case that day is now, and no one has |
* changed this, we use a temporary. |
*/ |
if (tvp) { |
(void) gettimeofday(&starttv, NULL); |
endtv = *tvp; |
s = &endtv; |
} else |
s = NULL; |
if (!lastchar) { |
again: |
if (!getchar_inprog) { |
getchar_inprog = async_send_0(fphone(stdin), |
CONSOLE_GET_EVENT, &charcall); |
} |
if (!s) |
async_wait_for(getchar_inprog, &rc); |
else if (async_wait_timeout(getchar_inprog, &rc, s->tv_usec) == ETIMEOUT) { |
tvp->tv_sec = 0; |
tvp->tv_usec = 0; |
return (0); |
} |
getchar_inprog = 0; |
if (rc) |
stop("end of file, help"); |
if (IPC_GET_ARG1(charcall) == KEY_RELEASE) |
goto again; |
lastchar = IPC_GET_ARG4(charcall); |
} |
if (tvp) { |
/* since there is input, we may not have timed out */ |
(void) gettimeofday(&endtv, NULL); |
TV_SUB(&endtv, &starttv); |
TV_SUB(tvp, &endtv); /* adjust *tvp by elapsed time */ |
} |
return 1; |
} |
/* |
* `sleep' for the current turn time (using select). |
* Eat any input that might be available. |
*/ |
void tsleep(void) |
{ |
struct timeval tv; |
tv.tv_sec = 0; |
tv.tv_usec = fallrate; |
while (TV_POS(&tv)) |
if (rwait(&tv)) { |
lastchar = '\0'; |
} else |
break; |
} |
/* |
* getchar with timeout. |
*/ |
int tgetchar(void) |
{ |
static struct timeval timeleft; |
char c; |
/* |
* Reset timeleft to fallrate whenever it is not positive. |
* In any case, wait to see if there is any input. If so, |
* take it, and update timeleft so that the next call to |
* tgetchar() will not wait as long. If there is no input, |
* make timeleft zero or negative, and return -1. |
* |
* Most of the hard work is done by rwait(). |
*/ |
if (!TV_POS(&timeleft)) { |
faster(); /* go faster */ |
timeleft.tv_sec = 0; |
timeleft.tv_usec = fallrate; |
} |
if (!rwait(&timeleft)) |
return -1; |
c = lastchar; |
lastchar = '\0'; |
return ((int) (unsigned char) c); |
} |
/** @} |
*/ |
//branches/snapshot/uspace/app/tetris/tetris.h |
---|
0,0 → 1,191 |
/* $OpenBSD: tetris.h,v 1.9 2003/06/03 03:01:41 millert Exp $ */ |
/* $NetBSD: tetris.h,v 1.2 1995/04/22 07:42:48 cgd Exp $ */ |
/*- |
* Copyright (c) 1992, 1993 |
* The Regents of the University of California. All rights reserved. |
* |
* This code is derived from software contributed to Berkeley by |
* Chris Torek and Darren F. Provine. |
* |
* 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 University 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 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. |
* |
* @(#)tetris.h 8.1 (Berkeley) 5/31/93 |
*/ |
/** @addtogroup tetris |
* @{ |
*/ |
/** @file |
*/ |
/* |
* Definitions for Tetris. |
*/ |
/* |
* The display (`board') is composed of 23 rows of 12 columns of characters |
* (numbered 0..22 and 0..11), stored in a single array for convenience. |
* Columns 1 to 10 of rows 1 to 20 are the actual playing area, where |
* shapes appear. Columns 0 and 11 are always occupied, as are all |
* columns of rows 21 and 22. Rows 0 and 22 exist as boundary areas |
* so that regions `outside' the visible area can be examined without |
* worrying about addressing problems. |
*/ |
/* The board */ |
#define B_COLS 12 |
#define B_ROWS 23 |
#define B_SIZE (B_ROWS * B_COLS) |
typedef uint32_t cell; |
extern cell board[B_SIZE]; /* 1 => occupied, 0 => empty */ |
/* The displayed area (rows) */ |
#define D_FIRST 1 |
#define D_LAST 22 |
/* The active area (rows) */ |
#define A_FIRST 1 |
#define A_LAST 21 |
/* |
* Minimum display size. |
*/ |
#define MINROWS 23 |
#define MINCOLS 40 |
/* Current screen size */ |
extern int Rows; |
extern int Cols; |
/* |
* Translations from board coordinates to display coordinates. |
* As with board coordinates, display coordiates are zero origin. |
*/ |
#define RTOD(x) ((x) - 1) |
#define CTOD(x) ((x) * 2 + (((Cols - 2 * B_COLS) >> 1) - 1)) |
/* |
* A `shape' is the fundamental thing that makes up the game. There |
* are 7 basic shapes, each consisting of four `blots': |
* |
* X.X X.X X.X |
* X.X X.X X.X.X X.X X.X.X X.X.X X.X.X.X |
* X X X |
* |
* 0 1 2 3 4 5 6 |
* |
* Except for 3 and 6, the center of each shape is one of the blots. |
* This blot is designated (0, 0). The other three blots can then be |
* described as offsets from the center. Shape 3 is the same under |
* rotation, so its center is effectively irrelevant; it has been chosen |
* so that it `sticks out' upward and leftward. Except for shape 6, |
* all the blots are contained in a box going from (-1, -1) to (+1, +1); |
* shape 6's center `wobbles' as it rotates, so that while it `sticks out' |
* rightward, its rotation---a vertical line---`sticks out' downward. |
* The containment box has to include the offset (2, 0), making the overall |
* containment box range from offset (-1, -1) to (+2, +1). (This is why |
* there is only one row above, but two rows below, the display area.) |
* |
* The game works by choosing one of these shapes at random and putting |
* its center at the middle of the first display row (row 1, column 5). |
* The shape is moved steadily downward until it collides with something: |
* either another shape, or the bottom of the board. When the shape can |
* no longer be moved downwards, it is merged into the current board. |
* At this time, any completely filled rows are elided, and blots above |
* these rows move down to make more room. A new random shape is again |
* introduced at the top of the board, and the whole process repeats. |
* The game ends when the new shape will not fit at (1, 5). |
* |
* While the shapes are falling, the user can rotate them counterclockwise |
* 90 degrees (in addition to moving them left or right), provided that the |
* rotation puts the blots in empty spaces. The table of shapes is set up |
* so that each shape contains the index of the new shape obtained by |
* rotating the current shape. Due to symmetry, each shape has exactly |
* 1, 2, or 4 rotations total; the first 7 entries in the table represent |
* the primary shapes, and the remaining 12 represent their various |
* rotated forms. |
*/ |
struct shape { |
int rot; /* index of rotated version of this shape */ |
int rotc; /* -- " -- in classic version */ |
int off[3]; /* offsets to other blots if center is at (0,0) */ |
uint32_t color; |
}; |
extern const struct shape shapes[]; |
extern const struct shape *curshape; |
extern const struct shape *nextshape; |
/* |
* Shapes fall at a rate faster than once per second. |
* |
* The initial rate is determined by dividing 1 million microseconds |
* by the game `level'. (This is at most 1 million, or one second.) |
* Each time the fall-rate is used, it is decreased a little bit, |
* depending on its current value, via the `faster' macro below. |
* The value eventually reaches a limit, and things stop going faster, |
* but by then the game is utterly impossible. |
*/ |
extern long fallrate; /* less than 1 million; smaller => faster */ |
#define faster() (fallrate -= fallrate / 3000) |
/* |
* Game level must be between 1 and 9. This controls the initial fall rate |
* and affects scoring. |
*/ |
#define MINLEVEL 1 |
#define MAXLEVEL 9 |
/* |
* Scoring is as follows: |
* |
* When the shape comes to rest, and is integrated into the board, |
* we score one point. If the shape is high up (at a low-numbered row), |
* and the user hits the space bar, the shape plummets all the way down, |
* and we score a point for each row it falls (plus one more as soon as |
* we find that it is at rest and integrate it---until then, it can |
* still be moved or rotated). |
* |
* If previewing has been turned on, the score is multiplied by PRE_PENALTY. |
*/ |
#define PRE_PENALTY 0.75 |
extern int score; /* The obvious thing */ |
extern char key_msg[100]; |
extern int showpreview; |
extern int classic; |
extern int fits_in(const struct shape *, int); |
extern void place(const struct shape *, int, int); |
extern void stop(char *); |
/** @} |
*/ |
//branches/snapshot/uspace/app/tetris/shapes.c |
---|
0,0 → 1,114 |
/* $OpenBSD: shapes.c,v 1.8 2004/07/10 07:26:24 deraadt Exp $ */ |
/* $NetBSD: shapes.c,v 1.2 1995/04/22 07:42:44 cgd Exp $ */ |
/*- |
* Copyright (c) 1992, 1993 |
* The Regents of the University of California. All rights reserved. |
* |
* This code is derived from software contributed to Berkeley by |
* Chris Torek and Darren F. Provine. |
* |
* 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 University 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 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. |
* |
* @(#)shapes.c 8.1 (Berkeley) 5/31/93 |
*/ |
/** @addtogroup tetris |
* @{ |
*/ |
/** @file |
*/ |
/* |
* Tetris shapes and related routines. |
* |
* Note that the first 7 are `well known'. |
*/ |
#include <unistd.h> |
#include "tetris.h" |
#define TL (-B_COLS - 1) /* top left */ |
#define TC (-B_COLS) /* top center */ |
#define TR (-B_COLS + 1) /* top right */ |
#define ML -1 /* middle left */ |
#define MR 1 /* middle right */ |
#define BL (B_COLS - 1) /* bottom left */ |
#define BC B_COLS /* bottom center */ |
#define BR (B_COLS + 1) /* bottom right */ |
const struct shape shapes[] = { |
/* 0 */ { 7, 7, { TL, TC, MR }, 0xff042d}, |
/* 1 */ { 8, 8, { TC, TR, ML }, 0xff9304}, |
/* 2 */ { 9, 11, { ML, MR, BC }, 0xbeff04}, |
/* 3 */ { 3, 3, { TL, TC, ML }, 0x63ff04}, |
/* 4 */ { 12, 14, { ML, BL, MR }, 0xce04ff}, |
/* 5 */ { 15, 17, { ML, BR, MR }, 0xff04cf}, |
/* 6 */ { 18, 18, { ML, MR, 2 }, 0x7604ff}, /* sticks out */ |
/* 7 */ { 0, 0, { TC, ML, BL }, 0xff042d}, |
/* 8 */ { 1, 1, { TC, MR, BR }, 0xff9304}, |
/* 9 */ { 10, 2, { TC, MR, BC }, 0xbeff04}, |
/* 10 */ { 11, 9, { TC, ML, MR }, 0xbeff04}, |
/* 11 */ { 2, 10, { TC, ML, BC }, 0xbeff04}, |
/* 12 */ { 13, 4, { TC, BC, BR }, 0xce04ff}, |
/* 13 */ { 14, 12, { TR, ML, MR }, 0xce04ff}, |
/* 14 */ { 4, 13, { TL, TC, BC }, 0xce04ff}, |
/* 15 */ { 16, 5, { TR, TC, BC }, 0xff04cf}, |
/* 16 */ { 17, 15, { TL, MR, ML }, 0xff04cf}, |
/* 17 */ { 5, 16, { TC, BC, BL }, 0xff04cf}, |
/* 18 */ { 6, 6, { TC, BC, 2 * B_COLS }, 0x7604ff} /* sticks out */ |
}; |
/* |
* Return true iff the given shape fits in the given position, |
* taking the current board into account. |
*/ |
int fits_in(const struct shape *shape, int pos) |
{ |
int *o = shape->off; |
if ((board[pos]) || (board[pos + *o++]) || (board[pos + *o++]) || |
(board[pos + *o])) |
return 0; |
return 1; |
} |
/* |
* Write the given shape into the current board, turning it on |
* if `onoff' is 1, and off if `onoff' is 0. |
*/ |
void place(const struct shape *shape, int pos, int onoff) |
{ |
int *o = shape->off; |
board[pos] = onoff ? shape->color : 0x000000; |
board[pos + *o++] = onoff ? shape->color : 0x000000; |
board[pos + *o++] = onoff ? shape->color : 0x000000; |
board[pos + *o] = onoff ? shape->color : 0x000000; |
} |
/** @} |
*/ |
//branches/snapshot/uspace/app/tetris/input.h |
---|
0,0 → 1,49 |
/* $OpenBSD: input.h,v 1.5 2003/06/03 03:01:41 millert Exp $ */ |
/* $NetBSD: input.h,v 1.2 1995/04/22 07:42:36 cgd Exp $ */ |
/*- |
* Copyright (c) 1992, 1993 |
* The Regents of the University of California. All rights reserved. |
* |
* This code is derived from software contributed to Berkeley by |
* Chris Torek and Darren F. Provine. |
* |
* 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 University 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 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. |
* |
* @(#)input.h 8.1 (Berkeley) 5/31/93 |
*/ |
/** @addtogroup tetris |
* @{ |
*/ |
/** @file |
*/ |
extern int rwait(struct timeval *); |
extern int tgetchar(void); |
extern void tsleep(void); |
/** @} |
*/ |
//branches/snapshot/uspace/app/tetris/screen.h |
---|
0,0 → 1,72 |
/* $OpenBSD: screen.h,v 1.5 2003/06/03 03:01:41 millert Exp $ */ |
/* $NetBSD: screen.h,v 1.2 1995/04/22 07:42:42 cgd Exp $ */ |
/*- |
* Copyright (c) 1992, 1993 |
* The Regents of the University of California. All rights reserved. |
* |
* This code is derived from software contributed to Berkeley by |
* Chris Torek and Darren F. Provine. |
* |
* 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 University 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 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. |
* |
* @(#)screen.h 8.1 (Berkeley) 5/31/93 |
*/ |
/** @addtogroup tetris |
* @{ |
*/ |
/** @file |
*/ |
/* |
* putpad() is for padded strings with count = 1. |
*/ |
#define putpad(s) tputs(s, 1, put) |
#include <sys/types.h> |
#include <async.h> |
typedef struct { |
ipcarg_t ws_row; |
ipcarg_t ws_col; |
} winsize_t; |
extern winsize_t winsize; |
extern void moveto(int r, int c); |
extern void clear_screen(void); |
/* just calls putchar; for tputs */ |
extern int put(int); |
extern void scr_clear(void); |
extern void scr_end(void); |
extern void scr_init(void); |
extern void scr_msg(char *, int); |
extern void scr_set(void); |
extern void scr_update(void); |
/** @} |
*/ |
//branches/snapshot/uspace/app/tetris/Makefile |
---|
0,0 → 1,39 |
LIBC_PREFIX = ../../lib/libc |
SOFTINT_PREFIX = ../../lib/softint |
include $(LIBC_PREFIX)/Makefile.toolchain |
LIBS = $(LIBC_PREFIX)/libc.a |
OUTPUT = tetris |
SOURCES = shapes.c scores.c input.c tetris.c screen.c |
OBJECTS := $(addsuffix .o,$(basename $(SOURCES))) |
.PHONY: all clean depend disasm |
all: $(OUTPUT) $(OUTPUT).disasm |
-include Makefile.depend |
depend: |
$(CC) $(DEFS) $(CFLAGS) -M $(SOURCES) > Makefile.depend |
$(OUTPUT): $(OBJECTS) $(LIBS) |
$(LD) -T $(LIBC_PREFIX)/arch/$(UARCH)/_link.ld $(OBJECTS) $(LIBS) $(LFLAGS) -o $@ -Map $(OUTPUT).map |
clean: |
-rm -f $(OUTPUT) $(OUTPUT).map $(OUTPUT).disasm Makefile.depend *.o |
disasm: $(OUTPUT).disasm |
$(OUTPUT).disasm: $(OUTPUT) |
$(OBJDUMP) -d $< > $@ |
%.o: %.S |
$(CC) $(DEFS) $(AFLAGS) $(CFLAGS) -D__ASM__ -c $< -o $@ |
%.o: %.s |
$(AS) $(AFLAGS) $< -o $@ |
%.o: %.c |
$(CC) $(DEFS) $(CFLAGS) -c $< -o $@ |
//branches/snapshot/uspace/app/getvc/getvc.c |
---|
0,0 → 1,106 |
/* |
* Copyright (c) 2009 Martin Decky |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup getvc GetVC |
* @brief Console initialization task. |
* @{ |
*/ |
/** |
* @file |
*/ |
#include <sys/types.h> |
#include <unistd.h> |
#include <stdio.h> |
#include <task.h> |
#include "version.h" |
static void usage(void) |
{ |
printf("Usage: getvc <device> <path>\n"); |
} |
static void closeall(void) |
{ |
fclose(stdin); |
fclose(stdout); |
fclose(stderr); |
close(0); |
close(1); |
close(2); |
} |
static task_id_t spawn(char *fname) |
{ |
char *argv[2]; |
argv[0] = fname; |
argv[1] = NULL; |
task_id_t id = task_spawn(fname, argv); |
if (id == 0) |
printf("Error spawning %s\n", fname); |
return id; |
} |
int main(int argc, char *argv[]) |
{ |
if (argc < 3) { |
usage(); |
return -1; |
} |
closeall(); |
stdin = fopen(argv[1], "r"); |
stdout = fopen(argv[1], "w"); |
stderr = fopen(argv[1], "w"); |
/* |
* FIXME: fopen() should actually detect that we are opening a console |
* and it should set line-buffering mode automatically. |
*/ |
setvbuf(stdout, NULL, _IOLBF, BUFSIZ); |
if ((stdin == NULL) |
|| (stdout == NULL) |
|| (stderr == NULL)) |
return -2; |
version_print(argv[1]); |
task_id_t id = spawn(argv[2]); |
task_wait(id); |
return 0; |
} |
/** @} |
*/ |
//branches/snapshot/uspace/app/getvc/version.c |
---|
0,0 → 1,67 |
/* |
* Copyright (c) 2009 Martin Decky |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup getvc |
* @{ |
*/ |
/** |
* @file |
*/ |
#include <unistd.h> |
#include <stdio.h> |
#include <macros.h> |
#include "getvc.h" |
#include "version.h" |
static char *release = STRING(RELEASE); |
static char *name = STRING(NAME); |
static char *arch = STRING(UARCH); |
#ifdef REVISION |
static char *revision = ", revision " STRING(REVISION); |
#else |
static char *revision = ""; |
#endif |
#ifdef TIMESTAMP |
static char *timestamp = "\nBuilt on " STRING(TIMESTAMP); |
#else |
static char *timestamp = ""; |
#endif |
/** Print version information. */ |
void version_print(const char *vc) |
{ |
printf("HelenOS release %s (%s)%s%s\n", release, name, revision, timestamp); |
printf("Running on %s (%s)\n", arch, vc); |
printf("Copyright (c) 2001-2009 HelenOS project\n\n"); |
} |
/** @} |
*/ |
//branches/snapshot/uspace/app/getvc/version.h |
---|
0,0 → 1,44 |
/* |
* Copyright (c) 2009 Martin Decky |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup getvc |
* @{ |
*/ |
/** |
* @file |
*/ |
#ifndef VERSION_H__ |
#define VERSION_H__ |
extern void version_print(const char *vc); |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/app/getvc/Makefile |
---|
0,0 → 1,79 |
# |
# Copyright (c) 2009 Martin Decky |
# All rights reserved. |
# |
# Redistribution and use in source and binary forms, with or without |
# modification, are permitted provided that the following conditions |
# are met: |
# |
# - Redistributions of source code must retain the above copyright |
# notice, this list of conditions and the following disclaimer. |
# - 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. |
# - The name of the author may not be used to endorse or promote products |
# derived from this software without specific prior written permission. |
# |
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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 ../../../version |
## Setup toolchain |
# |
LIBC_PREFIX = ../../lib/libc |
SOFTINT_PREFIX = ../../lib/softint |
include $(LIBC_PREFIX)/Makefile.toolchain |
LIBS = $(LIBC_PREFIX)/libc.a |
DEFS += -DRELEASE=$(RELEASE) "-DNAME=$(NAME)" |
## Sources |
# |
OUTPUT = getvc |
SOURCES = \ |
getvc.c \ |
version.c |
OBJECTS := $(addsuffix .o,$(basename $(SOURCES))) |
.PHONY: all clean depend disasm |
all: $(OUTPUT) $(OUTPUT).disasm |
-include Makefile.depend |
clean: |
-rm -f $(OUTPUT) $(OUTPUT).map $(OUTPUT).disasm Makefile.depend $(OBJECTS) |
depend: |
$(CC) $(DEFS) $(CFLAGS) -M $(SOURCES) > Makefile.depend |
$(OUTPUT): $(OBJECTS) $(LIBS) |
$(LD) -T $(LIBC_PREFIX)/arch/$(UARCH)/_link.ld $(OBJECTS) $(LIBS) $(LFLAGS) -o $@ -Map $(OUTPUT).map |
disasm: $(OUTPUT).disasm |
$(OUTPUT).disasm: $(OUTPUT) |
$(OBJDUMP) -d $< > $@ |
%.o: %.S |
$(CC) $(DEFS) $(AFLAGS) $(CFLAGS) -D__ASM__ -c $< -o $@ |
%.o: %.s |
$(AS) $(AFLAGS) $< -o $@ |
%.o: %.c |
$(CC) $(DEFS) $(CFLAGS) -c $< -o $@ |
//branches/snapshot/uspace/app/getvc/getvc.h |
---|
0,0 → 1,42 |
/* |
* Copyright (c) 2009 Martin Decky |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup getvc |
* @{ |
*/ |
/** |
* @file |
*/ |
#ifndef GETVC_H__ |
#define GETVC_H__ |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/app/klog/klog.c |
---|
0,0 → 1,96 |
/* |
* Copyright (c) 2006 Ondrej Palkovsky |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup klog KLog |
* @brief HelenOS KLog |
* @{ |
*/ |
/** |
* @file |
*/ |
#include <stdio.h> |
#include <ipc/ipc.h> |
#include <async.h> |
#include <ipc/services.h> |
#include <as.h> |
#include <sysinfo.h> |
#include <event.h> |
#include <errno.h> |
#include <io/klog.h> |
#define NAME "klog" |
/* Pointer to klog area */ |
static wchar_t *klog; |
static size_t klog_length; |
static void interrupt_received(ipc_callid_t callid, ipc_call_t *call) |
{ |
size_t klog_start = (size_t) IPC_GET_ARG1(*call); |
size_t klog_len = (size_t) IPC_GET_ARG2(*call); |
size_t klog_stored = (size_t) IPC_GET_ARG3(*call); |
size_t i; |
for (i = klog_len - klog_stored; i < klog_len; i++) |
putchar(klog[(klog_start + i) % klog_length]); |
} |
int main(int argc, char *argv[]) |
{ |
size_t klog_pages = sysinfo_value("klog.pages"); |
size_t klog_size = klog_pages * PAGE_SIZE; |
klog_length = klog_size / sizeof(wchar_t); |
klog = (wchar_t *) as_get_mappable_page(klog_size); |
if (klog == NULL) { |
printf(NAME ": Error allocating memory area\n"); |
return -1; |
} |
int res = ipc_share_in_start_1_0(PHONE_NS, (void *) klog, |
klog_size, SERVICE_MEM_KLOG); |
if (res != EOK) { |
printf(NAME ": Error initializing memory area\n"); |
return -1; |
} |
if (event_subscribe(EVENT_KLOG, 0) != EOK) { |
printf(NAME ": Error registering klog notifications\n"); |
return -1; |
} |
async_set_interrupt_received(interrupt_received); |
klog_update(); |
async_manager(); |
return 0; |
} |
/** @} |
*/ |
//branches/snapshot/uspace/app/klog/Makefile |
---|
0,0 → 1,76 |
# |
# Copyright (c) 2005 Martin Decky |
# All rights reserved. |
# |
# Redistribution and use in source and binary forms, with or without |
# modification, are permitted provided that the following conditions |
# are met: |
# |
# - Redistributions of source code must retain the above copyright |
# notice, this list of conditions and the following disclaimer. |
# - 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. |
# - The name of the author may not be used to endorse or promote products |
# derived from this software without specific prior written permission. |
# |
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
# |
## Setup toolchain |
# |
LIBC_PREFIX = ../../lib/libc |
SOFTINT_PREFIX = ../../lib/softint |
include $(LIBC_PREFIX)/Makefile.toolchain |
LIBS = $(LIBC_PREFIX)/libc.a |
## Sources |
# |
OUTPUT = klog |
SOURCES = \ |
klog.c |
OBJECTS := $(addsuffix .o,$(basename $(SOURCES))) |
.PHONY: all clean depend disasm |
all: $(OUTPUT) $(OUTPUT).disasm |
-include Makefile.depend |
clean: |
-rm -f $(OUTPUT) $(OUTPUT).map $(OUTPUT).disasm Makefile.depend $(OBJECTS) |
depend: |
$(CC) $(DEFS) $(CFLAGS) -M $(SOURCES) > Makefile.depend |
$(OUTPUT): $(OBJECTS) $(LIBS) |
$(LD) -T $(LIBC_PREFIX)/arch/$(UARCH)/_link.ld $(OBJECTS) $(LIBS) $(LFLAGS) -o $@ -Map $(OUTPUT).map |
disasm: $(OUTPUT).disasm |
$(OUTPUT).disasm: $(OUTPUT) |
$(OBJDUMP) -d $< > $@ |
%.o: %.S |
$(CC) $(DEFS) $(AFLAGS) $(CFLAGS) -D__ASM__ -c $< -o $@ |
%.o: %.s |
$(AS) $(AFLAGS) $< -o $@ |
%.o: %.c |
$(CC) $(DEFS) $(CFLAGS) -c $< -o $@ |
//branches/snapshot/uspace/lib/libc/include/getopt.h |
---|
0,0 → 1,71 |
/* $NetBSD: getopt.h,v 1.10.6.1 2008/05/18 12:30:09 yamt Exp $ */ |
/*- |
* Copyright (c) 2000 The NetBSD Foundation, Inc. |
* All rights reserved. |
* |
* This code is derived from software contributed to The NetBSD Foundation |
* by Dieter Baron and Thomas Klausner. |
* |
* 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. |
* |
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. 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 FOUNDATION 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. |
*/ |
/* Ported to HelenOS August 2008 by Tim Post <echo@echoreply.us> */ |
#ifndef _GETOPT_H_ |
#define _GETOPT_H_ |
#include <unistd.h> |
/* |
* Gnu like getopt_long() and BSD4.4 getsubopt()/optreset extensions |
*/ |
#define no_argument 0 |
#define required_argument 1 |
#define optional_argument 2 |
struct option { |
/* name of long option */ |
const char *name; |
/* |
* one of no_argument, required_argument, and optional_argument: |
* whether option takes an argument |
*/ |
int has_arg; |
/* if not NULL, set *flag to val when option found */ |
int *flag; |
/* if flag not NULL, value to set *flag to; else return value */ |
int val; |
}; |
/* HelenOS Port - These need to be exposed for legacy getopt() */ |
extern const char *optarg; |
extern int optind, opterr, optopt; |
extern int optreset; |
int getopt_long(int, char * const *, const char *, |
const struct option *, int *); |
/* HelenOS Port : Expose legacy getopt() */ |
int getopt(int, char * const [], const char *); |
#endif /* !_GETOPT_H_ */ |
//branches/snapshot/uspace/lib/libc/include/vfs/vfs.h |
---|
0,0 → 1,72 |
/* |
* Copyright (c) 2007 Jakub Jermar |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libc |
* @{ |
*/ |
/** @file |
*/ |
#ifndef LIBC_VFS_H_ |
#define LIBC_VFS_H_ |
#include <sys/types.h> |
#include <ipc/vfs.h> |
#include <ipc/devmap.h> |
#include <stdio.h> |
/** |
* This type is a libc version of the VFS triplet. |
* It uniquelly identifies a file system node within a file system instance. |
*/ |
typedef struct { |
fs_handle_t fs_handle; |
dev_handle_t dev_handle; |
fs_index_t index; |
} fdi_node_t; |
extern char *absolutize(const char *, size_t *); |
extern int mount(const char *, const char *, const char *, const char *, |
unsigned int); |
extern void __stdio_init(int filc, fdi_node_t *filv[]); |
extern void __stdio_done(void); |
extern int open_node(fdi_node_t *, int); |
extern int fd_phone(int); |
extern int fd_node(int, fdi_node_t *); |
extern FILE *fopen_node(fdi_node_t *, const char *); |
extern int fphone(FILE *); |
extern int fnode(FILE *, fdi_node_t *); |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/include/vfs/canonify.h |
---|
0,0 → 1,45 |
/* |
* Copyright (c) 2008 Jakub Jermar |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libc |
* @{ |
*/ |
/** @file |
*/ |
#ifndef LIBC_VFS_CANONIFY_H_ |
#define LIBC_VFS_CANONIFY_H_ |
#include <sys/types.h> |
extern char *canonify(char *, size_t *); |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/include/async.h |
---|
0,0 → 1,262 |
/* |
* Copyright (c) 2006 Ondrej Palkovsky |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libc |
* @{ |
*/ |
/** @file |
*/ |
#ifndef LIBC_ASYNC_H_ |
#define LIBC_ASYNC_H_ |
#include <ipc/ipc.h> |
#include <fibril.h> |
#include <sys/time.h> |
#include <atomic.h> |
#include <bool.h> |
typedef ipc_callid_t aid_t; |
typedef void (*async_client_conn_t)(ipc_callid_t callid, ipc_call_t *call); |
extern atomic_t async_futex; |
extern int __async_init(void); |
extern ipc_callid_t async_get_call_timeout(ipc_call_t *call, suseconds_t usecs); |
static inline ipc_callid_t async_get_call(ipc_call_t *data) |
{ |
return async_get_call_timeout(data, 0); |
} |
static inline void async_manager(void) |
{ |
fibril_switch(FIBRIL_TO_MANAGER); |
} |
/* |
* User-friendly wrappers for async_send_fast() and async_send_slow(). The |
* macros are in the form async_send_m(), where m denotes the number of payload |
* arguments. Each macros chooses between the fast and the slow version based |
* on m. |
*/ |
#define async_send_0(phoneid, method, dataptr) \ |
async_send_fast((phoneid), (method), 0, 0, 0, 0, (dataptr)) |
#define async_send_1(phoneid, method, arg1, dataptr) \ |
async_send_fast((phoneid), (method), (arg1), 0, 0, 0, (dataptr)) |
#define async_send_2(phoneid, method, arg1, arg2, dataptr) \ |
async_send_fast((phoneid), (method), (arg1), (arg2), 0, 0, (dataptr)) |
#define async_send_3(phoneid, method, arg1, arg2, arg3, dataptr) \ |
async_send_fast((phoneid), (method), (arg1), (arg2), (arg3), 0, (dataptr)) |
#define async_send_4(phoneid, method, arg1, arg2, arg3, arg4, dataptr) \ |
async_send_fast((phoneid), (method), (arg1), (arg2), (arg3), (arg4), \ |
(dataptr)) |
#define async_send_5(phoneid, method, arg1, arg2, arg3, arg4, arg5, dataptr) \ |
async_send_slow((phoneid), (method), (arg1), (arg2), (arg3), (arg4), \ |
(arg5), (dataptr)) |
extern aid_t async_send_fast(int phoneid, ipcarg_t method, ipcarg_t arg1, |
ipcarg_t arg2, ipcarg_t arg3, ipcarg_t arg4, ipc_call_t *dataptr); |
extern aid_t async_send_slow(int phoneid, ipcarg_t method, ipcarg_t arg1, |
ipcarg_t arg2, ipcarg_t arg3, ipcarg_t arg4, ipcarg_t arg5, |
ipc_call_t *dataptr); |
extern void async_wait_for(aid_t amsgid, ipcarg_t *result); |
extern int async_wait_timeout(aid_t amsgid, ipcarg_t *retval, |
suseconds_t timeout); |
extern fid_t async_new_connection(ipcarg_t in_phone_hash, ipc_callid_t callid, |
ipc_call_t *call, void (*cthread)(ipc_callid_t, ipc_call_t *)); |
extern void async_usleep(suseconds_t timeout); |
extern void async_create_manager(void); |
extern void async_destroy_manager(void); |
extern void async_set_client_connection(async_client_conn_t conn); |
extern void async_set_interrupt_received(async_client_conn_t conn); |
/* Wrappers for simple communication */ |
#define async_msg_0(phone, method) \ |
ipc_call_async_0((phone), (method), NULL, NULL, true) |
#define async_msg_1(phone, method, arg1) \ |
ipc_call_async_1((phone), (method), (arg1), NULL, NULL, \ |
true) |
#define async_msg_2(phone, method, arg1, arg2) \ |
ipc_call_async_2((phone), (method), (arg1), (arg2), NULL, NULL, \ |
true) |
#define async_msg_3(phone, method, arg1, arg2, arg3) \ |
ipc_call_async_3((phone), (method), (arg1), (arg2), (arg3), NULL, NULL, \ |
true) |
#define async_msg_4(phone, method, arg1, arg2, arg3, arg4) \ |
ipc_call_async_4((phone), (method), (arg1), (arg2), (arg3), (arg4), NULL, \ |
NULL, true) |
#define async_msg_5(phone, method, arg1, arg2, arg3, arg4, arg5) \ |
ipc_call_async_5((phone), (method), (arg1), (arg2), (arg3), (arg4), \ |
(arg5), NULL, NULL, true) |
/* |
* User-friendly wrappers for async_req_fast() and async_req_slow(). The macros |
* are in the form async_req_m_n(), where m is the number of payload arguments |
* and n is the number of return arguments. The macros decide between the fast |
* and slow verion based on m. |
*/ |
#define async_req_0_0(phoneid, method) \ |
async_req_fast((phoneid), (method), 0, 0, 0, 0, NULL, NULL, NULL, NULL, \ |
NULL) |
#define async_req_0_1(phoneid, method, r1) \ |
async_req_fast((phoneid), (method), 0, 0, 0, 0, (r1), NULL, NULL, NULL, \ |
NULL) |
#define async_req_0_2(phoneid, method, r1, r2) \ |
async_req_fast((phoneid), (method), 0, 0, 0, 0, (r1), (r2), NULL, NULL, \ |
NULL) |
#define async_req_0_3(phoneid, method, r1, r2, r3) \ |
async_req_fast((phoneid), (method), 0, 0, 0, 0, (r1), (r2), (r3), NULL, \ |
NULL) |
#define async_req_0_4(phoneid, method, r1, r2, r3, r4) \ |
async_req_fast((phoneid), (method), 0, 0, 0, 0, (r1), (r2), (r3), (r4), \ |
NULL) |
#define async_req_0_5(phoneid, method, r1, r2, r3, r4, r5) \ |
async_req_fast((phoneid), (method), 0, 0, 0, 0, (r1), (r2), (r3), (r4), \ |
(r5)) |
#define async_req_1_0(phoneid, method, arg1) \ |
async_req_fast((phoneid), (method), (arg1), 0, 0, 0, NULL, NULL, NULL, \ |
NULL, NULL) |
#define async_req_1_1(phoneid, method, arg1, rc1) \ |
async_req_fast((phoneid), (method), (arg1), 0, 0, 0, (rc1), NULL, NULL, \ |
NULL, NULL) |
#define async_req_1_2(phoneid, method, arg1, rc1, rc2) \ |
async_req_fast((phoneid), (method), (arg1), 0, 0, 0, (rc1), (rc2), NULL, \ |
NULL, NULL) |
#define async_req_1_3(phoneid, method, arg1, rc1, rc2, rc3) \ |
async_req_fast((phoneid), (method), (arg1), 0, 0, 0, (rc1), (rc2), (rc3), \ |
NULL, NULL) |
#define async_req_1_4(phoneid, method, arg1, rc1, rc2, rc3, rc4) \ |
async_req_fast((phoneid), (method), (arg1), 0, 0, 0, (rc1), (rc2), (rc3), \ |
(rc4), NULL) |
#define async_req_1_5(phoneid, method, arg1, rc1, rc2, rc3, rc4, rc5) \ |
async_req_fast((phoneid), (method), (arg1), 0, 0, 0, (rc1), (rc2), (rc3), \ |
(rc4), (rc5)) |
#define async_req_2_0(phoneid, method, arg1, arg2) \ |
async_req_fast((phoneid), (method), (arg1), (arg2), 0, 0, NULL, NULL, \ |
NULL, NULL, NULL) |
#define async_req_2_1(phoneid, method, arg1, arg2, rc1) \ |
async_req_fast((phoneid), (method), (arg1), (arg2), 0, 0, (rc1), NULL, \ |
NULL, NULL, NULL) |
#define async_req_2_2(phoneid, method, arg1, arg2, rc1, rc2) \ |
async_req_fast((phoneid), (method), (arg1), (arg2), 0, 0, (rc1), (rc2), \ |
NULL, NULL, NULL) |
#define async_req_2_3(phoneid, method, arg1, arg2, rc1, rc2, rc3) \ |
async_req_fast((phoneid), (method), (arg1), (arg2), 0, 0, (rc1), (rc2), \ |
(rc3), NULL, NULL) |
#define async_req_2_4(phoneid, method, arg1, arg2, rc1, rc2, rc3, rc4) \ |
async_req_fast((phoneid), (method), (arg1), (arg2), 0, 0, (rc1), (rc2), \ |
(rc3), (rc4), NULL) |
#define async_req_2_5(phoneid, method, arg1, arg2, rc1, rc2, rc3, rc4, rc5) \ |
async_req_fast((phoneid), (method), (arg1), (arg2), 0, 0, (rc1), (rc2), \ |
(rc3), (rc4), (rc5)) |
#define async_req_3_0(phoneid, method, arg1, arg2, arg3) \ |
async_req_fast((phoneid), (method), (arg1), (arg2), (arg3), 0, NULL, NULL, \ |
NULL, NULL, NULL) |
#define async_req_3_1(phoneid, method, arg1, arg2, arg3, rc1) \ |
async_req_fast((phoneid), (method), (arg1), (arg2), (arg3), 0, (rc1), \ |
NULL, NULL, NULL, NULL) |
#define async_req_3_2(phoneid, method, arg1, arg2, arg3, rc1, rc2) \ |
async_req_fast((phoneid), (method), (arg1), (arg2), (arg3), 0, (rc1), \ |
(rc2), NULL, NULL, NULL) |
#define async_req_3_3(phoneid, method, arg1, arg2, arg3, rc1, rc2, rc3) \ |
async_req_fast((phoneid), (method), (arg1), (arg2), (arg3), 0, (rc1), \ |
(rc2), (rc3), NULL, NULL) |
#define async_req_3_4(phoneid, method, arg1, arg2, arg3, rc1, rc2, rc3, rc4) \ |
async_req_fast((phoneid), (method), (arg1), (arg2), (arg3), 0, (rc1), \ |
(rc2), (rc3), (rc4), NULL) |
#define async_req_3_5(phoneid, method, arg1, arg2, arg3, rc1, rc2, rc3, rc4, \ |
rc5) \ |
async_req_fast((phoneid), (method), (arg1), (arg2), (arg3), 0, (rc1), \ |
(rc2), (rc3), (rc4), (rc5)) |
#define async_req_4_0(phoneid, method, arg1, arg2, arg3, arg4) \ |
async_req_fast((phoneid), (method), (arg1), (arg2), (arg3), (arg4), NULL, \ |
NULL, NULL, NULL, NULL) |
#define async_req_4_1(phoneid, method, arg1, arg2, arg3, arg4, rc1) \ |
async_req_fast((phoneid), (method), (arg1), (arg2), (arg3), (arg4), (rc1), \ |
NULL, NULL, NULL, NULL) |
#define async_req_4_2(phoneid, method, arg1, arg2, arg3, arg4, rc1, rc2) \ |
async_req_fast((phoneid), (method), (arg1), (arg2), (arg3), (arg4), (rc1), \ |
(rc2), NULL, NULL, NULL) |
#define async_req_4_3(phoneid, method, arg1, arg2, arg3, arg4, rc1, rc2, rc3) \ |
async_req_fast((phoneid), (method), (arg1), (arg2), (arg3), (arg4), (rc1), \ |
(rc2), (rc3), NULL, NULL) |
#define async_req_4_4(phoneid, method, arg1, arg2, arg3, arg4, rc1, rc2, rc3, \ |
rc4) \ |
async_req_fast((phoneid), (method), (arg1), (arg2), (arg3), (arg4), \ |
(rc1), (rc2), (rc3), (rc4), NULL) |
#define async_req_4_5(phoneid, method, arg1, arg2, arg3, arg4, rc1, rc2, rc3, \ |
rc4, rc5) \ |
async_req_fast((phoneid), (method), (arg1), (arg2), (arg3), (arg4), \ |
(rc1), (rc2), (rc3), (rc4), (rc5)) |
#define async_req_5_0(phoneid, method, arg1, arg2, arg3, arg4, arg5) \ |
async_req_slow((phoneid), (method), (arg1), (arg2), (arg3), (arg4), \ |
(arg5), NULL, NULL, NULL, NULL, NULL) |
#define async_req_5_1(phoneid, method, arg1, arg2, arg3, arg4, arg5, rc1) \ |
async_req_slow((phoneid), (method), (arg1), (arg2), (arg3), (arg4), \ |
(arg5), (rc1), NULL, NULL, NULL, NULL) |
#define async_req_5_2(phoneid, method, arg1, arg2, arg3, arg4, arg5, rc1, rc2) \ |
async_req_slow((phoneid), (method), (arg1), (arg2), (arg3), (arg4), \ |
(arg5), (rc1), (rc2), NULL, NULL, NULL) |
#define async_req_5_3(phoneid, method, arg1, arg2, arg3, arg4, arg5, rc1, rc2, \ |
rc3) \ |
async_req_slow((phoneid), (method), (arg1), (arg2), (arg3), (arg4), \ |
(arg5), (rc1), (rc2), (rc3), NULL, NULL) |
#define async_req_5_4(phoneid, method, arg1, arg2, arg3, arg4, arg5, rc1, rc2, \ |
rc3, rc4) \ |
async_req_slow((phoneid), (method), (arg1), (arg2), (arg3), (arg4), \ |
(arg5), (rc1), (rc2), (rc3), (rc4), NULL) |
#define async_req_5_5(phoneid, method, arg1, arg2, arg3, arg4, arg5, rc1, rc2, \ |
rc3, rc4, rc5) \ |
async_req_slow((phoneid), (method), (arg1), (arg2), (arg3), (arg4), \ |
(arg5), (rc1), (rc2), (rc3), (rc4), (rc5)) |
extern ipcarg_t async_req_fast(int phoneid, ipcarg_t method, ipcarg_t arg1, |
ipcarg_t arg2, ipcarg_t arg3, ipcarg_t arg4, ipcarg_t *r1, ipcarg_t *r2, |
ipcarg_t *r3, ipcarg_t *r4, ipcarg_t *r5); |
extern ipcarg_t async_req_slow(int phoneid, ipcarg_t method, ipcarg_t arg1, |
ipcarg_t arg2, ipcarg_t arg3, ipcarg_t arg4, ipcarg_t arg5, ipcarg_t *r1, |
ipcarg_t *r2, ipcarg_t *r3, ipcarg_t *r4, ipcarg_t *r5); |
static inline void async_serialize_start(void) |
{ |
fibril_inc_sercount(); |
} |
static inline void async_serialize_end(void) |
{ |
fibril_dec_sercount(); |
} |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/include/stdlib.h |
---|
0,0 → 1,62 |
/* |
* Copyright (c) 2005 Martin Decky |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libc |
* @{ |
*/ |
/** @file |
*/ |
#ifndef LIBC_STDLIB_H_ |
#define LIBC_STDLIB_H_ |
#include <unistd.h> |
#include <malloc.h> |
#define abort() _exit(1) |
#define exit(status) _exit((status)) |
#define RAND_MAX 714025 |
extern long int random(void); |
extern void srandom(unsigned int seed); |
static inline int rand(void) |
{ |
return random(); |
} |
static inline void srand(unsigned int seed) |
{ |
srandom(seed); |
} |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/include/stdio.h |
---|
0,0 → 1,154 |
/* |
* Copyright (c) 2005 Martin Decky |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libc |
* @{ |
*/ |
/** @file |
*/ |
#ifndef LIBC_STDIO_H_ |
#define LIBC_STDIO_H_ |
#include <sys/types.h> |
#include <stdarg.h> |
#include <string.h> |
#include <adt/list.h> |
#define EOF (-1) |
/** Default size for stream I/O buffers */ |
#define BUFSIZ 4096 |
#define DEBUG(fmt, ...) \ |
{ \ |
char _buf[256]; \ |
int _n = snprintf(_buf, sizeof(_buf), fmt, ##__VA_ARGS__); \ |
if (_n > 0) \ |
(void) __SYSCALL3(SYS_KLOG, 1, (sysarg_t) _buf, str_size(_buf)); \ |
} |
#ifndef SEEK_SET |
#define SEEK_SET 0 |
#define SEEK_CUR 1 |
#define SEEK_END 2 |
#endif |
enum _buffer_type { |
/** No buffering */ |
_IONBF, |
/** Line buffering */ |
_IOLBF, |
/** Full buffering */ |
_IOFBF |
}; |
typedef struct { |
/** Linked list pointer. */ |
link_t link; |
/** Underlying file descriptor. */ |
int fd; |
/** Error indicator. */ |
int error; |
/** End-of-file indicator. */ |
int eof; |
/** Klog indicator */ |
int klog; |
/** Phone to the file provider */ |
int phone; |
/** Buffering type */ |
enum _buffer_type btype; |
/** Buffer */ |
uint8_t *buf; |
/** Buffer size */ |
size_t buf_size; |
/** Buffer I/O pointer */ |
uint8_t *buf_head; |
} FILE; |
extern FILE *stdin; |
extern FILE *stdout; |
extern FILE *stderr; |
/* Character and string input functions */ |
extern int fgetc(FILE *); |
extern char *fgets(char *, size_t, FILE *); |
extern int getchar(void); |
extern char *gets(char *, size_t); |
/* Character and string output functions */ |
extern int fputc(wchar_t, FILE *); |
extern int fputs(const char *, FILE *); |
extern int putchar(wchar_t); |
extern int puts(const char *); |
/* Formatted string output functions */ |
extern int fprintf(FILE *, const char*, ...); |
extern int vfprintf(FILE *, const char *, va_list); |
extern int printf(const char *, ...); |
extern int vprintf(const char *, va_list); |
extern int snprintf(char *, size_t , const char *, ...); |
extern int asprintf(char **, const char *, ...); |
extern int vsnprintf(char *, size_t, const char *, va_list); |
/* File stream functions */ |
extern FILE *fopen(const char *, const char *); |
extern FILE *fdopen(int, const char *); |
extern int fclose(FILE *); |
extern size_t fread(void *, size_t, size_t, FILE *); |
extern size_t fwrite(const void *, size_t, size_t, FILE *); |
extern int fseek(FILE *, long, int); |
extern void rewind(FILE *); |
extern int ftell(FILE *); |
extern int feof(FILE *); |
extern int fflush(FILE *); |
extern int ferror(FILE *); |
extern void clearerr(FILE *); |
extern void setvbuf(FILE *, void *, int, size_t); |
/* Misc file functions */ |
extern int rename(const char *, const char *); |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/include/bitops.h |
---|
0,0 → 1,97 |
/* |
* Copyright (c) 2006 Ondrej Palkovsky |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup generic |
* @{ |
*/ |
/** @file |
*/ |
#ifndef LIBC_BITOPS_H_ |
#define LIBC_BITOPS_H_ |
#include <sys/types.h> |
/** Return position of first non-zero bit from left (i.e. [log_2(arg)]). |
* |
* If number is zero, it returns 0 |
*/ |
static inline unsigned int fnzb32(uint32_t arg) |
{ |
unsigned int n = 0; |
if (arg >> 16) { |
arg >>= 16; |
n += 16; |
} |
if (arg >> 8) { |
arg >>= 8; |
n += 8; |
} |
if (arg >> 4) { |
arg >>= 4; |
n += 4; |
} |
if (arg >> 2) { |
arg >>= 2; |
n += 2; |
} |
if (arg >> 1) { |
arg >>= 1; |
n += 1; |
} |
return n; |
} |
static inline unsigned int fnzb64(uint64_t arg) |
{ |
unsigned int n = 0; |
if (arg >> 32) { |
arg >>= 32; |
n += 32; |
} |
return (n + fnzb32((uint32_t) arg)); |
} |
static inline unsigned int fnzb(size_t arg) |
{ |
return fnzb64(arg); |
} |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/include/unistd.h |
---|
0,0 → 1,74 |
/* |
* Copyright (c) 2005 Martin Decky |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libc |
* @{ |
*/ |
/** @file |
*/ |
#ifndef LIBC_UNISTD_H_ |
#define LIBC_UNISTD_H_ |
#include <sys/types.h> |
#include <libarch/config.h> |
#ifndef NULL |
#define NULL 0 |
#endif |
#define getpagesize() (PAGE_SIZE) |
#ifndef SEEK_SET |
#define SEEK_SET 0 |
#define SEEK_CUR 1 |
#define SEEK_END 2 |
#endif |
extern ssize_t write(int, const void *, size_t); |
extern ssize_t read(int, void *, size_t); |
extern off_t lseek(int, off_t, int); |
extern int ftruncate(int, off_t); |
extern int close(int); |
extern int fsync(int); |
extern int unlink(const char *); |
extern char *getcwd(char *buf, size_t); |
extern int rmdir(const char *); |
extern int chdir(const char *); |
extern void _exit(int status) __attribute__ ((noreturn)); |
extern int usleep(unsigned long usec); |
extern unsigned int sleep(unsigned int seconds); |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/include/mem.h |
---|
0,0 → 1,51 |
/* |
* Copyright (c) 2005 Martin Decky |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libc |
* @{ |
*/ |
/** @file |
*/ |
#ifndef LIBC_MEM_H_ |
#define LIBC_MEM_H_ |
#include <sys/types.h> |
#define bzero(ptr, len) memset((ptr), 0, (len)) |
extern void *memset(void *, int, size_t); |
extern void *memcpy(void *, const void *, size_t); |
extern void *memmove(void *, const void *, size_t); |
extern int bcmp(const char *, const char *, size_t); |
#endif |
/** @} |
*/ |
Property changes: |
Added: svn:mergeinfo |
//branches/snapshot/uspace/lib/libc/include/adt/gcdlcm.h |
---|
0,0 → 1,73 |
/* |
* Copyright (c) 2009 Martin Decky |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libc |
* @{ |
*/ |
/** @file |
*/ |
#ifndef LIBC_GCDLCM_H_ |
#define LIBC_GCDLCM_H_ |
#include <sys/types.h> |
#define DECLARE_GCD(type, name) \ |
static inline type name(type a, type b) \ |
{ \ |
if (a == 0) \ |
return b; \ |
\ |
while (b != 0) { \ |
if (a > b) \ |
a -= b; \ |
else \ |
b -= a; \ |
} \ |
\ |
return a; \ |
} |
#define DECLARE_LCM(type, name, gcd) \ |
static inline type name(type a, type b) \ |
{ \ |
return (a * b) / gcd(a, b); \ |
} |
DECLARE_GCD(uint32_t, gcd32); |
DECLARE_GCD(uint64_t, gcd64); |
DECLARE_GCD(size_t, gcd); |
DECLARE_LCM(uint32_t, lcm32, gcd32); |
DECLARE_LCM(uint64_t, lcm64, gcd64); |
DECLARE_LCM(size_t, lcm, gcd); |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/include/adt/hash_table.h |
---|
0,0 → 1,94 |
/* |
* Copyright (c) 2006 Jakub Jermar |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libc |
* @{ |
*/ |
/** @file |
*/ |
#ifndef LIBC_HASH_TABLE_H_ |
#define LIBC_HASH_TABLE_H_ |
#include <adt/list.h> |
#include <unistd.h> |
typedef unsigned long hash_count_t; |
typedef unsigned long hash_index_t; |
typedef struct hash_table hash_table_t; |
typedef struct hash_table_operations hash_table_operations_t; |
/** Hash table structure. */ |
struct hash_table { |
link_t *entry; |
hash_count_t entries; |
hash_count_t max_keys; |
hash_table_operations_t *op; |
}; |
/** Set of operations for hash table. */ |
struct hash_table_operations { |
/** Hash function. |
* |
* @param key Array of keys needed to compute hash index. All keys |
* must be passed. |
* |
* @return Index into hash table. |
*/ |
hash_index_t (* hash)(unsigned long key[]); |
/** Hash table item comparison function. |
* |
* @param key Array of keys that will be compared with item. It is |
* not necessary to pass all keys. |
* |
* @return true if the keys match, false otherwise. |
*/ |
int (*compare)(unsigned long key[], hash_count_t keys, link_t *item); |
/** Hash table item removal callback. |
* |
* @param item Item that was removed from the hash table. |
*/ |
void (*remove_callback)(link_t *item); |
}; |
#define hash_table_get_instance(item, type, member) \ |
list_get_instance((item), type, member) |
extern int hash_table_create(hash_table_t *, hash_count_t, hash_count_t, |
hash_table_operations_t *); |
extern void hash_table_insert(hash_table_t *, unsigned long [], link_t *); |
extern link_t *hash_table_find(hash_table_t *, unsigned long []); |
extern void hash_table_remove(hash_table_t *, unsigned long [], hash_count_t); |
extern void hash_table_destroy(hash_table_t *); |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/include/adt/list.h |
---|
0,0 → 1,201 |
/* |
* Copyright (c) 2001-2004 Jakub Jermar |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libc |
* @{ |
*/ |
/** @file |
*/ |
#ifndef LIBC_LIST_H_ |
#define LIBC_LIST_H_ |
#include <unistd.h> |
/** Doubly linked list head and link type. */ |
typedef struct link { |
struct link *prev; /**< Pointer to the previous item in the list. */ |
struct link *next; /**< Pointer to the next item in the list. */ |
} link_t; |
/** Declare and initialize statically allocated list. |
* |
* @param name Name of the new statically allocated list. |
*/ |
#define LIST_INITIALIZE(name) link_t name = { \ |
.prev = &name, \ |
.next = &name \ |
} |
/** Initialize doubly-linked circular list link |
* |
* Initialize doubly-linked list link. |
* |
* @param link Pointer to link_t structure to be initialized. |
*/ |
static inline void link_initialize(link_t *link) |
{ |
link->prev = NULL; |
link->next = NULL; |
} |
/** Initialize doubly-linked circular list |
* |
* Initialize doubly-linked circular list. |
* |
* @param head Pointer to link_t structure representing head of the list. |
*/ |
static inline void list_initialize(link_t *head) |
{ |
head->prev = head; |
head->next = head; |
} |
/** Add item to the beginning of doubly-linked circular list |
* |
* Add item to the beginning of doubly-linked circular list. |
* |
* @param link Pointer to link_t structure to be added. |
* @param head Pointer to link_t structure representing head of the list. |
*/ |
static inline void list_prepend(link_t *link, link_t *head) |
{ |
link->next = head->next; |
link->prev = head; |
head->next->prev = link; |
head->next = link; |
} |
/** Add item to the end of doubly-linked circular list |
* |
* Add item to the end of doubly-linked circular list. |
* |
* @param link Pointer to link_t structure to be added. |
* @param head Pointer to link_t structure representing head of the list. |
*/ |
static inline void list_append(link_t *link, link_t *head) |
{ |
link->prev = head->prev; |
link->next = head; |
head->prev->next = link; |
head->prev = link; |
} |
/** Insert item before another item in doubly-linked circular list. */ |
static inline void list_insert_before(link_t *l, link_t *r) |
{ |
list_append(l, r); |
} |
/** Insert item after another item in doubly-linked circular list. */ |
static inline void list_insert_after(link_t *r, link_t *l) |
{ |
list_prepend(l, r); |
} |
/** Remove item from doubly-linked circular list |
* |
* Remove item from doubly-linked circular list. |
* |
* @param link Pointer to link_t structure to be removed from the list it is contained in. |
*/ |
static inline void list_remove(link_t *link) |
{ |
link->next->prev = link->prev; |
link->prev->next = link->next; |
link_initialize(link); |
} |
/** Query emptiness of doubly-linked circular list |
* |
* Query emptiness of doubly-linked circular list. |
* |
* @param head Pointer to link_t structure representing head of the list. |
*/ |
static inline int list_empty(link_t *head) |
{ |
return ((head->next == head) ? 1 : 0); |
} |
/** Split or concatenate headless doubly-linked circular list |
* |
* Split or concatenate headless doubly-linked circular list. |
* |
* Note that the algorithm works both directions: |
* concatenates splitted lists and splits concatenated lists. |
* |
* @param part1 Pointer to link_t structure leading the first (half of the headless) list. |
* @param part2 Pointer to link_t structure leading the second (half of the headless) list. |
*/ |
static inline void headless_list_split_or_concat(link_t *part1, link_t *part2) |
{ |
part1->prev->next = part2; |
part2->prev->next = part1; |
link_t *hlp = part1->prev; |
part1->prev = part2->prev; |
part2->prev = hlp; |
} |
/** Split headless doubly-linked circular list |
* |
* Split headless doubly-linked circular list. |
* |
* @param part1 Pointer to link_t structure leading the first half of the headless list. |
* @param part2 Pointer to link_t structure leading the second half of the headless list. |
*/ |
static inline void headless_list_split(link_t *part1, link_t *part2) |
{ |
headless_list_split_or_concat(part1, part2); |
} |
/** Concatenate two headless doubly-linked circular lists |
* |
* Concatenate two headless doubly-linked circular lists. |
* |
* @param part1 Pointer to link_t structure leading the first headless list. |
* @param part2 Pointer to link_t structure leading the second headless list. |
*/ |
static inline void headless_list_concat(link_t *part1, link_t *part2) |
{ |
headless_list_split_or_concat(part1, part2); |
} |
#define list_get_instance(link, type, member) ((type *) (((void *)(link)) - ((void *) &(((type *) NULL)->member)))) |
extern int list_member(const link_t *link, const link_t *head); |
extern void list_concat(link_t *head1, link_t *head2); |
extern unsigned int list_count(const link_t *link); |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/include/adt/fifo.h |
---|
0,0 → 1,127 |
/* |
* Copyright (c) 2006 Jakub Jermar |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libc |
* @{ |
*/ |
/** @file |
*/ |
/* |
* This implementation of FIFO stores values in an array |
* (static or dynamic). As such, these FIFOs have upper bound |
* on number of values they can store. Push and pop operations |
* are done via accessing the array through head and tail indices. |
* Because of better operation ordering in fifo_pop(), the access |
* policy for these two indices is to 'increment (mod size of FIFO) |
* and use'. |
*/ |
#ifndef LIBC_FIFO_H_ |
#define LIBC_FIFO_H_ |
#include <malloc.h> |
typedef unsigned long fifo_count_t; |
typedef unsigned long fifo_index_t; |
#define FIFO_CREATE_STATIC(name, t, itms) \ |
struct { \ |
t fifo[(itms)]; \ |
fifo_count_t items; \ |
fifo_index_t head; \ |
fifo_index_t tail; \ |
} name |
/** Create and initialize static FIFO. |
* |
* FIFO is allocated statically. |
* This macro is suitable for creating smaller FIFOs. |
* |
* @param name Name of FIFO. |
* @param t Type of values stored in FIFO. |
* @param itms Number of items that can be stored in FIFO. |
*/ |
#define FIFO_INITIALIZE_STATIC(name, t, itms) \ |
FIFO_CREATE_STATIC(name, t, itms) = { \ |
.items = (itms), \ |
.head = 0, \ |
.tail = 0 \ |
} |
/** Create and prepare dynamic FIFO. |
* |
* FIFO is allocated dynamically. |
* This macro is suitable for creating larger FIFOs. |
* |
* @param name Name of FIFO. |
* @param t Type of values stored in FIFO. |
* @param itms Number of items that can be stored in FIFO. |
*/ |
#define FIFO_INITIALIZE_DYNAMIC(name, t, itms) \ |
struct { \ |
t *fifo; \ |
fifo_count_t items; \ |
fifo_index_t head; \ |
fifo_index_t tail; \ |
} name = { \ |
.fifo = NULL, \ |
.items = (itms), \ |
.head = 0, \ |
.tail = 0 \ |
} |
/** Pop value from head of FIFO. |
* |
* @param name FIFO name. |
* |
* @return Leading value in FIFO. |
*/ |
#define fifo_pop(name) \ |
name.fifo[name.head = (name.head + 1) < name.items ? (name.head + 1) : 0] |
/** Push value to tail of FIFO. |
* |
* @param name FIFO name. |
* @param value Value to be appended to FIFO. |
* |
*/ |
#define fifo_push(name, value) \ |
name.fifo[name.tail = (name.tail + 1) < name.items ? (name.tail + 1) : 0] = (value) |
/** Allocate memory for dynamic FIFO. |
* |
* @param name FIFO name. |
*/ |
#define fifo_create(name) \ |
name.fifo = malloc(sizeof(*name.fifo) * name.items) |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/include/macros.h |
---|
0,0 → 1,60 |
/* |
* Copyright (c) 2009 Martin Decky |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libc |
* @{ |
*/ |
/** @file |
*/ |
#ifndef LIBC_MACROS_H_ |
#define LIBC_MACROS_H_ |
#define min(a, b) ((a) < (b) ? (a) : (b)) |
#define max(a, b) ((a) > (b) ? (a) : (b)) |
#define SIZE2KB(size) ((size) >> 10) |
#define SIZE2MB(size) ((size) >> 20) |
#define KB2SIZE(kb) ((kb) << 10) |
#define MB2SIZE(mb) ((mb) << 20) |
#define STRING(arg) STRING_ARG(arg) |
#define STRING_ARG(arg) #arg |
#define LOWER32(arg) ((arg) & 0xffffffff) |
#define UPPER32(arg) (((arg) >> 32) & 0xffffffff) |
#define MERGE_LOUP32(lo, up) \ |
((((uint64_t) (lo)) & 0xffffffff) \ |
| ((((uint64_t) (up)) & 0xffffffff) << 32)) |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/include/errno.h |
---|
0,0 → 1,61 |
/* |
* Copyright (c) 2006 Ondrej Palkovsky |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libc |
* @{ |
*/ |
/** @file |
*/ |
#ifndef LIBC_ERRNO_H_ |
#define LIBC_ERRNO_H_ |
#include <kernel/errno.h> |
#include <fibril.h> |
extern int _errno; |
#define errno _errno |
#define EMFILE (-17) |
#define ENAMETOOLONG (-256) |
#define EISDIR (-257) |
#define ENOTDIR (-258) |
#define ENOSPC (-259) |
#define EEXIST (-260) |
#define ENOTEMPTY (-261) |
#define EBADF (-262) |
#define ERANGE (-263) |
#define EXDEV (-264) |
#define EIO (-265) |
#define EMLINK (-266) |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/include/malloc.h |
---|
0,0 → 1,51 |
/* |
* Copyright (c) 2009 Martin Decky |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libc |
* @{ |
*/ |
/** @file |
*/ |
#ifndef LIBC_MALLOC_H_ |
#define LIBC_MALLOC_H_ |
#include <sys/types.h> |
extern void __heap_init(void); |
extern uintptr_t get_max_heap_addr(void); |
extern void *malloc(const size_t size); |
extern void *memalign(const size_t align, const size_t size); |
extern void *realloc(const void *addr, const size_t size); |
extern void free(const void *addr); |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/include/devmap.h |
---|
0,0 → 1,59 |
/* |
* Copyright (c) 2009 Jiri Svoboda |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libc |
* @{ |
*/ |
/** @file |
*/ |
#ifndef LIBC_DEVMAP_H_ |
#define LIBC_DEVMAP_H_ |
#include <ipc/devmap.h> |
#include <async.h> |
extern int devmap_get_phone(devmap_interface_t, unsigned int); |
extern void devmap_hangup_phone(devmap_interface_t iface); |
extern int devmap_driver_register(const char *, async_client_conn_t); |
extern int devmap_device_register(const char *, dev_handle_t *); |
extern int devmap_device_get_handle(const char *, dev_handle_t *, unsigned int); |
extern int devmap_device_connect(dev_handle_t, unsigned int); |
extern int devmap_null_create(void); |
extern void devmap_null_destroy(int); |
extern ipcarg_t devmap_device_get_count(void); |
extern ipcarg_t devmap_device_get_devices(ipcarg_t, dev_desc_t *); |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/include/ipc/devmap.h |
---|
0,0 → 1,78 |
/* |
* Copyright (c) 2007 Josef Cejka |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup devmap |
* @{ |
*/ |
#ifndef DEVMAP_DEVMAP_H_ |
#define DEVMAP_DEVMAP_H_ |
#include <atomic.h> |
#include <ipc/ipc.h> |
#include <adt/list.h> |
#define DEVMAP_NAME_MAXLEN 255 |
typedef ipcarg_t dev_handle_t; |
typedef enum { |
DEVMAP_DRIVER_REGISTER = IPC_FIRST_USER_METHOD, |
DEVMAP_DRIVER_UNREGISTER, |
DEVMAP_DEVICE_REGISTER, |
DEVMAP_DEVICE_UNREGISTER, |
DEVMAP_DEVICE_GET_NAME, |
DEVMAP_DEVICE_GET_HANDLE, |
DEVMAP_DEVICE_NULL_CREATE, |
DEVMAP_DEVICE_NULL_DESTROY, |
DEVMAP_DEVICE_GET_COUNT, |
DEVMAP_DEVICE_GET_DEVICES |
} devmap_request_t; |
/** Interface provided by devmap. |
* |
* Every process that connects to devmap must ask one of following |
* interfaces otherwise connection will be refused. |
* |
*/ |
typedef enum { |
/** Connect as device driver */ |
DEVMAP_DRIVER = 1, |
/** Connect as client */ |
DEVMAP_CLIENT, |
/** Create new connection to instance of device that |
is specified by second argument of call. */ |
DEVMAP_CONNECT_TO_DEVICE |
} devmap_interface_t; |
typedef struct { |
dev_handle_t handle; |
char name[DEVMAP_NAME_MAXLEN + 1]; |
} dev_desc_t; |
#endif |
//branches/snapshot/uspace/lib/libc/include/ipc/vfs.h |
---|
0,0 → 1,154 |
/* |
* Copyright (c) 2009 Martin Decky |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libcipc |
* @{ |
*/ |
/** @file |
*/ |
#ifndef LIBC_IPC_VFS_H_ |
#define LIBC_IPC_VFS_H_ |
#include <sys/types.h> |
#include <ipc/ipc.h> |
#define FS_NAME_MAXLEN 20 |
#define MAX_PATH_LEN (64 * 1024) |
#define PLB_SIZE (2 * MAX_PATH_LEN) |
/* Basic types. */ |
typedef int16_t fs_handle_t; |
typedef uint32_t fs_index_t; |
/** |
* A structure like this is passed to VFS by each individual FS upon its |
* registration. It assosiates a human-readable identifier with each |
* registered FS. |
*/ |
typedef struct { |
/** Unique identifier of the fs. */ |
char name[FS_NAME_MAXLEN + 1]; |
} vfs_info_t; |
typedef enum { |
VFS_IN_OPEN = IPC_FIRST_USER_METHOD, |
VFS_IN_OPEN_NODE, |
VFS_IN_READ, |
VFS_IN_WRITE, |
VFS_IN_SEEK, |
VFS_IN_TRUNCATE, |
VFS_IN_FSTAT, |
VFS_IN_CLOSE, |
VFS_IN_MOUNT, |
VFS_IN_UNMOUNT, |
VFS_IN_DEVICE, |
VFS_IN_SYNC, |
VFS_IN_REGISTER, |
VFS_IN_MKDIR, |
VFS_IN_UNLINK, |
VFS_IN_RENAME, |
VFS_IN_STAT, |
VFS_IN_NODE |
} vfs_in_request_t; |
typedef enum { |
VFS_OUT_OPEN_NODE = IPC_FIRST_USER_METHOD, |
VFS_OUT_READ, |
VFS_OUT_WRITE, |
VFS_OUT_TRUNCATE, |
VFS_OUT_CLOSE, |
VFS_OUT_MOUNT, |
VFS_OUT_MOUNTED, |
VFS_OUT_UNMOUNT, |
VFS_OUT_DEVICE, |
VFS_OUT_SYNC, |
VFS_OUT_STAT, |
VFS_OUT_LOOKUP, |
VFS_OUT_DESTROY, |
VFS_OUT_LAST |
} vfs_out_request_t; |
/* |
* Lookup flags. |
*/ |
/** |
* No lookup flags used. |
*/ |
#define L_NONE 0 |
/** |
* Lookup will succeed only if the object is a regular file. If L_CREATE is |
* specified, an empty file will be created. This flag is mutually exclusive |
* with L_DIRECTORY. |
*/ |
#define L_FILE 1 |
/** |
* Lookup wil succeed only if the object is a directory. If L_CREATE is |
* specified, an empty directory will be created. This flag is mutually |
* exclusive with L_FILE. |
*/ |
#define L_DIRECTORY 2 |
/** |
* When used with L_CREATE, L_EXCLUSIVE will cause the lookup to fail if the |
* object already exists. L_EXCLUSIVE is implied when L_DIRECTORY is used. |
*/ |
#define L_EXCLUSIVE 4 |
/** |
* L_CREATE is used for creating both regular files and directories. |
*/ |
#define L_CREATE 8 |
/** |
* L_LINK is used for linking to an already existing nodes. |
*/ |
#define L_LINK 16 |
/** |
* L_UNLINK is used to remove leaves from the file system namespace. This flag |
* cannot be passed directly by the client, but will be set by VFS during |
* VFS_UNLINK. |
*/ |
#define L_UNLINK 32 |
/** |
* L_OPEN is used to indicate that the lookup operation is a part of VFS_OPEN |
* call from the client. This means that the server might allocate some |
* resources for the opened file. This flag cannot be passed directly by the |
* client. |
*/ |
#define L_OPEN 64 |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/include/ipc/console.h |
---|
0,0 → 1,56 |
/* |
* Copyright (c) 2006 Josef Cejka |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libcipc |
* @{ |
*/ |
/** @file |
*/ |
#ifndef LIBC_IPC_CONSOLE_H_ |
#define LIBC_IPC_CONSOLE_H_ |
#include <ipc/ipc.h> |
#include <ipc/vfs.h> |
typedef enum { |
CONSOLE_GET_SIZE = VFS_OUT_LAST, |
CONSOLE_GET_EVENT, |
CONSOLE_GOTO, |
CONSOLE_CLEAR, |
CONSOLE_SET_STYLE, |
CONSOLE_SET_COLOR, |
CONSOLE_SET_RGB_COLOR, |
CONSOLE_CURSOR_VISIBILITY, |
CONSOLE_KCON_ENABLE |
} console_request_t; |
#endif |
/** @} |
*/ |
Property changes: |
Added: svn:mergeinfo |
//branches/snapshot/uspace/lib/libc/include/ipc/ipc.h |
---|
0,0 → 1,301 |
/* |
* Copyright (c) 2006 Ondrej Palkovsky |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libcipc |
* @{ |
*/ |
/** @file |
*/ |
#ifndef LIBIPC_IPC_H_ |
#define LIBIPC_IPC_H_ |
#include <task.h> |
#include <kernel/ipc/ipc.h> |
#include <kernel/ddi/irq.h> |
#include <sys/types.h> |
#include <kernel/synch/synch.h> |
#define IPC_FLAG_BLOCKING 0x01 |
typedef sysarg_t ipcarg_t; |
typedef struct { |
ipcarg_t args[IPC_CALL_LEN]; |
ipcarg_t in_phone_hash; |
} ipc_call_t; |
typedef sysarg_t ipc_callid_t; |
typedef void (* ipc_async_callback_t)(void *, int, ipc_call_t *); |
/* |
* User-friendly wrappers for ipc_call_sync_fast() and ipc_call_sync_slow(). |
* They are in the form ipc_call_sync_m_n(), where m denotes the number of |
* arguments of payload and n denotes number of return values. Whenever |
* possible, the fast version is used. |
*/ |
#define ipc_call_sync_0_0(phoneid, method) \ |
ipc_call_sync_fast((phoneid), (method), 0, 0, 0, 0, 0, 0, 0, 0) |
#define ipc_call_sync_0_1(phoneid, method, res1) \ |
ipc_call_sync_fast((phoneid), (method), 0, 0, 0, (res1), 0, 0, 0, 0) |
#define ipc_call_sync_0_2(phoneid, method, res1, res2) \ |
ipc_call_sync_fast((phoneid), (method), 0, 0, 0, (res1), (res2), 0, 0, 0) |
#define ipc_call_sync_0_3(phoneid, method, res1, res2, res3) \ |
ipc_call_sync_fast((phoneid), (method), 0, 0, 0, (res1), (res2), (res3), \ |
0, 0) |
#define ipc_call_sync_0_4(phoneid, method, res1, res2, res3, res4) \ |
ipc_call_sync_fast((phoneid), (method), 0, 0, 0, (res1), (res2), (res3), \ |
(res4), 0) |
#define ipc_call_sync_0_5(phoneid, method, res1, res2, res3, res4, res5) \ |
ipc_call_sync_fast((phoneid), (method), 0, 0, 0, (res1), (res2), (res3), \ |
(res4), (res5)) |
#define ipc_call_sync_1_0(phoneid, method, arg1) \ |
ipc_call_sync_fast((phoneid), (method), (arg1), 0, 0, 0, 0, 0, 0, 0) |
#define ipc_call_sync_1_1(phoneid, method, arg1, res1) \ |
ipc_call_sync_fast((phoneid), (method), (arg1), 0, 0, (res1), 0, 0, 0, 0) |
#define ipc_call_sync_1_2(phoneid, method, arg1, res1, res2) \ |
ipc_call_sync_fast((phoneid), (method), (arg1), 0, 0, (res1), (res2), 0, \ |
0, 0) |
#define ipc_call_sync_1_3(phoneid, method, arg1, res1, res2, res3) \ |
ipc_call_sync_fast((phoneid), (method), (arg1), 0, 0, (res1), (res2), \ |
(res3), 0, 0) |
#define ipc_call_sync_1_4(phoneid, method, arg1, res1, res2, res3, res4) \ |
ipc_call_sync_fast((phoneid), (method), (arg1), 0, 0, (res1), (res2), \ |
(res3), (res4), 0) |
#define ipc_call_sync_1_5(phoneid, method, arg1, res1, res2, res3, res4, \ |
res5) \ |
ipc_call_sync_fast((phoneid), (method), (arg1), 0, 0, (res1), (res2), \ |
(res3), (res4), (res5)) |
#define ipc_call_sync_2_0(phoneid, method, arg1, arg2) \ |
ipc_call_sync_fast((phoneid), (method), (arg1), (arg2), 0, 0, 0, 0, \ |
0, 0) |
#define ipc_call_sync_2_1(phoneid, method, arg1, arg2, res1) \ |
ipc_call_sync_fast((phoneid), (method), (arg1), (arg2), 0, (res1), 0, 0, \ |
0, 0) |
#define ipc_call_sync_2_2(phoneid, method, arg1, arg2, res1, res2) \ |
ipc_call_sync_fast((phoneid), (method), (arg1), (arg2), 0, (res1), \ |
(res2), 0, 0, 0) |
#define ipc_call_sync_2_3(phoneid, method, arg1, arg2, res1, res2, res3) \ |
ipc_call_sync_fast((phoneid), (method), (arg1), (arg2), 0, (res1), \ |
(res2), (res3), 0, 0) |
#define ipc_call_sync_2_4(phoneid, method, arg1, arg2, res1, res2, res3, \ |
res4) \ |
ipc_call_sync_fast((phoneid), (method), (arg1), (arg2), 0, (res1), \ |
(res2), (res3), (res4), 0) |
#define ipc_call_sync_2_5(phoneid, method, arg1, arg2, res1, res2, res3, \ |
res4, res5)\ |
ipc_call_sync_fast((phoneid), (method), (arg1), (arg2), 0, (res1), \ |
(res2), (res3), (res4), (res5)) |
#define ipc_call_sync_3_0(phoneid, method, arg1, arg2, arg3) \ |
ipc_call_sync_fast((phoneid), (method), (arg1), (arg2), (arg3), 0, 0, 0, \ |
0, 0) |
#define ipc_call_sync_3_1(phoneid, method, arg1, arg2, arg3, res1) \ |
ipc_call_sync_fast((phoneid), (method), (arg1), (arg2), (arg3), (res1), \ |
0, 0, 0, 0) |
#define ipc_call_sync_3_2(phoneid, method, arg1, arg2, arg3, res1, res2) \ |
ipc_call_sync_fast((phoneid), (method), (arg1), (arg2), (arg3), (res1), \ |
(res2), 0, 0, 0) |
#define ipc_call_sync_3_3(phoneid, method, arg1, arg2, arg3, res1, res2, \ |
res3) \ |
ipc_call_sync_fast((phoneid), (method), (arg1), (arg2), (arg3), \ |
(res1), (res2), (res3), 0, 0) |
#define ipc_call_sync_3_4(phoneid, method, arg1, arg2, arg3, res1, res2, \ |
res3, res4) \ |
ipc_call_sync_fast((phoneid), (method), (arg1), (arg2), (arg3), \ |
(res1), (res2), (res3), (res4), 0) |
#define ipc_call_sync_3_5(phoneid, method, arg1, arg2, arg3, res1, res2, \ |
res3, res4, res5) \ |
ipc_call_sync_fast((phoneid), (method), (arg1), (arg2), (arg3), \ |
(res1), (res2), (res3), (res4), (res5)) |
#define ipc_call_sync_4_0(phoneid, method, arg1, arg2, arg3, arg4) \ |
ipc_call_sync_slow((phoneid), (method), (arg1), (arg2), (arg3), (arg4), 0, \ |
0, 0, 0, 0, 0) |
#define ipc_call_sync_4_1(phoneid, method, arg1, arg2, arg3, arg4, res1) \ |
ipc_call_sync_slow((phoneid), (method), (arg1), (arg2), (arg3), (arg4), 0, \ |
(res1), 0, 0, 0, 0) |
#define ipc_call_sync_4_2(phoneid, method, arg1, arg2, arg3, arg4, res1, res2) \ |
ipc_call_sync_slow((phoneid), (method), (arg1), (arg2), (arg3), (arg4), 0, \ |
(res1), (res2), 0, 0, 0) |
#define ipc_call_sync_4_3(phoneid, method, arg1, arg2, arg3, arg4, res1, res2, \ |
res3) \ |
ipc_call_sync_slow((phoneid), (method), (arg1), (arg2), (arg3), \ |
(arg4), 0, (res1), (res2), (res3), 0, 0) |
#define ipc_call_sync_4_4(phoneid, method, arg1, arg2, arg3, arg4, res1, res2, \ |
res3, res4) \ |
ipc_call_sync_slow((phoneid), (method), (arg1), (arg2), (arg3), \ |
(arg4), 0, (res1), (res2), (res3), (res4), 0) |
#define ipc_call_sync_4_5(phoneid, method, arg1, arg2, arg3, arg4, res1, res2, \ |
res3, res4, res5) \ |
ipc_call_sync_slow((phoneid), (method), (arg1), (arg2), (arg3), \ |
(arg4), 0, (res1), (res2), (res3), (res4), (res5)) |
#define ipc_call_sync_5_0(phoneid, method, arg1, arg2, arg3, arg4, arg5) \ |
ipc_call_sync_slow((phoneid), (method), (arg1), (arg2), (arg3), (arg4), \ |
(arg5), 0, 0, 0, 0, 0) |
#define ipc_call_sync_5_1(phoneid, method, arg1, arg2, arg3, arg4, arg5, res1) \ |
ipc_call_sync_slow((phoneid), (method), (arg1), (arg2), (arg3), (arg4), \ |
(arg5), (res1), 0, 0, 0, 0) |
#define ipc_call_sync_5_2(phoneid, method, arg1, arg2, arg3, arg4, arg5, res1, \ |
res2) \ |
ipc_call_sync_slow((phoneid), (method), (arg1), (arg2), (arg3), \ |
(arg4), (arg5), (res1), (res2), 0, 0, 0) |
#define ipc_call_sync_5_3(phoneid, method, arg1, arg2, arg3, arg4, arg5, res1, \ |
res2, res3) \ |
ipc_call_sync_slow((phoneid), (method), (arg1), (arg2), (arg3), \ |
(arg4), (arg5), (res1), (res2), (res3), 0, 0) |
#define ipc_call_sync_5_4(phoneid, method, arg1, arg2, arg3, arg4, arg5, res1, \ |
res2, res3, res4) \ |
ipc_call_sync_slow((phoneid), (method), (arg1), (arg2), (arg3), \ |
(arg4), (arg5), (res1), (res2), (res3), (res4), 0) |
#define ipc_call_sync_5_5(phoneid, method, arg1, arg2, arg3, arg4, arg5, res1, \ |
res2, res3, res4, res5) \ |
ipc_call_sync_slow((phoneid), (method), (arg1), (arg2), (arg3), \ |
(arg4), (arg5), (res1), (res2), (res3), (res4), (res5)) |
extern int ipc_call_sync_fast(int, ipcarg_t, ipcarg_t, ipcarg_t, ipcarg_t, |
ipcarg_t *, ipcarg_t *, ipcarg_t *, ipcarg_t *, ipcarg_t *); |
extern int ipc_call_sync_slow(int, ipcarg_t, ipcarg_t, ipcarg_t, ipcarg_t, |
ipcarg_t, ipcarg_t, ipcarg_t *, ipcarg_t *, ipcarg_t *, ipcarg_t *, |
ipcarg_t *); |
extern ipc_callid_t ipc_wait_cycle(ipc_call_t *, uint32_t, int); |
extern ipc_callid_t ipc_wait_for_call_timeout(ipc_call_t *, uint32_t); |
static inline ipc_callid_t ipc_wait_for_call(ipc_call_t *data) |
{ |
return ipc_wait_for_call_timeout(data, SYNCH_NO_TIMEOUT); |
} |
extern ipc_callid_t ipc_trywait_for_call(ipc_call_t *); |
/* |
* User-friendly wrappers for ipc_answer_fast() and ipc_answer_slow(). |
* They are in the form of ipc_answer_m(), where m is the number of return |
* arguments. The macros decide between the fast and the slow version according |
* to m. |
*/ |
#define ipc_answer_0(callid, retval) \ |
ipc_answer_fast((callid), (retval), 0, 0, 0, 0) |
#define ipc_answer_1(callid, retval, arg1) \ |
ipc_answer_fast((callid), (retval), (arg1), 0, 0, 0) |
#define ipc_answer_2(callid, retval, arg1, arg2) \ |
ipc_answer_fast((callid), (retval), (arg1), (arg2), 0, 0) |
#define ipc_answer_3(callid, retval, arg1, arg2, arg3) \ |
ipc_answer_fast((callid), (retval), (arg1), (arg2), (arg3), 0) |
#define ipc_answer_4(callid, retval, arg1, arg2, arg3, arg4) \ |
ipc_answer_fast((callid), (retval), (arg1), (arg2), (arg3), (arg4)) |
#define ipc_answer_5(callid, retval, arg1, arg2, arg3, arg4, arg5) \ |
ipc_answer_slow((callid), (retval), (arg1), (arg2), (arg3), (arg4), (arg5)) |
extern ipcarg_t ipc_answer_fast(ipc_callid_t, ipcarg_t, ipcarg_t, ipcarg_t, |
ipcarg_t, ipcarg_t); |
extern ipcarg_t ipc_answer_slow(ipc_callid_t, ipcarg_t, ipcarg_t, ipcarg_t, |
ipcarg_t, ipcarg_t, ipcarg_t); |
/* |
* User-friendly wrappers for ipc_call_async_fast() and ipc_call_async_slow(). |
* They are in the form of ipc_call_async_m(), where m is the number of payload |
* arguments. The macros decide between the fast and the slow version according |
* to m. |
*/ |
#define ipc_call_async_0(phoneid, method, private, callback, can_preempt) \ |
ipc_call_async_fast((phoneid), (method), 0, 0, 0, 0, (private), \ |
(callback), (can_preempt)) |
#define ipc_call_async_1(phoneid, method, arg1, private, callback, \ |
can_preempt) \ |
ipc_call_async_fast((phoneid), (method), (arg1), 0, 0, 0, (private), \ |
(callback), (can_preempt)) |
#define ipc_call_async_2(phoneid, method, arg1, arg2, private, callback, \ |
can_preempt) \ |
ipc_call_async_fast((phoneid), (method), (arg1), (arg2), 0, 0, \ |
(private), (callback), (can_preempt)) |
#define ipc_call_async_3(phoneid, method, arg1, arg2, arg3, private, callback, \ |
can_preempt) \ |
ipc_call_async_fast((phoneid), (method), (arg1), (arg2), (arg3), 0, \ |
(private), (callback), (can_preempt)) |
#define ipc_call_async_4(phoneid, method, arg1, arg2, arg3, arg4, private, \ |
callback, can_preempt) \ |
ipc_call_async_fast((phoneid), (method), (arg1), (arg2), (arg3), \ |
(arg4), (private), (callback), (can_preempt)) |
#define ipc_call_async_5(phoneid, method, arg1, arg2, arg3, arg4, arg5, \ |
private, callback, can_preempt) \ |
ipc_call_async_slow((phoneid), (method), (arg1), (arg2), (arg3), \ |
(arg4), (arg5), (private), (callback), (can_preempt)) |
extern void ipc_call_async_fast(int, ipcarg_t, ipcarg_t, ipcarg_t, ipcarg_t, |
ipcarg_t, void *, ipc_async_callback_t, int); |
extern void ipc_call_async_slow(int, ipcarg_t, ipcarg_t, ipcarg_t, ipcarg_t, |
ipcarg_t, ipcarg_t, void *, ipc_async_callback_t, int); |
extern int ipc_connect_to_me(int, int, int, int, ipcarg_t *); |
extern int ipc_connect_me_to(int, int, int, int); |
extern int ipc_connect_me_to_blocking(int, int, int, int); |
extern int ipc_hangup(int); |
extern int ipc_register_irq(int, int, int, irq_code_t *); |
extern int ipc_unregister_irq(int, int); |
extern int ipc_forward_fast(ipc_callid_t, int, int, ipcarg_t, ipcarg_t, int); |
extern int ipc_forward_slow(ipc_callid_t, int, int, ipcarg_t, ipcarg_t, |
ipcarg_t, ipcarg_t, ipcarg_t, int); |
/* |
* User-friendly wrappers for ipc_share_in_start(). |
*/ |
#define ipc_share_in_start_0_0(phoneid, dst, size) \ |
ipc_share_in_start((phoneid), (dst), (size), 0, NULL) |
#define ipc_share_in_start_0_1(phoneid, dst, size, flags) \ |
ipc_share_in_start((phoneid), (dst), (size), 0, (flags)) |
#define ipc_share_in_start_1_0(phoneid, dst, size, arg) \ |
ipc_share_in_start((phoneid), (dst), (size), (arg), NULL) |
#define ipc_share_in_start_1_1(phoneid, dst, size, arg, flags) \ |
ipc_share_in_start((phoneid), (dst), (size), (arg), (flags)) |
extern int ipc_share_in_start(int, void *, size_t, ipcarg_t, int *); |
extern int ipc_share_in_receive(ipc_callid_t *, size_t *); |
extern int ipc_share_in_finalize(ipc_callid_t, void *, int ); |
extern int ipc_share_out_start(int, void *, int); |
extern int ipc_share_out_receive(ipc_callid_t *, size_t *, int *); |
extern int ipc_share_out_finalize(ipc_callid_t, void *); |
extern int ipc_data_read_start(int, void *, size_t); |
extern int ipc_data_read_receive(ipc_callid_t *, size_t *); |
extern int ipc_data_read_finalize(ipc_callid_t, const void *, size_t); |
extern int ipc_data_write_start(int, const void *, size_t); |
extern int ipc_data_write_receive(ipc_callid_t *, size_t *); |
extern int ipc_data_write_finalize(ipc_callid_t, void *, size_t); |
extern int ipc_connect_kbox(task_id_t); |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/include/ipc/ns.h |
---|
0,0 → 1,48 |
/* |
* Copyright (c) 2006 Ondrej Palkovsky |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libcipc |
* @{ |
*/ |
/** @file |
*/ |
#ifndef LIBIPC_NS_H_ |
#define LIBIPC_NS_H_ |
#include <ipc/ipc.h> |
typedef enum { |
NS_PING = IPC_FIRST_USER_METHOD, |
NS_TASK_WAIT |
} ns_request_t; |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/include/ipc/loader.h |
---|
0,0 → 1,53 |
/* |
* Copyright (c) 2008 Jiri Svoboda |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libcipc |
* @{ |
*/ |
/** @file |
*/ |
#ifndef LIBC_IPC_LOADER_H_ |
#define LIBC_IPC_LOADER_H_ |
#include <ipc/ipc.h> |
typedef enum { |
LOADER_HELLO = IPC_FIRST_USER_METHOD, |
LOADER_GET_TASKID, |
LOADER_SET_PATHNAME, |
LOADER_SET_ARGS, |
LOADER_SET_FILES, |
LOADER_LOAD, |
LOADER_RUN |
} loader_request_t; |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/include/ipc/bd.h |
---|
0,0 → 1,48 |
/* |
* Copyright (c) 2009 Jiri Svoboda |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libcipc |
* @{ |
*/ |
/** @file |
*/ |
#ifndef LIBC_IPC_BD_H_ |
#define LIBC_IPC_BD_H_ |
#include <ipc/ipc.h> |
typedef enum { |
BD_READ_BLOCK = IPC_FIRST_USER_METHOD, |
BD_WRITE_BLOCK |
} bd_request_t; |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/include/ipc/fb.h |
---|
0,0 → 1,77 |
/* |
* Copyright (c) 2006 Ondrej Palkovsky |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libcipc |
* @{ |
*/ |
/** @file |
*/ |
#ifndef LIBC_FB_H_ |
#define LIBC_FB_H_ |
#include <ipc/ipc.h> |
typedef enum { |
FB_PUTCHAR = IPC_FIRST_USER_METHOD, |
FB_CLEAR, |
FB_GET_CSIZE, |
FB_CURSOR_VISIBILITY, |
FB_CURSOR_GOTO, |
FB_SCROLL, |
FB_VIEWPORT_SWITCH, |
FB_VIEWPORT_CREATE, |
FB_VIEWPORT_DELETE, |
FB_SET_STYLE, |
FB_SET_COLOR, |
FB_SET_RGB_COLOR, |
FB_GET_RESOLUTION, |
FB_DRAW_TEXT_DATA, |
FB_FLUSH, |
FB_DRAW_PPM, |
FB_PREPARE_SHM, |
FB_DROP_SHM, |
FB_SHM2PIXMAP, |
FB_VP_DRAW_PIXMAP, |
FB_VP2PIXMAP, |
FB_DROP_PIXMAP, |
FB_ANIM_CREATE, |
FB_ANIM_DROP, |
FB_ANIM_ADDPIXMAP, |
FB_ANIM_CHGVP, |
FB_ANIM_START, |
FB_ANIM_STOP, |
FB_POINTER_MOVE, |
FB_SCREEN_YIELD, |
FB_SCREEN_RECLAIM |
} fb_request_t; |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/include/ipc/services.h |
---|
0,0 → 1,59 |
/* |
* Copyright (c) 2006 Jakub Jermar |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libcipc |
* @{ |
*/ |
/** |
* @file services.h |
* @brief List of all known services and their codes. |
*/ |
#ifndef LIBIPC_SERVICES_H_ |
#define LIBIPC_SERVICES_H_ |
typedef enum { |
SERVICE_LOAD = 1, |
SERVICE_PCI, |
SERVICE_KEYBOARD, |
SERVICE_VIDEO, |
SERVICE_CONSOLE, |
SERVICE_VFS, |
SERVICE_DEVMAP, |
SERVICE_FHC, |
SERVICE_OBIO |
} services_t; |
/* Memory area to be received from NS */ |
#define SERVICE_MEM_REALTIME 1 |
#define SERVICE_MEM_KLOG 2 |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/include/ipc/bus.h |
---|
0,0 → 1,47 |
/* |
* Copyright (c) 2009 Jakub Jermar |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libcipc |
* @{ |
*/ |
/** @file |
*/ |
#ifndef LIBC_BUS_H_ |
#define LIBC_BUS_H_ |
#include <ipc/ipc.h> |
typedef enum { |
BUS_CLEAR_INTERRUPT = IPC_FIRST_USER_METHOD |
} bus_request_t; |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/include/sys/stat.h |
---|
0,0 → 1,64 |
/* |
* Copyright (c) 2008 Jakub Jermar |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libc |
* @{ |
*/ |
/** @file |
*/ |
#ifndef LIBC_SYS_STAT_H_ |
#define LIBC_SYS_STAT_H_ |
#include <sys/types.h> |
#include <bool.h> |
#include <ipc/vfs.h> |
#include <ipc/devmap.h> |
struct stat { |
fs_handle_t fs_handle; |
dev_handle_t dev_handle; |
fs_index_t index; |
unsigned lnkcnt; |
bool is_file; |
off_t size; |
union { |
struct { |
dev_handle_t device; |
} devfs_stat; |
}; |
}; |
extern int fstat(int, struct stat *); |
extern int stat(const char *, struct stat *); |
extern int mkdir(const char *, mode_t); |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/include/sys/types.h |
---|
0,0 → 1,52 |
/* |
* Copyright (c) 2006 Josef Cejka |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libc |
* @{ |
*/ |
/** @file |
*/ |
#ifndef LIBC_SYS_TYPES_H_ |
#define LIBC_SYS_TYPES_H_ |
#include <libarch/types.h> |
typedef long off_t; |
typedef int mode_t; |
typedef int32_t wchar_t; |
typedef volatile uint8_t ioport8_t; |
typedef volatile uint16_t ioport16_t; |
typedef volatile uint32_t ioport32_t; |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/include/sys/time.h |
---|
0,0 → 1,64 |
/* |
* Copyright (c) 2006 Ondrej Palkovsky |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libc |
* @{ |
*/ |
/** @file |
*/ |
#ifndef LIBC_SYS_TIME_H_ |
#define LIBC_SYS_TIME_H_ |
#include <sys/types.h> |
#define DST_NONE 0 |
typedef long time_t; |
typedef long suseconds_t; |
struct timeval { |
time_t tv_sec; /* seconds */ |
suseconds_t tv_usec; /* microseconds */ |
}; |
struct timezone { |
int tz_minuteswest; /* minutes W of Greenwich */ |
int tz_dsttime; /* type of dst correction */ |
}; |
extern void tv_add(struct timeval *tv, suseconds_t usecs); |
extern suseconds_t tv_sub(struct timeval *tv1, struct timeval *tv2); |
extern int tv_gt(struct timeval *tv1, struct timeval *tv2); |
extern int tv_gteq(struct timeval *tv1, struct timeval *tv2); |
extern int gettimeofday(struct timeval *tv, struct timezone *tz); |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/include/sys/mman.h |
---|
0,0 → 1,59 |
/* |
* Copyright (c) 2006 Ondrej Palkovsky |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libc |
* @{ |
*/ |
/** @file |
*/ |
#ifndef LIBC_MMAN_H_ |
#define LIBC_MMAN_H_ |
#include <as.h> |
#include <sys/types.h> |
#define MAP_FAILED ((void *) -1) |
#define MAP_SHARED (1 << 0) |
#define MAP_PRIVATE (1 << 1) |
#define MAP_FIXED (1 << 2) |
#define MAP_ANONYMOUS (1 << 3) |
#define PROTO_READ AS_AREA_READ |
#define PROTO_WRITE AS_AREA_WRITE |
#define PROTO_EXEC AS_AREA_EXEC |
extern void *mmap(void *start, size_t length, int prot, int flags, int fd, |
off_t offset); |
extern int munmap(void *start, size_t length); |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/include/byteorder.h |
---|
0,0 → 1,111 |
/* |
* Copyright (c) 2005 Jakub Jermar |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libc |
* @{ |
*/ |
/** @file |
*/ |
#ifndef LIBC_BYTEORDER_H_ |
#define LIBC_BYTEORDER_H_ |
#include <stdint.h> |
#if !(defined(__BE__) ^ defined(__LE__)) |
#error The architecture must be either big-endian or little-endian. |
#endif |
#ifdef __BE__ |
#define uint16_t_le2host(n) (uint16_t_byteorder_swap(n)) |
#define uint32_t_le2host(n) (uint32_t_byteorder_swap(n)) |
#define uint64_t_le2host(n) (uint64_t_byteorder_swap(n)) |
#define uint16_t_be2host(n) (n) |
#define uint32_t_be2host(n) (n) |
#define uint64_t_be2host(n) (n) |
#define host2uint16_t_le(n) (uint16_t_byteorder_swap(n)) |
#define host2uint32_t_le(n) (uint32_t_byteorder_swap(n)) |
#define host2uint64_t_le(n) (uint64_t_byteorder_swap(n)) |
#define host2uint16_t_be(n) (n) |
#define host2uint32_t_be(n) (n) |
#define host2uint64_t_be(n) (n) |
#else |
#define uint16_t_le2host(n) (n) |
#define uint32_t_le2host(n) (n) |
#define uint64_t_le2host(n) (n) |
#define uint16_t_be2host(n) (uint16_t_byteorder_swap(n)) |
#define uint32_t_be2host(n) (uint32_t_byteorder_swap(n)) |
#define uint64_t_be2host(n) (uint64_t_byteorder_swap(n)) |
#define host2uint16_t_le(n) (n) |
#define host2uint32_t_le(n) (n) |
#define host2uint64_t_le(n) (n) |
#define host2uint16_t_be(n) (uint16_t_byteorder_swap(n)) |
#define host2uint32_t_be(n) (uint32_t_byteorder_swap(n)) |
#define host2uint64_t_be(n) (uint64_t_byteorder_swap(n)) |
#endif |
static inline uint64_t uint64_t_byteorder_swap(uint64_t n) |
{ |
return ((n & 0xff) << 56) | |
((n & 0xff00) << 40) | |
((n & 0xff0000) << 24) | |
((n & 0xff000000LL) << 8) | |
((n & 0xff00000000LL) >> 8) | |
((n & 0xff0000000000LL) >> 24) | |
((n & 0xff000000000000LL) >> 40) | |
((n & 0xff00000000000000LL) >> 56); |
} |
static inline uint32_t uint32_t_byteorder_swap(uint32_t n) |
{ |
return ((n & 0xff) << 24) | |
((n & 0xff00) << 8) | |
((n & 0xff0000) >> 8) | |
((n & 0xff000000) >> 24); |
} |
static inline uint16_t uint16_t_byteorder_swap(uint16_t n) |
{ |
return ((n & 0xff) << 8) | |
((n & 0xff00) >> 8); |
} |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/include/string.h |
---|
0,0 → 1,100 |
/* |
* Copyright (c) 2005 Martin Decky |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libc |
* @{ |
*/ |
/** @file |
*/ |
#ifndef LIBC_STRING_H_ |
#define LIBC_STRING_H_ |
#include <mem.h> |
#include <sys/types.h> |
#include <bool.h> |
#define U_SPECIAL '?' |
/** No size limit constant */ |
#define STR_NO_LIMIT ((size_t) -1) |
/** Maximum size of a string containing @c length characters */ |
#define STR_BOUNDS(length) ((length) << 2) |
extern wchar_t str_decode(const char *str, size_t *offset, size_t sz); |
extern int chr_encode(const wchar_t ch, char *str, size_t *offset, size_t sz); |
extern size_t str_size(const char *str); |
extern size_t wstr_size(const wchar_t *str); |
extern size_t str_lsize(const char *str, size_t max_len); |
extern size_t wstr_lsize(const wchar_t *str, size_t max_len); |
extern size_t str_length(const char *str); |
extern size_t wstr_length(const wchar_t *wstr); |
extern size_t str_nlength(const char *str, size_t size); |
extern size_t wstr_nlength(const wchar_t *str, size_t size); |
extern bool ascii_check(wchar_t ch); |
extern bool chr_check(wchar_t ch); |
extern int str_cmp(const char *s1, const char *s2); |
extern int str_lcmp(const char *s1, const char *s2, size_t max_len); |
extern void str_cpy(char *dest, size_t size, const char *src); |
extern void str_ncpy(char *dest, size_t size, const char *src, size_t n); |
extern void str_append(char *dest, size_t size, const char *src); |
extern void wstr_nstr(char *dst, const wchar_t *src, size_t size); |
extern const char *str_chr(const char *str, wchar_t ch); |
extern const char *str_rchr(const char *str, wchar_t ch); |
extern bool wstr_linsert(wchar_t *str, wchar_t ch, size_t pos, size_t max_pos); |
extern bool wstr_remove(wchar_t *str, size_t pos); |
extern char *str_dup(const char *); |
/* |
* TODO: Get rid of this. |
*/ |
extern int stricmp(const char *, const char *); |
extern long int strtol(const char *, char **, int); |
extern unsigned long strtoul(const char *, char **, int); |
extern char * strtok_r(char *, const char *, char **); |
extern char * strtok(char *, const char *); |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/include/fibril_sync.h |
---|
0,0 → 1,104 |
/* |
* Copyright (c) 2009 Jakub Jermar |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libc |
* @{ |
*/ |
/** @file |
*/ |
#ifndef LIBC_FIBRIL_SYNC_H_ |
#define LIBC_FIBRIL_SYNC_H_ |
#include <async.h> |
#include <fibril.h> |
#include <adt/list.h> |
#include <libarch/tls.h> |
typedef struct { |
int counter; |
link_t waiters; |
} fibril_mutex_t; |
#define FIBRIL_MUTEX_INITIALIZE(name) \ |
fibril_mutex_t name = { \ |
.counter = 1, \ |
.waiters = { \ |
.prev = &name.waiters, \ |
.next = &name.waiters, \ |
} \ |
} |
typedef struct { |
unsigned writers; |
unsigned readers; |
link_t waiters; |
} fibril_rwlock_t; |
#define FIBRIL_RWLOCK_INITIALIZE(name) \ |
fibril_rwlock_t name = { \ |
.readers = 0, \ |
.writers = 0, \ |
.waiters = { \ |
.prev = &name.waiters, \ |
.next = &name.waiters, \ |
} \ |
} |
typedef struct { |
link_t waiters; |
} fibril_condvar_t; |
#define FIBRIL_CONDVAR_INITIALIZE(name) \ |
fibril_condvar_t name = { \ |
.waiters = { \ |
.next = &name.waiters, \ |
.prev = &name.waiters, \ |
} \ |
} |
extern void fibril_mutex_initialize(fibril_mutex_t *); |
extern void fibril_mutex_lock(fibril_mutex_t *); |
extern bool fibril_mutex_trylock(fibril_mutex_t *); |
extern void fibril_mutex_unlock(fibril_mutex_t *); |
extern void fibril_rwlock_initialize(fibril_rwlock_t *); |
extern void fibril_rwlock_read_lock(fibril_rwlock_t *); |
extern void fibril_rwlock_write_lock(fibril_rwlock_t *); |
extern void fibril_rwlock_read_unlock(fibril_rwlock_t *); |
extern void fibril_rwlock_write_unlock(fibril_rwlock_t *); |
extern void fibril_condvar_initialize(fibril_condvar_t *); |
extern void fibril_condvar_wait(fibril_condvar_t *, fibril_mutex_t *); |
extern void fibril_condvar_signal(fibril_condvar_t *); |
extern void fibril_condvar_broadcast(fibril_condvar_t *); |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/include/fibril.h |
---|
0,0 → 1,99 |
/* |
* Copyright (c) 2006 Ondrej Palkovsky |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libc |
* @{ |
*/ |
/** @file |
*/ |
#ifndef LIBC_FIBRIL_H_ |
#define LIBC_FIBRIL_H_ |
#include <libarch/fibril.h> |
#include <adt/list.h> |
#include <libarch/tls.h> |
#ifndef context_set |
#define context_set(c, _pc, stack, size, ptls) \ |
(c)->pc = (sysarg_t) (_pc); \ |
(c)->sp = ((sysarg_t) (stack)) + (size) - SP_DELTA; \ |
(c)->tls = (sysarg_t) (ptls); |
#endif /* context_set */ |
#define FIBRIL_SERIALIZED 1 |
#define FIBRIL_WRITER 2 |
typedef enum { |
FIBRIL_PREEMPT, |
FIBRIL_TO_MANAGER, |
FIBRIL_FROM_MANAGER, |
FIBRIL_FROM_DEAD |
} fibril_switch_type_t; |
typedef sysarg_t fid_t; |
struct fibril { |
link_t link; |
context_t ctx; |
void *stack; |
void *arg; |
int (*func)(void *); |
tcb_t *tcb; |
struct fibril *clean_after_me; |
int retval; |
int flags; |
}; |
typedef struct fibril fibril_t; |
/** Fibril-local variable specifier */ |
#define fibril_local __thread |
extern int context_save(context_t *c); |
extern void context_restore(context_t *c) __attribute__ ((noreturn)); |
extern fid_t fibril_create(int (*func)(void *), void *arg); |
extern fibril_t *fibril_setup(void); |
extern void fibril_teardown(fibril_t *f); |
extern int fibril_switch(fibril_switch_type_t stype); |
extern void fibril_add_ready(fid_t fid); |
extern void fibril_add_manager(fid_t fid); |
extern void fibril_remove_manager(void); |
extern fid_t fibril_get_id(void); |
extern void fibril_inc_sercount(void); |
extern void fibril_dec_sercount(void); |
static inline int fibril_yield(void) { |
return fibril_switch(FIBRIL_PREEMPT); |
} |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/include/loader/pcb.h |
---|
0,0 → 1,83 |
/* |
* Copyright (c) 2008 Jiri Svoboda |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup fs |
* @{ |
*/ |
/** @file |
* @brief Program Control Block interface. |
*/ |
#ifndef LIBC_PCB_H_ |
#define LIBC_PCB_H_ |
#include <sys/types.h> |
#include <vfs/vfs.h> |
typedef void (*entry_point_t)(void); |
/** Program Control Block. |
* |
* Holds pointers to data passed from the program loader to the program |
* and/or to the dynamic linker. This includes the program entry point, |
* arguments, environment variables etc. |
* |
*/ |
typedef struct { |
/** Program entry point. */ |
entry_point_t entry; |
/** Number of command-line arguments. */ |
int argc; |
/** Command-line arguments. */ |
char **argv; |
/** Number of preset files. */ |
int filc; |
/** Preset files. */ |
fdi_node_t **filv; |
/* |
* ELF-specific data. |
*/ |
/** Pointer to ELF dynamic section of the program. */ |
void *dynamic; |
} pcb_t; |
/** |
* A pointer to the program control block. Having received the PCB pointer, |
* the C library startup code stores it here for later use. |
*/ |
extern pcb_t *__pcb; |
#endif |
/** |
* @} |
*/ |
//branches/snapshot/uspace/lib/libc/include/loader/loader.h |
---|
0,0 → 1,62 |
/* |
* Copyright (c) 2008 Jiri Svoboda |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup fs |
* @{ |
*/ |
/** @file |
* @brief Program loader interface. |
*/ |
#ifndef LIBC_LOADER_H_ |
#define LIBC_LOADER_H_ |
#include <task.h> |
#include <vfs/vfs.h> |
/** Abstraction of a loader connection */ |
typedef struct { |
/** ID of the phone connected to the loader. */ |
int phone_id; |
} loader_t; |
extern int loader_spawn(const char *); |
extern loader_t *loader_connect(void); |
extern int loader_get_task_id(loader_t *, task_id_t *); |
extern int loader_set_pathname(loader_t *, const char *); |
extern int loader_set_args(loader_t *, char *const[]); |
extern int loader_set_files(loader_t *, fdi_node_t *const[]); |
extern int loader_load_program(loader_t *); |
extern int loader_run(loader_t *); |
extern void loader_abort(loader_t *); |
#endif |
/** |
* @} |
*/ |
//branches/snapshot/uspace/lib/libc/include/fcntl.h |
---|
0,0 → 1,51 |
/* |
* Copyright (c) 2007 Jakub Jermar |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libc |
* @{ |
*/ |
/** @file |
*/ |
#ifndef LIBC_FCNTL_H_ |
#define LIBC_FCNTL_H_ |
#define O_CREAT 1 |
#define O_EXCL 2 |
#define O_TRUNC 4 |
#define O_APPEND 8 |
#define O_RDONLY 16 |
#define O_RDWR 32 |
#define O_WRONLY 64 |
extern int open(const char *, int, ...); |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/include/dirent.h |
---|
0,0 → 1,57 |
/* |
* Copyright (c) 2008 Jakub Jermar |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libc |
* @{ |
*/ |
/** @file |
*/ |
#ifndef LIBC_DIRENT_H_ |
#define LIBC_DIRENT_H_ |
#define NAME_MAX 256 |
struct dirent { |
char d_name[NAME_MAX + 1]; |
}; |
typedef struct { |
int fd; |
struct dirent res; |
} DIR; |
extern DIR *opendir(const char *); |
extern struct dirent *readdir(DIR *); |
extern void rewinddir(DIR *); |
extern int closedir(DIR *); |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/include/io/printf_core.h |
---|
0,0 → 1,58 |
/* |
* Copyright (c) 2006 Josef Cejka |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libc |
* @{ |
*/ |
/** @file |
*/ |
#ifndef LIBC_PRINTF_CORE_H_ |
#define LIBC_PRINTF_CORE_H_ |
#include <sys/types.h> |
#include <stdarg.h> |
/** Structure for specifying output methods for different printf clones. */ |
typedef struct printf_spec { |
/* String output function, returns number of printed characters or EOF */ |
int (*str_write)(const char *, size_t, void *); |
/* Wide string output function, returns number of printed characters or EOF */ |
int (*wstr_write)(const wchar_t *, size_t, void *); |
/* User data - output stream specification, state, locks, etc. */ |
void *data; |
} printf_spec_t; |
int printf_core(const char *fmt, printf_spec_t *ps, va_list ap); |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/include/io/klog.h |
---|
0,0 → 1,46 |
/* |
* Copyright (c) 2006 Jakub Vana |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libc |
* @{ |
*/ |
/** @file |
*/ |
#ifndef LIBC_STREAM_H_ |
#define LIBC_STREAM_H_ |
#include <sys/types.h> |
extern size_t klog_write(const void *buf, size_t size); |
extern void klog_update(void); |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/include/io/color.h |
---|
0,0 → 1,55 |
/* |
* Copyright (c) 2008 Jiri Svoboda |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libc |
* @{ |
*/ |
/** @file |
*/ |
#ifndef LIBC_IO_COLOR_H_ |
#define LIBC_IO_COLOR_H_ |
enum console_color { |
COLOR_BLACK = 0, |
COLOR_BLUE = 1, |
COLOR_GREEN = 2, |
COLOR_CYAN = 3, |
COLOR_RED = 4, |
COLOR_MAGENTA = 5, |
COLOR_YELLOW = 6, |
COLOR_WHITE = 7, |
CATTR_BRIGHT = 8, |
CATTR_BLINK = 8 |
}; |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/include/io/style.h |
---|
0,0 → 1,46 |
/* |
* Copyright (c) 2008 Jiri Svoboda |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libc |
* @{ |
*/ |
/** @file |
*/ |
#ifndef LIBC_IO_STYLE_H_ |
#define LIBC_IO_STYLE_H_ |
enum console_style { |
STYLE_NORMAL = 0, |
STYLE_EMPHASIS = 1 |
}; |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/include/io/console.h |
---|
0,0 → 1,78 |
/* |
* Copyright (c) 2008 Jiri Svoboda |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libc |
* @{ |
*/ |
/** @file |
*/ |
#ifndef LIBC_IO_CONSOLE_H_ |
#define LIBC_IO_CONSOLE_H_ |
#include <ipc/ipc.h> |
#include <bool.h> |
typedef enum { |
KEY_PRESS, |
KEY_RELEASE |
} console_ev_type_t; |
/** Console event structure. */ |
typedef struct { |
/** Press or release event. */ |
console_ev_type_t type; |
/** Keycode of the key that was pressed or released. */ |
unsigned int key; |
/** Bitmask of modifiers held. */ |
unsigned int mods; |
/** The character that was generated or '\0' for none. */ |
wchar_t c; |
} console_event_t; |
extern void console_clear(int phone); |
extern int console_get_size(int phone, ipcarg_t *rows, ipcarg_t *cols); |
extern void console_goto(int phone, ipcarg_t row, ipcarg_t col); |
extern void console_set_style(int phone, int style); |
extern void console_set_color(int phone, int fg_color, int bg_color, int flags); |
extern void console_set_rgb_color(int phone, int fg_color, int bg_color); |
extern void console_cursor_visibility(int phone, bool show); |
extern void console_kcon_enable(int phone); |
extern bool console_get_event(int phone, console_event_t *event); |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/include/io/keycode.h |
---|
0,0 → 1,220 |
/* |
* Copyright (c) 2009 Jiri Svoboda |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libc |
* @{ |
*/ |
/** @file |
*/ |
#ifndef LIBC_IO_KEYCODE_H_ |
#define LIBC_IO_KEYCODE_H_ |
/** Keycode definitions. |
* |
* A keycode identifies a key by its position on the keyboard, rather |
* than by its label. For human readability, key positions are noted |
* with the key label on a keyboard with US layout. This label has |
* nothing to do with the character, that the key produces |
* -- this is determined by the keymap. |
* |
* The keyboard model reflects a standard PC keyboard layout. |
* Non-standard keyboards need to be mapped to this model in some |
* logical way. Scancodes are mapped to keycodes with a scanmap. |
* |
* For easier mapping to the model and to emphasize the nature of keycodes, |
* they really are organized here by position, rather than by label. |
*/ |
enum keycode { |
/* Main block row 1 */ |
KC_BACKTICK = 1, |
KC_1, |
KC_2, |
KC_3, |
KC_4, |
KC_5, |
KC_6, |
KC_7, |
KC_8, |
KC_9, |
KC_0, |
KC_MINUS, |
KC_EQUALS, |
KC_BACKSPACE, |
/* Main block row 2 */ |
KC_TAB, |
KC_Q, |
KC_W, |
KC_E, |
KC_R, |
KC_T, |
KC_Y, |
KC_U, |
KC_I, |
KC_O, |
KC_P, |
KC_LBRACKET, |
KC_RBRACKET, |
/* Main block row 3 */ |
KC_CAPS_LOCK, |
KC_A, |
KC_S, |
KC_D, |
KC_F, |
KC_G, |
KC_H, |
KC_J, |
KC_K, |
KC_L, |
KC_SEMICOLON, |
KC_QUOTE, |
KC_BACKSLASH, |
KC_ENTER, |
/* Main block row 4 */ |
KC_LSHIFT, |
KC_Z, |
KC_X, |
KC_C, |
KC_V, |
KC_B, |
KC_N, |
KC_M, |
KC_COMMA, |
KC_PERIOD, |
KC_SLASH, |
KC_RSHIFT, |
/* Main block row 5 */ |
KC_LCTRL, |
KC_LALT, |
KC_SPACE, |
KC_RALT, |
KC_RCTRL, |
/* Function keys block */ |
KC_ESCAPE, |
KC_F1, |
KC_F2, |
KC_F3, |
KC_F4, |
KC_F5, |
KC_F6, |
KC_F7, |
KC_F8, |
KC_F9, |
KC_F10, |
KC_F11, |
KC_F12, |
KC_PRTSCR, |
KC_SCROLL_LOCK, |
KC_PAUSE, |
/* Cursor keys block */ |
KC_INSERT, |
KC_HOME, |
KC_PAGE_UP, |
KC_DELETE, |
KC_END, |
KC_PAGE_DOWN, |
KC_UP, |
KC_LEFT, |
KC_DOWN, |
KC_RIGHT, |
/* Numeric block */ |
KC_NUM_LOCK, |
KC_NSLASH, |
KC_NTIMES, |
KC_NMINUS, |
KC_NPLUS, |
KC_NENTER, |
KC_N7, |
KC_N8, |
KC_N9, |
KC_N4, |
KC_N5, |
KC_N6, |
KC_N1, |
KC_N2, |
KC_N3, |
KC_N0, |
KC_NPERIOD |
} keycode_t; |
enum keymod { |
KM_LSHIFT = 0x001, |
KM_RSHIFT = 0x002, |
KM_LCTRL = 0x004, |
KM_RCTRL = 0x008, |
KM_LALT = 0x010, |
KM_RALT = 0x020, |
KM_CAPS_LOCK = 0x040, |
KM_NUM_LOCK = 0x080, |
KM_SCROLL_LOCK = 0x100, |
KM_SHIFT = KM_LSHIFT | KM_RSHIFT, |
KM_CTRL = KM_LCTRL | KM_RCTRL, |
KM_ALT = KM_LALT | KM_RALT |
} keymod_t; |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/include/task.h |
---|
0,0 → 1,50 |
/* |
* Copyright (c) 2006 Jakub Jermar |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libc |
* @{ |
*/ |
/** @file |
*/ |
#ifndef LIBC_TASK_H_ |
#define LIBC_TASK_H_ |
#include <sys/types.h> |
typedef uint64_t task_id_t; |
extern task_id_t task_get_id(void); |
extern int task_set_name(const char *name); |
extern task_id_t task_spawn(const char *path, char *const argv[]); |
extern int task_wait(task_id_t id); |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/include/thread.h |
---|
0,0 → 1,56 |
/* |
* Copyright (c) 2006 Jakub Jermar |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libc |
* @{ |
*/ |
/** @file |
*/ |
#ifndef LIBC_THREAD_H_ |
#define LIBC_THREAD_H_ |
#include <kernel/proc/uarg.h> |
#include <libarch/thread.h> |
#include <sys/types.h> |
typedef uint64_t thread_id_t; |
extern void __thread_entry(void); |
extern void __thread_main(uspace_arg_t *); |
extern int thread_create(void (*)(void *), void *, char *, thread_id_t *); |
extern void thread_exit(int) __attribute__ ((noreturn)); |
extern void thread_detach(thread_id_t); |
extern int thread_join(thread_id_t); |
extern thread_id_t thread_get_id(void); |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/include/event.h |
---|
0,0 → 1,46 |
/* |
* Copyright (c) 2009 Jakub Jermar |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libc |
* @{ |
*/ |
/** @file |
*/ |
#ifndef LIBC_EVENT_H_ |
#define LIBC_EVENT_H_ |
#include <kernel/ipc/event_types.h> |
#include <ipc/ipc.h> |
extern int event_subscribe(event_type_t, ipcarg_t); |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/include/ddi.h |
---|
0,0 → 1,49 |
/* |
* Copyright (c) 2006 Jakub Jermar |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libc |
* @{ |
*/ |
/** @file |
*/ |
#ifndef LIBC_DDI_H_ |
#define LIBC_DDI_H_ |
#include <task.h> |
extern int device_assign_devno(void); |
extern int physmem_map(void *, void *, unsigned long, int); |
extern int iospace_enable(task_id_t, void *, unsigned long); |
extern int preemption_control(int); |
extern int pio_enable(void *, size_t, void **); |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/include/libc.h |
---|
0,0 → 1,63 |
/* |
* Copyright (c) 2005 Martin Decky |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libc |
* @{ |
*/ |
/** @file |
*/ |
#ifndef LIBC_LIBC_H_ |
#define LIBC_LIBC_H_ |
#include <sys/types.h> |
#include <kernel/syscall/syscall.h> |
#include <libarch/syscall.h> |
#define __SYSCALL0(id) \ |
__syscall0(0, 0, 0, 0, 0, 0, id) |
#define __SYSCALL1(id, p1) \ |
__syscall1(p1, 0, 0, 0, 0, 0, id) |
#define __SYSCALL2(id, p1, p2) \ |
__syscall2(p1, p2, 0, 0, 0, 0, id) |
#define __SYSCALL3(id, p1, p2, p3) \ |
__syscall3(p1, p2, p3, 0, 0, 0, id) |
#define __SYSCALL4(id, p1, p2, p3, p4) \ |
__syscall4(p1, p2, p3, p4, 0, 0, id) |
#define __SYSCALL5(id, p1, p2, p3, p4, p5) \ |
__syscall5(p1, p2, p3, p4, p5, 0, id) |
#define __SYSCALL6(id, p1, p2, p3, p4, p5, p6) \ |
__syscall6(p1, p2, p3, p4, p5, p6, id) |
extern void __main(void *pcb_ptr); |
extern void __exit(void); |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/include/ctype.h |
---|
0,0 → 1,98 |
/* |
* Copyright (c) 2006 Josef Cejka |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libc |
* @{ |
*/ |
/** @file |
*/ |
#ifndef LIBC_CTYPE_H_ |
#define LIBC_CTYPE_H_ |
static inline int islower(int c) |
{ |
return ((c >= 'a') && (c <= 'z')); |
} |
static inline int isupper(int c) |
{ |
return ((c >= 'A') && (c <= 'Z')); |
} |
static inline int isalpha(int c) |
{ |
return (islower(c) || isupper(c)); |
} |
static inline int isdigit(int c) |
{ |
return ((c >= '0') && (c <= '9')); |
} |
static inline int isalnum(int c) |
{ |
return (isalpha(c) || isdigit(c)); |
} |
static inline int isspace(int c) |
{ |
switch (c) { |
case ' ': |
case '\n': |
case '\t': |
case '\f': |
case '\r': |
case '\v': |
return 1; |
break; |
default: |
return 0; |
} |
} |
static inline int tolower(int c) |
{ |
if (isupper(c)) |
return (c + ('a' - 'A')); |
else |
return c; |
} |
static inline int toupper(int c) |
{ |
if (islower(c)) |
return (c + ('A' - 'a')); |
else |
return c; |
} |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/include/align.h |
---|
0,0 → 1,63 |
/* |
* Copyright (c) 2005 Jakub Jermar |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libc |
* @{ |
*/ |
/** @file |
*/ |
#ifndef LIBC_ALIGN_H_ |
#define LIBC_ALIGN_H_ |
/** Align to the nearest lower address which is a power of two. |
* |
* @param s Address or size to be aligned. |
* @param a Size of alignment, must be power of 2. |
*/ |
#define ALIGN_DOWN(s, a) ((s) & ~((a) - 1)) |
/** Align to the nearest higher address which is a power of two. |
* |
* @param s Address or size to be aligned. |
* @param a Size of alignment, must be power of 2. |
*/ |
#define ALIGN_UP(s, a) ((long)((s) + ((a) - 1)) & ~((long) (a) - 1)) |
/** Round up to the nearest higher boundary. |
* |
* @param n Number to be aligned. |
* @param b Boundary, arbitrary unsigned number. |
*/ |
#define ROUND_UP(n, b) (((n) / (b) + ((n) % (b) != 0)) * (b)) |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/include/syscall.h |
---|
0,0 → 1,64 |
/* |
* Copyright (c) 2005 Martin Decky |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libc |
* @{ |
*/ |
/** |
* @file |
* @brief Syscall function declaration for architectures that don't |
* inline syscalls or architectures that handle syscalls |
* according to the number of arguments. |
*/ |
#ifndef LIBC_SYSCALL_H_ |
#define LIBC_SYSCALL_H_ |
#ifndef LIBARCH_SYSCALL_GENERIC |
#error "You can't include this file directly." |
#endif |
#include <sys/types.h> |
#include <kernel/syscall/syscall.h> |
#define __syscall0 __syscall |
#define __syscall1 __syscall |
#define __syscall2 __syscall |
#define __syscall3 __syscall |
#define __syscall4 __syscall |
#define __syscall5 __syscall |
#define __syscall6 __syscall |
extern sysarg_t __syscall(const sysarg_t p1, const sysarg_t p2, |
const sysarg_t p3, const sysarg_t p4, const sysarg_t p5, const sysarg_t p6, |
const syscall_t id); |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/include/udebug.h |
---|
0,0 → 1,58 |
/* |
* Copyright (c) 2008 Jiri Svoboda |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libc |
* @{ |
*/ |
/** @file |
*/ |
#ifndef LIBC_UDEBUG_H_ |
#define LIBC_UDEBUG_H_ |
#include <kernel/udebug/udebug.h> |
#include <sys/types.h> |
#include <libarch/types.h> |
typedef sysarg_t thash_t; |
int udebug_begin(int phoneid); |
int udebug_end(int phoneid); |
int udebug_set_evmask(int phoneid, udebug_evmask_t mask); |
int udebug_thread_read(int phoneid, void *buffer, size_t n, |
size_t *copied, size_t *needed); |
int udebug_mem_read(int phoneid, void *buffer, uintptr_t addr, size_t n); |
int udebug_args_read(int phoneid, thash_t tid, sysarg_t *buffer); |
int udebug_go(int phoneid, thash_t tid, udebug_event_t *ev_type, |
sysarg_t *val0, sysarg_t *val1); |
int udebug_stop(int phoneid, thash_t tid); |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/include/as.h |
---|
0,0 → 1,53 |
/* |
* Copyright (c) 2005 Martin Decky |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libc |
* @{ |
*/ |
/** @file |
*/ |
#ifndef LIBC_AS_H_ |
#define LIBC_AS_H_ |
#include <sys/types.h> |
#include <task.h> |
#include <kernel/mm/as.h> |
#include <libarch/config.h> |
extern void *as_area_create(void *address, size_t size, int flags); |
extern int as_area_resize(void *address, size_t size, int flags); |
extern int as_area_change_flags(void *address, int flags); |
extern int as_area_destroy(void *address); |
extern void *set_maxheapsize(size_t mhs); |
extern void * as_get_mappable_page(size_t sz); |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/include/smc.h |
---|
0,0 → 1,45 |
/* |
* Copyright (c) 2008 Jiri Svoboda |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libc |
* @{ |
*/ |
/** @file |
*/ |
#ifndef LIBC_SMC_H_ |
#define LIBC_SMC_H_ |
#include <sys/types.h> |
extern int smc_coherence(void *address, size_t size); |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/include/setjmp.h |
---|
0,0 → 1,49 |
/* |
* Copyright (c) 2008 Josef Cejka |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libc |
* @{ |
*/ |
/** @file |
*/ |
#ifndef LIBC_SETJMP_H_ |
#define LIBC_SETJMP_H_ |
#include <libarch/fibril.h> |
typedef context_t jmp_buf; |
extern int setjmp(jmp_buf env); |
extern void longjmp(jmp_buf env,int val) __attribute__((__noreturn__)); |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/include/rwlock.h |
---|
0,0 → 1,59 |
/* |
* Copyright (c) 2008 Jakub Jermar |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libc |
* @{ |
*/ |
/** |
* @file |
* @brief This file contains rwlock API and provides its fake |
* implementation based on futexes. |
*/ |
#ifndef LIBC_RWLOCK_H_ |
#define LIBC_RWLOCK_H_ |
#include <atomic.h> |
#include <sys/types.h> |
#include <futex.h> |
typedef atomic_t rwlock_t; |
#define RWLOCK_INITIALIZE(rwlock) \ |
rwlock_t rwlock = FUTEX_INITIALIZER |
#define rwlock_initialize(rwlock) futex_initialize((rwlock), 1) |
#define rwlock_read_lock(rwlock) futex_down((rwlock)) |
#define rwlock_write_lock(rwlock) futex_down((rwlock)) |
#define rwlock_read_unlock(rwlock) futex_up((rwlock)) |
#define rwlock_write_unlock(rwlock) futex_up((rwlock)) |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/include/futex.h |
---|
0,0 → 1,54 |
/* |
* Copyright (c) 2006 Jakub Jermar |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libc |
* @{ |
*/ |
/** @file |
*/ |
#ifndef LIBC_FUTEX_H_ |
#define LIBC_FUTEX_H_ |
#include <atomic.h> |
#include <sys/types.h> |
#define FUTEX_INITIALIZER {1} |
typedef atomic_t futex_t; |
extern void futex_initialize(futex_t *futex, int value); |
extern int futex_down(futex_t *futex); |
extern int futex_trydown(futex_t *futex); |
extern int futex_down_timeout(futex_t *futex, uint32_t usec, int flags); |
extern int futex_up(futex_t *futex); |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/include/assert.h |
---|
0,0 → 1,61 |
/* |
* Copyright (c) 2005 Martin Decky |
* Copyright (c) 2006 Josef Cejka |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libc |
* @{ |
*/ |
/** @file |
*/ |
#ifndef LIBC_ASSERT_H_ |
#define LIBC_ASSERT_H_ |
/** Debugging assert macro |
* |
* If NDEBUG is not set, the assert() macro |
* evaluates expr and if it is false prints |
* error message and terminate program. |
* |
* @param expr Expression which is expected to be true. |
* |
*/ |
#include <stdio.h> |
#include <stdlib.h> |
#ifndef NDEBUG |
# define assert(expr) if (!(expr)) { printf("Assertion failed (%s) at file '%s', line %d.\n", #expr, __FILE__, __LINE__); abort();} |
#else |
# define assert(expr) |
#endif |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/include/tls.h |
---|
0,0 → 1,67 |
/* |
* Copyright (c) 2007 Jakub Jermar |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libc |
* @{ |
*/ |
/** @file |
*/ |
#ifndef LIBC_TLS_H_ |
#define LIBC_TLS_H_ |
#include <libarch/tls.h> |
#include <sys/types.h> |
/* |
* Symbols defined in the respective linker script. |
*/ |
extern char _tls_alignment; |
extern char _tdata_start; |
extern char _tdata_end; |
extern char _tbss_start; |
extern char _tbss_end; |
extern tcb_t *__make_tls(void); |
extern tcb_t *__alloc_tls(void **, size_t); |
extern void __free_tls(tcb_t *); |
extern void __free_tls_arch(tcb_t *, size_t); |
#ifdef CONFIG_TLS_VARIANT_1 |
extern tcb_t *tls_alloc_variant_1(void **, size_t); |
extern void tls_free_variant_1(tcb_t *, size_t); |
#endif |
#ifdef CONFIG_TLS_VARIANT_2 |
extern tcb_t *tls_alloc_variant_2(void **, size_t); |
extern void tls_free_variant_2(tcb_t *, size_t); |
#endif |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/include/time.h |
---|
0,0 → 1,45 |
/* |
* Copyright (c) 2007 Jakub Jermar |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libc |
* @{ |
*/ |
/** @file |
*/ |
#ifndef LIBC_TIME_H_ |
#define LIBC_TIME_H_ |
#include <sys/time.h> |
extern time_t time(time_t *); |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/include/stdint.h |
---|
0,0 → 1,64 |
/* |
* Copyright (c) 2006 Josef Cejka |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libc |
* @{ |
*/ |
/** @file |
*/ |
#ifndef LIBC_STDINT_H_ |
#define LIBC_STDINT_H_ |
/* Definitions of types with fixed size */ |
#include <libarch/types.h> |
#define MAX_INT8 (0x7F) |
#define MIN_INT8 (0x80) |
#define MAX_UINT8 (0xFFu) |
#define MIN_UINT8 (0u) |
#define MAX_INT16 (0x7FFF) |
#define MIN_INT16 (0x8000) |
#define MAX_UINT16 (0xFFFFu) |
#define MIN_UINT16 (0u) |
#define MAX_INT32 (0x7FFFFFFF) |
#define MIN_INT32 (0x80000000) |
#define MAX_UINT32 (0xFFFFFFFFu) |
#define MIN_UINT32 (0u) |
#define MAX_INT64 (0x7FFFFFFFFFFFFFFFll) |
#define MIN_INT64 (0x8000000000000000ll) |
#define MAX_UINT64 (0xFFFFFFFFFFFFFFFFull) |
#define MIN_UINT64 (0ull) |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/include/stddef.h |
---|
0,0 → 1,43 |
/* |
* Copyright (c) 2006 Josef Cejka |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libc |
* @{ |
*/ |
/** @file |
*/ |
#ifndef LIBC_STDDEF_H_ |
#define LIBC_STDDEF_H_ |
#include <sys/types.h> |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/include/stdarg.h |
---|
0,0 → 1,55 |
/* |
* Copyright (c) 2006 Josef Cejka |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libc |
* @{ |
*/ |
/** @file |
*/ |
#ifndef LIBC_STDARG_H_ |
#define LIBC_STDARG_H_ |
#include <sys/types.h> |
#include <libarch/stackarg.h> |
#ifndef __VARARGS_DEFINED |
# define __VARARGS_DEFINED |
typedef __builtin_va_list va_list; |
# define va_start(ap, last) __builtin_va_start(ap, last) |
# define va_arg(ap, type) __builtin_va_arg(ap, type) |
# define va_end(ap) __builtin_va_end(ap) |
# endif |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/include/limits.h |
---|
0,0 → 1,74 |
/* |
* Copyright (c) 2006 Josef Cejka |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libc |
* @{ |
*/ |
/** @file |
*/ |
#ifndef LIBC_LIMITS_H_ |
#define LIBC_LIMITS_H_ |
#include <stdint.h> |
#include <libarch/limits.h> |
/* char */ |
#define SCHAR_MIN MIN_INT8 |
#define SCHAR_MAX MAX_INT8 |
#define UCHAR_MIN MIN_UINT8 |
#define UCHAR_MAX MAX_UINT8 |
#ifdef __CHAR_UNSIGNED__ |
# define CHAR_MIN UCHAR_MIN |
# define CHAR_MAX UCHAR_MAX |
#else |
# define CHAR_MIN SCHAR_MIN |
# define CHAR_MAX SCHAR_MAX |
#endif |
/* short int */ |
#define SHRT_MIN MIN_INT16 |
#define SHRT_MAX MAX_INT16 |
#define USHRT_MIN MIN_UINT16 |
#define USHRT_MAX MAX_UINT16 |
#define INT_MIN MIN_INT32 |
#define INT_MAX MAX_INT32 |
#define UINT_MIN MIN_UINT32 |
#define UINT_MAX MAX_UINT32 |
#define LLONG_MIN MIN_INT64 |
#define LLONG_MAX MAX_INT64 |
#define ULLONG_MIN MIN_UINT64 |
#define ULLONG_MAX MAX_UINT64 |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/include/err.h |
---|
0,0 → 1,46 |
/* |
* Copyright (c) 2006 Ondrej Palkovsky |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libc |
* @{ |
*/ |
/** @file |
*/ |
#ifndef LIBC_ERR_H_ |
#define LIBC_ERR_H_ |
#define errx(status, fmt, ...) { \ |
printf((fmt), ##__VA_ARGS__); \ |
_exit(status); \ |
} |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/include/sysinfo.h |
---|
0,0 → 1,47 |
/* |
* Copyright (c) 2006 Jakub Jermar |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libc |
* @{ |
*/ |
/** @file |
*/ |
#ifndef LIBC_SYSINFO_H_ |
#define LIBC_SYSINFO_H_ |
#include <libc.h> |
#include <sysinfo.h> |
#include <string.h> |
sysarg_t sysinfo_value(char *name); |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/include/bool.h |
---|
0,0 → 1,46 |
/* |
* Copyright (c) 2006 Martin Decky |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libc |
* @{ |
*/ |
/** @file |
*/ |
#ifndef LIBC_BOOL_H_ |
#define LIBC_BOOL_H_ |
#define false 0 |
#define true 1 |
typedef short bool; |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/include/cap.h |
---|
0,0 → 1,46 |
/* |
* Copyright (c) 2006 Jakub Jermar |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libc |
* @{ |
*/ |
/** @file |
*/ |
#ifndef LIB_CAP_H_ |
#define LIB_CAP_H_ |
#include <task.h> |
extern int cap_grant(task_id_t id, unsigned int caps); |
extern int cap_revoke(task_id_t id, unsigned int caps); |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/include/atomic.h |
---|
0,0 → 1,57 |
/* |
* Copyright (c) 2006 Jakub Jermar |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libc |
* @{ |
*/ |
/** @file |
*/ |
#ifndef LIBC_ATOMIC_H_ |
#define LIBC_ATOMIC_H_ |
typedef struct atomic { |
volatile long count; |
} atomic_t; |
#include <libarch/atomic.h> |
static inline void atomic_set(atomic_t *val, long i) |
{ |
val->count = i; |
} |
static inline long atomic_get(atomic_t *val) |
{ |
return val->count; |
} |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/generic/getopt.c |
---|
0,0 → 1,479 |
/* $NetBSD: getopt_long.c,v 1.21.4.1 2008/01/09 01:34:14 matt Exp $ */ |
/*- |
* Copyright (c) 2000 The NetBSD Foundation, Inc. |
* All rights reserved. |
* |
* This code is derived from software contributed to The NetBSD Foundation |
* by Dieter Baron and Thomas Klausner. |
* |
* 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. |
* |
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. 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 FOUNDATION 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. |
*/ |
/* Ported to HelenOS August 2008 by Tim Post <echo@echoreply.us> */ |
#include <assert.h> |
#include <stdarg.h> |
#include <err.h> |
#include <errno.h> |
#include <getopt.h> |
#include <stdlib.h> |
#include <string.h> |
/* HelenOS Port : We're incorporating only the modern getopt_long with wrappers |
* to keep legacy getopt() usage from breaking. All references to REPLACE_GETOPT |
* are dropped, we just include the code */ |
int opterr = 1; /* if error message should be printed */ |
int optind = 1; /* index into parent argv vector */ |
int optopt = '?'; /* character checked for validity */ |
int optreset; /* reset getopt */ |
const char *optarg; /* argument associated with option */ |
#define IGNORE_FIRST (*options == '-' || *options == '+') |
#define PRINT_ERROR ((opterr) && ((*options != ':') \ |
|| (IGNORE_FIRST && options[1] != ':'))) |
/*HelenOS Port - POSIXLY_CORRECT is always false */ |
#define IS_POSIXLY_CORRECT 0 |
#define PERMUTE (!IS_POSIXLY_CORRECT && !IGNORE_FIRST) |
/* XXX: GNU ignores PC if *options == '-' */ |
#define IN_ORDER (!IS_POSIXLY_CORRECT && *options == '-') |
/* return values */ |
#define BADCH (int)'?' |
#define BADARG ((IGNORE_FIRST && options[1] == ':') \ |
|| (*options == ':') ? (int)':' : (int)'?') |
#define INORDER (int)1 |
#define EMSG "" |
static int getopt_internal(int, char **, const char *); |
static int gcd(int, int); |
static void permute_args(int, int, int, char **); |
static const char *place = EMSG; /* option letter processing */ |
/* XXX: set optreset to 1 rather than these two */ |
static int nonopt_start = -1; /* first non option argument (for permute) */ |
static int nonopt_end = -1; /* first option after non options (for permute) */ |
/* Error messages */ |
/* HelenOS Port: Calls to warnx() were eliminated (as we have no stderr that |
* may be redirected) and replaced with printf. As such, error messages now |
* end in a newline */ |
static const char recargchar[] = "option requires an argument -- %c\n"; |
static const char recargstring[] = "option requires an argument -- %s\n"; |
static const char ambig[] = "ambiguous option -- %.*s\n"; |
static const char noarg[] = "option doesn't take an argument -- %.*s\n"; |
static const char illoptchar[] = "unknown option -- %c\n"; |
static const char illoptstring[] = "unknown option -- %s\n"; |
/* |
* Compute the greatest common divisor of a and b. |
*/ |
static int |
gcd(a, b) |
int a; |
int b; |
{ |
int c; |
c = a % b; |
while (c != 0) { |
a = b; |
b = c; |
c = a % b; |
} |
return b; |
} |
/* |
* Exchange the block from nonopt_start to nonopt_end with the block |
* from nonopt_end to opt_end (keeping the same order of arguments |
* in each block). |
*/ |
static void |
permute_args(panonopt_start, panonopt_end, opt_end, nargv) |
int panonopt_start; |
int panonopt_end; |
int opt_end; |
char **nargv; |
{ |
int cstart, cyclelen, i, j, ncycle, nnonopts, nopts, pos; |
char *swap; |
assert(nargv != NULL); |
/* |
* compute lengths of blocks and number and size of cycles |
*/ |
nnonopts = panonopt_end - panonopt_start; |
nopts = opt_end - panonopt_end; |
ncycle = gcd(nnonopts, nopts); |
cyclelen = (opt_end - panonopt_start) / ncycle; |
for (i = 0; i < ncycle; i++) { |
cstart = panonopt_end+i; |
pos = cstart; |
for (j = 0; j < cyclelen; j++) { |
if (pos >= panonopt_end) |
pos -= nnonopts; |
else |
pos += nopts; |
swap = nargv[pos]; |
nargv[pos] = nargv[cstart]; |
nargv[cstart] = swap; |
} |
} |
} |
/* |
* getopt_internal -- |
* Parse argc/argv argument vector. Called by user level routines. |
* Returns -2 if -- is found (can be long option or end of options marker). |
*/ |
static int |
getopt_internal(nargc, nargv, options) |
int nargc; |
char **nargv; |
const char *options; |
{ |
const char *oli; /* option letter list index */ |
int optchar; |
assert(nargv != NULL); |
assert(options != NULL); |
optarg = NULL; |
/* |
* XXX Some programs (like rsyncd) expect to be able to |
* XXX re-initialize optind to 0 and have getopt_long(3) |
* XXX properly function again. Work around this braindamage. |
*/ |
if (optind == 0) |
optind = 1; |
if (optreset) |
nonopt_start = nonopt_end = -1; |
start: |
if (optreset || !*place) { /* update scanning pointer */ |
optreset = 0; |
if (optind >= nargc) { /* end of argument vector */ |
place = EMSG; |
if (nonopt_end != -1) { |
/* do permutation, if we have to */ |
permute_args(nonopt_start, nonopt_end, |
optind, nargv); |
optind -= nonopt_end - nonopt_start; |
} |
else if (nonopt_start != -1) { |
/* |
* If we skipped non-options, set optind |
* to the first of them. |
*/ |
optind = nonopt_start; |
} |
nonopt_start = nonopt_end = -1; |
return -1; |
} |
if ((*(place = nargv[optind]) != '-') |
|| (place[1] == '\0')) { /* found non-option */ |
place = EMSG; |
if (IN_ORDER) { |
/* |
* GNU extension: |
* return non-option as argument to option 1 |
*/ |
optarg = nargv[optind++]; |
return INORDER; |
} |
if (!PERMUTE) { |
/* |
* if no permutation wanted, stop parsing |
* at first non-option |
*/ |
return -1; |
} |
/* do permutation */ |
if (nonopt_start == -1) |
nonopt_start = optind; |
else if (nonopt_end != -1) { |
permute_args(nonopt_start, nonopt_end, |
optind, nargv); |
nonopt_start = optind - |
(nonopt_end - nonopt_start); |
nonopt_end = -1; |
} |
optind++; |
/* process next argument */ |
goto start; |
} |
if (nonopt_start != -1 && nonopt_end == -1) |
nonopt_end = optind; |
if (place[1] && *++place == '-') { /* found "--" */ |
place++; |
return -2; |
} |
} |
if ((optchar = (int)*place++) == (int)':' || |
(oli = str_chr(options + (IGNORE_FIRST ? 1 : 0), optchar)) == NULL) { |
/* option letter unknown or ':' */ |
if (!*place) |
++optind; |
if (PRINT_ERROR) |
printf(illoptchar, optchar); |
optopt = optchar; |
return BADCH; |
} |
if (optchar == 'W' && oli[1] == ';') { /* -W long-option */ |
/* XXX: what if no long options provided (called by getopt)? */ |
if (*place) |
return -2; |
if (++optind >= nargc) { /* no arg */ |
place = EMSG; |
if (PRINT_ERROR) |
printf(recargchar, optchar); |
optopt = optchar; |
return BADARG; |
} else /* white space */ |
place = nargv[optind]; |
/* |
* Handle -W arg the same as --arg (which causes getopt to |
* stop parsing). |
*/ |
return -2; |
} |
if (*++oli != ':') { /* doesn't take argument */ |
if (!*place) |
++optind; |
} else { /* takes (optional) argument */ |
optarg = NULL; |
if (*place) /* no white space */ |
optarg = place; |
/* XXX: disable test for :: if PC? (GNU doesn't) */ |
else if (oli[1] != ':') { /* arg not optional */ |
if (++optind >= nargc) { /* no arg */ |
place = EMSG; |
if (PRINT_ERROR) |
printf(recargchar, optchar); |
optopt = optchar; |
return BADARG; |
} else |
optarg = nargv[optind]; |
} |
place = EMSG; |
++optind; |
} |
/* dump back option letter */ |
return optchar; |
} |
/* |
* getopt -- |
* Parse argc/argv argument vector. |
*/ |
int |
getopt(nargc, nargv, options) |
int nargc; |
char * const *nargv; |
const char *options; |
{ |
int retval; |
assert(nargv != NULL); |
assert(options != NULL); |
retval = getopt_internal(nargc, (char **)nargv, options); |
if (retval == -2) { |
++optind; |
/* |
* We found an option (--), so if we skipped non-options, |
* we have to permute. |
*/ |
if (nonopt_end != -1) { |
permute_args(nonopt_start, nonopt_end, optind, |
(char **)nargv); |
optind -= nonopt_end - nonopt_start; |
} |
nonopt_start = nonopt_end = -1; |
retval = -1; |
} |
return retval; |
} |
/* |
* getopt_long -- |
* Parse argc/argv argument vector. |
*/ |
int |
getopt_long(nargc, nargv, options, long_options, idx) |
int nargc; |
char * const *nargv; |
const char *options; |
const struct option *long_options; |
int *idx; |
{ |
int retval; |
#define IDENTICAL_INTERPRETATION(_x, _y) \ |
(long_options[(_x)].has_arg == long_options[(_y)].has_arg && \ |
long_options[(_x)].flag == long_options[(_y)].flag && \ |
long_options[(_x)].val == long_options[(_y)].val) |
assert(nargv != NULL); |
assert(options != NULL); |
assert(long_options != NULL); |
/* idx may be NULL */ |
retval = getopt_internal(nargc, (char **)nargv, options); |
if (retval == -2) { |
char *current_argv; |
const char *has_equal; |
size_t current_argv_len; |
int i, ambiguous, match; |
current_argv = (char *)place; |
match = -1; |
ambiguous = 0; |
optind++; |
place = EMSG; |
if (*current_argv == '\0') { /* found "--" */ |
/* |
* We found an option (--), so if we skipped |
* non-options, we have to permute. |
*/ |
if (nonopt_end != -1) { |
permute_args(nonopt_start, nonopt_end, |
optind, (char **)nargv); |
optind -= nonopt_end - nonopt_start; |
} |
nonopt_start = nonopt_end = -1; |
return -1; |
} |
if ((has_equal = str_chr(current_argv, '=')) != NULL) { |
/* argument found (--option=arg) */ |
current_argv_len = has_equal - current_argv; |
has_equal++; |
} else |
current_argv_len = str_size(current_argv); |
for (i = 0; long_options[i].name; i++) { |
/* find matching long option */ |
if (str_lcmp(current_argv, long_options[i].name, |
str_nlength(current_argv, current_argv_len))) |
continue; |
if (str_size(long_options[i].name) == |
(unsigned)current_argv_len) { |
/* exact match */ |
match = i; |
ambiguous = 0; |
break; |
} |
if (match == -1) /* partial match */ |
match = i; |
else if (!IDENTICAL_INTERPRETATION(i, match)) |
ambiguous = 1; |
} |
if (ambiguous) { |
/* ambiguous abbreviation */ |
if (PRINT_ERROR) |
printf(ambig, (int)current_argv_len, |
current_argv); |
optopt = 0; |
return BADCH; |
} |
if (match != -1) { /* option found */ |
if (long_options[match].has_arg == no_argument |
&& has_equal) { |
if (PRINT_ERROR) |
printf(noarg, (int)current_argv_len, |
current_argv); |
/* |
* XXX: GNU sets optopt to val regardless of |
* flag |
*/ |
if (long_options[match].flag == NULL) |
optopt = long_options[match].val; |
else |
optopt = 0; |
return BADARG; |
} |
if (long_options[match].has_arg == required_argument || |
long_options[match].has_arg == optional_argument) { |
if (has_equal) |
optarg = has_equal; |
else if (long_options[match].has_arg == |
required_argument) { |
/* |
* optional argument doesn't use |
* next nargv |
*/ |
optarg = nargv[optind++]; |
} |
} |
if ((long_options[match].has_arg == required_argument) |
&& (optarg == NULL)) { |
/* |
* Missing argument; leading ':' |
* indicates no error should be generated |
*/ |
if (PRINT_ERROR) |
printf(recargstring, current_argv); |
/* |
* XXX: GNU sets optopt to val regardless |
* of flag |
*/ |
if (long_options[match].flag == NULL) |
optopt = long_options[match].val; |
else |
optopt = 0; |
--optind; |
return BADARG; |
} |
} else { /* unknown option */ |
if (PRINT_ERROR) |
printf(illoptstring, current_argv); |
optopt = 0; |
return BADCH; |
} |
if (long_options[match].flag) { |
*long_options[match].flag = long_options[match].val; |
retval = 0; |
} else |
retval = long_options[match].val; |
if (idx) |
*idx = match; |
} |
return retval; |
#undef IDENTICAL_INTERPRETATION |
} |
//branches/snapshot/uspace/lib/libc/generic/as.c |
---|
0,0 → 1,131 |
/* |
* Copyright (c) 2006 Jakub Jermar |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libc |
* @{ |
*/ |
/** @file |
*/ |
#include <as.h> |
#include <libc.h> |
#include <unistd.h> |
#include <align.h> |
#include <sys/types.h> |
#include <bitops.h> |
#include <malloc.h> |
/** Last position allocated by as_get_mappable_page */ |
static uintptr_t last_allocated = 0; |
/** Create address space area. |
* |
* @param address Virtual address where to place new address space area. |
* @param size Size of the area. |
* @param flags Flags describing type of the area. |
* |
* @return address on success, (void *) -1 otherwise. |
* |
*/ |
void *as_area_create(void *address, size_t size, int flags) |
{ |
return (void *) __SYSCALL3(SYS_AS_AREA_CREATE, (sysarg_t) address, |
(sysarg_t) size, (sysarg_t) flags); |
} |
/** Resize address space area. |
* |
* @param address Virtual address pointing into already existing address space |
* area. |
* @param size New requested size of the area. |
* @param flags Currently unused. |
* |
* @return zero on success or a code from @ref errno.h on failure. |
* |
*/ |
int as_area_resize(void *address, size_t size, int flags) |
{ |
return __SYSCALL3(SYS_AS_AREA_RESIZE, (sysarg_t) address, |
(sysarg_t) size, (sysarg_t) flags); |
} |
/** Destroy address space area. |
* |
* @param address Virtual address pointing into the address space area being |
* destroyed. |
* |
* @return zero on success or a code from @ref errno.h on failure. |
* |
*/ |
int as_area_destroy(void *address) |
{ |
return __SYSCALL1(SYS_AS_AREA_DESTROY, (sysarg_t) address); |
} |
/** Change address-space area flags. |
* |
* @param address Virtual address pointing into the address space area being |
* modified. |
* @param flags New flags describing type of the area. |
* |
* @return zero on success or a code from @ref errno.h on failure. |
* |
*/ |
int as_area_change_flags(void *address, int flags) |
{ |
return __SYSCALL2(SYS_AS_AREA_CHANGE_FLAGS, (sysarg_t) address, |
(sysarg_t) flags); |
} |
/** Return pointer to some unmapped area, where fits new as_area |
* |
* @param size Requested size of the allocation. |
* |
* @return pointer to the beginning |
* |
*/ |
void *as_get_mappable_page(size_t size) |
{ |
if (size == 0) |
return NULL; |
size_t sz = 1 << (fnzb(size - 1) + 1); |
if (last_allocated == 0) |
last_allocated = get_max_heap_addr(); |
/* |
* Make sure we allocate from naturally aligned address. |
*/ |
uintptr_t res = ALIGN_UP(last_allocated, sz); |
last_allocated = res + ALIGN_UP(size, PAGE_SIZE); |
return ((void *) res); |
} |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/generic/libc.c |
---|
0,0 → 1,96 |
/* |
* Copyright (c) 2005 Martin Decky |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup lc Libc |
* @brief HelenOS C library |
* @{ |
* @} |
*/ |
/** @addtogroup libc generic |
* @ingroup lc |
* @{ |
*/ |
/** @file |
*/ |
#include <libc.h> |
#include <stdio.h> |
#include <unistd.h> |
#include <malloc.h> |
#include <tls.h> |
#include <thread.h> |
#include <fibril.h> |
#include <ipc/ipc.h> |
#include <async.h> |
#include <as.h> |
#include <loader/pcb.h> |
extern int main(int argc, char *argv[]); |
void _exit(int status) |
{ |
thread_exit(status); |
} |
void __main(void *pcb_ptr) |
{ |
__heap_init(); |
__async_init(); |
fibril_t *fibril = fibril_setup(); |
__tcb_set(fibril->tcb); |
/* Save the PCB pointer */ |
__pcb = (pcb_t *) pcb_ptr; |
int argc; |
char **argv; |
if (__pcb == NULL) { |
argc = 0; |
argv = NULL; |
__stdio_init(0, NULL); |
} else { |
argc = __pcb->argc; |
argv = __pcb->argv; |
__stdio_init(__pcb->filc, __pcb->filv); |
} |
main(argc, argv); |
__stdio_done(); |
} |
void __exit(void) |
{ |
fibril_teardown(__tcb_get()->fibril_data); |
_exit(0); |
} |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/generic/async.c |
---|
0,0 → 1,1101 |
/* |
* Copyright (c) 2006 Ondrej Palkovsky |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libc |
* @{ |
*/ |
/** @file |
*/ |
/** |
* Asynchronous library |
* |
* The aim of this library is to provide a facility for writing programs which |
* utilize the asynchronous nature of HelenOS IPC, yet using a normal way of |
* programming. |
* |
* You should be able to write very simple multithreaded programs, the async |
* framework will automatically take care of most synchronization problems. |
* |
* Default semantics: |
* - async_send_*(): Send asynchronously. If the kernel refuses to send |
* more messages, [ try to get responses from kernel, if |
* nothing found, might try synchronous ] |
* |
* Example of use (pseudo C): |
* |
* 1) Multithreaded client application |
* |
* fibril_create(fibril1, ...); |
* fibril_create(fibril2, ...); |
* ... |
* |
* int fibril1(void *arg) |
* { |
* conn = ipc_connect_me_to(); |
* c1 = async_send(conn); |
* c2 = async_send(conn); |
* async_wait_for(c1); |
* async_wait_for(c2); |
* ... |
* } |
* |
* |
* 2) Multithreaded server application |
* |
* main() |
* { |
* async_manager(); |
* } |
* |
* my_client_connection(icallid, *icall) |
* { |
* if (want_refuse) { |
* ipc_answer_0(icallid, ELIMIT); |
* return; |
* } |
* ipc_answer_0(icallid, EOK); |
* |
* callid = async_get_call(&call); |
* handle_call(callid, call); |
* ipc_answer_2(callid, 1, 2, 3); |
* |
* callid = async_get_call(&call); |
* ... |
* } |
* |
*/ |
#include <futex.h> |
#include <async.h> |
#include <fibril.h> |
#include <stdio.h> |
#include <adt/hash_table.h> |
#include <adt/list.h> |
#include <ipc/ipc.h> |
#include <assert.h> |
#include <errno.h> |
#include <sys/time.h> |
#include <arch/barrier.h> |
#include <bool.h> |
atomic_t async_futex = FUTEX_INITIALIZER; |
/** Structures of this type represent a waiting fibril. */ |
typedef struct { |
/** Expiration time. */ |
struct timeval expires; |
/** If true, this struct is in the timeout list. */ |
bool inlist; |
/** Timeout list link. */ |
link_t link; |
/** Identification of and link to the waiting fibril. */ |
fid_t fid; |
/** If true, this fibril is currently active. */ |
bool active; |
/** If true, we have timed out. */ |
bool timedout; |
} awaiter_t; |
typedef struct { |
awaiter_t wdata; |
/** If reply was received. */ |
bool done; |
/** Pointer to where the answer data is stored. */ |
ipc_call_t *dataptr; |
ipcarg_t retval; |
} amsg_t; |
/** |
* Structures of this type are used to group information about a call and a |
* message queue link. |
*/ |
typedef struct { |
link_t link; |
ipc_callid_t callid; |
ipc_call_t call; |
} msg_t; |
typedef struct { |
awaiter_t wdata; |
/** Hash table link. */ |
link_t link; |
/** Incoming phone hash. */ |
ipcarg_t in_phone_hash; |
/** Messages that should be delivered to this fibril. */ |
link_t msg_queue; |
/** Identification of the opening call. */ |
ipc_callid_t callid; |
/** Call data of the opening call. */ |
ipc_call_t call; |
/** Identification of the closing call. */ |
ipc_callid_t close_callid; |
/** Fibril function that will be used to handle the connection. */ |
void (*cfibril)(ipc_callid_t, ipc_call_t *); |
} connection_t; |
/** Identifier of the incoming connection handled by the current fibril. */ |
fibril_local connection_t *FIBRIL_connection; |
static void default_client_connection(ipc_callid_t callid, ipc_call_t *call); |
static void default_interrupt_received(ipc_callid_t callid, ipc_call_t *call); |
/** |
* Pointer to a fibril function that will be used to handle connections. |
*/ |
static async_client_conn_t client_connection = default_client_connection; |
/** |
* Pointer to a fibril function that will be used to handle interrupt |
* notifications. |
*/ |
static async_client_conn_t interrupt_received = default_interrupt_received; |
static hash_table_t conn_hash_table; |
static LIST_INITIALIZE(timeout_list); |
#define CONN_HASH_TABLE_CHAINS 32 |
/** Compute hash into the connection hash table based on the source phone hash. |
* |
* @param key Pointer to source phone hash. |
* |
* @return Index into the connection hash table. |
* |
*/ |
static hash_index_t conn_hash(unsigned long *key) |
{ |
assert(key); |
return (((*key) >> 4) % CONN_HASH_TABLE_CHAINS); |
} |
/** Compare hash table item with a key. |
* |
* @param key Array containing the source phone hash as the only item. |
* @param keys Expected 1 but ignored. |
* @param item Connection hash table item. |
* |
* @return True on match, false otherwise. |
* |
*/ |
static int conn_compare(unsigned long key[], hash_count_t keys, link_t *item) |
{ |
connection_t *hs = hash_table_get_instance(item, connection_t, link); |
return (key[0] == hs->in_phone_hash); |
} |
/** Connection hash table removal callback function. |
* |
* This function is called whenever a connection is removed from the connection |
* hash table. |
* |
* @param item Connection hash table item being removed. |
* |
*/ |
static void conn_remove(link_t *item) |
{ |
free(hash_table_get_instance(item, connection_t, link)); |
} |
/** Operations for the connection hash table. */ |
static hash_table_operations_t conn_hash_table_ops = { |
.hash = conn_hash, |
.compare = conn_compare, |
.remove_callback = conn_remove |
}; |
/** Sort in current fibril's timeout request. |
* |
* @param wd Wait data of the current fibril. |
* |
*/ |
static void insert_timeout(awaiter_t *wd) |
{ |
wd->timedout = false; |
wd->inlist = true; |
link_t *tmp = timeout_list.next; |
while (tmp != &timeout_list) { |
awaiter_t *cur = list_get_instance(tmp, awaiter_t, link); |
if (tv_gteq(&cur->expires, &wd->expires)) |
break; |
tmp = tmp->next; |
} |
list_append(&wd->link, tmp); |
} |
/** Try to route a call to an appropriate connection fibril. |
* |
* If the proper connection fibril is found, a message with the call is added to |
* its message queue. If the fibril was not active, it is activated and all |
* timeouts are unregistered. |
* |
* @param callid Hash of the incoming call. |
* @param call Data of the incoming call. |
* |
* @return False if the call doesn't match any connection. |
* True if the call was passed to the respective connection fibril. |
* |
*/ |
static bool route_call(ipc_callid_t callid, ipc_call_t *call) |
{ |
futex_down(&async_futex); |
unsigned long key = call->in_phone_hash; |
link_t *hlp = hash_table_find(&conn_hash_table, &key); |
if (!hlp) { |
futex_up(&async_futex); |
return false; |
} |
connection_t *conn = hash_table_get_instance(hlp, connection_t, link); |
msg_t *msg = malloc(sizeof(*msg)); |
if (!msg) { |
futex_up(&async_futex); |
return false; |
} |
msg->callid = callid; |
msg->call = *call; |
list_append(&msg->link, &conn->msg_queue); |
if (IPC_GET_METHOD(*call) == IPC_M_PHONE_HUNGUP) |
conn->close_callid = callid; |
/* If the connection fibril is waiting for an event, activate it */ |
if (!conn->wdata.active) { |
/* If in timeout list, remove it */ |
if (conn->wdata.inlist) { |
conn->wdata.inlist = false; |
list_remove(&conn->wdata.link); |
} |
conn->wdata.active = true; |
fibril_add_ready(conn->wdata.fid); |
} |
futex_up(&async_futex); |
return true; |
} |
/** Notification fibril. |
* |
* When a notification arrives, a fibril with this implementing function is |
* created. It calls interrupt_received() and does the final cleanup. |
* |
* @param arg Message structure pointer. |
* |
* @return Always zero. |
* |
*/ |
static int notification_fibril(void *arg) |
{ |
msg_t *msg = (msg_t *) arg; |
interrupt_received(msg->callid, &msg->call); |
free(msg); |
return 0; |
} |
/** Process interrupt notification. |
* |
* A new fibril is created which would process the notification. |
* |
* @param callid Hash of the incoming call. |
* @param call Data of the incoming call. |
* |
* @return False if an error occured. |
* True if the call was passed to the notification fibril. |
* |
*/ |
static bool process_notification(ipc_callid_t callid, ipc_call_t *call) |
{ |
futex_down(&async_futex); |
msg_t *msg = malloc(sizeof(*msg)); |
if (!msg) { |
futex_up(&async_futex); |
return false; |
} |
msg->callid = callid; |
msg->call = *call; |
fid_t fid = fibril_create(notification_fibril, msg); |
fibril_add_ready(fid); |
futex_up(&async_futex); |
return true; |
} |
/** Return new incoming message for the current (fibril-local) connection. |
* |
* @param call Storage where the incoming call data will be stored. |
* @param usecs Timeout in microseconds. Zero denotes no timeout. |
* |
* @return If no timeout was specified, then a hash of the |
* incoming call is returned. If a timeout is specified, |
* then a hash of the incoming call is returned unless |
* the timeout expires prior to receiving a message. In |
* that case zero is returned. |
* |
*/ |
ipc_callid_t async_get_call_timeout(ipc_call_t *call, suseconds_t usecs) |
{ |
assert(FIBRIL_connection); |
/* Why doing this? |
* GCC 4.1.0 coughs on FIBRIL_connection-> dereference. |
* GCC 4.1.1 happilly puts the rdhwr instruction in delay slot. |
* I would never expect to find so many errors in |
* a compiler. |
*/ |
connection_t *conn = FIBRIL_connection; |
futex_down(&async_futex); |
if (usecs) { |
gettimeofday(&conn->wdata.expires, NULL); |
tv_add(&conn->wdata.expires, usecs); |
} else |
conn->wdata.inlist = false; |
/* If nothing in queue, wait until something arrives */ |
while (list_empty(&conn->msg_queue)) { |
if (usecs) |
insert_timeout(&conn->wdata); |
conn->wdata.active = false; |
/* |
* Note: the current fibril will be rescheduled either due to a |
* timeout or due to an arriving message destined to it. In the |
* former case, handle_expired_timeouts() and, in the latter |
* case, route_call() will perform the wakeup. |
*/ |
fibril_switch(FIBRIL_TO_MANAGER); |
/* |
* Futex is up after getting back from async_manager. |
* Get it again. |
*/ |
futex_down(&async_futex); |
if ((usecs) && (conn->wdata.timedout) |
&& (list_empty(&conn->msg_queue))) { |
/* If we timed out -> exit */ |
futex_up(&async_futex); |
return 0; |
} |
} |
msg_t *msg = list_get_instance(conn->msg_queue.next, msg_t, link); |
list_remove(&msg->link); |
ipc_callid_t callid = msg->callid; |
*call = msg->call; |
free(msg); |
futex_up(&async_futex); |
return callid; |
} |
/** Default fibril function that gets called to handle new connection. |
* |
* This function is defined as a weak symbol - to be redefined in user code. |
* |
* @param callid Hash of the incoming call. |
* @param call Data of the incoming call. |
* |
*/ |
static void default_client_connection(ipc_callid_t callid, ipc_call_t *call) |
{ |
ipc_answer_0(callid, ENOENT); |
} |
/** Default fibril function that gets called to handle interrupt notifications. |
* |
* This function is defined as a weak symbol - to be redefined in user code. |
* |
* @param callid Hash of the incoming call. |
* @param call Data of the incoming call. |
* |
*/ |
static void default_interrupt_received(ipc_callid_t callid, ipc_call_t *call) |
{ |
} |
/** Wrapper for client connection fibril. |
* |
* When a new connection arrives, a fibril with this implementing function is |
* created. It calls client_connection() and does the final cleanup. |
* |
* @param arg Connection structure pointer. |
* |
* @return Always zero. |
* |
*/ |
static int connection_fibril(void *arg) |
{ |
/* |
* Setup fibril-local connection pointer and call client_connection(). |
* |
*/ |
FIBRIL_connection = (connection_t *) arg; |
FIBRIL_connection->cfibril(FIBRIL_connection->callid, |
&FIBRIL_connection->call); |
/* Remove myself from the connection hash table */ |
futex_down(&async_futex); |
unsigned long key = FIBRIL_connection->in_phone_hash; |
hash_table_remove(&conn_hash_table, &key, 1); |
futex_up(&async_futex); |
/* Answer all remaining messages with EHANGUP */ |
while (!list_empty(&FIBRIL_connection->msg_queue)) { |
msg_t *msg; |
msg = list_get_instance(FIBRIL_connection->msg_queue.next, |
msg_t, link); |
list_remove(&msg->link); |
ipc_answer_0(msg->callid, EHANGUP); |
free(msg); |
} |
if (FIBRIL_connection->close_callid) |
ipc_answer_0(FIBRIL_connection->close_callid, EOK); |
return 0; |
} |
/** Create a new fibril for a new connection. |
* |
* Create new fibril for connection, fill in connection structures and inserts |
* it into the hash table, so that later we can easily do routing of messages to |
* particular fibrils. |
* |
* @param in_phone_hash Identification of the incoming connection. |
* @param callid Hash of the opening IPC_M_CONNECT_ME_TO call. |
* If callid is zero, the connection was opened by |
* accepting the IPC_M_CONNECT_TO_ME call and this function |
* is called directly by the server. |
* @param call Call data of the opening call. |
* @param cfibril Fibril function that should be called upon opening the |
* connection. |
* |
* @return New fibril id or NULL on failure. |
* |
*/ |
fid_t async_new_connection(ipcarg_t in_phone_hash, ipc_callid_t callid, |
ipc_call_t *call, void (*cfibril)(ipc_callid_t, ipc_call_t *)) |
{ |
connection_t *conn = malloc(sizeof(*conn)); |
if (!conn) { |
if (callid) |
ipc_answer_0(callid, ENOMEM); |
return NULL; |
} |
conn->in_phone_hash = in_phone_hash; |
list_initialize(&conn->msg_queue); |
conn->callid = callid; |
conn->close_callid = false; |
if (call) |
conn->call = *call; |
/* We will activate the fibril ASAP */ |
conn->wdata.active = true; |
conn->cfibril = cfibril; |
conn->wdata.fid = fibril_create(connection_fibril, conn); |
if (!conn->wdata.fid) { |
free(conn); |
if (callid) |
ipc_answer_0(callid, ENOMEM); |
return NULL; |
} |
/* Add connection to the connection hash table */ |
unsigned long key = conn->in_phone_hash; |
futex_down(&async_futex); |
hash_table_insert(&conn_hash_table, &key, &conn->link); |
futex_up(&async_futex); |
fibril_add_ready(conn->wdata.fid); |
return conn->wdata.fid; |
} |
/** Handle a call that was received. |
* |
* If the call has the IPC_M_CONNECT_ME_TO method, a new connection is created. |
* Otherwise the call is routed to its connection fibril. |
* |
* @param callid Hash of the incoming call. |
* @param call Data of the incoming call. |
* |
*/ |
static void handle_call(ipc_callid_t callid, ipc_call_t *call) |
{ |
/* Unrouted call - do some default behaviour */ |
if ((callid & IPC_CALLID_NOTIFICATION)) { |
process_notification(callid, call); |
goto out; |
} |
switch (IPC_GET_METHOD(*call)) { |
case IPC_M_CONNECT_ME: |
case IPC_M_CONNECT_ME_TO: |
/* Open new connection with fibril etc. */ |
async_new_connection(IPC_GET_ARG5(*call), callid, call, |
client_connection); |
goto out; |
} |
/* Try to route the call through the connection hash table */ |
if (route_call(callid, call)) |
goto out; |
/* Unknown call from unknown phone - hang it up */ |
ipc_answer_0(callid, EHANGUP); |
return; |
out: |
; |
} |
/** Fire all timeouts that expired. */ |
static void handle_expired_timeouts(void) |
{ |
struct timeval tv; |
gettimeofday(&tv, NULL); |
futex_down(&async_futex); |
link_t *cur = timeout_list.next; |
while (cur != &timeout_list) { |
awaiter_t *waiter = list_get_instance(cur, awaiter_t, link); |
if (tv_gt(&waiter->expires, &tv)) |
break; |
cur = cur->next; |
list_remove(&waiter->link); |
waiter->inlist = false; |
waiter->timedout = true; |
/* |
* Redundant condition? |
* The fibril should not be active when it gets here. |
*/ |
if (!waiter->active) { |
waiter->active = true; |
fibril_add_ready(waiter->fid); |
} |
} |
futex_up(&async_futex); |
} |
/** Endless loop dispatching incoming calls and answers. |
* |
* @return Never returns. |
* |
*/ |
static int async_manager_worker(void) |
{ |
while (true) { |
if (fibril_switch(FIBRIL_FROM_MANAGER)) { |
futex_up(&async_futex); |
/* |
* async_futex is always held when entering a manager |
* fibril. |
*/ |
continue; |
} |
futex_down(&async_futex); |
suseconds_t timeout; |
if (!list_empty(&timeout_list)) { |
awaiter_t *waiter = list_get_instance(timeout_list.next, |
awaiter_t, link); |
struct timeval tv; |
gettimeofday(&tv, NULL); |
if (tv_gteq(&tv, &waiter->expires)) { |
futex_up(&async_futex); |
handle_expired_timeouts(); |
continue; |
} else |
timeout = tv_sub(&waiter->expires, &tv); |
} else |
timeout = SYNCH_NO_TIMEOUT; |
futex_up(&async_futex); |
ipc_call_t call; |
ipc_callid_t callid = ipc_wait_cycle(&call, timeout, |
SYNCH_FLAGS_NONE); |
if (!callid) { |
handle_expired_timeouts(); |
continue; |
} |
if (callid & IPC_CALLID_ANSWERED) |
continue; |
handle_call(callid, &call); |
} |
return 0; |
} |
/** Function to start async_manager as a standalone fibril. |
* |
* When more kernel threads are used, one async manager should exist per thread. |
* |
* @param arg Unused. |
* @return Never returns. |
* |
*/ |
static int async_manager_fibril(void *arg) |
{ |
futex_up(&async_futex); |
/* |
* async_futex is always locked when entering manager |
*/ |
async_manager_worker(); |
return 0; |
} |
/** Add one manager to manager list. */ |
void async_create_manager(void) |
{ |
fid_t fid = fibril_create(async_manager_fibril, NULL); |
fibril_add_manager(fid); |
} |
/** Remove one manager from manager list */ |
void async_destroy_manager(void) |
{ |
fibril_remove_manager(); |
} |
/** Initialize the async framework. |
* |
* @return Zero on success or an error code. |
*/ |
int __async_init(void) |
{ |
if (!hash_table_create(&conn_hash_table, CONN_HASH_TABLE_CHAINS, 1, |
&conn_hash_table_ops)) { |
printf("%s: cannot create hash table\n", "async"); |
return ENOMEM; |
} |
return 0; |
} |
/** Reply received callback. |
* |
* This function is called whenever a reply for an asynchronous message sent out |
* by the asynchronous framework is received. |
* |
* Notify the fibril which is waiting for this message that it has arrived. |
* |
* @param arg Pointer to the asynchronous message record. |
* @param retval Value returned in the answer. |
* @param data Call data of the answer. |
*/ |
static void reply_received(void *arg, int retval, ipc_call_t *data) |
{ |
futex_down(&async_futex); |
amsg_t *msg = (amsg_t *) arg; |
msg->retval = retval; |
/* Copy data after futex_down, just in case the call was detached */ |
if ((msg->dataptr) && (data)) |
*msg->dataptr = *data; |
write_barrier(); |
/* Remove message from timeout list */ |
if (msg->wdata.inlist) |
list_remove(&msg->wdata.link); |
msg->done = true; |
if (!msg->wdata.active) { |
msg->wdata.active = true; |
fibril_add_ready(msg->wdata.fid); |
} |
futex_up(&async_futex); |
} |
/** Send message and return id of the sent message. |
* |
* The return value can be used as input for async_wait() to wait for |
* completion. |
* |
* @param phoneid Handle of the phone that will be used for the send. |
* @param method Service-defined method. |
* @param arg1 Service-defined payload argument. |
* @param arg2 Service-defined payload argument. |
* @param arg3 Service-defined payload argument. |
* @param arg4 Service-defined payload argument. |
* @param dataptr If non-NULL, storage where the reply data will be |
* stored. |
* |
* @return Hash of the sent message or 0 on error. |
* |
*/ |
aid_t async_send_fast(int phoneid, ipcarg_t method, ipcarg_t arg1, |
ipcarg_t arg2, ipcarg_t arg3, ipcarg_t arg4, ipc_call_t *dataptr) |
{ |
amsg_t *msg = malloc(sizeof(*msg)); |
if (!msg) |
return 0; |
msg->done = false; |
msg->dataptr = dataptr; |
msg->wdata.inlist = false; |
/* We may sleep in the next method, but it will use its own mechanism */ |
msg->wdata.active = true; |
ipc_call_async_4(phoneid, method, arg1, arg2, arg3, arg4, msg, |
reply_received, true); |
return (aid_t) msg; |
} |
/** Send message and return id of the sent message |
* |
* The return value can be used as input for async_wait() to wait for |
* completion. |
* |
* @param phoneid Handle of the phone that will be used for the send. |
* @param method Service-defined method. |
* @param arg1 Service-defined payload argument. |
* @param arg2 Service-defined payload argument. |
* @param arg3 Service-defined payload argument. |
* @param arg4 Service-defined payload argument. |
* @param arg5 Service-defined payload argument. |
* @param dataptr If non-NULL, storage where the reply data will be |
* stored. |
* |
* @return Hash of the sent message or 0 on error. |
* |
*/ |
aid_t async_send_slow(int phoneid, ipcarg_t method, ipcarg_t arg1, |
ipcarg_t arg2, ipcarg_t arg3, ipcarg_t arg4, ipcarg_t arg5, |
ipc_call_t *dataptr) |
{ |
amsg_t *msg = malloc(sizeof(*msg)); |
if (!msg) |
return 0; |
msg->done = false; |
msg->dataptr = dataptr; |
msg->wdata.inlist = false; |
/* We may sleep in next method, but it will use its own mechanism */ |
msg->wdata.active = true; |
ipc_call_async_5(phoneid, method, arg1, arg2, arg3, arg4, arg5, msg, |
reply_received, true); |
return (aid_t) msg; |
} |
/** Wait for a message sent by the async framework. |
* |
* @param amsgid Hash of the message to wait for. |
* @param retval Pointer to storage where the retval of the answer will |
* be stored. |
* |
*/ |
void async_wait_for(aid_t amsgid, ipcarg_t *retval) |
{ |
amsg_t *msg = (amsg_t *) amsgid; |
futex_down(&async_futex); |
if (msg->done) { |
futex_up(&async_futex); |
goto done; |
} |
msg->wdata.fid = fibril_get_id(); |
msg->wdata.active = false; |
msg->wdata.inlist = false; |
/* Leave the async_futex locked when entering this function */ |
fibril_switch(FIBRIL_TO_MANAGER); |
/* Futex is up automatically after fibril_switch */ |
done: |
if (retval) |
*retval = msg->retval; |
free(msg); |
} |
/** Wait for a message sent by the async framework, timeout variant. |
* |
* @param amsgid Hash of the message to wait for. |
* @param retval Pointer to storage where the retval of the answer will |
* be stored. |
* @param timeout Timeout in microseconds. |
* |
* @return Zero on success, ETIMEOUT if the timeout has expired. |
* |
*/ |
int async_wait_timeout(aid_t amsgid, ipcarg_t *retval, suseconds_t timeout) |
{ |
amsg_t *msg = (amsg_t *) amsgid; |
/* TODO: Let it go through the event read at least once */ |
if (timeout < 0) |
return ETIMEOUT; |
futex_down(&async_futex); |
if (msg->done) { |
futex_up(&async_futex); |
goto done; |
} |
gettimeofday(&msg->wdata.expires, NULL); |
tv_add(&msg->wdata.expires, timeout); |
msg->wdata.fid = fibril_get_id(); |
msg->wdata.active = false; |
insert_timeout(&msg->wdata); |
/* Leave the async_futex locked when entering this function */ |
fibril_switch(FIBRIL_TO_MANAGER); |
/* Futex is up automatically after fibril_switch */ |
if (!msg->done) |
return ETIMEOUT; |
done: |
if (retval) |
*retval = msg->retval; |
free(msg); |
return 0; |
} |
/** Wait for specified time. |
* |
* The current fibril is suspended but the thread continues to execute. |
* |
* @param timeout Duration of the wait in microseconds. |
* |
*/ |
void async_usleep(suseconds_t timeout) |
{ |
amsg_t *msg = malloc(sizeof(*msg)); |
if (!msg) |
return; |
msg->wdata.fid = fibril_get_id(); |
msg->wdata.active = false; |
gettimeofday(&msg->wdata.expires, NULL); |
tv_add(&msg->wdata.expires, timeout); |
futex_down(&async_futex); |
insert_timeout(&msg->wdata); |
/* Leave the async_futex locked when entering this function */ |
fibril_switch(FIBRIL_TO_MANAGER); |
/* Futex is up automatically after fibril_switch() */ |
free(msg); |
} |
/** Setter for client_connection function pointer. |
* |
* @param conn Function that will implement a new connection fibril. |
* |
*/ |
void async_set_client_connection(async_client_conn_t conn) |
{ |
client_connection = conn; |
} |
/** Setter for interrupt_received function pointer. |
* |
* @param intr Function that will implement a new interrupt |
* notification fibril. |
*/ |
void async_set_interrupt_received(async_client_conn_t intr) |
{ |
interrupt_received = intr; |
} |
/** Pseudo-synchronous message sending - fast version. |
* |
* Send message asynchronously and return only after the reply arrives. |
* |
* This function can only transfer 4 register payload arguments. For |
* transferring more arguments, see the slower async_req_slow(). |
* |
* @param phoneid Hash of the phone through which to make the call. |
* @param method Method of the call. |
* @param arg1 Service-defined payload argument. |
* @param arg2 Service-defined payload argument. |
* @param arg3 Service-defined payload argument. |
* @param arg4 Service-defined payload argument. |
* @param r1 If non-NULL, storage for the 1st reply argument. |
* @param r2 If non-NULL, storage for the 2nd reply argument. |
* @param r3 If non-NULL, storage for the 3rd reply argument. |
* @param r4 If non-NULL, storage for the 4th reply argument. |
* @param r5 If non-NULL, storage for the 5th reply argument. |
* |
* @return Return code of the reply or a negative error code. |
* |
*/ |
ipcarg_t async_req_fast(int phoneid, ipcarg_t method, ipcarg_t arg1, |
ipcarg_t arg2, ipcarg_t arg3, ipcarg_t arg4, ipcarg_t *r1, ipcarg_t *r2, |
ipcarg_t *r3, ipcarg_t *r4, ipcarg_t *r5) |
{ |
ipc_call_t result; |
aid_t eid = async_send_4(phoneid, method, arg1, arg2, arg3, arg4, |
&result); |
ipcarg_t rc; |
async_wait_for(eid, &rc); |
if (r1) |
*r1 = IPC_GET_ARG1(result); |
if (r2) |
*r2 = IPC_GET_ARG2(result); |
if (r3) |
*r3 = IPC_GET_ARG3(result); |
if (r4) |
*r4 = IPC_GET_ARG4(result); |
if (r5) |
*r5 = IPC_GET_ARG5(result); |
return rc; |
} |
/** Pseudo-synchronous message sending - slow version. |
* |
* Send message asynchronously and return only after the reply arrives. |
* |
* @param phoneid Hash of the phone through which to make the call. |
* @param method Method of the call. |
* @param arg1 Service-defined payload argument. |
* @param arg2 Service-defined payload argument. |
* @param arg3 Service-defined payload argument. |
* @param arg4 Service-defined payload argument. |
* @param arg5 Service-defined payload argument. |
* @param r1 If non-NULL, storage for the 1st reply argument. |
* @param r2 If non-NULL, storage for the 2nd reply argument. |
* @param r3 If non-NULL, storage for the 3rd reply argument. |
* @param r4 If non-NULL, storage for the 4th reply argument. |
* @param r5 If non-NULL, storage for the 5th reply argument. |
* |
* @return Return code of the reply or a negative error code. |
* |
*/ |
ipcarg_t async_req_slow(int phoneid, ipcarg_t method, ipcarg_t arg1, |
ipcarg_t arg2, ipcarg_t arg3, ipcarg_t arg4, ipcarg_t arg5, ipcarg_t *r1, |
ipcarg_t *r2, ipcarg_t *r3, ipcarg_t *r4, ipcarg_t *r5) |
{ |
ipc_call_t result; |
aid_t eid = async_send_5(phoneid, method, arg1, arg2, arg3, arg4, arg5, |
&result); |
ipcarg_t rc; |
async_wait_for(eid, &rc); |
if (r1) |
*r1 = IPC_GET_ARG1(result); |
if (r2) |
*r2 = IPC_GET_ARG2(result); |
if (r3) |
*r3 = IPC_GET_ARG3(result); |
if (r4) |
*r4 = IPC_GET_ARG4(result); |
if (r5) |
*r5 = IPC_GET_ARG5(result); |
return rc; |
} |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/generic/errno.c |
---|
0,0 → 1,41 |
/* |
* Copyright (c) 2009 Martin Decky |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libc |
* @{ |
*/ |
/** @file |
*/ |
#include <errno.h> |
#include <fibril.h> |
int _errno; |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/generic/io/io.c |
---|
0,0 → 1,593 |
/* |
* Copyright (c) 2005 Martin Decky |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libc |
* @{ |
*/ |
/** @file |
*/ |
#include <stdio.h> |
#include <unistd.h> |
#include <fcntl.h> |
#include <assert.h> |
#include <string.h> |
#include <errno.h> |
#include <bool.h> |
#include <malloc.h> |
#include <io/klog.h> |
#include <vfs/vfs.h> |
#include <ipc/devmap.h> |
#include <adt/list.h> |
static void _fflushbuf(FILE *stream); |
static FILE stdin_null = { |
.fd = -1, |
.error = true, |
.eof = true, |
.klog = false, |
.phone = -1, |
.btype = _IONBF, |
.buf = NULL, |
.buf_size = 0, |
.buf_head = NULL |
}; |
static FILE stdout_klog = { |
.fd = -1, |
.error = false, |
.eof = false, |
.klog = true, |
.phone = -1, |
.btype = _IOLBF, |
.buf = NULL, |
.buf_size = BUFSIZ, |
.buf_head = NULL |
}; |
static FILE stderr_klog = { |
.fd = -1, |
.error = false, |
.eof = false, |
.klog = true, |
.phone = -1, |
.btype = _IONBF, |
.buf = NULL, |
.buf_size = 0, |
.buf_head = NULL |
}; |
FILE *stdin = NULL; |
FILE *stdout = NULL; |
FILE *stderr = NULL; |
static LIST_INITIALIZE(files); |
void __stdio_init(int filc, fdi_node_t *filv[]) |
{ |
if (filc > 0) { |
stdin = fopen_node(filv[0], "r"); |
} else { |
stdin = &stdin_null; |
list_append(&stdin->link, &files); |
} |
if (filc > 1) { |
stdout = fopen_node(filv[1], "w"); |
} else { |
stdout = &stdout_klog; |
list_append(&stdout->link, &files); |
} |
if (filc > 2) { |
stderr = fopen_node(filv[2], "w"); |
} else { |
stderr = &stderr_klog; |
list_append(&stderr->link, &files); |
} |
} |
void __stdio_done(void) |
{ |
link_t *link = files.next; |
while (link != &files) { |
FILE *file = list_get_instance(link, FILE, link); |
fclose(file); |
link = files.next; |
} |
} |
static bool parse_mode(const char *mode, int *flags) |
{ |
/* Parse mode except first character. */ |
const char *mp = mode; |
if (*mp++ == 0) { |
errno = EINVAL; |
return false; |
} |
if ((*mp == 'b') || (*mp == 't')) |
mp++; |
bool plus; |
if (*mp == '+') { |
mp++; |
plus = true; |
} else |
plus = false; |
if (*mp != 0) { |
errno = EINVAL; |
return false; |
} |
/* Parse first character of mode and determine flags for open(). */ |
switch (mode[0]) { |
case 'r': |
*flags = plus ? O_RDWR : O_RDONLY; |
break; |
case 'w': |
*flags = (O_TRUNC | O_CREAT) | (plus ? O_RDWR : O_WRONLY); |
break; |
case 'a': |
/* TODO: a+ must read from beginning, append to the end. */ |
if (plus) { |
errno = ENOTSUP; |
return false; |
} |
*flags = (O_APPEND | O_CREAT) | (plus ? O_RDWR : O_WRONLY); |
default: |
errno = EINVAL; |
return false; |
} |
return true; |
} |
/** Set stream buffer. */ |
void setvbuf(FILE *stream, void *buf, int mode, size_t size) |
{ |
stream->btype = mode; |
stream->buf = buf; |
stream->buf_size = size; |
stream->buf_head = stream->buf; |
} |
static void _setvbuf(FILE *stream) |
{ |
/* FIXME: Use more complex rules for setting buffering options. */ |
switch (stream->fd) { |
case 1: |
setvbuf(stream, NULL, _IOLBF, BUFSIZ); |
break; |
case 0: |
case 2: |
setvbuf(stream, NULL, _IONBF, 0); |
break; |
default: |
setvbuf(stream, NULL, _IOFBF, BUFSIZ); |
} |
} |
/** Allocate stream buffer. */ |
static int _fallocbuf(FILE *stream) |
{ |
assert(stream->buf == NULL); |
stream->buf = malloc(stream->buf_size); |
if (stream->buf == NULL) { |
errno = ENOMEM; |
return -1; |
} |
stream->buf_head = stream->buf; |
return 0; |
} |
/** Open a stream. |
* |
* @param path Path of the file to open. |
* @param mode Mode string, (r|w|a)[b|t][+]. |
* |
*/ |
FILE *fopen(const char *path, const char *mode) |
{ |
int flags; |
if (!parse_mode(mode, &flags)) |
return NULL; |
/* Open file. */ |
FILE *stream = malloc(sizeof(FILE)); |
if (stream == NULL) { |
errno = ENOMEM; |
return NULL; |
} |
stream->fd = open(path, flags, 0666); |
if (stream->fd < 0) { |
/* errno was set by open() */ |
free(stream); |
return NULL; |
} |
stream->error = false; |
stream->eof = false; |
stream->klog = false; |
stream->phone = -1; |
_setvbuf(stream); |
list_append(&stream->link, &files); |
return stream; |
} |
FILE *fdopen(int fd, const char *mode) |
{ |
/* Open file. */ |
FILE *stream = malloc(sizeof(FILE)); |
if (stream == NULL) { |
errno = ENOMEM; |
return NULL; |
} |
stream->fd = fd; |
stream->error = false; |
stream->eof = false; |
stream->klog = false; |
stream->phone = -1; |
_setvbuf(stream); |
list_append(&stream->link, &files); |
return stream; |
} |
FILE *fopen_node(fdi_node_t *node, const char *mode) |
{ |
int flags; |
if (!parse_mode(mode, &flags)) |
return NULL; |
/* Open file. */ |
FILE *stream = malloc(sizeof(FILE)); |
if (stream == NULL) { |
errno = ENOMEM; |
return NULL; |
} |
stream->fd = open_node(node, flags); |
if (stream->fd < 0) { |
/* errno was set by open_node() */ |
free(stream); |
return NULL; |
} |
stream->error = false; |
stream->eof = false; |
stream->klog = false; |
stream->phone = -1; |
_setvbuf(stream); |
list_append(&stream->link, &files); |
return stream; |
} |
int fclose(FILE *stream) |
{ |
int rc = 0; |
fflush(stream); |
if (stream->phone >= 0) |
ipc_hangup(stream->phone); |
if (stream->fd >= 0) |
rc = close(stream->fd); |
list_remove(&stream->link); |
if ((stream != &stdin_null) |
&& (stream != &stdout_klog) |
&& (stream != &stderr_klog)) |
free(stream); |
stream = NULL; |
if (rc != 0) { |
/* errno was set by close() */ |
return EOF; |
} |
return 0; |
} |
/** Read from a stream. |
* |
* @param buf Destination buffer. |
* @param size Size of each record. |
* @param nmemb Number of records to read. |
* @param stream Pointer to the stream. |
* |
*/ |
size_t fread(void *buf, size_t size, size_t nmemb, FILE *stream) |
{ |
size_t left = size * nmemb; |
size_t done = 0; |
/* Make sure no data is pending write. */ |
_fflushbuf(stream); |
while ((left > 0) && (!stream->error) && (!stream->eof)) { |
ssize_t rd = read(stream->fd, buf + done, left); |
if (rd < 0) |
stream->error = true; |
else if (rd == 0) |
stream->eof = true; |
else { |
left -= rd; |
done += rd; |
} |
} |
return (done / size); |
} |
static size_t _fwrite(const void *buf, size_t size, size_t nmemb, FILE *stream) |
{ |
size_t left = size * nmemb; |
size_t done = 0; |
while ((left > 0) && (!stream->error)) { |
ssize_t wr; |
if (stream->klog) |
wr = klog_write(buf + done, left); |
else |
wr = write(stream->fd, buf + done, left); |
if (wr <= 0) |
stream->error = true; |
else { |
left -= wr; |
done += wr; |
} |
} |
return (done / size); |
} |
/** Drain stream buffer, do not sync stream. */ |
static void _fflushbuf(FILE *stream) |
{ |
size_t bytes_used; |
if ((!stream->buf) || (stream->btype == _IONBF) || (stream->error)) |
return; |
bytes_used = stream->buf_head - stream->buf; |
if (bytes_used == 0) |
return; |
(void) _fwrite(stream->buf, 1, bytes_used, stream); |
stream->buf_head = stream->buf; |
} |
/** Write to a stream. |
* |
* @param buf Source buffer. |
* @param size Size of each record. |
* @param nmemb Number of records to write. |
* @param stream Pointer to the stream. |
* |
*/ |
size_t fwrite(const void *buf, size_t size, size_t nmemb, FILE *stream) |
{ |
uint8_t *data; |
size_t bytes_left; |
size_t now; |
size_t buf_free; |
size_t total_written; |
size_t i; |
uint8_t b; |
bool need_flush; |
/* If not buffered stream, write out directly. */ |
if (stream->btype == _IONBF) { |
now = _fwrite(buf, size, nmemb, stream); |
fflush(stream); |
return now; |
} |
/* Perform lazy allocation of stream buffer. */ |
if (stream->buf == NULL) { |
if (_fallocbuf(stream) != 0) |
return 0; /* Errno set by _fallocbuf(). */ |
} |
data = (uint8_t *) buf; |
bytes_left = size * nmemb; |
total_written = 0; |
need_flush = false; |
while ((!stream->error) && (bytes_left > 0)) { |
buf_free = stream->buf_size - (stream->buf_head - stream->buf); |
if (bytes_left > buf_free) |
now = buf_free; |
else |
now = bytes_left; |
for (i = 0; i < now; i++) { |
b = data[i]; |
stream->buf_head[i] = b; |
if ((b == '\n') && (stream->btype == _IOLBF)) |
need_flush = true; |
} |
buf += now; |
stream->buf_head += now; |
buf_free -= now; |
bytes_left -= now; |
total_written += now; |
if (buf_free == 0) { |
/* Only need to drain buffer. */ |
_fflushbuf(stream); |
need_flush = false; |
} |
} |
if (need_flush) |
fflush(stream); |
return (total_written / size); |
} |
int fputc(wchar_t c, FILE *stream) |
{ |
char buf[STR_BOUNDS(1)]; |
size_t sz = 0; |
if (chr_encode(c, buf, &sz, STR_BOUNDS(1)) == EOK) { |
size_t wr = fwrite(buf, sz, 1, stream); |
if (wr < sz) |
return EOF; |
return (int) c; |
} |
return EOF; |
} |
int putchar(wchar_t c) |
{ |
return fputc(c, stdout); |
} |
int fputs(const char *str, FILE *stream) |
{ |
return fwrite(str, str_size(str), 1, stream); |
} |
int puts(const char *str) |
{ |
return fputs(str, stdout); |
} |
int fgetc(FILE *stream) |
{ |
char c; |
/* This could be made faster by only flushing when needed. */ |
if (stdout) |
fflush(stdout); |
if (stderr) |
fflush(stderr); |
if (fread(&c, sizeof(char), 1, stream) < sizeof(char)) |
return EOF; |
return (int) c; |
} |
int getchar(void) |
{ |
return fgetc(stdin); |
} |
int fseek(FILE *stream, long offset, int origin) |
{ |
off_t rc = lseek(stream->fd, offset, origin); |
if (rc == (off_t) (-1)) { |
/* errno has been set by lseek. */ |
return -1; |
} |
stream->eof = false; |
return 0; |
} |
void rewind(FILE *stream) |
{ |
(void) fseek(stream, 0, SEEK_SET); |
} |
int fflush(FILE *stream) |
{ |
_fflushbuf(stream); |
if (stream->klog) { |
klog_update(); |
return EOK; |
} |
if (stream->fd >= 0) |
return fsync(stream->fd); |
return ENOENT; |
} |
int feof(FILE *stream) |
{ |
return stream->eof; |
} |
int ferror(FILE *stream) |
{ |
return stream->error; |
} |
int fphone(FILE *stream) |
{ |
if (stream->fd >= 0) { |
if (stream->phone < 0) |
stream->phone = fd_phone(stream->fd); |
return stream->phone; |
} |
return -1; |
} |
int fnode(FILE *stream, fdi_node_t *node) |
{ |
if (stream->fd >= 0) |
return fd_node(stream->fd, node); |
return ENOENT; |
} |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/generic/io/printf_core.c |
---|
0,0 → 1,891 |
/* |
* Copyright (c) 2001-2004 Jakub Jermar |
* Copyright (c) 2006 Josef Cejka |
* Copyright (c) 2009 Martin Decky |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup generic |
* @{ |
*/ |
/** |
* @file |
* @brief Printing functions. |
*/ |
#include <unistd.h> |
#include <stdio.h> |
#include <io/printf_core.h> |
#include <ctype.h> |
#include <string.h> |
/** show prefixes 0x or 0 */ |
#define __PRINTF_FLAG_PREFIX 0x00000001 |
/** signed / unsigned number */ |
#define __PRINTF_FLAG_SIGNED 0x00000002 |
/** print leading zeroes */ |
#define __PRINTF_FLAG_ZEROPADDED 0x00000004 |
/** align to left */ |
#define __PRINTF_FLAG_LEFTALIGNED 0x00000010 |
/** always show + sign */ |
#define __PRINTF_FLAG_SHOWPLUS 0x00000020 |
/** print space instead of plus */ |
#define __PRINTF_FLAG_SPACESIGN 0x00000040 |
/** show big characters */ |
#define __PRINTF_FLAG_BIGCHARS 0x00000080 |
/** number has - sign */ |
#define __PRINTF_FLAG_NEGATIVE 0x00000100 |
/** |
* Buffer big enough for 64-bit number printed in base 2, sign, prefix and 0 |
* to terminate string... (last one is only for better testing end of buffer by |
* zero-filling subroutine) |
*/ |
#define PRINT_NUMBER_BUFFER_SIZE (64 + 5) |
/** Enumeration of possible arguments types. |
*/ |
typedef enum { |
PrintfQualifierByte = 0, |
PrintfQualifierShort, |
PrintfQualifierInt, |
PrintfQualifierLong, |
PrintfQualifierLongLong, |
PrintfQualifierPointer |
} qualifier_t; |
static char nullstr[] = "(NULL)"; |
static char digits_small[] = "0123456789abcdef"; |
static char digits_big[] = "0123456789ABCDEF"; |
static char invalch = U_SPECIAL; |
/** Print one or more characters without adding newline. |
* |
* @param buf Buffer holding characters with size of |
* at least size bytes. NULL is not allowed! |
* @param size Size of the buffer in bytes. |
* @param ps Output method and its data. |
* |
* @return Number of characters printed. |
* |
*/ |
static int printf_putnchars(const char *buf, size_t size, |
printf_spec_t *ps) |
{ |
return ps->str_write((void *) buf, size, ps->data); |
} |
/** Print one or more wide characters without adding newline. |
* |
* @param buf Buffer holding wide characters with size of |
* at least size bytes. NULL is not allowed! |
* @param size Size of the buffer in bytes. |
* @param ps Output method and its data. |
* |
* @return Number of wide characters printed. |
* |
*/ |
static int printf_wputnchars(const wchar_t *buf, size_t size, |
printf_spec_t *ps) |
{ |
return ps->wstr_write((void *) buf, size, ps->data); |
} |
/** Print string without adding a newline. |
* |
* @param str String to print. |
* @param ps Write function specification and support data. |
* |
* @return Number of characters printed. |
* |
*/ |
static int printf_putstr(const char *str, printf_spec_t *ps) |
{ |
if (str == NULL) |
return printf_putnchars(nullstr, str_size(nullstr), ps); |
return ps->str_write((void *) str, str_size(str), ps->data); |
} |
/** Print one ASCII character. |
* |
* @param c ASCII character to be printed. |
* @param ps Output method. |
* |
* @return Number of characters printed. |
* |
*/ |
static int printf_putchar(const char ch, printf_spec_t *ps) |
{ |
if (!ascii_check(ch)) |
return ps->str_write((void *) &invalch, 1, ps->data); |
return ps->str_write(&ch, 1, ps->data); |
} |
/** Print one wide character. |
* |
* @param c Wide character to be printed. |
* @param ps Output method. |
* |
* @return Number of characters printed. |
* |
*/ |
static int printf_putwchar(const wchar_t ch, printf_spec_t *ps) |
{ |
if (!chr_check(ch)) |
return ps->str_write((void *) &invalch, 1, ps->data); |
return ps->wstr_write(&ch, sizeof(wchar_t), ps->data); |
} |
/** Print one formatted ASCII character. |
* |
* @param ch Character to print. |
* @param width Width modifier. |
* @param flags Flags that change the way the character is printed. |
* |
* @return Number of characters printed, negative value on failure. |
* |
*/ |
static int print_char(const char ch, int width, uint32_t flags, printf_spec_t *ps) |
{ |
size_t counter = 0; |
if (!(flags & __PRINTF_FLAG_LEFTALIGNED)) { |
while (--width > 0) { |
/* |
* One space is consumed by the character itself, hence |
* the predecrement. |
*/ |
if (printf_putchar(' ', ps) > 0) |
counter++; |
} |
} |
if (printf_putchar(ch, ps) > 0) |
counter++; |
while (--width > 0) { |
/* |
* One space is consumed by the character itself, hence |
* the predecrement. |
*/ |
if (printf_putchar(' ', ps) > 0) |
counter++; |
} |
return (int) (counter + 1); |
} |
/** Print one formatted wide character. |
* |
* @param ch Character to print. |
* @param width Width modifier. |
* @param flags Flags that change the way the character is printed. |
* |
* @return Number of characters printed, negative value on failure. |
* |
*/ |
static int print_wchar(const wchar_t ch, int width, uint32_t flags, printf_spec_t *ps) |
{ |
size_t counter = 0; |
if (!(flags & __PRINTF_FLAG_LEFTALIGNED)) { |
while (--width > 0) { |
/* |
* One space is consumed by the character itself, hence |
* the predecrement. |
*/ |
if (printf_putchar(' ', ps) > 0) |
counter++; |
} |
} |
if (printf_putwchar(ch, ps) > 0) |
counter++; |
while (--width > 0) { |
/* |
* One space is consumed by the character itself, hence |
* the predecrement. |
*/ |
if (printf_putchar(' ', ps) > 0) |
counter++; |
} |
return (int) (counter + 1); |
} |
/** Print string. |
* |
* @param str String to be printed. |
* @param width Width modifier. |
* @param precision Precision modifier. |
* @param flags Flags that modify the way the string is printed. |
* |
* @return Number of characters printed, negative value on failure. |
*/ |
static int print_str(char *str, int width, unsigned int precision, |
uint32_t flags, printf_spec_t *ps) |
{ |
if (str == NULL) |
return printf_putstr(nullstr, ps); |
/* Print leading spaces. */ |
size_t strw = str_length(str); |
if (precision == 0) |
precision = strw; |
/* Left padding */ |
size_t counter = 0; |
width -= precision; |
if (!(flags & __PRINTF_FLAG_LEFTALIGNED)) { |
while (width-- > 0) { |
if (printf_putchar(' ', ps) == 1) |
counter++; |
} |
} |
/* Part of @a str fitting into the alloted space. */ |
int retval; |
size_t size = str_lsize(str, precision); |
if ((retval = printf_putnchars(str, size, ps)) < 0) |
return -counter; |
counter += retval; |
/* Right padding */ |
while (width-- > 0) { |
if (printf_putchar(' ', ps) == 1) |
counter++; |
} |
return ((int) counter); |
} |
/** Print wide string. |
* |
* @param str Wide string to be printed. |
* @param width Width modifier. |
* @param precision Precision modifier. |
* @param flags Flags that modify the way the string is printed. |
* |
* @return Number of wide characters printed, negative value on failure. |
*/ |
static int print_wstr(wchar_t *str, int width, unsigned int precision, |
uint32_t flags, printf_spec_t *ps) |
{ |
if (str == NULL) |
return printf_putstr(nullstr, ps); |
/* Print leading spaces. */ |
size_t strw = wstr_length(str); |
if (precision == 0) |
precision = strw; |
/* Left padding */ |
size_t counter = 0; |
width -= precision; |
if (!(flags & __PRINTF_FLAG_LEFTALIGNED)) { |
while (width-- > 0) { |
if (printf_putchar(' ', ps) == 1) |
counter++; |
} |
} |
/* Part of @a wstr fitting into the alloted space. */ |
int retval; |
size_t size = wstr_lsize(str, precision); |
if ((retval = printf_wputnchars(str, size, ps)) < 0) |
return -counter; |
counter += retval; |
/* Right padding */ |
while (width-- > 0) { |
if (printf_putchar(' ', ps) == 1) |
counter++; |
} |
return ((int) counter); |
} |
/** Print a number in a given base. |
* |
* Print significant digits of a number in given base. |
* |
* @param num Number to print. |
* @param width Width modifier. |
* @param precision Precision modifier. |
* @param base Base to print the number in (must be between 2 and 16). |
* @param flags Flags that modify the way the number is printed. |
* |
* @return Number of characters printed. |
* |
*/ |
static int print_number(uint64_t num, int width, int precision, int base, |
uint32_t flags, printf_spec_t *ps) |
{ |
char *digits; |
if (flags & __PRINTF_FLAG_BIGCHARS) |
digits = digits_big; |
else |
digits = digits_small; |
char data[PRINT_NUMBER_BUFFER_SIZE]; |
char *ptr = &data[PRINT_NUMBER_BUFFER_SIZE - 1]; |
/* Size of number with all prefixes and signs */ |
int size = 0; |
/* Put zero at end of string */ |
*ptr-- = 0; |
if (num == 0) { |
*ptr-- = '0'; |
size++; |
} else { |
do { |
*ptr-- = digits[num % base]; |
size++; |
} while (num /= base); |
} |
/* Size of plain number */ |
int number_size = size; |
/* |
* Collect the sum of all prefixes/signs/etc. to calculate padding and |
* leading zeroes. |
*/ |
if (flags & __PRINTF_FLAG_PREFIX) { |
switch(base) { |
case 2: |
/* Binary formating is not standard, but usefull */ |
size += 2; |
break; |
case 8: |
size++; |
break; |
case 16: |
size += 2; |
break; |
} |
} |
char sgn = 0; |
if (flags & __PRINTF_FLAG_SIGNED) { |
if (flags & __PRINTF_FLAG_NEGATIVE) { |
sgn = '-'; |
size++; |
} else if (flags & __PRINTF_FLAG_SHOWPLUS) { |
sgn = '+'; |
size++; |
} else if (flags & __PRINTF_FLAG_SPACESIGN) { |
sgn = ' '; |
size++; |
} |
} |
if (flags & __PRINTF_FLAG_LEFTALIGNED) |
flags &= ~__PRINTF_FLAG_ZEROPADDED; |
/* |
* If the number is left-aligned or precision is specified then |
* padding with zeros is ignored. |
*/ |
if (flags & __PRINTF_FLAG_ZEROPADDED) { |
if ((precision == 0) && (width > size)) |
precision = width - size + number_size; |
} |
/* Print leading spaces */ |
if (number_size > precision) { |
/* Print the whole number, not only a part */ |
precision = number_size; |
} |
width -= precision + size - number_size; |
size_t counter = 0; |
if (!(flags & __PRINTF_FLAG_LEFTALIGNED)) { |
while (width-- > 0) { |
if (printf_putchar(' ', ps) == 1) |
counter++; |
} |
} |
/* Print sign */ |
if (sgn) { |
if (printf_putchar(sgn, ps) == 1) |
counter++; |
} |
/* Print prefix */ |
if (flags & __PRINTF_FLAG_PREFIX) { |
switch(base) { |
case 2: |
/* Binary formating is not standard, but usefull */ |
if (printf_putchar('0', ps) == 1) |
counter++; |
if (flags & __PRINTF_FLAG_BIGCHARS) { |
if (printf_putchar('B', ps) == 1) |
counter++; |
} else { |
if (printf_putchar('b', ps) == 1) |
counter++; |
} |
break; |
case 8: |
if (printf_putchar('o', ps) == 1) |
counter++; |
break; |
case 16: |
if (printf_putchar('0', ps) == 1) |
counter++; |
if (flags & __PRINTF_FLAG_BIGCHARS) { |
if (printf_putchar('X', ps) == 1) |
counter++; |
} else { |
if (printf_putchar('x', ps) == 1) |
counter++; |
} |
break; |
} |
} |
/* Print leading zeroes */ |
precision -= number_size; |
while (precision-- > 0) { |
if (printf_putchar('0', ps) == 1) |
counter++; |
} |
/* Print the number itself */ |
int retval; |
if ((retval = printf_putstr(++ptr, ps)) > 0) |
counter += retval; |
/* Print tailing spaces */ |
while (width-- > 0) { |
if (printf_putchar(' ', ps) == 1) |
counter++; |
} |
return ((int) counter); |
} |
/** Print formatted string. |
* |
* Print string formatted according to the fmt parameter and variadic arguments. |
* Each formatting directive must have the following form: |
* |
* \% [ FLAGS ] [ WIDTH ] [ .PRECISION ] [ TYPE ] CONVERSION |
* |
* FLAGS:@n |
* - "#" Force to print prefix. For \%o conversion, the prefix is 0, for |
* \%x and \%X prefixes are 0x and 0X and for conversion \%b the |
* prefix is 0b. |
* |
* - "-" Align to left. |
* |
* - "+" Print positive sign just as negative. |
* |
* - " " If the printed number is positive and "+" flag is not set, |
* print space in place of sign. |
* |
* - "0" Print 0 as padding instead of spaces. Zeroes are placed between |
* sign and the rest of the number. This flag is ignored if "-" |
* flag is specified. |
* |
* WIDTH:@n |
* - Specify the minimal width of a printed argument. If it is bigger, |
* width is ignored. If width is specified with a "*" character instead of |
* number, width is taken from parameter list. And integer parameter is |
* expected before parameter for processed conversion specification. If |
* this value is negative its absolute value is taken and the "-" flag is |
* set. |
* |
* PRECISION:@n |
* - Value precision. For numbers it specifies minimum valid numbers. |
* Smaller numbers are printed with leading zeroes. Bigger numbers are not |
* affected. Strings with more than precision characters are cut off. Just |
* as with width, an "*" can be used used instead of a number. An integer |
* value is then expected in parameters. When both width and precision are |
* specified using "*", the first parameter is used for width and the |
* second one for precision. |
* |
* TYPE:@n |
* - "hh" Signed or unsigned char.@n |
* - "h" Signed or unsigned short.@n |
* - "" Signed or unsigned int (default value).@n |
* - "l" Signed or unsigned long int.@n |
* If conversion is "c", the character is wchar_t (wide character).@n |
* If conversion is "s", the string is wchar_t * (wide string).@n |
* - "ll" Signed or unsigned long long int.@n |
* |
* CONVERSION:@n |
* - % Print percentile character itself. |
* |
* - c Print single character. The character is expected to be plain |
* ASCII (e.g. only values 0 .. 127 are valid).@n |
* If type is "l", then the character is expected to be wide character |
* (e.g. values 0 .. 0x10ffff are valid). |
* |
* - s Print zero terminated string. If a NULL value is passed as |
* value, "(NULL)" is printed instead.@n |
* If type is "l", then the string is expected to be wide string. |
* |
* - P, p Print value of a pointer. Void * value is expected and it is |
* printed in hexadecimal notation with prefix (as with \%#X / \%#x |
* for 32-bit or \%#X / \%#x for 64-bit long pointers). |
* |
* - b Print value as unsigned binary number. Prefix is not printed by |
* default. (Nonstandard extension.) |
* |
* - o Print value as unsigned octal number. Prefix is not printed by |
* default. |
* |
* - d, i Print signed decimal number. There is no difference between d |
* and i conversion. |
* |
* - u Print unsigned decimal number. |
* |
* - X, x Print hexadecimal number with upper- or lower-case. Prefix is |
* not printed by default. |
* |
* All other characters from fmt except the formatting directives are printed |
* verbatim. |
* |
* @param fmt Format NULL-terminated string. |
* |
* @return Number of characters printed, negative value on failure. |
* |
*/ |
int printf_core(const char *fmt, printf_spec_t *ps, va_list ap) |
{ |
size_t i; /* Index of the currently processed character from fmt */ |
size_t nxt = 0; /* Index of the next character from fmt */ |
size_t j = 0; /* Index to the first not printed nonformating character */ |
size_t counter = 0; /* Number of characters printed */ |
int retval; /* Return values from nested functions */ |
while (true) { |
i = nxt; |
wchar_t uc = str_decode(fmt, &nxt, STR_NO_LIMIT); |
if (uc == 0) |
break; |
/* Control character */ |
if (uc == '%') { |
/* Print common characters if any processed */ |
if (i > j) { |
if ((retval = printf_putnchars(&fmt[j], i - j, ps)) < 0) { |
/* Error */ |
counter = -counter; |
goto out; |
} |
counter += retval; |
} |
j = i; |
/* Parse modifiers */ |
uint32_t flags = 0; |
bool end = false; |
do { |
i = nxt; |
uc = str_decode(fmt, &nxt, STR_NO_LIMIT); |
switch (uc) { |
case '#': |
flags |= __PRINTF_FLAG_PREFIX; |
break; |
case '-': |
flags |= __PRINTF_FLAG_LEFTALIGNED; |
break; |
case '+': |
flags |= __PRINTF_FLAG_SHOWPLUS; |
break; |
case ' ': |
flags |= __PRINTF_FLAG_SPACESIGN; |
break; |
case '0': |
flags |= __PRINTF_FLAG_ZEROPADDED; |
break; |
default: |
end = true; |
}; |
} while (!end); |
/* Width & '*' operator */ |
int width = 0; |
if (isdigit(uc)) { |
while (true) { |
width *= 10; |
width += uc - '0'; |
i = nxt; |
uc = str_decode(fmt, &nxt, STR_NO_LIMIT); |
if (uc == 0) |
break; |
if (!isdigit(uc)) |
break; |
} |
} else if (uc == '*') { |
/* Get width value from argument list */ |
i = nxt; |
uc = str_decode(fmt, &nxt, STR_NO_LIMIT); |
width = (int) va_arg(ap, int); |
if (width < 0) { |
/* Negative width sets '-' flag */ |
width *= -1; |
flags |= __PRINTF_FLAG_LEFTALIGNED; |
} |
} |
/* Precision and '*' operator */ |
int precision = 0; |
if (uc == '.') { |
i = nxt; |
uc = str_decode(fmt, &nxt, STR_NO_LIMIT); |
if (isdigit(uc)) { |
while (true) { |
precision *= 10; |
precision += uc - '0'; |
i = nxt; |
uc = str_decode(fmt, &nxt, STR_NO_LIMIT); |
if (uc == 0) |
break; |
if (!isdigit(uc)) |
break; |
} |
} else if (uc == '*') { |
/* Get precision value from the argument list */ |
i = nxt; |
uc = str_decode(fmt, &nxt, STR_NO_LIMIT); |
precision = (int) va_arg(ap, int); |
if (precision < 0) { |
/* Ignore negative precision */ |
precision = 0; |
} |
} |
} |
qualifier_t qualifier; |
switch (uc) { |
/** @todo Unimplemented qualifiers: |
* t ptrdiff_t - ISO C 99 |
*/ |
case 'h': |
/* Char or short */ |
qualifier = PrintfQualifierShort; |
i = nxt; |
uc = str_decode(fmt, &nxt, STR_NO_LIMIT); |
if (uc == 'h') { |
i = nxt; |
uc = str_decode(fmt, &nxt, STR_NO_LIMIT); |
qualifier = PrintfQualifierByte; |
} |
break; |
case 'l': |
/* Long or long long */ |
qualifier = PrintfQualifierLong; |
i = nxt; |
uc = str_decode(fmt, &nxt, STR_NO_LIMIT); |
if (uc == 'l') { |
i = nxt; |
uc = str_decode(fmt, &nxt, STR_NO_LIMIT); |
qualifier = PrintfQualifierLongLong; |
} |
break; |
default: |
/* Default type */ |
qualifier = PrintfQualifierInt; |
} |
unsigned int base = 10; |
switch (uc) { |
/* |
* String and character conversions. |
*/ |
case 's': |
if (qualifier == PrintfQualifierLong) |
retval = print_wstr(va_arg(ap, wchar_t *), width, precision, flags, ps); |
else |
retval = print_str(va_arg(ap, char *), width, precision, flags, ps); |
if (retval < 0) { |
counter = -counter; |
goto out; |
} |
counter += retval; |
j = nxt; |
goto next_char; |
case 'c': |
if (qualifier == PrintfQualifierLong) |
retval = print_wchar(va_arg(ap, wchar_t), width, flags, ps); |
else |
retval = print_char(va_arg(ap, unsigned int), width, flags, ps); |
if (retval < 0) { |
counter = -counter; |
goto out; |
}; |
counter += retval; |
j = nxt; |
goto next_char; |
/* |
* Integer values |
*/ |
case 'P': |
/* Pointer */ |
flags |= __PRINTF_FLAG_BIGCHARS; |
case 'p': |
flags |= __PRINTF_FLAG_PREFIX; |
base = 16; |
qualifier = PrintfQualifierPointer; |
break; |
case 'b': |
base = 2; |
break; |
case 'o': |
base = 8; |
break; |
case 'd': |
case 'i': |
flags |= __PRINTF_FLAG_SIGNED; |
case 'u': |
break; |
case 'X': |
flags |= __PRINTF_FLAG_BIGCHARS; |
case 'x': |
base = 16; |
break; |
/* Percentile itself */ |
case '%': |
j = i; |
goto next_char; |
/* |
* Bad formatting. |
*/ |
default: |
/* |
* Unknown format. Now, j is the index of '%' |
* so we will print whole bad format sequence. |
*/ |
goto next_char; |
} |
/* Print integers */ |
size_t size; |
uint64_t number; |
switch (qualifier) { |
case PrintfQualifierByte: |
size = sizeof(unsigned char); |
number = (uint64_t) va_arg(ap, unsigned int); |
break; |
case PrintfQualifierShort: |
size = sizeof(unsigned short); |
number = (uint64_t) va_arg(ap, unsigned int); |
break; |
case PrintfQualifierInt: |
size = sizeof(unsigned int); |
number = (uint64_t) va_arg(ap, unsigned int); |
break; |
case PrintfQualifierLong: |
size = sizeof(unsigned long); |
number = (uint64_t) va_arg(ap, unsigned long); |
break; |
case PrintfQualifierLongLong: |
size = sizeof(unsigned long long); |
number = (uint64_t) va_arg(ap, unsigned long long); |
break; |
case PrintfQualifierPointer: |
size = sizeof(void *); |
number = (uint64_t) (unsigned long) va_arg(ap, void *); |
break; |
default: |
/* Unknown qualifier */ |
counter = -counter; |
goto out; |
} |
if (flags & __PRINTF_FLAG_SIGNED) { |
if (number & (0x1 << (size * 8 - 1))) { |
flags |= __PRINTF_FLAG_NEGATIVE; |
if (size == sizeof(uint64_t)) { |
number = -((int64_t) number); |
} else { |
number = ~number; |
number &= |
~(0xFFFFFFFFFFFFFFFFll << |
(size * 8)); |
number++; |
} |
} |
} |
if ((retval = print_number(number, width, precision, |
base, flags, ps)) < 0) { |
counter = -counter; |
goto out; |
} |
counter += retval; |
j = nxt; |
} |
next_char: |
; |
} |
if (i > j) { |
if ((retval = printf_putnchars(&fmt[j], i - j, ps)) < 0) { |
/* Error */ |
counter = -counter; |
goto out; |
} |
counter += retval; |
} |
out: |
return ((int) counter); |
} |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/generic/io/vprintf.c |
---|
0,0 → 1,118 |
/* |
* Copyright (c) 2006 Josef Cejka |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libc |
* @{ |
*/ |
/** @file |
*/ |
#include <stdarg.h> |
#include <stdio.h> |
#include <unistd.h> |
#include <io/printf_core.h> |
#include <futex.h> |
#include <async.h> |
#include <string.h> |
static atomic_t printf_futex = FUTEX_INITIALIZER; |
static int vprintf_str_write(const char *str, size_t size, void *stream) |
{ |
size_t wr = fwrite(str, 1, size, (FILE *) stream); |
return str_nlength(str, wr); |
} |
static int vprintf_wstr_write(const wchar_t *str, size_t size, void *stream) |
{ |
size_t offset = 0; |
size_t chars = 0; |
while (offset < size) { |
if (fputc(str[chars], (FILE *) stream) <= 0) |
break; |
chars++; |
offset += sizeof(wchar_t); |
} |
return chars; |
} |
/** Print formatted text. |
* |
* @param stream Output stream |
* @param fmt Format string |
* @param ap Format parameters |
* |
* \see For more details about format string see printf_core. |
* |
*/ |
int vfprintf(FILE *stream, const char *fmt, va_list ap) |
{ |
struct printf_spec ps = { |
vprintf_str_write, |
vprintf_wstr_write, |
stream |
}; |
/* |
* Prevent other threads to execute printf_core() |
*/ |
futex_down(&printf_futex); |
/* |
* Prevent other fibrils of the same thread |
* to execute printf_core() |
*/ |
async_serialize_start(); |
int ret = printf_core(fmt, &ps, ap); |
async_serialize_end(); |
futex_up(&printf_futex); |
return ret; |
} |
/** Print formatted text to stdout. |
* |
* @param file Output stream |
* @param fmt Format string |
* @param ap Format parameters |
* |
* \see For more details about format string see printf_core. |
* |
*/ |
int vprintf(const char *fmt, va_list ap) |
{ |
return vfprintf(stdout, fmt, ap); |
} |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/generic/io/printf.c |
---|
0,0 → 1,78 |
/* |
* Copyright (c) 2006 Josef Cejka |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libc |
* @{ |
*/ |
/** @file |
*/ |
#include <io/printf_core.h> |
#include <stdio.h> |
/** Print formatted text. |
* |
* @param stream Output stream |
* @param fmt Format string |
* |
* \see For more details about format string see printf_core. |
* |
*/ |
int fprintf(FILE *stream, const char *fmt, ...) |
{ |
va_list args; |
va_start(args, fmt); |
int ret = vfprintf(stream, fmt, args); |
va_end(args); |
return ret; |
} |
/** Print formatted text to stdout. |
* |
* @param fmt Format string |
* |
* \see For more details about format string see printf_core. |
* |
*/ |
int printf(const char *fmt, ...) |
{ |
va_list args; |
va_start(args, fmt); |
int ret = vprintf(fmt, args); |
va_end(args); |
return ret; |
} |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/generic/io/console.c |
---|
0,0 → 1,102 |
/* |
* Copyright (c) 2006 Josef Cejka |
* Copyright (c) 2006 Jakub Vana |
* Copyright (c) 2008 Jiri Svoboda |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libc |
* @{ |
*/ |
/** @file |
*/ |
#include <libc.h> |
#include <async.h> |
#include <io/console.h> |
#include <ipc/console.h> |
void console_clear(int phone) |
{ |
async_msg_0(phone, CONSOLE_CLEAR); |
} |
int console_get_size(int phone, ipcarg_t *rows, ipcarg_t *cols) |
{ |
return async_req_0_2(phone, CONSOLE_GET_SIZE, rows, cols); |
} |
void console_set_style(int phone, int style) |
{ |
async_msg_1(phone, CONSOLE_SET_STYLE, style); |
} |
void console_set_color(int phone, int fg_color, int bg_color, int flags) |
{ |
async_msg_3(phone, CONSOLE_SET_COLOR, fg_color, bg_color, flags); |
} |
void console_set_rgb_color(int phone, int fg_color, int bg_color) |
{ |
async_msg_2(phone, CONSOLE_SET_RGB_COLOR, fg_color, bg_color); |
} |
void console_cursor_visibility(int phone, bool show) |
{ |
async_msg_1(phone, CONSOLE_CURSOR_VISIBILITY, show != false); |
} |
void console_kcon_enable(int phone) |
{ |
async_msg_0(phone, CONSOLE_KCON_ENABLE); |
} |
void console_goto(int phone, ipcarg_t row, ipcarg_t col) |
{ |
async_msg_2(phone, CONSOLE_GOTO, row, col); |
} |
bool console_get_event(int phone, console_event_t *event) |
{ |
ipcarg_t type; |
ipcarg_t key; |
ipcarg_t mods; |
ipcarg_t c; |
int rc = async_req_0_4(phone, CONSOLE_GET_EVENT, &type, &key, &mods, &c); |
if (rc < 0) |
return false; |
event->type = type; |
event->key = key; |
event->mods = mods; |
event->c = c; |
return true; |
} |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/generic/io/snprintf.c |
---|
0,0 → 1,61 |
/* |
* Copyright (c) 2006 Josef Cejka |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libc |
* @{ |
*/ |
/** @file |
*/ |
#include <stdarg.h> |
#include <stdio.h> |
#include <io/printf_core.h> |
/** Print formatted to the given buffer with limited size. |
* |
* @param str Buffer |
* @param size Buffer size |
* @param fmt Format string |
* |
* \see For more details about format string see printf_core. |
* |
*/ |
int snprintf(char *str, size_t size, const char *fmt, ...) |
{ |
va_list args; |
va_start(args, fmt); |
int ret = vsnprintf(str, size, fmt, args); |
va_end(args); |
return ret; |
} |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/generic/io/asprintf.c |
---|
0,0 → 1,89 |
/* |
* Copyright (c) 2006 Josef Cejka |
* Copyright (c) 2008 Jakub Jermar |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libc |
* @{ |
*/ |
/** @file |
*/ |
#include <stdarg.h> |
#include <stdio.h> |
#include <stdlib.h> |
#include <string.h> |
#include <io/printf_core.h> |
static int asprintf_str_write(const char *str, size_t count, void *unused) |
{ |
return str_nlength(str, count); |
} |
static int asprintf_wstr_write(const wchar_t *str, size_t count, void *unused) |
{ |
return wstr_nlength(str, count); |
} |
/** Allocate and print to string. |
* |
* @param strp Address of the pointer where to store the address of |
* the newly allocated string. |
* @fmt Format string. |
* |
* @return Number of characters printed or a negative error code. |
* |
*/ |
int asprintf(char **strp, const char *fmt, ...) |
{ |
struct printf_spec ps = { |
asprintf_str_write, |
asprintf_wstr_write, |
NULL |
}; |
va_list args; |
va_start(args, fmt); |
int ret = printf_core(fmt, &ps, args); |
va_end(args); |
if (ret > 0) { |
*strp = malloc(STR_BOUNDS(ret) + 1); |
if (*strp == NULL) |
return -1; |
va_start(args, fmt); |
vsnprintf(*strp, STR_BOUNDS(ret) + 1, fmt, args); |
va_end(args); |
} |
return ret; |
} |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/generic/io/vsnprintf.c |
---|
0,0 → 1,186 |
/* |
* Copyright (c) 2006 Josef Cejka |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libc |
* @{ |
*/ |
/** @file |
*/ |
#include <stdarg.h> |
#include <stdio.h> |
#include <string.h> |
#include <io/printf_core.h> |
#include <errno.h> |
typedef struct { |
size_t size; /* Total size of the buffer (in bytes) */ |
size_t len; /* Number of already used bytes */ |
char *dst; /* Destination */ |
} vsnprintf_data_t; |
/** Write string to given buffer. |
* |
* Write at most data->size plain characters including trailing zero. |
* According to C99, snprintf() has to return number of characters that |
* would have been written if enough space had been available. Hence |
* the return value is not the number of actually printed characters |
* but size of the input string. |
* |
* @param str Source string to print. |
* @param size Number of plain characters in str. |
* @param data Structure describing destination string, counter |
* of used space and total string size. |
* |
* @return Number of characters to print (not characters actually |
* printed). |
* |
*/ |
static int vsnprintf_str_write(const char *str, size_t size, vsnprintf_data_t *data) |
{ |
size_t left = data->size - data->len; |
if (left == 0) |
return ((int) size); |
if (left == 1) { |
/* We have only one free byte left in buffer |
* -> store trailing zero |
*/ |
data->dst[data->size - 1] = 0; |
data->len = data->size; |
return ((int) size); |
} |
if (left <= size) { |
/* We do not have enough space for the whole string |
* with the trailing zero => print only a part |
* of string |
*/ |
size_t index = 0; |
while (index < size) { |
wchar_t uc = str_decode(str, &index, size); |
if (chr_encode(uc, data->dst, &data->len, data->size - 1) != EOK) |
break; |
} |
/* Put trailing zero at end, but not count it |
* into data->len so it could be rewritten next time |
*/ |
data->dst[data->len] = 0; |
return ((int) size); |
} |
/* Buffer is big enought to print the whole string */ |
memcpy((void *)(data->dst + data->len), (void *) str, size); |
data->len += size; |
/* Put trailing zero at end, but not count it |
* into data->len so it could be rewritten next time |
*/ |
data->dst[data->len] = 0; |
return ((int) size); |
} |
/** Write wide string to given buffer. |
* |
* Write at most data->size plain characters including trailing zero. |
* According to C99, snprintf() has to return number of characters that |
* would have been written if enough space had been available. Hence |
* the return value is not the number of actually printed characters |
* but size of the input string. |
* |
* @param str Source wide string to print. |
* @param size Number of bytes in str. |
* @param data Structure describing destination string, counter |
* of used space and total string size. |
* |
* @return Number of wide characters to print (not characters actually |
* printed). |
* |
*/ |
static int vsnprintf_wstr_write(const wchar_t *str, size_t size, vsnprintf_data_t *data) |
{ |
size_t index = 0; |
while (index < (size / sizeof(wchar_t))) { |
size_t left = data->size - data->len; |
if (left == 0) |
return ((int) size); |
if (left == 1) { |
/* We have only one free byte left in buffer |
* -> store trailing zero |
*/ |
data->dst[data->size - 1] = 0; |
data->len = data->size; |
return ((int) size); |
} |
if (chr_encode(str[index], data->dst, &data->len, data->size - 1) != EOK) |
break; |
index++; |
} |
/* Put trailing zero at end, but not count it |
* into data->len so it could be rewritten next time |
*/ |
data->dst[data->len] = 0; |
return ((int) size); |
} |
int vsnprintf(char *str, size_t size, const char *fmt, va_list ap) |
{ |
vsnprintf_data_t data = { |
size, |
0, |
str |
}; |
printf_spec_t ps = { |
(int(*) (const char *, size_t, void *)) vsnprintf_str_write, |
(int(*) (const wchar_t *, size_t, void *)) vsnprintf_wstr_write, |
&data |
}; |
/* Print 0 at end of string - fix the case that nothing will be printed */ |
if (size > 0) |
str[0] = 0; |
/* vsnprintf_write ensures that str will be terminated by zero. */ |
return printf_core(fmt, &ps, ap); |
} |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/generic/io/klog.c |
---|
0,0 → 1,53 |
/* |
* Copyright (c) 2006 Josef Cejka |
* Copyright (c) 2006 Jakub Vana |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libc |
* @{ |
*/ |
/** @file |
*/ |
#include <libc.h> |
#include <string.h> |
#include <sys/types.h> |
#include <unistd.h> |
#include <io/klog.h> |
size_t klog_write(const void *buf, size_t size) |
{ |
return (size_t) __SYSCALL3(SYS_KLOG, 1, (sysarg_t) buf, size); |
} |
void klog_update(void) |
{ |
(void) __SYSCALL3(SYS_KLOG, 1, NULL, 0); |
} |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/generic/mman.c |
---|
0,0 → 1,61 |
/* |
* Copyright (c) 2006 Ondrej Palkovsky |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libc |
* @{ |
*/ |
/** @file |
*/ |
#include <sys/mman.h> |
#include <sys/types.h> |
#include <as.h> |
#include <unistd.h> |
void *mmap(void *start, size_t length, int prot, int flags, int fd, |
off_t offset) |
{ |
if (!start) |
start = as_get_mappable_page(length); |
// if (!((flags & MAP_SHARED) ^ (flags & MAP_PRIVATE))) |
// return MAP_FAILED; |
if (!(flags & MAP_ANONYMOUS)) |
return MAP_FAILED; |
return as_area_create(start, length, prot); |
} |
int munmap(void *start, size_t length) |
{ |
return as_area_destroy(start); |
} |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/generic/malloc.c |
---|
0,0 → 1,457 |
/* |
* Copyright (c) 2009 Martin Decky |
* Copyright (c) 2009 Petr Tuma |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libc |
* @{ |
*/ |
/** @file |
*/ |
#include <malloc.h> |
#include <bool.h> |
#include <as.h> |
#include <align.h> |
#include <macros.h> |
#include <assert.h> |
#include <errno.h> |
#include <bitops.h> |
#include <mem.h> |
#include <adt/gcdlcm.h> |
/* Magic used in heap headers. */ |
#define HEAP_BLOCK_HEAD_MAGIC 0xBEEF0101 |
/* Magic used in heap footers. */ |
#define HEAP_BLOCK_FOOT_MAGIC 0xBEEF0202 |
/** Allocation alignment (this also covers the alignment of fields |
in the heap header and footer) */ |
#define BASE_ALIGN 16 |
/** |
* Either 4 * 256M on 32-bit architecures or 16 * 256M on 64-bit architectures |
*/ |
#define MAX_HEAP_SIZE (sizeof(uintptr_t) << 28) |
/** |
* |
*/ |
#define STRUCT_OVERHEAD (sizeof(heap_block_head_t) + sizeof(heap_block_foot_t)) |
/** |
* Calculate real size of a heap block (with header and footer) |
*/ |
#define GROSS_SIZE(size) ((size) + STRUCT_OVERHEAD) |
/** |
* Calculate net size of a heap block (without header and footer) |
*/ |
#define NET_SIZE(size) ((size) - STRUCT_OVERHEAD) |
/** Header of a heap block |
* |
*/ |
typedef struct { |
/* Size of the block (including header and footer) */ |
size_t size; |
/* Indication of a free block */ |
bool free; |
/* A magic value to detect overwrite of heap header */ |
uint32_t magic; |
} heap_block_head_t; |
/** Footer of a heap block |
* |
*/ |
typedef struct { |
/* Size of the block (including header and footer) */ |
size_t size; |
/* A magic value to detect overwrite of heap footer */ |
uint32_t magic; |
} heap_block_foot_t; |
/** Linker heap symbol */ |
extern char _heap; |
/** Address of heap start */ |
static void *heap_start = 0; |
/** Address of heap end */ |
static void *heap_end = 0; |
/** Maximum heap size */ |
static size_t max_heap_size = (size_t) -1; |
/** Current number of pages of heap area */ |
static size_t heap_pages = 0; |
/** Initialize a heap block |
* |
* Fills in the structures related to a heap block. |
* |
* @param addr Address of the block. |
* @param size Size of the block including the header and the footer. |
* @param free Indication of a free block. |
* |
*/ |
static void block_init(void *addr, size_t size, bool free) |
{ |
/* Calculate the position of the header and the footer */ |
heap_block_head_t *head = (heap_block_head_t *) addr; |
heap_block_foot_t *foot = |
(heap_block_foot_t *) (addr + size - sizeof(heap_block_foot_t)); |
head->size = size; |
head->free = free; |
head->magic = HEAP_BLOCK_HEAD_MAGIC; |
foot->size = size; |
foot->magic = HEAP_BLOCK_FOOT_MAGIC; |
} |
/** Check a heap block |
* |
* Verifies that the structures related to a heap block still contain |
* the magic constants. This helps detect heap corruption early on. |
* |
* @param addr Address of the block. |
* |
*/ |
static void block_check(void *addr) |
{ |
heap_block_head_t *head = (heap_block_head_t *) addr; |
assert(head->magic == HEAP_BLOCK_HEAD_MAGIC); |
heap_block_foot_t *foot = |
(heap_block_foot_t *) (addr + head->size - sizeof(heap_block_foot_t)); |
assert(foot->magic == HEAP_BLOCK_FOOT_MAGIC); |
assert(head->size == foot->size); |
} |
static bool grow_heap(size_t size) |
{ |
if (size == 0) |
return false; |
size_t heap_size = (size_t) (heap_end - heap_start); |
if ((max_heap_size != (size_t) -1) && (heap_size + size > max_heap_size)) |
return false; |
size_t pages = (size - 1) / PAGE_SIZE + 1; |
if (as_area_resize((void *) &_heap, (heap_pages + pages) * PAGE_SIZE, 0) |
== EOK) { |
void *end = (void *) ALIGN_DOWN(((uintptr_t) &_heap) + |
(heap_pages + pages) * PAGE_SIZE, BASE_ALIGN); |
block_init(heap_end, end - heap_end, true); |
heap_pages += pages; |
heap_end = end; |
return true; |
} |
return false; |
} |
static void shrink_heap(void) |
{ |
// TODO |
} |
/** Initialize the heap allocator |
* |
* Finds how much physical memory we have and creates |
* the heap management structures that mark the whole |
* physical memory as a single free block. |
* |
*/ |
void __heap_init(void) |
{ |
if (as_area_create((void *) &_heap, PAGE_SIZE, |
AS_AREA_WRITE | AS_AREA_READ)) { |
heap_pages = 1; |
heap_start = (void *) ALIGN_UP((uintptr_t) &_heap, BASE_ALIGN); |
heap_end = |
(void *) ALIGN_DOWN(((uintptr_t) &_heap) + PAGE_SIZE, BASE_ALIGN); |
/* Make the entire area one large block. */ |
block_init(heap_start, heap_end - heap_start, true); |
} |
} |
uintptr_t get_max_heap_addr(void) |
{ |
if (max_heap_size == (size_t) -1) |
max_heap_size = |
max((size_t) (heap_end - heap_start), MAX_HEAP_SIZE); |
return ((uintptr_t) heap_start + max_heap_size); |
} |
static void split_mark(heap_block_head_t *cur, const size_t size) |
{ |
assert(cur->size >= size); |
/* See if we should split the block. */ |
size_t split_limit = GROSS_SIZE(size); |
if (cur->size > split_limit) { |
/* Block big enough -> split. */ |
void *next = ((void *) cur) + size; |
block_init(next, cur->size - size, true); |
block_init(cur, size, false); |
} else { |
/* Block too small -> use as is. */ |
cur->free = false; |
} |
} |
/** Allocate a memory block |
* |
* @param size The size of the block to allocate. |
* @param align Memory address alignment. |
* |
* @return the address of the block or NULL when not enough memory. |
* |
*/ |
static void *malloc_internal(const size_t size, const size_t align) |
{ |
if (align == 0) |
return NULL; |
size_t falign = lcm(align, BASE_ALIGN); |
size_t real_size = GROSS_SIZE(ALIGN_UP(size, falign)); |
bool grown = false; |
void *result; |
loop: |
result = NULL; |
heap_block_head_t *cur = (heap_block_head_t *) heap_start; |
while ((result == NULL) && ((void *) cur < heap_end)) { |
block_check(cur); |
/* Try to find a block that is free and large enough. */ |
if ((cur->free) && (cur->size >= real_size)) { |
/* We have found a suitable block. |
Check for alignment properties. */ |
void *addr = ((void *) cur) + sizeof(heap_block_head_t); |
void *aligned = (void *) ALIGN_UP(addr, falign); |
if (addr == aligned) { |
/* Exact block start including alignment. */ |
split_mark(cur, real_size); |
result = addr; |
} else { |
/* Block start has to be aligned, thus |
the previous block needs to be enlarged */ |
size_t excess = (size_t) (aligned - addr); |
if (cur->size >= real_size + excess) { |
if ((void *) cur > heap_start) { |
// TODO: This can be optimized further in case |
// of expanding a previous allocated block if the |
// excess is large enought to put another free |
// block in between |
heap_block_foot_t *prev_foot = |
((void *) cur) - sizeof(heap_block_foot_t); |
heap_block_head_t *prev_head = |
(heap_block_head_t *) (((void *) cur) - prev_foot->size); |
block_check(prev_head); |
size_t reduced_size = cur->size - excess; |
cur = ((void *) cur) + excess; |
block_init(prev_head, prev_head->size + excess, prev_head->free); |
block_init(cur, reduced_size, true); |
split_mark(cur, real_size); |
result = aligned; |
} else { |
while (excess < STRUCT_OVERHEAD) { |
aligned += falign; |
excess += falign; |
} |
if (cur->size >= real_size + excess) { |
size_t reduced_size = cur->size - excess; |
cur = (heap_block_head_t *) (heap_start + excess); |
block_init(heap_start, excess, true); |
block_init(cur, reduced_size, true); |
split_mark(cur, real_size); |
result = aligned; |
} |
} |
} |
} |
} |
/* Advance to the next block. */ |
cur = (heap_block_head_t *) (((void *) cur) + cur->size); |
} |
if ((result == NULL) && (!grown)) { |
if (grow_heap(real_size)) { |
grown = true; |
goto loop; |
} |
} |
return result; |
} |
void *malloc(const size_t size) |
{ |
return malloc_internal(size, BASE_ALIGN); |
} |
void *memalign(const size_t align, const size_t size) |
{ |
if (align == 0) |
return NULL; |
size_t palign = |
1 << (fnzb(max(sizeof(void *), align) - 1) + 1); |
return malloc_internal(size, palign); |
} |
void *realloc(const void *addr, const size_t size) |
{ |
if (addr == NULL) |
return malloc(size); |
/* Calculate the position of the header. */ |
heap_block_head_t *head = |
(heap_block_head_t *) (addr - sizeof(heap_block_head_t)); |
assert((void *) head >= heap_start); |
assert((void *) head < heap_end); |
block_check(head); |
assert(!head->free); |
void *ptr = NULL; |
size_t real_size = GROSS_SIZE(size); |
size_t orig_size = head->size; |
if (orig_size > real_size) { |
/* Shrink */ |
if (orig_size - real_size >= STRUCT_OVERHEAD) { |
/* Split the original block to a full block |
and a tailing free block */ |
block_init((void *) head, real_size, false); |
block_init((void *) head + real_size, |
orig_size - real_size, true); |
shrink_heap(); |
} |
ptr = ((void *) head) + sizeof(heap_block_head_t); |
} else { |
/* Look at the next block. If it is free and the size is |
sufficient then merge the two. */ |
heap_block_head_t *next_head = |
(heap_block_head_t *) (((void *) head) + head->size); |
if (((void *) next_head < heap_end) |
&& (head->size + next_head->size >= real_size)) { |
block_check(next_head); |
block_init(head, head->size + next_head->size, false); |
split_mark(head, size); |
ptr = ((void *) head) + sizeof(heap_block_head_t); |
} else { |
ptr = malloc(size); |
if (ptr != NULL) { |
memcpy(ptr, addr, NET_SIZE(orig_size)); |
free(addr); |
} |
} |
} |
return ptr; |
} |
/** Free a memory block |
* |
* @param addr The address of the block. |
*/ |
void free(const void *addr) |
{ |
/* Calculate the position of the header. */ |
heap_block_head_t *head |
= (heap_block_head_t *) (addr - sizeof(heap_block_head_t)); |
assert((void *) head >= heap_start); |
assert((void *) head < heap_end); |
block_check(head); |
assert(!head->free); |
/* Mark the block itself as free. */ |
head->free = true; |
/* Look at the next block. If it is free, merge the two. */ |
heap_block_head_t *next_head |
= (heap_block_head_t *) (((void *) head) + head->size); |
if ((void *) next_head < heap_end) { |
block_check(next_head); |
if (next_head->free) |
block_init(head, head->size + next_head->size, true); |
} |
/* Look at the previous block. If it is free, merge the two. */ |
if ((void *) head > heap_start) { |
heap_block_foot_t *prev_foot = |
(heap_block_foot_t *) (((void *) head) - sizeof(heap_block_foot_t)); |
heap_block_head_t *prev_head = |
(heap_block_head_t *) (((void *) head) - prev_foot->size); |
block_check(prev_head); |
if (prev_head->free) |
block_init(prev_head, prev_head->size + head->size, true); |
} |
shrink_heap(); |
} |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/generic/devmap.c |
---|
0,0 → 1,289 |
/* |
* Copyright (c) 2007 Josef Cejka |
* Copyright (c) 2009 Jiri Svoboda |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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 <string.h> |
#include <ipc/ipc.h> |
#include <ipc/services.h> |
#include <ipc/devmap.h> |
#include <devmap.h> |
#include <async.h> |
#include <errno.h> |
static int devmap_phone_driver = -1; |
static int devmap_phone_client = -1; |
/** Get phone to device mapper task. */ |
int devmap_get_phone(devmap_interface_t iface, unsigned int flags) |
{ |
switch (iface) { |
case DEVMAP_DRIVER: |
if (devmap_phone_driver >= 0) |
return devmap_phone_driver; |
if (flags & IPC_FLAG_BLOCKING) |
devmap_phone_driver = ipc_connect_me_to_blocking(PHONE_NS, |
SERVICE_DEVMAP, DEVMAP_DRIVER, 0); |
else |
devmap_phone_driver = ipc_connect_me_to(PHONE_NS, |
SERVICE_DEVMAP, DEVMAP_DRIVER, 0); |
return devmap_phone_driver; |
case DEVMAP_CLIENT: |
if (devmap_phone_client >= 0) |
return devmap_phone_client; |
if (flags & IPC_FLAG_BLOCKING) |
devmap_phone_client = ipc_connect_me_to_blocking(PHONE_NS, |
SERVICE_DEVMAP, DEVMAP_CLIENT, 0); |
else |
devmap_phone_client = ipc_connect_me_to(PHONE_NS, |
SERVICE_DEVMAP, DEVMAP_CLIENT, 0); |
return devmap_phone_client; |
default: |
return -1; |
} |
} |
void devmap_hangup_phone(devmap_interface_t iface) |
{ |
switch (iface) { |
case DEVMAP_DRIVER: |
if (devmap_phone_driver >= 0) { |
ipc_hangup(devmap_phone_driver); |
devmap_phone_driver = -1; |
} |
break; |
case DEVMAP_CLIENT: |
if (devmap_phone_client >= 0) { |
ipc_hangup(devmap_phone_client); |
devmap_phone_client = -1; |
} |
break; |
default: |
break; |
} |
} |
/** Register new driver with devmap. */ |
int devmap_driver_register(const char *name, async_client_conn_t conn) |
{ |
int phone = devmap_get_phone(DEVMAP_DRIVER, IPC_FLAG_BLOCKING); |
if (phone < 0) |
return phone; |
async_serialize_start(); |
ipc_call_t answer; |
aid_t req = async_send_2(phone, DEVMAP_DRIVER_REGISTER, 0, 0, &answer); |
ipcarg_t retval = ipc_data_write_start(phone, name, str_size(name) + 1); |
if (retval != EOK) { |
async_wait_for(req, NULL); |
async_serialize_end(); |
return -1; |
} |
async_set_client_connection(conn); |
ipcarg_t callback_phonehash; |
ipc_connect_to_me(phone, 0, 0, 0, &callback_phonehash); |
async_wait_for(req, &retval); |
async_serialize_end(); |
return retval; |
} |
/** Register new device. |
* |
* @param name Device name. |
* @param handle Output: Handle to the created instance of device. |
* |
*/ |
int devmap_device_register(const char *name, dev_handle_t *handle) |
{ |
int phone = devmap_get_phone(DEVMAP_DRIVER, IPC_FLAG_BLOCKING); |
if (phone < 0) |
return phone; |
async_serialize_start(); |
ipc_call_t answer; |
aid_t req = async_send_2(phone, DEVMAP_DEVICE_REGISTER, 0, 0, |
&answer); |
ipcarg_t retval = ipc_data_write_start(phone, name, str_size(name) + 1); |
if (retval != EOK) { |
async_wait_for(req, NULL); |
async_serialize_end(); |
return retval; |
} |
async_wait_for(req, &retval); |
async_serialize_end(); |
if (retval != EOK) { |
if (handle != NULL) |
*handle = -1; |
return retval; |
} |
if (handle != NULL) |
*handle = (dev_handle_t) IPC_GET_ARG1(answer); |
return retval; |
} |
int devmap_device_get_handle(const char *name, dev_handle_t *handle, unsigned int flags) |
{ |
int phone = devmap_get_phone(DEVMAP_CLIENT, flags); |
if (phone < 0) |
return phone; |
async_serialize_start(); |
ipc_call_t answer; |
aid_t req = async_send_2(phone, DEVMAP_DEVICE_GET_HANDLE, flags, 0, |
&answer); |
ipcarg_t retval = ipc_data_write_start(phone, name, str_size(name) + 1); |
if (retval != EOK) { |
async_wait_for(req, NULL); |
async_serialize_end(); |
return retval; |
} |
async_wait_for(req, &retval); |
async_serialize_end(); |
if (retval != EOK) { |
if (handle != NULL) |
*handle = (dev_handle_t) -1; |
return retval; |
} |
if (handle != NULL) |
*handle = (dev_handle_t) IPC_GET_ARG1(answer); |
return retval; |
} |
int devmap_device_connect(dev_handle_t handle, unsigned int flags) |
{ |
int phone; |
if (flags & IPC_FLAG_BLOCKING) { |
phone = ipc_connect_me_to_blocking(PHONE_NS, SERVICE_DEVMAP, |
DEVMAP_CONNECT_TO_DEVICE, handle); |
} else { |
phone = ipc_connect_me_to(PHONE_NS, SERVICE_DEVMAP, |
DEVMAP_CONNECT_TO_DEVICE, handle); |
} |
return phone; |
} |
int devmap_null_create(void) |
{ |
int phone = devmap_get_phone(DEVMAP_CLIENT, IPC_FLAG_BLOCKING); |
if (phone < 0) |
return -1; |
ipcarg_t null_id; |
int retval = async_req_0_1(phone, DEVMAP_DEVICE_NULL_CREATE, &null_id); |
if (retval != EOK) |
return -1; |
return (int) null_id; |
} |
void devmap_null_destroy(int null_id) |
{ |
int phone = devmap_get_phone(DEVMAP_CLIENT, IPC_FLAG_BLOCKING); |
if (phone < 0) |
return; |
async_req_1_0(phone, DEVMAP_DEVICE_NULL_DESTROY, (ipcarg_t) null_id); |
} |
ipcarg_t devmap_device_get_count(void) |
{ |
int phone = devmap_get_phone(DEVMAP_CLIENT, IPC_FLAG_BLOCKING); |
if (phone < 0) |
return 0; |
ipcarg_t count; |
int retval = async_req_0_1(phone, DEVMAP_DEVICE_GET_COUNT, &count); |
if (retval != EOK) |
return 0; |
return count; |
} |
ipcarg_t devmap_device_get_devices(ipcarg_t count, dev_desc_t *data) |
{ |
int phone = devmap_get_phone(DEVMAP_CLIENT, IPC_FLAG_BLOCKING); |
if (phone < 0) |
return 0; |
async_serialize_start(); |
ipc_call_t answer; |
aid_t req = async_send_0(phone, DEVMAP_DEVICE_GET_DEVICES, &answer); |
ipcarg_t retval = ipc_data_read_start(phone, data, count * sizeof(dev_desc_t)); |
if (retval != EOK) { |
async_wait_for(req, NULL); |
async_serialize_end(); |
return 0; |
} |
async_wait_for(req, &retval); |
async_serialize_end(); |
if (retval != EOK) |
return 0; |
return IPC_GET_ARG1(answer); |
} |
//branches/snapshot/uspace/lib/libc/generic/vfs/vfs.c |
---|
0,0 → 1,652 |
/* |
* Copyright (c) 2008 Jakub Jermar |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libc |
* @{ |
*/ |
/** @file |
*/ |
#include <vfs/vfs.h> |
#include <vfs/canonify.h> |
#include <stdlib.h> |
#include <unistd.h> |
#include <dirent.h> |
#include <fcntl.h> |
#include <stdio.h> |
#include <sys/stat.h> |
#include <sys/types.h> |
#include <ipc/ipc.h> |
#include <ipc/services.h> |
#include <async.h> |
#include <atomic.h> |
#include <futex.h> |
#include <errno.h> |
#include <string.h> |
#include <devmap.h> |
#include <ipc/vfs.h> |
#include <ipc/devmap.h> |
static int vfs_phone = -1; |
static futex_t vfs_phone_futex = FUTEX_INITIALIZER; |
static futex_t cwd_futex = FUTEX_INITIALIZER; |
DIR *cwd_dir = NULL; |
char *cwd_path = NULL; |
size_t cwd_size = 0; |
char *absolutize(const char *path, size_t *retlen) |
{ |
char *ncwd_path; |
char *ncwd_path_nc; |
futex_down(&cwd_futex); |
size_t size = str_size(path); |
if (*path != '/') { |
if (!cwd_path) { |
futex_up(&cwd_futex); |
return NULL; |
} |
ncwd_path_nc = malloc(cwd_size + 1 + size + 1); |
if (!ncwd_path_nc) { |
futex_up(&cwd_futex); |
return NULL; |
} |
str_cpy(ncwd_path_nc, cwd_size + 1 + size + 1, cwd_path); |
ncwd_path_nc[cwd_size] = '/'; |
ncwd_path_nc[cwd_size + 1] = '\0'; |
} else { |
ncwd_path_nc = malloc(size + 1); |
if (!ncwd_path_nc) { |
futex_up(&cwd_futex); |
return NULL; |
} |
ncwd_path_nc[0] = '\0'; |
} |
str_append(ncwd_path_nc, cwd_size + 1 + size + 1, path); |
ncwd_path = canonify(ncwd_path_nc, retlen); |
if (!ncwd_path) { |
futex_up(&cwd_futex); |
free(ncwd_path_nc); |
return NULL; |
} |
/* |
* We need to clone ncwd_path because canonify() works in-place and thus |
* the address in ncwd_path need not be the same as ncwd_path_nc, even |
* though they both point into the same dynamically allocated buffer. |
*/ |
ncwd_path = str_dup(ncwd_path); |
free(ncwd_path_nc); |
if (!ncwd_path) { |
futex_up(&cwd_futex); |
return NULL; |
} |
futex_up(&cwd_futex); |
return ncwd_path; |
} |
static void vfs_connect(void) |
{ |
while (vfs_phone < 0) |
vfs_phone = ipc_connect_me_to_blocking(PHONE_NS, SERVICE_VFS, 0, 0); |
} |
int mount(const char *fs_name, const char *mp, const char *dev, |
const char *opts, unsigned int flags) |
{ |
int res; |
ipcarg_t rc; |
aid_t req; |
dev_handle_t dev_handle; |
res = devmap_device_get_handle(dev, &dev_handle, flags); |
if (res != EOK) |
return res; |
size_t mpa_size; |
char *mpa = absolutize(mp, &mpa_size); |
if (!mpa) |
return ENOMEM; |
futex_down(&vfs_phone_futex); |
async_serialize_start(); |
vfs_connect(); |
req = async_send_2(vfs_phone, VFS_IN_MOUNT, dev_handle, flags, NULL); |
rc = ipc_data_write_start(vfs_phone, (void *) mpa, mpa_size); |
if (rc != EOK) { |
async_wait_for(req, NULL); |
async_serialize_end(); |
futex_up(&vfs_phone_futex); |
free(mpa); |
return (int) rc; |
} |
rc = ipc_data_write_start(vfs_phone, (void *) opts, str_size(opts)); |
if (rc != EOK) { |
async_wait_for(req, NULL); |
async_serialize_end(); |
futex_up(&vfs_phone_futex); |
free(mpa); |
return (int) rc; |
} |
rc = ipc_data_write_start(vfs_phone, (void *) fs_name, str_size(fs_name)); |
if (rc != EOK) { |
async_wait_for(req, NULL); |
async_serialize_end(); |
futex_up(&vfs_phone_futex); |
free(mpa); |
return (int) rc; |
} |
/* Ask VFS whether it likes fs_name. */ |
rc = async_req_0_0(vfs_phone, IPC_M_PING); |
if (rc != EOK) { |
async_wait_for(req, NULL); |
async_serialize_end(); |
futex_up(&vfs_phone_futex); |
free(mpa); |
return (int) rc; |
} |
async_wait_for(req, &rc); |
async_serialize_end(); |
futex_up(&vfs_phone_futex); |
free(mpa); |
return (int) rc; |
} |
static int _open(const char *path, int lflag, int oflag, ...) |
{ |
ipcarg_t rc; |
ipc_call_t answer; |
aid_t req; |
size_t pa_size; |
char *pa = absolutize(path, &pa_size); |
if (!pa) |
return ENOMEM; |
futex_down(&vfs_phone_futex); |
async_serialize_start(); |
vfs_connect(); |
req = async_send_3(vfs_phone, VFS_IN_OPEN, lflag, oflag, 0, &answer); |
rc = ipc_data_write_start(vfs_phone, pa, pa_size); |
if (rc != EOK) { |
async_wait_for(req, NULL); |
async_serialize_end(); |
futex_up(&vfs_phone_futex); |
free(pa); |
return (int) rc; |
} |
async_wait_for(req, &rc); |
async_serialize_end(); |
futex_up(&vfs_phone_futex); |
free(pa); |
if (rc != EOK) |
return (int) rc; |
return (int) IPC_GET_ARG1(answer); |
} |
int open(const char *path, int oflag, ...) |
{ |
return _open(path, L_FILE, oflag); |
} |
int open_node(fdi_node_t *node, int oflag) |
{ |
futex_down(&vfs_phone_futex); |
async_serialize_start(); |
vfs_connect(); |
ipc_call_t answer; |
aid_t req = async_send_4(vfs_phone, VFS_IN_OPEN_NODE, node->fs_handle, |
node->dev_handle, node->index, oflag, &answer); |
ipcarg_t rc; |
async_wait_for(req, &rc); |
async_serialize_end(); |
futex_up(&vfs_phone_futex); |
if (rc != EOK) |
return (int) rc; |
return (int) IPC_GET_ARG1(answer); |
} |
int close(int fildes) |
{ |
ipcarg_t rc; |
futex_down(&vfs_phone_futex); |
async_serialize_start(); |
vfs_connect(); |
rc = async_req_1_0(vfs_phone, VFS_IN_CLOSE, fildes); |
async_serialize_end(); |
futex_up(&vfs_phone_futex); |
return (int)rc; |
} |
ssize_t read(int fildes, void *buf, size_t nbyte) |
{ |
ipcarg_t rc; |
ipc_call_t answer; |
aid_t req; |
futex_down(&vfs_phone_futex); |
async_serialize_start(); |
vfs_connect(); |
req = async_send_1(vfs_phone, VFS_IN_READ, fildes, &answer); |
rc = ipc_data_read_start(vfs_phone, (void *)buf, nbyte); |
if (rc != EOK) { |
async_wait_for(req, NULL); |
async_serialize_end(); |
futex_up(&vfs_phone_futex); |
return (ssize_t) rc; |
} |
async_wait_for(req, &rc); |
async_serialize_end(); |
futex_up(&vfs_phone_futex); |
if (rc == EOK) |
return (ssize_t) IPC_GET_ARG1(answer); |
else |
return rc; |
} |
ssize_t write(int fildes, const void *buf, size_t nbyte) |
{ |
ipcarg_t rc; |
ipc_call_t answer; |
aid_t req; |
futex_down(&vfs_phone_futex); |
async_serialize_start(); |
vfs_connect(); |
req = async_send_1(vfs_phone, VFS_IN_WRITE, fildes, &answer); |
rc = ipc_data_write_start(vfs_phone, (void *)buf, nbyte); |
if (rc != EOK) { |
async_wait_for(req, NULL); |
async_serialize_end(); |
futex_up(&vfs_phone_futex); |
return (ssize_t) rc; |
} |
async_wait_for(req, &rc); |
async_serialize_end(); |
futex_up(&vfs_phone_futex); |
if (rc == EOK) |
return (ssize_t) IPC_GET_ARG1(answer); |
else |
return -1; |
} |
int fsync(int fildes) |
{ |
futex_down(&vfs_phone_futex); |
async_serialize_start(); |
vfs_connect(); |
ipcarg_t rc = async_req_1_0(vfs_phone, VFS_IN_SYNC, fildes); |
async_serialize_end(); |
futex_up(&vfs_phone_futex); |
return (int) rc; |
} |
off_t lseek(int fildes, off_t offset, int whence) |
{ |
ipcarg_t rc; |
futex_down(&vfs_phone_futex); |
async_serialize_start(); |
vfs_connect(); |
ipcarg_t newoffs; |
rc = async_req_3_1(vfs_phone, VFS_IN_SEEK, fildes, offset, whence, |
&newoffs); |
async_serialize_end(); |
futex_up(&vfs_phone_futex); |
if (rc != EOK) |
return (off_t) -1; |
return (off_t) newoffs; |
} |
int ftruncate(int fildes, off_t length) |
{ |
ipcarg_t rc; |
futex_down(&vfs_phone_futex); |
async_serialize_start(); |
vfs_connect(); |
rc = async_req_2_0(vfs_phone, VFS_IN_TRUNCATE, fildes, length); |
async_serialize_end(); |
futex_up(&vfs_phone_futex); |
return (int) rc; |
} |
int fstat(int fildes, struct stat *stat) |
{ |
ipcarg_t rc; |
ipc_call_t answer; |
aid_t req; |
futex_down(&vfs_phone_futex); |
async_serialize_start(); |
vfs_connect(); |
req = async_send_1(vfs_phone, VFS_IN_FSTAT, fildes, NULL); |
rc = ipc_data_read_start(vfs_phone, (void *)stat, sizeof(struct stat)); |
if (rc != EOK) { |
async_wait_for(req, NULL); |
async_serialize_end(); |
futex_up(&vfs_phone_futex); |
return (ssize_t) rc; |
} |
async_wait_for(req, &rc); |
async_serialize_end(); |
futex_up(&vfs_phone_futex); |
return rc; |
} |
int stat(const char *path, struct stat *stat) |
{ |
ipcarg_t rc; |
aid_t req; |
size_t pa_size; |
char *pa = absolutize(path, &pa_size); |
if (!pa) |
return ENOMEM; |
futex_down(&vfs_phone_futex); |
async_serialize_start(); |
vfs_connect(); |
req = async_send_0(vfs_phone, VFS_IN_STAT, NULL); |
rc = ipc_data_write_start(vfs_phone, pa, pa_size); |
if (rc != EOK) { |
async_wait_for(req, NULL); |
async_serialize_end(); |
futex_up(&vfs_phone_futex); |
free(pa); |
return (int) rc; |
} |
rc = ipc_data_read_start(vfs_phone, stat, sizeof(struct stat)); |
if (rc != EOK) { |
async_wait_for(req, NULL); |
async_serialize_end(); |
futex_up(&vfs_phone_futex); |
free(pa); |
return (int) rc; |
} |
async_wait_for(req, &rc); |
async_serialize_end(); |
futex_up(&vfs_phone_futex); |
free(pa); |
return rc; |
} |
DIR *opendir(const char *dirname) |
{ |
DIR *dirp = malloc(sizeof(DIR)); |
if (!dirp) |
return NULL; |
dirp->fd = _open(dirname, L_DIRECTORY, 0); |
if (dirp->fd < 0) { |
free(dirp); |
return NULL; |
} |
return dirp; |
} |
struct dirent *readdir(DIR *dirp) |
{ |
ssize_t len = read(dirp->fd, &dirp->res.d_name[0], NAME_MAX + 1); |
if (len <= 0) |
return NULL; |
return &dirp->res; |
} |
void rewinddir(DIR *dirp) |
{ |
(void) lseek(dirp->fd, 0, SEEK_SET); |
} |
int closedir(DIR *dirp) |
{ |
(void) close(dirp->fd); |
free(dirp); |
return 0; |
} |
int mkdir(const char *path, mode_t mode) |
{ |
ipcarg_t rc; |
aid_t req; |
size_t pa_size; |
char *pa = absolutize(path, &pa_size); |
if (!pa) |
return ENOMEM; |
futex_down(&vfs_phone_futex); |
async_serialize_start(); |
vfs_connect(); |
req = async_send_1(vfs_phone, VFS_IN_MKDIR, mode, NULL); |
rc = ipc_data_write_start(vfs_phone, pa, pa_size); |
if (rc != EOK) { |
async_wait_for(req, NULL); |
async_serialize_end(); |
futex_up(&vfs_phone_futex); |
free(pa); |
return (int) rc; |
} |
async_wait_for(req, &rc); |
async_serialize_end(); |
futex_up(&vfs_phone_futex); |
free(pa); |
return rc; |
} |
static int _unlink(const char *path, int lflag) |
{ |
ipcarg_t rc; |
aid_t req; |
size_t pa_size; |
char *pa = absolutize(path, &pa_size); |
if (!pa) |
return ENOMEM; |
futex_down(&vfs_phone_futex); |
async_serialize_start(); |
vfs_connect(); |
req = async_send_0(vfs_phone, VFS_IN_UNLINK, NULL); |
rc = ipc_data_write_start(vfs_phone, pa, pa_size); |
if (rc != EOK) { |
async_wait_for(req, NULL); |
async_serialize_end(); |
futex_up(&vfs_phone_futex); |
free(pa); |
return (int) rc; |
} |
async_wait_for(req, &rc); |
async_serialize_end(); |
futex_up(&vfs_phone_futex); |
free(pa); |
return rc; |
} |
int unlink(const char *path) |
{ |
return _unlink(path, L_NONE); |
} |
int rmdir(const char *path) |
{ |
return _unlink(path, L_DIRECTORY); |
} |
int rename(const char *old, const char *new) |
{ |
ipcarg_t rc; |
aid_t req; |
size_t olda_size; |
char *olda = absolutize(old, &olda_size); |
if (!olda) |
return ENOMEM; |
size_t newa_size; |
char *newa = absolutize(new, &newa_size); |
if (!newa) { |
free(olda); |
return ENOMEM; |
} |
futex_down(&vfs_phone_futex); |
async_serialize_start(); |
vfs_connect(); |
req = async_send_0(vfs_phone, VFS_IN_RENAME, NULL); |
rc = ipc_data_write_start(vfs_phone, olda, olda_size); |
if (rc != EOK) { |
async_wait_for(req, NULL); |
async_serialize_end(); |
futex_up(&vfs_phone_futex); |
free(olda); |
free(newa); |
return (int) rc; |
} |
rc = ipc_data_write_start(vfs_phone, newa, newa_size); |
if (rc != EOK) { |
async_wait_for(req, NULL); |
async_serialize_end(); |
futex_up(&vfs_phone_futex); |
free(olda); |
free(newa); |
return (int) rc; |
} |
async_wait_for(req, &rc); |
async_serialize_end(); |
futex_up(&vfs_phone_futex); |
free(olda); |
free(newa); |
return rc; |
} |
int chdir(const char *path) |
{ |
size_t pa_size; |
char *pa = absolutize(path, &pa_size); |
if (!pa) |
return ENOMEM; |
DIR *d = opendir(pa); |
if (!d) { |
free(pa); |
return ENOENT; |
} |
futex_down(&cwd_futex); |
if (cwd_dir) { |
closedir(cwd_dir); |
cwd_dir = NULL; |
free(cwd_path); |
cwd_path = NULL; |
cwd_size = 0; |
} |
cwd_dir = d; |
cwd_path = pa; |
cwd_size = pa_size; |
futex_up(&cwd_futex); |
return EOK; |
} |
char *getcwd(char *buf, size_t size) |
{ |
if (!size) |
return NULL; |
futex_down(&cwd_futex); |
if (size < cwd_size + 1) { |
futex_up(&cwd_futex); |
return NULL; |
} |
str_cpy(buf, size, cwd_path); |
futex_up(&cwd_futex); |
return buf; |
} |
int fd_phone(int fildes) |
{ |
struct stat stat; |
int rc; |
rc = fstat(fildes, &stat); |
if (!stat.devfs_stat.device) |
return -1; |
return devmap_device_connect(stat.devfs_stat.device, 0); |
} |
int fd_node(int fildes, fdi_node_t *node) |
{ |
struct stat stat; |
int rc; |
rc = fstat(fildes, &stat); |
if (rc == EOK) { |
node->fs_handle = stat.fs_handle; |
node->dev_handle = stat.dev_handle; |
node->index = stat.index; |
} |
return rc; |
} |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/generic/vfs/canonify.c |
---|
0,0 → 1,341 |
/* |
* Copyright (c) 2008 Jakub Jermar |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libc |
* @{ |
*/ |
/** |
* @file |
* @brief |
*/ |
#include <stdlib.h> |
#include <vfs/canonify.h> |
/** Token types used for tokenization of path. */ |
typedef enum { |
TK_INVALID, |
TK_SLASH, |
TK_DOT, |
TK_DOTDOT, |
TK_COMP, |
TK_NUL |
} tokval_t; |
typedef struct { |
tokval_t kind; |
char *start; |
char *stop; |
} token_t; |
/** Fake up the TK_SLASH token. */ |
static token_t slash_token(char *start) |
{ |
token_t ret; |
ret.kind = TK_SLASH; |
ret.start = start; |
ret.stop = start; |
return ret; |
} |
/** Given a token, return the next token. */ |
static token_t next_token(token_t *cur) |
{ |
token_t ret; |
if (cur->stop[1] == '\0') { |
ret.kind = TK_NUL; |
ret.start = cur->stop + 1; |
ret.stop = ret.start; |
return ret; |
} |
if (cur->stop[1] == '/') { |
ret.kind = TK_SLASH; |
ret.start = cur->stop + 1; |
ret.stop = ret.start; |
return ret; |
} |
if (cur->stop[1] == '.' && (!cur->stop[2] || cur->stop[2] == '/')) { |
ret.kind = TK_DOT; |
ret.start = cur->stop + 1; |
ret.stop = ret.start; |
return ret; |
} |
if (cur->stop[1] == '.' && cur->stop[2] == '.' && |
(!cur->stop[3] || cur->stop[3] == '/')) { |
ret.kind = TK_DOTDOT; |
ret.start = cur->stop + 1; |
ret.stop = cur->stop + 2; |
return ret; |
} |
unsigned i; |
for (i = 1; cur->stop[i] && cur->stop[i] != '/'; i++) |
; |
ret.kind = TK_COMP; |
ret.start = &cur->stop[1]; |
ret.stop = &cur->stop[i - 1]; |
return ret; |
} |
/** States used by canonify(). */ |
typedef enum { |
S_INI, |
S_A, |
S_B, |
S_C, |
S_ACCEPT, |
S_RESTART, |
S_REJECT |
} state_t; |
typedef struct { |
state_t s; |
void (* f)(token_t *, token_t *, token_t *); |
} change_state_t; |
/* |
* Actions that can be performed when transitioning from one |
* state of canonify() to another. |
*/ |
static void set_first_slash(token_t *t, token_t *tfsl, token_t *tlcomp) |
{ |
*tfsl = *t; |
*tlcomp = *t; |
} |
static void save_component(token_t *t, token_t *tfsl, token_t *tlcomp) |
{ |
*tlcomp = *t; |
} |
static void terminate_slash(token_t *t, token_t *tfsl, token_t *tlcomp) |
{ |
if (tfsl->stop[1]) /* avoid writing to a well-formatted path */ |
tfsl->stop[1] = '\0'; |
} |
static void remove_trailing_slash(token_t *t, token_t *tfsl, token_t *tlcomp) |
{ |
t->start[-1] = '\0'; |
} |
/** Eat the extra '/'.. |
* |
* @param t The current TK_SLASH token. |
*/ |
static void shift_slash(token_t *t, token_t *tfsl, token_t *tlcomp) |
{ |
char *p = t->start; |
char *q = t->stop + 1; |
while ((*p++ = *q++)) |
; |
} |
/** Eat the extra '.'. |
* |
* @param t The current TK_DOT token. |
*/ |
static void shift_dot(token_t *t, token_t *tfsl, token_t *tlcomp) |
{ |
char *p = t->start; |
char *q = t->stop + 1; |
while ((*p++ = *q++)) |
; |
} |
/** Collapse the TK_COMP TK_SLASH TK_DOTDOT pattern. |
* |
* @param t The current TK_DOTDOT token. |
* @param tlcomp The last TK_COMP token. |
*/ |
static void shift_dotdot(token_t *t, token_t *tfsl, token_t *tlcomp) |
{ |
char *p = tlcomp->start; |
char *q = t->stop + 1; |
while ((*p++ = *q++)) |
; |
} |
/** Transition function for canonify(). */ |
static change_state_t trans[4][6] = { |
[S_INI] = { |
[TK_SLASH] = { |
.s = S_A, |
.f = set_first_slash, |
}, |
[TK_DOT] = { |
.s = S_REJECT, |
.f = NULL, |
}, |
[TK_DOTDOT] = { |
.s = S_REJECT, |
.f = NULL, |
}, |
[TK_COMP] = { |
.s = S_REJECT, |
.f = NULL, |
}, |
[TK_NUL] = { |
.s = S_REJECT, |
.f = NULL, |
}, |
[TK_INVALID] = { |
.s = S_REJECT, |
.f = NULL, |
}, |
}, |
[S_A] = { |
[TK_SLASH] = { |
.s = S_A, |
.f = set_first_slash, |
}, |
[TK_DOT] = { |
.s = S_A, |
.f = NULL, |
}, |
[TK_DOTDOT] = { |
.s = S_A, |
.f = NULL, |
}, |
[TK_COMP] = { |
.s = S_B, |
.f = save_component, |
}, |
[TK_NUL] = { |
.s = S_ACCEPT, |
.f = terminate_slash, |
}, |
[TK_INVALID] = { |
.s = S_REJECT, |
.f = NULL, |
}, |
}, |
[S_B] = { |
[TK_SLASH] = { |
.s = S_C, |
.f = NULL, |
}, |
[TK_DOT] = { |
.s = S_REJECT, |
.f = NULL, |
}, |
[TK_DOTDOT] = { |
.s = S_REJECT, |
.f = NULL, |
}, |
[TK_COMP] = { |
.s = S_REJECT, |
.f = NULL, |
}, |
[TK_NUL] = { |
.s = S_ACCEPT, |
.f = NULL, |
}, |
[TK_INVALID] = { |
.s = S_REJECT, |
.f = NULL, |
}, |
}, |
[S_C] = { |
[TK_SLASH] = { |
.s = S_RESTART, |
.f = shift_slash, |
}, |
[TK_DOT] = { |
.s = S_RESTART, |
.f = shift_dot, |
}, |
[TK_DOTDOT] = { |
.s = S_RESTART, |
.f = shift_dotdot, |
}, |
[TK_COMP] = { |
.s = S_B, |
.f = save_component, |
}, |
[TK_NUL] = { |
.s = S_ACCEPT, |
.f = remove_trailing_slash, |
}, |
[TK_INVALID] = { |
.s = S_REJECT, |
.f = NULL, |
}, |
} |
}; |
/** Canonify a file system path. |
* |
* A file system path is canonical, if the following holds: |
* 1) the path is absolute (i.e. a/b/c is not canonical) |
* 2) there is no trailing slash in the path (i.e. /a/b/c is not canonical) |
* 3) there is no extra slash in the path (i.e. /a//b/c is not canonical) |
* 4) there is no '.' component in the path (i.e. /a/./b/c is not canonical) |
* 5) there is no '..' component in the path (i.e. /a/b/../c is not canonical) |
* |
* This function makes a potentially non-canonical file system path canonical. |
* It works in-place and requires a NULL-terminated input string. |
* |
* @param path Path to be canonified. |
* @param lenp Pointer where the length of the final path will be |
* stored. Can be NULL. |
* |
* @return Canonified path or NULL on failure. |
*/ |
char *canonify(char *path, size_t *lenp) |
{ |
state_t state; |
token_t t; |
token_t tfsl; /* first slash */ |
token_t tlcomp; /* last component */ |
if (*path != '/') |
return NULL; |
tfsl = slash_token(path); |
restart: |
state = S_INI; |
t = tfsl; |
tlcomp = tfsl; |
while (state != S_ACCEPT && state != S_RESTART && state != S_REJECT) { |
if (trans[state][t.kind].f) |
trans[state][t.kind].f(&t, &tfsl, &tlcomp); |
state = trans[state][t.kind].s; |
t = next_token(&t); |
} |
switch (state) { |
case S_RESTART: |
goto restart; |
case S_REJECT: |
return NULL; |
case S_ACCEPT: |
if (lenp) |
*lenp = (size_t)((tlcomp.stop - tfsl.start) + 1); |
return tfsl.start; |
default: |
abort(); |
} |
} |
/** |
* @} |
*/ |
//branches/snapshot/uspace/lib/libc/generic/fibril_sync.c |
---|
0,0 → 1,219 |
/* |
* Copyright (c) 2009 Jakub Jermar |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libc |
* @{ |
*/ |
/** @file |
*/ |
#include <fibril_sync.h> |
#include <fibril.h> |
#include <async.h> |
#include <adt/list.h> |
#include <futex.h> |
#include <assert.h> |
void fibril_mutex_initialize(fibril_mutex_t *fm) |
{ |
fm->counter = 1; |
list_initialize(&fm->waiters); |
} |
void fibril_mutex_lock(fibril_mutex_t *fm) |
{ |
futex_down(&async_futex); |
if (fm->counter-- <= 0) { |
fibril_t *f = (fibril_t *) fibril_get_id(); |
list_append(&f->link, &fm->waiters); |
fibril_switch(FIBRIL_TO_MANAGER); |
} else { |
futex_up(&async_futex); |
} |
} |
bool fibril_mutex_trylock(fibril_mutex_t *fm) |
{ |
bool locked = false; |
futex_down(&async_futex); |
if (fm->counter > 0) { |
fm->counter--; |
locked = true; |
} |
futex_up(&async_futex); |
return locked; |
} |
static void _fibril_mutex_unlock_unsafe(fibril_mutex_t *fm) |
{ |
assert(fm->counter <= 0); |
if (fm->counter++ < 0) { |
link_t *tmp; |
fibril_t *f; |
assert(!list_empty(&fm->waiters)); |
tmp = fm->waiters.next; |
f = list_get_instance(tmp, fibril_t, link); |
list_remove(&f->link); |
fibril_add_ready((fid_t) f); |
} |
} |
void fibril_mutex_unlock(fibril_mutex_t *fm) |
{ |
futex_down(&async_futex); |
_fibril_mutex_unlock_unsafe(fm); |
futex_up(&async_futex); |
} |
void fibril_rwlock_initialize(fibril_rwlock_t *frw) |
{ |
frw->writers = 0; |
frw->readers = 0; |
list_initialize(&frw->waiters); |
} |
void fibril_rwlock_read_lock(fibril_rwlock_t *frw) |
{ |
futex_down(&async_futex); |
if (frw->writers) { |
fibril_t *f = (fibril_t *) fibril_get_id(); |
f->flags &= ~FIBRIL_WRITER; |
list_append(&f->link, &frw->waiters); |
fibril_switch(FIBRIL_TO_MANAGER); |
} else { |
frw->readers++; |
futex_up(&async_futex); |
} |
} |
void fibril_rwlock_write_lock(fibril_rwlock_t *frw) |
{ |
futex_down(&async_futex); |
if (frw->writers || frw->readers) { |
fibril_t *f = (fibril_t *) fibril_get_id(); |
f->flags |= FIBRIL_WRITER; |
list_append(&f->link, &frw->waiters); |
fibril_switch(FIBRIL_TO_MANAGER); |
} else { |
frw->writers++; |
futex_up(&async_futex); |
} |
} |
static void _fibril_rwlock_common_unlock(fibril_rwlock_t *frw) |
{ |
futex_down(&async_futex); |
assert(frw->readers || (frw->writers == 1)); |
if (frw->readers) { |
if (--frw->readers) |
goto out; |
} else { |
frw->writers--; |
} |
assert(!frw->readers && !frw->writers); |
while (!list_empty(&frw->waiters)) { |
link_t *tmp = frw->waiters.next; |
fibril_t *f = list_get_instance(tmp, fibril_t, link); |
if (f->flags & FIBRIL_WRITER) { |
if (frw->readers) |
break; |
list_remove(&f->link); |
fibril_add_ready((fid_t) f); |
frw->writers++; |
break; |
} else { |
list_remove(&f->link); |
fibril_add_ready((fid_t) f); |
frw->readers++; |
} |
} |
out: |
futex_up(&async_futex); |
} |
void fibril_rwlock_read_unlock(fibril_rwlock_t *frw) |
{ |
_fibril_rwlock_common_unlock(frw); |
} |
void fibril_rwlock_write_unlock(fibril_rwlock_t *frw) |
{ |
_fibril_rwlock_common_unlock(frw); |
} |
void fibril_condvar_initialize(fibril_condvar_t *fcv) |
{ |
list_initialize(&fcv->waiters); |
} |
void fibril_condvar_wait(fibril_condvar_t *fcv, fibril_mutex_t *fm) |
{ |
fibril_t *f = (fibril_t *) fibril_get_id(); |
futex_down(&async_futex); |
list_append(&f->link, &fcv->waiters); |
_fibril_mutex_unlock_unsafe(fm); |
fibril_switch(FIBRIL_TO_MANAGER); |
fibril_mutex_lock(fm); |
} |
static void _fibril_condvar_wakeup_common(fibril_condvar_t *fcv, bool once) |
{ |
link_t *tmp; |
fibril_t *f; |
futex_down(&async_futex); |
while (!list_empty(&fcv->waiters)) { |
tmp = fcv->waiters.next; |
f = list_get_instance(tmp, fibril_t, link); |
list_remove(&f->link); |
fibril_add_ready((fid_t) f); |
if (once) |
break; |
} |
futex_up(&async_futex); |
} |
void fibril_condvar_signal(fibril_condvar_t *fcv) |
{ |
_fibril_condvar_wakeup_common(fcv, true); |
} |
void fibril_condvar_broadcast(fibril_condvar_t *fcv) |
{ |
_fibril_condvar_wakeup_common(fcv, false); |
} |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/generic/fibril.c |
---|
0,0 → 1,348 |
/* |
* Copyright (c) 2006 Ondrej Palkovsky |
* Copyright (c) 2007 Jakub Jermar |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libc |
* @{ |
*/ |
/** @file |
*/ |
#include <adt/list.h> |
#include <fibril.h> |
#include <thread.h> |
#include <tls.h> |
#include <malloc.h> |
#include <unistd.h> |
#include <stdio.h> |
#include <libarch/faddr.h> |
#include <futex.h> |
#include <assert.h> |
#include <async.h> |
#ifndef FIBRIL_INITIAL_STACK_PAGES_NO |
#define FIBRIL_INITIAL_STACK_PAGES_NO 1 |
#endif |
/** |
* This futex serializes access to ready_list, serialized_list and manager_list. |
*/ |
static atomic_t fibril_futex = FUTEX_INITIALIZER; |
static LIST_INITIALIZE(ready_list); |
static LIST_INITIALIZE(serialized_list); |
static LIST_INITIALIZE(manager_list); |
static void fibril_main(void); |
/** Number of threads that are executing a manager fibril. */ |
static int threads_in_manager; |
/** Number of threads that are executing a manager fibril and are serialized. */ |
static int serialized_threads; /* Protected by async_futex */ |
/** Fibril-local count of serialization. If > 0, we must not preempt */ |
static fibril_local int serialization_count; |
/** Setup fibril information into TCB structure */ |
fibril_t *fibril_setup(void) |
{ |
fibril_t *f; |
tcb_t *tcb; |
tcb = __make_tls(); |
if (!tcb) |
return NULL; |
f = malloc(sizeof(fibril_t)); |
if (!f) { |
__free_tls(tcb); |
return NULL; |
} |
tcb->fibril_data = f; |
f->tcb = tcb; |
f->func = NULL; |
f->arg = NULL; |
f->stack = NULL; |
f->clean_after_me = NULL; |
f->retval = 0; |
f->flags = 0; |
return f; |
} |
void fibril_teardown(fibril_t *f) |
{ |
__free_tls(f->tcb); |
free(f); |
} |
/** Function that spans the whole life-cycle of a fibril. |
* |
* Each fibril begins execution in this function. Then the function implementing |
* the fibril logic is called. After its return, the return value is saved. |
* The fibril then switches to another fibril, which cleans up after it. |
*/ |
void fibril_main(void) |
{ |
fibril_t *f = __tcb_get()->fibril_data; |
/* Call the implementing function. */ |
f->retval = f->func(f->arg); |
fibril_switch(FIBRIL_FROM_DEAD); |
/* not reached */ |
} |
/** Switch from the current fibril. |
* |
* If calling with FIBRIL_TO_MANAGER parameter, the async_futex should be |
* held. |
* |
* @param stype Switch type. One of FIBRIL_PREEMPT, FIBRIL_TO_MANAGER, |
* FIBRIL_FROM_MANAGER, FIBRIL_FROM_DEAD. The parameter |
* describes the circumstances of the switch. |
* @return Return 0 if there is no ready fibril, |
* return 1 otherwise. |
*/ |
int fibril_switch(fibril_switch_type_t stype) |
{ |
fibril_t *srcf, *dstf; |
int retval = 0; |
futex_down(&fibril_futex); |
if (stype == FIBRIL_PREEMPT && list_empty(&ready_list)) |
goto ret_0; |
if (stype == FIBRIL_FROM_MANAGER) { |
if (list_empty(&ready_list) && list_empty(&serialized_list)) |
goto ret_0; |
/* |
* Do not preempt if there is not enough threads to run the |
* ready fibrils which are not serialized. |
*/ |
if (list_empty(&serialized_list) && |
threads_in_manager <= serialized_threads) { |
goto ret_0; |
} |
} |
/* If we are going to manager and none exists, create it */ |
if (stype == FIBRIL_TO_MANAGER || stype == FIBRIL_FROM_DEAD) { |
while (list_empty(&manager_list)) { |
futex_up(&fibril_futex); |
async_create_manager(); |
futex_down(&fibril_futex); |
} |
} |
srcf = __tcb_get()->fibril_data; |
if (stype != FIBRIL_FROM_DEAD) { |
/* Save current state */ |
if (!context_save(&srcf->ctx)) { |
if (serialization_count) |
srcf->flags &= ~FIBRIL_SERIALIZED; |
if (srcf->clean_after_me) { |
/* |
* Cleanup after the dead fibril from which we |
* restored context here. |
*/ |
void *stack = srcf->clean_after_me->stack; |
if (stack) { |
/* |
* This check is necessary because a |
* thread could have exited like a |
* normal fibril using the |
* FIBRIL_FROM_DEAD switch type. In that |
* case, its fibril will not have the |
* stack member filled. |
*/ |
free(stack); |
} |
fibril_teardown(srcf->clean_after_me); |
srcf->clean_after_me = NULL; |
} |
return 1; /* futex_up already done here */ |
} |
/* Save myself to the correct run list */ |
if (stype == FIBRIL_PREEMPT) |
list_append(&srcf->link, &ready_list); |
else if (stype == FIBRIL_FROM_MANAGER) { |
list_append(&srcf->link, &manager_list); |
threads_in_manager--; |
} else { |
/* |
* If stype == FIBRIL_TO_MANAGER, don't put ourselves to |
* any list, we should already be somewhere, or we will |
* be lost. |
*/ |
} |
} |
/* Choose a new fibril to run */ |
if (stype == FIBRIL_TO_MANAGER || stype == FIBRIL_FROM_DEAD) { |
dstf = list_get_instance(manager_list.next, fibril_t, link); |
if (serialization_count && stype == FIBRIL_TO_MANAGER) { |
serialized_threads++; |
srcf->flags |= FIBRIL_SERIALIZED; |
} |
threads_in_manager++; |
if (stype == FIBRIL_FROM_DEAD) |
dstf->clean_after_me = srcf; |
} else { |
if (!list_empty(&serialized_list)) { |
dstf = list_get_instance(serialized_list.next, fibril_t, |
link); |
serialized_threads--; |
} else { |
dstf = list_get_instance(ready_list.next, fibril_t, |
link); |
} |
} |
list_remove(&dstf->link); |
futex_up(&fibril_futex); |
context_restore(&dstf->ctx); |
/* not reached */ |
ret_0: |
futex_up(&fibril_futex); |
return retval; |
} |
/** Create a new fibril. |
* |
* @param func Implementing function of the new fibril. |
* @param arg Argument to pass to func. |
* |
* @return Return 0 on failure or TLS of the new fibril. |
*/ |
fid_t fibril_create(int (*func)(void *), void *arg) |
{ |
fibril_t *f; |
f = fibril_setup(); |
if (!f) |
return 0; |
f->stack = (char *) malloc(FIBRIL_INITIAL_STACK_PAGES_NO * |
getpagesize()); |
if (!f->stack) { |
fibril_teardown(f); |
return 0; |
} |
f->func = func; |
f->arg = arg; |
context_save(&f->ctx); |
context_set(&f->ctx, FADDR(fibril_main), f->stack, |
FIBRIL_INITIAL_STACK_PAGES_NO * getpagesize(), f->tcb); |
return (fid_t) f; |
} |
/** Add a fibril to the ready list. |
* |
* @param fid Pointer to the fibril structure of the fibril to be |
* added. |
*/ |
void fibril_add_ready(fid_t fid) |
{ |
fibril_t *f; |
f = (fibril_t *) fid; |
futex_down(&fibril_futex); |
if ((f->flags & FIBRIL_SERIALIZED)) |
list_append(&f->link, &serialized_list); |
else |
list_append(&f->link, &ready_list); |
futex_up(&fibril_futex); |
} |
/** Add a fibril to the manager list. |
* |
* @param fid Pointer to the fibril structure of the fibril to be |
* added. |
*/ |
void fibril_add_manager(fid_t fid) |
{ |
fibril_t *f; |
f = (fibril_t *) fid; |
futex_down(&fibril_futex); |
list_append(&f->link, &manager_list); |
futex_up(&fibril_futex); |
} |
/** Remove one manager from the manager list. */ |
void fibril_remove_manager(void) |
{ |
futex_down(&fibril_futex); |
if (list_empty(&manager_list)) { |
futex_up(&fibril_futex); |
return; |
} |
list_remove(manager_list.next); |
futex_up(&fibril_futex); |
} |
/** Return fibril id of the currently running fibril. |
* |
* @return fibril ID of the currently running fibril. |
* |
*/ |
fid_t fibril_get_id(void) |
{ |
return (fid_t) __tcb_get()->fibril_data; |
} |
/** Disable preemption |
* |
* If the fibril wants to send several message in a row and does not want to be |
* preempted, it should start async_serialize_start() in the beginning of |
* communication and async_serialize_end() in the end. If it is a true |
* multithreaded application, it should protect the communication channel by a |
* futex as well. |
* |
*/ |
void fibril_inc_sercount(void) |
{ |
serialization_count++; |
} |
/** Restore the preemption counter to the previous state. */ |
void fibril_dec_sercount(void) |
{ |
serialization_count--; |
} |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/generic/ipc.c |
---|
0,0 → 1,967 |
/* |
* Copyright (c) 2006 Ondrej Palkovsky |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libc |
* @{ |
* @} |
*/ |
/** @addtogroup libcipc IPC |
* @brief HelenOS uspace IPC |
* @{ |
* @ingroup libc |
*/ |
/** @file |
*/ |
#include <ipc/ipc.h> |
#include <libc.h> |
#include <malloc.h> |
#include <errno.h> |
#include <adt/list.h> |
#include <stdio.h> |
#include <unistd.h> |
#include <futex.h> |
#include <kernel/synch/synch.h> |
#include <async.h> |
#include <fibril.h> |
#include <assert.h> |
/** |
* Structures of this type are used for keeping track of sent asynchronous calls |
* and queing unsent calls. |
*/ |
typedef struct { |
link_t list; |
ipc_async_callback_t callback; |
void *private; |
union { |
ipc_callid_t callid; |
struct { |
ipc_call_t data; |
int phoneid; |
} msg; |
} u; |
fid_t fid; /**< Fibril waiting for sending this call. */ |
} async_call_t; |
LIST_INITIALIZE(dispatched_calls); |
/** List of asynchronous calls that were not accepted by kernel. |
* |
* It is protected by async_futex, because if the call cannot be sent into the |
* kernel, the async framework is used automatically. |
*/ |
LIST_INITIALIZE(queued_calls); |
static atomic_t ipc_futex = FUTEX_INITIALIZER; |
/** Make a fast synchronous call. |
* |
* Only three payload arguments can be passed using this function. However, this |
* function is faster than the generic ipc_call_sync_slow() because the payload |
* is passed directly in registers. |
* |
* @param phoneid Phone handle for the call. |
* @param method Requested method. |
* @param arg1 Service-defined payload argument. |
* @param arg2 Service-defined payload argument. |
* @param arg3 Service-defined payload argument. |
* @param result1 If non-NULL, the return ARG1 will be stored there. |
* @param result2 If non-NULL, the return ARG2 will be stored there. |
* @param result3 If non-NULL, the return ARG3 will be stored there. |
* @param result4 If non-NULL, the return ARG4 will be stored there. |
* @param result5 If non-NULL, the return ARG5 will be stored there. |
* |
* @return Negative values represent errors returned by IPC. |
* Otherwise the RETVAL of the answer is returned. |
*/ |
int |
ipc_call_sync_fast(int phoneid, ipcarg_t method, ipcarg_t arg1, ipcarg_t arg2, |
ipcarg_t arg3, ipcarg_t *result1, ipcarg_t *result2, ipcarg_t *result3, |
ipcarg_t *result4, ipcarg_t *result5) |
{ |
ipc_call_t resdata; |
int callres; |
callres = __SYSCALL6(SYS_IPC_CALL_SYNC_FAST, phoneid, method, arg1, |
arg2, arg3, (sysarg_t) &resdata); |
if (callres) |
return callres; |
if (result1) |
*result1 = IPC_GET_ARG1(resdata); |
if (result2) |
*result2 = IPC_GET_ARG2(resdata); |
if (result3) |
*result3 = IPC_GET_ARG3(resdata); |
if (result4) |
*result4 = IPC_GET_ARG4(resdata); |
if (result5) |
*result5 = IPC_GET_ARG5(resdata); |
return IPC_GET_RETVAL(resdata); |
} |
/** Make a synchronous call transmitting 5 arguments of payload. |
* |
* @param phoneid Phone handle for the call. |
* @param method Requested method. |
* @param arg1 Service-defined payload argument. |
* @param arg2 Service-defined payload argument. |
* @param arg3 Service-defined payload argument. |
* @param arg4 Service-defined payload argument. |
* @param arg5 Service-defined payload argument. |
* @param result1 If non-NULL, storage for the first return argument. |
* @param result2 If non-NULL, storage for the second return argument. |
* @param result3 If non-NULL, storage for the third return argument. |
* @param result4 If non-NULL, storage for the fourth return argument. |
* @param result5 If non-NULL, storage for the fifth return argument. |
* |
* @return Negative value means IPC error. |
* Otherwise the RETVAL of the answer. |
*/ |
int |
ipc_call_sync_slow(int phoneid, ipcarg_t method, ipcarg_t arg1, ipcarg_t arg2, |
ipcarg_t arg3, ipcarg_t arg4, ipcarg_t arg5, ipcarg_t *result1, |
ipcarg_t *result2, ipcarg_t *result3, ipcarg_t *result4, ipcarg_t *result5) |
{ |
ipc_call_t data; |
int callres; |
IPC_SET_METHOD(data, method); |
IPC_SET_ARG1(data, arg1); |
IPC_SET_ARG2(data, arg2); |
IPC_SET_ARG3(data, arg3); |
IPC_SET_ARG4(data, arg4); |
IPC_SET_ARG5(data, arg5); |
callres = __SYSCALL3(SYS_IPC_CALL_SYNC_SLOW, phoneid, (sysarg_t) &data, |
(sysarg_t) &data); |
if (callres) |
return callres; |
if (result1) |
*result1 = IPC_GET_ARG1(data); |
if (result2) |
*result2 = IPC_GET_ARG2(data); |
if (result3) |
*result3 = IPC_GET_ARG3(data); |
if (result4) |
*result4 = IPC_GET_ARG4(data); |
if (result5) |
*result5 = IPC_GET_ARG5(data); |
return IPC_GET_RETVAL(data); |
} |
/** Syscall to send asynchronous message. |
* |
* @param phoneid Phone handle for the call. |
* @param data Call data with the request. |
* |
* @return Hash of the call or an error code. |
*/ |
static ipc_callid_t _ipc_call_async(int phoneid, ipc_call_t *data) |
{ |
return __SYSCALL2(SYS_IPC_CALL_ASYNC_SLOW, phoneid, (sysarg_t) data); |
} |
/** Prolog to ipc_call_async_*() functions. |
* |
* @param private Argument for the answer/error callback. |
* @param callback Answer/error callback. |
* |
* @return New, partially initialized async_call structure or NULL. |
*/ |
static inline async_call_t *ipc_prepare_async(void *private, |
ipc_async_callback_t callback) |
{ |
async_call_t *call; |
call = malloc(sizeof(*call)); |
if (!call) { |
if (callback) |
callback(private, ENOMEM, NULL); |
return NULL; |
} |
call->callback = callback; |
call->private = private; |
return call; |
} |
/** Epilogue of ipc_call_async_*() functions. |
* |
* @param callid Value returned by the SYS_IPC_CALL_ASYNC_* syscall. |
* @param phoneid Phone handle through which the call was made. |
* @param call async_call structure returned by ipc_prepare_async(). |
* @param can_preempt If non-zero, the current fibril can be preempted in this |
* call. |
*/ |
static inline void ipc_finish_async(ipc_callid_t callid, int phoneid, |
async_call_t *call, int can_preempt) |
{ |
if (!call) { /* Nothing to do regardless if failed or not */ |
futex_up(&ipc_futex); |
return; |
} |
if (callid == (ipc_callid_t) IPC_CALLRET_FATAL) { |
futex_up(&ipc_futex); |
/* Call asynchronous handler with error code */ |
if (call->callback) |
call->callback(call->private, ENOENT, NULL); |
free(call); |
return; |
} |
if (callid == (ipc_callid_t) IPC_CALLRET_TEMPORARY) { |
futex_up(&ipc_futex); |
call->u.msg.phoneid = phoneid; |
futex_down(&async_futex); |
list_append(&call->list, &queued_calls); |
if (can_preempt) { |
call->fid = fibril_get_id(); |
fibril_switch(FIBRIL_TO_MANAGER); |
/* Async futex unlocked by previous call */ |
} else { |
call->fid = 0; |
futex_up(&async_futex); |
} |
return; |
} |
call->u.callid = callid; |
/* Add call to the list of dispatched calls */ |
list_append(&call->list, &dispatched_calls); |
futex_up(&ipc_futex); |
} |
/** Make a fast asynchronous call. |
* |
* This function can only handle four arguments of payload. It is, however, |
* faster than the more generic ipc_call_async_slow(). |
* |
* Note that this function is a void function. |
* During normal opertation, answering this call will trigger the callback. |
* In case of fatal error, call the callback handler with the proper error code. |
* If the call cannot be temporarily made, queue it. |
* |
* @param phoneid Phone handle for the call. |
* @param method Requested method. |
* @param arg1 Service-defined payload argument. |
* @param arg2 Service-defined payload argument. |
* @param arg3 Service-defined payload argument. |
* @param arg4 Service-defined payload argument. |
* @param private Argument to be passed to the answer/error callback. |
* @param callback Answer or error callback. |
* @param can_preempt If non-zero, the current fibril will be preempted in |
* case the kernel temporarily refuses to accept more |
* asynchronous calls. |
*/ |
void ipc_call_async_fast(int phoneid, ipcarg_t method, ipcarg_t arg1, |
ipcarg_t arg2, ipcarg_t arg3, ipcarg_t arg4, void *private, |
ipc_async_callback_t callback, int can_preempt) |
{ |
async_call_t *call = NULL; |
ipc_callid_t callid; |
if (callback) { |
call = ipc_prepare_async(private, callback); |
if (!call) |
return; |
} |
/* |
* We need to make sure that we get callid before another thread |
* accesses the queue again. |
*/ |
futex_down(&ipc_futex); |
callid = __SYSCALL6(SYS_IPC_CALL_ASYNC_FAST, phoneid, method, arg1, |
arg2, arg3, arg4); |
if (callid == (ipc_callid_t) IPC_CALLRET_TEMPORARY) { |
if (!call) { |
call = ipc_prepare_async(private, callback); |
if (!call) |
return; |
} |
IPC_SET_METHOD(call->u.msg.data, method); |
IPC_SET_ARG1(call->u.msg.data, arg1); |
IPC_SET_ARG2(call->u.msg.data, arg2); |
IPC_SET_ARG3(call->u.msg.data, arg3); |
IPC_SET_ARG4(call->u.msg.data, arg4); |
/* |
* To achieve deterministic behavior, we always zero out the |
* arguments that are beyond the limits of the fast version. |
*/ |
IPC_SET_ARG5(call->u.msg.data, 0); |
} |
ipc_finish_async(callid, phoneid, call, can_preempt); |
} |
/** Make an asynchronous call transmitting the entire payload. |
* |
* Note that this function is a void function. |
* During normal opertation, answering this call will trigger the callback. |
* In case of fatal error, call the callback handler with the proper error code. |
* If the call cannot be temporarily made, queue it. |
* |
* @param phoneid Phone handle for the call. |
* @param method Requested method. |
* @param arg1 Service-defined payload argument. |
* @param arg2 Service-defined payload argument. |
* @param arg3 Service-defined payload argument. |
* @param arg4 Service-defined payload argument. |
* @param arg5 Service-defined payload argument. |
* @param private Argument to be passed to the answer/error callback. |
* @param callback Answer or error callback. |
* @param can_preempt If non-zero, the current fibril will be preempted in |
* case the kernel temporarily refuses to accept more |
* asynchronous calls. |
* |
*/ |
void ipc_call_async_slow(int phoneid, ipcarg_t method, ipcarg_t arg1, |
ipcarg_t arg2, ipcarg_t arg3, ipcarg_t arg4, ipcarg_t arg5, void *private, |
ipc_async_callback_t callback, int can_preempt) |
{ |
async_call_t *call; |
ipc_callid_t callid; |
call = ipc_prepare_async(private, callback); |
if (!call) |
return; |
IPC_SET_METHOD(call->u.msg.data, method); |
IPC_SET_ARG1(call->u.msg.data, arg1); |
IPC_SET_ARG2(call->u.msg.data, arg2); |
IPC_SET_ARG3(call->u.msg.data, arg3); |
IPC_SET_ARG4(call->u.msg.data, arg4); |
IPC_SET_ARG5(call->u.msg.data, arg5); |
/* |
* We need to make sure that we get callid before another thread |
* accesses the queue again. |
*/ |
futex_down(&ipc_futex); |
callid = _ipc_call_async(phoneid, &call->u.msg.data); |
ipc_finish_async(callid, phoneid, call, can_preempt); |
} |
/** Answer a received call - fast version. |
* |
* The fast answer makes use of passing retval and first four arguments in |
* registers. If you need to return more, use the ipc_answer_slow() instead. |
* |
* @param callid Hash of the call being answered. |
* @param retval Return value. |
* @param arg1 First return argument. |
* @param arg2 Second return argument. |
* @param arg3 Third return argument. |
* @param arg4 Fourth return argument. |
* |
* @return Zero on success or a value from @ref errno.h on failure. |
*/ |
ipcarg_t ipc_answer_fast(ipc_callid_t callid, ipcarg_t retval, ipcarg_t arg1, |
ipcarg_t arg2, ipcarg_t arg3, ipcarg_t arg4) |
{ |
return __SYSCALL6(SYS_IPC_ANSWER_FAST, callid, retval, arg1, arg2, arg3, |
arg4); |
} |
/** Answer a received call - slow full version. |
* |
* @param callid Hash of the call being answered. |
* @param retval Return value. |
* @param arg1 First return argument. |
* @param arg2 Second return argument. |
* @param arg3 Third return argument. |
* @param arg4 Fourth return argument. |
* @param arg5 Fifth return argument. |
* |
* @return Zero on success or a value from @ref errno.h on failure. |
*/ |
ipcarg_t ipc_answer_slow(ipc_callid_t callid, ipcarg_t retval, ipcarg_t arg1, |
ipcarg_t arg2, ipcarg_t arg3, ipcarg_t arg4, ipcarg_t arg5) |
{ |
ipc_call_t data; |
IPC_SET_RETVAL(data, retval); |
IPC_SET_ARG1(data, arg1); |
IPC_SET_ARG2(data, arg2); |
IPC_SET_ARG3(data, arg3); |
IPC_SET_ARG4(data, arg4); |
IPC_SET_ARG5(data, arg5); |
return __SYSCALL2(SYS_IPC_ANSWER_SLOW, callid, (sysarg_t) &data); |
} |
/** Try to dispatch queued calls from the async queue. */ |
static void try_dispatch_queued_calls(void) |
{ |
async_call_t *call; |
ipc_callid_t callid; |
/** @todo |
* Integrate intelligently ipc_futex, so that it is locked during |
* ipc_call_async_*(), until it is added to dispatched_calls. |
*/ |
futex_down(&async_futex); |
while (!list_empty(&queued_calls)) { |
call = list_get_instance(queued_calls.next, async_call_t, list); |
callid = _ipc_call_async(call->u.msg.phoneid, |
&call->u.msg.data); |
if (callid == (ipc_callid_t) IPC_CALLRET_TEMPORARY) { |
break; |
} |
list_remove(&call->list); |
futex_up(&async_futex); |
if (call->fid) |
fibril_add_ready(call->fid); |
if (callid == (ipc_callid_t) IPC_CALLRET_FATAL) { |
if (call->callback) |
call->callback(call->private, ENOENT, NULL); |
free(call); |
} else { |
call->u.callid = callid; |
futex_down(&ipc_futex); |
list_append(&call->list, &dispatched_calls); |
futex_up(&ipc_futex); |
} |
futex_down(&async_futex); |
} |
futex_up(&async_futex); |
} |
/** Handle a received answer. |
* |
* Find the hash of the answer and call the answer callback. |
* |
* @todo Make it use hash table. |
* |
* @param callid Hash of the received answer. |
* The answer has the same hash as the request OR'ed with |
* the IPC_CALLID_ANSWERED bit. |
* @param data Call data of the answer. |
*/ |
static void handle_answer(ipc_callid_t callid, ipc_call_t *data) |
{ |
link_t *item; |
async_call_t *call; |
callid &= ~IPC_CALLID_ANSWERED; |
futex_down(&ipc_futex); |
for (item = dispatched_calls.next; item != &dispatched_calls; |
item = item->next) { |
call = list_get_instance(item, async_call_t, list); |
if (call->u.callid == callid) { |
list_remove(&call->list); |
futex_up(&ipc_futex); |
if (call->callback) |
call->callback(call->private, |
IPC_GET_RETVAL(*data), data); |
free(call); |
return; |
} |
} |
futex_up(&ipc_futex); |
} |
/** Wait for a first call to come. |
* |
* @param call Storage where the incoming call data will be stored. |
* @param usec Timeout in microseconds |
* @param flags Flags passed to SYS_IPC_WAIT (blocking, nonblocking). |
* |
* @return Hash of the call. Note that certain bits have special |
* meaning. IPC_CALLID_ANSWERED will be set in an answer |
* and IPC_CALLID_NOTIFICATION is used for notifications. |
* |
*/ |
ipc_callid_t ipc_wait_cycle(ipc_call_t *call, uint32_t usec, int flags) |
{ |
ipc_callid_t callid; |
callid = __SYSCALL3(SYS_IPC_WAIT, (sysarg_t) call, usec, flags); |
/* Handle received answers */ |
if (callid & IPC_CALLID_ANSWERED) { |
handle_answer(callid, call); |
try_dispatch_queued_calls(); |
} |
return callid; |
} |
/** Wait some time for an IPC call. |
* |
* The call will return after an answer is received. |
* |
* @param call Storage where the incoming call data will be stored. |
* @param usec Timeout in microseconds. |
* |
* @return Hash of the answer. |
*/ |
ipc_callid_t ipc_wait_for_call_timeout(ipc_call_t *call, uint32_t usec) |
{ |
ipc_callid_t callid; |
do { |
callid = ipc_wait_cycle(call, usec, SYNCH_FLAGS_NONE); |
} while (callid & IPC_CALLID_ANSWERED); |
return callid; |
} |
/** Check if there is an IPC call waiting to be picked up. |
* |
* @param call Storage where the incoming call will be stored. |
* @return Hash of the answer. |
*/ |
ipc_callid_t ipc_trywait_for_call(ipc_call_t *call) |
{ |
ipc_callid_t callid; |
do { |
callid = ipc_wait_cycle(call, SYNCH_NO_TIMEOUT, |
SYNCH_FLAGS_NON_BLOCKING); |
} while (callid & IPC_CALLID_ANSWERED); |
return callid; |
} |
/** Ask destination to do a callback connection. |
* |
* @param phoneid Phone handle used for contacting the other side. |
* @param arg1 Service-defined argument. |
* @param arg2 Service-defined argument. |
* @param arg3 Service-defined argument. |
* @param phonehash Storage where the library will store an opaque |
* identifier of the phone that will be used for incoming |
* calls. This identifier can be used for connection |
* tracking. |
* |
* @return Zero on success or a negative error code. |
*/ |
int ipc_connect_to_me(int phoneid, int arg1, int arg2, int arg3, |
ipcarg_t *phonehash) |
{ |
return ipc_call_sync_3_5(phoneid, IPC_M_CONNECT_TO_ME, arg1, arg2, |
arg3, NULL, NULL, NULL, NULL, phonehash); |
} |
/** Ask through phone for a new connection to some service. |
* |
* @param phoneid Phone handle used for contacting the other side. |
* @param arg1 User defined argument. |
* @param arg2 User defined argument. |
* @param arg3 User defined argument. |
* |
* @return New phone handle on success or a negative error code. |
*/ |
int ipc_connect_me_to(int phoneid, int arg1, int arg2, int arg3) |
{ |
ipcarg_t newphid; |
int res; |
res = ipc_call_sync_3_5(phoneid, IPC_M_CONNECT_ME_TO, arg1, arg2, arg3, |
NULL, NULL, NULL, NULL, &newphid); |
if (res) |
return res; |
return newphid; |
} |
/** Ask through phone for a new connection to some service. |
* |
* If the connection is not available at the moment, the |
* call will block. |
* |
* @param phoneid Phone handle used for contacting the other side. |
* @param arg1 User defined argument. |
* @param arg2 User defined argument. |
* @param arg3 User defined argument. |
* |
* @return New phone handle on success or a negative error code. |
*/ |
int ipc_connect_me_to_blocking(int phoneid, int arg1, int arg2, int arg3) |
{ |
ipcarg_t newphid; |
int res; |
res = ipc_call_sync_4_5(phoneid, IPC_M_CONNECT_ME_TO, arg1, arg2, arg3, |
IPC_FLAG_BLOCKING, NULL, NULL, NULL, NULL, &newphid); |
if (res) |
return res; |
return newphid; |
} |
/** Hang up a phone. |
* |
* @param phoneid Handle of the phone to be hung up. |
* |
* @return Zero on success or a negative error code. |
*/ |
int ipc_hangup(int phoneid) |
{ |
return __SYSCALL1(SYS_IPC_HANGUP, phoneid); |
} |
/** Register IRQ notification. |
* |
* @param inr IRQ number. |
* @param devno Device number of the device generating inr. |
* @param method Use this method for notifying me. |
* @param ucode Top-half pseudocode handler. |
* |
* @return Value returned by the kernel. |
*/ |
int ipc_register_irq(int inr, int devno, int method, irq_code_t *ucode) |
{ |
return __SYSCALL4(SYS_IPC_REGISTER_IRQ, inr, devno, method, |
(sysarg_t) ucode); |
} |
/** Unregister IRQ notification. |
* |
* @param inr IRQ number. |
* @param devno Device number of the device generating inr. |
* |
* @return Value returned by the kernel. |
*/ |
int ipc_unregister_irq(int inr, int devno) |
{ |
return __SYSCALL2(SYS_IPC_UNREGISTER_IRQ, inr, devno); |
} |
/** Forward a received call to another destination. |
* |
* @param callid Hash of the call to forward. |
* @param phoneid Phone handle to use for forwarding. |
* @param method New method for the forwarded call. |
* @param arg1 New value of the first argument for the forwarded call. |
* @param arg2 New value of the second argument for the forwarded call. |
* @param mode Flags specifying mode of the forward operation. |
* |
* @return Zero on success or an error code. |
* |
* For non-system methods, the old method, arg1 and arg2 are rewritten by the |
* new values. For system methods, the new method, arg1 and arg2 are written |
* to the old arg1, arg2 and arg3, respectivelly. Calls with immutable |
* methods are forwarded verbatim. |
*/ |
int ipc_forward_fast(ipc_callid_t callid, int phoneid, int method, |
ipcarg_t arg1, ipcarg_t arg2, int mode) |
{ |
return __SYSCALL6(SYS_IPC_FORWARD_FAST, callid, phoneid, method, arg1, |
arg2, mode); |
} |
int ipc_forward_slow(ipc_callid_t callid, int phoneid, int method, |
ipcarg_t arg1, ipcarg_t arg2, ipcarg_t arg3, ipcarg_t arg4, ipcarg_t arg5, |
int mode) |
{ |
ipc_call_t data; |
IPC_SET_METHOD(data, method); |
IPC_SET_ARG1(data, arg1); |
IPC_SET_ARG2(data, arg2); |
IPC_SET_ARG3(data, arg3); |
IPC_SET_ARG4(data, arg4); |
IPC_SET_ARG5(data, arg5); |
return __SYSCALL4(SYS_IPC_FORWARD_SLOW, callid, phoneid, (sysarg_t) &data, mode); |
} |
/** Wrapper for making IPC_M_SHARE_IN calls. |
* |
* @param phoneid Phone that will be used to contact the receiving side. |
* @param dst Destination address space area base. |
* @param size Size of the destination address space area. |
* @param arg User defined argument. |
* @param flags Storage where the received flags will be stored. Can be |
* NULL. |
* |
* @return Zero on success or a negative error code from errno.h. |
*/ |
int ipc_share_in_start(int phoneid, void *dst, size_t size, ipcarg_t arg, |
int *flags) |
{ |
int res; |
sysarg_t tmp_flags; |
res = async_req_3_2(phoneid, IPC_M_SHARE_IN, (ipcarg_t) dst, |
(ipcarg_t) size, arg, NULL, &tmp_flags); |
if (flags) |
*flags = tmp_flags; |
return res; |
} |
/** Wrapper for receiving the IPC_M_SHARE_IN calls. |
* |
* This wrapper only makes it more comfortable to receive IPC_M_SHARE_IN calls |
* so that the user doesn't have to remember the meaning of each IPC argument. |
* |
* So far, this wrapper is to be used from within a connection fibril. |
* |
* @param callid Storage where the hash of the IPC_M_SHARE_IN call will |
* be stored. |
* @param size Destination address space area size. |
* |
* @return Non-zero on success, zero on failure. |
*/ |
int ipc_share_in_receive(ipc_callid_t *callid, size_t *size) |
{ |
ipc_call_t data; |
assert(callid); |
assert(size); |
*callid = async_get_call(&data); |
if (IPC_GET_METHOD(data) != IPC_M_SHARE_IN) |
return 0; |
*size = (size_t) IPC_GET_ARG2(data); |
return 1; |
} |
/** Wrapper for answering the IPC_M_SHARE_IN calls. |
* |
* This wrapper only makes it more comfortable to answer IPC_M_DATA_READ calls |
* so that the user doesn't have to remember the meaning of each IPC argument. |
* |
* @param callid Hash of the IPC_M_DATA_READ call to answer. |
* @param src Source address space base. |
* @param flags Flags to be used for sharing. Bits can be only cleared. |
* |
* @return Zero on success or a value from @ref errno.h on failure. |
*/ |
int ipc_share_in_finalize(ipc_callid_t callid, void *src, int flags) |
{ |
return ipc_answer_2(callid, EOK, (ipcarg_t) src, (ipcarg_t) flags); |
} |
/** Wrapper for making IPC_M_SHARE_OUT calls. |
* |
* @param phoneid Phone that will be used to contact the receiving side. |
* @param src Source address space area base address. |
* @param flags Flags to be used for sharing. Bits can be only cleared. |
* |
* @return Zero on success or a negative error code from errno.h. |
*/ |
int ipc_share_out_start(int phoneid, void *src, int flags) |
{ |
return async_req_3_0(phoneid, IPC_M_SHARE_OUT, (ipcarg_t) src, 0, |
(ipcarg_t) flags); |
} |
/** Wrapper for receiving the IPC_M_SHARE_OUT calls. |
* |
* This wrapper only makes it more comfortable to receive IPC_M_SHARE_OUT calls |
* so that the user doesn't have to remember the meaning of each IPC argument. |
* |
* So far, this wrapper is to be used from within a connection fibril. |
* |
* @param callid Storage where the hash of the IPC_M_SHARE_OUT call will |
* be stored. |
* @param size Storage where the source address space area size will be |
* stored. |
* @param flags Storage where the sharing flags will be stored. |
* |
* @return Non-zero on success, zero on failure. |
*/ |
int ipc_share_out_receive(ipc_callid_t *callid, size_t *size, int *flags) |
{ |
ipc_call_t data; |
assert(callid); |
assert(size); |
assert(flags); |
*callid = async_get_call(&data); |
if (IPC_GET_METHOD(data) != IPC_M_SHARE_OUT) |
return 0; |
*size = (size_t) IPC_GET_ARG2(data); |
*flags = (int) IPC_GET_ARG3(data); |
return 1; |
} |
/** Wrapper for answering the IPC_M_SHARE_OUT calls. |
* |
* This wrapper only makes it more comfortable to answer IPC_M_SHARE_OUT calls |
* so that the user doesn't have to remember the meaning of each IPC argument. |
* |
* @param callid Hash of the IPC_M_DATA_WRITE call to answer. |
* @param dst Destination address space area base address. |
* |
* @return Zero on success or a value from @ref errno.h on failure. |
*/ |
int ipc_share_out_finalize(ipc_callid_t callid, void *dst) |
{ |
return ipc_answer_1(callid, EOK, (ipcarg_t) dst); |
} |
/** Wrapper for making IPC_M_DATA_READ calls. |
* |
* @param phoneid Phone that will be used to contact the receiving side. |
* @param dst Address of the beginning of the destination buffer. |
* @param size Size of the destination buffer. |
* |
* @return Zero on success or a negative error code from errno.h. |
*/ |
int ipc_data_read_start(int phoneid, void *dst, size_t size) |
{ |
return async_req_2_0(phoneid, IPC_M_DATA_READ, (ipcarg_t) dst, |
(ipcarg_t) size); |
} |
/** Wrapper for receiving the IPC_M_DATA_READ calls. |
* |
* This wrapper only makes it more comfortable to receive IPC_M_DATA_READ calls |
* so that the user doesn't have to remember the meaning of each IPC argument. |
* |
* So far, this wrapper is to be used from within a connection fibril. |
* |
* @param callid Storage where the hash of the IPC_M_DATA_READ call will |
* be stored. |
* @param size Storage where the maximum size will be stored. Can be |
* NULL. |
* |
* @return Non-zero on success, zero on failure. |
*/ |
int ipc_data_read_receive(ipc_callid_t *callid, size_t *size) |
{ |
ipc_call_t data; |
assert(callid); |
*callid = async_get_call(&data); |
if (IPC_GET_METHOD(data) != IPC_M_DATA_READ) |
return 0; |
if (size) |
*size = (size_t) IPC_GET_ARG2(data); |
return 1; |
} |
/** Wrapper for answering the IPC_M_DATA_READ calls. |
* |
* This wrapper only makes it more comfortable to answer IPC_M_DATA_READ calls |
* so that the user doesn't have to remember the meaning of each IPC argument. |
* |
* @param callid Hash of the IPC_M_DATA_READ call to answer. |
* @param src Source address for the IPC_M_DATA_READ call. |
* @param size Size for the IPC_M_DATA_READ call. Can be smaller than |
* the maximum size announced by the sender. |
* |
* @return Zero on success or a value from @ref errno.h on failure. |
*/ |
int ipc_data_read_finalize(ipc_callid_t callid, const void *src, size_t size) |
{ |
return ipc_answer_2(callid, EOK, (ipcarg_t) src, (ipcarg_t) size); |
} |
/** Wrapper for making IPC_M_DATA_WRITE calls. |
* |
* @param phoneid Phone that will be used to contact the receiving side. |
* @param src Address of the beginning of the source buffer. |
* @param size Size of the source buffer. |
* |
* @return Zero on success or a negative error code from errno.h. |
*/ |
int ipc_data_write_start(int phoneid, const void *src, size_t size) |
{ |
return async_req_2_0(phoneid, IPC_M_DATA_WRITE, (ipcarg_t) src, |
(ipcarg_t) size); |
} |
/** Wrapper for receiving the IPC_M_DATA_WRITE calls. |
* |
* This wrapper only makes it more comfortable to receive IPC_M_DATA_WRITE calls |
* so that the user doesn't have to remember the meaning of each IPC argument. |
* |
* So far, this wrapper is to be used from within a connection fibril. |
* |
* @param callid Storage where the hash of the IPC_M_DATA_WRITE call will |
* be stored. |
* @param size Storage where the suggested size will be stored. May be |
* NULL |
* |
* @return Non-zero on success, zero on failure. |
*/ |
int ipc_data_write_receive(ipc_callid_t *callid, size_t *size) |
{ |
ipc_call_t data; |
assert(callid); |
*callid = async_get_call(&data); |
if (IPC_GET_METHOD(data) != IPC_M_DATA_WRITE) |
return 0; |
if (size) |
*size = (size_t) IPC_GET_ARG2(data); |
return 1; |
} |
/** Wrapper for answering the IPC_M_DATA_WRITE calls. |
* |
* This wrapper only makes it more comfortable to answer IPC_M_DATA_WRITE calls |
* so that the user doesn't have to remember the meaning of each IPC argument. |
* |
* @param callid Hash of the IPC_M_DATA_WRITE call to answer. |
* @param dst Final destination address for the IPC_M_DATA_WRITE call. |
* @param size Final size for the IPC_M_DATA_WRITE call. |
* |
* @return Zero on success or a value from @ref errno.h on failure. |
*/ |
int ipc_data_write_finalize(ipc_callid_t callid, void *dst, size_t size) |
{ |
return ipc_answer_2(callid, EOK, (ipcarg_t) dst, (ipcarg_t) size); |
} |
#include <kernel/syscall/sysarg64.h> |
/** Connect to a task specified by id. |
*/ |
int ipc_connect_kbox(task_id_t id) |
{ |
sysarg64_t arg; |
arg.value = (unsigned long long) id; |
return __SYSCALL1(SYS_IPC_CONNECT_KBOX, (sysarg_t) &arg); |
} |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/generic/adt/hash_table.c |
---|
0,0 → 1,196 |
/* |
* Copyright (c) 2008 Jakub Jermar |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libc |
* @{ |
*/ |
/** @file |
*/ |
/* |
* This is an implementation of generic chained hash table. |
*/ |
#include <adt/hash_table.h> |
#include <adt/list.h> |
#include <unistd.h> |
#include <malloc.h> |
#include <assert.h> |
#include <stdio.h> |
#include <string.h> |
/** Create chained hash table. |
* |
* @param h Hash table structure. Will be initialized by this call. |
* @param m Number of hash table buckets. |
* @param max_keys Maximal number of keys needed to identify an item. |
* @param op Hash table operations structure. |
* @return True on success |
*/ |
int hash_table_create(hash_table_t *h, hash_count_t m, hash_count_t max_keys, |
hash_table_operations_t *op) |
{ |
hash_count_t i; |
assert(h); |
assert(op && op->hash && op->compare); |
assert(max_keys > 0); |
h->entry = malloc(m * sizeof(link_t)); |
if (!h->entry) { |
printf("cannot allocate memory for hash table\n"); |
return false; |
} |
memset((void *) h->entry, 0, m * sizeof(link_t)); |
for (i = 0; i < m; i++) |
list_initialize(&h->entry[i]); |
h->entries = m; |
h->max_keys = max_keys; |
h->op = op; |
return true; |
} |
/** Destroy a hash table instance. |
* |
* @param h Hash table to be destroyed. |
*/ |
void hash_table_destroy(hash_table_t *h) |
{ |
assert(h); |
assert(h->entry); |
free(h->entry); |
} |
/** Insert item into a hash table. |
* |
* @param h Hash table. |
* @param key Array of all keys necessary to compute hash index. |
* @param item Item to be inserted into the hash table. |
*/ |
void hash_table_insert(hash_table_t *h, unsigned long key[], link_t *item) |
{ |
hash_index_t chain; |
assert(item); |
assert(h && h->op && h->op->hash && h->op->compare); |
chain = h->op->hash(key); |
assert(chain < h->entries); |
list_append(item, &h->entry[chain]); |
} |
/** Search hash table for an item matching keys. |
* |
* @param h Hash table. |
* @param key Array of all keys needed to compute hash index. |
* |
* @return Matching item on success, NULL if there is no such item. |
*/ |
link_t *hash_table_find(hash_table_t *h, unsigned long key[]) |
{ |
link_t *cur; |
hash_index_t chain; |
assert(h && h->op && h->op->hash && h->op->compare); |
chain = h->op->hash(key); |
assert(chain < h->entries); |
for (cur = h->entry[chain].next; cur != &h->entry[chain]; |
cur = cur->next) { |
if (h->op->compare(key, h->max_keys, cur)) { |
/* |
* The entry is there. |
*/ |
return cur; |
} |
} |
return NULL; |
} |
/** Remove all matching items from hash table. |
* |
* For each removed item, h->remove_callback() is called. |
* |
* @param h Hash table. |
* @param key Array of keys that will be compared against items of |
* the hash table. |
* @param keys Number of keys in the 'key' array. |
*/ |
void hash_table_remove(hash_table_t *h, unsigned long key[], hash_count_t keys) |
{ |
hash_index_t chain; |
link_t *cur; |
assert(h && h->op && h->op->hash && h->op->compare && |
h->op->remove_callback); |
assert(keys <= h->max_keys); |
if (keys == h->max_keys) { |
/* |
* All keys are known, hash_table_find() can be used to find the |
* entry. |
*/ |
cur = hash_table_find(h, key); |
if (cur) { |
list_remove(cur); |
h->op->remove_callback(cur); |
} |
return; |
} |
/* |
* Fewer keys were passed. |
* Any partially matching entries are to be removed. |
*/ |
for (chain = 0; chain < h->entries; chain++) { |
for (cur = h->entry[chain].next; cur != &h->entry[chain]; |
cur = cur->next) { |
if (h->op->compare(key, keys, cur)) { |
link_t *hlp; |
hlp = cur; |
cur = cur->prev; |
list_remove(hlp); |
h->op->remove_callback(hlp); |
continue; |
} |
} |
} |
} |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/generic/adt/list.c |
---|
0,0 → 1,112 |
/* |
* Copyright (c) 2004 Jakub Jermar |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libc |
* @{ |
*/ |
/** @file |
*/ |
#include <adt/list.h> |
/** Check for membership |
* |
* Check whether link is contained in the list head. |
* The membership is defined as pointer equivalence. |
* |
* @param link Item to look for. |
* @param head List to look in. |
* |
* @return true if link is contained in head, false otherwise. |
* |
*/ |
int list_member(const link_t *link, const link_t *head) |
{ |
int found = 0; |
link_t *hlp = head->next; |
while (hlp != head) { |
if (hlp == link) { |
found = 1; |
break; |
} |
hlp = hlp->next; |
} |
return found; |
} |
/** Concatenate two lists |
* |
* Concatenate lists head1 and head2, producing a single |
* list head1 containing items from both (in head1, head2 |
* order) and empty list head2. |
* |
* @param head1 First list and concatenated output |
* @param head2 Second list and empty output. |
* |
*/ |
void list_concat(link_t *head1, link_t *head2) |
{ |
if (list_empty(head2)) |
return; |
head2->next->prev = head1->prev; |
head2->prev->next = head1; |
head1->prev->next = head2->next; |
head1->prev = head2->prev; |
list_initialize(head2); |
} |
/** Count list items |
* |
* Return the number of items in the list. |
* |
* @param link List to count. |
* |
* @return Number of items in the list. |
* |
*/ |
unsigned int list_count(const link_t *link) |
{ |
unsigned int count = 0; |
link_t *hlp = link->next; |
while (hlp != link) { |
count++; |
hlp = hlp->next; |
} |
return count; |
} |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/generic/task.c |
---|
0,0 → 1,157 |
/* |
* Copyright (c) 2006 Jakub Jermar |
* Copyright (c) 2008 Jiri Svoboda |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libc |
* @{ |
*/ |
/** @file |
*/ |
#include <task.h> |
#include <libc.h> |
#include <stdlib.h> |
#include <errno.h> |
#include <loader/loader.h> |
#include <string.h> |
#include <ipc/ns.h> |
#include <macros.h> |
#include <async.h> |
task_id_t task_get_id(void) |
{ |
task_id_t task_id; |
(void) __SYSCALL1(SYS_TASK_GET_ID, (sysarg_t) &task_id); |
return task_id; |
} |
/** Set the task name. |
* |
* @param name The new name, typically the command used to execute the |
* program. |
* |
* @return Zero on success or negative error code. |
* |
*/ |
int task_set_name(const char *name) |
{ |
return __SYSCALL2(SYS_TASK_SET_NAME, (sysarg_t) name, str_size(name)); |
} |
/** Create a new task by running an executable from the filesystem. |
* |
* This is really just a convenience wrapper over the more complicated |
* loader API. |
* |
* @param path pathname of the binary to execute |
* @param argv command-line arguments |
* |
* @return ID of the newly created task or zero on error. |
* |
*/ |
task_id_t task_spawn(const char *path, char *const args[]) |
{ |
/* Connect to a program loader. */ |
loader_t *ldr = loader_connect(); |
if (ldr == NULL) |
return 0; |
/* Get task ID. */ |
task_id_t task_id; |
int rc = loader_get_task_id(ldr, &task_id); |
if (rc != EOK) |
goto error; |
/* Send program pathname. */ |
rc = loader_set_pathname(ldr, path); |
if (rc != EOK) |
goto error; |
/* Send arguments. */ |
rc = loader_set_args(ldr, args); |
if (rc != EOK) |
goto error; |
/* Send default files */ |
fdi_node_t *files[4]; |
fdi_node_t stdin_node; |
fdi_node_t stdout_node; |
fdi_node_t stderr_node; |
if ((stdin != NULL) && (fnode(stdin, &stdin_node) == EOK)) |
files[0] = &stdin_node; |
else |
files[0] = NULL; |
if ((stdout != NULL) && (fnode(stdout, &stdout_node) == EOK)) |
files[1] = &stdout_node; |
else |
files[1] = NULL; |
if ((stderr != NULL) && (fnode(stderr, &stderr_node) == EOK)) |
files[2] = &stderr_node; |
else |
files[2] = NULL; |
files[3] = NULL; |
rc = loader_set_files(ldr, files); |
if (rc != EOK) |
goto error; |
/* Load the program. */ |
rc = loader_load_program(ldr); |
if (rc != EOK) |
goto error; |
/* Run it. */ |
rc = loader_run(ldr); |
if (rc != EOK) |
goto error; |
/* Success */ |
free(ldr); |
return task_id; |
error: |
/* Error exit */ |
loader_abort(ldr); |
free(ldr); |
return 0; |
} |
int task_wait(task_id_t id) |
{ |
return (int) async_req_2_0(PHONE_NS, NS_TASK_WAIT, LOWER32(id), UPPER32(id)); |
} |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/generic/mem.c |
---|
0,0 → 1,239 |
/* |
* Copyright (c) 2005 Martin Decky |
* Copyright (c) 2008 Jiri Svoboda |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libc |
* @{ |
*/ |
/** @file |
*/ |
#include <mem.h> |
#include <stdlib.h> |
#include <sys/types.h> |
/** Fill memory block with a constant value. */ |
void *memset(void *dest, int b, size_t n) |
{ |
char *pb; |
unsigned long *pw; |
size_t word_size; |
size_t n_words; |
unsigned long pattern; |
size_t i; |
size_t fill; |
/* Fill initial segment. */ |
word_size = sizeof(unsigned long); |
fill = word_size - ((uintptr_t) dest & (word_size - 1)); |
if (fill > n) fill = n; |
pb = dest; |
i = fill; |
while (i-- != 0) |
*pb++ = b; |
/* Compute remaining size. */ |
n -= fill; |
if (n == 0) return dest; |
n_words = n / word_size; |
n = n % word_size; |
pw = (unsigned long *) pb; |
/* Create word-sized pattern for aligned segment. */ |
pattern = 0; |
i = word_size; |
while (i-- != 0) |
pattern = (pattern << 8) | (uint8_t) b; |
/* Fill aligned segment. */ |
i = n_words; |
while (i-- != 0) |
*pw++ = pattern; |
pb = (char *) pw; |
/* Fill final segment. */ |
i = n; |
while (i-- != 0) |
*pb++ = b; |
return dest; |
} |
struct along { |
unsigned long n; |
} __attribute__ ((packed)); |
static void *unaligned_memcpy(void *dst, const void *src, size_t n) |
{ |
size_t i, j; |
struct along *adst = dst; |
const struct along *asrc = src; |
for (i = 0; i < n / sizeof(unsigned long); i++) |
adst[i].n = asrc[i].n; |
for (j = 0; j < n % sizeof(unsigned long); j++) |
((unsigned char *) (((unsigned long *) dst) + i))[j] = |
((unsigned char *) (((unsigned long *) src) + i))[j]; |
return (char *) dst; |
} |
/** Copy memory block. */ |
void *memcpy(void *dst, const void *src, size_t n) |
{ |
size_t i; |
size_t mod, fill; |
size_t word_size; |
size_t n_words; |
const unsigned long *srcw; |
unsigned long *dstw; |
const uint8_t *srcb; |
uint8_t *dstb; |
word_size = sizeof(unsigned long); |
/* |
* Are source and destination addresses congruent modulo word_size? |
* If not, use unaligned_memcpy(). |
*/ |
if (((uintptr_t) dst & (word_size - 1)) != |
((uintptr_t) src & (word_size - 1))) |
return unaligned_memcpy(dst, src, n); |
/* |
* mod is the address modulo word size. fill is the length of the |
* initial buffer segment before the first word boundary. |
* If the buffer is very short, use unaligned_memcpy(), too. |
*/ |
mod = (uintptr_t) dst & (word_size - 1); |
fill = word_size - mod; |
if (fill > n) fill = n; |
/* Copy the initial segment. */ |
srcb = src; |
dstb = dst; |
i = fill; |
while (i-- != 0) |
*dstb++ = *srcb++; |
/* Compute remaining length. */ |
n -= fill; |
if (n == 0) return dst; |
/* Pointers to aligned segment. */ |
dstw = (unsigned long *) dstb; |
srcw = (const unsigned long *) srcb; |
n_words = n / word_size; /* Number of whole words to copy. */ |
n -= n_words * word_size; /* Remaining bytes at the end. */ |
/* "Fast" copy. */ |
i = n_words; |
while (i-- != 0) |
*dstw++ = *srcw++; |
/* |
* Copy the rest. |
*/ |
srcb = (const uint8_t *) srcw; |
dstb = (uint8_t *) dstw; |
i = n; |
while (i-- != 0) |
*dstb++ = *srcb++; |
return dst; |
} |
/** Move memory block with possible overlapping. */ |
void *memmove(void *dst, const void *src, size_t n) |
{ |
const uint8_t *sp; |
uint8_t *dp; |
/* Nothing to do? */ |
if (src == dst) |
return dst; |
/* Non-overlapping? */ |
if (dst >= src + n || src >= dst + n) { |
return memcpy(dst, src, n); |
} |
/* Which direction? */ |
if (src > dst) { |
/* Forwards. */ |
sp = src; |
dp = dst; |
while (n-- != 0) |
*dp++ = *sp++; |
} else { |
/* Backwards. */ |
sp = src + (n - 1); |
dp = dst + (n - 1); |
while (n-- != 0) |
*dp-- = *sp--; |
} |
return dst; |
} |
/** Compare two memory areas. |
* |
* @param s1 Pointer to the first area to compare. |
* @param s2 Pointer to the second area to compare. |
* @param len Size of the first area in bytes. Both areas must have |
* the same length. |
* @return If len is 0, return zero. If the areas match, return |
* zero. Otherwise return non-zero. |
*/ |
int bcmp(const char *s1, const char *s2, size_t len) |
{ |
for (; len && *s1++ == *s2++; len--) |
; |
return len; |
} |
/** @} |
*/ |
Property changes: |
Added: svn:mergeinfo |
//branches/snapshot/uspace/lib/libc/generic/loader.c |
---|
0,0 → 1,309 |
/* |
* Copyright (c) 2008 Jiri Svoboda |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libc |
* @{ |
*/ |
/** @file |
*/ |
#include <ipc/ipc.h> |
#include <ipc/loader.h> |
#include <ipc/services.h> |
#include <libc.h> |
#include <task.h> |
#include <string.h> |
#include <stdlib.h> |
#include <async.h> |
#include <errno.h> |
#include <vfs/vfs.h> |
#include <loader/loader.h> |
/** Connect to a new program loader. |
* |
* Spawns a new program loader task and returns the connection structure. |
* |
* @param name Symbolic name to set on the newly created task. |
* |
* @return Pointer to the loader connection structure (should be |
* deallocated using free() after use). |
* |
*/ |
int loader_spawn(const char *name) |
{ |
return __SYSCALL2(SYS_PROGRAM_SPAWN_LOADER, |
(sysarg_t) name, str_size(name)); |
} |
loader_t *loader_connect(void) |
{ |
int phone_id = ipc_connect_me_to_blocking(PHONE_NS, SERVICE_LOAD, 0, 0); |
if (phone_id < 0) |
return NULL; |
loader_t *ldr = malloc(sizeof(loader_t)); |
if (ldr == NULL) |
return NULL; |
ldr->phone_id = phone_id; |
return ldr; |
} |
/** Get ID of the new task. |
* |
* Retrieves the ID of the new task from the loader. |
* |
* @param ldr Loader connection structure. |
* @param task_id Points to a variable where the ID should be stored. |
* |
* @return Zero on success or negative error code. |
* |
*/ |
int loader_get_task_id(loader_t *ldr, task_id_t *task_id) |
{ |
/* Get task ID. */ |
ipc_call_t answer; |
aid_t req = async_send_0(ldr->phone_id, LOADER_GET_TASKID, &answer); |
int rc = ipc_data_read_start(ldr->phone_id, task_id, sizeof(task_id_t)); |
if (rc != EOK) { |
async_wait_for(req, NULL); |
return rc; |
} |
ipcarg_t retval; |
async_wait_for(req, &retval); |
return (int) retval; |
} |
/** Set pathname of the program to load. |
* |
* Sets the name of the program file to load. The name can be relative |
* to the current working directory (it will be absolutized before |
* sending to the loader). |
* |
* @param ldr Loader connection structure. |
* @param path Pathname of the program file. |
* |
* @return Zero on success or negative error code. |
* |
*/ |
int loader_set_pathname(loader_t *ldr, const char *path) |
{ |
size_t pa_len; |
char *pa = absolutize(path, &pa_len); |
if (!pa) |
return 0; |
/* Send program pathname */ |
ipc_call_t answer; |
aid_t req = async_send_0(ldr->phone_id, LOADER_SET_PATHNAME, &answer); |
int rc = ipc_data_write_start(ldr->phone_id, (void *) pa, pa_len); |
if (rc != EOK) { |
async_wait_for(req, NULL); |
return rc; |
} |
free(pa); |
ipcarg_t retval; |
async_wait_for(req, &retval); |
return (int) retval; |
} |
/** Set command-line arguments for the program. |
* |
* Sets the vector of command-line arguments to be passed to the loaded |
* program. By convention, the very first argument is typically the same as |
* the command used to execute the program. |
* |
* @param ldr Loader connection structure. |
* @param argv NULL-terminated array of pointers to arguments. |
* |
* @return Zero on success or negative error code. |
* |
*/ |
int loader_set_args(loader_t *ldr, char *const argv[]) |
{ |
/* |
* Serialize the arguments into a single array. First |
* compute size of the buffer needed. |
*/ |
char *const *ap = argv; |
size_t buffer_size = 0; |
while (*ap != NULL) { |
buffer_size += str_size(*ap) + 1; |
ap++; |
} |
char *arg_buf = malloc(buffer_size); |
if (arg_buf == NULL) |
return ENOMEM; |
/* Now fill the buffer with null-terminated argument strings */ |
ap = argv; |
char *dp = arg_buf; |
while (*ap != NULL) { |
str_cpy(dp, buffer_size - (dp - arg_buf), *ap); |
dp += str_size(*ap) + 1; |
ap++; |
} |
/* Send serialized arguments to the loader */ |
ipc_call_t answer; |
aid_t req = async_send_0(ldr->phone_id, LOADER_SET_ARGS, &answer); |
ipcarg_t rc = ipc_data_write_start(ldr->phone_id, (void *) arg_buf, buffer_size); |
if (rc != EOK) { |
async_wait_for(req, NULL); |
return rc; |
} |
async_wait_for(req, &rc); |
if (rc != EOK) |
return rc; |
/* Free temporary buffer */ |
free(arg_buf); |
return EOK; |
} |
/** Set preset files for the program. |
* |
* Sets the vector of preset files to be passed to the loaded |
* program. By convention, the first three files represent stdin, |
* stdout and stderr respectively. |
* |
* @param ldr Loader connection structure. |
* @param files NULL-terminated array of pointers to files. |
* |
* @return Zero on success or negative error code. |
* |
*/ |
int loader_set_files(loader_t *ldr, fdi_node_t *const files[]) |
{ |
/* |
* Serialize the arguments into a single array. First |
* compute size of the buffer needed. |
*/ |
fdi_node_t *const *ap = files; |
size_t count = 0; |
while (*ap != NULL) { |
count++; |
ap++; |
} |
fdi_node_t *files_buf; |
files_buf = (fdi_node_t *) malloc(count * sizeof(fdi_node_t)); |
if (files_buf == NULL) |
return ENOMEM; |
/* Fill the buffer */ |
size_t i; |
for (i = 0; i < count; i++) |
files_buf[i] = *files[i]; |
/* Send serialized files to the loader */ |
ipc_call_t answer; |
aid_t req = async_send_0(ldr->phone_id, LOADER_SET_FILES, &answer); |
ipcarg_t rc = ipc_data_write_start(ldr->phone_id, (void *) files_buf, |
count * sizeof(fdi_node_t)); |
if (rc != EOK) { |
async_wait_for(req, NULL); |
return rc; |
} |
async_wait_for(req, &rc); |
if (rc != EOK) |
return rc; |
/* Free temporary buffer */ |
free(files_buf); |
return EOK; |
} |
/** Instruct loader to load the program. |
* |
* If this function succeeds, the program has been successfully loaded |
* and is ready to be executed. |
* |
* @param ldr Loader connection structure. |
* |
* @return Zero on success or negative error code. |
* |
*/ |
int loader_load_program(loader_t *ldr) |
{ |
return (int) async_req_0_0(ldr->phone_id, LOADER_LOAD); |
} |
/** Instruct loader to execute the program. |
* |
* Note that this function blocks until the loader actually replies |
* so you cannot expect this function to return if you are debugging |
* the task and its thread is stopped. |
* |
* After using this function, no further operations must be performed |
* on the loader structure. It should be de-allocated using free(). |
* |
* @param ldr Loader connection structure. |
* |
* @return Zero on success or negative error code. |
* |
*/ |
int loader_run(loader_t *ldr) |
{ |
int rc = async_req_0_0(ldr->phone_id, LOADER_RUN); |
if (rc != EOK) |
return rc; |
ipc_hangup(ldr->phone_id); |
ldr->phone_id = 0; |
return EOK; |
} |
/** Cancel the loader session. |
* |
* Tells the loader not to load any program and terminate. |
* After using this function, no further operations must be performed |
* on the loader structure. It should be de-allocated using free(). |
* |
* @param ldr Loader connection structure. |
* |
* @return Zero on success or negative error code. |
* |
*/ |
void loader_abort(loader_t *ldr) |
{ |
ipc_hangup(ldr->phone_id); |
ldr->phone_id = 0; |
} |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/generic/string.c |
---|
0,0 → 1,889 |
/* |
* Copyright (c) 2005 Martin Decky |
* Copyright (c) 2008 Jiri Svoboda |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libc |
* @{ |
*/ |
/** @file |
*/ |
#include <string.h> |
#include <stdlib.h> |
#include <assert.h> |
#include <limits.h> |
#include <ctype.h> |
#include <malloc.h> |
#include <errno.h> |
#include <align.h> |
#include <mem.h> |
#include <string.h> |
/** Byte mask consisting of lowest @n bits (out of 8) */ |
#define LO_MASK_8(n) ((uint8_t) ((1 << (n)) - 1)) |
/** Byte mask consisting of lowest @n bits (out of 32) */ |
#define LO_MASK_32(n) ((uint32_t) ((1 << (n)) - 1)) |
/** Byte mask consisting of highest @n bits (out of 8) */ |
#define HI_MASK_8(n) (~LO_MASK_8(8 - (n))) |
/** Number of data bits in a UTF-8 continuation byte */ |
#define CONT_BITS 6 |
/** Decode a single character from a string. |
* |
* Decode a single character from a string of size @a size. Decoding starts |
* at @a offset and this offset is moved to the beginning of the next |
* character. In case of decoding error, offset generally advances at least |
* by one. However, offset is never moved beyond size. |
* |
* @param str String (not necessarily NULL-terminated). |
* @param offset Byte offset in string where to start decoding. |
* @param size Size of the string (in bytes). |
* |
* @return Value of decoded character, U_SPECIAL on decoding error or |
* NULL if attempt to decode beyond @a size. |
* |
*/ |
wchar_t str_decode(const char *str, size_t *offset, size_t size) |
{ |
if (*offset + 1 > size) |
return 0; |
/* First byte read from string */ |
uint8_t b0 = (uint8_t) str[(*offset)++]; |
/* Determine code length */ |
unsigned int b0_bits; /* Data bits in first byte */ |
unsigned int cbytes; /* Number of continuation bytes */ |
if ((b0 & 0x80) == 0) { |
/* 0xxxxxxx (Plain ASCII) */ |
b0_bits = 7; |
cbytes = 0; |
} else if ((b0 & 0xe0) == 0xc0) { |
/* 110xxxxx 10xxxxxx */ |
b0_bits = 5; |
cbytes = 1; |
} else if ((b0 & 0xf0) == 0xe0) { |
/* 1110xxxx 10xxxxxx 10xxxxxx */ |
b0_bits = 4; |
cbytes = 2; |
} else if ((b0 & 0xf8) == 0xf0) { |
/* 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx */ |
b0_bits = 3; |
cbytes = 3; |
} else { |
/* 10xxxxxx -- unexpected continuation byte */ |
return U_SPECIAL; |
} |
if (*offset + cbytes > size) |
return U_SPECIAL; |
wchar_t ch = b0 & LO_MASK_8(b0_bits); |
/* Decode continuation bytes */ |
while (cbytes > 0) { |
uint8_t b = (uint8_t) str[(*offset)++]; |
/* Must be 10xxxxxx */ |
if ((b & 0xc0) != 0x80) |
return U_SPECIAL; |
/* Shift data bits to ch */ |
ch = (ch << CONT_BITS) | (wchar_t) (b & LO_MASK_8(CONT_BITS)); |
cbytes--; |
} |
return ch; |
} |
/** Encode a single character to string representation. |
* |
* Encode a single character to string representation (i.e. UTF-8) and store |
* it into a buffer at @a offset. Encoding starts at @a offset and this offset |
* is moved to the position where the next character can be written to. |
* |
* @param ch Input character. |
* @param str Output buffer. |
* @param offset Byte offset where to start writing. |
* @param size Size of the output buffer (in bytes). |
* |
* @return EOK if the character was encoded successfully, EOVERFLOW if there |
* was not enough space in the output buffer or EINVAL if the character |
* code was invalid. |
*/ |
int chr_encode(const wchar_t ch, char *str, size_t *offset, size_t size) |
{ |
if (*offset >= size) |
return EOVERFLOW; |
if (!chr_check(ch)) |
return EINVAL; |
/* Unsigned version of ch (bit operations should only be done |
on unsigned types). */ |
uint32_t cc = (uint32_t) ch; |
/* Determine how many continuation bytes are needed */ |
unsigned int b0_bits; /* Data bits in first byte */ |
unsigned int cbytes; /* Number of continuation bytes */ |
if ((cc & ~LO_MASK_32(7)) == 0) { |
b0_bits = 7; |
cbytes = 0; |
} else if ((cc & ~LO_MASK_32(11)) == 0) { |
b0_bits = 5; |
cbytes = 1; |
} else if ((cc & ~LO_MASK_32(16)) == 0) { |
b0_bits = 4; |
cbytes = 2; |
} else if ((cc & ~LO_MASK_32(21)) == 0) { |
b0_bits = 3; |
cbytes = 3; |
} else { |
/* Codes longer than 21 bits are not supported */ |
return EINVAL; |
} |
/* Check for available space in buffer */ |
if (*offset + cbytes >= size) |
return EOVERFLOW; |
/* Encode continuation bytes */ |
unsigned int i; |
for (i = cbytes; i > 0; i--) { |
str[*offset + i] = 0x80 | (cc & LO_MASK_32(CONT_BITS)); |
cc = cc >> CONT_BITS; |
} |
/* Encode first byte */ |
str[*offset] = (cc & LO_MASK_32(b0_bits)) | HI_MASK_8(8 - b0_bits - 1); |
/* Advance offset */ |
*offset += cbytes + 1; |
return EOK; |
} |
/** Get size of string. |
* |
* Get the number of bytes which are used by the string @a str (excluding the |
* NULL-terminator). |
* |
* @param str String to consider. |
* |
* @return Number of bytes used by the string |
* |
*/ |
size_t str_size(const char *str) |
{ |
size_t size = 0; |
while (*str++ != 0) |
size++; |
return size; |
} |
/** Get size of wide string. |
* |
* Get the number of bytes which are used by the wide string @a str (excluding the |
* NULL-terminator). |
* |
* @param str Wide string to consider. |
* |
* @return Number of bytes used by the wide string |
* |
*/ |
size_t wstr_size(const wchar_t *str) |
{ |
return (wstr_length(str) * sizeof(wchar_t)); |
} |
/** Get size of string with length limit. |
* |
* Get the number of bytes which are used by up to @a max_len first |
* characters in the string @a str. If @a max_len is greater than |
* the length of @a str, the entire string is measured (excluding the |
* NULL-terminator). |
* |
* @param str String to consider. |
* @param max_len Maximum number of characters to measure. |
* |
* @return Number of bytes used by the characters. |
* |
*/ |
size_t str_lsize(const char *str, size_t max_len) |
{ |
size_t len = 0; |
size_t offset = 0; |
while (len < max_len) { |
if (str_decode(str, &offset, STR_NO_LIMIT) == 0) |
break; |
len++; |
} |
return offset; |
} |
/** Get size of wide string with length limit. |
* |
* Get the number of bytes which are used by up to @a max_len first |
* wide characters in the wide string @a str. If @a max_len is greater than |
* the length of @a str, the entire wide string is measured (excluding the |
* NULL-terminator). |
* |
* @param str Wide string to consider. |
* @param max_len Maximum number of wide characters to measure. |
* |
* @return Number of bytes used by the wide characters. |
* |
*/ |
size_t wstr_lsize(const wchar_t *str, size_t max_len) |
{ |
return (wstr_nlength(str, max_len * sizeof(wchar_t)) * sizeof(wchar_t)); |
} |
/** Get number of characters in a string. |
* |
* @param str NULL-terminated string. |
* |
* @return Number of characters in string. |
* |
*/ |
size_t str_length(const char *str) |
{ |
size_t len = 0; |
size_t offset = 0; |
while (str_decode(str, &offset, STR_NO_LIMIT) != 0) |
len++; |
return len; |
} |
/** Get number of characters in a wide string. |
* |
* @param str NULL-terminated wide string. |
* |
* @return Number of characters in @a str. |
* |
*/ |
size_t wstr_length(const wchar_t *wstr) |
{ |
size_t len = 0; |
while (*wstr++ != 0) |
len++; |
return len; |
} |
/** Get number of characters in a string with size limit. |
* |
* @param str NULL-terminated string. |
* @param size Maximum number of bytes to consider. |
* |
* @return Number of characters in string. |
* |
*/ |
size_t str_nlength(const char *str, size_t size) |
{ |
size_t len = 0; |
size_t offset = 0; |
while (str_decode(str, &offset, size) != 0) |
len++; |
return len; |
} |
/** Get number of characters in a string with size limit. |
* |
* @param str NULL-terminated string. |
* @param size Maximum number of bytes to consider. |
* |
* @return Number of characters in string. |
* |
*/ |
size_t wstr_nlength(const wchar_t *str, size_t size) |
{ |
size_t len = 0; |
size_t limit = ALIGN_DOWN(size, sizeof(wchar_t)); |
size_t offset = 0; |
while ((offset < limit) && (*str++ != 0)) { |
len++; |
offset += sizeof(wchar_t); |
} |
return len; |
} |
/** Check whether character is plain ASCII. |
* |
* @return True if character is plain ASCII. |
* |
*/ |
bool ascii_check(wchar_t ch) |
{ |
if ((ch >= 0) && (ch <= 127)) |
return true; |
return false; |
} |
/** Check whether character is valid |
* |
* @return True if character is a valid Unicode code point. |
* |
*/ |
bool chr_check(wchar_t ch) |
{ |
if ((ch >= 0) && (ch <= 1114111)) |
return true; |
return false; |
} |
/** Compare two NULL terminated strings. |
* |
* Do a char-by-char comparison of two NULL-terminated strings. |
* The strings are considered equal iff they consist of the same |
* characters on the minimum of their lengths. |
* |
* @param s1 First string to compare. |
* @param s2 Second string to compare. |
* |
* @return 0 if the strings are equal, -1 if first is smaller, |
* 1 if second smaller. |
* |
*/ |
int str_cmp(const char *s1, const char *s2) |
{ |
wchar_t c1 = 0; |
wchar_t c2 = 0; |
size_t off1 = 0; |
size_t off2 = 0; |
while (true) { |
c1 = str_decode(s1, &off1, STR_NO_LIMIT); |
c2 = str_decode(s2, &off2, STR_NO_LIMIT); |
if (c1 < c2) |
return -1; |
if (c1 > c2) |
return 1; |
if (c1 == 0 || c2 == 0) |
break; |
} |
return 0; |
} |
/** Compare two NULL terminated strings with length limit. |
* |
* Do a char-by-char comparison of two NULL-terminated strings. |
* The strings are considered equal iff they consist of the same |
* characters on the minimum of their lengths and the length limit. |
* |
* @param s1 First string to compare. |
* @param s2 Second string to compare. |
* @param max_len Maximum number of characters to consider. |
* |
* @return 0 if the strings are equal, -1 if first is smaller, |
* 1 if second smaller. |
* |
*/ |
int str_lcmp(const char *s1, const char *s2, size_t max_len) |
{ |
wchar_t c1 = 0; |
wchar_t c2 = 0; |
size_t off1 = 0; |
size_t off2 = 0; |
size_t len = 0; |
while (true) { |
if (len >= max_len) |
break; |
c1 = str_decode(s1, &off1, STR_NO_LIMIT); |
c2 = str_decode(s2, &off2, STR_NO_LIMIT); |
if (c1 < c2) |
return -1; |
if (c1 > c2) |
return 1; |
if (c1 == 0 || c2 == 0) |
break; |
++len; |
} |
return 0; |
} |
/** Copy string. |
* |
* Copy source string @a src to destination buffer @a dest. |
* No more than @a size bytes are written. If the size of the output buffer |
* is at least one byte, the output string will always be well-formed, i.e. |
* null-terminated and containing only complete characters. |
* |
* @param dst Destination buffer. |
* @param count Size of the destination buffer (must be > 0). |
* @param src Source string. |
*/ |
void str_cpy(char *dest, size_t size, const char *src) |
{ |
wchar_t ch; |
size_t src_off; |
size_t dest_off; |
/* There must be space for a null terminator in the buffer. */ |
assert(size > 0); |
src_off = 0; |
dest_off = 0; |
while ((ch = str_decode(src, &src_off, STR_NO_LIMIT)) != 0) { |
if (chr_encode(ch, dest, &dest_off, size - 1) != EOK) |
break; |
} |
dest[dest_off] = '\0'; |
} |
/** Copy size-limited substring. |
* |
* Copy prefix of string @a src of max. size @a size to destination buffer |
* @a dest. No more than @a size bytes are written. The output string will |
* always be well-formed, i.e. null-terminated and containing only complete |
* characters. |
* |
* No more than @a n bytes are read from the input string, so it does not |
* have to be null-terminated. |
* |
* @param dst Destination buffer. |
* @param count Size of the destination buffer (must be > 0). |
* @param src Source string. |
* @param n Maximum number of bytes to read from @a src. |
*/ |
void str_ncpy(char *dest, size_t size, const char *src, size_t n) |
{ |
wchar_t ch; |
size_t src_off; |
size_t dest_off; |
/* There must be space for a null terminator in the buffer. */ |
assert(size > 0); |
src_off = 0; |
dest_off = 0; |
while ((ch = str_decode(src, &src_off, n)) != 0) { |
if (chr_encode(ch, dest, &dest_off, size - 1) != EOK) |
break; |
} |
dest[dest_off] = '\0'; |
} |
/** Append one string to another. |
* |
* Append source string @a src to string in destination buffer @a dest. |
* Size of the destination buffer is @a dest. If the size of the output buffer |
* is at least one byte, the output string will always be well-formed, i.e. |
* null-terminated and containing only complete characters. |
* |
* @param dst Destination buffer. |
* @param count Size of the destination buffer. |
* @param src Source string. |
*/ |
void str_append(char *dest, size_t size, const char *src) |
{ |
size_t dstr_size; |
dstr_size = str_size(dest); |
str_cpy(dest + dstr_size, size - dstr_size, src); |
} |
/** Copy NULL-terminated wide string to string |
* |
* Copy source wide string @a src to destination buffer @a dst. |
* No more than @a size bytes are written. NULL-terminator is always |
* written after the last succesfully copied character (i.e. if the |
* destination buffer is has at least 1 byte, it will be always |
* NULL-terminated). |
* |
* @param src Source wide string. |
* @param dst Destination buffer. |
* @param count Size of the destination buffer. |
* |
*/ |
void wstr_nstr(char *dst, const wchar_t *src, size_t size) |
{ |
/* No space for the NULL-terminator in the buffer */ |
if (size == 0) |
return; |
wchar_t ch; |
size_t src_idx = 0; |
size_t dst_off = 0; |
while ((ch = src[src_idx++]) != 0) { |
if (chr_encode(ch, dst, &dst_off, size) != EOK) |
break; |
} |
if (dst_off >= size) |
dst[size - 1] = 0; |
else |
dst[dst_off] = 0; |
} |
/** Find first occurence of character in string. |
* |
* @param str String to search. |
* @param ch Character to look for. |
* |
* @return Pointer to character in @a str or NULL if not found. |
*/ |
const char *str_chr(const char *str, wchar_t ch) |
{ |
wchar_t acc; |
size_t off = 0; |
size_t last = 0; |
while ((acc = str_decode(str, &off, STR_NO_LIMIT)) != 0) { |
if (acc == ch) |
return (str + last); |
last = off; |
} |
return NULL; |
} |
/** Find last occurence of character in string. |
* |
* @param str String to search. |
* @param ch Character to look for. |
* |
* @return Pointer to character in @a str or NULL if not found. |
*/ |
const char *str_rchr(const char *str, wchar_t ch) |
{ |
wchar_t acc; |
size_t off = 0; |
size_t last = 0; |
const char *res = NULL; |
while ((acc = str_decode(str, &off, STR_NO_LIMIT)) != 0) { |
if (acc == ch) |
res = (str + last); |
last = off; |
} |
return res; |
} |
/** Insert a wide character into a wide string. |
* |
* Insert a wide character into a wide string at position |
* @a pos. The characters after the position are shifted. |
* |
* @param str String to insert to. |
* @param ch Character to insert to. |
* @param pos Character index where to insert. |
@ @param max_pos Characters in the buffer. |
* |
* @return True if the insertion was sucessful, false if the position |
* is out of bounds. |
* |
*/ |
bool wstr_linsert(wchar_t *str, wchar_t ch, size_t pos, size_t max_pos) |
{ |
size_t len = wstr_length(str); |
if ((pos > len) || (pos + 1 > max_pos)) |
return false; |
size_t i; |
for (i = len; i + 1 > pos; i--) |
str[i + 1] = str[i]; |
str[pos] = ch; |
return true; |
} |
/** Remove a wide character from a wide string. |
* |
* Remove a wide character from a wide string at position |
* @a pos. The characters after the position are shifted. |
* |
* @param str String to remove from. |
* @param pos Character index to remove. |
* |
* @return True if the removal was sucessful, false if the position |
* is out of bounds. |
* |
*/ |
bool wstr_remove(wchar_t *str, size_t pos) |
{ |
size_t len = wstr_length(str); |
if (pos >= len) |
return false; |
size_t i; |
for (i = pos + 1; i <= len; i++) |
str[i - 1] = str[i]; |
return true; |
} |
int stricmp(const char *a, const char *b) |
{ |
int c = 0; |
while (a[c] && b[c] && (!(tolower(a[c]) - tolower(b[c])))) |
c++; |
return (tolower(a[c]) - tolower(b[c])); |
} |
/** Convert string to a number. |
* Core of strtol and strtoul functions. |
* |
* @param nptr Pointer to string. |
* @param endptr If not NULL, function stores here pointer to the first |
* invalid character. |
* @param base Zero or number between 2 and 36 inclusive. |
* @param sgn It's set to 1 if minus found. |
* @return Result of conversion. |
*/ |
static unsigned long |
_strtoul(const char *nptr, char **endptr, int base, char *sgn) |
{ |
unsigned char c; |
unsigned long result = 0; |
unsigned long a, b; |
const char *str = nptr; |
const char *tmpptr; |
while (isspace(*str)) |
str++; |
if (*str == '-') { |
*sgn = 1; |
++str; |
} else if (*str == '+') |
++str; |
if (base) { |
if ((base == 1) || (base > 36)) { |
/* FIXME: set errno to EINVAL */ |
return 0; |
} |
if ((base == 16) && (*str == '0') && ((str[1] == 'x') || |
(str[1] == 'X'))) { |
str += 2; |
} |
} else { |
base = 10; |
if (*str == '0') { |
base = 8; |
if ((str[1] == 'X') || (str[1] == 'x')) { |
base = 16; |
str += 2; |
} |
} |
} |
tmpptr = str; |
while (*str) { |
c = *str; |
c = (c >= 'a' ? c - 'a' + 10 : (c >= 'A' ? c - 'A' + 10 : |
(c <= '9' ? c - '0' : 0xff))); |
if (c > base) { |
break; |
} |
a = (result & 0xff) * base + c; |
b = (result >> 8) * base + (a >> 8); |
if (b > (ULONG_MAX >> 8)) { |
/* overflow */ |
/* FIXME: errno = ERANGE*/ |
return ULONG_MAX; |
} |
result = (b << 8) + (a & 0xff); |
++str; |
} |
if (str == tmpptr) { |
/* |
* No number was found => first invalid character is the first |
* character of the string. |
*/ |
/* FIXME: set errno to EINVAL */ |
str = nptr; |
result = 0; |
} |
if (endptr) |
*endptr = (char *) str; |
if (nptr == str) { |
/*FIXME: errno = EINVAL*/ |
return 0; |
} |
return result; |
} |
/** Convert initial part of string to long int according to given base. |
* The number may begin with an arbitrary number of whitespaces followed by |
* optional sign (`+' or `-'). If the base is 0 or 16, the prefix `0x' may be |
* inserted and the number will be taken as hexadecimal one. If the base is 0 |
* and the number begin with a zero, number will be taken as octal one (as with |
* base 8). Otherwise the base 0 is taken as decimal. |
* |
* @param nptr Pointer to string. |
* @param endptr If not NULL, function stores here pointer to the first |
* invalid character. |
* @param base Zero or number between 2 and 36 inclusive. |
* @return Result of conversion. |
*/ |
long int strtol(const char *nptr, char **endptr, int base) |
{ |
char sgn = 0; |
unsigned long number = 0; |
number = _strtoul(nptr, endptr, base, &sgn); |
if (number > LONG_MAX) { |
if ((sgn) && (number == (unsigned long) (LONG_MAX) + 1)) { |
/* FIXME: set 0 to errno */ |
return number; |
} |
/* FIXME: set ERANGE to errno */ |
return (sgn ? LONG_MIN : LONG_MAX); |
} |
return (sgn ? -number : number); |
} |
/** Convert initial part of string to unsigned long according to given base. |
* The number may begin with an arbitrary number of whitespaces followed by |
* optional sign (`+' or `-'). If the base is 0 or 16, the prefix `0x' may be |
* inserted and the number will be taken as hexadecimal one. If the base is 0 |
* and the number begin with a zero, number will be taken as octal one (as with |
* base 8). Otherwise the base 0 is taken as decimal. |
* |
* @param nptr Pointer to string. |
* @param endptr If not NULL, function stores here pointer to the first |
* invalid character |
* @param base Zero or number between 2 and 36 inclusive. |
* @return Result of conversion. |
*/ |
unsigned long strtoul(const char *nptr, char **endptr, int base) |
{ |
char sgn = 0; |
unsigned long number = 0; |
number = _strtoul(nptr, endptr, base, &sgn); |
return (sgn ? -number : number); |
} |
char *str_dup(const char *src) |
{ |
size_t size = str_size(src); |
void *dest = malloc(size + 1); |
if (dest == NULL) |
return (char *) NULL; |
return (char *) memcpy(dest, src, size + 1); |
} |
char *strtok(char *s, const char *delim) |
{ |
static char *next; |
return strtok_r(s, delim, &next); |
} |
char *strtok_r(char *s, const char *delim, char **next) |
{ |
char *start, *end; |
if (s == NULL) |
s = *next; |
/* Skip over leading delimiters. */ |
while (*s && (str_chr(delim, *s) != NULL)) ++s; |
start = s; |
/* Skip over token characters. */ |
while (*s && (str_chr(delim, *s) == NULL)) ++s; |
end = s; |
*next = (*s ? s + 1 : s); |
if (start == end) { |
return NULL; /* No more tokens. */ |
} |
/* Overwrite delimiter with NULL terminator. */ |
*end = '\0'; |
return start; |
} |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/generic/ddi.c |
---|
0,0 → 1,139 |
/* |
* Copyright (c) 2006 Jakub Jermar |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libc |
* @{ |
*/ |
/** @file |
*/ |
#include <ddi.h> |
#include <libarch/ddi.h> |
#include <libc.h> |
#include <task.h> |
#include <as.h> |
#include <align.h> |
#include <libarch/config.h> |
#include <kernel/ddi/ddi_arg.h> |
/** Return unique device number. |
* |
* @return New unique device number. |
* |
*/ |
int device_assign_devno(void) |
{ |
return __SYSCALL0(SYS_DEVICE_ASSIGN_DEVNO); |
} |
/** Map piece of physical memory to task. |
* |
* Caller of this function must have the CAP_MEM_MANAGER capability. |
* |
* @param pf Physical address of the starting frame. |
* @param vp Virtual address of the starting page. |
* @param pages Number of pages to map. |
* @param flags Flags for the new address space area. |
* |
* @return 0 on success, EPERM if the caller lacks the |
* CAP_MEM_MANAGER capability, ENOENT if there is no task |
* with specified ID and ENOMEM if there was some problem |
* in creating address space area. |
*/ |
int physmem_map(void *pf, void *vp, unsigned long pages, int flags) |
{ |
return __SYSCALL4(SYS_PHYSMEM_MAP, (sysarg_t) pf, (sysarg_t) vp, pages, |
flags); |
} |
/** Enable I/O space range to task. |
* |
* Caller of this function must have the IO_MEM_MANAGER capability. |
* |
* @param id Task ID. |
* @param ioaddr Starting address of the I/O range. |
* @param size Size of the range. |
* |
* @return 0 on success, EPERM if the caller lacks the |
* CAP_IO_MANAGER capability, ENOENT if there is no task |
* with specified ID and ENOMEM if there was some problem |
* in allocating memory. |
*/ |
int iospace_enable(task_id_t id, void *ioaddr, unsigned long size) |
{ |
ddi_ioarg_t arg; |
arg.task_id = id; |
arg.ioaddr = ioaddr; |
arg.size = size; |
return __SYSCALL1(SYS_IOSPACE_ENABLE, (sysarg_t) &arg); |
} |
/** Interrupt control |
* |
* @param enable 1 - enable interrupts, 0 - disable interrupts |
*/ |
int preemption_control(int enable) |
{ |
return __SYSCALL1(SYS_PREEMPT_CONTROL, (sysarg_t) enable); |
} |
/** Enable PIO for specified I/O range. |
* |
* @param pio_addr I/O start address. |
* @param size Size of the I/O region. |
* @param use_addr Address where the final address for application's PIO |
* will be stored. |
* |
* @return Zero on success or negative error code. |
*/ |
int pio_enable(void *pio_addr, size_t size, void **use_addr) |
{ |
void *phys; |
void *virt; |
size_t offset; |
unsigned int pages; |
#ifdef IO_SPACE_BOUNDARY |
if (pio_addr < IO_SPACE_BOUNDARY) { |
*use_addr = pio_addr; |
return iospace_enable(task_get_id(), pio_addr, size); |
} |
#endif |
phys = (void *) ALIGN_DOWN((uintptr_t) pio_addr, PAGE_SIZE); |
offset = pio_addr - phys; |
pages = ALIGN_UP(offset + size, PAGE_SIZE) >> PAGE_WIDTH; |
virt = as_get_mappable_page(pages << PAGE_WIDTH); |
*use_addr = virt + offset; |
return physmem_map(phys, virt, pages, AS_AREA_READ | AS_AREA_WRITE); |
} |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/generic/thread.c |
---|
0,0 → 1,174 |
/* |
* Copyright (c) 2006 Jakub Jermar |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libc |
* @{ |
*/ |
/** @file |
*/ |
#include <thread.h> |
#include <libc.h> |
#include <stdlib.h> |
#include <libarch/faddr.h> |
#include <kernel/proc/uarg.h> |
#include <fibril.h> |
#include <string.h> |
#include <async.h> |
#ifndef THREAD_INITIAL_STACK_PAGES_NO |
#define THREAD_INITIAL_STACK_PAGES_NO 1 |
#endif |
/** Main thread function. |
* |
* This function is called from __thread_entry() and is used |
* to call the thread's implementing function and perform cleanup |
* and exit when thread returns back. Do not call this function |
* directly. |
* |
* @param uarg Pointer to userspace argument structure. |
*/ |
void __thread_main(uspace_arg_t *uarg) |
{ |
fibril_t *f; |
f = fibril_setup(); |
__tcb_set(f->tcb); |
uarg->uspace_thread_function(uarg->uspace_thread_arg); |
/* XXX: we cannot free the userspace stack while running on it */ |
// free(uarg->uspace_stack); |
// free(uarg); |
/* If there is a manager, destroy it */ |
async_destroy_manager(); |
fibril_teardown(f); |
thread_exit(0); |
} |
/** Create userspace thread. |
* |
* This function creates new userspace thread and allocates userspace |
* stack and userspace argument structure for it. |
* |
* @param function Function implementing the thread. |
* @param arg Argument to be passed to thread. |
* @param name Symbolic name of the thread. |
* @param tid Thread ID of the newly created thread. |
* |
* @return Zero on success or a code from @ref errno.h on failure. |
*/ |
int thread_create(void (* function)(void *), void *arg, char *name, |
thread_id_t *tid) |
{ |
char *stack; |
uspace_arg_t *uarg; |
int rc; |
stack = (char *) malloc(getpagesize() * THREAD_INITIAL_STACK_PAGES_NO); |
if (!stack) |
return -1; |
uarg = (uspace_arg_t *) malloc(sizeof(uspace_arg_t)); |
if (!uarg) { |
free(stack); |
return -1; |
} |
uarg->uspace_entry = (void *) FADDR(__thread_entry); |
uarg->uspace_stack = (void *) stack; |
uarg->uspace_thread_function = function; |
uarg->uspace_thread_arg = arg; |
uarg->uspace_uarg = uarg; |
rc = __SYSCALL4(SYS_THREAD_CREATE, (sysarg_t) uarg, (sysarg_t) name, |
(sysarg_t) str_size(name), (sysarg_t) tid); |
if (rc) { |
/* |
* Failed to create a new thread. |
* Free up the allocated structures. |
*/ |
free(uarg); |
free(stack); |
} |
return rc; |
} |
/** Terminate current thread. |
* |
* @param status Exit status. Currently not used. |
*/ |
void thread_exit(int status) |
{ |
__SYSCALL1(SYS_THREAD_EXIT, (sysarg_t) status); |
for (;;) |
; |
} |
/** Detach thread. |
* |
* Currently not implemented. |
* |
* @param thread TID. |
*/ |
void thread_detach(thread_id_t thread) |
{ |
} |
/** Join thread. |
* |
* Currently not implemented. |
* |
* @param thread TID. |
* |
* @return Thread exit status. |
*/ |
int thread_join(thread_id_t thread) |
{ |
return 0; |
} |
/** Get current thread ID. |
* |
* @return Current thread ID. |
*/ |
thread_id_t thread_get_id(void) |
{ |
thread_id_t thread_id; |
(void) __SYSCALL1(SYS_THREAD_GET_ID, (sysarg_t) &thread_id); |
return thread_id; |
} |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/generic/sysinfo.c |
---|
0,0 → 1,46 |
/* |
* Copyright (c) 2006 Jakub Jermar |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libc |
* @{ |
*/ |
/** @file |
*/ |
#include <libc.h> |
#include <sysinfo.h> |
#include <string.h> |
sysarg_t sysinfo_value(char *name) |
{ |
return __SYSCALL2(SYS_SYSINFO_VALUE, (sysarg_t ) name, |
(sysarg_t) str_size(name)); |
} |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/generic/event.c |
---|
0,0 → 1,57 |
/* |
* Copyright (c) 2009 Jakub Jermar |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libc |
* @{ |
* @} |
*/ |
/** @addtogroup libc |
*/ |
/** @file |
*/ |
#include <libc.h> |
#include <event.h> |
#include <kernel/ipc/event_types.h> |
#include <ipc/ipc.h> |
/** Subscribe for event notifications. |
* |
* @param evno Event number. |
* @param method Use this method for notifying me. |
* |
* @return Value returned by the kernel. |
*/ |
int event_subscribe(event_type_t e, ipcarg_t method) |
{ |
return __SYSCALL2(SYS_EVENT_SUBSCRIBE, (sysarg_t) e, (sysarg_t) method); |
} |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/generic/time.c |
---|
0,0 → 1,219 |
/* |
* Copyright (c) 2006 Ondrej Palkovsky |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libc |
* @{ |
*/ |
/** @file |
*/ |
#include <sys/time.h> |
#include <unistd.h> |
#include <ipc/ipc.h> |
#include <stdio.h> |
#include <arch/barrier.h> |
#include <unistd.h> |
#include <atomic.h> |
#include <futex.h> |
#include <sysinfo.h> |
#include <ipc/services.h> |
#include <sysinfo.h> |
#include <as.h> |
#include <ddi.h> |
#include <time.h> |
/* Pointers to public variables with time */ |
struct { |
volatile sysarg_t seconds1; |
volatile sysarg_t useconds; |
volatile sysarg_t seconds2; |
} *ktime = NULL; |
/** Add microseconds to given timeval. |
* |
* @param tv Destination timeval. |
* @param usecs Number of microseconds to add. |
*/ |
void tv_add(struct timeval *tv, suseconds_t usecs) |
{ |
tv->tv_sec += usecs / 1000000; |
tv->tv_usec += usecs % 1000000; |
if (tv->tv_usec > 1000000) { |
tv->tv_sec++; |
tv->tv_usec -= 1000000; |
} |
} |
/** Subtract two timevals. |
* |
* @param tv1 First timeval. |
* @param tv2 Second timeval. |
* |
* @return Return difference between tv1 and tv2 (tv1 - tv2) in |
* microseconds. |
*/ |
suseconds_t tv_sub(struct timeval *tv1, struct timeval *tv2) |
{ |
suseconds_t result; |
result = tv1->tv_usec - tv2->tv_usec; |
result += (tv1->tv_sec - tv2->tv_sec) * 1000000; |
return result; |
} |
/** Decide if one timeval is greater than the other. |
* |
* @param t1 First timeval. |
* @param t2 Second timeval. |
* |
* @return Return true tv1 is greater than tv2. Otherwise return |
* false. |
*/ |
int tv_gt(struct timeval *tv1, struct timeval *tv2) |
{ |
if (tv1->tv_sec > tv2->tv_sec) |
return 1; |
if (tv1->tv_sec == tv2->tv_sec && tv1->tv_usec > tv2->tv_usec) |
return 1; |
return 0; |
} |
/** Decide if one timeval is greater than or equal to the other. |
* |
* @param tv1 First timeval. |
* @param tv2 Second timeval. |
* |
* @return Return true if tv1 is greater than or equal to tv2. |
* Otherwise return false. |
*/ |
int tv_gteq(struct timeval *tv1, struct timeval *tv2) |
{ |
if (tv1->tv_sec > tv2->tv_sec) |
return 1; |
if (tv1->tv_sec == tv2->tv_sec && tv1->tv_usec >= tv2->tv_usec) |
return 1; |
return 0; |
} |
/** POSIX gettimeofday |
* |
* The time variables are memory mapped(RO) from kernel, which updates |
* them periodically. As it is impossible to read 2 values atomically, we |
* use a trick: First read a seconds, then read microseconds, then |
* read seconds again. If a second elapsed in the meantime, set it to zero. |
* This provides assurance, that at least the |
* sequence of subsequent gettimeofday calls is ordered. |
*/ |
int gettimeofday(struct timeval *tv, struct timezone *tz) |
{ |
void *mapping; |
sysarg_t s1, s2; |
int rights; |
int res; |
if (!ktime) { |
mapping = as_get_mappable_page(PAGE_SIZE); |
/* Get the mapping of kernel clock */ |
res = ipc_share_in_start_1_1(PHONE_NS, mapping, PAGE_SIZE, |
SERVICE_MEM_REALTIME, &rights); |
if (res) { |
printf("Failed to initialize timeofday memarea\n"); |
_exit(1); |
} |
if (!(rights & AS_AREA_READ)) { |
printf("Received bad rights on time area: %X\n", |
rights); |
as_area_destroy(mapping); |
_exit(1); |
} |
ktime = mapping; |
} |
if (tz) { |
tz->tz_minuteswest = 0; |
tz->tz_dsttime = DST_NONE; |
} |
s2 = ktime->seconds2; |
read_barrier(); |
tv->tv_usec = ktime->useconds; |
read_barrier(); |
s1 = ktime->seconds1; |
if (s1 != s2) { |
tv->tv_usec = 0; |
tv->tv_sec = s1 > s2 ? s1 : s2; |
} else |
tv->tv_sec = s1; |
return 0; |
} |
time_t time(time_t *tloc) |
{ |
struct timeval tv; |
if (gettimeofday(&tv, NULL)) |
return (time_t) -1; |
if (tloc) |
*tloc = tv.tv_sec; |
return tv.tv_sec; |
} |
/** Wait unconditionally for specified number of microseconds */ |
int usleep(unsigned long usec) |
{ |
atomic_t futex = FUTEX_INITIALIZER; |
futex_initialize(&futex, 0); |
futex_down_timeout(&futex, usec, 0); |
return 0; |
} |
/** Wait unconditionally for specified number of seconds */ |
unsigned int sleep(unsigned int seconds) |
{ |
atomic_t futex = FUTEX_INITIALIZER; |
futex_initialize(&futex, 0); |
/* Sleep in 1000 second steps to support |
full argument range */ |
while (seconds > 0) { |
unsigned int period = (seconds > 1000) ? 1000 : seconds; |
futex_down_timeout(&futex, period * 1000000, 0); |
seconds -= period; |
} |
return 0; |
} |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/generic/tls.c |
---|
0,0 → 1,141 |
/* |
* Copyright (c) 2006 Jakub Jermar |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libc |
* @{ |
*/ |
/** @file |
* |
* Support for thread-local storage, as described in: |
* Drepper U.: ELF Handling For Thread-Local Storage, 2005 |
* |
* Only static model is supported. |
*/ |
#include <tls.h> |
#include <malloc.h> |
#include <string.h> |
#include <align.h> |
/** Create TLS (Thread Local Storage) data structures. |
* |
* The code requires, that sections .tdata and .tbss are adjacent. It may be |
* changed in the future. |
* |
* @return Pointer to TCB. |
*/ |
tcb_t *__make_tls(void) |
{ |
void *data; |
tcb_t *tcb; |
size_t tls_size = &_tbss_end - &_tdata_start; |
tcb = __alloc_tls(&data, tls_size); |
/* |
* Copy thread local data from the initialization image. |
*/ |
memcpy(data, &_tdata_start, &_tdata_end - &_tdata_start); |
/* |
* Zero out the thread local uninitialized data. |
*/ |
memset(data + (&_tbss_start - &_tdata_start), 0, |
&_tbss_end - &_tbss_start); |
return tcb; |
} |
void __free_tls(tcb_t *tcb) |
{ |
size_t tls_size = &_tbss_end - &_tdata_start; |
__free_tls_arch(tcb, tls_size); |
} |
#ifdef CONFIG_TLS_VARIANT_1 |
/** Allocate TLS variant 1 data structures. |
* |
* @param data Start of TLS section. This is an output argument. |
* @param size Size of tdata + tbss section. |
* @return Pointer to tcb_t structure. |
*/ |
tcb_t *tls_alloc_variant_1(void **data, size_t size) |
{ |
tcb_t *result; |
result = malloc(sizeof(tcb_t) + size); |
*data = ((void *)result) + sizeof(tcb_t); |
return result; |
} |
/** Free TLS variant I data structures. |
* |
* @param tcb Pointer to TCB structure. |
* @param size This argument is ignored. |
*/ |
void tls_free_variant_1(tcb_t *tcb, size_t size) |
{ |
free(tcb); |
} |
#endif |
#ifdef CONFIG_TLS_VARIANT_2 |
/** Allocate TLS variant II data structures. |
* |
* @param data Pointer to pointer to thread local data. This is |
* actually an output argument. |
* @param size Size of thread local data. |
* @return Pointer to TCB structure. |
*/ |
tcb_t * tls_alloc_variant_2(void **data, size_t size) |
{ |
tcb_t *tcb; |
size = ALIGN_UP(size, &_tls_alignment); |
*data = memalign((uintptr_t) &_tls_alignment, sizeof(tcb_t) + size); |
tcb = (tcb_t *) (*data + size); |
tcb->self = tcb; |
return tcb; |
} |
/** Free TLS variant II data structures. |
* |
* @param tcb Pointer to TCB structure. |
* @param size Size of thread local data. |
*/ |
void tls_free_variant_2(tcb_t *tcb, size_t size) |
{ |
size = ALIGN_UP(size, &_tls_alignment); |
void *start = ((void *) tcb) - size; |
free(start); |
} |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/generic/smc.c |
---|
0,0 → 1,46 |
/* |
* Copyright (c) 2008 Jiri Svoboda |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libc |
* @{ |
*/ |
/** @file |
*/ |
#include <libc.h> |
#include <sys/types.h> |
#include <smc.h> |
int smc_coherence(void *address, size_t size) |
{ |
return __SYSCALL2(SYS_SMC_COHERENCE, (sysarg_t) address, |
(sysarg_t) size); |
} |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/generic/udebug.c |
---|
0,0 → 1,103 |
/* |
* Copyright (c) 2008 Jiri Svoboda |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libc |
* @{ |
*/ |
/** @file |
*/ |
#include <udebug.h> |
#include <sys/types.h> |
#include <ipc/ipc.h> |
#include <async.h> |
int udebug_begin(int phoneid) |
{ |
return async_req_1_0(phoneid, IPC_M_DEBUG_ALL, UDEBUG_M_BEGIN); |
} |
int udebug_end(int phoneid) |
{ |
return async_req_1_0(phoneid, IPC_M_DEBUG_ALL, UDEBUG_M_END); |
} |
int udebug_set_evmask(int phoneid, udebug_evmask_t mask) |
{ |
return async_req_2_0(phoneid, IPC_M_DEBUG_ALL, UDEBUG_M_SET_EVMASK, |
mask); |
} |
int udebug_thread_read(int phoneid, void *buffer, size_t n, |
size_t *copied, size_t *needed) |
{ |
ipcarg_t a_copied, a_needed; |
int rc; |
rc = async_req_3_3(phoneid, IPC_M_DEBUG_ALL, UDEBUG_M_THREAD_READ, |
(sysarg_t)buffer, n, NULL, &a_copied, &a_needed); |
*copied = (size_t)a_copied; |
*needed = (size_t)a_needed; |
return rc; |
} |
int udebug_mem_read(int phoneid, void *buffer, uintptr_t addr, size_t n) |
{ |
return async_req_4_0(phoneid, IPC_M_DEBUG_ALL, UDEBUG_M_MEM_READ, |
(sysarg_t)buffer, addr, n); |
} |
int udebug_args_read(int phoneid, thash_t tid, sysarg_t *buffer) |
{ |
return async_req_3_0(phoneid, IPC_M_DEBUG_ALL, UDEBUG_M_ARGS_READ, |
tid, (sysarg_t)buffer); |
} |
int udebug_go(int phoneid, thash_t tid, udebug_event_t *ev_type, |
sysarg_t *val0, sysarg_t *val1) |
{ |
ipcarg_t a_ev_type; |
int rc; |
rc = async_req_2_3(phoneid, IPC_M_DEBUG_ALL, UDEBUG_M_GO, |
tid, &a_ev_type, val0, val1); |
*ev_type = a_ev_type; |
return rc; |
} |
int udebug_stop(int phoneid, thash_t tid) |
{ |
return async_req_2_0(phoneid, IPC_M_DEBUG_ALL, UDEBUG_M_STOP, |
tid); |
} |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/generic/pcb.c |
---|
0,0 → 1,40 |
/* |
* Copyright (c) 2008 Jiri Svoboda |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libc |
* @{ |
*/ |
/** @file |
*/ |
#include <loader/pcb.h> |
pcb_t *__pcb; |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/generic/futex.c |
---|
0,0 → 1,192 |
/* |
* Copyright (c) 2008 Jakub Jermar |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libc |
* @{ |
*/ |
/** @file |
*/ |
#include <futex.h> |
#include <atomic.h> |
#include <libc.h> |
#include <stdio.h> |
#include <sys/types.h> |
#include <kernel/synch/synch.h> |
/* |
* Note about race conditions. |
* Because of non-atomic nature of operations performed sequentially on the |
* futex counter and the futex wait queue, there is a race condition: |
* |
* (wq->missed_wakeups == 1) && (futex->count = 1) |
* |
* Scenario 1 (wait queue timeout vs. futex_up()): |
* 1. assume wq->missed_wakeups == 0 && futex->count == -1 |
* (ie. thread A sleeping, thread B in the critical section) |
* 2. A receives timeout and gets removed from the wait queue |
* 3. B wants to leave the critical section and calls futex_up() |
* 4. B thus changes futex->count from -1 to 0 |
* 5. B has to call SYS_FUTEX_WAKEUP syscall to wake up the sleeping thread |
* 6. B finds the wait queue empty and changes wq->missed_wakeups from 0 to 1 |
* 7. A fixes futex->count (i.e. the number of waiting threads) by changing it |
* from 0 to 1 |
* |
* Scenario 2 (conditional down operation vs. futex_up) |
* 1. assume wq->missed_wakeups == 0 && futex->count == 0 |
* (i.e. thread A is in the critical section) |
* 2. thread B performs futex_trydown() operation and changes futex->count from |
* 0 to -1 |
* B is now obliged to call SYS_FUTEX_SLEEP syscall |
* 3. A wants to leave the critical section and does futex_up() |
* 4. A thus changes futex->count from -1 to 0 and must call SYS_FUTEX_WAKEUP |
* syscall |
* 5. B finds the wait queue empty and immediatelly aborts the conditional sleep |
* 6. No thread is queueing in the wait queue so wq->missed_wakeups changes from |
* 0 to 1 |
* 6. B fixes futex->count (i.e. the number of waiting threads) by changing it |
* from 0 to 1 |
* |
* Both scenarios allow two threads to be in the critical section |
* simultaneously. One without kernel intervention and the other through |
* wq->missed_wakeups being 1. |
* |
* To mitigate this problem, futex_down_timeout() detects that the syscall |
* didn't sleep in the wait queue, fixes the futex counter and RETRIES the |
* whole operation again. |
*/ |
/** Initialize futex counter. |
* |
* @param futex Futex. |
* @param val Initialization value. |
*/ |
void futex_initialize(futex_t *futex, int val) |
{ |
atomic_set(futex, val); |
} |
int futex_down(futex_t *futex) |
{ |
return futex_down_timeout(futex, SYNCH_NO_TIMEOUT, SYNCH_FLAGS_NONE); |
} |
int futex_trydown(futex_t *futex) |
{ |
return futex_down_timeout(futex, SYNCH_NO_TIMEOUT, |
SYNCH_FLAGS_NON_BLOCKING); |
} |
/** Try to down the futex. |
* |
* @param futex Futex. |
* @param usec Microseconds to wait. Zero value means sleep without |
* timeout. |
* @param flags Select mode of operation. See comment for |
* waitq_sleep_timeout(). |
* |
* @return ENOENT if there is no such virtual address. One of |
* ESYNCH_OK_ATOMIC and ESYNCH_OK_BLOCKED on success or |
* ESYNCH_TIMEOUT if the lock was not acquired because of |
* a timeout or ESYNCH_WOULD_BLOCK if the operation could |
* not be carried out atomically (if requested so). |
*/ |
int futex_down_timeout(futex_t *futex, uint32_t usec, int flags) |
{ |
int rc; |
while (atomic_predec(futex) < 0) { |
rc = __SYSCALL3(SYS_FUTEX_SLEEP, (sysarg_t) &futex->count, |
(sysarg_t) usec, (sysarg_t) flags); |
switch (rc) { |
case ESYNCH_OK_ATOMIC: |
/* |
* Because of a race condition between timeout and |
* futex_up() and between conditional |
* futex_down_timeout() and futex_up(), we have to give |
* up and try again in this special case. |
*/ |
atomic_inc(futex); |
break; |
case ESYNCH_TIMEOUT: |
atomic_inc(futex); |
return ESYNCH_TIMEOUT; |
break; |
case ESYNCH_WOULD_BLOCK: |
/* |
* The conditional down operation should be implemented |
* this way. The userspace-only variant tends to |
* accumulate missed wakeups in the kernel futex wait |
* queue. |
*/ |
atomic_inc(futex); |
return ESYNCH_WOULD_BLOCK; |
break; |
case ESYNCH_OK_BLOCKED: |
/* |
* Enter the critical section. |
* The futex counter has already been incremented for |
* us. |
*/ |
return ESYNCH_OK_BLOCKED; |
break; |
default: |
return rc; |
} |
} |
/* |
* Enter the critical section. |
*/ |
return ESYNCH_OK_ATOMIC; |
} |
/** Up the futex. |
* |
* @param futex Futex. |
* |
* @return ENOENT if there is no such virtual address. Otherwise |
* zero. |
*/ |
int futex_up(futex_t *futex) |
{ |
long val; |
val = atomic_postinc(futex); |
if (val < 0) |
return __SYSCALL1(SYS_FUTEX_WAKEUP, (sysarg_t) &futex->count); |
return 0; |
} |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/generic/cap.c |
---|
0,0 → 1,75 |
/* |
* Copyright (c) 2006 Jakub Jermar |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libc |
* @{ |
*/ |
/** |
* @file cap.c |
* @brief Functions to grant/revoke capabilities to/from a task. |
*/ |
#include <cap.h> |
#include <task.h> |
#include <libc.h> |
#include <kernel/syscall/sysarg64.h> |
/** Grant capabilities to a task. |
* |
* @param id Destination task ID. |
* @param caps Capabilities to grant. |
* |
* @return Zero on success or a value from @ref errno.h on failure. |
*/ |
int cap_grant(task_id_t id, unsigned int caps) |
{ |
sysarg64_t arg; |
arg.value = (unsigned long long) id; |
return __SYSCALL2(SYS_CAP_GRANT, (sysarg_t) &arg, (sysarg_t) caps); |
} |
/** Revoke capabilities from a task. |
* |
* @param id Destination task ID. |
* @param caps Capabilities to revoke. |
* |
* @return Zero on success or a value from @ref errno.h on failure. |
*/ |
int cap_revoke(task_id_t id, unsigned int caps) |
{ |
sysarg64_t arg; |
arg.value = (unsigned long long) id; |
return __SYSCALL2(SYS_CAP_REVOKE, (sysarg_t) &arg, (sysarg_t) caps); |
} |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/generic/stdlib.c |
---|
0,0 → 1,50 |
/* |
* Copyright (c) 2006 Ondrej Palkovsky |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libc |
* @{ |
*/ |
/** @file |
*/ |
#include <stdlib.h> |
static long glbl_seed = 1; |
long int random(void) |
{ |
return glbl_seed = ((1366*glbl_seed + 150889) % RAND_MAX); |
} |
void srandom(unsigned int seed) |
{ |
glbl_seed = seed; |
} |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/generic/err.c |
---|
0,0 → 1,46 |
/* |
* Copyright (c) 2006 Ondrej Palkovsky |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libc |
* @{ |
*/ |
/** @file |
*/ |
#include <stdio.h> |
#include <stdlib.h> |
/* TODO |
void errx(int __status, __const char *__format, ...) |
{ |
_exit(0); |
} |
*/ |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/Makefile |
---|
0,0 → 1,127 |
# |
# Copyright (c) 2005 Martin Decky |
# All rights reserved. |
# |
# Redistribution and use in source and binary forms, with or without |
# modification, are permitted provided that the following conditions |
# are met: |
# |
# - Redistributions of source code must retain the above copyright |
# notice, this list of conditions and the following disclaimer. |
# - 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. |
# - The name of the author may not be used to endorse or promote products |
# derived from this software without specific prior written permission. |
# |
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
# |
## Common compiler flags |
# |
LIBC_PREFIX = $(shell pwd) |
SOFTINT_PREFIX = ../softint |
## Setup toolchain |
# |
include $(LIBC_PREFIX)/Makefile.toolchain |
## Sources |
# |
GENERIC_SOURCES = \ |
generic/libc.c \ |
generic/ddi.c \ |
generic/as.c \ |
generic/cap.c \ |
generic/devmap.c \ |
generic/event.c \ |
generic/errno.c \ |
generic/mem.c \ |
generic/string.c \ |
generic/fibril.c \ |
generic/fibril_sync.c \ |
generic/pcb.c \ |
generic/smc.c \ |
generic/thread.c \ |
generic/tls.c \ |
generic/task.c \ |
generic/futex.c \ |
generic/io/asprintf.c \ |
generic/io/io.c \ |
generic/io/printf.c \ |
generic/io/klog.c \ |
generic/io/snprintf.c \ |
generic/io/vprintf.c \ |
generic/io/vsnprintf.c \ |
generic/io/printf_core.c \ |
generic/io/console.c \ |
generic/malloc.c \ |
generic/sysinfo.c \ |
generic/ipc.c \ |
generic/async.c \ |
generic/loader.c \ |
generic/getopt.c \ |
generic/adt/list.o \ |
generic/adt/hash_table.o \ |
generic/time.c \ |
generic/err.c \ |
generic/stdlib.c \ |
generic/mman.c \ |
generic/udebug.c \ |
generic/vfs/vfs.c \ |
generic/vfs/canonify.c |
ARCH_SOURCES += \ |
arch/$(UARCH)/src/entry.s \ |
arch/$(UARCH)/src/thread_entry.s |
GENERIC_OBJECTS := $(addsuffix .o,$(basename $(GENERIC_SOURCES))) |
ARCH_OBJECTS := $(addsuffix .o,$(basename $(ARCH_SOURCES))) |
OBJECTS := $(GENERIC_OBJECTS) $(ARCH_OBJECTS) |
.PHONY: all clean depend kerninc |
all: kerninc libc.a arch/$(UARCH)/_link.ld |
kerninc: |
ln -sfn ../../../../kernel/generic/include include/kernel |
ln -sfn kernel/arch include/arch |
ln -sfn ../arch/$(UARCH)/include include/libarch |
-include Makefile.depend |
clean: |
-rm -f include/kernel include/arch include/libarch libc.a arch/$(UARCH)/_link.ld Makefile.depend |
find generic/ arch/$(UARCH)/ -name '*.o' -follow -exec rm \{\} \; |
depend: kerninc |
-makedepend -f - -- $(DEPEND_DEFS) $(CFLAGS) -- $(ARCH_SOURCES) $(GENERIC_SOURCES) > Makefile.depend 2> /dev/null |
libc.a: depend $(ARCH_OBJECTS) $(GENERIC_OBJECTS) |
$(AR) rc libc.a $(LIBS) $(ARCH_OBJECTS) $(GENERIC_OBJECTS) |
arch/$(UARCH)/_link.ld: arch/$(UARCH)/_link.ld.in |
$(CC) $(DEFS) $(CFLAGS) -DLIBC_PREFIX=$(LIBC_PREFIX) -E -x c $< | grep -v "^\#" > $@ |
%.o: %.S |
$(CC) $(DEFS) $(AFLAGS) $(CFLAGS) -D__ASM__ -c $< -o $@ |
%.o: %.s |
$(AS) $(AFLAGS) $< -o $@ |
%.o: %.c |
$(CC) $(DEFS) $(CFLAGS) -c $< -o $@ |
//branches/snapshot/uspace/lib/libc/arch/ia64/Makefile.inc |
---|
0,0 → 1,46 |
# |
# Copyright (c) 2005 Martin Decky |
# All rights reserved. |
# |
# Redistribution and use in source and binary forms, with or without |
# modification, are permitted provided that the following conditions |
# are met: |
# |
# - Redistributions of source code must retain the above copyright |
# notice, this list of conditions and the following disclaimer. |
# - 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. |
# - The name of the author may not be used to endorse or promote products |
# derived from this software without specific prior written permission. |
# |
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
# |
## Toolchain configuration |
# |
TARGET = ia64-pc-linux-gnu |
TOOLCHAIN_DIR = $(CROSS_PREFIX)/ia64/bin |
ARCH_SOURCES += arch/$(UARCH)/src/syscall.S \ |
arch/$(UARCH)/src/fibril.S \ |
arch/$(UARCH)/src/tls.c \ |
arch/$(UARCH)/src/ddi.c |
CFLAGS += -fno-unwind-tables |
LFLAGS += -N $(SOFTINT_PREFIX)/libsoftint.a |
ENDIANESS = LE |
BFD_NAME = elf64-ia64-little |
BFD_ARCH = ia64-elf64 |
//branches/snapshot/uspace/lib/libc/arch/ia64/include/types.h |
---|
0,0 → 1,68 |
/* |
* Copyright (c) 2006 Ondrej Palkovsky |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libcia64 |
* @{ |
*/ |
/** @file |
*/ |
#ifndef LIBC_ia64_TYPES_H_ |
#define LIBC_ia64_TYPES_H_ |
typedef unsigned long long sysarg_t; |
typedef char int8_t; |
typedef short int int16_t; |
typedef int int32_t; |
typedef long int int64_t; |
typedef unsigned char uint8_t; |
typedef unsigned short int uint16_t; |
typedef unsigned int uint32_t; |
typedef unsigned long int uint64_t; |
typedef int64_t ssize_t; |
typedef uint64_t size_t; |
typedef uint64_t uintptr_t; |
typedef unsigned char __r8; /* Reserve byte */ |
typedef unsigned short __r16; |
typedef unsigned int __r32; |
typedef unsigned long __r64; |
typedef struct __r128{ |
__r64 lo; |
__r64 hi; |
} __r128; |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/arch/ia64/include/ddi.h |
---|
0,0 → 1,115 |
/* |
* Copyright (c) 2005 Jakub Vana |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libcia64 |
* @{ |
*/ |
/** @file |
*/ |
#ifndef LIBC_ia64_DDI_H_ |
#define LIBC_ia64_DDI_H_ |
#include <sys/types.h> |
#include <libarch/types.h> |
#define IO_SPACE_BOUNDARY (64 * 1024) |
uint64_t get_ia64_iospace_address(void); |
extern uint64_t ia64_iospace_address; |
#define IA64_IOSPACE_ADDRESS \ |
(ia64_iospace_address ? \ |
ia64_iospace_address : \ |
(ia64_iospace_address = get_ia64_iospace_address())) |
static inline void pio_write_8(ioport8_t *port, uint8_t v) |
{ |
uintptr_t prt = (uintptr_t) port; |
*((ioport8_t *)(IA64_IOSPACE_ADDRESS + |
((prt & 0xfff) | ((prt >> 2) << 12)))) = v; |
asm volatile ("mf\n" ::: "memory"); |
} |
static inline void pio_write_16(ioport16_t *port, uint16_t v) |
{ |
uintptr_t prt = (uintptr_t) port; |
*((ioport16_t *)(IA64_IOSPACE_ADDRESS + |
((prt & 0xfff) | ((prt >> 2) << 12)))) = v; |
asm volatile ("mf\n" ::: "memory"); |
} |
static inline void pio_write_32(ioport32_t *port, uint32_t v) |
{ |
uintptr_t prt = (uintptr_t) port; |
*((ioport32_t *)(IA64_IOSPACE_ADDRESS + |
((prt & 0xfff) | ((prt >> 2) << 12)))) = v; |
asm volatile ("mf\n" ::: "memory"); |
} |
static inline uint8_t pio_read_8(ioport8_t *port) |
{ |
uintptr_t prt = (uintptr_t) port; |
asm volatile ("mf\n" ::: "memory"); |
return *((ioport8_t *)(IA64_IOSPACE_ADDRESS + |
((prt & 0xfff) | ((prt >> 2) << 12)))); |
} |
static inline uint16_t pio_read_16(ioport16_t *port) |
{ |
uintptr_t prt = (uintptr_t) port; |
asm volatile ("mf\n" ::: "memory"); |
return *((ioport16_t *)(IA64_IOSPACE_ADDRESS + |
((prt & 0xfff) | ((prt >> 2) << 12)))); |
} |
static inline uint32_t pio_read_32(ioport32_t *port) |
{ |
uintptr_t prt = (uintptr_t) port; |
asm volatile ("mf\n" ::: "memory"); |
return *((ioport32_t *)(IA64_IOSPACE_ADDRESS + |
((prt & 0xfff) | ((prt >> 2) << 12)))); |
} |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/arch/ia64/include/syscall.h |
---|
0,0 → 1,46 |
/* |
* Copyright (c) 2005 Martin Decky |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libc |
* @{ |
*/ |
/** |
* @file |
*/ |
#ifndef LIBC_ia64_SYSCALL_H_ |
#define LIBC_ia64_SYSCALL_H_ |
#define LIBARCH_SYSCALL_GENERIC |
#include <syscall.h> |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/arch/ia64/include/config.h |
---|
0,0 → 1,44 |
/* |
* Copyright (c) 2006 Jakub Jermar |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libcia64 |
* @{ |
*/ |
/** @file |
*/ |
#ifndef LIBC_ia64_CONFIG_H_ |
#define LIBC_ia64_CONFIG_H_ |
#define PAGE_WIDTH 14 |
#define PAGE_SIZE (1 << PAGE_WIDTH) |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/arch/ia64/include/tls.h |
---|
0,0 → 1,65 |
/* |
* Copyright (c) 2006 Jakub Jermar |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libcia64 |
* @{ |
*/ |
/** @file |
*/ |
#ifndef LIBC_ia64_TLS_H_ |
#define LIBC_ia64_TLS_H_ |
#define CONFIG_TLS_VARIANT_1 |
#include <sys/types.h> |
/* This structure must be exactly 16 bytes long */ |
typedef struct { |
void *dtv; /* unused in static linking*/ |
void *fibril_data; |
} tcb_t; |
static inline void __tcb_set(tcb_t *tcb) |
{ |
asm volatile ("mov r13 = %0\n" : : "r" (tcb) : "r13"); |
} |
static inline tcb_t *__tcb_get(void) |
{ |
void *retval; |
asm volatile ("mov %0 = r13\n" : "=r" (retval)); |
return retval; |
} |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/arch/ia64/include/thread.h |
---|
0,0 → 1,43 |
/* |
* Copyright (c) 2006 Jakub Jermar |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libcia64 |
* @{ |
*/ |
/** @file |
*/ |
#ifndef LIBC_ia64_THREAD_H_ |
#define LIBC_ia64_THREAD_H_ |
#define THREAD_INITIAL_STACK_PAGES_NO 2 |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/arch/ia64/include/fibril.h |
---|
0,0 → 1,139 |
/* |
* Copyright (c) 2005 Jakub Jermar |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libcia64 |
* @{ |
*/ |
/** @file |
*/ |
#ifndef LIBC_ia64_FIBRIL_H_ |
#define LIBC_ia64_FIBRIL_H_ |
#include <sys/types.h> |
#include <align.h> |
#include <libarch/stack.h> |
#include <libarch/types.h> |
/* |
* context_save() and context_restore() are both leaf procedures. |
* No need to allocate scratch area. |
*/ |
#define SP_DELTA (0 + ALIGN_UP(STACK_ITEM_SIZE, STACK_ALIGNMENT)) |
#define PFM_MASK (~0x3fffffffff) |
#define PSTHREAD_INITIAL_STACK_PAGES_NO 2 |
/* Stack is divided into two equal parts (for memory stack and register stack). */ |
#define PSTHREAD_INITIAL_STACK_DIVISION 2 |
#ifdef context_set |
#undef context_set |
#endif |
#define context_set(c, _pc, stack, size, tls) \ |
do { \ |
(c)->pc = (uint64_t) _pc; \ |
(c)->bsp = ((uint64_t) stack) + size / PSTHREAD_INITIAL_STACK_DIVISION; \ |
(c)->ar_pfs &= PFM_MASK; \ |
(c)->sp = ((uint64_t) stack) + ALIGN_UP((size / PSTHREAD_INITIAL_STACK_DIVISION), STACK_ALIGNMENT) - SP_DELTA; \ |
(c)->tp = (uint64_t) tls; \ |
} while (0); |
/* |
* Only save registers that must be preserved across |
* function calls. |
*/ |
typedef struct context { |
/* |
* Application registers |
*/ |
uint64_t ar_pfs; |
uint64_t ar_unat_caller; |
uint64_t ar_unat_callee; |
uint64_t ar_rsc; |
uint64_t bsp; /* ar_bsp */ |
uint64_t ar_rnat; |
uint64_t ar_lc; |
/* |
* General registers |
*/ |
uint64_t r1; |
uint64_t r4; |
uint64_t r5; |
uint64_t r6; |
uint64_t r7; |
uint64_t sp; /* r12 */ |
uint64_t tp; /* r13 */ |
/* |
* Branch registers |
*/ |
uint64_t pc; /* b0 */ |
uint64_t b1; |
uint64_t b2; |
uint64_t b3; |
uint64_t b4; |
uint64_t b5; |
/* |
* Predicate registers |
*/ |
uint64_t pr; |
__r128 f2 __attribute__ ((aligned(16))); |
__r128 f3; |
__r128 f4; |
__r128 f5; |
__r128 f16; |
__r128 f17; |
__r128 f18; |
__r128 f19; |
__r128 f20; |
__r128 f21; |
__r128 f22; |
__r128 f23; |
__r128 f24; |
__r128 f25; |
__r128 f26; |
__r128 f27; |
__r128 f28; |
__r128 f29; |
__r128 f30; |
__r128 f31; |
} context_t; |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/arch/ia64/include/atomic.h |
---|
0,0 → 1,66 |
/* |
* Copyright (c) 2005 Jakub Jermar |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libcia64 |
* @{ |
*/ |
/** @file |
*/ |
#ifndef LIBC_ia64_ATOMIC_H_ |
#define LIBC_ia64_ATOMIC_H_ |
/** Atomic addition. |
* |
* @param val Atomic value. |
* @param imm Value to add. |
* |
* @return Value before addition. |
*/ |
static inline long atomic_add(atomic_t *val, int imm) |
{ |
long v; |
asm volatile ("fetchadd8.rel %0 = %1, %2\n" : "=r" (v), "+m" (val->count) : "i" (imm)); |
return v; |
} |
static inline void atomic_inc(atomic_t *val) { atomic_add(val, 1); } |
static inline void atomic_dec(atomic_t *val) { atomic_add(val, -1); } |
static inline long atomic_preinc(atomic_t *val) { return atomic_add(val, 1) + 1; } |
static inline long atomic_predec(atomic_t *val) { return atomic_add(val, -1) - 1; } |
static inline long atomic_postinc(atomic_t *val) { return atomic_add(val, 1); } |
static inline long atomic_postdec(atomic_t *val) { return atomic_add(val, -1); } |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/arch/ia64/include/stackarg.h |
---|
0,0 → 1,43 |
/* |
* Copyright (c) 2006 Josef Cejka |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libcia64 |
* @{ |
*/ |
/** @file |
*/ |
#ifndef LIBC_STACKARG_H_ |
#define LIBC_STACKARG_H_ |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/arch/ia64/include/faddr.h |
---|
0,0 → 1,53 |
/* |
* Copyright (c) 2005 Jakub Jermar |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libcia64 |
* @{ |
*/ |
/** @file |
*/ |
#ifndef LIBC_ia64_FADDR_H_ |
#define LIBC_ia64_FADDR_H_ |
#include <libarch/types.h> |
/** |
* |
* Calculate absolute address of function |
* referenced by fptr pointer. |
* |
* @param f Function pointer. |
* |
*/ |
#define FADDR(f) (*((uintptr_t *)(f))); |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/arch/ia64/include/limits.h |
---|
0,0 → 1,46 |
/* |
* Copyright (c) 2006 Josef Cejka |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libcia64 |
* @{ |
*/ |
/** @file |
*/ |
#ifndef LIBC_ia64_LIMITS_H_ |
#define LIBC_ia64_LIMITS_H_ |
# define LONG_MIN MIN_INT64 |
# define LONG_MAX MAX_INT64 |
# define ULONG_MIN MIN_UINT64 |
# define ULONG_MAX MAX_UINT64 |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/arch/ia64/include/stack.h |
---|
0,0 → 1,46 |
/* |
* Copyright (c) 2005 Jakub Jermar |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libcia64 |
* @{ |
*/ |
/** @file |
*/ |
#ifndef LIBC_ia64_STACK_H_ |
#define LIBC_ia64_STACK_H_ |
#define STACK_ITEM_SIZE 8 |
#define STACK_ALIGNMENT 16 |
#define STACK_SCRATCH_AREA_SIZE 16 |
#define REGISTER_STACK_ALIGNMENT 8 |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/arch/ia64/_link.ld.in |
---|
0,0 → 1,53 |
STARTUP(LIBC_PREFIX/arch/UARCH/src/entry.o) |
ENTRY(__entry) |
PHDRS { |
text PT_LOAD FLAGS(5); |
data PT_LOAD FLAGS(6); |
} |
SECTIONS { |
. = 0x4000 + SIZEOF_HEADERS; |
.init : { |
*(.init); |
} : text |
.text : { |
*(.text); |
*(.rodata*); |
} :text |
. = . + 0x4000; |
.got : { |
_gp = .; |
*(.got*); |
} :data |
.data : { |
*(.opd); |
*(.data .data.*); |
*(.sdata); |
} :data |
.tdata : { |
_tdata_start = .; |
*(.tdata); |
_tdata_end = .; |
_tbss_start = .; |
*(.tbss); |
_tbss_end = .; |
} :data |
_tls_alignment = ALIGNOF(.tdata); |
.bss : { |
*(.sbss); |
*(.scommon); |
*(COMMON); |
*(.bss); |
} :data |
. = ALIGN(0x4000); |
_heap = .; |
/DISCARD/ : { |
*(*); |
} |
} |
//branches/snapshot/uspace/lib/libc/arch/ia64/src/entry.s |
---|
0,0 → 1,47 |
# |
# Copyright (c) 2006 Jakub Jermar |
# All rights reserved. |
# |
# Redistribution and use in source and binary forms, with or without |
# modification, are permitted provided that the following conditions |
# are met: |
# |
# - Redistributions of source code must retain the above copyright |
# notice, this list of conditions and the following disclaimer. |
# - 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. |
# - The name of the author may not be used to endorse or promote products |
# derived from this software without specific prior written permission. |
# |
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
# |
.section .init, "ax" |
.org 0 |
.globl __entry |
## User-space task entry point |
# |
# r2 contains the PCB pointer |
# |
__entry: |
alloc loc0 = ar.pfs, 0, 1, 2, 0 |
movl r1 = _gp |
# Pass PCB pointer as the first argument to __main |
mov out0 = r2 |
br.call.sptk.many b0 = __main |
0: |
br.call.sptk.many b0 = __exit |
//branches/snapshot/uspace/lib/libc/arch/ia64/src/thread_entry.s |
---|
0,0 → 1,52 |
# |
# Copyright (c) 2006 Jakub Jermar |
# All rights reserved. |
# |
# Redistribution and use in source and binary forms, with or without |
# modification, are permitted provided that the following conditions |
# are met: |
# |
# - Redistributions of source code must retain the above copyright |
# notice, this list of conditions and the following disclaimer. |
# - 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. |
# - The name of the author may not be used to endorse or promote products |
# derived from this software without specific prior written permission. |
# |
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
# |
.text |
.globl __thread_entry |
## User-space thread entry point for all but the first threads. |
# |
# |
__thread_entry: |
alloc loc0 = ar.pfs, 0, 1, 1, 0 |
movl r1 = _gp |
# |
# r8 contains address of uarg structure. |
# |
mov out0 = r8 |
br.call.sptk.many b0 = __thread_main |
# |
# Not reached. |
# |
.end __thread_entry |
//branches/snapshot/uspace/lib/libc/arch/ia64/src/ddi.c |
---|
0,0 → 1,13 |
#include <libarch/ddi.h> |
#include <sysinfo.h> |
uint64_t ia64_iospace_address=0; |
uint64_t get_ia64_iospace_address(void) |
{ |
return sysinfo_value("ia64_iospace.address.virtual"); |
} |
//branches/snapshot/uspace/lib/libc/arch/ia64/src/syscall.S |
---|
0,0 → 1,44 |
# |
# Copyright (c) 2006 Jakub Jermar |
# All rights reserved. |
# |
# Redistribution and use in source and binary forms, with or without |
# modification, are permitted provided that the following conditions |
# are met: |
# |
# - Redistributions of source code must retain the above copyright |
# notice, this list of conditions and the following disclaimer. |
# - 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. |
# - The name of the author may not be used to endorse or promote products |
# derived from this software without specific prior written permission. |
# |
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
# |
/** |
* Immediate operand for break instruction. |
* Be carefull about the value as Ski simulator |
* is somewhat sensitive to its value. |
* |
* 0 will be confused with Ski breakpoint. |
* And higher values will be confused with SSC's. |
*/ |
#define SYSCALL_IMM 1 |
.global __syscall |
__syscall: |
alloc r14 = ar.pfs, 7, 0, 0, 0 ;; |
break SYSCALL_IMM |
mov ar.pfs = r14 ;; |
br.ret.sptk.many b0 |
//branches/snapshot/uspace/lib/libc/arch/ia64/src/tls.c |
---|
0,0 → 1,51 |
/* |
* Copyright (c) 2006 Ondrej Palkovsky |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libcia64 ia64 |
* @brief ia64 architecture dependent parts of libc |
* @ingroup lc |
* @{ |
*/ |
/** @file |
*/ |
#include <tls.h> |
#include <malloc.h> |
tcb_t * __alloc_tls(void **data, size_t size) |
{ |
return tls_alloc_variant_1(data, size); |
} |
void __free_tls_arch(tcb_t *tcb, size_t size) |
{ |
tls_free_variant_1(tcb, size); |
} |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/arch/ia64/src/fibril.S |
---|
0,0 → 1,246 |
# |
# Copyright (c) 2005 Jakub Jermar |
# All rights reserved. |
# |
# Redistribution and use in source and binary forms, with or without |
# modification, are permitted provided that the following conditions |
# are met: |
# |
# - Redistributions of source code must retain the above copyright |
# notice, this list of conditions and the following disclaimer. |
# - 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. |
# - The name of the author may not be used to endorse or promote products |
# derived from this software without specific prior written permission. |
# |
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
# |
.text |
.global context_save |
.global context_restore |
context_save: |
alloc loc0 = ar.pfs, 1, 8, 0, 0 |
mov loc1 = ar.unat ;; |
/* loc2 */ |
mov loc3 = ar.rsc |
.auto |
/* |
* Flush dirty registers to backing store. |
* After this ar.bsp and ar.bspstore are equal. |
*/ |
flushrs |
mov loc4 = ar.bsp |
/* |
* Put RSE to enforced lazy mode. |
* So that ar.rnat can be read. |
*/ |
and loc5 = ~3, loc3 |
mov ar.rsc = loc5 |
mov loc5 = ar.rnat |
.explicit |
mov loc6 = ar.lc |
/* |
* Save application registers |
*/ |
st8 [in0] = loc0, 8 ;; /* save ar.pfs */ |
st8 [in0] = loc1, 8 ;; /* save ar.unat (caller) */ |
mov loc2 = in0 ;; |
add in0 = 8, in0 ;; /* skip ar.unat (callee) */ |
st8 [in0] = loc3, 8 ;; /* save ar.rsc */ |
st8 [in0] = loc4, 8 ;; /* save ar.bsp */ |
st8 [in0] = loc5, 8 ;; /* save ar.rnat */ |
st8 [in0] = loc6, 8 ;; /* save ar.lc */ |
/* |
* Save general registers including NaT bits |
*/ |
st8.spill [in0] = r1, 8 ;; |
st8.spill [in0] = r4, 8 ;; |
st8.spill [in0] = r5, 8 ;; |
st8.spill [in0] = r6, 8 ;; |
st8.spill [in0] = r7, 8 ;; |
st8.spill [in0] = r12, 8 ;; /* save sp */ |
st8.spill [in0] = r13, 8 ;; /* save tp */ |
mov loc3 = ar.unat ;; |
st8 [loc2] = loc3 /* save ar.unat (callee) */ |
/* |
* Save branch registers |
*/ |
mov loc2 = b0 ;; |
st8 [in0] = loc2, 8 /* save pc */ |
mov loc3 = b1 ;; |
st8 [in0] = loc3, 8 |
mov loc4 = b2 ;; |
st8 [in0] = loc4, 8 |
mov loc5 = b3 ;; |
st8 [in0] = loc5, 8 |
mov loc6 = b4 ;; |
st8 [in0] = loc6, 8 |
mov loc7 = b5 ;; |
st8 [in0] = loc7, 8 |
/* |
* Save predicate registers |
*/ |
mov loc2 = pr ;; |
st8 [in0] = loc2, 16;; /* Next fpu registers should be spilled to 16B aligned address */ |
/* |
* Save floating-point registers. |
*/ |
stf.spill [in0] = f2, 16 ;; |
stf.spill [in0] = f3, 16 ;; |
stf.spill [in0] = f4, 16 ;; |
stf.spill [in0] = f5, 16 ;; |
stf.spill [in0] = f16, 16 ;; |
stf.spill [in0] = f17, 16 ;; |
stf.spill [in0] = f18, 16 ;; |
stf.spill [in0] = f19, 16 ;; |
stf.spill [in0] = f20, 16 ;; |
stf.spill [in0] = f21, 16 ;; |
stf.spill [in0] = f22, 16 ;; |
stf.spill [in0] = f23, 16 ;; |
stf.spill [in0] = f24, 16 ;; |
stf.spill [in0] = f25, 16 ;; |
stf.spill [in0] = f26, 16 ;; |
stf.spill [in0] = f27, 16 ;; |
stf.spill [in0] = f28, 16 ;; |
stf.spill [in0] = f29, 16 ;; |
stf.spill [in0] = f30, 16 ;; |
stf.spill [in0] = f31, 16 ;; |
mov ar.unat = loc1 |
add r8 = r0, r0, 1 /* context_save returns 1 */ |
br.ret.sptk.many b0 |
context_restore: |
alloc loc0 = ar.pfs, 1, 9, 0, 0 ;; |
ld8 loc0 = [in0], 8 ;; /* load ar.pfs */ |
ld8 loc1 = [in0], 8 ;; /* load ar.unat (caller) */ |
ld8 loc2 = [in0], 8 ;; /* load ar.unat (callee) */ |
ld8 loc3 = [in0], 8 ;; /* load ar.rsc */ |
ld8 loc4 = [in0], 8 ;; /* load ar.bsp */ |
ld8 loc5 = [in0], 8 ;; /* load ar.rnat */ |
ld8 loc6 = [in0], 8 ;; /* load ar.lc */ |
.auto |
/* |
* Invalidate the ALAT |
*/ |
invala |
/* |
* Put RSE to enforced lazy mode. |
* So that ar.bspstore and ar.rnat can be written. |
*/ |
movl loc8 = ~3 |
and loc8 = loc3, loc8 |
mov ar.rsc = loc8 |
/* |
* Flush dirty registers to backing store. |
* We do this because we want the following move |
* to ar.bspstore to assign the same value to ar.bsp. |
*/ |
flushrs |
/* |
* Restore application registers |
*/ |
mov ar.bspstore = loc4 /* rse.bspload = ar.bsp = ar.bspstore = loc4 */ |
mov ar.rnat = loc5 |
mov ar.pfs = loc0 |
mov ar.rsc = loc3 |
.explicit |
mov ar.unat = loc2 ;; |
mov ar.lc = loc6 |
/* |
* Restore general registers including NaT bits |
*/ |
ld8.fill r1 = [in0], 8 ;; |
ld8.fill r4 = [in0], 8 ;; |
ld8.fill r5 = [in0], 8 ;; |
ld8.fill r6 = [in0], 8 ;; |
ld8.fill r7 = [in0], 8 ;; |
ld8.fill r12 = [in0], 8 ;; /* restore sp */ |
ld8.fill r13 = [in0], 8 ;; |
/* |
* Restore branch registers |
*/ |
ld8 loc2 = [in0], 8 ;; /* restore pc */ |
mov b0 = loc2 |
ld8 loc3 = [in0], 8 ;; |
mov b1 = loc3 |
ld8 loc4 = [in0], 8 ;; |
mov b2 = loc4 |
ld8 loc5 = [in0], 8 ;; |
mov b3 = loc5 |
ld8 loc6 = [in0], 8 ;; |
mov b4 = loc6 |
ld8 loc7 = [in0], 8 ;; |
mov b5 = loc7 |
/* |
* Restore predicate registers |
*/ |
ld8 loc2 = [in0], 16 ;; |
mov pr = loc2, ~0 |
/* |
* Restore floating-point registers. |
*/ |
ldf.fill f2 = [in0], 16 ;; |
ldf.fill f3 = [in0], 16 ;; |
ldf.fill f4 = [in0], 16 ;; |
ldf.fill f5 = [in0], 16 ;; |
ldf.fill f16 = [in0], 16 ;; |
ldf.fill f17 = [in0], 16 ;; |
ldf.fill f18 = [in0], 16 ;; |
ldf.fill f19 = [in0], 16 ;; |
ldf.fill f20 = [in0], 16 ;; |
ldf.fill f21 = [in0], 16 ;; |
ldf.fill f22 = [in0], 16 ;; |
ldf.fill f23 = [in0], 16 ;; |
ldf.fill f24 = [in0], 16 ;; |
ldf.fill f25 = [in0], 16 ;; |
ldf.fill f26 = [in0], 16 ;; |
ldf.fill f27 = [in0], 16 ;; |
ldf.fill f28 = [in0], 16 ;; |
ldf.fill f29 = [in0], 16 ;; |
ldf.fill f30 = [in0], 16 ;; |
ldf.fill f31 = [in0], 16 ;; |
mov ar.unat = loc1 |
mov r8 = r0 /* context_restore returns 0 */ |
br.ret.sptk.many b0 |
//branches/snapshot/uspace/lib/libc/arch/sparc64/include/types.h |
---|
0,0 → 1,58 |
/* |
* Copyright (c) 2005 Martin Decky |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libcsparc64 |
* @{ |
*/ |
/** @file |
*/ |
#ifndef LIBC_sparc64_TYPES_H_ |
#define LIBC_sparc64_TYPES_H_ |
typedef unsigned long sysarg_t; |
typedef signed char int8_t; |
typedef short int int16_t; |
typedef int int32_t; |
typedef long int int64_t; |
typedef unsigned char uint8_t; |
typedef unsigned short int uint16_t; |
typedef unsigned int uint32_t; |
typedef unsigned long int uint64_t; |
typedef int64_t ssize_t; |
typedef uint64_t size_t; |
typedef uint64_t uintptr_t; |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/arch/sparc64/include/ddi.h |
---|
0,0 → 1,92 |
/* |
* Copyright (c) 2009 Jakub Jermar |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @file |
* @ingroup libsparc64 |
*/ |
#ifndef LIBC_sparc64_DDI_H_ |
#define LIBC_sparc64_DDI_H_ |
#include <sys/types.h> |
#include <libarch/types.h> |
static inline memory_barrier(void) |
{ |
asm volatile ("membar #LoadLoad | #StoreStore\n" ::: "memory"); |
} |
static inline void pio_write_8(ioport8_t *port, uint8_t v) |
{ |
*port = v; |
memory_barrier(); |
} |
static inline void pio_write_16(ioport16_t *port, uint16_t v) |
{ |
*port = v; |
memory_barrier(); |
} |
static inline void pio_write_32(ioport32_t *port, uint32_t v) |
{ |
*port = v; |
memory_barrier(); |
} |
static inline uint8_t pio_read_8(ioport8_t *port) |
{ |
uint8_t rv; |
rv = *port; |
memory_barrier(); |
return rv; |
} |
static inline uint16_t pio_read_16(ioport16_t *port) |
{ |
uint16_t rv; |
rv = *port; |
memory_barrier(); |
return rv; |
} |
static inline uint32_t pio_read_32(ioport32_t *port) |
{ |
uint32_t rv; |
rv = *port; |
memory_barrier(); |
return rv; |
} |
#endif |
//branches/snapshot/uspace/lib/libc/arch/sparc64/include/syscall.h |
---|
0,0 → 1,74 |
/* |
* Copyright (c) 2005 Martin Decky |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libcsparc64 |
* @{ |
*/ |
/** @file |
*/ |
#ifndef LIBC_sparc64_SYSCALL_H_ |
#define LIBC_sparc64_SYSCALL_H_ |
#include <sys/types.h> |
#include <kernel/syscall/syscall.h> |
#define __syscall0 __syscall |
#define __syscall1 __syscall |
#define __syscall2 __syscall |
#define __syscall3 __syscall |
#define __syscall4 __syscall |
#define __syscall5 __syscall |
#define __syscall6 __syscall |
static inline sysarg_t |
__syscall(const sysarg_t p1, const sysarg_t p2, const sysarg_t p3, |
const sysarg_t p4, const sysarg_t p5, const sysarg_t p6, const syscall_t id) |
{ |
register uint64_t a1 asm("o0") = p1; |
register uint64_t a2 asm("o1") = p2; |
register uint64_t a3 asm("o2") = p3; |
register uint64_t a4 asm("o3") = p4; |
register uint64_t a5 asm("o4") = p5; |
register uint64_t a6 asm("o5") = p6; |
asm volatile ( |
"ta %7\n" |
: "=r" (a1) |
: "r" (a1), "r" (a2), "r" (a3), "r" (a4), "r" (a5), "r" (a6), |
"i" (id) |
: "memory" |
); |
return a1; |
} |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/arch/sparc64/include/config.h |
---|
0,0 → 1,44 |
/* |
* Copyright (c) 2006 Jakub Jermar |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libcsparc64 |
* @{ |
*/ |
/** @file |
*/ |
#ifndef LIBC_sparc64_CONFIG_H_ |
#define LIBC_sparc64_CONFIG_H_ |
#define PAGE_WIDTH 14 |
#define PAGE_SIZE (1 << PAGE_WIDTH) |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/arch/sparc64/include/tls.h |
---|
0,0 → 1,65 |
/* |
* Copyright (c) 2006 Ondrej Palkovsky |
* Copyright (c) 2006 Jakub Jermar |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libcsparc64 |
* @{ |
*/ |
/** |
* @file |
* @brief sparc64 TLS functions. |
*/ |
#ifndef LIBC_sparc64_TLS_H_ |
#define LIBC_sparc64_TLS_H_ |
#define CONFIG_TLS_VARIANT_2 |
typedef struct { |
void *self; |
void *fibril_data; |
} tcb_t; |
static inline void __tcb_set(tcb_t *tcb) |
{ |
asm volatile ("mov %0, %%g7\n" : : "r" (tcb) : "g7"); |
} |
static inline tcb_t * __tcb_get(void) |
{ |
void *retval; |
asm volatile ("mov %%g7, %0\n" : "=r" (retval)); |
return retval; |
} |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/arch/sparc64/include/thread.h |
---|
0,0 → 1,40 |
/* |
* Copyright (c) 2006 Ondrej Palkovsky |
* Copyright (c) 2006 Jakub Jermar |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libcsparc64 |
* @{ |
*/ |
#ifndef LIBC_sparc64_THREAD_H_ |
#define LIBC_sparc64_THREAD_H_ |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/arch/sparc64/include/atomic.h |
---|
0,0 → 1,97 |
/* |
* Copyright (c) 2005 Jakub Jermar |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libcsparc64 |
* @{ |
*/ |
/** @file |
*/ |
#ifndef LIBC_sparc64_ATOMIC_H_ |
#define LIBC_sparc64_ATOMIC_H_ |
#include <sys/types.h> |
/** Atomic add operation. |
* |
* Use atomic compare and swap operation to atomically add signed value. |
* |
* @param val Atomic variable. |
* @param i Signed value to be added. |
* |
* @return Value of the atomic variable as it existed before addition. |
*/ |
static inline long atomic_add(atomic_t *val, int i) |
{ |
uint64_t a, b; |
do { |
volatile uintptr_t x = (uint64_t) &val->count; |
a = *((uint64_t *) x); |
b = a + i; |
asm volatile ("casx %0, %2, %1\n" : "+m" (*((uint64_t *)x)), "+r" (b) : "r" (a)); |
} while (a != b); |
return a; |
} |
static inline long atomic_preinc(atomic_t *val) |
{ |
return atomic_add(val, 1) + 1; |
} |
static inline long atomic_postinc(atomic_t *val) |
{ |
return atomic_add(val, 1); |
} |
static inline long atomic_predec(atomic_t *val) |
{ |
return atomic_add(val, -1) - 1; |
} |
static inline long atomic_postdec(atomic_t *val) |
{ |
return atomic_add(val, -1); |
} |
static inline void atomic_inc(atomic_t *val) |
{ |
(void) atomic_add(val, 1); |
} |
static inline void atomic_dec(atomic_t *val) |
{ |
(void) atomic_add(val, -1); |
} |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/arch/sparc64/include/fibril.h |
---|
0,0 → 1,84 |
/* |
* Copyright (c) 2005 Jakub Jermar |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libcsparc64 |
* @{ |
*/ |
/** @file |
*/ |
#ifndef LIBC_sparc64_FIBRIL_H_ |
#define LIBC_sparc64_FIBRIL_H_ |
#include <libarch/stack.h> |
#include <sys/types.h> |
#include <align.h> |
#define SP_DELTA STACK_WINDOW_SAVE_AREA_SIZE |
#ifdef context_set |
#undef context_set |
#endif |
#define context_set(c, _pc, stack, size, ptls) \ |
(c)->pc = ((uintptr_t) _pc) - 8; \ |
(c)->sp = ((uintptr_t) stack) + ALIGN_UP((size), \ |
STACK_ALIGNMENT) - (STACK_BIAS + SP_DELTA); \ |
(c)->fp = -STACK_BIAS; \ |
(c)->tp = ptls |
/* |
* Save only registers that must be preserved across |
* function calls. |
*/ |
typedef struct { |
uintptr_t sp; /* %o6 */ |
uintptr_t pc; /* %o7 */ |
uint64_t i0; |
uint64_t i1; |
uint64_t i2; |
uint64_t i3; |
uint64_t i4; |
uint64_t i5; |
uintptr_t fp; /* %i6 */ |
uintptr_t i7; |
uint64_t l0; |
uint64_t l1; |
uint64_t l2; |
uint64_t l3; |
uint64_t l4; |
uint64_t l5; |
uint64_t l6; |
uint64_t l7; |
uint64_t tp; /* %g7 */ |
} context_t; |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/arch/sparc64/include/stack.h |
---|
0,0 → 1,56 |
/* |
* Copyright (c) 2005 Jakub Jermar |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libcsparc64 |
* @{ |
*/ |
/** @file |
*/ |
#ifndef LIBC_sparc64_STACK_H_ |
#define LIBC_sparc64_STACK_H_ |
#define STACK_ITEM_SIZE 8 |
/** According to SPARC Compliance Definition, every stack frame is 16-byte aligned. */ |
#define STACK_ALIGNMENT 16 |
/** |
* 16-extended-word save area for %i[0-7] and %l[0-7] registers. |
*/ |
#define STACK_WINDOW_SAVE_AREA_SIZE (16 * STACK_ITEM_SIZE) |
/** |
* By convention, the actual top of the stack is %sp + STACK_BIAS. |
*/ |
#define STACK_BIAS 2047 |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/arch/sparc64/include/stackarg.h |
---|
0,0 → 1,41 |
/* |
* Copyright (c) 2006 Josef Cejka |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libcsparc64 |
* @{ |
*/ |
/** @file |
*/ |
#ifndef LIBC_sparc64_STACKARG_H_ |
#define LIBC_sparc64_STACKARG_H_ |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/arch/sparc64/include/faddr.h |
---|
0,0 → 1,45 |
/* |
* Copyright (c) 2005 Ondrej Palkovsky |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libcsparc64 |
* @{ |
*/ |
/** @file |
*/ |
#ifndef LIBC_sparc64_FADDR_H_ |
#define LIBC_sparc64_FADDR_H_ |
#include <libarch/types.h> |
#define FADDR(fptr) ((uintptr_t) (fptr)) |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/arch/sparc64/include/limits.h |
---|
0,0 → 1,46 |
/* |
* Copyright (c) 2006 Josef Cejka |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libcsparc64 |
* @{ |
*/ |
/** @file |
*/ |
#ifndef LIBC_sparc64_LIMITS_H_ |
#define LIBC_sparc64_LIMITS_H_ |
#define LONG_MIN MIN_INT64 |
#define LONG_MAX MAX_INT64 |
#define ULONG_MIN MIN_UINT64 |
#define ULONG_MAX MAX_UINT64 |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/arch/sparc64/Makefile.inc |
---|
0,0 → 1,44 |
# |
# Copyright (c) 2006 Martin Decky |
# All rights reserved. |
# |
# Redistribution and use in source and binary forms, with or without |
# modification, are permitted provided that the following conditions |
# are met: |
# |
# - Redistributions of source code must retain the above copyright |
# notice, this list of conditions and the following disclaimer. |
# - 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. |
# - The name of the author may not be used to endorse or promote products |
# derived from this software without specific prior written permission. |
# |
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
# |
## Toolchain configuration |
# |
TARGET = sparc64-linux-gnu |
TOOLCHAIN_DIR = $(CROSS_PREFIX)/sparc64/bin |
ARCH_SOURCES += arch/$(UARCH)/src/fibril.S \ |
arch/$(UARCH)/src/tls.c |
CFLAGS += -mcpu=ultrasparc -m64 |
LFLAGS += -no-check-sections -N |
ENDIANESS = BE |
BFD_NAME = elf64-sparc |
BFD_ARCH = sparc |
//branches/snapshot/uspace/lib/libc/arch/sparc64/_link.ld.in |
---|
0,0 → 1,52 |
STARTUP(LIBC_PREFIX/arch/UARCH/src/entry.o) |
ENTRY(__entry) |
PHDRS { |
text PT_LOAD FLAGS(5); |
data PT_LOAD FLAGS(6); |
} |
SECTIONS { |
. = 0x4000 + SIZEOF_HEADERS; |
.init : { |
*(.init); |
} :text |
.text : { |
*(.text); |
*(.rodata*); |
} :text |
. = . + 0x4000; |
.got : { |
_gp = .; |
*(.got*); |
} :data |
.data : { |
*(.data); |
*(.sdata); |
} :data |
.tdata : { |
_tdata_start = .; |
*(.tdata); |
_tdata_end = .; |
_tbss_start = .; |
*(.tbss); |
_tbss_end = .; |
} :data |
_tls_alignment = ALIGNOF(.tdata); |
.bss : { |
*(.sbss); |
*(COMMON); |
*(.bss); |
} :data |
. = ALIGN(0x4000); |
_heap = .; |
/DISCARD/ : { |
*(*); |
} |
} |
//branches/snapshot/uspace/lib/libc/arch/sparc64/src/entry.s |
---|
0,0 → 1,48 |
# |
# Copyright (c) 2006 Martin Decky |
# All rights reserved. |
# |
# Redistribution and use in source and binary forms, with or without |
# modification, are permitted provided that the following conditions |
# are met: |
# |
# - Redistributions of source code must retain the above copyright |
# notice, this list of conditions and the following disclaimer. |
# - 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. |
# - The name of the author may not be used to endorse or promote products |
# derived from this software without specific prior written permission. |
# |
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
# |
.section .init, "ax" |
.org 0 |
.globl __entry |
## User-space task entry point |
# |
# %o0 contains uarg |
# %o1 contains pcb_ptr |
# |
__entry: |
# Pass pcb_ptr as the first argument to __main() |
mov %o1, %o0 |
sethi %hi(_gp), %l7 |
call __main |
or %l7, %lo(_gp), %l7 |
call __exit |
nop |
//branches/snapshot/uspace/lib/libc/arch/sparc64/src/fibril.S |
---|
0,0 → 1,53 |
# |
# Copyright (c) 2005 Jakub Jermar |
# All rights reserved. |
# |
# Redistribution and use in source and binary forms, with or without |
# modification, are permitted provided that the following conditions |
# are met: |
# |
# - Redistributions of source code must retain the above copyright |
# notice, this list of conditions and the following disclaimer. |
# - 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. |
# - The name of the author may not be used to endorse or promote products |
# derived from this software without specific prior written permission. |
# |
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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 <kernel/arch/context_offset.h> |
.text |
.global context_save |
.global context_restore |
context_save: |
CONTEXT_SAVE_ARCH_CORE %o0 |
retl |
mov 1, %o0 ! context_save_arch returns 1 |
context_restore: |
# |
# Flush all active windows. |
# This is essential, because CONTEXT_LOAD overwrites |
# %sp of CWP - 1 with the value written to %fp of CWP. |
# Flushing all active windows mitigates this problem |
# as CWP - 1 becomes the overlap window. |
# |
flushw |
CONTEXT_RESTORE_ARCH_CORE %o0 |
retl |
xor %o0, %o0, %o0 ! context_restore_arch returns 0 |
//branches/snapshot/uspace/lib/libc/arch/sparc64/src/tls.c |
---|
0,0 → 1,51 |
/* |
* Copyright (c) 2006 Ondrej Palkovsky |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libcsparc64 sparc64 |
* @ingroup lc |
* @{ |
*/ |
/** @file |
* |
*/ |
#include <tls.h> |
#include <sys/types.h> |
tcb_t * __alloc_tls(void **data, size_t size) |
{ |
return tls_alloc_variant_2(data, size); |
} |
void __free_tls_arch(tcb_t *tcb, size_t size) |
{ |
tls_free_variant_2(tcb, size); |
} |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/arch/sparc64/src/thread_entry.s |
---|
0,0 → 1,43 |
# |
# Copyright (c) 2006 Jakub Jermar |
# All rights reserved. |
# |
# Redistribution and use in source and binary forms, with or without |
# modification, are permitted provided that the following conditions |
# are met: |
# |
# - Redistributions of source code must retain the above copyright |
# notice, this list of conditions and the following disclaimer. |
# - 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. |
# - The name of the author may not be used to endorse or promote products |
# derived from this software without specific prior written permission. |
# |
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
# |
.text |
.globl __thread_entry |
## User-space thread entry point for all but the first threads. |
# |
# |
__thread_entry: |
sethi %hi(_gp), %l7 |
call __thread_main ! %o0 contains address of uarg |
or %l7, %lo(_gp), %l7 |
! not reached |
.end __thread_entry |
//branches/snapshot/uspace/lib/libc/arch/arm32/include/tls.h |
---|
0,0 → 1,99 |
/* |
* Copyright (c) 2007 Pavel Jancik |
* Copyright (c) 2007 Michal Kebrt |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libcarm32 |
* @{ |
*/ |
/** @file |
*/ |
#ifndef LIBC_arm32_TLS_H_ |
#define LIBC_arm32_TLS_H_ |
#include <sys/types.h> |
#define CONFIG_TLS_VARIANT_1 |
/** Offsets for accessing thread-local variables are shifted 8 bytes higher. */ |
#define ARM_TP_OFFSET (-8) |
/** TCB (Thread Control Block) struct. |
* |
* TLS starts just after this struct. |
*/ |
typedef struct { |
/** Fibril data. */ |
void *fibril_data; |
} tcb_t; |
/** Sets TLS address to the r9 register. |
* |
* @param tcb TCB (TLS starts behind) |
*/ |
static inline void __tcb_set(tcb_t *tcb) |
{ |
void *tls = (void *) tcb; |
tls += sizeof(tcb_t) + ARM_TP_OFFSET; |
asm volatile ( |
"mov r9, %0" |
: |
: "r" (tls) |
); |
} |
/** Returns TCB address. |
* |
* @return TCB address (starts before TLS which address is stored |
* in r9 register). |
*/ |
static inline tcb_t *__tcb_get(void) |
{ |
void *ret; |
asm volatile ( |
"mov %0, r9" |
: "=r"(ret) |
); |
return (tcb_t *) (ret - ARM_TP_OFFSET - sizeof(tcb_t)); |
} |
/** Returns TLS address stored. |
* |
* Implemented in assembly. |
* |
* @return TLS address stored in r9 register |
*/ |
extern uintptr_t __aeabi_read_tp(void); |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/arch/arm32/include/types.h |
---|
0,0 → 1,59 |
/* |
* Copyright (c) 2005 Martin Decky |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libcarm32 |
* @{ |
*/ |
/** @file |
* @brief Definitions of basic types like #uintptr_t. |
*/ |
#ifndef LIBC_arm32_TYPES_H_ |
#define LIBC_arm32_TYPES_H_ |
typedef unsigned int sysarg_t; |
typedef char int8_t; |
typedef short int int16_t; |
typedef long int int32_t; |
typedef long long int int64_t; |
typedef unsigned char uint8_t; |
typedef unsigned short int uint16_t; |
typedef unsigned long int uint32_t; |
typedef unsigned long long int uint64_t; |
typedef int32_t ssize_t; |
typedef uint32_t size_t; |
typedef uint32_t uintptr_t; |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/arch/arm32/include/fibril.h |
---|
0,0 → 1,90 |
/* |
* Copyright (c) 2007 Michal Kebrt |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libcarm32 |
* @{ |
*/ |
/** @file |
* @brief Fibrils related declarations. |
*/ |
#ifndef LIBC_arm32_FIBRIL_H_ |
#define LIBC_arm32_FIBRIL_H_ |
#include <sys/types.h> |
#include <align.h> |
#include <thread.h> |
/** Size of a stack item */ |
#define STACK_ITEM_SIZE 4 |
/** Stack alignment - see <a href="http://www.arm.com/support/faqdev/14269.html">ABI</a> for details */ |
#define STACK_ALIGNMENT 8 |
#define SP_DELTA (0 + ALIGN_UP(STACK_ITEM_SIZE, STACK_ALIGNMENT)) |
/** Sets data to the context. |
* |
* @param c Context (#context_t). |
* @param _pc Program counter. |
* @param stack Stack address. |
* @param size Stack size. |
* @param ptls Pointer to the TCB. |
*/ |
#define context_set(c, _pc, stack, size, ptls) \ |
(c)->pc = (sysarg_t) (_pc); \ |
(c)->sp = ((sysarg_t) (stack)) + (size) - SP_DELTA; \ |
(c)->tls = ((sysarg_t)(ptls)) + sizeof(tcb_t) + ARM_TP_OFFSET; |
/** Fibril context. |
* |
* Only registers preserved accross function calls are included. r9 is used |
* to store a TLS address. -ffixed-r9 gcc forces gcc not to use this |
* register. -mtp=soft forces gcc to use #__aeabi_read_tp to obtain |
* TLS address. |
*/ |
typedef struct { |
uint32_t sp; |
uint32_t pc; |
uint32_t r4; |
uint32_t r5; |
uint32_t r6; |
uint32_t r7; |
uint32_t r8; |
uint32_t tls; |
uint32_t r10; |
uint32_t r11; |
} context_t; |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/arch/arm32/include/ddi.h |
---|
0,0 → 1,69 |
/* |
* Copyright (c) 2009 Jakub Jermar |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @file |
* @ingroup libcarm32 |
*/ |
#ifndef LIBC_arm32_DDI_H_ |
#define LIBC_arm32_DDI_H_ |
#include <sys/types.h> |
#include <libarch/types.h> |
static inline void pio_write_8(ioport8_t *port, uint8_t v) |
{ |
*port = v; |
} |
static inline void pio_write_16(ioport16_t *port, uint16_t v) |
{ |
*port = v; |
} |
static inline void pio_write_32(ioport32_t *port, uint32_t v) |
{ |
*port = v; |
} |
static inline uint8_t pio_read_8(ioport8_t *port) |
{ |
return *port; |
} |
static inline uint16_t pio_read_16(ioport16_t *port) |
{ |
return *port; |
} |
static inline uint32_t pio_read_32(ioport32_t *port) |
{ |
return *port; |
} |
#endif |
//branches/snapshot/uspace/lib/libc/arch/arm32/include/syscall.h |
---|
0,0 → 1,46 |
/* |
* Copyright (c) 2007 Michal Kebrt |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libcarm32 |
* @{ |
*/ |
/** @file |
* @brief |
*/ |
#ifndef LIBC_arm32_SYSCALL_H_ |
#define LIBC_arm32_SYSCALL_H_ |
#define LIBARCH_SYSCALL_GENERIC |
#include <syscall.h> |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/arch/arm32/include/config.h |
---|
0,0 → 1,45 |
/* |
* Copyright (c) 2006 Jakub Jermar |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libcarm32 |
* @{ |
*/ |
/** @file |
* @brief Configuration constants. |
*/ |
#ifndef LIBC_arm32_CONFIG_H_ |
#define LIBC_arm32_CONFIG_H_ |
#define PAGE_WIDTH 12 |
#define PAGE_SIZE (1 << PAGE_WIDTH) |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/arch/arm32/include/thread.h |
---|
0,0 → 1,42 |
/* |
* Copyright (c) 2007 Pavel Jancik |
* Copyright (c) 2007 Michal Kebrt |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libcarm32 |
* @{ |
*/ |
/** @file |
*/ |
#ifndef LIBC_arm32_THREAD_H_ |
#define LIBC_arm32_THREAD_H_ |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/arch/arm32/include/atomic.h |
---|
0,0 → 1,136 |
/* |
* Copyright (c) 2007 Michal Kebrt |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libcarm32 |
* @{ |
*/ |
/** @file |
* @brief Atomic operations. |
*/ |
#ifndef LIBC_arm32_ATOMIC_H_ |
#define LIBC_arm32_ATOMIC_H_ |
/** Atomic addition. |
* |
* @param val Where to add. |
* @param i Value to be added. |
* |
* @return Value after addition. |
*/ |
static inline long atomic_add(atomic_t *val, int i) |
{ |
int ret; |
volatile long * mem = &(val->count); |
asm volatile ( |
"1:\n" |
"ldr r2, [%1]\n" |
"add r3, r2, %2\n" |
"str r3, %0\n" |
"swp r3, r3, [%1]\n" |
"cmp r3, r2\n" |
"bne 1b\n" |
: "=m" (ret) |
: "r" (mem), "r" (i) |
: "r3", "r2" |
); |
return ret; |
} |
/** Atomic increment. |
* |
* @param val Variable to be incremented. |
*/ |
static inline void atomic_inc(atomic_t *val) |
{ |
atomic_add(val, 1); |
} |
/** Atomic decrement. |
* |
* @param val Variable to be decremented. |
*/ |
static inline void atomic_dec(atomic_t *val) |
{ |
atomic_add(val, -1); |
} |
/** Atomic pre-increment. |
* |
* @param val Variable to be incremented. |
* @return Value after incrementation. |
*/ |
static inline long atomic_preinc(atomic_t *val) |
{ |
return atomic_add(val, 1); |
} |
/** Atomic pre-decrement. |
* |
* @param val Variable to be decremented. |
* @return Value after decrementation. |
*/ |
static inline long atomic_predec(atomic_t *val) |
{ |
return atomic_add(val, -1); |
} |
/** Atomic post-increment. |
* |
* @param val Variable to be incremented. |
* @return Value before incrementation. |
*/ |
static inline long atomic_postinc(atomic_t *val) |
{ |
return atomic_add(val, 1) - 1; |
} |
/** Atomic post-decrement. |
* |
* @param val Variable to be decremented. |
* @return Value before decrementation. |
*/ |
static inline long atomic_postdec(atomic_t *val) |
{ |
return atomic_add(val, -1) + 1; |
} |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/arch/arm32/include/stackarg.h |
---|
0,0 → 1,43 |
/* |
* Copyright (c) 2007 Michal Kebrt |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libcarm32 |
* @{ |
*/ |
/** @file |
* @brief Empty. |
*/ |
#ifndef LIBC_arm32_STACKARG_H_ |
#define LIBC_arm32_STACKARG_H_ |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/arch/arm32/include/faddr.h |
---|
0,0 → 1,50 |
/* |
* Copyright (c) 2007 Michal Kebrt |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libcarm32 |
* @{ |
*/ |
/** @file |
* @brief Function address conversion. |
*/ |
#ifndef LIBC_arm32_FADDR_H_ |
#define LIBC_arm32_FADDR_H_ |
#include <libarch/types.h> |
/** Calculate absolute address of function referenced by fptr pointer. |
* |
* @param f Function pointer. |
*/ |
#define FADDR(f) (f) |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/arch/arm32/include/limits.h |
---|
0,0 → 1,47 |
/* |
* Copyright (c) 2007 Michal Kebrt |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libcarm32 |
* @{ |
*/ |
/** @file |
* @brief Limits declarations. |
*/ |
#ifndef LIBC_arm32__LIMITS_H_ |
#define LIBC_arm32__LIMITS_H_ |
#define LONG_MIN MIN_INT32 |
#define LONG_MAX MAX_INT32 |
#define ULONG_MIN MIN_UINT32 |
#define ULONG_MAX MAX_UINT32 |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/arch/arm32/Makefile.inc |
---|
0,0 → 1,47 |
# |
# Copyright (c) 2007 Michal Kebrt |
# Copyright (c) 2007 Pavel Jancik |
# All rights reserved. |
# |
# Redistribution and use in source and binary forms, with or without |
# modification, are permitted provided that the following conditions |
# are met: |
# |
# - Redistributions of source code must retain the above copyright |
# notice, this list of conditions and the following disclaimer. |
# - 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. |
# - The name of the author may not be used to endorse or promote products |
# derived from this software without specific prior written permission. |
# |
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
# |
## Toolchain configuration |
# |
TARGET = arm-linux-gnu |
TOOLCHAIN_DIR = $(CROSS_PREFIX)/arm/bin |
ARCH_SOURCES += arch/$(UARCH)/src/syscall.c \ |
arch/$(UARCH)/src/fibril.S \ |
arch/$(UARCH)/src/tls.c \ |
arch/$(UARCH)/src/eabi.S |
CFLAGS += -ffixed-r9 -mtp=soft |
LFLAGS += -N $(SOFTINT_PREFIX)/libsoftint.a |
ENDIANESS = LE |
BFD_NAME = elf32-littlearm |
BFD_ARCH = arm |
//branches/snapshot/uspace/lib/libc/arch/arm32/_link.ld.in |
---|
0,0 → 1,50 |
STARTUP(LIBC_PREFIX/arch/UARCH/src/entry.o) |
ENTRY(__entry) |
PHDRS { |
text PT_LOAD FLAGS(5); |
data PT_LOAD FLAGS(6); |
} |
SECTIONS { |
. = 0x1000 + SIZEOF_HEADERS; |
.init : { |
*(.init); |
} : text |
.text : { |
*(.text); |
*(.rodata*); |
} :text |
. = . + 0x1000; |
.data : { |
*(.opd); |
*(.data .data.*); |
*(.sdata); |
} :data |
.tdata : { |
_tdata_start = .; |
*(.tdata); |
_tdata_end = .; |
_tbss_start = .; |
*(.tbss); |
_tbss_end = .; |
} :data |
_tls_alignment = ALIGNOF(.tdata); |
.bss : { |
*(.sbss); |
*(.scommon); |
*(COMMON); |
*(.bss); |
} :data |
. = ALIGN(0x1000); |
_heap = .; |
/DISCARD/ : { |
*(*); |
} |
} |
//branches/snapshot/uspace/lib/libc/arch/arm32/src/entry.s |
---|
0,0 → 1,44 |
# |
# Copyright (c) 2007 Michal Kebrt, Pavel Jancik |
# All rights reserved. |
# |
# Redistribution and use in source and binary forms, with or without |
# modification, are permitted provided that the following conditions |
# are met: |
# |
# - Redistributions of source code must retain the above copyright |
# notice, this list of conditions and the following disclaimer. |
# - 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. |
# - The name of the author may not be used to endorse or promote products |
# derived from this software without specific prior written permission. |
# |
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
# |
.section .init, "ax" |
.org 0 |
.global __entry |
## User-space task entry point |
# |
# r1 contains the PCB pointer |
# |
__entry: |
# Pass pcb_ptr to __main as the first argument (in r0) |
mov r0, r1 |
bl __main |
bl __exit |
//branches/snapshot/uspace/lib/libc/arch/arm32/src/syscall.c |
---|
0,0 → 1,78 |
/* |
* Copyright (c) 2007 Pavel Jancik |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libcarm32 |
* @{ |
*/ |
/** @file |
* @brief Syscall routine. |
*/ |
#include <libc.h> |
/** Syscall routine. |
* |
* Stores p1-p4, id to r0-r4 registers and calls <code>swi</code> |
* instruction. Returned value is read from r0 register. |
* |
* @param p1 Parameter 1. |
* @param p2 Parameter 2. |
* @param p3 Parameter 3. |
* @param p4 Parameter 4. |
* @param id Number of syscall. |
* |
* @return Syscall return value. |
*/ |
sysarg_t __syscall(const sysarg_t p1, const sysarg_t p2, const sysarg_t p3, |
const sysarg_t p4, const sysarg_t p5, const sysarg_t p6, const syscall_t id) |
{ |
register sysarg_t __arm_reg_r0 asm("r0") = p1; |
register sysarg_t __arm_reg_r1 asm("r1") = p2; |
register sysarg_t __arm_reg_r2 asm("r2") = p3; |
register sysarg_t __arm_reg_r3 asm("r3") = p4; |
register sysarg_t __arm_reg_r4 asm("r4") = p5; |
register sysarg_t __arm_reg_r5 asm("r5") = p6; |
register sysarg_t __arm_reg_r6 asm("r6") = id; |
asm volatile ( "swi" |
: "=r" (__arm_reg_r0) |
: "r" (__arm_reg_r0), |
"r" (__arm_reg_r1), |
"r" (__arm_reg_r2), |
"r" (__arm_reg_r3), |
"r" (__arm_reg_r4), |
"r" (__arm_reg_r5), |
"r" (__arm_reg_r6) |
); |
return __arm_reg_r0; |
} |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/arch/arm32/src/tls.c |
---|
0,0 → 1,51 |
/* |
* Copyright (c) 2007 Pavel Jancik |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libcarm32 arm32 |
* @brief arm32 architecture dependent parts of libc |
* @ingroup lc |
* @{ |
*/ |
/** @file |
*/ |
#include <tls.h> |
#include <sys/types.h> |
tcb_t * __alloc_tls(void **data, size_t size) |
{ |
return tls_alloc_variant_1(data, size); |
} |
void __free_tls_arch(tcb_t *tcb, size_t size) |
{ |
tls_free_variant_1(tcb, size); |
} |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/arch/arm32/src/fibril.S |
---|
0,0 → 1,49 |
# |
# Copyright (c) 2007 Michal Kebrt |
# All rights reserved. |
# |
# Redistribution and use in source and binary forms, with or without |
# modification, are permitted provided that the following conditions |
# are met: |
# |
# - Redistributions of source code must retain the above copyright |
# notice, this list of conditions and the following disclaimer. |
# - 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. |
# - The name of the author may not be used to endorse or promote products |
# derived from this software without specific prior written permission. |
# |
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
# |
.text |
.global context_save |
.global context_restore |
context_save: |
stmia r0!, {sp, lr} |
stmia r0!, {r4-r11} |
# return 1 |
mov r0, #1 |
mov pc, lr |
context_restore: |
ldmia r0!, {sp, lr} |
ldmia r0!, {r4-r11} |
#return 0 |
mov r0, #0 |
mov pc, lr |
//branches/snapshot/uspace/lib/libc/arch/arm32/src/eabi.S |
---|
0,0 → 1,35 |
# |
# Copyright (c) 2007 Pavel Jancik |
# All rights reserved. |
# |
# Redistribution and use in source and binary forms, with or without |
# modification, are permitted provided that the following conditions |
# are met: |
# |
# - Redistributions of source code must retain the above copyright |
# notice, this list of conditions and the following disclaimer. |
# - 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. |
# - The name of the author may not be used to endorse or promote products |
# derived from this software without specific prior written permission. |
# |
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
# |
.text |
.global __aeabi_read_tp |
__aeabi_read_tp: |
mov r0, r9 |
mov pc, lr |
//branches/snapshot/uspace/lib/libc/arch/arm32/src/thread_entry.s |
---|
0,0 → 1,37 |
# |
# Copyright (c) 2006 Jakub Jermar |
# All rights reserved. |
# |
# Redistribution and use in source and binary forms, with or without |
# modification, are permitted provided that the following conditions |
# are met: |
# |
# - Redistributions of source code must retain the above copyright |
# notice, this list of conditions and the following disclaimer. |
# - 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. |
# - The name of the author may not be used to endorse or promote products |
# derived from this software without specific prior written permission. |
# |
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
# |
.text |
.global __thread_entry |
## User-space thread entry point for all but the first threads. |
# |
# |
__thread_entry: |
b __thread_main |
//branches/snapshot/uspace/lib/libc/arch/mips32eb/include/ddi.h |
---|
0,0 → 1,0 |
link ../../mips32/include/ddi.h |
Property changes: |
Added: svn:special |
+* |
\ No newline at end of property |
//branches/snapshot/uspace/lib/libc/arch/mips32eb/include/tls.h |
---|
0,0 → 1,0 |
link ../../mips32/include/tls.h |
Property changes: |
Added: svn:special |
+* |
\ No newline at end of property |
//branches/snapshot/uspace/lib/libc/arch/mips32eb/include/fibril.h |
---|
0,0 → 1,0 |
link ../../mips32/include/fibril.h |
Property changes: |
Added: svn:special |
+* |
\ No newline at end of property |
//branches/snapshot/uspace/lib/libc/arch/mips32eb/include/syscall.h |
---|
0,0 → 1,0 |
link ../../mips32/include/syscall.h |
Property changes: |
Added: svn:special |
+* |
\ No newline at end of property |
//branches/snapshot/uspace/lib/libc/arch/mips32eb/include/faddr.h |
---|
0,0 → 1,0 |
link ../../mips32/include/faddr.h |
Property changes: |
Added: svn:special |
+* |
\ No newline at end of property |
//branches/snapshot/uspace/lib/libc/arch/mips32eb/include/config.h |
---|
0,0 → 1,0 |
link ../../mips32/include/config.h |
Property changes: |
Added: svn:special |
+* |
\ No newline at end of property |
//branches/snapshot/uspace/lib/libc/arch/mips32eb/include/limits.h |
---|
0,0 → 1,0 |
link ../../mips32/include/limits.h |
Property changes: |
Added: svn:special |
+* |
\ No newline at end of property |
//branches/snapshot/uspace/lib/libc/arch/mips32eb/include/atomic.h |
---|
0,0 → 1,0 |
link ../../mips32/include/atomic.h |
Property changes: |
Added: svn:special |
+* |
\ No newline at end of property |
//branches/snapshot/uspace/lib/libc/arch/mips32eb/include/stackarg.h |
---|
0,0 → 1,0 |
link ../../mips32/include/stackarg.h |
Property changes: |
Added: svn:special |
+* |
\ No newline at end of property |
//branches/snapshot/uspace/lib/libc/arch/mips32eb/include/types.h |
---|
0,0 → 1,0 |
link ../../mips32/include/types.h |
Property changes: |
Added: svn:special |
+* |
\ No newline at end of property |
//branches/snapshot/uspace/lib/libc/arch/mips32eb/include/thread.h |
---|
0,0 → 1,0 |
link ../../mips32/include/thread.h |
Property changes: |
Added: svn:special |
+* |
\ No newline at end of property |
//branches/snapshot/uspace/lib/libc/arch/mips32eb/Makefile.inc |
---|
0,0 → 1,45 |
# |
# Copyright (c) 2005 Martin Decky |
# All rights reserved. |
# |
# Redistribution and use in source and binary forms, with or without |
# modification, are permitted provided that the following conditions |
# are met: |
# |
# - Redistributions of source code must retain the above copyright |
# notice, this list of conditions and the following disclaimer. |
# - 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. |
# - The name of the author may not be used to endorse or promote products |
# derived from this software without specific prior written permission. |
# |
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
# |
## Toolchain configuration |
# |
TARGET = mips-linux-gnu |
TOOLCHAIN_DIR = $(CROSS_PREFIX)/mips/bin |
ARCH_SOURCES += arch/$(UARCH)/src/syscall.c \ |
arch/$(UARCH)/src/fibril.S \ |
arch/$(UARCH)/src/tls.c |
CFLAGS += -mips3 |
LFLAGS += -N |
ENDIANESS = BE |
BFD_ARCH = mips |
BFD_NAME = elf32-tradbigmips |
//branches/snapshot/uspace/lib/libc/arch/mips32eb/_link.ld.in |
---|
0,0 → 1,0 |
link ../mips32/_link.ld.in |
Property changes: |
Added: svn:special |
+* |
\ No newline at end of property |
//branches/snapshot/uspace/lib/libc/arch/mips32eb/src |
---|
0,0 → 1,0 |
link ../mips32/src |
Property changes: |
Added: svn:special |
+* |
\ No newline at end of property |
//branches/snapshot/uspace/lib/libc/arch/ppc32/include/types.h |
---|
0,0 → 1,59 |
/* |
* Copyright (c) 2005 Martin Decky |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libcppc32 |
* @{ |
*/ |
/** @file |
*/ |
#ifndef LIBC_ppc32_TYPES_H_ |
#define LIBC_ppc32_TYPES_H_ |
typedef unsigned int sysarg_t; |
typedef char int8_t; |
typedef short int int16_t; |
typedef int int32_t; |
typedef long long int int64_t; |
typedef unsigned char uint8_t; |
typedef unsigned short int uint16_t; |
typedef unsigned int uint32_t; |
typedef unsigned long long int uint64_t; |
typedef int32_t ssize_t; |
typedef uint32_t size_t; |
typedef uint32_t uintptr_t; |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/arch/ppc32/include/ddi.h |
---|
0,0 → 1,69 |
/* |
* Copyright (c) 2009 Jakub Jermar |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @file |
* @ingroup libcppc32 |
*/ |
#ifndef LIBC_ppc32_DDI_H_ |
#define LIBC_ppc32_DDI_H_ |
#include <sys/types.h> |
#include <libarch/types.h> |
static inline void pio_write_8(ioport8_t *port, uint8_t v) |
{ |
*port = v; |
} |
static inline void pio_write_16(ioport16_t *port, uint16_t v) |
{ |
*port = v; |
} |
static inline void pio_write_32(ioport32_t *port, uint32_t v) |
{ |
*port = v; |
} |
static inline uint8_t pio_read_8(ioport8_t *port) |
{ |
return *port; |
} |
static inline uint16_t pio_read_16(ioport16_t *port) |
{ |
return *port; |
} |
static inline uint32_t pio_read_32(ioport32_t *port) |
{ |
return *port; |
} |
#endif |
//branches/snapshot/uspace/lib/libc/arch/ppc32/include/syscall.h |
---|
0,0 → 1,46 |
/* |
* Copyright (c) 2005 Martin Decky |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libc |
* @{ |
*/ |
/** |
* @file |
*/ |
#ifndef LIBC_ppc32_SYSCALL_H_ |
#define LIBC_ppc32_SYSCALL_H_ |
#define LIBARCH_SYSCALL_GENERIC |
#include <syscall.h> |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/arch/ppc32/include/config.h |
---|
0,0 → 1,44 |
/* |
* Copyright (c) 2006 Jakub Jermar |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libppc32 |
* @{ |
*/ |
/** @file |
*/ |
#ifndef LIBC_ppc32_CONFIG_H_ |
#define LIBC_ppc32_CONFIG_H_ |
#define PAGE_WIDTH 12 |
#define PAGE_SIZE (1 << PAGE_WIDTH) |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/arch/ppc32/include/tls.h |
---|
0,0 → 1,73 |
/* |
* Copyright (c) 2006 Martin Decky |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libcppc32 |
* @{ |
*/ |
/** @file |
*/ |
#ifndef LIBC_ppc32_TLS_H_ |
#define LIBC_ppc32_TLS_H_ |
#define CONFIG_TLS_VARIANT_1 |
#define PPC_TP_OFFSET 0x7000 |
typedef struct { |
void *fibril_data; |
} tcb_t; |
static inline void __tcb_set(tcb_t *tcb) |
{ |
void *tp = tcb; |
tp += PPC_TP_OFFSET + sizeof(tcb_t); |
asm volatile ( |
"mr %%r2, %0\n" |
: |
: "r" (tp) |
); |
} |
static inline tcb_t * __tcb_get(void) |
{ |
void * retval; |
asm volatile ( |
"mr %0, %%r2\n" |
: "=r" (retval) |
); |
return (tcb_t *)(retval - PPC_TP_OFFSET - sizeof(tcb_t)); |
} |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/arch/ppc32/include/thread.h |
---|
0,0 → 1,41 |
/* |
* Copyright (c) 2006 Martin Decky |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libcppc32 |
* @{ |
*/ |
/** @file |
*/ |
#ifndef LIBC_ppc32_THREAD_H_ |
#define LIBC_ppc32_THREAD_H_ |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/arch/ppc32/include/fibril.h |
---|
0,0 → 1,83 |
/* |
* Copyright (c) 2006 Martin Decky |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libcppc32 |
* @{ |
*/ |
/** @file |
*/ |
#ifndef LIBC_ppc32_FIBRIL_H_ |
#define LIBC_ppc32_FIBRIL_H_ |
#include <sys/types.h> |
/* We define our own context_set, because we need to set |
* the TLS pointer to the tcb+0x7000 |
* |
* See tls_set in thread.h |
*/ |
#define context_set(c, _pc, stack, size, ptls) \ |
(c)->pc = (sysarg_t) (_pc); \ |
(c)->sp = ((sysarg_t) (stack)) + (size) - SP_DELTA; \ |
(c)->tls = ((sysarg_t) (ptls)) + 0x7000 + sizeof(tcb_t); |
#define SP_DELTA 16 |
typedef struct { |
uint32_t sp; |
uint32_t pc; |
uint32_t tls; |
uint32_t r13; |
uint32_t r14; |
uint32_t r15; |
uint32_t r16; |
uint32_t r17; |
uint32_t r18; |
uint32_t r19; |
uint32_t r20; |
uint32_t r21; |
uint32_t r22; |
uint32_t r23; |
uint32_t r24; |
uint32_t r25; |
uint32_t r26; |
uint32_t r27; |
uint32_t r28; |
uint32_t r29; |
uint32_t r30; |
uint32_t r31; |
uint32_t cr; |
} __attribute__ ((packed)) context_t; |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/arch/ppc32/include/atomic.h |
---|
0,0 → 1,95 |
/* |
* Copyright (c) 2005 Martin Decky |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libcppc32 |
* @{ |
*/ |
/** @file |
*/ |
#ifndef LIBC_ppc32_ATOMIC_H_ |
#define LIBC_ppc32_ATOMIC_H_ |
static inline void atomic_inc(atomic_t *val) |
{ |
long tmp; |
asm volatile ( |
"1:\n" |
"lwarx %0, 0, %2\n" |
"addic %0, %0, 1\n" |
"stwcx. %0, 0, %2\n" |
"bne- 1b" |
: "=&r" (tmp), "=m" (val->count) |
: "r" (&val->count), "m" (val->count) |
: "cc"); |
} |
static inline void atomic_dec(atomic_t *val) |
{ |
long tmp; |
asm volatile ( |
"1:\n" |
"lwarx %0, 0, %2\n" |
"addic %0, %0, -1\n" |
"stwcx. %0, 0, %2\n" |
"bne- 1b" |
: "=&r" (tmp), "=m" (val->count) |
: "r" (&val->count), "m" (val->count) |
: "cc"); |
} |
static inline long atomic_postinc(atomic_t *val) |
{ |
atomic_inc(val); |
return val->count - 1; |
} |
static inline long atomic_postdec(atomic_t *val) |
{ |
atomic_dec(val); |
return val->count + 1; |
} |
static inline long atomic_preinc(atomic_t *val) |
{ |
atomic_inc(val); |
return val->count; |
} |
static inline long atomic_predec(atomic_t *val) |
{ |
atomic_dec(val); |
return val->count; |
} |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/arch/ppc32/include/regname.h |
---|
0,0 → 1,188 |
/* |
* Copyright (c) 2006 Martin Decky |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libcppc32 |
* @{ |
*/ |
/** @file |
*/ |
#ifndef LIBC_ppc32_REGNAME_H_ |
#define LIBC_ppc32_REGNAME_H_ |
/* Condition Register Bit Fields */ |
#define cr0 0 |
#define cr1 1 |
#define cr2 2 |
#define cr3 3 |
#define cr4 4 |
#define cr5 5 |
#define cr6 6 |
#define cr7 7 |
/* General Purpose Registers (GPRs) */ |
#define r0 0 |
#define r1 1 |
#define r2 2 |
#define r3 3 |
#define r4 4 |
#define r5 5 |
#define r6 6 |
#define r7 7 |
#define r8 8 |
#define r9 9 |
#define r10 10 |
#define r11 11 |
#define r12 12 |
#define r13 13 |
#define r14 14 |
#define r15 15 |
#define r16 16 |
#define r17 17 |
#define r18 18 |
#define r19 19 |
#define r20 20 |
#define r21 21 |
#define r22 22 |
#define r23 23 |
#define r24 24 |
#define r25 25 |
#define r26 26 |
#define r27 27 |
#define r28 28 |
#define r29 29 |
#define r30 30 |
#define r31 31 |
/* GPR Aliases */ |
#define sp 1 |
/* Floating Point Registers (FPRs) */ |
#define fr0 0 |
#define fr1 1 |
#define fr2 2 |
#define fr3 3 |
#define fr4 4 |
#define fr5 5 |
#define fr6 6 |
#define fr7 7 |
#define fr8 8 |
#define fr9 9 |
#define fr10 10 |
#define fr11 11 |
#define fr12 12 |
#define fr13 13 |
#define fr14 14 |
#define fr15 15 |
#define fr16 16 |
#define fr17 17 |
#define fr18 18 |
#define fr19 19 |
#define fr20 20 |
#define fr21 21 |
#define fr22 22 |
#define fr23 23 |
#define fr24 24 |
#define fr25 25 |
#define fr26 26 |
#define fr27 27 |
#define fr28 28 |
#define fr29 29 |
#define fr30 30 |
#define fr31 31 |
#define vr0 0 |
#define vr1 1 |
#define vr2 2 |
#define vr3 3 |
#define vr4 4 |
#define vr5 5 |
#define vr6 6 |
#define vr7 7 |
#define vr8 8 |
#define vr9 9 |
#define vr10 10 |
#define vr11 11 |
#define vr12 12 |
#define vr13 13 |
#define vr14 14 |
#define vr15 15 |
#define vr16 16 |
#define vr17 17 |
#define vr18 18 |
#define vr19 19 |
#define vr20 20 |
#define vr21 21 |
#define vr22 22 |
#define vr23 23 |
#define vr24 24 |
#define vr25 25 |
#define vr26 26 |
#define vr27 27 |
#define vr28 28 |
#define vr29 29 |
#define vr30 30 |
#define vr31 31 |
#define evr0 0 |
#define evr1 1 |
#define evr2 2 |
#define evr3 3 |
#define evr4 4 |
#define evr5 5 |
#define evr6 6 |
#define evr7 7 |
#define evr8 8 |
#define evr9 9 |
#define evr10 10 |
#define evr11 11 |
#define evr12 12 |
#define evr13 13 |
#define evr14 14 |
#define evr15 15 |
#define evr16 16 |
#define evr17 17 |
#define evr18 18 |
#define evr19 19 |
#define evr20 20 |
#define evr21 21 |
#define evr22 22 |
#define evr23 23 |
#define evr24 24 |
#define evr25 25 |
#define evr26 26 |
#define evr27 27 |
#define evr28 28 |
#define evr29 29 |
#define evr30 30 |
#define evr31 31 |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/arch/ppc32/include/stackarg.h |
---|
0,0 → 1,41 |
/* |
* Copyright (c) 2006 Josef Cejka |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libcppc32 |
* @{ |
*/ |
/** @file |
*/ |
#ifndef LIBC_STACKARG_H_ |
#define LIBC_STACKARG_H_ |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/arch/ppc32/include/faddr.h |
---|
0,0 → 1,45 |
/* |
* Copyright (c) 2005 Ondrej Palkovsky |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libcppc32 |
* @{ |
*/ |
/** @file |
*/ |
#ifndef LIBC_ppc32_FADDR_H_ |
#define LIBC_ppc32_FADDR_H_ |
#include <libarch/types.h> |
#define FADDR(fptr) ((uintptr_t) (fptr)) |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/arch/ppc32/include/limits.h |
---|
0,0 → 1,46 |
/* |
* Copyright (c) 2006 Josef Cejka |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libcppc32 |
* @{ |
*/ |
/** @file |
*/ |
#ifndef LIBC_ppc32_LIMITS_H_ |
#define LIBC_ppc32_LIMITS_H_ |
#define LONG_MIN MIN_INT32 |
#define LONG_MAX MAX_INT32 |
#define ULONG_MIN MIN_UINT32 |
#define ULONG_MAX MAX_UINT32 |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/arch/ppc32/Makefile.inc |
---|
0,0 → 1,46 |
# |
# Copyright (c) 2006 Martin Decky |
# All rights reserved. |
# |
# Redistribution and use in source and binary forms, with or without |
# modification, are permitted provided that the following conditions |
# are met: |
# |
# - Redistributions of source code must retain the above copyright |
# notice, this list of conditions and the following disclaimer. |
# - 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. |
# - The name of the author may not be used to endorse or promote products |
# derived from this software without specific prior written permission. |
# |
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
# |
## Toolchain configuration |
# |
TARGET = ppc-linux-gnu |
TOOLCHAIN_DIR = $(CROSS_PREFIX)/ppc/bin |
ARCH_SOURCES += arch/$(UARCH)/src/syscall.c \ |
arch/$(UARCH)/src/fibril.S \ |
arch/$(UARCH)/src/tls.c |
CFLAGS += -mcpu=powerpc -msoft-float -m32 |
AFLAGS += -a32 |
LFLAGS += -N |
ENDIANESS = BE |
BFD_NAME = elf32-powerpc |
BFD_ARCH = powerpc:common |
//branches/snapshot/uspace/lib/libc/arch/ppc32/_link.ld.in |
---|
0,0 → 1,48 |
STARTUP(LIBC_PREFIX/arch/UARCH/src/entry.o) |
ENTRY(__entry) |
PHDRS { |
text PT_LOAD FLAGS(5); |
data PT_LOAD FLAGS(6); |
} |
SECTIONS { |
. = 0x1000 + SIZEOF_HEADERS; |
.init : { |
*(.init); |
} :text |
.text : { |
*(.text); |
*(.rodata*); |
} :text |
. = . + 0x1000; |
.data : { |
*(.data); |
*(.sdata); |
} :data |
.tdata : { |
_tdata_start = .; |
*(.tdata); |
_tdata_end = .; |
_tbss_start = .; |
*(.tbss); |
_tbss_end = .; |
} :data |
_tls_alignment = ALIGNOF(.tdata); |
.bss : { |
*(.sbss); |
*(COMMON); |
*(.bss); |
} :data |
. = ALIGN(0x1000); |
_heap = .; |
/DISCARD/ : { |
*(*); |
} |
} |
//branches/snapshot/uspace/lib/libc/arch/ppc32/src/entry.s |
---|
0,0 → 1,45 |
# |
# Copyright (c) 2006 Martin Decky |
# All rights reserved. |
# |
# Redistribution and use in source and binary forms, with or without |
# modification, are permitted provided that the following conditions |
# are met: |
# |
# - Redistributions of source code must retain the above copyright |
# notice, this list of conditions and the following disclaimer. |
# - 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. |
# - The name of the author may not be used to endorse or promote products |
# derived from this software without specific prior written permission. |
# |
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
# |
.section .init, "ax" |
.org 0 |
.globl __entry |
## User-space task entry point |
# |
# r6 contains the PCB pointer |
# |
__entry: |
# Pass the PCB pointer to __main() as the first argument. |
# The first argument is passed in r3. |
mr %r3, %r6 |
bl __main |
bl __exit |
//branches/snapshot/uspace/lib/libc/arch/ppc32/src/fibril.S |
---|
0,0 → 1,62 |
# |
# Copyright (c) 2006 Martin Decky |
# All rights reserved. |
# |
# Redistribution and use in source and binary forms, with or without |
# modification, are permitted provided that the following conditions |
# are met: |
# |
# - Redistributions of source code must retain the above copyright |
# notice, this list of conditions and the following disclaimer. |
# - 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. |
# - The name of the author may not be used to endorse or promote products |
# derived from this software without specific prior written permission. |
# |
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
# |
.text |
.global context_save |
.global context_restore |
#include <libarch/regname.h> |
#include <arch/context_offset.h> |
context_save: |
CONTEXT_SAVE_ARCH_CORE r3 |
mflr r4 |
stw r4, OFFSET_PC(r3) |
mfcr r4 |
stw r4, OFFSET_CR(r3) |
# context_save returns 1 |
li r3, 1 |
blr |
context_restore: |
CONTEXT_RESTORE_ARCH_CORE r3 |
lwz r4, OFFSET_CR(r3) |
mtcr r4 |
lwz r4, OFFSET_PC(r3) |
mtlr r4 |
# context_restore returns 0 |
li r3, 0 |
blr |
//branches/snapshot/uspace/lib/libc/arch/ppc32/src/syscall.c |
---|
0,0 → 1,66 |
/* |
* Copyright (c) 2006 Martin Decky |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libcppc32 ppc32 |
* @brief ppc32 architecture dependent parts of libc |
* @ingroup lc |
* @{ |
*/ |
/** @file |
*/ |
#include <libc.h> |
sysarg_t __syscall(const sysarg_t p1, const sysarg_t p2, const sysarg_t p3, |
const sysarg_t p4, const sysarg_t p5, const sysarg_t p6, const syscall_t id) |
{ |
register sysarg_t __ppc32_reg_r3 asm("3") = p1; |
register sysarg_t __ppc32_reg_r4 asm("4") = p2; |
register sysarg_t __ppc32_reg_r5 asm("5") = p3; |
register sysarg_t __ppc32_reg_r6 asm("6") = p4; |
register sysarg_t __ppc32_reg_r7 asm("7") = p5; |
register sysarg_t __ppc32_reg_r8 asm("8") = p6; |
register sysarg_t __ppc32_reg_r9 asm("9") = id; |
asm volatile ( |
"sc\n" |
: "=r" (__ppc32_reg_r3) |
: "r" (__ppc32_reg_r3), |
"r" (__ppc32_reg_r4), |
"r" (__ppc32_reg_r5), |
"r" (__ppc32_reg_r6), |
"r" (__ppc32_reg_r7), |
"r" (__ppc32_reg_r8), |
"r" (__ppc32_reg_r9) |
); |
return __ppc32_reg_r3; |
} |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/arch/ppc32/src/tls.c |
---|
0,0 → 1,49 |
/* |
* Copyright (c) 2006 Ondrej Palkovsky |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libcppc32 |
* @{ |
*/ |
/** @file |
*/ |
#include <tls.h> |
#include <sys/types.h> |
tcb_t * __alloc_tls(void **data, size_t size) |
{ |
return tls_alloc_variant_1(data, size); |
} |
void __free_tls_arch(tcb_t *tcb, size_t size) |
{ |
tls_free_variant_1(tcb, size); |
} |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/arch/ppc32/src/thread_entry.s |
---|
0,0 → 1,39 |
# |
# Copyright (c) 2006 Martin Decky |
# All rights reserved. |
# |
# Redistribution and use in source and binary forms, with or without |
# modification, are permitted provided that the following conditions |
# are met: |
# |
# - Redistributions of source code must retain the above copyright |
# notice, this list of conditions and the following disclaimer. |
# - 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. |
# - The name of the author may not be used to endorse or promote products |
# derived from this software without specific prior written permission. |
# |
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
# |
.text |
.globl __thread_entry |
## User-space thread entry point for all but the first threads. |
# |
# |
__thread_entry: |
b __thread_main |
.end __thread_entry |
//branches/snapshot/uspace/lib/libc/arch/amd64/include/types.h |
---|
0,0 → 1,58 |
/* |
* Copyright (c) 2006 Ondrej Palkovsky |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libcamd64 |
* @{ |
*/ |
/** @file |
*/ |
#ifndef LIBC_amd64_TYPES_H_ |
#define LIBC_amd64_TYPES_H_ |
typedef unsigned long long sysarg_t; |
typedef signed char int8_t; |
typedef short int int16_t; |
typedef int int32_t; |
typedef long long int int64_t; |
typedef unsigned char uint8_t; |
typedef unsigned short int uint16_t; |
typedef unsigned int uint32_t; |
typedef unsigned long long int uint64_t; |
typedef int64_t ssize_t; |
typedef uint64_t size_t; |
typedef uint64_t uintptr_t; |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/arch/amd64/include/syscall.h |
---|
0,0 → 1,46 |
/* |
* Copyright (c) 2005 Martin Decky |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libc |
* @{ |
*/ |
/** |
* @file |
*/ |
#ifndef LIBC_amd64_SYSCALL_H_ |
#define LIBC_amd64_SYSCALL_H_ |
#define LIBARCH_SYSCALL_GENERIC |
#include <syscall.h> |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/arch/amd64/include/config.h |
---|
0,0 → 1,44 |
/* |
* Copyright (c) 2006 Jakub Jermar |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libcamd64 |
* @{ |
*/ |
/** @file |
*/ |
#ifndef LIBC_amd64_CONFIG_H_ |
#define LIBC_amd64_CONFIG_H_ |
#define PAGE_WIDTH 12 |
#define PAGE_SIZE (1 << PAGE_WIDTH) |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/arch/amd64/include/atomic.h |
---|
0,0 → 1,80 |
/* |
* Copyright (c) 2001-2004 Jakub Jermar |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libcamd64 amd64 |
* @ingroup lc |
* @brief amd64 architecture dependent parts of libc |
* @{ |
*/ |
/** @file |
*/ |
#ifndef LIBC_amd64_ATOMIC_H_ |
#define LIBC_amd64_ATOMIC_H_ |
static inline void atomic_inc(atomic_t *val) { |
asm volatile ("lock incq %0\n" : "+m" (val->count)); |
} |
static inline void atomic_dec(atomic_t *val) { |
asm volatile ("lock decq %0\n" : "+m" (val->count)); |
} |
static inline long atomic_postinc(atomic_t *val) |
{ |
long r; |
asm volatile ( |
"movq $1, %0\n" |
"lock xaddq %0, %1\n" |
: "=r" (r), "+m" (val->count) |
); |
return r; |
} |
static inline long atomic_postdec(atomic_t *val) |
{ |
long r; |
asm volatile ( |
"movq $-1, %0\n" |
"lock xaddq %0, %1\n" |
: "=r" (r), "+m" (val->count) |
); |
return r; |
} |
#define atomic_preinc(val) (atomic_postinc(val) + 1) |
#define atomic_predec(val) (atomic_postdec(val) - 1) |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/arch/amd64/include/tls.h |
---|
0,0 → 1,63 |
/* |
* Copyright (c) 2006 Ondrej Palkovsky |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libcamd64 |
* @{ |
*/ |
/** @file |
*/ |
#ifndef LIBC_amd64_TLS_H_ |
#define LIBC_amd64_TLS_H_ |
#define CONFIG_TLS_VARIANT_2 |
#include <libc.h> |
typedef struct { |
void *self; |
void *fibril_data; |
} tcb_t; |
static inline void __tcb_set(tcb_t *tcb) |
{ |
__SYSCALL1(SYS_TLS_SET, (sysarg_t) tcb); |
} |
static inline tcb_t * __tcb_get(void) |
{ |
void * retval; |
asm ("movq %%fs:0, %0" : "=r"(retval)); |
return retval; |
} |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/arch/amd64/include/thread.h |
---|
0,0 → 1,41 |
/* |
* Copyright (c) 2006 Ondrej Palkovsky |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libcamd64 |
* @{ |
*/ |
/** @file |
*/ |
#ifndef LIBC_amd64_THREAD_H_ |
#define LIBC_amd64_THREAD_H_ |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/arch/amd64/include/fibril.h |
---|
0,0 → 1,67 |
/* |
* Copyright (c) 2006 Ondrej Palkovsky |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libcamd64 |
* @{ |
*/ |
/** @file |
*/ |
#ifndef LIBC_amd64_FIBRIL_H_ |
#define LIBC_amd64_FIBRIL_H_ |
#include <sys/types.h> |
/* According to ABI the stack MUST be aligned on |
* 16-byte boundary. If it is not, the va_arg calling will |
* panic sooner or later |
*/ |
#define SP_DELTA 16 |
/* We include only registers that must be preserved |
* during function call |
*/ |
typedef struct { |
uint64_t sp; |
uint64_t pc; |
uint64_t rbx; |
uint64_t rbp; |
uint64_t r12; |
uint64_t r13; |
uint64_t r14; |
uint64_t r15; |
uint64_t tls; |
} context_t; |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/arch/amd64/include/stackarg.h |
---|
0,0 → 1,41 |
/* |
* Copyright (c) 2006 Josef Cejka |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libcamd64 |
* @{ |
*/ |
/** @file |
*/ |
#ifndef LIBC_STACKARG_H_ |
#define LIBC_STACKARG_H_ |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/arch/amd64/include/faddr.h |
---|
0,0 → 1,45 |
/* |
* Copyright (c) 2005 Ondrej Palkovsky |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libcamd64 |
* @{ |
*/ |
/** @file |
*/ |
#ifndef LIBC_amd64_FADDR_H_ |
#define LIBC_amd64_FADDR_H_ |
#include <libarch/types.h> |
#define FADDR(fptr) ((uintptr_t) (fptr)) |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/arch/amd64/include/limits.h |
---|
0,0 → 1,46 |
/* |
* Copyright (c) 2006 Josef Cejka |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libcamd64 |
* @{ |
*/ |
/** @file |
*/ |
#ifndef LIBC_amd64_LIMITS_H_ |
#define LIBC_amd64_LIMITS_H_ |
# define LONG_MIN MIN_INT64 |
# define LONG_MAX MAX_INT64 |
# define ULONG_MIN MIN_UINT64 |
# define ULONG_MAX MAX_UINT64 |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/arch/amd64/include/ddi.h |
---|
0,0 → 1,0 |
link ../../ia32/include/ddi.h |
Property changes: |
Added: svn:special |
+* |
\ No newline at end of property |
//branches/snapshot/uspace/lib/libc/arch/amd64/Makefile.inc |
---|
0,0 → 1,44 |
# |
# Copyright (c) 2005 Martin Decky |
# All rights reserved. |
# |
# Redistribution and use in source and binary forms, with or without |
# modification, are permitted provided that the following conditions |
# are met: |
# |
# - Redistributions of source code must retain the above copyright |
# notice, this list of conditions and the following disclaimer. |
# - 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. |
# - The name of the author may not be used to endorse or promote products |
# derived from this software without specific prior written permission. |
# |
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
# |
## Toolchain configuration |
# |
TARGET = amd64-linux-gnu |
TOOLCHAIN_DIR = $(CROSS_PREFIX)/amd64/bin |
ARCH_SOURCES += arch/$(UARCH)/src/syscall.S \ |
arch/$(UARCH)/src/fibril.S \ |
arch/$(UARCH)/src/tls.c |
LFLAGS += -N |
ENDIANESS = LE |
BFD_NAME = elf64-x86-64 |
BFD_ARCH = i386:x86-64 |
//branches/snapshot/uspace/lib/libc/arch/amd64/_link.ld.in |
---|
0,0 → 1,46 |
STARTUP(LIBC_PREFIX/arch/UARCH/src/entry.o) |
ENTRY(__entry) |
PHDRS { |
text PT_LOAD FLAGS(5); |
data PT_LOAD FLAGS(6); |
} |
SECTIONS { |
. = 0x1000 + SIZEOF_HEADERS; |
.init : { |
*(.init); |
} :text |
.text : { |
*(.text); |
*(.rodata*); |
} :text |
. = . + 0x1000; |
.data : { |
*(.data); |
} :data |
.tdata : { |
_tdata_start = .; |
*(.tdata); |
_tdata_end = .; |
_tbss_start = .; |
*(.tbss); |
_tbss_end = .; |
} :data |
_tls_alignment = ALIGNOF(.tdata); |
.bss : { |
*(COMMON); |
*(.bss); |
} :data |
. = ALIGN(0x1000); |
_heap = .; |
/DISCARD/ : { |
*(*); |
} |
} |
//branches/snapshot/uspace/lib/libc/arch/amd64/src/entry.s |
---|
0,0 → 1,44 |
# |
# Copyright (c) 2006 Ondrej Palkovsky |
# All rights reserved. |
# |
# Redistribution and use in source and binary forms, with or without |
# modification, are permitted provided that the following conditions |
# are met: |
# |
# - Redistributions of source code must retain the above copyright |
# notice, this list of conditions and the following disclaimer. |
# - 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. |
# - The name of the author may not be used to endorse or promote products |
# derived from this software without specific prior written permission. |
# |
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
# |
.section .init, "ax" |
.org 0 |
.globl __entry |
## User-space task entry point |
# |
# %rdi contains the PCB pointer |
# |
__entry: |
# %rdi was deliberately chosen as the first argument is also in %rdi |
# Pass PCB pointer to __main (no operation) |
call __main |
call __exit |
//branches/snapshot/uspace/lib/libc/arch/amd64/src/fibril.S |
---|
0,0 → 1,73 |
# |
# Copyright (c) 2001-2004 Jakub Jermar |
# All rights reserved. |
# |
# Redistribution and use in source and binary forms, with or without |
# modification, are permitted provided that the following conditions |
# are met: |
# |
# - Redistributions of source code must retain the above copyright |
# notice, this list of conditions and the following disclaimer. |
# - 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. |
# - The name of the author may not be used to endorse or promote products |
# derived from this software without specific prior written permission. |
# |
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
# |
.text |
.global context_save |
.global context_restore |
#include <kernel/arch/context_offset.h> |
## Save current CPU context |
# |
# Save CPU context to context_t variable |
# pointed by the 1st argument. Returns 1 in EAX. |
# |
context_save: |
movq (%rsp), %rdx # the caller's return %eip |
# In %edi is passed 1st argument |
CONTEXT_SAVE_ARCH_CORE %rdi %rdx |
# Save TLS |
movq %fs:0, %rax |
movq %rax, OFFSET_TLS(%rdi) |
xorq %rax,%rax # context_save returns 1 |
incq %rax |
ret |
## Restore current CPU context |
# |
# Restore CPU context from context_t variable |
# pointed by the 1st argument. Returns 0 in EAX. |
# |
context_restore: |
CONTEXT_RESTORE_ARCH_CORE %rdi %rdx |
movq %rdx,(%rsp) |
# Set thread local storage |
movq OFFSET_TLS(%rdi), %rdi # Set arg1 to TLS addr |
movq $1, %rax # SYS_TLS_SET |
syscall |
xorq %rax,%rax # context_restore returns 0 |
ret |
//branches/snapshot/uspace/lib/libc/arch/amd64/src/syscall.S |
---|
0,0 → 1,57 |
# |
# Copyright (c) 2006 Ondrej Palkovsky |
# All rights reserved. |
# |
# Redistribution and use in source and binary forms, with or without |
# modification, are permitted provided that the following conditions |
# are met: |
# |
# - Redistributions of source code must retain the above copyright |
# notice, this list of conditions and the following disclaimer. |
# - 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. |
# - The name of the author may not be used to endorse or promote products |
# derived from this software without specific prior written permission. |
# |
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
# |
.text |
.global __syscall |
## Make a system call. |
# |
# @param rdi First argument. |
# @param rsi Second argument. |
# @param rdx Third argument. |
# @param rcx Fourth argument. |
# @param r8 Fifth argument. |
# @param r9 Sixth argument. |
# @param 8(%rsp) Syscall number. |
# |
# @return The return value will be stored in RAX. |
# |
__syscall: |
# |
# Move the syscall number into RAX. |
movslq 8(%rsp), %rax |
# |
# Save RCX, the 4th argument, aside because RCX gets rewritten by the |
# SYSCALL instruction. |
# |
movq %rcx, %r10 |
syscall |
ret |
//branches/snapshot/uspace/lib/libc/arch/amd64/src/tls.c |
---|
0,0 → 1,51 |
/* |
* Copyright (c) 2006 Ondrej Palkovsky |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libcamd64 amd64 |
* @ingroup lc |
* @{ |
*/ |
/** @file |
* @ingroup libcia32 |
*/ |
#include <tls.h> |
#include <sys/types.h> |
tcb_t * __alloc_tls(void **data, size_t size) |
{ |
return tls_alloc_variant_2(data, size); |
} |
void __free_tls_arch(tcb_t *tcb, size_t size) |
{ |
tls_free_variant_2(tcb, size); |
} |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/arch/amd64/src/thread_entry.s |
---|
0,0 → 1,43 |
# |
# Copyright (c) 2006 Jakub Jermar |
# All rights reserved. |
# |
# Redistribution and use in source and binary forms, with or without |
# modification, are permitted provided that the following conditions |
# are met: |
# |
# - Redistributions of source code must retain the above copyright |
# notice, this list of conditions and the following disclaimer. |
# - 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. |
# - The name of the author may not be used to endorse or promote products |
# derived from this software without specific prior written permission. |
# |
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
# |
.text |
.globl __thread_entry |
## User-space thread entry point for all but the first threads. |
# |
# |
__thread_entry: |
# |
# RAX contains address of uarg |
# |
movq %rax, %rdi |
call __thread_main |
.end __thread_entry |
//branches/snapshot/uspace/lib/libc/arch/mips32/include/types.h |
---|
0,0 → 1,59 |
/* |
* Copyright (c) 2005 Martin Decky |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libcmips32 |
* @{ |
*/ |
/** @file |
* @ingroup libcmips32eb |
*/ |
#ifndef LIBC_mips32_TYPES_H_ |
#define LIBC_mips32_TYPES_H_ |
typedef unsigned int sysarg_t; |
typedef char int8_t; |
typedef short int int16_t; |
typedef long int int32_t; |
typedef long long int int64_t; |
typedef unsigned char uint8_t; |
typedef unsigned short int uint16_t; |
typedef unsigned long int uint32_t; |
typedef unsigned long long int uint64_t; |
typedef int32_t ssize_t; |
typedef uint32_t size_t; |
typedef uint32_t uintptr_t; |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/arch/mips32/include/ddi.h |
---|
0,0 → 1,69 |
/* |
* Copyright (c) 2009 Jakub Jermar |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @file |
* @ingroup libcmips32 |
*/ |
#ifndef LIBC_mips32_DDI_H_ |
#define LIBC_mips32_DDI_H_ |
#include <sys/types.h> |
#include <libarch/types.h> |
static inline void pio_write_8(ioport8_t *port, uint8_t v) |
{ |
*port = v; |
} |
static inline void pio_write_16(ioport16_t *port, uint16_t v) |
{ |
*port = v; |
} |
static inline void pio_write_32(ioport32_t *port, uint32_t v) |
{ |
*port = v; |
} |
static inline uint8_t pio_read_8(ioport8_t *port) |
{ |
return *port; |
} |
static inline uint16_t pio_read_16(ioport16_t *port) |
{ |
return *port; |
} |
static inline uint32_t pio_read_32(ioport32_t *port) |
{ |
return *port; |
} |
#endif |
//branches/snapshot/uspace/lib/libc/arch/mips32/include/atomic.h |
---|
0,0 → 1,78 |
/* |
* Copyright (c) 2005 Ondrej Palkovsky |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libcmips32 |
* @{ |
*/ |
/** @file |
* @ingroup libcmips32eb |
*/ |
#ifndef LIBC_mips32_ATOMIC_H_ |
#define LIBC_mips32_ATOMIC_H_ |
#define atomic_inc(x) ((void) atomic_add(x, 1)) |
#define atomic_dec(x) ((void) atomic_add(x, -1)) |
#define atomic_postinc(x) (atomic_add(x, 1) - 1) |
#define atomic_postdec(x) (atomic_add(x, -1) + 1) |
#define atomic_preinc(x) atomic_add(x, 1) |
#define atomic_predec(x) atomic_add(x, -1) |
/* Atomic addition of immediate value. |
* |
* @param val Memory location to which will be the immediate value added. |
* @param i Signed immediate that will be added to *val. |
* |
* @return Value after addition. |
*/ |
static inline long atomic_add(atomic_t *val, int i) |
{ |
long tmp, v; |
asm volatile ( |
"1:\n" |
" ll %0, %1\n" |
" addu %0, %0, %3\n" /* same as add, but never traps on overflow */ |
" move %2, %0\n" |
" sc %0, %1\n" |
" beq %0, %4, 1b\n" /* if the atomic operation failed, try again */ |
/* nop */ /* nop is inserted automatically by compiler */ |
" nop\n" |
: "=&r" (tmp), "+m" (val->count), "=&r" (v) |
: "r" (i), "i" (0) |
); |
return v; |
} |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/arch/mips32/include/syscall.h |
---|
0,0 → 1,46 |
/* |
* Copyright (c) 2005 Martin Decky |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libc |
* @{ |
*/ |
/** |
* @file |
*/ |
#ifndef LIBC_mips32_SYSCALL_H_ |
#define LIBC_mips32_SYSCALL_H_ |
#define LIBARCH_SYSCALL_GENERIC |
#include <syscall.h> |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/arch/mips32/include/config.h |
---|
0,0 → 1,44 |
/* |
* Copyright (c) 2006 Jakub Jermar |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libcmips32 |
* @{ |
*/ |
/** @file |
*/ |
#ifndef LIBC_mips32_CONFIG_H_ |
#define LIBC_mips32_CONFIG_H_ |
#define PAGE_WIDTH 14 |
#define PAGE_SIZE (1 << PAGE_WIDTH) |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/arch/mips32/include/tls.h |
---|
0,0 → 1,86 |
/* |
* Copyright (c) 2006 Ondrej Palkovsky |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libcmips32 |
* @{ |
*/ |
/** @file |
* @ingroup libcmips32eb |
*/ |
/* TLS for MIPS is described in http://www.linux-mips.org/wiki/NPTL */ |
#ifndef LIBC_mips32_TLS_H_ |
#define LIBC_mips32_TLS_H_ |
/* |
* FIXME: Note that the use of variant I contradicts the observations made in |
* the note below. Nevertheless the scheme we have used for allocating and |
* deallocatin TLS corresponds to TLS variant I. |
*/ |
#define CONFIG_TLS_VARIANT_1 |
/* I did not find any specification (neither MIPS nor PowerPC), but |
* as I found it |
* - it uses Variant II |
* - TCB is at Address(First TLS Block)+0x7000. |
* - DTV is at Address(First TLS Block)+0x8000 |
* - What would happen if the TLS data was larger then 0x7000? |
* - The linker never accesses DTV directly, has the second definition any |
* sense? |
* We will make it this way: |
* - TCB is at TP-0x7000-sizeof(tcb) |
* - No assumption about DTV etc., but it will not have a fixed address |
*/ |
#define MIPS_TP_OFFSET 0x7000 |
typedef struct { |
void *fibril_data; |
} tcb_t; |
static inline void __tcb_set(tcb_t *tcb) |
{ |
void *tp = tcb; |
tp += MIPS_TP_OFFSET + sizeof(tcb_t); |
asm volatile ("add $27, %0, $0" : : "r"(tp)); /* Move tls to K1 */ |
} |
static inline tcb_t * __tcb_get(void) |
{ |
void * retval; |
asm volatile("add %0, $27, $0" : "=r"(retval)); |
return (tcb_t *)(retval - MIPS_TP_OFFSET - sizeof(tcb_t)); |
} |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/arch/mips32/include/thread.h |
---|
0,0 → 1,42 |
/* |
* Copyright (c) 2006 Ondrej Palkovsky |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libcmips32 |
* @{ |
*/ |
/** @file |
* @ingroup libcmips32eb |
*/ |
#ifndef LIBC_mips32_THREAD_H_ |
#define LIBC_mips32_THREAD_H_ |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/arch/mips32/include/stackarg.h |
---|
0,0 → 1,62 |
/* |
* Copyright (c) 2006 Josef Cejka |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libcmips32 |
* @{ |
*/ |
/** @file |
* @ingroup libcmips32eb |
*/ |
#ifndef LIBC_mips32_STACKARG_H_ |
#define LIBC_mips32_STACKARG_H_ |
/* dont allow to define it second time in stdarg.h */ |
#define __VARARGS_DEFINED |
#include <sys/types.h> |
/** |
* va_arg macro for MIPS32 - problem is that 64 bit values must be aligned on an 8-byte boundary (32bit values not) |
* To satisfy this, paddings must be sometimes inserted. |
*/ |
typedef uint8_t* va_list; |
#define va_start(ap, lst) \ |
((ap) = (va_list)&(lst) + sizeof(lst)) |
#define va_arg(ap, type) \ |
(((type *)((ap) = (va_list)( (sizeof(type) <= 4) ? ((uint32_t)((ap) + 2*4 - 1) & (~3)) : ((uint32_t)((ap) + 2*8 -1) & (~7)) )))[-1]) |
#define va_end(ap) |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/arch/mips32/include/fibril.h |
---|
0,0 → 1,90 |
/* |
* Copyright (c) 2006 Ondrej Palkovsky |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libcmips32 |
* @{ |
*/ |
/** @file |
* @ingroup libcmips32eb |
*/ |
#ifndef LIBC_mips32_FIBRIL_H_ |
#define LIBC_mips32_FIBRIL_H_ |
#include <sys/types.h> |
/* We define our own context_set, because we need to set |
* the TLS pointer to the tcb+0x7000 |
* |
* See tls_set in thread.h |
*/ |
#define context_set(c, _pc, stack, size, ptls) \ |
(c)->pc = (sysarg_t) (_pc); \ |
(c)->sp = ((sysarg_t) (stack)) + (size) - SP_DELTA; \ |
(c)->tls = ((sysarg_t)(ptls)) + 0x7000 + sizeof(tcb_t); |
/* +16 is just for sure that the called function |
* have space to store it's arguments |
*/ |
#define SP_DELTA (8+16) |
typedef struct { |
uint32_t sp; |
uint32_t pc; |
uint32_t s0; |
uint32_t s1; |
uint32_t s2; |
uint32_t s3; |
uint32_t s4; |
uint32_t s5; |
uint32_t s6; |
uint32_t s7; |
uint32_t s8; |
uint32_t gp; |
uint32_t tls; /* Thread local storage(=k1) */ |
uint32_t f20; |
uint32_t f21; |
uint32_t f22; |
uint32_t f23; |
uint32_t f24; |
uint32_t f25; |
uint32_t f26; |
uint32_t f27; |
uint32_t f28; |
uint32_t f29; |
uint32_t f30; |
} context_t; |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/arch/mips32/include/faddr.h |
---|
0,0 → 1,45 |
/* |
* Copyright (c) 2005 Ondrej Palkovsky |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libcmips32 |
* @{ |
*/ |
/** @file |
*/ |
#ifndef LIBC_mips32_FADDR_H_ |
#define LIBC_mips32_FADDR_H_ |
#include <libarch/types.h> |
#define FADDR(fptr) ((uintptr_t) (fptr)) |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/arch/mips32/include/limits.h |
---|
0,0 → 1,47 |
/* |
* Copyright (c) 2006 Josef Cejka |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libcmips32 |
* @{ |
*/ |
/** @file |
* @ingroup libcmips32eb |
*/ |
#ifndef LIBC_mips32__LIMITS_H_ |
#define LIBC_mips32__LIMITS_H_ |
# define LONG_MIN MIN_INT32 |
# define LONG_MAX MAX_INT32 |
# define ULONG_MIN MIN_UINT32 |
# define ULONG_MAX MAX_UINT32 |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/arch/mips32/Makefile.inc |
---|
0,0 → 1,44 |
# |
# Copyright (c) 2005 Martin Decky |
# All rights reserved. |
# |
# Redistribution and use in source and binary forms, with or without |
# modification, are permitted provided that the following conditions |
# are met: |
# |
# - Redistributions of source code must retain the above copyright |
# notice, this list of conditions and the following disclaimer. |
# - 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. |
# - The name of the author may not be used to endorse or promote products |
# derived from this software without specific prior written permission. |
# |
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
# |
## Toolchain configuration |
# |
TARGET = mipsel-linux-gnu |
TOOLCHAIN_DIR = $(CROSS_PREFIX)/mipsel/bin |
ARCH_SOURCES += arch/$(UARCH)/src/syscall.c \ |
arch/$(UARCH)/src/fibril.S \ |
arch/$(UARCH)/src/tls.c |
CFLAGS += -mips3 |
ENDIANESS = LE |
BFD_ARCH = mips |
BFD_NAME = elf32-tradlittlemips |
//branches/snapshot/uspace/lib/libc/arch/mips32/_link.ld.in |
---|
0,0 → 1,57 |
STARTUP(LIBC_PREFIX/arch/UARCH/src/entry.o) |
ENTRY(__entry) |
PHDRS { |
text PT_LOAD FLAGS(5); |
data PT_LOAD FLAGS(6); |
} |
SECTIONS { |
. = 0x4000 + SIZEOF_HEADERS; |
.init : { |
*(.init); |
} :text |
.text : { |
*(.text); |
*(.rodata*); |
} :text |
. = . + 0x4000; |
.data : { |
*(.data); |
*(.data.rel*); |
} :data |
.got : { |
_gp = .; |
*(.got); |
} :data |
.tdata : { |
_tdata_start = .; |
*(.tdata); |
_tdata_end = .; |
_tbss_start = .; |
*(.tbss); |
_tbss_end = .; |
} :data |
_tls_alignment = ALIGNOF(.tdata); |
.sbss : { |
*(.scommon); |
*(.sbss); |
} |
.bss : { |
*(.bss); |
*(COMMON); |
} :data |
. = ALIGN(0x4000); |
_heap = .; |
/DISCARD/ : { |
*(*); |
} |
} |
//branches/snapshot/uspace/lib/libc/arch/mips32/src/entry.s |
---|
0,0 → 1,65 |
# |
# Copyright (c) 2005 Martin Decky |
# All rights reserved. |
# |
# Redistribution and use in source and binary forms, with or without |
# modification, are permitted provided that the following conditions |
# are met: |
# |
# - Redistributions of source code must retain the above copyright |
# notice, this list of conditions and the following disclaimer. |
# - 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. |
# - The name of the author may not be used to endorse or promote products |
# derived from this software without specific prior written permission. |
# |
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
# |
.text |
.section .init, "ax" |
.global __entry |
.global __entry_driver |
.set noreorder |
.option pic2 |
## User-space task entry point |
# |
# $a0 ($4) contains the PCB pointer |
# |
.ent __entry |
__entry: |
.frame $sp, 32, $31 |
.cpload $25 |
# Mips o32 may store its arguments on stack, make space (16 bytes), |
# so that it could work with -O0 |
# Make space additional 16 bytes for the stack frame |
addiu $sp, -32 |
.cprestore 16 # Allow PIC code |
# Pass pcb_ptr to __main() as the first argument. pcb_ptr is already |
# in $a0. As the first argument is passed in $a0, no operation |
# is needed. |
jal __main |
nop |
jal __exit |
nop |
.end |
# Alignment of output section data to 0x4000 |
.section .data |
.align 14 |
//branches/snapshot/uspace/lib/libc/arch/mips32/src/fibril.S |
---|
0,0 → 1,55 |
# |
# Copyright (c) 2003-2004 Jakub Jermar |
# All rights reserved. |
# |
# Redistribution and use in source and binary forms, with or without |
# modification, are permitted provided that the following conditions |
# are met: |
# |
# - Redistributions of source code must retain the above copyright |
# notice, this list of conditions and the following disclaimer. |
# - 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. |
# - The name of the author may not be used to endorse or promote products |
# derived from this software without specific prior written permission. |
# |
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
# |
.text |
.set noat |
.set noreorder |
#include <arch/context_offset.h> |
.global context_save |
.global context_restore |
context_save: |
CONTEXT_SAVE_ARCH_CORE $a0 |
# context_save returns 1 |
j $ra |
li $v0, 1 |
context_restore: |
CONTEXT_RESTORE_ARCH_CORE $a0 |
# Just for the jump into first function, but one instruction |
# should not bother us |
move $t9, $ra |
# context_restore returns 0 |
j $ra |
xor $v0, $v0 |
//branches/snapshot/uspace/lib/libc/arch/mips32/src/syscall.c |
---|
0,0 → 1,68 |
/* |
* Copyright (c) 2005 Martin Decky |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libcmips32 |
* @{ |
*/ |
/** @file |
* @ingroup libcmips32eb |
*/ |
#include <libc.h> |
sysarg_t __syscall(const sysarg_t p1, const sysarg_t p2, const sysarg_t p3, |
const sysarg_t p4, const sysarg_t p5, const sysarg_t p6, const syscall_t id) |
{ |
register sysarg_t __mips_reg_a0 asm("$4") = p1; |
register sysarg_t __mips_reg_a1 asm("$5") = p2; |
register sysarg_t __mips_reg_a2 asm("$6") = p3; |
register sysarg_t __mips_reg_a3 asm("$7") = p4; |
register sysarg_t __mips_reg_t0 asm("$8") = p5; |
register sysarg_t __mips_reg_t1 asm("$9") = p6; |
register sysarg_t __mips_reg_v0 asm("$2") = id; |
asm volatile ( |
"syscall\n" |
: "=r" (__mips_reg_v0) |
: "r" (__mips_reg_a0), |
"r" (__mips_reg_a1), |
"r" (__mips_reg_a2), |
"r" (__mips_reg_a3), |
"r" (__mips_reg_t0), |
"r" (__mips_reg_t1), |
"r" (__mips_reg_v0) |
: "%ra" /* We are a function call, although C does not |
* know it */ |
); |
return __mips_reg_v0; |
} |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/arch/mips32/src/tls.c |
---|
0,0 → 1,50 |
/* |
* Copyright (c) 2006 Ondrej Palkovsky |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libcmips32 |
* @{ |
*/ |
/** @file |
* @ingroup libcmips32eb |
*/ |
#include <tls.h> |
#include <sys/types.h> |
tcb_t * __alloc_tls(void **data, size_t size) |
{ |
return tls_alloc_variant_1(data, size); |
} |
void __free_tls_arch(tcb_t *tcb, size_t size) |
{ |
tls_free_variant_1(tcb, size); |
} |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/arch/mips32/src/thread_entry.s |
---|
0,0 → 1,59 |
# |
# Copyright (c) 2006 Jakub Jermar |
# All rights reserved. |
# |
# Redistribution and use in source and binary forms, with or without |
# modification, are permitted provided that the following conditions |
# are met: |
# |
# - Redistributions of source code must retain the above copyright |
# notice, this list of conditions and the following disclaimer. |
# - 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. |
# - The name of the author may not be used to endorse or promote products |
# derived from this software without specific prior written permission. |
# |
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
# |
.text |
.set noat |
.set noreorder |
.option pic2 |
.globl __thread_entry |
## User-space thread entry point for all but the first threads. |
# |
# |
.ent __thread_entry |
__thread_entry: |
.frame $sp, 32, $31 |
.cpload $25 |
# |
# v0 contains address of uarg. |
# |
add $4, $2, 0 |
# Mips o32 may store its arguments on stack, make space |
addiu $sp, -32 |
.cprestore 16 |
jal __thread_main |
nop |
# |
# Not reached. |
# |
.end __thread_entry |
//branches/snapshot/uspace/lib/libc/arch/ia32/include/types.h |
---|
0,0 → 1,58 |
/* |
* Copyright (c) 2005 Martin Decky |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libcia32 |
* @{ |
*/ |
/** @file |
*/ |
#ifndef LIBC_ia32_TYPES_H_ |
#define LIBC_ia32_TYPES_H_ |
typedef unsigned int sysarg_t; |
typedef char int8_t; |
typedef short int int16_t; |
typedef int int32_t; |
typedef long long int int64_t; |
typedef unsigned char uint8_t; |
typedef unsigned short int uint16_t; |
typedef unsigned int uint32_t; |
typedef unsigned long long int uint64_t; |
typedef int32_t ssize_t; |
typedef uint32_t size_t; |
typedef uint32_t uintptr_t; |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/arch/ia32/include/ddi.h |
---|
0,0 → 1,104 |
/* |
* Copyright (c) 2006 Ondrej Palkovsky |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @file |
* @ingroup libcia32, libcamd64 |
*/ |
#ifndef LIBC_ia32_DDI_H_ |
#define LIBC_ia32_DDI_H_ |
#include <sys/types.h> |
#include <libarch/types.h> |
#define IO_SPACE_BOUNDARY ((void *) (64 * 1024)) |
static inline uint8_t pio_read_8(ioport8_t *port) |
{ |
uint8_t val; |
asm volatile ( |
"inb %w[port], %b[val]\n" |
: [val] "=a" (val) |
: [port] "d" (port) |
); |
return val; |
} |
static inline uint16_t pio_read_16(ioport16_t *port) |
{ |
uint16_t val; |
asm volatile ( |
"inw %w[port], %w[val]\n" |
: [val] "=a" (val) |
: [port] "d" (port) |
); |
return val; |
} |
static inline uint32_t pio_read_32(ioport32_t *port) |
{ |
uint32_t val; |
asm volatile ( |
"inl %w[port], %[val]\n" |
: [val] "=a" (val) |
: [port] "d" (port) |
); |
return val; |
} |
static inline void pio_write_8(ioport8_t *port, uint8_t val) |
{ |
asm volatile ( |
"outb %b[val], %w[port]\n" |
:: [val] "a" (val), [port] "d" (port) |
); |
} |
static inline void pio_write_16(ioport16_t *port, uint16_t val) |
{ |
asm volatile ( |
"outw %w[val], %w[port]\n" |
:: [val] "a" (val), [port] "d" (port) |
); |
} |
static inline void pio_write_32(ioport32_t *port, uint32_t val) |
{ |
asm volatile ( |
"outl %[val], %w[port]\n" |
:: [val] "a" (val), [port] "d" (port) |
); |
} |
#endif |
//branches/snapshot/uspace/lib/libc/arch/ia32/include/syscall.h |
---|
0,0 → 1,61 |
/* |
* Copyright (c) 2005 Martin Decky |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libc |
* @{ |
*/ |
/** |
* @file |
*/ |
#ifndef LIBC_ia32_SYSCALL_H_ |
#define LIBC_ia32_SYSCALL_H_ |
#include <sys/types.h> |
#include <kernel/syscall/syscall.h> |
#define __syscall0 __syscall_sysenter |
#define __syscall1 __syscall_sysenter |
#define __syscall2 __syscall_sysenter |
#define __syscall3 __syscall_sysenter |
#define __syscall4 __syscall_sysenter |
#define __syscall5 __syscall_int |
#define __syscall6 __syscall_int |
extern sysarg_t |
__syscall_sysenter(const sysarg_t, const sysarg_t, const sysarg_t, const sysarg_t, |
const sysarg_t, const sysarg_t, const syscall_t); |
extern sysarg_t |
__syscall_int(const sysarg_t, const sysarg_t, const sysarg_t, const sysarg_t, |
const sysarg_t, const sysarg_t, const syscall_t); |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/arch/ia32/include/config.h |
---|
0,0 → 1,44 |
/* |
* Copyright (c) 2006 Jakub Jermar |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libcia32 |
* @{ |
*/ |
/** @file |
*/ |
#ifndef LIBC_ia32_CONFIG_H_ |
#define LIBC_ia32_CONFIG_H_ |
#define PAGE_WIDTH 12 |
#define PAGE_SIZE (1 << PAGE_WIDTH) |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/arch/ia32/include/atomic.h |
---|
0,0 → 1,78 |
/* |
* Copyright (c) 2001-2004 Jakub Jermar |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libcia32 |
* @{ |
*/ |
/** @file |
*/ |
#ifndef LIBC_ia32_ATOMIC_H_ |
#define LIBC_ia32_ATOMIC_H_ |
static inline void atomic_inc(atomic_t *val) { |
asm volatile ("lock incl %0\n" : "+m" (val->count)); |
} |
static inline void atomic_dec(atomic_t *val) { |
asm volatile ("lock decl %0\n" : "+m" (val->count)); |
} |
static inline long atomic_postinc(atomic_t *val) |
{ |
long r; |
asm volatile ( |
"movl $1, %0\n" |
"lock xaddl %0, %1\n" |
: "=r" (r), "+m" (val->count) |
); |
return r; |
} |
static inline long atomic_postdec(atomic_t *val) |
{ |
long r; |
asm volatile ( |
"movl $-1, %0\n" |
"lock xaddl %0, %1\n" |
: "=r" (r), "+m" (val->count) |
); |
return r; |
} |
#define atomic_preinc(val) (atomic_postinc(val) + 1) |
#define atomic_predec(val) (atomic_postdec(val) - 1) |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/arch/ia32/include/tls.h |
---|
0,0 → 1,63 |
/* |
* Copyright (c) 2006 Ondrej Palkovsky |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libcia32 |
* @{ |
*/ |
/** @file |
*/ |
#ifndef LIBC_ia32_TLS_H_ |
#define LIBC_ia32_TLS_H_ |
#define CONFIG_TLS_VARIANT_2 |
#include <libc.h> |
typedef struct { |
void *self; |
void *fibril_data; |
} tcb_t; |
static inline void __tcb_set(tcb_t *tcb) |
{ |
__SYSCALL1(SYS_TLS_SET, (sysarg_t) tcb); |
} |
static inline tcb_t * __tcb_get(void) |
{ |
void *retval; |
asm ("movl %%gs:0, %0" : "=r"(retval)); |
return retval; |
} |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/arch/ia32/include/thread.h |
---|
0,0 → 1,41 |
/* |
* Copyright (c) 2006 Ondrej Palkovsky |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libcia32 |
* @{ |
*/ |
/** @file |
*/ |
#ifndef LIBC_ia32_THREAD_H_ |
#define LIBC_ia32_THREAD_H_ |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/arch/ia32/include/stackarg.h |
---|
0,0 → 1,66 |
/* |
* Copyright (c) 2005 Jakub Jermar |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libcia32 |
* @{ |
*/ |
/** @file |
*/ |
/* |
* Variable argument list manipulation macros |
* for architectures using stack to pass arguments. |
*/ |
#ifndef LIBC_ia32_STACKARG_H_ |
#define LIBC_ia32_STACKARG_H_ |
#include <sys/types.h> |
/* dont allow to define it second time in stdarg.h */ |
#define __VARARGS_DEFINED |
typedef struct va_list { |
int pos; |
uint8_t *last; |
} va_list; |
#define va_start(ap, lst) \ |
(ap).pos = sizeof(lst); \ |
(ap).last = (uint8_t *) &(lst) |
#define va_arg(ap, type) \ |
(*((type *)((ap).last + ((ap).pos += sizeof(type) ) - sizeof(type)))) |
#define va_end(ap) |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/arch/ia32/include/fibril.h |
---|
0,0 → 1,64 |
/* |
* Copyright (c) 2006 Ondrej Palkovsky |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libcia32 |
* @{ |
*/ |
/** @file |
*/ |
#ifndef LIBC_ia32_FIBRIL_H_ |
#define LIBC_ia32_FIBRIL_H_ |
#include <sys/types.h> |
/* According to ABI the stack MUST be aligned on |
* 16-byte boundary. If it is not, the va_arg calling will |
* panic sooner or later |
*/ |
#define SP_DELTA (12) |
/* We include only registers that must be preserved |
* during function call |
*/ |
typedef struct { |
uint32_t sp; |
uint32_t pc; |
uint32_t ebx; |
uint32_t esi; |
uint32_t edi; |
uint32_t ebp; |
uint32_t tls; |
} context_t; |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/arch/ia32/include/faddr.h |
---|
0,0 → 1,45 |
/* |
* Copyright (c) 2005 Ondrej Palkovsky |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libcia32 |
* @{ |
*/ |
/** @file |
*/ |
#ifndef LIBC_ia32_FADDR_H_ |
#define LIBC_ia32_FADDR_H_ |
#include <libarch/types.h> |
#define FADDR(fptr) ((uintptr_t) (fptr)) |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/arch/ia32/include/limits.h |
---|
0,0 → 1,46 |
/* |
* Copyright (c) 2006 Josef Cejka |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libcia32 |
* @{ |
*/ |
/** @file |
*/ |
#ifndef LIBC_ia32__LIMITS_H_ |
#define LIBC_ia32__LIMITS_H_ |
# define LONG_MIN MIN_INT32 |
# define LONG_MAX MAX_INT32 |
# define ULONG_MIN MIN_UINT32 |
# define ULONG_MAX MAX_UINT32 |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/arch/ia32/Makefile.inc |
---|
0,0 → 1,45 |
# |
# Copyright (c) 2005 Martin Decky |
# All rights reserved. |
# |
# Redistribution and use in source and binary forms, with or without |
# modification, are permitted provided that the following conditions |
# are met: |
# |
# - Redistributions of source code must retain the above copyright |
# notice, this list of conditions and the following disclaimer. |
# - 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. |
# - The name of the author may not be used to endorse or promote products |
# derived from this software without specific prior written permission. |
# |
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
# |
## Toolchain configuration |
# |
TARGET = i686-pc-linux-gnu |
TOOLCHAIN_DIR = $(CROSS_PREFIX)/i686/bin |
ARCH_SOURCES += arch/$(UARCH)/src/syscall.S \ |
arch/$(UARCH)/src/fibril.S \ |
arch/$(UARCH)/src/tls.c \ |
arch/$(UARCH)/src/setjmp.S |
LFLAGS += -N |
ENDIANESS = LE |
BFD_NAME = elf32-i386 |
BFD_ARCH = i386 |
//branches/snapshot/uspace/lib/libc/arch/ia32/_link.ld.in |
---|
0,0 → 1,46 |
STARTUP(LIBC_PREFIX/arch/UARCH/src/entry.o) |
ENTRY(__entry) |
PHDRS { |
text PT_LOAD FLAGS(5); |
data PT_LOAD FLAGS(6); |
} |
SECTIONS { |
. = 0x1000 + SIZEOF_HEADERS; |
.init : { |
*(.init); |
} :text |
.text : { |
*(.text); |
*(.rodata*); |
} :text |
. = . + 0x1000; |
.data : { |
*(.data); |
} :data |
.tdata : { |
_tdata_start = .; |
*(.tdata); |
_tdata_end = .; |
_tbss_start = .; |
*(.tbss); |
_tbss_end = .; |
} :data |
_tls_alignment = ALIGNOF(.tdata); |
.bss : { |
*(COMMON); |
*(.bss); |
} :data |
. = ALIGN(0x1000); |
_heap = .; |
/DISCARD/ : { |
*(*); |
} |
} |
//branches/snapshot/uspace/lib/libc/arch/ia32/src/syscall.S |
---|
0,0 → 1,90 |
# |
# Copyright (c) 2007 Jakub Jermar |
# All rights reserved. |
# |
# Redistribution and use in source and binary forms, with or without |
# modification, are permitted provided that the following conditions |
# are met: |
# |
# - Redistributions of source code must retain the above copyright |
# notice, this list of conditions and the following disclaimer. |
# - 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. |
# - The name of the author may not be used to endorse or promote products |
# derived from this software without specific prior written permission. |
# |
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
# |
.text |
/** Syscall wrapper - INT $0x30 version. |
* |
* Mind the order of arguments. First two arguments and the syscall number go to |
* scratch registers. An optimized version of this wrapper for fewer arguments |
* could benefit from this and not save unused registers on the stack. |
*/ |
.global __syscall_int |
__syscall_int: |
pushl %ebx |
pushl %esi |
pushl %edi |
pushl %ebp |
movl 20(%esp), %edx # First argument. |
movl 24(%esp), %ecx # Second argument. |
movl 28(%esp), %ebx # Third argument. |
movl 32(%esp), %esi # Fourth argument. |
movl 36(%esp), %edi # Fifth argument. |
movl 40(%esp), %ebp # Sixth argument. |
movl 44(%esp), %eax # Syscall number. |
int $0x30 |
popl %ebp |
popl %edi |
popl %esi |
popl %ebx |
ret |
/** Syscall wrapper - SYSENTER version. |
* |
* This is an optimized version of syscall for four or less arguments. Note |
* that EBP and EDI are used to remember user stack address and the return |
* address. The kernel part doesn't save DS, ES and FS so the handler restores |
* these to the selector immediately following CS (it must be the flat data |
* segment, otherwise the SYSENTER wouldn't work in the first place). |
*/ |
.global __syscall_sysenter |
__syscall_sysenter: |
pushl %ebx |
pushl %esi |
pushl %edi |
pushl %ebp |
mov %esp, %ebp |
lea ra, %edi |
movl 20(%esp), %edx # First argument. |
movl 24(%esp), %ecx # Second argument. |
movl 28(%esp), %ebx # Third argument. |
movl 32(%esp), %esi # Fourth argument. |
movl 44(%esp), %eax # Syscall number. |
sysenter |
ra: |
movw %cs, %cx |
addw $8, %cx |
movw %cx, %ds |
movw %cx, %es |
movw %cx, %fs |
popl %ebp |
popl %edi |
popl %esi |
popl %ebx |
ret |
//branches/snapshot/uspace/lib/libc/arch/ia32/src/entry.s |
---|
0,0 → 1,50 |
# |
# Copyright (c) 2005 Martin Decky |
# All rights reserved. |
# |
# Redistribution and use in source and binary forms, with or without |
# modification, are permitted provided that the following conditions |
# are met: |
# |
# - Redistributions of source code must retain the above copyright |
# notice, this list of conditions and the following disclaimer. |
# - 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. |
# - The name of the author may not be used to endorse or promote products |
# derived from this software without specific prior written permission. |
# |
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
# |
.section .init, "ax" |
.org 0 |
.globl __entry |
## User-space task entry point |
# |
# %ebx contains the PCB pointer |
# |
__entry: |
mov %ss, %ax |
mov %ax, %ds |
mov %ax, %es |
mov %ax, %fs |
# Do not set %gs, it contains descriptor that can see TLS |
# Pass the PCB pointer to __main as the first argument |
pushl %ebx |
call __main |
call __exit |
//branches/snapshot/uspace/lib/libc/arch/ia32/src/setjmp.S |
---|
0,0 → 1,57 |
# |
# Copyright (c) 2008 Josef Cejka |
# All rights reserved. |
# |
# Redistribution and use in source and binary forms, with or without |
# modification, are permitted provided that the following conditions |
# are met: |
# |
# - Redistributions of source code must retain the above copyright |
# notice, this list of conditions and the following disclaimer. |
# - 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. |
# - The name of the author may not be used to endorse or promote products |
# derived from this software without specific prior written permission. |
# |
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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 <kernel/arch/context_offset.h> |
.text |
.global setjmp |
.global longjmp |
.type setjmp,@function |
setjmp: |
movl 0(%esp),%eax # save pc value into eax |
movl 4(%esp),%edx # address of the jmp_buf structure to save context to |
# save registers to the jmp_buf structure |
CONTEXT_SAVE_ARCH_CORE %edx %eax |
xorl %eax,%eax # set_jmp returns 0 |
ret |
.type longjmp,@function |
longjmp: |
movl 4(%esp), %ecx # put address of jmp_buf into ecx |
movl 8(%esp), %eax # put return value into eax |
# restore registers from the jmp_buf structure |
CONTEXT_RESTORE_ARCH_CORE %ecx %edx |
movl %edx,0(%esp) # put saved pc on stack |
ret |
//branches/snapshot/uspace/lib/libc/arch/ia32/src/fibril.S |
---|
0,0 → 1,79 |
# |
# Copyright (c) 2001-2004 Jakub Jermar |
# All rights reserved. |
# |
# Redistribution and use in source and binary forms, with or without |
# modification, are permitted provided that the following conditions |
# are met: |
# |
# - Redistributions of source code must retain the above copyright |
# notice, this list of conditions and the following disclaimer. |
# - 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. |
# - The name of the author may not be used to endorse or promote products |
# derived from this software without specific prior written permission. |
# |
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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 <kernel/arch/context_offset.h> |
.text |
.global context_save |
.global context_restore |
## Save current CPU context |
# |
# Save CPU context to the context_t variable |
# pointed by the 1st argument. Returns 1 in EAX. |
# |
context_save: |
movl 0(%esp),%eax # the caller's return %eip |
movl 4(%esp),%edx # address of the context variable to save context to |
# save registers to the context structure |
CONTEXT_SAVE_ARCH_CORE %edx %eax |
# Save TLS |
movl %gs:0, %eax |
movl %eax, OFFSET_TLS(%edx) # tls -> ctx->tls |
xorl %eax,%eax # context_save returns 1 |
incl %eax |
ret |
## Restore saved CPU context |
# |
# Restore CPU context from context_t variable |
# pointed by the 1st argument. Returns 0 in EAX. |
# |
context_restore: |
movl 4(%esp),%eax # address of the context variable to restore context from |
# restore registers from the context structure |
CONTEXT_RESTORE_ARCH_CORE %eax %edx |
movl %edx,0(%esp) # ctx->pc -> saver's return %eip |
# Set thread local storage |
pushl %edx |
movl OFFSET_TLS(%eax), %edx # Set arg1 to TLS addr |
movl $1, %eax # Syscall SYS_TLS_SET |
int $0x30 |
popl %edx |
xorl %eax,%eax # context_restore returns 0 |
ret |
//branches/snapshot/uspace/lib/libc/arch/ia32/src/tls.c |
---|
0,0 → 1,51 |
/* |
* Copyright (c) 2006 Ondrej Palkovsky |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libcamd64 amd64 |
* @ingroup lc |
* @{ |
*/ |
/** @file |
* @ingroup libcia32 |
*/ |
#include <tls.h> |
#include <sys/types.h> |
tcb_t * __alloc_tls(void **data, size_t size) |
{ |
return tls_alloc_variant_2(data, size); |
} |
void __free_tls_arch(tcb_t *tcb, size_t size) |
{ |
tls_free_variant_2(tcb, size); |
} |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libc/arch/ia32/src/thread_entry.s |
---|
0,0 → 1,53 |
# |
# Copyright (c) 2006 Jakub Jermar |
# All rights reserved. |
# |
# Redistribution and use in source and binary forms, with or without |
# modification, are permitted provided that the following conditions |
# are met: |
# |
# - Redistributions of source code must retain the above copyright |
# notice, this list of conditions and the following disclaimer. |
# - 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. |
# - The name of the author may not be used to endorse or promote products |
# derived from this software without specific prior written permission. |
# |
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
# |
.text |
.globl __thread_entry |
## User-space thread entry point for all but the first threads. |
# |
# |
__thread_entry: |
mov %ss, %dx |
mov %dx, %ds |
mov %dx, %es |
mov %dx, %fs |
# Do not set %gs, it contains descriptor that can see TLS |
# |
# EAX contains address of uarg. |
# |
pushl %eax |
call __thread_main |
# |
# Not reached. |
# |
.end __thread_entry |
//branches/snapshot/uspace/lib/libc/Makefile.toolchain |
---|
0,0 → 1,94 |
# |
# Copyright (C) 2005 Martin Decky |
# All rights reserved. |
# |
# Redistribution and use in source and binary forms, with or without |
# modification, are permitted provided that the following conditions |
# are met: |
# |
# - Redistributions of source code must retain the above copyright |
# notice, this list of conditions and the following disclaimer. |
# - 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. |
# - The name of the author may not be used to endorse or promote products |
# derived from this software without specific prior written permission. |
# |
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
# |
CFLAGS = -I$(LIBC_PREFIX)/include -O3 -imacros $(LIBC_PREFIX)/../../../config.h \ |
-fexec-charset=UTF-8 -fwide-exec-charset=UTF-32$(ENDIANESS) \ |
-finput-charset=UTF-8 -fno-builtin -Wall -Wextra -Wno-unused-parameter \ |
-Wmissing-prototypes -Werror-implicit-function-declaration -nostdlib \ |
-nostdinc -pipe -g -D__$(ENDIANESS)__ |
LFLAGS = -M -N $(SOFTINT_PREFIX)/libsoftint.a |
AFLAGS = |
## Cross-toolchain prefix |
# |
ifndef CROSS_PREFIX |
CROSS_PREFIX = /usr/local |
endif |
## Setup platform configuration |
# |
-include $(LIBC_PREFIX)/../../../Makefile.config |
-include $(LIBC_PREFIX)/../../../config.defs |
-include $(LIBC_PREFIX)/arch/$(UARCH)/Makefile.inc |
## Simple detection of the host system |
# |
HOST = $(shell uname) |
## On Solaris, some utilities have different names |
# |
ifeq ($(HOST),SunOS) |
BINUTILS_PREFIX = "g" |
else |
BINUTILS_PREFIX = "" |
endif |
## Toolchain configuration |
# |
ifeq ($(COMPILER),gcc_native) |
CC = gcc |
AS = $(BINUTILS_PREFIX)as |
LD = $(BINUTILS_PREFIX)ld |
AR = $(BINUTILS_PREFIX)ar |
OBJCOPY = $(BINUTILS_PREFIX)objcopy |
OBJDUMP = $(BINUTILS_PREFIX)objdump |
DEPEND_DEFS = $(DEFS) $(CONFIG_DEFS) |
endif |
ifeq ($(COMPILER),icc_native) |
CC = icc |
AS = as |
LD = ld |
AR = ar |
OBJCOPY = objcopy |
OBJDUMP = objdump |
DEPEND_DEFS = $(DEFS) $(CONFIG_DEFS) |
endif |
ifeq ($(COMPILER),gcc_cross) |
CC = $(TOOLCHAIN_DIR)/$(TARGET)-gcc |
AS = $(TOOLCHAIN_DIR)/$(TARGET)-as |
LD = $(TOOLCHAIN_DIR)/$(TARGET)-ld |
AR = $(TOOLCHAIN_DIR)/$(TARGET)-ar |
OBJCOPY = $(TOOLCHAIN_DIR)/$(TARGET)-objcopy |
OBJDUMP = $(TOOLCHAIN_DIR)/$(TARGET)-objdump |
DEPEND_DEFS = $(DEFS) $(CONFIG_DEFS) |
endif |
//branches/snapshot/uspace/lib/libfs/libfs.c |
---|
0,0 → 1,497 |
/* |
* Copyright (c) 2009 Jakub Jermar |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libfs |
* @{ |
*/ |
/** |
* @file |
* Glue code which is commonod to all FS implementations. |
*/ |
#include "libfs.h" |
#include "../../srv/vfs/vfs.h" |
#include <errno.h> |
#include <async.h> |
#include <ipc/ipc.h> |
#include <as.h> |
#include <assert.h> |
#include <dirent.h> |
#include <mem.h> |
#include <sys/stat.h> |
/** Register file system server. |
* |
* This function abstracts away the tedious registration protocol from |
* file system implementations and lets them to reuse this registration glue |
* code. |
* |
* @param vfs_phone Open phone for communication with VFS. |
* @param reg File system registration structure. It will be |
* initialized by this function. |
* @param info VFS info structure supplied by the file system |
* implementation. |
* @param conn Connection fibril for handling all calls originating in |
* VFS. |
* |
* @return EOK on success or a non-zero error code on errror. |
*/ |
int fs_register(int vfs_phone, fs_reg_t *reg, vfs_info_t *info, |
async_client_conn_t conn) |
{ |
/* |
* Tell VFS that we are here and want to get registered. |
* We use the async framework because VFS will answer the request |
* out-of-order, when it knows that the operation succeeded or failed. |
*/ |
ipc_call_t answer; |
aid_t req = async_send_0(vfs_phone, VFS_IN_REGISTER, &answer); |
/* |
* Send our VFS info structure to VFS. |
*/ |
int rc = ipc_data_write_start(vfs_phone, info, sizeof(*info)); |
if (rc != EOK) { |
async_wait_for(req, NULL); |
return rc; |
} |
/* |
* Ask VFS for callback connection. |
*/ |
ipc_connect_to_me(vfs_phone, 0, 0, 0, ®->vfs_phonehash); |
/* |
* Allocate piece of address space for PLB. |
*/ |
reg->plb_ro = as_get_mappable_page(PLB_SIZE); |
if (!reg->plb_ro) { |
async_wait_for(req, NULL); |
return ENOMEM; |
} |
/* |
* Request sharing the Path Lookup Buffer with VFS. |
*/ |
rc = ipc_share_in_start_0_0(vfs_phone, reg->plb_ro, PLB_SIZE); |
if (rc) { |
async_wait_for(req, NULL); |
return rc; |
} |
/* |
* Pick up the answer for the request to the VFS_IN_REQUEST call. |
*/ |
async_wait_for(req, NULL); |
reg->fs_handle = (int) IPC_GET_ARG1(answer); |
/* |
* Create a connection fibril to handle the callback connection. |
*/ |
async_new_connection(reg->vfs_phonehash, 0, NULL, conn); |
/* |
* Tell the async framework that other connections are to be handled by |
* the same connection fibril as well. |
*/ |
async_set_client_connection(conn); |
return IPC_GET_RETVAL(answer); |
} |
void fs_node_initialize(fs_node_t *fn) |
{ |
memset(fn, 0, sizeof(fs_node_t)); |
} |
void libfs_mount(libfs_ops_t *ops, fs_handle_t fs_handle, ipc_callid_t rid, |
ipc_call_t *request) |
{ |
dev_handle_t mp_dev_handle = (dev_handle_t) IPC_GET_ARG1(*request); |
fs_index_t mp_fs_index = (fs_index_t) IPC_GET_ARG2(*request); |
fs_handle_t mr_fs_handle = (fs_handle_t) IPC_GET_ARG3(*request); |
dev_handle_t mr_dev_handle = (dev_handle_t) IPC_GET_ARG4(*request); |
int res; |
ipcarg_t rc; |
ipc_call_t call; |
ipc_callid_t callid; |
/* accept the phone */ |
callid = async_get_call(&call); |
int mountee_phone = (int)IPC_GET_ARG1(call); |
if ((IPC_GET_METHOD(call) != IPC_M_CONNECTION_CLONE) || |
mountee_phone < 0) { |
ipc_answer_0(callid, EINVAL); |
ipc_answer_0(rid, EINVAL); |
return; |
} |
ipc_answer_0(callid, EOK); /* acknowledge the mountee_phone */ |
res = ipc_data_write_receive(&callid, NULL); |
if (!res) { |
ipc_hangup(mountee_phone); |
ipc_answer_0(callid, EINVAL); |
ipc_answer_0(rid, EINVAL); |
return; |
} |
fs_node_t *fn = ops->node_get(mp_dev_handle, mp_fs_index); |
if (!fn) { |
ipc_hangup(mountee_phone); |
ipc_answer_0(callid, ENOENT); |
ipc_answer_0(rid, ENOENT); |
return; |
} |
if (fn->mp_data.mp_active) { |
ipc_hangup(mountee_phone); |
ops->node_put(fn); |
ipc_answer_0(callid, EBUSY); |
ipc_answer_0(rid, EBUSY); |
return; |
} |
rc = async_req_0_0(mountee_phone, IPC_M_CONNECT_ME); |
if (rc != 0) { |
ipc_hangup(mountee_phone); |
ops->node_put(fn); |
ipc_answer_0(callid, rc); |
ipc_answer_0(rid, rc); |
return; |
} |
ipc_call_t answer; |
aid_t msg = async_send_1(mountee_phone, VFS_OUT_MOUNTED, mr_dev_handle, |
&answer); |
ipc_forward_fast(callid, mountee_phone, 0, 0, 0, IPC_FF_ROUTE_FROM_ME); |
async_wait_for(msg, &rc); |
if (rc == EOK) { |
fn->mp_data.mp_active = true; |
fn->mp_data.fs_handle = mr_fs_handle; |
fn->mp_data.dev_handle = mr_dev_handle; |
fn->mp_data.phone = mountee_phone; |
} |
/* |
* Do not release the FS node so that it stays in memory. |
*/ |
ipc_answer_3(rid, rc, IPC_GET_ARG1(answer), IPC_GET_ARG2(answer), |
IPC_GET_ARG3(answer)); |
} |
/** Lookup VFS triplet by name in the file system name space. |
* |
* The path passed in the PLB must be in the canonical file system path format |
* as returned by the canonify() function. |
* |
* @param ops libfs operations structure with function pointers to |
* file system implementation |
* @param fs_handle File system handle of the file system where to perform |
* the lookup. |
* @param rid Request ID of the VFS_OUT_LOOKUP request. |
* @param request VFS_OUT_LOOKUP request data itself. |
* |
*/ |
void libfs_lookup(libfs_ops_t *ops, fs_handle_t fs_handle, ipc_callid_t rid, |
ipc_call_t *request) |
{ |
unsigned first = IPC_GET_ARG1(*request); |
unsigned last = IPC_GET_ARG2(*request); |
unsigned next = first; |
dev_handle_t dev_handle = IPC_GET_ARG3(*request); |
int lflag = IPC_GET_ARG4(*request); |
fs_index_t index = IPC_GET_ARG5(*request); /* when L_LINK specified */ |
char component[NAME_MAX + 1]; |
int len; |
if (last < next) |
last += PLB_SIZE; |
fs_node_t *par = NULL; |
fs_node_t *cur = ops->root_get(dev_handle); |
fs_node_t *tmp = NULL; |
if (cur->mp_data.mp_active) { |
ipc_forward_slow(rid, cur->mp_data.phone, VFS_OUT_LOOKUP, |
next, last, cur->mp_data.dev_handle, lflag, index, |
IPC_FF_ROUTE_FROM_ME); |
ops->node_put(cur); |
return; |
} |
if (ops->plb_get_char(next) == '/') |
next++; /* eat slash */ |
while (next <= last && ops->has_children(cur)) { |
/* collect the component */ |
len = 0; |
while ((next <= last) && (ops->plb_get_char(next) != '/')) { |
if (len + 1 == NAME_MAX) { |
/* component length overflow */ |
ipc_answer_0(rid, ENAMETOOLONG); |
goto out; |
} |
component[len++] = ops->plb_get_char(next); |
next++; /* process next character */ |
} |
assert(len); |
component[len] = '\0'; |
next++; /* eat slash */ |
/* match the component */ |
tmp = ops->match(cur, component); |
if (tmp && tmp->mp_data.mp_active) { |
if (next > last) |
next = last = first; |
else |
next--; |
ipc_forward_slow(rid, tmp->mp_data.phone, |
VFS_OUT_LOOKUP, next, last, tmp->mp_data.dev_handle, |
lflag, index, IPC_FF_ROUTE_FROM_ME); |
ops->node_put(cur); |
ops->node_put(tmp); |
if (par) |
ops->node_put(par); |
return; |
} |
/* handle miss: match amongst siblings */ |
if (!tmp) { |
if (next <= last) { |
/* there are unprocessed components */ |
ipc_answer_0(rid, ENOENT); |
goto out; |
} |
/* miss in the last component */ |
if (lflag & (L_CREATE | L_LINK)) { |
/* request to create a new link */ |
if (!ops->is_directory(cur)) { |
ipc_answer_0(rid, ENOTDIR); |
goto out; |
} |
fs_node_t *fn; |
if (lflag & L_CREATE) |
fn = ops->create(dev_handle, lflag); |
else |
fn = ops->node_get(dev_handle, |
index); |
if (fn) { |
int rc; |
rc = ops->link(cur, fn, component); |
if (rc != EOK) { |
if (lflag & L_CREATE) { |
(void)ops->destroy(fn); |
} |
ipc_answer_0(rid, rc); |
} else { |
ipc_answer_5(rid, EOK, |
fs_handle, dev_handle, |
ops->index_get(fn), |
ops->size_get(fn), |
ops->lnkcnt_get(fn)); |
ops->node_put(fn); |
} |
} else { |
ipc_answer_0(rid, ENOSPC); |
} |
goto out; |
} |
ipc_answer_0(rid, ENOENT); |
goto out; |
} |
if (par) |
ops->node_put(par); |
/* descend one level */ |
par = cur; |
cur = tmp; |
tmp = NULL; |
} |
/* handle miss: excessive components */ |
if (next <= last && !ops->has_children(cur)) { |
if (lflag & (L_CREATE | L_LINK)) { |
if (!ops->is_directory(cur)) { |
ipc_answer_0(rid, ENOTDIR); |
goto out; |
} |
/* collect next component */ |
len = 0; |
while (next <= last) { |
if (ops->plb_get_char(next) == '/') { |
/* more than one component */ |
ipc_answer_0(rid, ENOENT); |
goto out; |
} |
if (len + 1 == NAME_MAX) { |
/* component length overflow */ |
ipc_answer_0(rid, ENAMETOOLONG); |
goto out; |
} |
component[len++] = ops->plb_get_char(next); |
next++; /* process next character */ |
} |
assert(len); |
component[len] = '\0'; |
fs_node_t *fn; |
if (lflag & L_CREATE) |
fn = ops->create(dev_handle, lflag); |
else |
fn = ops->node_get(dev_handle, index); |
if (fn) { |
int rc; |
rc = ops->link(cur, fn, component); |
if (rc != EOK) { |
if (lflag & L_CREATE) |
(void)ops->destroy(fn); |
ipc_answer_0(rid, rc); |
} else { |
ipc_answer_5(rid, EOK, |
fs_handle, dev_handle, |
ops->index_get(fn), |
ops->size_get(fn), |
ops->lnkcnt_get(fn)); |
ops->node_put(fn); |
} |
} else { |
ipc_answer_0(rid, ENOSPC); |
} |
goto out; |
} |
ipc_answer_0(rid, ENOENT); |
goto out; |
} |
/* handle hit */ |
if (lflag & L_UNLINK) { |
unsigned old_lnkcnt = ops->lnkcnt_get(cur); |
int res = ops->unlink(par, cur, component); |
ipc_answer_5(rid, (ipcarg_t)res, fs_handle, dev_handle, |
ops->index_get(cur), ops->size_get(cur), old_lnkcnt); |
goto out; |
} |
if (((lflag & (L_CREATE | L_EXCLUSIVE)) == (L_CREATE | L_EXCLUSIVE)) || |
(lflag & L_LINK)) { |
ipc_answer_0(rid, EEXIST); |
goto out; |
} |
if ((lflag & L_FILE) && (ops->is_directory(cur))) { |
ipc_answer_0(rid, EISDIR); |
goto out; |
} |
if ((lflag & L_DIRECTORY) && (ops->is_file(cur))) { |
ipc_answer_0(rid, ENOTDIR); |
goto out; |
} |
ipc_answer_5(rid, EOK, fs_handle, dev_handle, ops->index_get(cur), |
ops->size_get(cur), ops->lnkcnt_get(cur)); |
out: |
if (par) |
ops->node_put(par); |
if (cur) |
ops->node_put(cur); |
if (tmp) |
ops->node_put(tmp); |
} |
void libfs_stat(libfs_ops_t *ops, fs_handle_t fs_handle, ipc_callid_t rid, |
ipc_call_t *request) |
{ |
dev_handle_t dev_handle = (dev_handle_t) IPC_GET_ARG1(*request); |
fs_index_t index = (fs_index_t) IPC_GET_ARG2(*request); |
fs_node_t *fn = ops->node_get(dev_handle, index); |
ipc_callid_t callid; |
size_t size; |
if (!ipc_data_read_receive(&callid, &size) || |
size < sizeof(struct stat)) { |
ipc_answer_0(callid, EINVAL); |
ipc_answer_0(rid, EINVAL); |
return; |
} |
struct stat *stat = malloc(sizeof(struct stat)); |
if (!stat) { |
ipc_answer_0(callid, ENOMEM); |
ipc_answer_0(rid, ENOMEM); |
return; |
} |
memset(stat, 0, sizeof(struct stat)); |
stat->fs_handle = fs_handle; |
stat->dev_handle = dev_handle; |
stat->index = index; |
stat->lnkcnt = ops->lnkcnt_get(fn); |
stat->is_file = ops->is_file(fn); |
stat->size = ops->size_get(fn); |
ipc_data_read_finalize(callid, stat, sizeof(struct stat)); |
ipc_answer_0(rid, EOK); |
free(stat); |
} |
/** Open VFS triplet. |
* |
* @param ops libfs operations structure with function pointers to |
* file system implementation |
* @param rid Request ID of the VFS_OUT_OPEN_NODE request. |
* @param request VFS_OUT_OPEN_NODE request data itself. |
* |
*/ |
void libfs_open_node(libfs_ops_t *ops, fs_handle_t fs_handle, ipc_callid_t rid, |
ipc_call_t *request) |
{ |
dev_handle_t dev_handle = IPC_GET_ARG1(*request); |
fs_index_t index = IPC_GET_ARG2(*request); |
fs_node_t *node = ops->node_get(dev_handle, index); |
if (node == NULL) { |
ipc_answer_0(rid, ENOENT); |
return; |
} |
ipc_answer_5(rid, EOK, fs_handle, dev_handle, index, |
ops->size_get(node), ops->lnkcnt_get(node)); |
ops->node_put(node); |
} |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libfs/libfs.h |
---|
0,0 → 1,94 |
/* |
* Copyright (c) 2009 Jakub Jermar |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libfs |
* @{ |
*/ |
/** |
* @file |
*/ |
#ifndef LIBFS_LIBFS_H_ |
#define LIBFS_LIBFS_H_ |
#include <ipc/vfs.h> |
#include <stdint.h> |
#include <ipc/ipc.h> |
#include <async.h> |
#include <devmap.h> |
typedef struct { |
bool mp_active; |
int phone; |
fs_handle_t fs_handle; |
dev_handle_t dev_handle; |
} mp_data_t; |
typedef struct { |
mp_data_t mp_data; /**< Mount point info. */ |
void *data; /**< Data of the file system implementation. */ |
} fs_node_t; |
typedef struct { |
fs_node_t * (* match)(fs_node_t *, const char *); |
fs_node_t * (* node_get)(dev_handle_t, fs_index_t); |
void (* node_put)(fs_node_t *); |
fs_node_t * (* create)(dev_handle_t, int); |
int (* destroy)(fs_node_t *); |
int (* link)(fs_node_t *, fs_node_t *, const char *); |
int (* unlink)(fs_node_t *, fs_node_t *, const char *); |
fs_index_t (* index_get)(fs_node_t *); |
size_t (* size_get)(fs_node_t *); |
unsigned (* lnkcnt_get)(fs_node_t *); |
bool (* has_children)(fs_node_t *); |
fs_node_t *(* root_get)(dev_handle_t); |
char (* plb_get_char)(unsigned pos); |
bool (* is_directory)(fs_node_t *); |
bool (* is_file)(fs_node_t *); |
} libfs_ops_t; |
typedef struct { |
int fs_handle; /**< File system handle. */ |
ipcarg_t vfs_phonehash; /**< Initial VFS phonehash. */ |
uint8_t *plb_ro; /**< Read-only PLB view. */ |
} fs_reg_t; |
extern int fs_register(int, fs_reg_t *, vfs_info_t *, async_client_conn_t); |
extern void fs_node_initialize(fs_node_t *); |
extern void libfs_mount(libfs_ops_t *, fs_handle_t, ipc_callid_t, ipc_call_t *); |
extern void libfs_lookup(libfs_ops_t *, fs_handle_t, ipc_callid_t, ipc_call_t *); |
extern void libfs_stat(libfs_ops_t *, fs_handle_t, ipc_callid_t, ipc_call_t *); |
extern void libfs_open_node(libfs_ops_t *, fs_handle_t, ipc_callid_t, |
ipc_call_t *); |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libfs/Makefile |
---|
0,0 → 1,67 |
# |
# Copyright (c) 2005 Martin Decky |
# Copyright (c) 2007 Jakub Jermar |
# All rights reserved. |
# |
# Redistribution and use in source and binary forms, with or without |
# modification, are permitted provided that the following conditions |
# are met: |
# |
# - Redistributions of source code must retain the above copyright |
# notice, this list of conditions and the following disclaimer. |
# - 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. |
# - The name of the author may not be used to endorse or promote products |
# derived from this software without specific prior written permission. |
# |
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
# |
## Common compiler flags |
# |
LIBC_PREFIX = ../libc |
## Setup toolchain |
# |
include $(LIBC_PREFIX)/Makefile.toolchain |
CFLAGS += -Iinclude |
## Sources |
# |
SOURCES = \ |
libfs.c |
OBJECTS := $(addsuffix .o,$(basename $(SOURCES))) |
.PHONY: all clean depend |
all: libfs.a |
-include Makefile.depend |
clean: |
-rm -f libfs.a Makefile.depend |
find . -name '*.o' -follow -exec rm \{\} \; |
depend: |
-makedepend -f - -- $(DEPEND_DEFS) $(CFLAGS) -- $(SOURCES) > Makefile.depend 2> /dev/null |
libfs.a: depend $(OBJECTS) |
$(AR) rc libfs.a $(OBJECTS) |
%.o: %.c |
$(CC) $(DEFS) $(CFLAGS) -c $< -o $@ |
//branches/snapshot/uspace/lib/libblock/libblock.c |
---|
0,0 → 1,550 |
/* |
* Copyright (c) 2008 Jakub Jermar |
* Copyright (c) 2008 Martin Decky |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libblock |
* @{ |
*/ |
/** |
* @file |
* @brief |
*/ |
#include "libblock.h" |
#include "../../srv/vfs/vfs.h" |
#include <ipc/devmap.h> |
#include <ipc/bd.h> |
#include <ipc/services.h> |
#include <errno.h> |
#include <sys/mman.h> |
#include <async.h> |
#include <ipc/ipc.h> |
#include <as.h> |
#include <assert.h> |
#include <fibril_sync.h> |
#include <adt/list.h> |
#include <adt/hash_table.h> |
#include <mem.h> |
/** Lock protecting the device connection list */ |
static FIBRIL_MUTEX_INITIALIZE(dcl_lock); |
/** Device connection list head. */ |
static LIST_INITIALIZE(dcl_head); |
#define CACHE_BUCKETS_LOG2 10 |
#define CACHE_BUCKETS (1 << CACHE_BUCKETS_LOG2) |
typedef struct { |
fibril_mutex_t lock; |
size_t block_size; /**< Block size. */ |
unsigned block_count; /**< Total number of blocks. */ |
hash_table_t block_hash; |
link_t free_head; |
enum cache_mode mode; |
} cache_t; |
typedef struct { |
link_t link; |
dev_handle_t dev_handle; |
int dev_phone; |
void *com_area; |
size_t com_size; |
void *bb_buf; |
off_t bb_off; |
size_t bb_size; |
cache_t *cache; |
} devcon_t; |
static int read_block(devcon_t *devcon, bn_t boff, size_t block_size); |
static int write_block(devcon_t *devcon, bn_t boff, size_t block_size); |
static devcon_t *devcon_search(dev_handle_t dev_handle) |
{ |
link_t *cur; |
fibril_mutex_lock(&dcl_lock); |
for (cur = dcl_head.next; cur != &dcl_head; cur = cur->next) { |
devcon_t *devcon = list_get_instance(cur, devcon_t, link); |
if (devcon->dev_handle == dev_handle) { |
fibril_mutex_unlock(&dcl_lock); |
return devcon; |
} |
} |
fibril_mutex_unlock(&dcl_lock); |
return NULL; |
} |
static int devcon_add(dev_handle_t dev_handle, int dev_phone, void *com_area, |
size_t com_size) |
{ |
link_t *cur; |
devcon_t *devcon; |
devcon = malloc(sizeof(devcon_t)); |
if (!devcon) |
return ENOMEM; |
link_initialize(&devcon->link); |
devcon->dev_handle = dev_handle; |
devcon->dev_phone = dev_phone; |
devcon->com_area = com_area; |
devcon->com_size = com_size; |
devcon->bb_buf = NULL; |
devcon->bb_off = 0; |
devcon->bb_size = 0; |
devcon->cache = NULL; |
fibril_mutex_lock(&dcl_lock); |
for (cur = dcl_head.next; cur != &dcl_head; cur = cur->next) { |
devcon_t *d = list_get_instance(cur, devcon_t, link); |
if (d->dev_handle == dev_handle) { |
fibril_mutex_unlock(&dcl_lock); |
free(devcon); |
return EEXIST; |
} |
} |
list_append(&devcon->link, &dcl_head); |
fibril_mutex_unlock(&dcl_lock); |
return EOK; |
} |
static void devcon_remove(devcon_t *devcon) |
{ |
fibril_mutex_lock(&dcl_lock); |
list_remove(&devcon->link); |
fibril_mutex_unlock(&dcl_lock); |
} |
int block_init(dev_handle_t dev_handle, size_t com_size) |
{ |
int rc; |
int dev_phone; |
void *com_area; |
com_area = mmap(NULL, com_size, PROTO_READ | PROTO_WRITE, |
MAP_ANONYMOUS | MAP_PRIVATE, 0, 0); |
if (!com_area) { |
return ENOMEM; |
} |
dev_phone = devmap_device_connect(dev_handle, IPC_FLAG_BLOCKING); |
if (dev_phone < 0) { |
munmap(com_area, com_size); |
return dev_phone; |
} |
rc = ipc_share_out_start(dev_phone, com_area, |
AS_AREA_READ | AS_AREA_WRITE); |
if (rc != EOK) { |
munmap(com_area, com_size); |
ipc_hangup(dev_phone); |
return rc; |
} |
rc = devcon_add(dev_handle, dev_phone, com_area, com_size); |
if (rc != EOK) { |
munmap(com_area, com_size); |
ipc_hangup(dev_phone); |
return rc; |
} |
return EOK; |
} |
void block_fini(dev_handle_t dev_handle) |
{ |
devcon_t *devcon = devcon_search(dev_handle); |
assert(devcon); |
devcon_remove(devcon); |
if (devcon->bb_buf) |
free(devcon->bb_buf); |
if (devcon->cache) { |
hash_table_destroy(&devcon->cache->block_hash); |
free(devcon->cache); |
} |
munmap(devcon->com_area, devcon->com_size); |
ipc_hangup(devcon->dev_phone); |
free(devcon); |
} |
int block_bb_read(dev_handle_t dev_handle, off_t off, size_t size) |
{ |
void *bb_buf; |
int rc; |
devcon_t *devcon = devcon_search(dev_handle); |
if (!devcon) |
return ENOENT; |
if (devcon->bb_buf) |
return EEXIST; |
bb_buf = malloc(size); |
if (!bb_buf) |
return ENOMEM; |
rc = read_block(devcon, 0, size); |
if (rc != EOK) { |
free(bb_buf); |
return rc; |
} |
memcpy(bb_buf, devcon->com_area, size); |
devcon->bb_buf = bb_buf; |
devcon->bb_off = off; |
devcon->bb_size = size; |
return EOK; |
} |
void *block_bb_get(dev_handle_t dev_handle) |
{ |
devcon_t *devcon = devcon_search(dev_handle); |
assert(devcon); |
return devcon->bb_buf; |
} |
static hash_index_t cache_hash(unsigned long *key) |
{ |
return *key & (CACHE_BUCKETS - 1); |
} |
static int cache_compare(unsigned long *key, hash_count_t keys, link_t *item) |
{ |
block_t *b = hash_table_get_instance(item, block_t, hash_link); |
return b->boff == *key; |
} |
static void cache_remove_callback(link_t *item) |
{ |
} |
static hash_table_operations_t cache_ops = { |
.hash = cache_hash, |
.compare = cache_compare, |
.remove_callback = cache_remove_callback |
}; |
int block_cache_init(dev_handle_t dev_handle, size_t size, unsigned blocks, |
enum cache_mode mode) |
{ |
devcon_t *devcon = devcon_search(dev_handle); |
cache_t *cache; |
if (!devcon) |
return ENOENT; |
if (devcon->cache) |
return EEXIST; |
cache = malloc(sizeof(cache_t)); |
if (!cache) |
return ENOMEM; |
fibril_mutex_initialize(&cache->lock); |
list_initialize(&cache->free_head); |
cache->block_size = size; |
cache->block_count = blocks; |
cache->mode = mode; |
if (!hash_table_create(&cache->block_hash, CACHE_BUCKETS, 1, |
&cache_ops)) { |
free(cache); |
return ENOMEM; |
} |
devcon->cache = cache; |
return EOK; |
} |
static bool cache_can_grow(cache_t *cache) |
{ |
return true; |
} |
static void block_initialize(block_t *b) |
{ |
fibril_mutex_initialize(&b->lock); |
b->refcnt = 1; |
b->dirty = false; |
fibril_rwlock_initialize(&b->contents_lock); |
link_initialize(&b->free_link); |
link_initialize(&b->hash_link); |
} |
/** Instantiate a block in memory and get a reference to it. |
* |
* @param dev_handle Device handle of the block device. |
* @param boff Block offset. |
* @param flags If BLOCK_FLAGS_NOREAD is specified, block_get() |
* will not read the contents of the block from the |
* device. |
* |
* @return Block structure. |
*/ |
block_t *block_get(dev_handle_t dev_handle, bn_t boff, int flags) |
{ |
devcon_t *devcon; |
cache_t *cache; |
block_t *b; |
link_t *l; |
unsigned long key = boff; |
devcon = devcon_search(dev_handle); |
assert(devcon); |
assert(devcon->cache); |
cache = devcon->cache; |
fibril_mutex_lock(&cache->lock); |
l = hash_table_find(&cache->block_hash, &key); |
if (l) { |
/* |
* We found the block in the cache. |
*/ |
b = hash_table_get_instance(l, block_t, hash_link); |
fibril_mutex_lock(&b->lock); |
if (b->refcnt++ == 0) |
list_remove(&b->free_link); |
fibril_mutex_unlock(&b->lock); |
fibril_mutex_unlock(&cache->lock); |
} else { |
/* |
* The block was not found in the cache. |
*/ |
int rc; |
bool sync = false; |
if (cache_can_grow(cache)) { |
/* |
* We can grow the cache by allocating new blocks. |
* Should the allocation fail, we fail over and try to |
* recycle a block from the cache. |
*/ |
b = malloc(sizeof(block_t)); |
if (!b) |
goto recycle; |
b->data = malloc(cache->block_size); |
if (!b->data) { |
free(b); |
goto recycle; |
} |
} else { |
/* |
* Try to recycle a block from the free list. |
*/ |
unsigned long temp_key; |
recycle: |
assert(!list_empty(&cache->free_head)); |
l = cache->free_head.next; |
list_remove(l); |
b = hash_table_get_instance(l, block_t, hash_link); |
sync = b->dirty; |
temp_key = b->boff; |
hash_table_remove(&cache->block_hash, &temp_key, 1); |
} |
block_initialize(b); |
b->dev_handle = dev_handle; |
b->size = cache->block_size; |
b->boff = boff; |
hash_table_insert(&cache->block_hash, &key, &b->hash_link); |
/* |
* Lock the block before releasing the cache lock. Thus we don't |
* kill concurent operations on the cache while doing I/O on the |
* block. |
*/ |
fibril_mutex_lock(&b->lock); |
fibril_mutex_unlock(&cache->lock); |
if (sync) { |
/* |
* The block is dirty and needs to be written back to |
* the device before we can read in the new contents. |
*/ |
abort(); /* TODO: block_write() */ |
} |
if (!(flags & BLOCK_FLAGS_NOREAD)) { |
/* |
* The block contains old or no data. We need to read |
* the new contents from the device. |
*/ |
rc = read_block(devcon, b->boff, cache->block_size); |
assert(rc == EOK); |
memcpy(b->data, devcon->com_area, cache->block_size); |
} |
fibril_mutex_unlock(&b->lock); |
} |
return b; |
} |
/** Release a reference to a block. |
* |
* If the last reference is dropped, the block is put on the free list. |
* |
* @param block Block of which a reference is to be released. |
*/ |
void block_put(block_t *block) |
{ |
devcon_t *devcon = devcon_search(block->dev_handle); |
cache_t *cache; |
int rc; |
assert(devcon); |
assert(devcon->cache); |
cache = devcon->cache; |
fibril_mutex_lock(&cache->lock); |
fibril_mutex_lock(&block->lock); |
if (!--block->refcnt) { |
/* |
* Last reference to the block was dropped, put the block on the |
* free list. |
*/ |
list_append(&block->free_link, &cache->free_head); |
if (cache->mode != CACHE_MODE_WB && block->dirty) { |
memcpy(devcon->com_area, block->data, block->size); |
rc = write_block(devcon, block->boff, block->size); |
assert(rc == EOK); |
block->dirty = false; |
} |
} |
fibril_mutex_unlock(&block->lock); |
fibril_mutex_unlock(&cache->lock); |
} |
/** Read sequential data from a block device. |
* |
* @param dev_handle Device handle of the block device. |
* @param bufpos Pointer to the first unread valid offset within the |
* communication buffer. |
* @param buflen Pointer to the number of unread bytes that are ready in |
* the communication buffer. |
* @param pos Device position to be read. |
* @param dst Destination buffer. |
* @param size Size of the destination buffer. |
* @param block_size Block size to be used for the transfer. |
* |
* @return EOK on success or a negative return code on failure. |
*/ |
int block_seqread(dev_handle_t dev_handle, off_t *bufpos, size_t *buflen, |
off_t *pos, void *dst, size_t size, size_t block_size) |
{ |
off_t offset = 0; |
size_t left = size; |
devcon_t *devcon = devcon_search(dev_handle); |
assert(devcon); |
while (left > 0) { |
size_t rd; |
if (*bufpos + left < *buflen) |
rd = left; |
else |
rd = *buflen - *bufpos; |
if (rd > 0) { |
/* |
* Copy the contents of the communication buffer to the |
* destination buffer. |
*/ |
memcpy(dst + offset, devcon->com_area + *bufpos, rd); |
offset += rd; |
*bufpos += rd; |
*pos += rd; |
left -= rd; |
} |
if (*bufpos == (off_t) *buflen) { |
/* Refill the communication buffer with a new block. */ |
int rc; |
rc = read_block(devcon, *pos / block_size, block_size); |
if (rc != EOK) |
return rc; |
*bufpos = 0; |
*buflen = block_size; |
} |
} |
return EOK; |
} |
/** Read block from block device. |
* |
* @param devcon Device connection. |
* @param boff Block index. |
* @param block_size Block size. |
* @param src Buffer for storing the data. |
* |
* @return EOK on success or negative error code on failure. |
*/ |
static int read_block(devcon_t *devcon, bn_t boff, size_t block_size) |
{ |
ipcarg_t retval; |
int rc; |
assert(devcon); |
rc = async_req_2_1(devcon->dev_phone, BD_READ_BLOCK, boff, block_size, |
&retval); |
if ((rc != EOK) || (retval != EOK)) |
return (rc != EOK ? rc : (int) retval); |
return EOK; |
} |
/** Write block to block device. |
* |
* @param devcon Device connection. |
* @param boff Block index. |
* @param block_size Block size. |
* @param src Buffer containing the data to write. |
* |
* @return EOK on success or negative error code on failure. |
*/ |
static int write_block(devcon_t *devcon, bn_t boff, size_t block_size) |
{ |
ipcarg_t retval; |
int rc; |
assert(devcon); |
rc = async_req_2_1(devcon->dev_phone, BD_WRITE_BLOCK, boff, block_size, |
&retval); |
if ((rc != EOK) || (retval != EOK)) |
return (rc != EOK ? rc : (int) retval); |
return EOK; |
} |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libblock/libblock.h |
---|
0,0 → 1,113 |
/* |
* Copyright (c) 2008 Jakub Jermar |
* Copyright (c) 2008 Martin Decky |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup libblock |
* @{ |
*/ |
/** |
* @file |
*/ |
#ifndef LIBBLOCK_LIBBLOCK_H_ |
#define LIBBLOCK_LIBBLOCK_H_ |
#include <stdint.h> |
#include "../../srv/vfs/vfs.h" |
#include <fibril_sync.h> |
#include <adt/hash_table.h> |
#include <adt/list.h> |
/* |
* Flags that can be used with block_get(). |
*/ |
/** |
* This macro is a symbolic value for situations where no special flags are |
* needed. |
*/ |
#define BLOCK_FLAGS_NONE 0 |
/** |
* When the client of block_get() intends to overwrite the current contents of |
* the block, this flag is used to avoid the unnecessary read. |
*/ |
#define BLOCK_FLAGS_NOREAD 1 |
typedef unsigned bn_t; /**< Block number type. */ |
typedef struct block { |
/** Mutex protecting the reference count. */ |
fibril_mutex_t lock; |
/** Number of references to the block_t structure. */ |
unsigned refcnt; |
/** If true, the block needs to be written back to the block device. */ |
bool dirty; |
/** Readers / Writer lock protecting the contents of the block. */ |
fibril_rwlock_t contents_lock; |
/** Handle of the device where the block resides. */ |
dev_handle_t dev_handle; |
/** Block offset on the block device. Counted in 'size'-byte blocks. */ |
bn_t boff; |
/** Size of the block. */ |
size_t size; |
/** Link for placing the block into the free block list. */ |
link_t free_link; |
/** Link for placing the block into the block hash table. */ |
link_t hash_link; |
/** Buffer with the block data. */ |
void *data; |
} block_t; |
/** Caching mode */ |
enum cache_mode { |
/** Write-Through */ |
CACHE_MODE_WT, |
/** Write-Back */ |
CACHE_MODE_WB |
}; |
extern int block_init(dev_handle_t, size_t); |
extern void block_fini(dev_handle_t); |
extern int block_bb_read(dev_handle_t, off_t, size_t); |
extern void *block_bb_get(dev_handle_t); |
extern int block_cache_init(dev_handle_t, size_t, unsigned, enum cache_mode); |
extern block_t *block_get(dev_handle_t, bn_t, int); |
extern void block_put(block_t *); |
extern int block_seqread(dev_handle_t, off_t *, size_t *, off_t *, void *, |
size_t, size_t); |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/lib/libblock/Makefile |
---|
0,0 → 1,67 |
# |
# Copyright (c) 2005 Martin Decky |
# Copyright (c) 2007 Jakub Jermar |
# All rights reserved. |
# |
# Redistribution and use in source and binary forms, with or without |
# modification, are permitted provided that the following conditions |
# are met: |
# |
# - Redistributions of source code must retain the above copyright |
# notice, this list of conditions and the following disclaimer. |
# - 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. |
# - The name of the author may not be used to endorse or promote products |
# derived from this software without specific prior written permission. |
# |
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
# |
## Common compiler flags |
# |
LIBC_PREFIX = ../libc |
## Setup toolchain |
# |
include $(LIBC_PREFIX)/Makefile.toolchain |
CFLAGS += -Iinclude |
## Sources |
# |
SOURCES = \ |
libblock.c |
OBJECTS := $(addsuffix .o,$(basename $(SOURCES))) |
.PHONY: all clean depend |
all: libblock.a |
-include Makefile.depend |
clean: |
-rm -f libblock.a Makefile.depend |
find . -name '*.o' -follow -exec rm \{\} \; |
depend: |
-makedepend -f - -- $(DEPEND_DEFS) $(CFLAGS) -- $(SOURCES) > Makefile.depend 2> /dev/null |
libblock.a: depend $(OBJECTS) |
$(AR) rc libblock.a $(OBJECTS) |
%.o: %.c |
$(CC) $(DEFS) $(CFLAGS) -c $< -o $@ |
//branches/snapshot/uspace/lib/softfloat/include/sftypes.h |
---|
0,0 → 1,113 |
/* |
* Copyright (c) 2005 Josef Cejka |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup softfloat |
* @{ |
*/ |
/** @file |
*/ |
#ifndef __SFTYPES_H__ |
#define __SFTYPES_H__ |
#include <byteorder.h> |
#include <stdint.h> |
typedef union { |
float f; |
uint32_t binary; |
struct { |
#if defined(__BE__) |
uint32_t sign : 1; |
uint32_t exp : 8; |
uint32_t fraction : 23; |
#elif defined(__LE__) |
uint32_t fraction : 23; |
uint32_t exp : 8; |
uint32_t sign : 1; |
#else |
#error Unknown endianess |
#endif |
} parts __attribute__ ((packed)); |
} float32; |
typedef union { |
double d; |
uint64_t binary; |
struct { |
#if defined(__BE__) |
uint64_t sign : 1; |
uint64_t exp : 11; |
uint64_t fraction : 52; |
#elif defined(__LE__) |
uint64_t fraction : 52; |
uint64_t exp : 11; |
uint64_t sign : 1; |
#else |
#error Unknown endianess |
#endif |
} parts __attribute__ ((packed)); |
} float64; |
#define FLOAT32_MAX 0x7f800000 |
#define FLOAT32_MIN 0xff800000 |
#define FLOAT64_MAX |
#define FLOAT64_MIN |
/* |
* For recognizing NaNs or infinity use isFloat32NaN and is Float32Inf, |
* comparing with these constants is not sufficient. |
*/ |
#define FLOAT32_NAN 0x7FC00001 |
#define FLOAT32_SIGNAN 0x7F800001 |
#define FLOAT32_INF 0x7F800000 |
#define FLOAT64_NAN 0x7FF8000000000001ll |
#define FLOAT64_SIGNAN 0x7FF0000000000001ll |
#define FLOAT64_INF 0x7FF0000000000000ll |
#define FLOAT32_FRACTION_SIZE 23 |
#define FLOAT64_FRACTION_SIZE 52 |
#define FLOAT32_HIDDEN_BIT_MASK 0x800000 |
#define FLOAT64_HIDDEN_BIT_MASK 0x10000000000000ll |
#define FLOAT32_MAX_EXPONENT 0xFF |
#define FLOAT64_MAX_EXPONENT 0x7FF |
#define FLOAT32_BIAS 0x7F |
#define FLOAT64_BIAS 0x3FF |
#define FLOAT80_BIAS 0x3FFF |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/lib/softfloat/include/sub.h |
---|
0,0 → 1,47 |
/* |
* Copyright (c) 2005 Josef Cejka |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup softfloat |
* @{ |
*/ |
/** @file |
*/ |
#ifndef __SUB_H__ |
#define __SUB_H__ |
float32 subFloat32(float32 a, float32 b); |
float64 subFloat64(float64 a, float64 b); |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/lib/softfloat/include/comparison.h |
---|
0,0 → 1,59 |
/* |
* Copyright (c) 2005 Josef Cejka |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup softfloat |
* @{ |
*/ |
/** @file |
*/ |
#ifndef __COMPARISON_H__ |
#define __COMPARISON_H__ |
inline int isFloat32NaN(float32 f); |
inline int isFloat32SigNaN(float32 f); |
inline int isFloat32Infinity(float32 f); |
inline int isFloat32Zero(float32 f); |
inline int isFloat64NaN(float64 d); |
inline int isFloat64SigNaN(float64 d); |
inline int isFloat64Infinity(float64 d); |
inline int isFloat64Zero(float64 d); |
inline int isFloat32eq(float32 a, float32 b); |
inline int isFloat32lt(float32 a, float32 b); |
inline int isFloat32gt(float32 a, float32 b); |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/lib/softfloat/include/mul.h |
---|
0,0 → 1,49 |
/* |
* Copyright (c) 2005 Josef Cejka |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup softfloat |
* @{ |
*/ |
/** @file |
*/ |
#ifndef __MUL_H__ |
#define __MUL_H__ |
float32 mulFloat32(float32 a, float32 b); |
float64 mulFloat64(float64 a, float64 b); |
void mul64integers(uint64_t a,uint64_t b, uint64_t *lo, uint64_t *hi); |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/lib/softfloat/include/other.h |
---|
0,0 → 1,43 |
/* |
* Copyright (c) 2005 Josef Cejka |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup softfloat |
* @{ |
*/ |
/** @file |
*/ |
#ifndef __OTHER_H__ |
#define __OTHER_H__ |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/lib/softfloat/include/softfloat.h |
---|
0,0 → 1,174 |
/* |
* Copyright (c) 2005 Josef Cejka |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup softfloat |
* @{ |
*/ |
/** @file |
*/ |
#ifndef __SOFTFLOAT_H__ |
#define __SOFTFLOAT_H__ |
float __addsf3(float a, float b); |
double __adddf3(double a, double b); |
long double __addtf3(long double a, long double b); |
long double __addxf3(long double a, long double b); |
float __subsf3(float a, float b); |
double __subdf3(double a, double b); |
long double __subtf3(long double a, long double b); |
long double __subxf3(long double a, long double b); |
float __mulsf3(float a, float b); |
double __muldf3(double a, double b); |
long double __multf3(long double a, long double b); |
long double __mulxf3(long double a, long double b); |
float __divsf3(float a, float b); |
double __divdf3(double a, double b); |
long double __divtf3(long double a, long double b); |
long double __divxf3(long double a, long double b); |
float __negsf2(float a); |
double __negdf2(double a); |
long double __negtf2(long double a); |
long double __negxf2(long double a); |
double __extendsfdf2(float a); |
long double __extendsftf2(float a); |
long double __extendsfxf2(float a); |
long double __extenddftf2(double a); |
long double __extenddfxf2(double a); |
double __truncxfdf2(long double a); |
double __trunctfdf2(long double a); |
float __truncxfsf2(long double a); |
float __trunctfsf2(long double a); |
float __truncdfsf2(double a); |
int __fixsfsi(float a); |
int __fixdfsi(double a); |
int __fixtfsi(long double a); |
int __fixxfsi(long double a); |
long __fixsfdi(float a); |
long __fixdfdi(double a); |
long __fixtfdi(long double a); |
long __fixxfdi(long double a); |
long long __fixsfti(float a); |
long long __fixdfti(double a); |
long long __fixtfti(long double a); |
long long __fixxfti(long double a); |
unsigned int __fixunssfsi(float a); |
unsigned int __fixunsdfsi(double a); |
unsigned int __fixunstfsi(long double a); |
unsigned int __fixunsxfsi(long double a); |
unsigned long __fixunssfdi(float a); |
unsigned long __fixunsdfdi(double a); |
unsigned long __fixunstfdi(long double a); |
unsigned long __fixunsxfdi(long double a); |
unsigned long long __fixunssfti(float a); |
unsigned long long __fixunsdfti(double a); |
unsigned long long __fixunstfti(long double a); |
unsigned long long __fixunsxfti(long double a); |
float __floatsisf(int i); |
double __floatsidf(int i); |
long double __floatsitf(int i); |
long double __floatsixf(int i); |
float __floatdisf(long i); |
double __floatdidf(long i); |
long double __floatditf(long i); |
long double __floatdixf(long i); |
float __floattisf(long long i); |
double __floattidf(long long i); |
long double __floattitf(long long i); |
long double __floattixf(long long i); |
float __floatunsisf(unsigned int i); |
double __floatunsidf(unsigned int i); |
long double __floatunsitf(unsigned int i); |
long double __floatunsixf(unsigned int i); |
float __floatundisf(unsigned long i); |
double __floatundidf(unsigned long i); |
long double __floatunditf(unsigned long i); |
long double __floatundixf(unsigned long i); |
float __floatuntisf(unsigned long long i); |
double __floatuntidf(unsigned long long i); |
long double __floatuntitf(unsigned long long i); |
long double __floatuntixf(unsigned long long i); |
int __cmpsf2(float a, float b); |
int __cmpdf2(double a, double b); |
int __cmptf2(long double a, long double b); |
int __unordsf2(float a, float b); |
int __unorddf2(double a, double b); |
int __unordtf2(long double a, long double b); |
int __eqsf2(float a, float b); |
int __eqdf2(double a, double b); |
int __eqtf2(long double a, long double b); |
int __nesf2(float a, float b); |
int __nedf2(double a, double b); |
int __netf2(long double a, long double b); |
int __gesf2(float a, float b); |
int __gedf2(double a, double b); |
int __getf2(long double a, long double b); |
int __ltsf2(float a, float b); |
int __ltdf2(double a, double b); |
int __lttf2(long double a, long double b); |
int __lesf2(float a, float b); |
int __ledf2(double a, double b); |
int __letf2(long double a, long double b); |
int __gtsf2(float a, float b); |
int __gtdf2(double a, double b); |
int __gttf2(long double a, long double b); |
/* Not implemented yet*/ |
float __powisf2(float a, int b); |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/lib/softfloat/include/div.h |
---|
0,0 → 1,48 |
/* |
* Copyright (c) 2005 Josef Cejka |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup softfloat |
* @{ |
*/ |
/** @file |
*/ |
#ifndef __DIV_H__ |
#define __DIV_H__ |
float32 divFloat32(float32 a, float32 b); |
float64 divFloat64(float64 a, float64 b); |
uint64_t divFloat64estim(uint64_t a, uint64_t b); |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/lib/softfloat/include/conversion.h |
---|
0,0 → 1,71 |
/* |
* Copyright (c) 2005 Josef Cejka |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup softfloat |
* @{ |
*/ |
/** @file |
*/ |
#ifndef __CONVERSION_H__ |
#define __CONVERSION_H__ |
float64 convertFloat32ToFloat64(float32 a); |
float32 convertFloat64ToFloat32(float64 a); |
uint32_t float32_to_uint32(float32 a); |
int32_t float32_to_int32(float32 a); |
uint64_t float32_to_uint64(float32 a); |
int64_t float32_to_int64(float32 a); |
uint64_t float64_to_uint64(float64 a); |
int64_t float64_to_int64(float64 a); |
uint32_t float64_to_uint32(float64 a); |
int32_t float64_to_int32(float64 a); |
float32 uint32_to_float32(uint32_t i); |
float32 int32_to_float32(int32_t i); |
float32 uint64_to_float32(uint64_t i); |
float32 int64_to_float32(int64_t i); |
float64 uint32_to_float64(uint32_t i); |
float64 int32_to_float64(int32_t i); |
float64 uint64_to_float64(uint64_t i); |
float64 int64_to_float64(int64_t i); |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/lib/softfloat/include/add.h |
---|
0,0 → 1,47 |
/* |
* Copyright (c) 2005 Josef Cejka |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup softfloat |
* @{ |
*/ |
/** @file |
*/ |
#ifndef __ADD_H__ |
#define __ADD_H__ |
float32 addFloat32(float32 a, float32 b); |
float64 addFloat64(float64 a, float64 b); |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/lib/softfloat/include/common.h |
---|
0,0 → 1,53 |
/* |
* Copyright (c) 2005 Josef Cejka |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup softfloat |
* @{ |
*/ |
/** @file |
*/ |
#ifndef __COMMON_H__ |
#define __COMMON_H__ |
#include<sftypes.h> |
float64 finishFloat64(int32_t cexp, uint64_t cfrac, char sign); |
int countZeroes64(uint64_t i); |
int countZeroes32(uint32_t i); |
int countZeroes8(uint8_t i); |
void roundFloat32(int32_t *exp, uint32_t *fraction); |
void roundFloat64(int32_t *exp, uint64_t *fraction); |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/lib/softfloat/Makefile |
---|
0,0 → 1,82 |
# |
# Copyright (c) 2005 Martin Decky |
# All rights reserved. |
# |
# Redistribution and use in source and binary forms, with or without |
# modification, are permitted provided that the following conditions |
# are met: |
# |
# - Redistributions of source code must retain the above copyright |
# notice, this list of conditions and the following disclaimer. |
# - 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. |
# - The name of the author may not be used to endorse or promote products |
# derived from this software without specific prior written permission. |
# |
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
# |
## Common compiler flags |
# |
LIBC_PREFIX = ../libc |
## Setup toolchain |
# |
include $(LIBC_PREFIX)/Makefile.toolchain |
CFLAGS += -Iinclude -Iarch/$(UARCH)/include/ |
## Sources |
# |
GENERIC_SOURCES = \ |
generic/add.c \ |
generic/common.c \ |
generic/comparison.c \ |
generic/conversion.c \ |
generic/div.c \ |
generic/mul.c \ |
generic/other.c \ |
generic/softfloat.c \ |
generic/sub.c |
ARCH_SOURCES = |
GENERIC_OBJECTS := $(addsuffix .o,$(basename $(GENERIC_SOURCES))) |
.PHONY: all clean depend |
all: libsoftfloat.a |
-include Makefile.depend |
clean: |
-rm -f libsoftfloat.a Makefile.depend |
find generic/ -name '*.o' -follow -exec rm \{\} \; |
depend: |
-makedepend -f - -- $(DEPEND_DEFS) $(CFLAGS) -- $(GENERIC_SOURCES) > Makefile.depend 2> /dev/null |
libsoftfloat.a: depend $(ARCH_OBJECTS) $(GENERIC_OBJECTS) |
$(AR) rc libsoftfloat.a $(ARCH_OBJECTS) $(GENERIC_OBJECTS) |
%.o: %.S |
$(CC) $(DEFS) $(AFLAGS) $(CFLAGS) -D__ASM__ -c $< -o $@ |
%.o: %.s |
$(AS) $(AFLAGS) $< -o $@ |
%.o: %.c |
$(CC) $(DEFS) $(CFLAGS) -c $< -o $@ |
//branches/snapshot/uspace/lib/softfloat/arch/arm32/include/functions.h |
---|
0,0 → 1,76 |
/* |
* Copyright (c) 2006 Josef Cejka |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup softfloatarm32 arm32 |
* @ingroup sfl |
* @brief Softfloat architecture dependent definitions. |
* @{ |
*/ |
/** @file |
* @brief Softfloat architecture dependent definitions. |
*/ |
#ifndef __SOFTFLOAT_FUNCTIONS_H__ |
#define __SOFTFLOAT_FUNCTIONS_H__ |
#define float32_to_int(X) float32_to_int32(X); |
#define float32_to_long(X) float32_to_int32(X); |
#define float32_to_longlong(X) float32_to_int64(X); |
#define float64_to_int(X) float64_to_int32(X); |
#define float64_to_long(X) float64_to_int32(X); |
#define float64_to_longlong(X) float64_to_int64(X); |
#define float32_to_uint(X) float32_to_uint32(X); |
#define float32_to_ulong(X) float32_to_uint32(X); |
#define float32_to_ulonglong(X) float32_to_uint64(X); |
#define float64_to_uint(X) float64_to_uint32(X); |
#define float64_to_ulong(X) float64_to_uint32(X); |
#define float64_to_ulonglong(X) float64_to_uint64(X); |
#define int_to_float32(X) int32_to_float32(X); |
#define long_to_float32(X) int32_to_float32(X); |
#define longlong_to_float32(X) int64_to_float32(X); |
#define int_to_float64(X) int32_to_float64(X); |
#define long_to_float64(X) int32_to_float64(X); |
#define longlong_to_float64(X) int64_to_float64(X); |
#define uint_to_float32(X) uint32_to_float32(X); |
#define ulong_to_float32(X) uint32_to_float32(X); |
#define ulonglong_to_float32(X) uint64_to_float32(X); |
#define uint_to_float64(X) uint32_to_float64(X); |
#define ulong_to_float64(X) uint32_to_float64(X); |
#define ulonglong_to_float64(X) uint64_to_float64(X); |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/lib/softfloat/arch/sparc64/include/functions.h |
---|
0,0 → 1,77 |
/* |
* Copyright (c) 2006 Josef Cejka |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup softfloatsparc64 sparc64 |
* @ingroup sfl |
* @brief softfloat architecture dependent definitions |
* @{ |
*/ |
/** @file |
*/ |
#ifndef __SOFTFLOAT_FUNCTIONS_H__ |
#define __SOFTFLOAT_FUNCTIONS_H__ |
#define float32_to_int(X) float32_to_int32(X); |
#define float32_to_long(X) float32_to_int64(X); |
#define float32_to_longlong(X) float32_to_int64(X); |
#define float64_to_int(X) float64_to_int32(X); |
#define float64_to_long(X) float64_to_int64(X); |
#define float64_to_longlong(X) float64_to_int64(X); |
#define float32_to_uint(X) float32_to_uint32(X); |
#define float32_to_ulong(X) float32_to_uint64(X); |
#define float32_to_ulonglong(X) float32_to_uint64(X); |
#define float64_to_uint(X) float64_to_uint32(X); |
#define float64_to_ulong(X) float64_to_uint64(X); |
#define float64_to_ulonglong(X) float64_to_uint64(X); |
#define int_to_float32(X) int32_to_float32(X); |
#define long_to_float32(X) int64_to_float32(X); |
#define longlong_to_float32(X) int64_to_float32(X); |
#define int_to_float64(X) int32_to_float64(X); |
#define long_to_float64(X) int64_to_float64(X); |
#define longlong_to_float64(X) int64_to_float64(X); |
#define uint_to_float32(X) uint32_to_float32(X); |
#define ulong_to_float32(X) uint64_to_float32(X); |
#define ulonglong_to_float32(X) uint64_to_float32(X); |
#define uint_to_float64(X) uint32_to_float64(X); |
#define ulong_to_float64(X) uint64_to_float64(X); |
#define ulonglong_to_float64(X) uint64_to_float64(X); |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/lib/softfloat/arch/ia64/include/functions.h |
---|
0,0 → 1,77 |
/* |
* Copyright (c) 2006 Josef Cejka |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup softfloatia64 ia64 |
* @ingroup sfl |
* @brief softfloat architecture dependent definitions |
* @{ |
*/ |
/** @file |
*/ |
#ifndef __SOFTFLOAT_FUNCTIONS_H__ |
#define __SOFTFLOAT_FUNCTIONS_H__ |
#define float32_to_int(X) float32_to_int32(X); |
#define float32_to_long(X) float32_to_int64(X); |
#define float32_to_longlong(X) float32_to_int64(X); |
#define float64_to_int(X) float64_to_int32(X); |
#define float64_to_long(X) float64_to_int64(X); |
#define float64_to_longlong(X) float64_to_int64(X); |
#define float32_to_uint(X) float32_to_uint32(X); |
#define float32_to_ulong(X) float32_to_uint64(X); |
#define float32_to_ulonglong(X) float32_to_uint64(X); |
#define float64_to_uint(X) float64_to_uint32(X); |
#define float64_to_ulong(X) float64_to_uint64(X); |
#define float64_to_ulonglong(X) float64_to_uint64(X); |
#define int_to_float32(X) int32_to_float32(X); |
#define long_to_float32(X) int64_to_float32(X); |
#define longlong_to_float32(X) int64_to_float32(X); |
#define int_to_float64(X) int32_to_float64(X); |
#define long_to_float64(X) int64_to_float64(X); |
#define longlong_to_float64(X) int64_to_float64(X); |
#define uint_to_float32(X) uint32_to_float32(X); |
#define ulong_to_float32(X) uint64_to_float32(X); |
#define ulonglong_to_float32(X) uint64_to_float32(X); |
#define uint_to_float64(X) uint32_to_float64(X); |
#define ulong_to_float64(X) uint64_to_float64(X); |
#define ulonglong_to_float64(X) uint64_to_float64(X); |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/lib/softfloat/arch/mips32eb/include/functions.h |
---|
0,0 → 1,77 |
/* |
* Copyright (c) 2006 Josef Cejka |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup softfloatmipseb32 mipseb32 |
* @ingroup sfl |
* @brief softfloat architecture dependent definitions |
* * @{ |
*/ |
/** @file |
*/ |
#ifndef __SOFTFLOAT_FUNCTIONS_H__ |
#define __SOFTFLOAT_FUNCTIONS_H__ |
#define float32_to_int(X) float32_to_int32(X); |
#define float32_to_long(X) float32_to_int32(X); |
#define float32_to_longlong(X) float32_to_int64(X); |
#define float64_to_int(X) float64_to_int32(X); |
#define float64_to_long(X) float64_to_int32(X); |
#define float64_to_longlong(X) float64_to_int64(X); |
#define float32_to_uint(X) float32_to_uint32(X); |
#define float32_to_ulong(X) float32_to_uint32(X); |
#define float32_to_ulonglong(X) float32_to_uint64(X); |
#define float64_to_uint(X) float64_to_uint32(X); |
#define float64_to_ulong(X) float64_to_uint32(X); |
#define float64_to_ulonglong(X) float64_to_uint64(X); |
#define int_to_float32(X) int32_to_float32(X); |
#define long_to_float32(X) int32_to_float32(X); |
#define longlong_to_float32(X) int64_to_float32(X); |
#define int_to_float64(X) int32_to_float64(X); |
#define long_to_float64(X) int32_to_float64(X); |
#define longlong_to_float64(X) int64_to_float64(X); |
#define uint_to_float32(X) uint32_to_float32(X); |
#define ulong_to_float32(X) uint32_to_float32(X); |
#define ulonglong_to_float32(X) uint64_to_float32(X); |
#define uint_to_float64(X) uint32_to_float64(X); |
#define ulong_to_float64(X) uint32_to_float64(X); |
#define ulonglong_to_float64(X) uint64_to_float64(X); |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/lib/softfloat/arch/ppc32/include/functions.h |
---|
0,0 → 1,77 |
/* |
* Copyright (c) 2006 Josef Cejka |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup softfloatppc32 ppc32 |
* @ingroup sfl |
* @brief softfloat architecture dependent definitions |
* @{ |
*/ |
/** @file |
*/ |
#ifndef __SOFTFLOAT_FUNCTIONS_H__ |
#define __SOFTFLOAT_FUNCTIONS_H__ |
#define float32_to_int(X) float32_to_int32(X); |
#define float32_to_long(X) float32_to_int32(X); |
#define float32_to_longlong(X) float32_to_int64(X); |
#define float64_to_int(X) float64_to_int32(X); |
#define float64_to_long(X) float64_to_int32(X); |
#define float64_to_longlong(X) float64_to_int64(X); |
#define float32_to_uint(X) float32_to_uint32(X); |
#define float32_to_ulong(X) float32_to_uint32(X); |
#define float32_to_ulonglong(X) float32_to_uint64(X); |
#define float64_to_uint(X) float64_to_uint32(X); |
#define float64_to_ulong(X) float64_to_uint32(X); |
#define float64_to_ulonglong(X) float64_to_uint64(X); |
#define int_to_float32(X) int32_to_float32(X); |
#define long_to_float32(X) int32_to_float32(X); |
#define longlong_to_float32(X) int64_to_float32(X); |
#define int_to_float64(X) int32_to_float64(X); |
#define long_to_float64(X) int32_to_float64(X); |
#define longlong_to_float64(X) int64_to_float64(X); |
#define uint_to_float32(X) uint32_to_float32(X); |
#define ulong_to_float32(X) uint32_to_float32(X); |
#define ulonglong_to_float32(X) uint64_to_float32(X); |
#define uint_to_float64(X) uint32_to_float64(X); |
#define ulong_to_float64(X) uint32_to_float64(X); |
#define ulonglong_to_float64(X) uint64_to_float64(X); |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/lib/softfloat/arch/amd64/include/functions.h |
---|
0,0 → 1,77 |
/* |
* Copyright (c) 2006 Josef Cejka |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup softfloatamd64 amd64 |
* @ingroup sfl |
* @brief softfloat architecture dependent definitions |
* @{ |
*/ |
/** @file |
*/ |
#ifndef __SOFTFLOAT_FUNCTIONS_H__ |
#define __SOFTFLOAT_FUNCTIONS_H__ |
#define float32_to_int(X) float32_to_int32(X); |
#define float32_to_long(X) float32_to_int64(X); |
#define float32_to_longlong(X) float32_to_int64(X); |
#define float64_to_int(X) float64_to_int32(X); |
#define float64_to_long(X) float64_to_int64(X); |
#define float64_to_longlong(X) float64_to_int64(X); |
#define float32_to_uint(X) float32_to_uint32(X); |
#define float32_to_ulong(X) float32_to_uint64(X); |
#define float32_to_ulonglong(X) float32_to_uint64(X); |
#define float64_to_uint(X) float64_to_uint32(X); |
#define float64_to_ulong(X) float64_to_uint64(X); |
#define float64_to_ulonglong(X) float64_to_uint64(X); |
#define int_to_float32(X) int32_to_float32(X); |
#define long_to_float32(X) int64_to_float32(X); |
#define longlong_to_float32(X) int64_to_float32(X); |
#define int_to_float64(X) int32_to_float64(X); |
#define long_to_float64(X) int64_to_float64(X); |
#define longlong_to_float64(X) int64_to_float64(X); |
#define uint_to_float32(X) uint32_to_float32(X); |
#define ulong_to_float32(X) uint64_to_float32(X); |
#define ulonglong_to_float32(X) uint64_to_float32(X); |
#define uint_to_float64(X) uint32_to_float64(X); |
#define ulong_to_float64(X) uint64_to_float64(X); |
#define ulonglong_to_float64(X) uint64_to_float64(X); |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/lib/softfloat/arch/mips32/include/functions.h |
---|
0,0 → 1,77 |
/* |
* Copyright (c) 2006 Josef Cejka |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup softfloatmips32 mips32 |
* @ingroup sfl |
* @brief softfloat architecture dependent definitions |
* @{ |
*/ |
/** @file |
*/ |
#ifndef __SOFTFLOAT_FUNCTIONS_H__ |
#define __SOFTFLOAT_FUNCTIONS_H__ |
#define float32_to_int(X) float32_to_int32(X); |
#define float32_to_long(X) float32_to_int32(X); |
#define float32_to_longlong(X) float32_to_int64(X); |
#define float64_to_int(X) float64_to_int32(X); |
#define float64_to_long(X) float64_to_int32(X); |
#define float64_to_longlong(X) float64_to_int64(X); |
#define float32_to_uint(X) float32_to_uint32(X); |
#define float32_to_ulong(X) float32_to_uint32(X); |
#define float32_to_ulonglong(X) float32_to_uint64(X); |
#define float64_to_uint(X) float64_to_uint32(X); |
#define float64_to_ulong(X) float64_to_uint32(X); |
#define float64_to_ulonglong(X) float64_to_uint64(X); |
#define int_to_float32(X) int32_to_float32(X); |
#define long_to_float32(X) int32_to_float32(X); |
#define longlong_to_float32(X) int64_to_float32(X); |
#define int_to_float64(X) int32_to_float64(X); |
#define long_to_float64(X) int32_to_float64(X); |
#define longlong_to_float64(X) int64_to_float64(X); |
#define uint_to_float32(X) uint32_to_float32(X); |
#define ulong_to_float32(X) uint32_to_float32(X); |
#define ulonglong_to_float32(X) uint64_to_float32(X); |
#define uint_to_float64(X) uint32_to_float64(X); |
#define ulong_to_float64(X) uint32_to_float64(X); |
#define ulonglong_to_float64(X) uint64_to_float64(X); |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/lib/softfloat/arch/ia32/include/functions.h |
---|
0,0 → 1,75 |
/* |
* Copyright (c) 2006 Josef Cejka |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup softfloatia32 ia32 |
* @ingroup sfl |
* @brief softfloat architecture dependent definitions |
* @{ |
*/ |
/** @file |
*/ |
#ifndef __SOFTFLOAT_FUNCTIONS_H__ |
#define __SOFTFLOAT_FUNCTIONS_H__ |
#define float32_to_int(X) float32_to_int32(X); |
#define float32_to_long(X) float32_to_int32(X); |
#define float32_to_longlong(X) float32_to_int64(X); |
#define float64_to_int(X) float64_to_int32(X); |
#define float64_to_long(X) float64_to_int32(X); |
#define float64_to_longlong(X) float64_to_int64(X); |
#define float32_to_uint(X) float32_to_uint32(X); |
#define float32_to_ulong(X) float32_to_uint32(X); |
#define float32_to_ulonglong(X) float32_to_uint64(X); |
#define float64_to_uint(X) float64_to_uint32(X); |
#define float64_to_ulong(X) float64_to_uint32(X); |
#define float64_to_ulonglong(X) float64_to_uint64(X); |
#define int_to_float32(X) int32_to_float32(X); |
#define long_to_float32(X) int32_to_float32(X); |
#define longlong_to_float32(X) int64_to_float32(X); |
#define int_to_float64(X) int32_to_float64(X); |
#define long_to_float64(X) int32_to_float64(X); |
#define longlong_to_float64(X) int64_to_float64(X); |
#define uint_to_float32(X) uint32_to_float32(X); |
#define ulong_to_float32(X) uint32_to_float32(X); |
#define ulonglong_to_float32(X) uint64_to_float32(X); |
#define uint_to_float64(X) uint32_to_float64(X); |
#define ulong_to_float64(X) uint32_to_float64(X); |
#define ulonglong_to_float64(X) uint64_to_float64(X); |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/lib/softfloat/generic/other.c |
---|
0,0 → 1,37 |
/* |
* Copyright (c) 2005 Josef Cejka |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup softfloat |
* @{ |
*/ |
/** @file |
*/ |
/** @} |
*/ |
//branches/snapshot/uspace/lib/softfloat/generic/softfloat.c |
---|
0,0 → 1,499 |
/* |
* Copyright (c) 2005 Josef Cejka |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup softfloat generic |
* @ingroup sfl |
* @brief Architecture independent parts of FPU software emulation library. |
* @{ |
*/ |
/** @file |
*/ |
#include<softfloat.h> |
#include<sftypes.h> |
#include<add.h> |
#include<sub.h> |
#include<mul.h> |
#include<div.h> |
#include<conversion.h> |
#include<comparison.h> |
#include<other.h> |
#include<functions.h> |
/* Arithmetic functions */ |
float __addsf3(float a, float b) |
{ |
float32 fa, fb; |
fa.f = a; |
fb.f = b; |
if (fa.parts.sign != fb.parts.sign) { |
if (fa.parts.sign) { |
fa.parts.sign = 0; |
return subFloat32(fb, fa).f; |
}; |
fb.parts.sign = 0; |
return subFloat32(fa, fb).f; |
} |
return addFloat32(fa, fb).f; |
} |
double __adddf3(double a, double b) |
{ |
float64 da, db; |
da.d = a; |
db.d = b; |
if (da.parts.sign != db.parts.sign) { |
if (da.parts.sign) { |
da.parts.sign = 0; |
return subFloat64(db, da).d; |
}; |
db.parts.sign = 0; |
return subFloat64(da, db).d; |
} |
return addFloat64(da, db).d; |
} |
float __subsf3(float a, float b) |
{ |
float32 fa, fb; |
fa.f = a; |
fb.f = b; |
if (fa.parts.sign != fb.parts.sign) { |
fb.parts.sign = !fb.parts.sign; |
return addFloat32(fa, fb).f; |
} |
return subFloat32(fa, fb).f; |
} |
double __subdf3(double a, double b) |
{ |
float64 da, db; |
da.d = a; |
db.d = b; |
if (da.parts.sign != db.parts.sign) { |
db.parts.sign = !db.parts.sign; |
return addFloat64(da, db).d; |
} |
return subFloat64(da, db).d; |
} |
float __mulsf3(float a, float b) |
{ |
float32 fa, fb; |
fa.f = a; |
fb.f = b; |
return mulFloat32(fa, fb).f; |
} |
double __muldf3(double a, double b) |
{ |
float64 da, db; |
da.d = a; |
db.d = b; |
return mulFloat64(da, db).d; |
} |
float __divsf3(float a, float b) |
{ |
float32 fa, fb; |
fa.f = a; |
fb.f = b; |
return divFloat32(fa, fb).f; |
} |
double __divdf3(double a, double b) |
{ |
float64 da, db; |
da.d = a; |
db.d = b; |
return divFloat64(da, db).d; |
} |
float __negsf2(float a) |
{ |
float32 fa; |
fa.f = a; |
fa.parts.sign = !fa.parts.sign; |
return fa.f; |
} |
double __negdf2(double a) |
{ |
float64 fa; |
fa.d = a; |
fa.parts.sign = !fa.parts.sign; |
return fa.d; |
} |
/* Conversion functions */ |
double __extendsfdf2(float a) |
{ |
float32 fa; |
fa.f = a; |
return convertFloat32ToFloat64(fa).d; |
} |
float __truncdfsf2(double a) |
{ |
float64 da; |
da.d = a; |
return convertFloat64ToFloat32(da).f; |
} |
int __fixsfsi(float a) |
{ |
float32 fa; |
fa.f = a; |
return float32_to_int(fa); |
} |
int __fixdfsi(double a) |
{ |
float64 da; |
da.d = a; |
return float64_to_int(da); |
} |
long __fixsfdi(float a) |
{ |
float32 fa; |
fa.f = a; |
return float32_to_long(fa); |
} |
long __fixdfdi(double a) |
{ |
float64 da; |
da.d = a; |
return float64_to_long(da); |
} |
long long __fixsfti(float a) |
{ |
float32 fa; |
fa.f = a; |
return float32_to_longlong(fa); |
} |
long long __fixdfti(double a) |
{ |
float64 da; |
da.d = a; |
return float64_to_longlong(da); |
} |
unsigned int __fixunssfsi(float a) |
{ |
float32 fa; |
fa.f = a; |
return float32_to_uint(fa); |
} |
unsigned int __fixunsdfsi(double a) |
{ |
float64 da; |
da.d = a; |
return float64_to_uint(da); |
} |
unsigned long __fixunssfdi(float a) |
{ |
float32 fa; |
fa.f = a; |
return float32_to_ulong(fa); |
} |
unsigned long __fixunsdfdi(double a) |
{ |
float64 da; |
da.d = a; |
return float64_to_ulong(da); |
} |
unsigned long long __fixunssfti(float a) |
{ |
float32 fa; |
fa.f = a; |
return float32_to_ulonglong(fa); |
} |
unsigned long long __fixunsdfti(double a) |
{ |
float64 da; |
da.d = a; |
return float64_to_ulonglong(da); |
} |
float __floatsisf(int i) |
{ |
float32 fa; |
fa = int_to_float32(i); |
return fa.f; |
} |
double __floatsidf(int i) |
{ |
float64 da; |
da = int_to_float64(i); |
return da.d; |
} |
float __floatdisf(long i) |
{ |
float32 fa; |
fa = long_to_float32(i); |
return fa.f; |
} |
double __floatdidf(long i) |
{ |
float64 da; |
da = long_to_float64(i); |
return da.d; |
} |
float __floattisf(long long i) |
{ |
float32 fa; |
fa = longlong_to_float32(i); |
return fa.f; |
} |
double __floattidf(long long i) |
{ |
float64 da; |
da = longlong_to_float64(i); |
return da.d; |
} |
float __floatunsisf(unsigned int i) |
{ |
float32 fa; |
fa = uint_to_float32(i); |
return fa.f; |
} |
double __floatunsidf(unsigned int i) |
{ |
float64 da; |
da = uint_to_float64(i); |
return da.d; |
} |
float __floatundisf(unsigned long i) |
{ |
float32 fa; |
fa = ulong_to_float32(i); |
return fa.f; |
} |
double __floatundidf(unsigned long i) |
{ |
float64 da; |
da = ulong_to_float64(i); |
return da.d; |
} |
float __floatuntisf(unsigned long long i) |
{ |
float32 fa; |
fa = ulonglong_to_float32(i); |
return fa.f; |
} |
double __floatuntidf(unsigned long long i) |
{ |
float64 da; |
da = ulonglong_to_float64(i); |
return da.d; |
} |
/* Comparison functions */ |
/* Comparison functions */ |
/* a<b .. -1 |
* a=b .. 0 |
* a>b .. 1 |
* */ |
int __cmpsf2(float a, float b) |
{ |
float32 fa, fb; |
fa.f = a; |
fb.f = b; |
if ( (isFloat32NaN(fa)) || (isFloat32NaN(fb)) ) { |
return 1; /* no special constant for unordered - maybe signaled? */ |
}; |
if (isFloat32eq(fa, fb)) { |
return 0; |
}; |
if (isFloat32lt(fa, fb)) { |
return -1; |
}; |
return 1; |
} |
int __unordsf2(float a, float b) |
{ |
float32 fa, fb; |
fa.f = a; |
fb.f = b; |
return ( (isFloat32NaN(fa)) || (isFloat32NaN(fb)) ); |
} |
/** |
* @return zero, if neither argument is a NaN and are equal |
* */ |
int __eqsf2(float a, float b) |
{ |
float32 fa, fb; |
fa.f = a; |
fb.f = b; |
if ( (isFloat32NaN(fa)) || (isFloat32NaN(fb)) ) { |
/* TODO: sigNaNs*/ |
return 1; |
}; |
return isFloat32eq(fa, fb) - 1; |
} |
/* strange behavior, but it was in gcc documentation */ |
int __nesf2(float a, float b) |
{ |
return __eqsf2(a, b); |
} |
/* return value >= 0 if a>=b and neither is NaN */ |
int __gesf2(float a, float b) |
{ |
float32 fa, fb; |
fa.f = a; |
fb.f = b; |
if ( (isFloat32NaN(fa)) || (isFloat32NaN(fb)) ) { |
/* TODO: sigNaNs*/ |
return -1; |
}; |
if (isFloat32eq(fa, fb)) { |
return 0; |
}; |
if (isFloat32gt(fa, fb)) { |
return 1; |
}; |
return -1; |
} |
/** Return negative value, if a<b and neither is NaN*/ |
int __ltsf2(float a, float b) |
{ |
float32 fa, fb; |
fa.f = a; |
fb.f = b; |
if ( (isFloat32NaN(fa)) || (isFloat32NaN(fb)) ) { |
/* TODO: sigNaNs*/ |
return 1; |
}; |
if (isFloat32lt(fa, fb)) { |
return -1; |
}; |
return 0; |
} |
/* return value <= 0 if a<=b and neither is NaN */ |
int __lesf2(float a, float b) |
{ |
float32 fa, fb; |
fa.f = a; |
fb.f = b; |
if ( (isFloat32NaN(fa)) || (isFloat32NaN(fb)) ) { |
/* TODO: sigNaNs*/ |
return 1; |
}; |
if (isFloat32eq(fa, fb)) { |
return 0; |
}; |
if (isFloat32lt(fa, fb)) { |
return -1; |
}; |
return 1; |
} |
/** Return positive value, if a>b and neither is NaN*/ |
int __gtsf2(float a, float b) |
{ |
float32 fa, fb; |
fa.f = a; |
fb.f = b; |
if ( (isFloat32NaN(fa)) || (isFloat32NaN(fb)) ) { |
/* TODO: sigNaNs*/ |
return -1; |
}; |
if (isFloat32gt(fa, fb)) { |
return 1; |
}; |
return 0; |
} |
/* Other functions */ |
float __powisf2(float a, int b) |
{ |
/* TODO: */ |
float32 fa; |
fa.binary = FLOAT32_NAN; |
return fa.f; |
} |
/** @} |
*/ |
//branches/snapshot/uspace/lib/softfloat/generic/div.c |
---|
0,0 → 1,364 |
/* |
* Copyright (c) 2005 Josef Cejka |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup softfloat |
* @{ |
*/ |
/** @file |
*/ |
#include<sftypes.h> |
#include<add.h> |
#include<div.h> |
#include<comparison.h> |
#include<mul.h> |
#include<common.h> |
float32 divFloat32(float32 a, float32 b) |
{ |
float32 result; |
int32_t aexp, bexp, cexp; |
uint64_t afrac, bfrac, cfrac; |
result.parts.sign = a.parts.sign ^ b.parts.sign; |
if (isFloat32NaN(a)) { |
if (isFloat32SigNaN(a)) { |
/*FIXME: SigNaN*/ |
} |
/*NaN*/ |
return a; |
} |
if (isFloat32NaN(b)) { |
if (isFloat32SigNaN(b)) { |
/*FIXME: SigNaN*/ |
} |
/*NaN*/ |
return b; |
} |
if (isFloat32Infinity(a)) { |
if (isFloat32Infinity(b)) { |
/*FIXME: inf / inf */ |
result.binary = FLOAT32_NAN; |
return result; |
} |
/* inf / num */ |
result.parts.exp = a.parts.exp; |
result.parts.fraction = a.parts.fraction; |
return result; |
} |
if (isFloat32Infinity(b)) { |
if (isFloat32Zero(a)) { |
/* FIXME 0 / inf */ |
result.parts.exp = 0; |
result.parts.fraction = 0; |
return result; |
} |
/* FIXME: num / inf*/ |
result.parts.exp = 0; |
result.parts.fraction = 0; |
return result; |
} |
if (isFloat32Zero(b)) { |
if (isFloat32Zero(a)) { |
/*FIXME: 0 / 0*/ |
result.binary = FLOAT32_NAN; |
return result; |
} |
/* FIXME: division by zero */ |
result.parts.exp = 0; |
result.parts.fraction = 0; |
return result; |
} |
afrac = a.parts.fraction; |
aexp = a.parts.exp; |
bfrac = b.parts.fraction; |
bexp = b.parts.exp; |
/* denormalized numbers */ |
if (aexp == 0) { |
if (afrac == 0) { |
result.parts.exp = 0; |
result.parts.fraction = 0; |
return result; |
} |
/* normalize it*/ |
afrac <<= 1; |
/* afrac is nonzero => it must stop */ |
while (! (afrac & FLOAT32_HIDDEN_BIT_MASK) ) { |
afrac <<= 1; |
aexp--; |
} |
} |
if (bexp == 0) { |
bfrac <<= 1; |
/* bfrac is nonzero => it must stop */ |
while (! (bfrac & FLOAT32_HIDDEN_BIT_MASK) ) { |
bfrac <<= 1; |
bexp--; |
} |
} |
afrac = (afrac | FLOAT32_HIDDEN_BIT_MASK ) << (32 - FLOAT32_FRACTION_SIZE - 1 ); |
bfrac = (bfrac | FLOAT32_HIDDEN_BIT_MASK ) << (32 - FLOAT32_FRACTION_SIZE ); |
if ( bfrac <= (afrac << 1) ) { |
afrac >>= 1; |
aexp++; |
} |
cexp = aexp - bexp + FLOAT32_BIAS - 2; |
cfrac = (afrac << 32) / bfrac; |
if (( cfrac & 0x3F ) == 0) { |
cfrac |= ( bfrac * cfrac != afrac << 32 ); |
} |
/* pack and round */ |
/* find first nonzero digit and shift result and detect possibly underflow */ |
while ((cexp > 0) && (cfrac) && (!(cfrac & (FLOAT32_HIDDEN_BIT_MASK << 7 )))) { |
cexp--; |
cfrac <<= 1; |
/* TODO: fix underflow */ |
}; |
cfrac += (0x1 << 6); /* FIXME: 7 is not sure*/ |
if (cfrac & (FLOAT32_HIDDEN_BIT_MASK << 7)) { |
++cexp; |
cfrac >>= 1; |
} |
/* check overflow */ |
if (cexp >= FLOAT32_MAX_EXPONENT ) { |
/* FIXME: overflow, return infinity */ |
result.parts.exp = FLOAT32_MAX_EXPONENT; |
result.parts.fraction = 0; |
return result; |
} |
if (cexp < 0) { |
/* FIXME: underflow */ |
result.parts.exp = 0; |
if ((cexp + FLOAT32_FRACTION_SIZE) < 0) { |
result.parts.fraction = 0; |
return result; |
} |
cfrac >>= 1; |
while (cexp < 0) { |
cexp ++; |
cfrac >>= 1; |
} |
} else { |
result.parts.exp = (uint32_t)cexp; |
} |
result.parts.fraction = ((cfrac >> 6) & (~FLOAT32_HIDDEN_BIT_MASK)); |
return result; |
} |
float64 divFloat64(float64 a, float64 b) |
{ |
float64 result; |
int64_t aexp, bexp, cexp; |
uint64_t afrac, bfrac, cfrac; |
uint64_t remlo, remhi; |
result.parts.sign = a.parts.sign ^ b.parts.sign; |
if (isFloat64NaN(a)) { |
if (isFloat64SigNaN(b)) { |
/*FIXME: SigNaN*/ |
return b; |
} |
if (isFloat64SigNaN(a)) { |
/*FIXME: SigNaN*/ |
} |
/*NaN*/ |
return a; |
} |
if (isFloat64NaN(b)) { |
if (isFloat64SigNaN(b)) { |
/*FIXME: SigNaN*/ |
} |
/*NaN*/ |
return b; |
} |
if (isFloat64Infinity(a)) { |
if (isFloat64Infinity(b) || isFloat64Zero(b)) { |
/*FIXME: inf / inf */ |
result.binary = FLOAT64_NAN; |
return result; |
} |
/* inf / num */ |
result.parts.exp = a.parts.exp; |
result.parts.fraction = a.parts.fraction; |
return result; |
} |
if (isFloat64Infinity(b)) { |
if (isFloat64Zero(a)) { |
/* FIXME 0 / inf */ |
result.parts.exp = 0; |
result.parts.fraction = 0; |
return result; |
} |
/* FIXME: num / inf*/ |
result.parts.exp = 0; |
result.parts.fraction = 0; |
return result; |
} |
if (isFloat64Zero(b)) { |
if (isFloat64Zero(a)) { |
/*FIXME: 0 / 0*/ |
result.binary = FLOAT64_NAN; |
return result; |
} |
/* FIXME: division by zero */ |
result.parts.exp = 0; |
result.parts.fraction = 0; |
return result; |
} |
afrac = a.parts.fraction; |
aexp = a.parts.exp; |
bfrac = b.parts.fraction; |
bexp = b.parts.exp; |
/* denormalized numbers */ |
if (aexp == 0) { |
if (afrac == 0) { |
result.parts.exp = 0; |
result.parts.fraction = 0; |
return result; |
} |
/* normalize it*/ |
aexp++; |
/* afrac is nonzero => it must stop */ |
while (! (afrac & FLOAT64_HIDDEN_BIT_MASK) ) { |
afrac <<= 1; |
aexp--; |
} |
} |
if (bexp == 0) { |
bexp++; |
/* bfrac is nonzero => it must stop */ |
while (! (bfrac & FLOAT64_HIDDEN_BIT_MASK) ) { |
bfrac <<= 1; |
bexp--; |
} |
} |
afrac = (afrac | FLOAT64_HIDDEN_BIT_MASK ) << (64 - FLOAT64_FRACTION_SIZE - 2 ); |
bfrac = (bfrac | FLOAT64_HIDDEN_BIT_MASK ) << (64 - FLOAT64_FRACTION_SIZE - 1); |
if ( bfrac <= (afrac << 1) ) { |
afrac >>= 1; |
aexp++; |
} |
cexp = aexp - bexp + FLOAT64_BIAS - 2; |
cfrac = divFloat64estim(afrac, bfrac); |
if (( cfrac & 0x1FF ) <= 2) { /*FIXME:?? */ |
mul64integers( bfrac, cfrac, &remlo, &remhi); |
/* (__u128)afrac << 64 - ( ((__u128)remhi<<64) + (__u128)remlo )*/ |
remhi = afrac - remhi - ( remlo > 0); |
remlo = - remlo; |
while ((int64_t) remhi < 0) { |
cfrac--; |
remlo += bfrac; |
remhi += ( remlo < bfrac ); |
} |
cfrac |= ( remlo != 0 ); |
} |
/* round and shift */ |
result = finishFloat64(cexp, cfrac, result.parts.sign); |
return result; |
} |
uint64_t divFloat64estim(uint64_t a, uint64_t b) |
{ |
uint64_t bhi; |
uint64_t remhi, remlo; |
uint64_t result; |
if ( b <= a ) { |
return 0xFFFFFFFFFFFFFFFFull; |
} |
bhi = b >> 32; |
result = ((bhi << 32) <= a) ?( 0xFFFFFFFFull << 32) : ( a / bhi) << 32; |
mul64integers(b, result, &remlo, &remhi); |
remhi = a - remhi - (remlo > 0); |
remlo = - remlo; |
b <<= 32; |
while ( (int64_t) remhi < 0 ) { |
result -= 0x1ll << 32; |
remlo += b; |
remhi += bhi + ( remlo < b ); |
} |
remhi = (remhi << 32) | (remlo >> 32); |
if (( bhi << 32) <= remhi) { |
result |= 0xFFFFFFFF; |
} else { |
result |= remhi / bhi; |
} |
return result; |
} |
/** @} |
*/ |
//branches/snapshot/uspace/lib/softfloat/generic/conversion.c |
---|
0,0 → 1,593 |
/* |
* Copyright (c) 2005 Josef Cejka |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup softfloat |
* @{ |
*/ |
/** @file |
*/ |
#include "sftypes.h" |
#include "conversion.h" |
#include "comparison.h" |
#include "common.h" |
float64 convertFloat32ToFloat64(float32 a) |
{ |
float64 result; |
uint64_t frac; |
result.parts.sign = a.parts.sign; |
result.parts.fraction = a.parts.fraction; |
result.parts.fraction <<= (FLOAT64_FRACTION_SIZE - FLOAT32_FRACTION_SIZE ); |
if ((isFloat32Infinity(a))||(isFloat32NaN(a))) { |
result.parts.exp = 0x7FF; |
/* TODO; check if its correct for SigNaNs*/ |
return result; |
}; |
result.parts.exp = a.parts.exp + ( (int)FLOAT64_BIAS - FLOAT32_BIAS ); |
if (a.parts.exp == 0) { |
/* normalize denormalized numbers */ |
if (result.parts.fraction == 0ll) { /* fix zero */ |
result.parts.exp = 0ll; |
return result; |
} |
frac = result.parts.fraction; |
while (!(frac & (0x10000000000000ll))) { |
frac <<= 1; |
--result.parts.exp; |
}; |
++result.parts.exp; |
result.parts.fraction = frac; |
}; |
return result; |
} |
float32 convertFloat64ToFloat32(float64 a) |
{ |
float32 result; |
int32_t exp; |
uint64_t frac; |
result.parts.sign = a.parts.sign; |
if (isFloat64NaN(a)) { |
result.parts.exp = 0xFF; |
if (isFloat64SigNaN(a)) { |
result.parts.fraction = 0x400000; /* set first bit of fraction nonzero */ |
return result; |
} |
result.parts.fraction = 0x1; /* fraction nonzero but its first bit is zero */ |
return result; |
}; |
if (isFloat64Infinity(a)) { |
result.parts.fraction = 0; |
result.parts.exp = 0xFF; |
return result; |
}; |
exp = (int)a.parts.exp - FLOAT64_BIAS + FLOAT32_BIAS; |
if (exp >= 0xFF) { |
/*FIXME: overflow*/ |
result.parts.fraction = 0; |
result.parts.exp = 0xFF; |
return result; |
} else if (exp <= 0 ) { |
/* underflow or denormalized */ |
result.parts.exp = 0; |
exp *= -1; |
if (exp > FLOAT32_FRACTION_SIZE ) { |
/* FIXME: underflow */ |
result.parts.fraction = 0; |
return result; |
}; |
/* denormalized */ |
frac = a.parts.fraction; |
frac |= 0x10000000000000ll; /* denormalize and set hidden bit */ |
frac >>= (FLOAT64_FRACTION_SIZE - FLOAT32_FRACTION_SIZE + 1); |
while (exp > 0) { |
--exp; |
frac >>= 1; |
}; |
result.parts.fraction = frac; |
return result; |
}; |
result.parts.exp = exp; |
result.parts.fraction = a.parts.fraction >> (FLOAT64_FRACTION_SIZE - FLOAT32_FRACTION_SIZE); |
return result; |
} |
/** Helping procedure for converting float32 to uint32 |
* @param a floating point number in normalized form (no NaNs or Inf are checked ) |
* @return unsigned integer |
*/ |
static uint32_t _float32_to_uint32_helper(float32 a) |
{ |
uint32_t frac; |
if (a.parts.exp < FLOAT32_BIAS) { |
/*TODO: rounding*/ |
return 0; |
} |
frac = a.parts.fraction; |
frac |= FLOAT32_HIDDEN_BIT_MASK; |
/* shift fraction to left so hidden bit will be the most significant bit */ |
frac <<= 32 - FLOAT32_FRACTION_SIZE - 1; |
frac >>= 32 - (a.parts.exp - FLOAT32_BIAS) - 1; |
if ((a.parts.sign == 1) && (frac != 0)) { |
frac = ~frac; |
++frac; |
} |
return frac; |
} |
/* Convert float to unsigned int32 |
* FIXME: Im not sure what to return if overflow/underflow happens |
* - now its the biggest or the smallest int |
*/ |
uint32_t float32_to_uint32(float32 a) |
{ |
if (isFloat32NaN(a)) { |
return MAX_UINT32; |
} |
if (isFloat32Infinity(a) || (a.parts.exp >= (32 + FLOAT32_BIAS))) { |
if (a.parts.sign) { |
return MIN_UINT32; |
} |
return MAX_UINT32; |
} |
return _float32_to_uint32_helper(a); |
} |
/* Convert float to signed int32 |
* FIXME: Im not sure what to return if overflow/underflow happens |
* - now its the biggest or the smallest int |
*/ |
int32_t float32_to_int32(float32 a) |
{ |
if (isFloat32NaN(a)) { |
return MAX_INT32; |
} |
if (isFloat32Infinity(a) || (a.parts.exp >= (32 + FLOAT32_BIAS))) { |
if (a.parts.sign) { |
return MIN_INT32; |
} |
return MAX_INT32; |
} |
return _float32_to_uint32_helper(a); |
} |
/** Helping procedure for converting float64 to uint64 |
* @param a floating point number in normalized form (no NaNs or Inf are checked ) |
* @return unsigned integer |
*/ |
static uint64_t _float64_to_uint64_helper(float64 a) |
{ |
uint64_t frac; |
if (a.parts.exp < FLOAT64_BIAS) { |
/*TODO: rounding*/ |
return 0; |
} |
frac = a.parts.fraction; |
frac |= FLOAT64_HIDDEN_BIT_MASK; |
/* shift fraction to left so hidden bit will be the most significant bit */ |
frac <<= 64 - FLOAT64_FRACTION_SIZE - 1; |
frac >>= 64 - (a.parts.exp - FLOAT64_BIAS) - 1; |
if ((a.parts.sign == 1) && (frac != 0)) { |
frac = ~frac; |
++frac; |
} |
return frac; |
} |
/* Convert float to unsigned int64 |
* FIXME: Im not sure what to return if overflow/underflow happens |
* - now its the biggest or the smallest int |
*/ |
uint64_t float64_to_uint64(float64 a) |
{ |
if (isFloat64NaN(a)) { |
return MAX_UINT64; |
} |
if (isFloat64Infinity(a) || (a.parts.exp >= (64 + FLOAT64_BIAS))) { |
if (a.parts.sign) { |
return MIN_UINT64; |
} |
return MAX_UINT64; |
} |
return _float64_to_uint64_helper(a); |
} |
/* Convert float to signed int64 |
* FIXME: Im not sure what to return if overflow/underflow happens |
* - now its the biggest or the smallest int |
*/ |
int64_t float64_to_int64(float64 a) |
{ |
if (isFloat64NaN(a)) { |
return MAX_INT64; |
} |
if (isFloat64Infinity(a) || (a.parts.exp >= (64 + FLOAT64_BIAS))) { |
if (a.parts.sign) { |
return MIN_INT64; |
} |
return MAX_INT64; |
} |
return _float64_to_uint64_helper(a); |
} |
/** Helping procedure for converting float32 to uint64 |
* @param a floating point number in normalized form (no NaNs or Inf are checked ) |
* @return unsigned integer |
*/ |
static uint64_t _float32_to_uint64_helper(float32 a) |
{ |
uint64_t frac; |
if (a.parts.exp < FLOAT32_BIAS) { |
/*TODO: rounding*/ |
return 0; |
} |
frac = a.parts.fraction; |
frac |= FLOAT32_HIDDEN_BIT_MASK; |
/* shift fraction to left so hidden bit will be the most significant bit */ |
frac <<= 64 - FLOAT32_FRACTION_SIZE - 1; |
frac >>= 64 - (a.parts.exp - FLOAT32_BIAS) - 1; |
if ((a.parts.sign == 1) && (frac != 0)) { |
frac = ~frac; |
++frac; |
} |
return frac; |
} |
/* Convert float to unsigned int64 |
* FIXME: Im not sure what to return if overflow/underflow happens |
* - now its the biggest or the smallest int |
*/ |
uint64_t float32_to_uint64(float32 a) |
{ |
if (isFloat32NaN(a)) { |
return MAX_UINT64; |
} |
if (isFloat32Infinity(a) || (a.parts.exp >= (64 + FLOAT32_BIAS))) { |
if (a.parts.sign) { |
return MIN_UINT64; |
} |
return MAX_UINT64; |
} |
return _float32_to_uint64_helper(a); |
} |
/* Convert float to signed int64 |
* FIXME: Im not sure what to return if overflow/underflow happens |
* - now its the biggest or the smallest int |
*/ |
int64_t float32_to_int64(float32 a) |
{ |
if (isFloat32NaN(a)) { |
return MAX_INT64; |
} |
if (isFloat32Infinity(a) || (a.parts.exp >= (64 + FLOAT32_BIAS))) { |
if (a.parts.sign) { |
return (MIN_INT64); |
} |
return MAX_INT64; |
} |
return _float32_to_uint64_helper(a); |
} |
/* Convert float64 to unsigned int32 |
* FIXME: Im not sure what to return if overflow/underflow happens |
* - now its the biggest or the smallest int |
*/ |
uint32_t float64_to_uint32(float64 a) |
{ |
if (isFloat64NaN(a)) { |
return MAX_UINT32; |
} |
if (isFloat64Infinity(a) || (a.parts.exp >= (32 + FLOAT64_BIAS))) { |
if (a.parts.sign) { |
return MIN_UINT32; |
} |
return MAX_UINT32; |
} |
return (uint32_t)_float64_to_uint64_helper(a); |
} |
/* Convert float64 to signed int32 |
* FIXME: Im not sure what to return if overflow/underflow happens |
* - now its the biggest or the smallest int |
*/ |
int32_t float64_to_int32(float64 a) |
{ |
if (isFloat64NaN(a)) { |
return MAX_INT32; |
} |
if (isFloat64Infinity(a) || (a.parts.exp >= (32 + FLOAT64_BIAS))) { |
if (a.parts.sign) { |
return MIN_INT32; |
} |
return MAX_INT32; |
} |
return (int32_t)_float64_to_uint64_helper(a); |
} |
/** Convert unsigned integer to float32 |
* |
* |
*/ |
float32 uint32_to_float32(uint32_t i) |
{ |
int counter; |
int32_t exp; |
float32 result; |
result.parts.sign = 0; |
result.parts.fraction = 0; |
counter = countZeroes32(i); |
exp = FLOAT32_BIAS + 32 - counter - 1; |
if (counter == 32) { |
result.binary = 0; |
return result; |
} |
if (counter > 0) { |
i <<= counter - 1; |
} else { |
i >>= 1; |
} |
roundFloat32(&exp, &i); |
result.parts.fraction = i >> 7; |
result.parts.exp = exp; |
return result; |
} |
float32 int32_to_float32(int32_t i) |
{ |
float32 result; |
if (i < 0) { |
result = uint32_to_float32((uint32_t)(-i)); |
} else { |
result = uint32_to_float32((uint32_t)i); |
} |
result.parts.sign = i < 0; |
return result; |
} |
float32 uint64_to_float32(uint64_t i) |
{ |
int counter; |
int32_t exp; |
uint32_t j; |
float32 result; |
result.parts.sign = 0; |
result.parts.fraction = 0; |
counter = countZeroes64(i); |
exp = FLOAT32_BIAS + 64 - counter - 1; |
if (counter == 64) { |
result.binary = 0; |
return result; |
} |
/* Shift all to the first 31 bits (31. will be hidden 1)*/ |
if (counter > 33) { |
i <<= counter - 1 - 32; |
} else { |
i >>= 1 + 32 - counter; |
} |
j = (uint32_t)i; |
roundFloat32(&exp, &j); |
result.parts.fraction = j >> 7; |
result.parts.exp = exp; |
return result; |
} |
float32 int64_to_float32(int64_t i) |
{ |
float32 result; |
if (i < 0) { |
result = uint64_to_float32((uint64_t)(-i)); |
} else { |
result = uint64_to_float32((uint64_t)i); |
} |
result.parts.sign = i < 0; |
return result; |
} |
/** Convert unsigned integer to float64 |
* |
* |
*/ |
float64 uint32_to_float64(uint32_t i) |
{ |
int counter; |
int32_t exp; |
float64 result; |
uint64_t frac; |
result.parts.sign = 0; |
result.parts.fraction = 0; |
counter = countZeroes32(i); |
exp = FLOAT64_BIAS + 32 - counter - 1; |
if (counter == 32) { |
result.binary = 0; |
return result; |
} |
frac = i; |
frac <<= counter + 32 - 1; |
roundFloat64(&exp, &frac); |
result.parts.fraction = frac >> 10; |
result.parts.exp = exp; |
return result; |
} |
float64 int32_to_float64(int32_t i) |
{ |
float64 result; |
if (i < 0) { |
result = uint32_to_float64((uint32_t)(-i)); |
} else { |
result = uint32_to_float64((uint32_t)i); |
} |
result.parts.sign = i < 0; |
return result; |
} |
float64 uint64_to_float64(uint64_t i) |
{ |
int counter; |
int32_t exp; |
float64 result; |
result.parts.sign = 0; |
result.parts.fraction = 0; |
counter = countZeroes64(i); |
exp = FLOAT64_BIAS + 64 - counter - 1; |
if (counter == 64) { |
result.binary = 0; |
return result; |
} |
if (counter > 0) { |
i <<= counter - 1; |
} else { |
i >>= 1; |
} |
roundFloat64(&exp, &i); |
result.parts.fraction = i >> 10; |
result.parts.exp = exp; |
return result; |
} |
float64 int64_to_float64(int64_t i) |
{ |
float64 result; |
if (i < 0) { |
result = uint64_to_float64((uint64_t)(-i)); |
} else { |
result = uint64_to_float64((uint64_t)i); |
} |
result.parts.sign = i < 0; |
return result; |
} |
/** @} |
*/ |
//branches/snapshot/uspace/lib/softfloat/generic/add.c |
---|
0,0 → 1,259 |
/* |
* Copyright (c) 2005 Josef Cejka |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup softfloat |
* @{ |
*/ |
/** @file |
*/ |
#include<sftypes.h> |
#include<add.h> |
#include<comparison.h> |
/** Add two Float32 numbers with same signs |
*/ |
float32 addFloat32(float32 a, float32 b) |
{ |
int expdiff; |
uint32_t exp1, exp2,frac1, frac2; |
expdiff = a.parts.exp - b.parts.exp; |
if (expdiff < 0) { |
if (isFloat32NaN(b)) { |
/* TODO: fix SigNaN */ |
if (isFloat32SigNaN(b)) { |
}; |
return b; |
}; |
if (b.parts.exp == FLOAT32_MAX_EXPONENT) { |
return b; |
} |
frac1 = b.parts.fraction; |
exp1 = b.parts.exp; |
frac2 = a.parts.fraction; |
exp2 = a.parts.exp; |
expdiff *= -1; |
} else { |
if ((isFloat32NaN(a)) || (isFloat32NaN(b))) { |
/* TODO: fix SigNaN */ |
if (isFloat32SigNaN(a) || isFloat32SigNaN(b)) { |
}; |
return (isFloat32NaN(a)?a:b); |
}; |
if (a.parts.exp == FLOAT32_MAX_EXPONENT) { |
return a; |
} |
frac1 = a.parts.fraction; |
exp1 = a.parts.exp; |
frac2 = b.parts.fraction; |
exp2 = b.parts.exp; |
}; |
if (exp1 == 0) { |
/* both are denormalized */ |
frac1 += frac2; |
if (frac1 & FLOAT32_HIDDEN_BIT_MASK ) { |
/* result is not denormalized */ |
a.parts.exp = 1; |
}; |
a.parts.fraction = frac1; |
return a; |
}; |
frac1 |= FLOAT32_HIDDEN_BIT_MASK; /* add hidden bit */ |
if (exp2 == 0) { |
/* second operand is denormalized */ |
--expdiff; |
} else { |
/* add hidden bit to second operand */ |
frac2 |= FLOAT32_HIDDEN_BIT_MASK; |
}; |
/* create some space for rounding */ |
frac1 <<= 6; |
frac2 <<= 6; |
if (expdiff < (FLOAT32_FRACTION_SIZE + 2) ) { |
frac2 >>= expdiff; |
frac1 += frac2; |
} else { |
a.parts.exp = exp1; |
a.parts.fraction = (frac1 >> 6) & (~(FLOAT32_HIDDEN_BIT_MASK)); |
return a; |
} |
if (frac1 & (FLOAT32_HIDDEN_BIT_MASK << 7) ) { |
++exp1; |
frac1 >>= 1; |
}; |
/* rounding - if first bit after fraction is set then round up */ |
frac1 += (0x1 << 5); |
if (frac1 & (FLOAT32_HIDDEN_BIT_MASK << 7)) { |
/* rounding overflow */ |
++exp1; |
frac1 >>= 1; |
}; |
if ((exp1 == FLOAT32_MAX_EXPONENT ) || (exp2 > exp1)) { |
/* overflow - set infinity as result */ |
a.parts.exp = FLOAT32_MAX_EXPONENT; |
a.parts.fraction = 0; |
return a; |
} |
a.parts.exp = exp1; |
/*Clear hidden bit and shift */ |
a.parts.fraction = ((frac1 >> 6) & (~FLOAT32_HIDDEN_BIT_MASK)) ; |
return a; |
} |
/** Add two Float64 numbers with same signs |
*/ |
float64 addFloat64(float64 a, float64 b) |
{ |
int expdiff; |
uint32_t exp1, exp2; |
uint64_t frac1, frac2; |
expdiff = ((int )a.parts.exp) - b.parts.exp; |
if (expdiff < 0) { |
if (isFloat64NaN(b)) { |
/* TODO: fix SigNaN */ |
if (isFloat64SigNaN(b)) { |
}; |
return b; |
}; |
/* b is infinity and a not */ |
if (b.parts.exp == FLOAT64_MAX_EXPONENT ) { |
return b; |
} |
frac1 = b.parts.fraction; |
exp1 = b.parts.exp; |
frac2 = a.parts.fraction; |
exp2 = a.parts.exp; |
expdiff *= -1; |
} else { |
if (isFloat64NaN(a)) { |
/* TODO: fix SigNaN */ |
if (isFloat64SigNaN(a) || isFloat64SigNaN(b)) { |
}; |
return a; |
}; |
/* a is infinity and b not */ |
if (a.parts.exp == FLOAT64_MAX_EXPONENT ) { |
return a; |
} |
frac1 = a.parts.fraction; |
exp1 = a.parts.exp; |
frac2 = b.parts.fraction; |
exp2 = b.parts.exp; |
}; |
if (exp1 == 0) { |
/* both are denormalized */ |
frac1 += frac2; |
if (frac1 & FLOAT64_HIDDEN_BIT_MASK) { |
/* result is not denormalized */ |
a.parts.exp = 1; |
}; |
a.parts.fraction = frac1; |
return a; |
}; |
/* add hidden bit - frac1 is sure not denormalized */ |
frac1 |= FLOAT64_HIDDEN_BIT_MASK; |
/* second operand ... */ |
if (exp2 == 0) { |
/* ... is denormalized */ |
--expdiff; |
} else { |
/* is not denormalized */ |
frac2 |= FLOAT64_HIDDEN_BIT_MASK; |
}; |
/* create some space for rounding */ |
frac1 <<= 6; |
frac2 <<= 6; |
if (expdiff < (FLOAT64_FRACTION_SIZE + 2) ) { |
frac2 >>= expdiff; |
frac1 += frac2; |
} else { |
a.parts.exp = exp1; |
a.parts.fraction = (frac1 >> 6) & (~(FLOAT64_HIDDEN_BIT_MASK)); |
return a; |
} |
if (frac1 & (FLOAT64_HIDDEN_BIT_MASK << 7) ) { |
++exp1; |
frac1 >>= 1; |
}; |
/* rounding - if first bit after fraction is set then round up */ |
frac1 += (0x1 << 5); |
if (frac1 & (FLOAT64_HIDDEN_BIT_MASK << 7)) { |
/* rounding overflow */ |
++exp1; |
frac1 >>= 1; |
}; |
if ((exp1 == FLOAT64_MAX_EXPONENT ) || (exp2 > exp1)) { |
/* overflow - set infinity as result */ |
a.parts.exp = FLOAT64_MAX_EXPONENT; |
a.parts.fraction = 0; |
return a; |
} |
a.parts.exp = exp1; |
/*Clear hidden bit and shift */ |
a.parts.fraction = ( (frac1 >> 6 ) & (~FLOAT64_HIDDEN_BIT_MASK)); |
return a; |
} |
/** @} |
*/ |
//branches/snapshot/uspace/lib/softfloat/generic/common.c |
---|
0,0 → 1,215 |
/* |
* Copyright (c) 2005 Josef Cejka |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup softfloat |
* @{ |
*/ |
/** @file |
*/ |
#include<sftypes.h> |
#include<common.h> |
/* Table for fast leading zeroes counting */ |
char zeroTable[256] = { |
8, 7, 7, 6, 6, 6, 6, 4, 4, 4, 4, 4, 4, 4, 4, \ |
3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, \ |
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, \ |
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, \ |
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, \ |
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, \ |
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, \ |
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, \ |
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \ |
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \ |
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \ |
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \ |
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \ |
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \ |
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \ |
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 |
}; |
/** Take fraction shifted by 10 bits to left, round it, normalize it and detect exceptions |
* @param cexp exponent with bias |
* @param cfrac fraction shifted 10 places left with added hidden bit |
* @param sign |
* @return valied float64 |
*/ |
float64 finishFloat64(int32_t cexp, uint64_t cfrac, char sign) |
{ |
float64 result; |
result.parts.sign = sign; |
/* find first nonzero digit and shift result and detect possibly underflow */ |
while ((cexp > 0) && (cfrac) && (!(cfrac & (FLOAT64_HIDDEN_BIT_MASK << (64 - FLOAT64_FRACTION_SIZE - 1 ) )))) { |
cexp--; |
cfrac <<= 1; |
/* TODO: fix underflow */ |
}; |
if ((cexp < 0) || ( cexp == 0 && (!(cfrac & (FLOAT64_HIDDEN_BIT_MASK << (64 - FLOAT64_FRACTION_SIZE - 1)))))) { |
/* FIXME: underflow */ |
result.parts.exp = 0; |
if ((cexp + FLOAT64_FRACTION_SIZE + 1) < 0) { /* +1 is place for rounding */ |
result.parts.fraction = 0; |
return result; |
} |
while (cexp < 0) { |
cexp++; |
cfrac >>= 1; |
} |
cfrac += (0x1 << (64 - FLOAT64_FRACTION_SIZE - 3)); |
if (!(cfrac & (FLOAT64_HIDDEN_BIT_MASK << (64 - FLOAT64_FRACTION_SIZE - 1)))) { |
result.parts.fraction = ((cfrac >>(64 - FLOAT64_FRACTION_SIZE - 2) ) & (~FLOAT64_HIDDEN_BIT_MASK)); |
return result; |
} |
} else { |
cfrac += (0x1 << (64 - FLOAT64_FRACTION_SIZE - 3)); |
} |
++cexp; |
if (cfrac & (FLOAT64_HIDDEN_BIT_MASK << (64 - FLOAT64_FRACTION_SIZE - 1 ))) { |
++cexp; |
cfrac >>= 1; |
} |
/* check overflow */ |
if (cexp >= FLOAT64_MAX_EXPONENT ) { |
/* FIXME: overflow, return infinity */ |
result.parts.exp = FLOAT64_MAX_EXPONENT; |
result.parts.fraction = 0; |
return result; |
} |
result.parts.exp = (uint32_t)cexp; |
result.parts.fraction = ((cfrac >>(64 - FLOAT64_FRACTION_SIZE - 2 ) ) & (~FLOAT64_HIDDEN_BIT_MASK)); |
return result; |
} |
/** Counts leading zeroes in 64bit unsigned integer |
* @param i |
*/ |
int countZeroes64(uint64_t i) |
{ |
int j; |
for (j =0; j < 64; j += 8) { |
if ( i & (0xFFll << (56 - j))) { |
return (j + countZeroes8(i >> (56 - j))); |
} |
} |
return 64; |
} |
/** Counts leading zeroes in 32bit unsigned integer |
* @param i |
*/ |
int countZeroes32(uint32_t i) |
{ |
int j; |
for (j =0; j < 32; j += 8) { |
if ( i & (0xFF << (24 - j))) { |
return (j + countZeroes8(i >> (24 - j))); |
} |
} |
return 32; |
} |
/** Counts leading zeroes in byte |
* @param i |
*/ |
int countZeroes8(uint8_t i) |
{ |
return zeroTable[i]; |
} |
/** Round and normalize number expressed by exponent and fraction with first bit (equal to hidden bit) at 30. bit |
* @param exp exponent |
* @param fraction part with hidden bit shifted to 30. bit |
*/ |
void roundFloat32(int32_t *exp, uint32_t *fraction) |
{ |
/* rounding - if first bit after fraction is set then round up */ |
(*fraction) += (0x1 << 6); |
if ((*fraction) & (FLOAT32_HIDDEN_BIT_MASK << 8)) { |
/* rounding overflow */ |
++(*exp); |
(*fraction) >>= 1; |
}; |
if (((*exp) >= FLOAT32_MAX_EXPONENT ) || ((*exp) < 0)) { |
/* overflow - set infinity as result */ |
(*exp) = FLOAT32_MAX_EXPONENT; |
(*fraction) = 0; |
return; |
} |
return; |
} |
/** Round and normalize number expressed by exponent and fraction with first bit (equal to hidden bit) at 62. bit |
* @param exp exponent |
* @param fraction part with hidden bit shifted to 62. bit |
*/ |
void roundFloat64(int32_t *exp, uint64_t *fraction) |
{ |
/* rounding - if first bit after fraction is set then round up */ |
(*fraction) += (0x1 << 9); |
if ((*fraction) & (FLOAT64_HIDDEN_BIT_MASK << 11)) { |
/* rounding overflow */ |
++(*exp); |
(*fraction) >>= 1; |
}; |
if (((*exp) >= FLOAT64_MAX_EXPONENT ) || ((*exp) < 0)) { |
/* overflow - set infinity as result */ |
(*exp) = FLOAT64_MAX_EXPONENT; |
(*fraction) = 0; |
return; |
} |
return; |
} |
/** @} |
*/ |
//branches/snapshot/uspace/lib/softfloat/generic/sub.c |
---|
0,0 → 1,265 |
/* |
* Copyright (c) 2005 Josef Cejka |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup softfloat |
* @{ |
*/ |
/** @file |
*/ |
#include<sftypes.h> |
#include<sub.h> |
#include<comparison.h> |
/** Subtract two float32 numbers with same signs |
*/ |
float32 subFloat32(float32 a, float32 b) |
{ |
int expdiff; |
uint32_t exp1, exp2, frac1, frac2; |
float32 result; |
result.f = 0; |
expdiff = a.parts.exp - b.parts.exp; |
if ((expdiff < 0 ) || ((expdiff == 0) && (a.parts.fraction < b.parts.fraction))) { |
if (isFloat32NaN(b)) { |
/* TODO: fix SigNaN */ |
if (isFloat32SigNaN(b)) { |
}; |
return b; |
}; |
if (b.parts.exp == FLOAT32_MAX_EXPONENT) { |
b.parts.sign = !b.parts.sign; /* num -(+-inf) = -+inf */ |
return b; |
} |
result.parts.sign = !a.parts.sign; |
frac1 = b.parts.fraction; |
exp1 = b.parts.exp; |
frac2 = a.parts.fraction; |
exp2 = a.parts.exp; |
expdiff *= -1; |
} else { |
if (isFloat32NaN(a)) { |
/* TODO: fix SigNaN */ |
if (isFloat32SigNaN(a) || isFloat32SigNaN(b)) { |
}; |
return a; |
}; |
if (a.parts.exp == FLOAT32_MAX_EXPONENT) { |
if (b.parts.exp == FLOAT32_MAX_EXPONENT) { |
/* inf - inf => nan */ |
/* TODO: fix exception */ |
result.binary = FLOAT32_NAN; |
return result; |
}; |
return a; |
} |
result.parts.sign = a.parts.sign; |
frac1 = a.parts.fraction; |
exp1 = a.parts.exp; |
frac2 = b.parts.fraction; |
exp2 = b.parts.exp; |
}; |
if (exp1 == 0) { |
/* both are denormalized */ |
result.parts.fraction = frac1-frac2; |
if (result.parts.fraction > frac1) { |
/* TODO: underflow exception */ |
return result; |
}; |
result.parts.exp = 0; |
return result; |
}; |
/* add hidden bit */ |
frac1 |= FLOAT32_HIDDEN_BIT_MASK; |
if (exp2 == 0) { |
/* denormalized */ |
--expdiff; |
} else { |
/* normalized */ |
frac2 |= FLOAT32_HIDDEN_BIT_MASK; |
}; |
/* create some space for rounding */ |
frac1 <<= 6; |
frac2 <<= 6; |
if (expdiff > FLOAT32_FRACTION_SIZE + 1) { |
goto done; |
}; |
frac1 = frac1 - (frac2 >> expdiff); |
done: |
/* TODO: find first nonzero digit and shift result and detect possibly underflow */ |
while ((exp1 > 0) && (!(frac1 & (FLOAT32_HIDDEN_BIT_MASK << 6 )))) { |
--exp1; |
frac1 <<= 1; |
/* TODO: fix underflow - frac1 == 0 does not necessary means underflow... */ |
}; |
/* rounding - if first bit after fraction is set then round up */ |
frac1 += 0x20; |
if (frac1 & (FLOAT32_HIDDEN_BIT_MASK << 7)) { |
++exp1; |
frac1 >>= 1; |
}; |
/*Clear hidden bit and shift */ |
result.parts.fraction = ((frac1 >> 6) & (~FLOAT32_HIDDEN_BIT_MASK)); |
result.parts.exp = exp1; |
return result; |
} |
/** Subtract two float64 numbers with same signs |
*/ |
float64 subFloat64(float64 a, float64 b) |
{ |
int expdiff; |
uint32_t exp1, exp2; |
uint64_t frac1, frac2; |
float64 result; |
result.d = 0; |
expdiff = a.parts.exp - b.parts.exp; |
if ((expdiff < 0 ) || ((expdiff == 0) && (a.parts.fraction < b.parts.fraction))) { |
if (isFloat64NaN(b)) { |
/* TODO: fix SigNaN */ |
if (isFloat64SigNaN(b)) { |
}; |
return b; |
}; |
if (b.parts.exp == FLOAT64_MAX_EXPONENT) { |
b.parts.sign = !b.parts.sign; /* num -(+-inf) = -+inf */ |
return b; |
} |
result.parts.sign = !a.parts.sign; |
frac1 = b.parts.fraction; |
exp1 = b.parts.exp; |
frac2 = a.parts.fraction; |
exp2 = a.parts.exp; |
expdiff *= -1; |
} else { |
if (isFloat64NaN(a)) { |
/* TODO: fix SigNaN */ |
if (isFloat64SigNaN(a) || isFloat64SigNaN(b)) { |
}; |
return a; |
}; |
if (a.parts.exp == FLOAT64_MAX_EXPONENT) { |
if (b.parts.exp == FLOAT64_MAX_EXPONENT) { |
/* inf - inf => nan */ |
/* TODO: fix exception */ |
result.binary = FLOAT64_NAN; |
return result; |
}; |
return a; |
} |
result.parts.sign = a.parts.sign; |
frac1 = a.parts.fraction; |
exp1 = a.parts.exp; |
frac2 = b.parts.fraction; |
exp2 = b.parts.exp; |
}; |
if (exp1 == 0) { |
/* both are denormalized */ |
result.parts.fraction = frac1 - frac2; |
if (result.parts.fraction > frac1) { |
/* TODO: underflow exception */ |
return result; |
}; |
result.parts.exp = 0; |
return result; |
}; |
/* add hidden bit */ |
frac1 |= FLOAT64_HIDDEN_BIT_MASK; |
if (exp2 == 0) { |
/* denormalized */ |
--expdiff; |
} else { |
/* normalized */ |
frac2 |= FLOAT64_HIDDEN_BIT_MASK; |
}; |
/* create some space for rounding */ |
frac1 <<= 6; |
frac2 <<= 6; |
if (expdiff > FLOAT64_FRACTION_SIZE + 1) { |
goto done; |
}; |
frac1 = frac1 - (frac2 >> expdiff); |
done: |
/* TODO: find first nonzero digit and shift result and detect possibly underflow */ |
while ((exp1 > 0) && (!(frac1 & (FLOAT64_HIDDEN_BIT_MASK << 6 )))) { |
--exp1; |
frac1 <<= 1; |
/* TODO: fix underflow - frac1 == 0 does not necessary means underflow... */ |
}; |
/* rounding - if first bit after fraction is set then round up */ |
frac1 += 0x20; |
if (frac1 & (FLOAT64_HIDDEN_BIT_MASK << 7)) { |
++exp1; |
frac1 >>= 1; |
}; |
/*Clear hidden bit and shift */ |
result.parts.fraction = ((frac1 >> 6) & (~FLOAT64_HIDDEN_BIT_MASK)); |
result.parts.exp = exp1; |
return result; |
} |
/** @} |
*/ |
//branches/snapshot/uspace/lib/softfloat/generic/comparison.c |
---|
0,0 → 1,129 |
/* |
* Copyright (c) 2005 Josef Cejka |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup softfloat |
* @{ |
*/ |
/** @file |
*/ |
#include<sftypes.h> |
#include<comparison.h> |
inline int isFloat32NaN(float32 f) |
{ /* NaN : exp = 0xff and nonzero fraction */ |
return ((f.parts.exp==0xFF)&&(f.parts.fraction)); |
} |
inline int isFloat64NaN(float64 d) |
{ /* NaN : exp = 0x7ff and nonzero fraction */ |
return ((d.parts.exp==0x7FF)&&(d.parts.fraction)); |
} |
inline int isFloat32SigNaN(float32 f) |
{ /* SigNaN : exp = 0xff fraction = 0xxxxx..x (binary), where at least one x is nonzero */ |
return ((f.parts.exp==0xFF)&&(f.parts.fraction<0x400000)&&(f.parts.fraction)); |
} |
inline int isFloat64SigNaN(float64 d) |
{ /* SigNaN : exp = 0x7ff fraction = 0xxxxx..x (binary), where at least one x is nonzero */ |
return ((d.parts.exp==0x7FF)&&(d.parts.fraction)&&(d.parts.fraction<0x8000000000000ll)); |
} |
inline int isFloat32Infinity(float32 f) |
{ |
return ((f.parts.exp==0xFF)&&(f.parts.fraction==0x0)); |
} |
inline int isFloat64Infinity(float64 d) |
{ |
return ((d.parts.exp==0x7FF)&&(d.parts.fraction==0x0)); |
} |
inline int isFloat32Zero(float32 f) |
{ |
return (((f.binary) & 0x7FFFFFFF) == 0); |
} |
inline int isFloat64Zero(float64 d) |
{ |
return (((d.binary) & 0x7FFFFFFFFFFFFFFFll) == 0); |
} |
/** |
* @return 1, if both floats are equal - but NaNs are not recognized |
*/ |
inline int isFloat32eq(float32 a, float32 b) |
{ |
return ((a.binary==b.binary)||(((a.binary| b.binary)&0x7FFFFFFF)==0)); /* a equals to b or both are zeros (with any sign) */ |
} |
/** |
* @return 1, if a<b - but NaNs are not recognized |
*/ |
inline int isFloat32lt(float32 a, float32 b) |
{ |
if (((a.binary| b.binary)&0x7FFFFFFF)==0) { |
return 0; /* +- zeroes */ |
}; |
if ((a.parts.sign)&&(b.parts.sign)) { |
/*if both are negative, smaller is that with greater binary value*/ |
return (a.binary>b.binary); |
}; |
/* lets negate signs - now will be positive numbers allways bigger than negative (first bit will be set for unsigned integer comparison)*/ |
a.parts.sign=!a.parts.sign; |
b.parts.sign=!b.parts.sign; |
return (a.binary<b.binary); |
} |
/** |
* @return 1, if a>b - but NaNs are not recognized |
*/ |
inline int isFloat32gt(float32 a, float32 b) |
{ |
if (((a.binary| b.binary)&0x7FFFFFFF)==0) { |
return 0; /* zeroes are equal with any sign */ |
}; |
if ((a.parts.sign)&&(b.parts.sign)) { |
/*if both are negative, greater is that with smaller binary value*/ |
return (a.binary<b.binary); |
}; |
/* lets negate signs - now will be positive numbers allways bigger than negative (first bit will be set for unsigned integer comparison)*/ |
a.parts.sign=!a.parts.sign; |
b.parts.sign=!b.parts.sign; |
return (a.binary>b.binary); |
} |
/** @} |
*/ |
//branches/snapshot/uspace/lib/softfloat/generic/mul.c |
---|
0,0 → 1,294 |
/* |
* Copyright (c) 2005 Josef Cejka |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup softfloat |
* @{ |
*/ |
/** @file |
*/ |
#include<sftypes.h> |
#include<mul.h> |
#include<comparison.h> |
#include<common.h> |
/** Multiply two 32 bit float numbers |
* |
*/ |
float32 mulFloat32(float32 a, float32 b) |
{ |
float32 result; |
uint64_t frac1, frac2; |
int32_t exp; |
result.parts.sign = a.parts.sign ^ b.parts.sign; |
if (isFloat32NaN(a) || isFloat32NaN(b) ) { |
/* TODO: fix SigNaNs */ |
if (isFloat32SigNaN(a)) { |
result.parts.fraction = a.parts.fraction; |
result.parts.exp = a.parts.exp; |
return result; |
}; |
if (isFloat32SigNaN(b)) { /* TODO: fix SigNaN */ |
result.parts.fraction = b.parts.fraction; |
result.parts.exp = b.parts.exp; |
return result; |
}; |
/* set NaN as result */ |
result.binary = FLOAT32_NAN; |
return result; |
}; |
if (isFloat32Infinity(a)) { |
if (isFloat32Zero(b)) { |
/* FIXME: zero * infinity */ |
result.binary = FLOAT32_NAN; |
return result; |
} |
result.parts.fraction = a.parts.fraction; |
result.parts.exp = a.parts.exp; |
return result; |
} |
if (isFloat32Infinity(b)) { |
if (isFloat32Zero(a)) { |
/* FIXME: zero * infinity */ |
result.binary = FLOAT32_NAN; |
return result; |
} |
result.parts.fraction = b.parts.fraction; |
result.parts.exp = b.parts.exp; |
return result; |
} |
/* exp is signed so we can easy detect underflow */ |
exp = a.parts.exp + b.parts.exp; |
exp -= FLOAT32_BIAS; |
if (exp >= FLOAT32_MAX_EXPONENT) { |
/* FIXME: overflow */ |
/* set infinity as result */ |
result.binary = FLOAT32_INF; |
result.parts.sign = a.parts.sign ^ b.parts.sign; |
return result; |
}; |
if (exp < 0) { |
/* FIXME: underflow */ |
/* return signed zero */ |
result.parts.fraction = 0x0; |
result.parts.exp = 0x0; |
return result; |
}; |
frac1 = a.parts.fraction; |
if (a.parts.exp > 0) { |
frac1 |= FLOAT32_HIDDEN_BIT_MASK; |
} else { |
++exp; |
}; |
frac2 = b.parts.fraction; |
if (b.parts.exp > 0) { |
frac2 |= FLOAT32_HIDDEN_BIT_MASK; |
} else { |
++exp; |
}; |
frac1 <<= 1; /* one bit space for rounding */ |
frac1 = frac1 * frac2; |
/* round and return */ |
while ((exp < FLOAT32_MAX_EXPONENT) && (frac1 >= ( 1 << (FLOAT32_FRACTION_SIZE + 2)))) { |
/* 23 bits of fraction + one more for hidden bit (all shifted 1 bit left)*/ |
++exp; |
frac1 >>= 1; |
}; |
/* rounding */ |
/* ++frac1; FIXME: not works - without it is ok */ |
frac1 >>= 1; /* shift off rounding space */ |
if ((exp < FLOAT32_MAX_EXPONENT) && (frac1 >= (1 << (FLOAT32_FRACTION_SIZE + 1)))) { |
++exp; |
frac1 >>= 1; |
}; |
if (exp >= FLOAT32_MAX_EXPONENT ) { |
/* TODO: fix overflow */ |
/* return infinity*/ |
result.parts.exp = FLOAT32_MAX_EXPONENT; |
result.parts.fraction = 0x0; |
return result; |
} |
exp -= FLOAT32_FRACTION_SIZE; |
if (exp <= FLOAT32_FRACTION_SIZE) { |
/* denormalized number */ |
frac1 >>= 1; /* denormalize */ |
while ((frac1 > 0) && (exp < 0)) { |
frac1 >>= 1; |
++exp; |
}; |
if (frac1 == 0) { |
/* FIXME : underflow */ |
result.parts.exp = 0; |
result.parts.fraction = 0; |
return result; |
}; |
}; |
result.parts.exp = exp; |
result.parts.fraction = frac1 & ( (1 << FLOAT32_FRACTION_SIZE) - 1); |
return result; |
} |
/** Multiply two 64 bit float numbers |
* |
*/ |
float64 mulFloat64(float64 a, float64 b) |
{ |
float64 result; |
uint64_t frac1, frac2; |
int32_t exp; |
result.parts.sign = a.parts.sign ^ b.parts.sign; |
if (isFloat64NaN(a) || isFloat64NaN(b) ) { |
/* TODO: fix SigNaNs */ |
if (isFloat64SigNaN(a)) { |
result.parts.fraction = a.parts.fraction; |
result.parts.exp = a.parts.exp; |
return result; |
}; |
if (isFloat64SigNaN(b)) { /* TODO: fix SigNaN */ |
result.parts.fraction = b.parts.fraction; |
result.parts.exp = b.parts.exp; |
return result; |
}; |
/* set NaN as result */ |
result.binary = FLOAT64_NAN; |
return result; |
}; |
if (isFloat64Infinity(a)) { |
if (isFloat64Zero(b)) { |
/* FIXME: zero * infinity */ |
result.binary = FLOAT64_NAN; |
return result; |
} |
result.parts.fraction = a.parts.fraction; |
result.parts.exp = a.parts.exp; |
return result; |
} |
if (isFloat64Infinity(b)) { |
if (isFloat64Zero(a)) { |
/* FIXME: zero * infinity */ |
result.binary = FLOAT64_NAN; |
return result; |
} |
result.parts.fraction = b.parts.fraction; |
result.parts.exp = b.parts.exp; |
return result; |
} |
/* exp is signed so we can easy detect underflow */ |
exp = a.parts.exp + b.parts.exp - FLOAT64_BIAS; |
frac1 = a.parts.fraction; |
if (a.parts.exp > 0) { |
frac1 |= FLOAT64_HIDDEN_BIT_MASK; |
} else { |
++exp; |
}; |
frac2 = b.parts.fraction; |
if (b.parts.exp > 0) { |
frac2 |= FLOAT64_HIDDEN_BIT_MASK; |
} else { |
++exp; |
}; |
frac1 <<= (64 - FLOAT64_FRACTION_SIZE - 1); |
frac2 <<= (64 - FLOAT64_FRACTION_SIZE - 2); |
mul64integers(frac1, frac2, &frac1, &frac2); |
frac2 |= (frac1 != 0); |
if (frac2 & (0x1ll << 62)) { |
frac2 <<= 1; |
exp--; |
} |
result = finishFloat64(exp, frac2, result.parts.sign); |
return result; |
} |
/** Multiply two 64 bit numbers and return result in two parts |
* @param a first operand |
* @param b second operand |
* @param lo lower part from result |
* @param hi higher part of result |
*/ |
void mul64integers(uint64_t a,uint64_t b, uint64_t *lo, uint64_t *hi) |
{ |
uint64_t low, high, middle1, middle2; |
uint32_t alow, blow; |
alow = a & 0xFFFFFFFF; |
blow = b & 0xFFFFFFFF; |
a >>= 32; |
b >>= 32; |
low = ((uint64_t)alow) * blow; |
middle1 = a * blow; |
middle2 = alow * b; |
high = a * b; |
middle1 += middle2; |
high += (((uint64_t)(middle1 < middle2)) << 32) + (middle1 >> 32); |
middle1 <<= 32; |
low += middle1; |
high += (low < middle1); |
*lo = low; |
*hi = high; |
return; |
} |
/** @} |
*/ |
//branches/snapshot/uspace/lib/softint/Makefile |
---|
0,0 → 1,74 |
# |
# Copyright (c) 2005 Martin Decky |
# All rights reserved. |
# |
# Redistribution and use in source and binary forms, with or without |
# modification, are permitted provided that the following conditions |
# are met: |
# |
# - Redistributions of source code must retain the above copyright |
# notice, this list of conditions and the following disclaimer. |
# - 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. |
# - The name of the author may not be used to endorse or promote products |
# derived from this software without specific prior written permission. |
# |
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
# |
## Common compiler flags |
# |
LIBC_PREFIX = ../libc |
## Setup toolchain |
# |
include $(LIBC_PREFIX)/Makefile.toolchain |
CFLAGS += -Iinclude |
## Sources |
# |
ARCH_SOURCES = |
GENERIC_SOURCES = \ |
generic/division.c |
GENERIC_OBJECTS := $(addsuffix .o,$(basename $(GENERIC_SOURCES))) |
.PHONY: all clean depend |
all: libsoftint.a |
-include Makefile.depend |
clean: |
-rm -f libsoftint.a Makefile.depend |
find generic/ -name '*.o' -follow -exec rm \{\} \; |
depend: |
-makedepend -f - -- $(DEPEMD_DEFS) $(CFLAGS) -- $(GENERIC_SOURCES) > Makefile.depend 2> /dev/null |
libsoftint.a: depend $(ARCH_OBJECTS) $(GENERIC_OBJECTS) |
$(AR) rc libsoftint.a $(ARCH_OBJECTS) $(GENERIC_OBJECTS) |
%.o: %.S |
$(CC) $(DEFS) $(AFLAGS) $(CFLAGS) -D__ASM__ -c $< -o $@ |
%.o: %.s |
$(AS) $(AFLAGS) $< -o $@ |
%.o: %.c |
$(CC) $(DEFS) $(CFLAGS) -c $< -o $@ |
//branches/snapshot/uspace/lib/softint/include/division.h |
---|
0,0 → 1,70 |
/* |
* Copyright (c) 2006 Josef Cejka |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup softint |
* @{ |
*/ |
/** |
* @file |
*/ |
#ifndef __SOFTINT_DIVISION_H__ |
#define __SOFTINT_DIVISION_H__ |
/* 32bit integer division */ |
int __divsi3(int a, int b); |
/* 64bit integer division */ |
long long __divdi3(long long a, long long b); |
/* 32bit unsigned integer division */ |
unsigned int __udivsi3(unsigned int a, unsigned int b); |
/* 64bit unsigned integer division */ |
unsigned long long __udivdi3(unsigned long long a, unsigned long long b); |
/* 32bit remainder of the signed division */ |
int __modsi3(int a, int b); |
/* 64bit remainder of the signed division */ |
long long __moddi3(long long a, long long b); |
/* 32bit remainder of the unsigned division */ |
unsigned int __umodsi3(unsigned int a, unsigned int b); |
/* 64bit remainder of the unsigned division */ |
unsigned long long __umoddi3(unsigned long long a, unsigned long long b); |
unsigned long long __udivmoddi3(unsigned long long a, unsigned long long b, unsigned long long *c); |
#endif |
/** @} |
*/ |
//branches/snapshot/uspace/lib/softint/generic/division.c |
---|
0,0 → 1,197 |
/* |
* Copyright (c) 2006 Josef Cejka |
* All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
* are met: |
* |
* - Redistributions of source code must retain the above copyright |
* notice, this list of conditions and the following disclaimer. |
* - 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. |
* - The name of the author may not be used to endorse or promote products |
* derived from this software without specific prior written permission. |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. |
*/ |
/** @addtogroup softint |
* @{ |
*/ |
/** |
* @file |
* SW implementation of 32 and 64 bit division and modulo. |
*/ |
#include <division.h> |
#define ABSVAL(x) ( (x) > 0 ? (x) : -(x)) |
#define SGN(x) ( (x) >= 0 ? 1 : 0 ) |
static unsigned int divandmod32(unsigned int a, unsigned int b, unsigned int *remainder) |
{ |
unsigned int result; |
int steps = sizeof(unsigned int) * 8; |
*remainder = 0; |
result = 0; |
if (b == 0) { |
/* FIXME: division by zero */ |
return 0; |
} |
if ( a < b) { |
*remainder = a; |
return 0; |
} |
for ( ; steps > 0; steps--) { |
/* shift one bit to remainder */ |
*remainder = ( (*remainder) << 1) | (( a >> 31) & 0x1); |
result <<= 1; |
if (*remainder >= b) { |
*remainder -= b; |
result |= 0x1; |
} |
a <<= 1; |
} |
return result; |
} |
static unsigned long long divandmod64(unsigned long long a, unsigned long long b, unsigned long long *remainder) |
{ |
unsigned long long result; |
int steps = sizeof(unsigned long long) * 8; |
*remainder = 0; |
result = 0; |
if (b == 0) { |
/* FIXME: division by zero */ |
return 0; |
} |
if ( a < b) { |
*remainder = a; |
return 0; |
} |
for ( ; steps > 0; steps--) { |
/* shift one bit to remainder */ |
*remainder = ( (*remainder) << 1) | ((a >> 63) & 0x1); |
result <<= 1; |
if (*remainder >= b) { |
*remainder -= b; |
result |= 0x1; |
} |
a <<= 1; |
} |
return result; |
} |
/* 32bit integer division */ |
int __divsi3(int a, int b) |
{ |
unsigned int rem; |
int result; |
result = (int)divandmod32(ABSVAL(a), ABSVAL(b), &rem); |
if ( SGN(a) == SGN(b)) return result; |
return -result; |
} |
/* 64bit integer division */ |
long long __divdi3(long long a, long long b) |
{ |
unsigned long long rem; |
long long result; |
result = (long long)divandmod64(ABSVAL(a), ABSVAL(b), &rem); |
if ( SGN(a) == SGN(b)) return result; |
return -result; |
} |
/* 32bit unsigned integer division */ |
unsigned int __udivsi3(unsigned int a, unsigned int b) |
{ |
unsigned int rem; |
return divandmod32(a, b, &rem); |
} |
/* 64bit unsigned integer division */ |
unsigned long long __udivdi3(unsigned long long a, unsigned long long b) |
{ |
unsigned long long rem; |
return divandmod64(a, b, &rem); |
} |
/* 32bit remainder of the signed division */ |
int __modsi3(int a, int b) |
{ |
unsigned int rem; |
divandmod32(a, b, &rem); |
/* if divident is negative, remainder must be too */ |
if (!(SGN(a))) { |
return -((int)rem); |
} |
return (int)rem; |
} |
/* 64bit remainder of the signed division */ |
long long __moddi3(long long a,long long b) |
{ |
unsigned long long rem; |
divandmod64(a, b, &rem); |
/* if divident is negative, remainder must be too */ |
if (!(SGN(a))) { |
return -((long long)rem); |
} |
return (long long)rem; |
} |
/* 32bit remainder of the unsigned division */ |
unsigned int __umodsi3(unsigned int a, unsigned int b) |
{ |
unsigned int rem; |
divandmod32(a, b, &rem); |
return rem; |
} |
/* 64bit remainder of the unsigned division */ |
unsigned long long __umoddi3(unsigned long long a, unsigned long long b) |
{ |
unsigned long long rem; |
divandmod64(a, b, &rem); |
return rem; |
} |
unsigned long long __udivmoddi3(unsigned long long a, unsigned long long b, unsigned long long *c) |
{ |
return divandmod64(a, b, c); |
} |
/** @} |
*/ |
//branches/snapshot/uspace/dist/readme |
---|
0,0 → 1,10 |
Multilingual text test |
---------------------- |
English: Quick brown fox jumps over the lazy dog |
Czech: Příliš žluťoučký kůň úpěl ďábelské ódy |
Greek: á½® ξεῖν’, ἀγγÎλλειν Λακεδαιμονίοις ὅτι τῇδε |
Hebrew: משוואת ברנולי היא משוואה בהידרודינמיקה |
Arabic: التوزيع الجغرافي للحمل العنقودي |
Russian: Леннон познакомился с художницей-авангардисткой |
Armenian: ÕÕ¯Õ½Õ¥Ö Õ°Ö€Õ¡Õ¿Õ¡Ö€Õ¡Õ¯Õ¾Õ¥Õ¬ ÔµÖ€Õ¸Ö‚Õ½Õ¡Õ²Õ¥Õ´Õ« Õ°Õ¡ÕµÕ¯Õ¡Õ¯Õ¡Õ¶ |
//branches/snapshot/uspace/Makefile |
---|
0,0 → 1,89 |
# |
# Copyright (c) 2005 Martin Decky |
# All rights reserved. |
# |
# Redistribution and use in source and binary forms, with or without |
# modification, are permitted provided that the following conditions |
# are met: |
# |
# - Redistributions of source code must retain the above copyright |
# notice, this list of conditions and the following disclaimer. |
# - 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. |
# - The name of the author may not be used to endorse or promote products |
# derived from this software without specific prior written permission. |
# |
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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 configuration |
# |
-include ../Makefile.config |
DIRS = \ |
lib/libc \ |
lib/libfs \ |
lib/libblock \ |
lib/softint \ |
lib/softfloat \ |
srv/bd/ata_bd \ |
srv/bd/file_bd \ |
srv/bd/gxe_bd \ |
srv/bd/rd \ |
srv/ns \ |
srv/loader \ |
srv/fb \ |
srv/kbd \ |
srv/console \ |
srv/fs/fat \ |
srv/fs/tmpfs \ |
srv/fs/devfs \ |
srv/vfs \ |
srv/devmap \ |
app/tetris \ |
app/tester \ |
app/trace \ |
app/klog \ |
app/init \ |
app/getvc \ |
app/bdsh |
ifeq ($(UARCH),amd64) |
DIRS += srv/pci |
endif |
ifeq ($(UARCH),ia32) |
DIRS += srv/pci |
endif |
ifeq ($(UARCH),sparc64) |
DIRS += \ |
srv/cir/fhc \ |
srv/cir/obio |
endif |
BUILDS := $(addsuffix .build,$(DIRS)) |
CLEANS := $(addsuffix .clean,$(DIRS)) |
.PHONY: all $(BUILDS) $(CLEANS) clean |
all: ../Makefile.config ../config.h ../config.defs $(BUILDS) |
clean: $(CLEANS) |
$(CLEANS): |
-$(MAKE) -C $(basename $@) clean |
$(BUILDS): |
$(MAKE) -C $(basename $@) all |
//branches/snapshot/uspace/doc/doxygroups.h |
---|
0,0 → 1,56 |
/* Definitions of modules and its relations for generating Doxygen documentation */ |
/** |
* @defgroup srvcs HelenOS Services |
* @ingroup uspace |
*/ |
/** |
* @defgroup ns Naming Service |
* @ingroup srvcs |
*/ |
/** |
* @defgroup kbd Keyboard Service |
* @ingroup srvcs |
*/ |
/** |
* @defgroup fbs Framebuffer Service |
* @ingroup srvcs |
*/ |
/** |
* @defgroup console Console Service |
* @ingroup srvcs |
*/ |
/** |
* @cond amd64 |
* @defgroup pci PCI Service |
* @ingroup srvcs |
* @endcond |
*/ |
/** |
* @cond ia32 |
* @defgroup pci PCI Service |
* @ingroup srvcs |
* @endcond |
*/ |
/** |
* @defgroup emul Emulation Libraries |
* @ingroup uspace |
*/ |
/** |
* @defgroup sfl Softloat |
* @ingroup emul |
*/ |
/** |
* @defgroup softint Softint |
* @ingroup emul |
*/ |