You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(35) |
Dec
(2) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(37) |
Feb
(10) |
Mar
|
Apr
(2) |
May
(17) |
Jun
(1) |
Jul
(14) |
Aug
(14) |
Sep
(4) |
Oct
|
Nov
(14) |
Dec
(4) |
2005 |
Jan
(6) |
Feb
|
Mar
|
Apr
(6) |
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
(92) |
Dec
(12) |
2006 |
Jan
(3) |
Feb
(4) |
Mar
|
Apr
(5) |
May
(3) |
Jun
(15) |
Jul
(3) |
Aug
(1) |
Sep
(29) |
Oct
(1) |
Nov
(6) |
Dec
(5) |
2007 |
Jan
(2) |
Feb
(2) |
Mar
|
Apr
(3) |
May
(14) |
Jun
(2) |
Jul
(16) |
Aug
(73) |
Sep
(12) |
Oct
(9) |
Nov
(27) |
Dec
(3) |
2008 |
Jan
(4) |
Feb
(4) |
Mar
(3) |
Apr
(8) |
May
(23) |
Jun
(4) |
Jul
(1) |
Aug
(3) |
Sep
(7) |
Oct
(5) |
Nov
(1) |
Dec
(1) |
2009 |
Jan
|
Feb
(10) |
Mar
|
Apr
(4) |
May
(4) |
Jun
(10) |
Jul
|
Aug
(1) |
Sep
|
Oct
(7) |
Nov
|
Dec
(1) |
2010 |
Jan
|
Feb
(1) |
Mar
|
Apr
(6) |
May
|
Jun
(3) |
Jul
(11) |
Aug
(1) |
Sep
|
Oct
(15) |
Nov
(1) |
Dec
(5) |
2011 |
Jan
(4) |
Feb
(1) |
Mar
(6) |
Apr
|
May
(22) |
Jun
|
Jul
(8) |
Aug
(2) |
Sep
|
Oct
|
Nov
|
Dec
(2) |
2012 |
Jan
|
Feb
(10) |
Mar
(1) |
Apr
(6) |
May
(27) |
Jun
(48) |
Jul
(30) |
Aug
(4) |
Sep
|
Oct
(3) |
Nov
(1) |
Dec
(11) |
2013 |
Jan
(4) |
Feb
(7) |
Mar
(6) |
Apr
(18) |
May
(28) |
Jun
(20) |
Jul
|
Aug
(4) |
Sep
(1) |
Oct
(1) |
Nov
(2) |
Dec
(7) |
2014 |
Jan
(3) |
Feb
(2) |
Mar
(4) |
Apr
(9) |
May
(11) |
Jun
(10) |
Jul
|
Aug
(18) |
Sep
(12) |
Oct
(17) |
Nov
(10) |
Dec
(16) |
2015 |
Jan
(5) |
Feb
(1) |
Mar
(5) |
Apr
(4) |
May
(28) |
Jun
(2) |
Jul
|
Aug
|
Sep
(6) |
Oct
|
Nov
(2) |
Dec
(1) |
2016 |
Jan
(14) |
Feb
|
Mar
(3) |
Apr
|
May
|
Jun
(3) |
Jul
(4) |
Aug
(4) |
Sep
(1) |
Oct
(1) |
Nov
|
Dec
(1) |
2017 |
Jan
(11) |
Feb
|
Mar
(21) |
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
2018 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
(2) |
Sep
(4) |
Oct
(4) |
Nov
|
Dec
(1) |
2019 |
Jan
(1) |
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
(13) |
Sep
(4) |
Oct
|
Nov
|
Dec
|
2020 |
Jan
(10) |
Feb
(9) |
Mar
(5) |
Apr
(4) |
May
(3) |
Jun
(18) |
Jul
(4) |
Aug
(2) |
Sep
(20) |
Oct
(2) |
Nov
|
Dec
|
2021 |
Jan
|
Feb
|
Mar
|
Apr
(2) |
May
(1) |
Jun
(2) |
Jul
(1) |
Aug
(2) |
Sep
|
Oct
|
Nov
|
Dec
(2) |
2022 |
Jan
(1) |
Feb
(2) |
Mar
(2) |
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
(5) |
Sep
|
Oct
(1) |
Nov
|
Dec
(1) |
2023 |
Jan
(10) |
Feb
(7) |
Mar
(29) |
Apr
(31) |
May
(29) |
Jun
(34) |
Jul
(3) |
Aug
(24) |
Sep
(22) |
Oct
(10) |
Nov
(38) |
Dec
(27) |
2024 |
Jan
(15) |
Feb
(8) |
Mar
(4) |
Apr
(20) |
May
(33) |
Jun
(18) |
Jul
(15) |
Aug
(23) |
Sep
(26) |
Oct
(32) |
Nov
(6) |
Dec
(4) |
2025 |
Jan
(7) |
Feb
(1) |
Mar
(1) |
Apr
(4) |
May
(46) |
Jun
(19) |
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <ljs...@us...> - 2010-07-18 03:51:01
|
Revision: 667 http://cadcdev.svn.sourceforge.net/cadcdev/?rev=667&view=rev Author: ljsebald Date: 2010-07-18 03:50:55 +0000 (Sun, 18 Jul 2010) Log Message: ----------- Add Doxygen comments to the Dreameye driver. Modified Paths: -------------- kos/kernel/arch/dreamcast/include/dc/maple/dreameye.h Modified: kos/kernel/arch/dreamcast/include/dc/maple/dreameye.h =================================================================== --- kos/kernel/arch/dreamcast/include/dc/maple/dreameye.h 2010-07-17 21:48:20 UTC (rev 666) +++ kos/kernel/arch/dreamcast/include/dc/maple/dreameye.h 2010-07-18 03:50:55 UTC (rev 667) @@ -1,10 +1,21 @@ /* KallistiOS ##version## dc/maple/dreameye.h - Copyright (C) 2005, 2009 Lawrence Sebald + Copyright (C) 2005, 2009, 2010 Lawrence Sebald */ +/** \file dc/maple/dreameye.h + \brief Definitions using the Dreameye Camera device. + + This file contains the definitions needed to access the Maple Camera type + device (aka, the Dreameye). Currently, this driver allows you to download + the still pictures that are saved on the camera and delete them. It does not + allow you to use the camera for video input currently. + + \author Lawrence Sebald +*/ + #ifndef __DC_MAPLE_DREAMEYE_H #define __DC_MAPLE_DREAMEYE_H @@ -13,58 +24,139 @@ #include <arch/types.h> -/* Dreameye Status structure. Everything in here should be considered to be - read-only from user programs. Note that most of this is used for keeping - track of what's going on during an image transfer. */ +/** \brief Dreameye status structure. + + This structure contains information about the status of the Camera device + and can be fetched with maple_dev_status(). You should not change any of + this information, it should all be considered read-only. Most of the fields + in here are related to image transfers, and messing with them during a + transfer could screw things up. + + \headerfile dc/maple/dreameye.h +*/ typedef struct dreameye_state { + /** \brief The number of images on the device. */ int image_count; + + /** \brief Is the image_count field valid? */ int image_count_valid; + + /** \brief The number of transfer operations required for the selected + image. */ int transfer_count; + + /** \brief Is an image transferring now? */ int img_transferring; + + /** \brief Storage for image data. */ uint8 *img_buf; + + /** \brief The size of the image in bytes. */ int img_size; + + /** \brief The image number currently being transferred. */ uint8 img_number; } dreameye_state_t; -/* Attributes that can be obtained with the Get Condition command. */ +/** \brief Get the number of images on the device. + + This constant is used with the MAPLE_COMMAND_GETCOND command to fetch the + number of images on the device. +*/ #define DREAMEYE_GETCOND_NUM_IMAGES 0x81 + +/** \brief Get the number of transfers to copy an image. + + This constant is used with the MAPLE_COMMAND_GETCOND command to fetch the + number of times a transfer command must be sent to get the image specified. +*/ #define DREAMEYE_GETCOND_TRANSFER_COUNT 0x83 -/* Subcommands that are used with Camera Control command. */ +/** \brief Get an image from the device. + + This subcommand is used with the MAPLE_COMMAND_CAMCONTROL command to fetch + part of image data from the specified image. +*/ #define DREAMEYE_SUBCOMMAND_IMAGEREQ 0x04 + +/** \brief Erase an image from the device. + + This subcommand is used with the MAPLE_COMMAND_CAMCONTROL command to remove + an image from the device. +*/ #define DREAMEYE_SUBCOMMAND_ERASE 0x05 + +/** \brief Error return command. + + This subcommand is used by the dreameye with the MAPLE_COMMAND_CAMCONTROL + command to indicate an error occurred in a subcommand. +*/ #define DREAMEYE_SUBCOMMAND_ERROR 0xFF -/* Used with the image request subcommand. */ +/** \brief Continue transferring an image. */ #define DREAMEYE_IMAGEREQ_CONTINUE 0x00 + +/** \brief Start transferring an image from its start. */ #define DREAMEYE_IMAGEREQ_START 0x40 -/* Grab the current number of saved images on the Dreameye. This command can be - sent to any of the sub-devices. Set block to 1 in order to wait for a - response from the Dreameye. When a response arrives, the state image_count - will be set and image_count_valid will be set to 1. The return value from - this function IS NOT the number of images. Returns MAPLE_EOK on success. */ +/** \brief Get the number of images on the Dreameye. + + This function fetches the number of saved images on the specified Dreameye + device. It can be sent to any of the subdevices of the MAPLE_FUNC_CONTROLLER + root device of the Dreameye. When the response comes from the device, the + image_count field of the dreameye_state_t for the specified device will have + the number of images on the device, and image_count_valid will be set to 1. + + \param dev The device to query. + \param block Set to 1 to wait for the Dreameye to respond. + \retval MAPLE_EOK On success. + \retval MAPLE_ETIMEOUT The command timed out while blocking. + \retval MAPLE_EAGAIN Could not send the command to the device, try again. +*/ int dreameye_get_image_count(maple_device_t *dev, int block); -/* Grab a specified image from the Dreameye. This command can take some time, - and (for the time being, anyway) will block. You must send this command to - the first sub-device. You are responsible for freeing the buffer after the - command has completed if you recieve a MAPLE_EOK response. */ +/** \brief Transfer an image from the Dreameye. + + This function fetches a single image from the specified Dreameye device. + This function will block, and can take a little while to execute. You must + use the first subdevice of the MAPLE_FUNC_CONTROLLER root device of the + Dreameye as the dev parameter. + + \param dev The device to get an image from. + \param image The image number to download. + \param data A pointer to a buffer to store things in. This + will be allocated by the function and you are + responsible for freeing the data when you are done. + \param img_sz A pointer to storage for the size of the image, in + bytes. + \retval MAPLE_EOK On success. + \retval MAPLE_EFAIL On error. +*/ int dreameye_get_image(maple_device_t *dev, uint8 image, uint8 **data, int *img_sz); -/* Erase an image from the Dreameye. This command can be sent to any of the - sub-devices. Set block to 1 in order to wait for a response from the - Dreameye. Pass an image of 0xFF to erase all images from the Dreameye. - Returns MAPLE_EOK on success, MAPLE_EINVALID if an invalid image number is - passed in. */ +/** \brief Erase an image from the Dreameye. + + This function erases the specified image from the Dreameye device. This + command can be sent to any of the subdevices of the MAPLE_FUNC_CONTROLLER + root device of the Dreameye. + + \param dev The device to erase from. + \param image The image number to erase (0xFF to erase all). + \param block Set to 1 to wait for the Dreameye to respond. + \retval MAPLE_EOK On success. + \retval MAPLE_EAGAIN Couldn't send the command, try again. + \retval MAPLE_ETIMEOUT Timeout on blocking. + \retval MAPLE_EINVALID Invalid image number specified. +*/ int dreameye_erase_image(maple_device_t *dev, uint8 image, int block); +/* \cond */ /* Init / Shutdown */ int dreameye_init(); void dreameye_shutdown(); +/* \endcond */ __END_DECLS #endif /* __DC_MAPLE_DREAMEYE_H */ - This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ljs...@us...> - 2010-07-17 21:48:26
|
Revision: 666 http://cadcdev.svn.sourceforge.net/cadcdev/?rev=666&view=rev Author: ljsebald Date: 2010-07-17 21:48:20 +0000 (Sat, 17 Jul 2010) Log Message: ----------- Adding Doxygen comments to sys/socket.h. Modified Paths: -------------- kos/include/sys/socket.h Modified: kos/include/sys/socket.h =================================================================== --- kos/include/sys/socket.h 2010-06-16 02:29:07 UTC (rev 665) +++ kos/include/sys/socket.h 2010-07-17 21:48:20 UTC (rev 666) @@ -1,10 +1,23 @@ /* KallistiOS ##version## sys/socket.h - Copyright (C)2006 Lawrence Sebald + Copyright (C)2006, 2010 Lawrence Sebald */ +/** \file sys/socket.h + \brief Main sockets header. + + This file contains the standard definitions (as directed by the POSIX 2008 + standard) for socket-related functionality in the AF_INET address family. + This does not include anything related to AF_INET6 (as IPv6 is not currently + implemented in KOS) nor UNIX domain sockets, and is not guaranteed to have + everything that one might have in a fully-standard compliant implementation + of the POSIX standard. + + \author Lawrence Sebald +*/ + #ifndef __SYS_SOCKET_H #define __SYS_SOCKET_H @@ -13,39 +26,195 @@ __BEGIN_DECLS +/** \brief Socket length type. */ typedef __uint32_t socklen_t; +/** \brief Socket address family type. */ typedef __uint8_t sa_family_t; +/** \brief Socket address structure. + \headerfile sys/socket.h +*/ struct sockaddr { + /** \brief Address family. */ sa_family_t sa_family; + /** \brief Address data. */ char sa_data[]; }; -/* Socket types, currently only SOCK_DGRAM is available */ +/** \brief Datagram socket type. + + This socket type specifies that the socket in question transmits datagrams + that may or may not be reliably transmitted. With IPv4, this implies using + UDP as the underlying protocol. +*/ #define SOCK_DGRAM 1 -/* Socket address families. Currently only AF_INET is available */ +/** \brief Internet domain sockets for use with IPv4 addresses. */ #define AF_INET 1 +/** \brief Protocol family for Internet domain sockets. */ #define PF_INET AF_INET -/* Socket shutdown macros. */ +/** \brief Disable furhter receive operations. */ #define SHUT_RD 0x00000001 + +/** \brief Disable further send operations. */ #define SHUT_WR 0x00000002 + +/** \brief Disable further send and receive operations. */ #define SHUT_RDWR (SHUT_RD | SHUT_WR) +/** \brief Accept a new connection on a socket. + + This function extracts the first connection on the queue of connections of + the specified socket, creating a new socket with the same protocol and + address family as that socket for communication with the extracted + connection. + + \param socket A socket created with socket() that has been bound to an + address with bind() and is listening for connections + after a call to listen(). + \param address A pointer to a sockaddr structure where the address of + the connecting socket will be returned (can be NULL). + \param address_len A pointer to a socklen_t which specifies the amount of + space in address on input, and the amount used of the + space on output. + \return On success, the non-negative file descriptor of the + new connection, otherwise -1 and errno will be set to + the appropriate error value. +*/ int accept(int socket, struct sockaddr *address, socklen_t *address_len); + +/** \brief Bind a name to a socket. + + This function assigns the socket to a unique name (address). + + \param socket A socket that is to be bound. + \param address A pointer to a sockaddr structure where the name to be + assigned to the socket resides. + \param address_len The length of the address structure. + \retval 0 On success. + \retval -1 On error, sets errno as appropriate. +*/ int bind(int socket, const struct sockaddr *address, socklen_t address_len); + +/** \brief Connect a socket. + + This function attempts to make a connection to a resource on a connection- + mode socket, or sets/resets the peer address on a connectionless one. + + \param socket A socket that is to be connected. + \param address A pointer to a sockaddr structure where the name of the + peer resides. + \param address_len The length of the address structure. + \retval 0 On success. + \retval -1 On error, sets errno as appropriate. +*/ int connect(int socket, const struct sockaddr *address, socklen_t address_len); + +/** \brief Listen for socket connections and set the queue length. + + This function marks a connection-mode socket for incoming connections. + + \param socket A connection-mode socket to listen on. + \param backlog The number of queue entries. + \retval 0 On success. + \retval -1 On error, sets errno as appropriate. +*/ int listen(int socket, int backlog); + +/** \brief Receive a message on a connected socket. + + This function receives messages from the peer on a connected socket. + + \param socket The socket to receive on. + \param buffer A pointer to a buffer to store the message in. + \param length The length of the buffer. + \param flags The type of message reception. Set to 0 for now. + \return On success, the length of the message in bytes. If no + messages are available, and the socket has been shut + down, 0. On error, -1, and sets errno as appropriate. +*/ ssize_t recv(int socket, void *buffer, size_t length, int flags); + +/** \brief Receive a message on a socket. + + This function receives messages from a peer on a (usually connectionless) + socket. + + \param socket The socket to receive on. + \param buffer A pointer to a buffer to store the message in. + \param length The length of the buffer. + \param flags The type of message reception. Set to 0 for now. + \param address A pointer to a sockaddr structure to store the peer's + name in. + \param address_len A pointer to the length of the address structure on + input, the number of bytes used on output. + \return On success, the length of the message in bytes. If no + messages are available, and the socket has been shut + down, 0. On error, -1, and sets errno as appropriate. +*/ ssize_t recvfrom(int socket, void *buffer, size_t length, int flags, struct sockaddr *address, socklen_t *address_len); + +/** \brief Send a message on a connected socket. + + This function sends messages to the peer on a connected socket. + + \param socket The socket to send on. + \param buffer A pointer to a buffer with the message to send. + \param length The length of the message. + \param flags The type of message transmission. Set to 0 for now. + \return On success, the number of bytes sent. On error, -1, + and sets errno as appropriate. +*/ ssize_t send(int socket, const void *message, size_t length, int flags); + +/** \brief Send a message on a socket. + + This function sends messages to the peer on a (usually connectionless) + socket. If used on a connection-mode socket, this function may change the + peer that the socket is connected to, or it may simply return error. + + \param socket The socket to send on. + \param buffer A pointer to a buffer with the message to send. + \param length The length of the message. + \param flags The type of message transmission. Set to 0 for now. + \param dest_addr A pointer to a sockaddr structure with the peer's name. + \param dest_len The length of dest_addr, in bytes. + \return On success, the number of bytes sent. On error, -1, + and sets errno as appropriate. +*/ ssize_t sendto(int socket, const void *message, size_t length, int flags, const struct sockaddr *dest_addr, socklen_t dest_len); + +/** \brief Shutdown socket send and receive operations. + + This function closes a specific socket for the set of specified operations. + + \param socket The socket to shutdown. + \param how The type of shutdown. + \retval 0 On success. + \retval -1 On error, sets errno as appropriate. + \see SHUT_RD + \see SHUT_WR + \see SHUT_RDWR +*/ int shutdown(int socket, int how); + +/** \brief Create an endpoint for communications. + + This function creates an unbound socket for communications with the + specified parameters. + + \param domain The domain to create the socket in (i.e, AF_INET). + \param type The type of socket to be created (i.e, SOCK_DGRAM). + \param protocol The protocol to use with the socket. May be 0 to allow + a default to be used. + \return A non-negative file descriptor on success. -1 on error, + and sets errno as appropriate. +*/ int socket(int domain, int type, int protocol); __END_DECLS This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ljs...@us...> - 2010-06-16 02:29:13
|
Revision: 665 http://cadcdev.svn.sourceforge.net/cadcdev/?rev=665&view=rev Author: ljsebald Date: 2010-06-16 02:29:07 +0000 (Wed, 16 Jun 2010) Log Message: ----------- Warning cleanup based on GCC 4.4.4. Modified Paths: -------------- kos/environ_dreamcast.sh kos/kernel/arch/dreamcast/fs/fs_iso9660.c kos/kernel/arch/dreamcast/sound/snd_sfxmgr.c kos/kernel/libc/koslib/malloc.c kos/kernel/net/net_icmp.c Modified: kos/environ_dreamcast.sh =================================================================== --- kos/environ_dreamcast.sh 2010-06-16 01:37:01 UTC (rev 664) +++ kos/environ_dreamcast.sh 2010-06-16 02:29:07 UTC (rev 665) @@ -12,6 +12,6 @@ export DC_ARM_AR="${DC_ARM_BASE}/bin/${DC_ARM_PREFIX}-ar" export DC_ARM_OBJCOPY="${DC_ARM_BASE}/bin/${DC_ARM_PREFIX}-objcopy" export DC_ARM_LD="${DC_ARM_BASE}/bin/${DC_ARM_PREFIX}-ld" - export DC_ARM_CFLAGS="-mcpu=arm7 -Wall -O2" + export DC_ARM_CFLAGS="-mcpu=arm7 -Wall -O2 -fno-strict-aliasing" export DC_ARM_AFLAGS="-mcpu=arm7" fi Modified: kos/kernel/arch/dreamcast/fs/fs_iso9660.c =================================================================== --- kos/kernel/arch/dreamcast/fs/fs_iso9660.c 2010-06-16 01:37:01 UTC (rev 664) +++ kos/kernel/arch/dreamcast/fs/fs_iso9660.c 2010-06-16 02:29:07 UTC (rev 665) @@ -362,7 +362,7 @@ break; /* Otherwise, compare the chars normally */ - if (tolower(isofn[i]) != tolower(normalfn[i])) + if (tolower((int)isofn[i]) != tolower((int)normalfn[i])) return -1; } @@ -717,7 +717,7 @@ char * fn = fnin; while (*fn && *fn != ';') { - *fn = tolower(*fn); + *fn = tolower((int)*fn); fn++; } *fn = 0; Modified: kos/kernel/arch/dreamcast/sound/snd_sfxmgr.c =================================================================== --- kos/kernel/arch/dreamcast/sound/snd_sfxmgr.c 2010-06-16 01:37:01 UTC (rev 664) +++ kos/kernel/arch/dreamcast/sound/snd_sfxmgr.c 2010-06-16 02:29:07 UTC (rev 665) @@ -110,7 +110,6 @@ return 0; } - /* Read WAV header info */ fs_seek(fd, 0x14, SEEK_SET); fs_read(fd, &fmt, 2); @@ -123,8 +122,8 @@ fs_seek(fd, 0x28, SEEK_SET); fs_read(fd, &len, 4); - printf("WAVE file is %s, %dHZ, %d bits/sample, %d bytes total, format %d\n", - chn==1 ? "mono" : "stereo", hz, bitsize, len, fmt); + dbglog(DBG_DEBUG, "WAVE file is %s, %luHZ, %d bits/sample, %lu bytes total," + " format %d\n", chn==1 ? "mono" : "stereo", hz, bitsize, len, fmt); /* Try to mmap it and if that works, no need to copy it again */ ownmem = 0; @@ -228,8 +227,6 @@ size = t->len; if (size >= 65535) size = 65534; - /* printf("sndstream: playing effect %p on chan %d, loc %x/%x, rate %d, size %d, vol %d, pan %d\r\n", - idx, sfx_lastchan, t->locl, t->locr, t->rate, size, vol, pan); */ if (!t->stereo) { cmd->cmd = AICA_CMD_CHAN; cmd->timestamp = 0; Modified: kos/kernel/libc/koslib/malloc.c =================================================================== --- kos/kernel/libc/koslib/malloc.c 2010-06-16 01:37:01 UTC (rev 664) +++ kos/kernel/libc/koslib/malloc.c 2010-06-16 02:29:07 UTC (rev 665) @@ -1575,9 +1575,15 @@ static void fREe(Void_t*); static Void_t* rEALLOc(Void_t*, size_t); static Void_t* mEMALIGn(size_t, size_t); +#if 0 static Void_t* vALLOc(size_t); +#endif +#ifndef KM_DBG static Void_t* cALLOc(size_t, size_t); +#endif +#if 0 static int mTRIm(size_t); +#endif static size_t mUSABLe(Void_t*); static void mSTATs(); static int mALLOPt(int, int); @@ -1763,7 +1769,7 @@ printf("Thread %d/%08lx freeing block @ %08lx\n", thd_current->tid, rv, (uint32)m); #endif - printf(" pre-magic is wrong at index %d (%08lx)\n", + printf(" pre-magic is wrong at index %lu (%08lx)\n", i, nt[i]); dmg = 1; } @@ -1776,7 +1782,7 @@ printf("Thread %d/%08lx freeing block @ %08lx\n", thd_current->tid, rv, (uint32)m); #endif - printf(" post-magic is wrong at index %d (%08lx)\n", + printf(" post-magic is wrong at index %lu (%08lx)\n", i, nt[i]); dmg = 1; } @@ -1798,7 +1804,7 @@ int mem_check_block(Void_t* m) { #ifdef KM_DBG - uint32 rv = arch_get_ret_addr(), rs, *nt, i; + uint32 rv = arch_get_ret_addr(), *nt, i; memctl_t * ctl; int dmg = 0; int retv = 0; @@ -1815,7 +1821,7 @@ if (nt[i] != PRE_MAGIC) { printf("Thread %d/%08lx checking block @ %08lx\n", thd_current->tid, rv, (uint32)m); - printf(" pre-magic is wrong at index %d (%08lx)\n", + printf(" pre-magic is wrong at index %lu (%08lx)\n", i, nt[i]); dmg = 1; retv = -2; @@ -1827,7 +1833,7 @@ if (nt[i] != POST_MAGIC) { printf("Thread %d/%08lx checking block @ %08lx\n", thd_current->tid, rv, (uint32)m); - printf(" post-magic is wrong at index %d (%08lx)\n", + printf(" post-magic is wrong at index %lu (%08lx)\n", i, nt[i]); dmg = 1; retv = -3; @@ -1848,7 +1854,9 @@ int mem_check_all() { #ifdef KM_DBG int retv = 0, rvp; +#ifdef KM_DBG_VERBOSE uint32 rv = arch_get_ret_addr(); +#endif memctl_t * ctl; if (MALLOC_PREACTION != 0) { @@ -1912,7 +1920,7 @@ printf("Thread %d/%08lx reallocing block @ %08lx to %d bytes\n", thd_current->tid, rv, (uint32)m, bytes); #endif - printf(" pre-magic is wrong at index %d (%08lx)\n", + printf(" pre-magic is wrong at index %lu (%08lx)\n", i, nt[i]); dmg = 1; } @@ -1925,7 +1933,7 @@ printf("Thread %d/%08lx reallocing block @ %08lx to %d bytes\n", thd_current->tid, rv, (uint32)m, bytes); #endif - printf(" post-magic is wrong at index %d (%08lx)\n", + printf(" post-magic is wrong at index %lu (%08lx)\n", i, nt[i]); dmg = 1; } @@ -2172,14 +2180,14 @@ if (!LIST_EMPTY(&block_list)) { printf("KM_DBG: Still-allocated memory blocks:\n"); LIST_FOREACH(c, &block_list, list) { - printf(" INUSE %08lx: size %d, thread %d, addr %08lx, type %s\n", + printf(" INUSE %08lx: size %lu, thread %d, addr %08lx, type %s\n", (uint32)c + BUFFER_SIZE, c->size, c->thread, c->addr, c->type); nt = (uint32 *)c; for (i=sizeof(memctl_t)/4; i<BUFFER_SIZE/4; i++) { if (nt[i] != PRE_MAGIC) { - printf(" pre-magic is wrong at index %d (%08lx)\n", + printf(" pre-magic is wrong at index %lu (%08lx)\n", i, nt[i]); } } @@ -2187,7 +2195,7 @@ nt = c->post; for (i=0; i<BUFFER_SIZE/4; i++) { if (nt[i] != POST_MAGIC) { - printf(" post-magic is wrong at index %d (%08lx)\n", + printf(" post-magic is wrong at index %lu (%08lx)\n", i, nt[i]); } } @@ -2201,14 +2209,6 @@ } } -#ifndef KM_DBG -/* Shut up, GCC */ -void foo() { - vALLOc(0); - mTRIm(0); -} -#endif - /*** End KOS Code ***/ /******************************************************************************************************/ /*** Begin Code Removed for KOS ***/ @@ -4916,6 +4916,7 @@ ------------------------------ calloc ------------------------------ */ +#ifndef KM_DBG #if __STD_C Void_t* cALLOc(size_t n_elements, size_t elem_size) #else @@ -4980,8 +4981,11 @@ } return mem; } +#endif +/*** Begin Code Removed for KOS ***/ +#if 0 /* ------------------------------ valloc ------------------------------ */ @@ -5018,6 +5022,8 @@ return 0; #endif } +#endif +/*** End Code Removed for KOS ***/ /* Modified: kos/kernel/net/net_icmp.c =================================================================== --- kos/kernel/net/net_icmp.c 2010-06-16 01:37:01 UTC (rev 664) +++ kos/kernel/net/net_icmp.c 2010-06-16 02:29:07 UTC (rev 665) @@ -54,7 +54,7 @@ uint8 ttl, const uint8* data, int data_sz) { printf("%d bytes from %d.%d.%d.%d: icmp_seq=%d ttl=%d time=%.3f ms\n", data_sz, ip[0], ip[1], ip[2], ip[3], seq, ttl, - delta_us / 1000.0f); + delta_us / 1000.0); } /* The default echo (ping) callback */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ljs...@us...> - 2010-06-16 01:37:08
|
Revision: 664 http://cadcdev.svn.sourceforge.net/cadcdev/?rev=664&view=rev Author: ljsebald Date: 2010-06-16 01:37:01 +0000 (Wed, 16 Jun 2010) Log Message: ----------- Remove the lock_common.h file, since its effectively the same thing as <sys/lock.h> anyway. Modified Paths: -------------- kos/kernel/libc/newlib/lock_common.c kos/kernel/libc/newlib/newlib_env_lock.c Removed Paths: ------------- kos/kernel/libc/newlib/lock_common.h Modified: kos/kernel/libc/newlib/lock_common.c =================================================================== --- kos/kernel/libc/newlib/lock_common.c 2010-06-15 14:10:22 UTC (rev 663) +++ kos/kernel/libc/newlib/lock_common.c 2010-06-16 01:37:01 UTC (rev 664) @@ -6,10 +6,10 @@ */ #include <assert.h> -#include "lock_common.h" #include <arch/irq.h> #include <arch/spinlock.h> #include <kos/thread.h> +#include <sys/lock.h> void __newlib_lock_init(__newlib_lock_t * lock) { spinlock_init(lock); Deleted: kos/kernel/libc/newlib/lock_common.h =================================================================== --- kos/kernel/libc/newlib/lock_common.h 2010-06-15 14:10:22 UTC (rev 663) +++ kos/kernel/libc/newlib/lock_common.h 2010-06-16 01:37:01 UTC (rev 664) @@ -1,35 +0,0 @@ -/* KallistiOS ##version## - - lock_common.h - Copyright (C)2004 Dan Potter - -*/ - -#ifndef __NEWLIB_LOCK_COMMON_H -#define __NEWLIB_LOCK_COMMON_H - -typedef struct { - void * owner; - int nest; - volatile int lock; -} __newlib_recursive_lock_t; - -#define __NEWLIB_RECURSIVE_LOCK_INIT { (void *)0, 0, 0 } - -typedef volatile int __newlib_lock_t; -#define __NEWLIB_LOCK_INIT 0 - -void __newlib_lock_init(__newlib_lock_t *); -void __newlib_lock_close(__newlib_lock_t *); -void __newlib_lock_acquire(__newlib_lock_t *); -void __newlib_lock_try_acquire(__newlib_lock_t *); -void __newlib_lock_release(__newlib_lock_t *); - -void __newlib_lock_init_recursive(__newlib_recursive_lock_t *); -void __newlib_lock_close_recursive(__newlib_recursive_lock_t *); -void __newlib_lock_acquire_recursive(__newlib_recursive_lock_t *); -void __newlib_lock_try_acquire_recursive(__newlib_recursive_lock_t *); -void __newlib_lock_release_recursive(__newlib_recursive_lock_t *); - - -#endif // __NEWLIB_LOCK_COMMON_H Modified: kos/kernel/libc/newlib/newlib_env_lock.c =================================================================== --- kos/kernel/libc/newlib/newlib_env_lock.c 2010-06-15 14:10:22 UTC (rev 663) +++ kos/kernel/libc/newlib/newlib_env_lock.c 2010-06-16 01:37:01 UTC (rev 664) @@ -7,7 +7,7 @@ // These calls can be nested. #include <sys/reent.h> -#include "lock_common.h" +#include <sys/lock.h> static __newlib_recursive_lock_t lock = __NEWLIB_RECURSIVE_LOCK_INIT; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ljs...@us...> - 2010-06-15 14:10:30
|
Revision: 663 http://cadcdev.svn.sourceforge.net/cadcdev/?rev=663&view=rev Author: ljsebald Date: 2010-06-15 14:10:22 +0000 (Tue, 15 Jun 2010) Log Message: ----------- Adding patches to support GCC 4.4.0 and 4.4.4. Adding patch to support Newlib 1.18.0. Add cond_wait_recursive and cond_wait_timed_recursive (for GCC 4.4.4's C++0x threading support, which probably won't work anyway). Add _isatty_r function, as needed by Newlib 1.18.0. Modified Paths: -------------- kos/include/kos/cond.h kos/include/sys/_types.h kos/kernel/libc/newlib/lock_common.h kos/kernel/libc/newlib/newlib_isatty.c kos/kernel/thread/cond.c Added Paths: ----------- kos/utils/dc-chain/patches/gcc-4.4.0-kos.diff kos/utils/dc-chain/patches/gcc-4.4.4-kos.diff kos/utils/dc-chain/patches/newlib-1.18.0-kos.diff Modified: kos/include/kos/cond.h =================================================================== --- kos/include/kos/cond.h 2010-04-26 03:58:13 UTC (rev 662) +++ kos/include/kos/cond.h 2010-06-15 14:10:22 UTC (rev 663) @@ -15,6 +15,7 @@ #include <sys/queue.h> #include <kos/thread.h> #include <kos/mutex.h> +#include <kos/recursive_lock.h> /* Condition structure */ typedef struct condvar { @@ -36,6 +37,13 @@ EINTR - wait was interrupted */ int cond_wait(condvar_t *cv, mutex_t * m); +/* Same as above, but uses a recursive lock instead of a mutex. + Note that using this is a really bad idea, since if the lock hasn't + been completely unlocked by the single unlock that happens in this + function, you will likely end up with a deadlock. This was only + added for support for GCC's C++0x threading support. */ +int cond_wait_recursive(condvar_t *cv, recursive_lock_t *l); + /* Wait on a condvar; if there is an associated mutex to unlock while waiting, then pass that as well. If more than 'timeout' milliseconds passes and we still haven't been signaled, return @@ -47,6 +55,11 @@ EINTR - was interrupted */ int cond_wait_timed(condvar_t *cv, mutex_t * m, int timeout); +/* Save as above, but uses a recursive lock instead of a mutex. + The note about deadlocks with cond_wait_recursive above still + applies here. */ +int cond_wait_timed_recursive(condvar_t *cv, recursive_lock_t *l, int timeout); + /* Signal a single thread waiting on the condvar; you should be holding any associated mutex before doing this! */ void cond_signal(condvar_t *cv); Modified: kos/include/sys/_types.h =================================================================== --- kos/include/sys/_types.h 2010-04-26 03:58:13 UTC (rev 662) +++ kos/include/sys/_types.h 2010-06-15 14:10:22 UTC (rev 663) @@ -1,10 +1,38 @@ #ifndef _SYS__TYPES_H #define _SYS__TYPES_H +#include <sys/lock.h> + // This part copied from newlib's sys/_types.h. +#ifndef __off_t_defined typedef long _off_t; +#endif + +#ifndef __dev_t_defined +typedef short __dev_t; +#endif + +#ifndef __uid_t_defined +typedef unsigned short __uid_t; +#endif +#ifndef __gid_t_defined +typedef unsigned short __gid_t; +#endif + +#ifndef __off64_t_defined __extension__ typedef long long _off64_t; +#endif +#ifndef __fpos_t_defined +typedef long _fpos_t; +#endif + +#ifdef __LARGE64_FILES +#ifndef __fpos64_t_defined +typedef _off64_t _fpos64_t; +#endif +#endif + #if defined(__INT_MAX__) && __INT_MAX__ == 2147483647 typedef int _ssize_t; #else @@ -14,6 +42,7 @@ #define __need_wint_t #include <stddef.h> +#ifndef __mbstate_t_defined /* Conversion state information. */ typedef struct { @@ -24,11 +53,16 @@ unsigned char __wchb[4]; } __value; /* Value so far. */ } _mbstate_t; +#endif -typedef int _flock_t; +#ifndef __flock_t_defined +typedef __newlib_recursive_lock_t _flock_t; +#endif +#ifndef __iconv_t_defined /* Iconv descriptor type */ typedef void *_iconv_t; +#endif // This part inserted to fix newlib brokenness. Modified: kos/kernel/libc/newlib/lock_common.h =================================================================== --- kos/kernel/libc/newlib/lock_common.h 2010-04-26 03:58:13 UTC (rev 662) +++ kos/kernel/libc/newlib/lock_common.h 2010-06-15 14:10:22 UTC (rev 663) @@ -8,18 +8,16 @@ #ifndef __NEWLIB_LOCK_COMMON_H #define __NEWLIB_LOCK_COMMON_H -#include <arch/spinlock.h> - typedef struct { void * owner; int nest; - spinlock_t lock; + volatile int lock; } __newlib_recursive_lock_t; -#define __NEWLIB_RECURSIVE_LOCK_INIT { NULL, 0, SPINLOCK_INITIALIZER } +#define __NEWLIB_RECURSIVE_LOCK_INIT { (void *)0, 0, 0 } -typedef spinlock_t __newlib_lock_t; -#define __NEWLIB_LOCK_INIT SPINLOCK_INITIALIZER +typedef volatile int __newlib_lock_t; +#define __NEWLIB_LOCK_INIT 0 void __newlib_lock_init(__newlib_lock_t *); void __newlib_lock_close(__newlib_lock_t *); Modified: kos/kernel/libc/newlib/newlib_isatty.c =================================================================== --- kos/kernel/libc/newlib/newlib_isatty.c 2010-04-26 03:58:13 UTC (rev 662) +++ kos/kernel/libc/newlib/newlib_isatty.c 2010-06-15 14:10:22 UTC (rev 663) @@ -5,6 +5,12 @@ */ +#include <sys/reent.h> + int isatty(int fd) { return 0; } + +int _isatty_r(struct _reent *reent, int fd) { + return 0; +} Modified: kos/kernel/thread/cond.c =================================================================== --- kos/kernel/thread/cond.c 2010-04-26 03:58:13 UTC (rev 662) +++ kos/kernel/thread/cond.c 2010-06-15 14:10:22 UTC (rev 663) @@ -91,10 +91,47 @@ return rv; } +int cond_wait_timed_recursive(condvar_t *cv, recursive_lock_t *l, int timeout) { + int old, rv; + + if (irq_inside_int()) { + dbglog(DBG_WARNING, "cond_wait_recursive: called inside interrupt\n"); + errno = EPERM; + return -1; + } + + old = irq_disable(); + + /* First of all, release the associated recursive lock */ + assert( rlock_is_locked(l) ); + if (rlock_unlock(l) < 0) { + dbglog(DBG_WARNING, "cond_wait_recursive: lock held by other thread\n"); + return -1; + } + + /* Now block us until we're signaled */ + rv = genwait_wait(cv, timeout ? "cond_wait_timed_recursive" : + "cond_wait_recursive", timeout, NULL); + + /* Re-lock our recursive lock */ + if (rv >= 0 || errno == EAGAIN) { + rlock_lock(l); + } + + /* Ok, ready to return */ + irq_restore(old); + + return rv; +} + int cond_wait(condvar_t *cv, mutex_t *m) { return cond_wait_timed(cv, m, 0); } +int cond_wait_recursive(condvar_t *cv, recursive_lock_t *l) { + return cond_wait_timed_recursive(cv, l, 0); +} + void cond_signal(condvar_t *cv) { int old = 0; Added: kos/utils/dc-chain/patches/gcc-4.4.0-kos.diff =================================================================== --- kos/utils/dc-chain/patches/gcc-4.4.0-kos.diff (rev 0) +++ kos/utils/dc-chain/patches/gcc-4.4.0-kos.diff 2010-06-15 14:10:22 UTC (rev 663) @@ -0,0 +1,1858 @@ +diff -ruN gcc-4.4.0/gcc/config/sh/crt1.asm gcc-4.4.0-kos/gcc/config/sh/crt1.asm +--- gcc-4.4.0/gcc/config/sh/crt1.asm 2009-04-09 19:23:07.000000000 -0400 ++++ gcc-4.4.0-kos/gcc/config/sh/crt1.asm 2009-05-06 13:53:31.000000000 -0400 +@@ -1,1369 +1,197 @@ +-/* Copyright (C) 2000, 2001, 2003, 2004, 2005, 2006, 2009 +- Free Software Foundation, Inc. +- This file was pretty much copied from newlib. ++! KallistiOS ##version## ++! ++! startup.s ++! (c)2000-2001 Dan Potter ++! ++! This file must appear FIRST in your linking order, or your program won't ++! work correctly as a raw binary. ++! ++! This is very loosely based on Marcus' crt0.s/startup.s ++! ++ ++.globl start ++.globl _start ++.globl _arch_real_exit ++.globl __arch_old_sr ++.globl __arch_old_vbr ++.globl __arch_old_stack ++.globl __arch_old_fpscr + +-This file is part of GCC. +- +-GCC 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 3, or (at your option) any +-later version. +- +-GCC 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. +- +-Under Section 7 of GPL version 3, you are granted additional +-permissions described in the GCC Runtime Library Exception, version +-3.1, as published by the Free Software Foundation. +- +-You should have received a copy of the GNU General Public License and +-a copy of the GCC Runtime Library Exception along with this program; +-see the files COPYING3 and COPYING.RUNTIME respectively. If not, see +-<http://www.gnu.org/licenses/>. */ +- +- +-#ifdef MMU_SUPPORT +- /* Section used for exception/timer interrupt stack area */ +- .section .data.vbr.stack,"aw" +- .align 4 +- .global __ST_VBR +-__ST_VBR: +- .zero 1024 * 2 /* ; 2k for VBR handlers */ +-/* Label at the highest stack address where the stack grows from */ +-__timer_stack: +-#endif /* MMU_SUPPORT */ +- +- /* ;---------------------------------------- +- Normal newlib crt1.asm */ +- +-#ifdef __SH5__ +- .section .data,"aw" +- .global ___data +-___data: +- +- .section .rodata,"a" +- .global ___rodata +-___rodata: +- +-#define ICCR_BASE 0x01600000 +-#define OCCR_BASE 0x01e00000 +-#define MMUIR_BASE 0x00000000 +-#define MMUDR_BASE 0x00800000 +- +-#define PTE_ENABLED 1 +-#define PTE_DISABLED 0 +- +-#define PTE_SHARED (1 << 1) +-#define PTE_NOT_SHARED 0 +- +-#define PTE_CB_UNCACHEABLE 0 +-#define PTE_CB_DEVICE 1 +-#define PTE_CB_CACHEABLE_WB 2 +-#define PTE_CB_CACHEABLE_WT 3 +- +-#define PTE_SZ_4KB (0 << 3) +-#define PTE_SZ_64KB (1 << 3) +-#define PTE_SZ_1MB (2 << 3) +-#define PTE_SZ_512MB (3 << 3) +- +-#define PTE_PRR (1 << 6) +-#define PTE_PRX (1 << 7) +-#define PTE_PRW (1 << 8) +-#define PTE_PRU (1 << 9) +- +-#define SR_MMU_BIT 31 +-#define SR_BL_BIT 28 +- +-#define ALIGN_4KB (0xfff) +-#define ALIGN_1MB (0xfffff) +-#define ALIGN_512MB (0x1fffffff) +- +-#define DYNACON_BASE 0x0f000000 +-#define DM_CB_DLINK_BASE 0x0c000000 +-#define DM_DB_DLINK_BASE 0x0b000000 +- +-#define FEMI_AREA_0 0x00000000 +-#define FEMI_AREA_1 0x04000000 +-#define FEMI_AREA_2 0x05000000 +-#define FEMI_AREA_3 0x06000000 +-#define FEMI_AREA_4 0x07000000 +-#define FEMI_CB 0x08000000 +- +-#define EMI_BASE 0X80000000 +- +-#define DMA_BASE 0X0e000000 +- +-#define CPU_BASE 0X0d000000 +- +-#define PERIPH_BASE 0X09000000 +-#define DMAC_BASE 0x0e000000 +-#define INTC_BASE 0x0a000000 +-#define CPRC_BASE 0x0a010000 +-#define TMU_BASE 0x0a020000 +-#define SCIF_BASE 0x0a030000 +-#define RTC_BASE 0x0a040000 +- +- +- +-#define LOAD_CONST32(val, reg) \ +- movi ((val) >> 16) & 65535, reg; \ +- shori (val) & 65535, reg +- +-#define LOAD_PTEH_VAL(sym, align, bits, scratch_reg, reg) \ +- LOAD_ADDR (sym, reg); \ +- LOAD_CONST32 ((align), scratch_reg); \ +- andc reg, scratch_reg, reg; \ +- LOAD_CONST32 ((bits), scratch_reg); \ +- or reg, scratch_reg, reg +- +-#define LOAD_PTEL_VAL(sym, align, bits, scratch_reg, reg) \ +- LOAD_ADDR (sym, reg); \ +- LOAD_CONST32 ((align), scratch_reg); \ +- andc reg, scratch_reg, reg; \ +- LOAD_CONST32 ((bits), scratch_reg); \ +- or reg, scratch_reg, reg +- +-#define SET_PTE(pte_addr_reg, pteh_val_reg, ptel_val_reg) \ +- putcfg pte_addr_reg, 0, r63; \ +- putcfg pte_addr_reg, 1, ptel_val_reg; \ +- putcfg pte_addr_reg, 0, pteh_val_reg +- +-#if __SH5__ == 64 +- .section .text,"ax" +-#define LOAD_ADDR(sym, reg) \ +- movi (sym >> 48) & 65535, reg; \ +- shori (sym >> 32) & 65535, reg; \ +- shori (sym >> 16) & 65535, reg; \ +- shori sym & 65535, reg +-#else +- .mode SHmedia +- .section .text..SHmedia32,"ax" +-#define LOAD_ADDR(sym, reg) \ +- movi (sym >> 16) & 65535, reg; \ +- shori sym & 65535, reg +-#endif +- .global start ++_start: + start: +- LOAD_ADDR (_stack, r15) +- +-#ifdef MMU_SUPPORT +- ! Set up the VM using the MMU and caches +- +- ! .vm_ep is first instruction to execute +- ! after VM initialization +- pt/l .vm_ep, tr1 +- +- ! Configure instruction cache (ICCR) +- movi 3, r2 +- movi 0, r3 +- LOAD_ADDR (ICCR_BASE, r1) +- putcfg r1, 0, r2 +- putcfg r1, 1, r3 +- +- ! movi 7, r2 ! write through +- ! Configure operand cache (OCCR) +- LOAD_ADDR (OCCR_BASE, r1) +- putcfg r1, 0, r2 +- putcfg r1, 1, r3 +- +- ! Disable all PTE translations +- LOAD_ADDR (MMUIR_BASE, r1) +- LOAD_ADDR (MMUDR_BASE, r2) +- movi 64, r3 +- pt/l .disable_ptes_loop, tr0 +-.disable_ptes_loop: +- putcfg r1, 0, r63 +- putcfg r2, 0, r63 +- addi r1, 16, r1 +- addi r2, 16, r2 +- addi r3, -1, r3 +- bgt r3, r63, tr0 +- +- LOAD_ADDR (MMUIR_BASE, r1) +- +- ! FEMI instruction mappings +- ! Area 0 - 1Mb cacheable at 0x00000000 +- ! Area 1 - None +- ! Area 2 - 1Mb cacheable at 0x05000000 +- ! - 1Mb cacheable at 0x05100000 +- ! Area 3 - None +- ! Area 4 - None +- +- ! Map a 1Mb page for instructions at 0x00000000 +- LOAD_PTEH_VAL (FEMI_AREA_0, ALIGN_1MB, PTE_ENABLED | PTE_NOT_SHARED, r25, r2) +- LOAD_PTEL_VAL (FEMI_AREA_0, ALIGN_1MB, PTE_CB_CACHEABLE_WB | PTE_SZ_1MB | PTE_PRX | PTE_PRU, r25, r3) +- SET_PTE (r1, r2, r3) +- +- ! Map a 1Mb page for instructions at 0x05000000 +- addi r1, 16, r1 +- LOAD_PTEH_VAL (FEMI_AREA_2, ALIGN_1MB, PTE_ENABLED | PTE_NOT_SHARED, r25, r2) +- LOAD_PTEL_VAL (FEMI_AREA_2, ALIGN_1MB, PTE_CB_CACHEABLE_WB | PTE_SZ_1MB | PTE_PRX | PTE_PRU, r25, r3) +- SET_PTE (r1, r2, r3) +- +- ! Map a 1Mb page for instructions at 0x05100000 +- addi r1, 16, r1 +- LOAD_PTEH_VAL ((FEMI_AREA_2+0x100000), ALIGN_1MB, PTE_ENABLED | PTE_NOT_SHARED, r25, r2) +- LOAD_PTEL_VAL ((FEMI_AREA_2+0x100000), ALIGN_1MB, PTE_CB_CACHEABLE_WB | PTE_SZ_1MB | PTE_PRX | PTE_PRU, r25, r3) +- SET_PTE (r1, r2, r3) +- +- ! Map a 512M page for instructions at EMI base +- addi r1, 16, r1 +- LOAD_PTEH_VAL (EMI_BASE, ALIGN_512MB, PTE_ENABLED | PTE_NOT_SHARED, r25, r2) +- LOAD_PTEL_VAL (EMI_BASE, ALIGN_512MB, PTE_CB_CACHEABLE_WB | PTE_SZ_512MB | PTE_PRX | PTE_PRU, r25, r3) +- SET_PTE (r1, r2, r3) +- +- ! Map a 4K page for instructions at DM_DB_DLINK_BASE +- addi r1, 16, r1 +- LOAD_PTEH_VAL (DM_DB_DLINK_BASE, ALIGN_4KB, PTE_ENABLED | PTE_NOT_SHARED, r25, r2) +- LOAD_PTEL_VAL (DM_DB_DLINK_BASE, ALIGN_4KB, PTE_CB_CACHEABLE_WB | PTE_SZ_4KB | PTE_PRX | PTE_PRU, r25, r3) +- SET_PTE (r1, r2, r3) +- +- LOAD_ADDR (MMUDR_BASE, r1) +- +- ! FEMI data mappings +- ! Area 0 - 1Mb cacheable at 0x00000000 +- ! Area 1 - 1Mb device at 0x04000000 +- ! Area 2 - 1Mb cacheable at 0x05000000 +- ! - 1Mb cacheable at 0x05100000 +- ! Area 3 - None +- ! Area 4 - None +- ! CB - 1Mb device at 0x08000000 +- +- ! Map a 1Mb page for data at 0x00000000 +- LOAD_PTEH_VAL (FEMI_AREA_0, ALIGN_1MB, PTE_ENABLED | PTE_NOT_SHARED, r25, r2) +- LOAD_PTEL_VAL (FEMI_AREA_0, ALIGN_1MB, PTE_CB_CACHEABLE_WB | PTE_SZ_1MB | PTE_PRR | PTE_PRW | PTE_PRU, r25, r3) +- SET_PTE (r1, r2, r3) +- +- ! Map a 1Mb page for data at 0x04000000 +- addi r1, 16, r1 +- LOAD_PTEH_VAL (FEMI_AREA_1, ALIGN_1MB, PTE_ENABLED | PTE_NOT_SHARED, r25, r2) +- LOAD_PTEL_VAL (FEMI_AREA_1, ALIGN_1MB, PTE_CB_DEVICE | PTE_SZ_1MB | PTE_PRR | PTE_PRW | PTE_PRU, r25, r3) +- SET_PTE (r1, r2, r3) +- +- ! Map a 1Mb page for data at 0x05000000 +- addi r1, 16, r1 +- LOAD_PTEH_VAL (FEMI_AREA_2, ALIGN_1MB, PTE_ENABLED | PTE_NOT_SHARED, r25, r2) +- LOAD_PTEL_VAL (FEMI_AREA_2, ALIGN_1MB, PTE_CB_CACHEABLE_WB | PTE_SZ_1MB | PTE_PRR | PTE_PRW | PTE_PRU, r25, r3) +- SET_PTE (r1, r2, r3) +- +- ! Map a 1Mb page for data at 0x05100000 +- addi r1, 16, r1 +- LOAD_PTEH_VAL ((FEMI_AREA_2+0x100000), ALIGN_1MB, PTE_ENABLED | PTE_NOT_SHARED, r25, r2) +- LOAD_PTEL_VAL ((FEMI_AREA_2+0x100000), ALIGN_1MB, PTE_CB_CACHEABLE_WB | PTE_SZ_1MB | PTE_PRR | PTE_PRW | PTE_PRU, r25, r3) +- SET_PTE (r1, r2, r3) +- +- ! Map a 4K page for registers at 0x08000000 +- addi r1, 16, r1 +- LOAD_PTEH_VAL (FEMI_CB, ALIGN_4KB, PTE_ENABLED | PTE_NOT_SHARED, r25, r2) +- LOAD_PTEL_VAL (FEMI_CB, ALIGN_4KB, PTE_CB_DEVICE | PTE_SZ_4KB | PTE_PRR | PTE_PRW | PTE_PRU, r25, r3) +- SET_PTE (r1, r2, r3) +- +- ! Map a 512M page for data at EMI +- addi r1, 16, r1 +- LOAD_PTEH_VAL (EMI_BASE, ALIGN_512MB, PTE_ENABLED | PTE_NOT_SHARED, r25, r2) +- LOAD_PTEL_VAL (EMI_BASE, ALIGN_512MB, PTE_CB_CACHEABLE_WB | PTE_SZ_512MB | PTE_PRR | PTE_PRW | PTE_PRU, r25, r3) +- SET_PTE (r1, r2, r3) +- +- ! Map a 4K page for DYNACON at DYNACON_BASE +- addi r1, 16, r1 +- LOAD_PTEH_VAL (DYNACON_BASE, ALIGN_4KB, PTE_ENABLED | PTE_NOT_SHARED, r25, r2) +- LOAD_PTEL_VAL (DYNACON_BASE, ALIGN_4KB, PTE_CB_DEVICE | PTE_SZ_4KB | PTE_PRR | PTE_PRW | PTE_PRU, r25, r3) +- SET_PTE (r1, r2, r3) +- +- ! Map a 4K page for instructions at DM_DB_DLINK_BASE +- addi r1, 16, r1 +- LOAD_PTEH_VAL (DM_DB_DLINK_BASE, ALIGN_4KB, PTE_ENABLED | PTE_NOT_SHARED, r25, r2) +- LOAD_PTEL_VAL (DM_DB_DLINK_BASE, ALIGN_4KB, PTE_CB_CACHEABLE_WB | PTE_SZ_4KB | PTE_PRR | PTE_PRW | PTE_PRU, r25, r3) +- SET_PTE (r1, r2, r3) +- +- ! Map a 4K page for data at DM_DB_DLINK_BASE+0x1000 +- addi r1, 16, r1 +- LOAD_PTEH_VAL ((DM_DB_DLINK_BASE+0x1000), ALIGN_4KB, PTE_ENABLED | PTE_NOT_SHARED, r25, r2) +- LOAD_PTEL_VAL ((DM_DB_DLINK_BASE+0x1000), ALIGN_4KB, PTE_CB_UNCACHEABLE | PTE_SZ_4KB | PTE_PRR | PTE_PRW | PTE_PRU, r25, r3) +- SET_PTE (r1, r2, r3) +- +- ! Map a 4K page for stack DM_DB_DLINK_BASE+0x2000 +- addi r1, 16, r1 +- LOAD_PTEH_VAL ((DM_DB_DLINK_BASE+0x2000), ALIGN_4KB, PTE_ENABLED | PTE_NOT_SHARED, r25, r2) +- LOAD_PTEL_VAL ((DM_DB_DLINK_BASE+0x2000), ALIGN_4KB, PTE_CB_CACHEABLE_WB | PTE_SZ_4KB | PTE_PRR | PTE_PRW | PTE_PRU, r25, r3) +- SET_PTE (r1, r2, r3) +- +- ! Map a 1M page for DM_CB_BASE2 at DM_CB_DLINK +- ! 0x0c000000 - 0x0c0fffff +- addi r1, 16, r1 +- LOAD_PTEH_VAL (DM_CB_DLINK_BASE, ALIGN_1MB, PTE_ENABLED | PTE_NOT_SHARED, r25, r2) +- LOAD_PTEL_VAL (DM_CB_DLINK_BASE, ALIGN_1MB, PTE_CB_DEVICE | PTE_SZ_1MB | PTE_PRR | PTE_PRW | PTE_PRU, r25, r3) +- SET_PTE (r1, r2, r3) +- +- ! Map a 1M page for DM_CB_BASE2 at DM_CB_DLINK +- ! 0x0c100000 - 0x0c1fffff +- addi r1, 16, r1 +- LOAD_PTEH_VAL ((DM_CB_DLINK_BASE+0x100000), ALIGN_1MB, PTE_ENABLED | PTE_NOT_SHARED, r25, r2) +- LOAD_PTEL_VAL ((DM_CB_DLINK_BASE+0x100000), ALIGN_1MB, PTE_CB_DEVICE | PTE_SZ_1MB | PTE_PRR | PTE_PRW | PTE_PRU, r25, r3) +- SET_PTE (r1, r2, r3) +- +- ! Map a 1M page for DM_CB_BASE2 at DM_CB_DLINK +- ! 0x0c200000 - 0x0c2fffff +- addi r1, 16, r1 +- LOAD_PTEH_VAL ((DM_CB_DLINK_BASE+0x200000), ALIGN_1MB, PTE_ENABLED | PTE_NOT_SHARED, r25, r2) +- LOAD_PTEL_VAL ((DM_CB_DLINK_BASE+0x200000), ALIGN_1MB, PTE_CB_DEVICE | PTE_SZ_1MB | PTE_PRR | PTE_PRW | PTE_PRU, r25, r3) +- SET_PTE (r1, r2, r3) +- +- ! Map a 1M page for DM_CB_BASE2 at DM_CB_DLINK +- ! 0x0c400000 - 0x0c4fffff +- addi r1, 16, r1 +- LOAD_PTEH_VAL ((DM_CB_DLINK_BASE+0x400000), ALIGN_1MB, PTE_ENABLED | PTE_NOT_SHARED, r25, r2) +- LOAD_PTEL_VAL ((DM_CB_DLINK_BASE+0x400000), ALIGN_1MB, PTE_CB_DEVICE | PTE_SZ_1MB | PTE_PRR | PTE_PRW | PTE_PRU, r25, r3) +- SET_PTE (r1, r2, r3) +- +- ! Map a 1M page for DM_CB_BASE2 at DM_CB_DLINK +- ! 0x0c800000 - 0x0c8fffff +- addi r1, 16, r1 +- LOAD_PTEH_VAL ((DM_CB_DLINK_BASE+0x800000), ALIGN_1MB, PTE_ENABLED | PTE_NOT_SHARED, r25, r2) +- LOAD_PTEL_VAL ((DM_CB_DLINK_BASE+0x800000), ALIGN_1MB, PTE_CB_DEVICE | PTE_SZ_1MB | PTE_PRR | PTE_PRW | PTE_PRU, r25, r3) +- SET_PTE (r1, r2, r3) +- +- ! Map a 4K page for DMA control registers +- addi r1, 16, r1 +- LOAD_PTEH_VAL (DMA_BASE, ALIGN_4KB, PTE_ENABLED | PTE_NOT_SHARED, r25, r2) +- LOAD_PTEL_VAL (DMA_BASE, ALIGN_4KB, PTE_CB_DEVICE | PTE_SZ_4KB | PTE_PRR | PTE_PRW | PTE_PRU, r25, r3) +- SET_PTE (r1, r2, r3) +- +- ! Map lots of 4K pages for peripherals +- +- ! /* peripheral */ +- addi r1, 16, r1 +- LOAD_PTEH_VAL (PERIPH_BASE, ALIGN_4KB, PTE_ENABLED | PTE_NOT_SHARED, r25, r2) +- LOAD_PTEL_VAL (PERIPH_BASE, ALIGN_4KB, PTE_CB_DEVICE | PTE_SZ_4KB | PTE_PRR | PTE_PRW | PTE_PRU, r25, r3) +- SET_PTE (r1, r2, r3) +- ! /* dmac */ +- addi r1, 16, r1 +- LOAD_PTEH_VAL (DMAC_BASE, ALIGN_4KB, PTE_ENABLED | PTE_NOT_SHARED, r25, r2) +- LOAD_PTEL_VAL (DMAC_BASE, ALIGN_4KB, PTE_CB_DEVICE | PTE_SZ_4KB | PTE_PRR | PTE_PRW | PTE_PRU, r25, r3) +- SET_PTE (r1, r2, r3) +- ! /* intc */ +- addi r1, 16, r1 +- LOAD_PTEH_VAL (INTC_BASE, ALIGN_4KB, PTE_ENABLED | PTE_NOT_SHARED, r25, r2) +- LOAD_PTEL_VAL (INTC_BASE, ALIGN_4KB, PTE_CB_DEVICE | PTE_SZ_4KB | PTE_PRR | PTE_PRW | PTE_PRU, r25, r3) +- SET_PTE (r1, r2, r3) +- ! /* rtc */ +- addi r1, 16, r1 +- LOAD_PTEH_VAL (RTC_BASE, ALIGN_4KB, PTE_ENABLED | PTE_NOT_SHARED, r25, r2) +- LOAD_PTEL_VAL (RTC_BASE, ALIGN_4KB, PTE_CB_DEVICE | PTE_SZ_4KB | PTE_PRR | PTE_PRW | PTE_PRU, r25, r3) +- SET_PTE (r1, r2, r3) +- ! /* dmac */ +- addi r1, 16, r1 +- LOAD_PTEH_VAL (TMU_BASE, ALIGN_4KB, PTE_ENABLED | PTE_NOT_SHARED, r25, r2) +- LOAD_PTEL_VAL (TMU_BASE, ALIGN_4KB, PTE_CB_DEVICE | PTE_SZ_4KB | PTE_PRR | PTE_PRW | PTE_PRU, r25, r3) +- SET_PTE (r1, r2, r3) +- ! /* scif */ +- addi r1, 16, r1 +- LOAD_PTEH_VAL (SCIF_BASE, ALIGN_4KB, PTE_ENABLED | PTE_NOT_SHARED, r25, r2) +- LOAD_PTEL_VAL (SCIF_BASE, ALIGN_4KB, PTE_CB_DEVICE | PTE_SZ_4KB | PTE_PRR | PTE_PRW | PTE_PRU, r25, r3) +- SET_PTE (r1, r2, r3) +- ! /* cprc */ +- addi r1, 16, r1 +- LOAD_PTEH_VAL (CPRC_BASE, ALIGN_4KB, PTE_ENABLED | PTE_NOT_SHARED, r25, r2) +- LOAD_PTEL_VAL (CPRC_BASE, ALIGN_4KB, PTE_CB_DEVICE | PTE_SZ_4KB | PTE_PRR | PTE_PRW | PTE_PRU, r25, r3) +- SET_PTE (r1, r2, r3) +- +- ! Map CPU WPC registers +- addi r1, 16, r1 +- LOAD_PTEH_VAL (CPU_BASE, ALIGN_1MB, PTE_ENABLED | PTE_NOT_SHARED, r25, r2) +- LOAD_PTEL_VAL (CPU_BASE, ALIGN_1MB, PTE_CB_DEVICE | PTE_SZ_1MB | PTE_PRR | PTE_PRW | PTE_PRU, r25, r3) +- SET_PTE (r1, r2, r3) +- addi r1, 16, r1 +- +- LOAD_PTEH_VAL ((CPU_BASE+0x100000), ALIGN_1MB, PTE_ENABLED | PTE_NOT_SHARED, r25, r2) +- LOAD_PTEL_VAL ((CPU_BASE+0x100000), ALIGN_1MB, PTE_CB_DEVICE | PTE_SZ_1MB | PTE_PRR | PTE_PRW | PTE_PRU, r25, r3) +- SET_PTE (r1, r2, r3) +- +- addi r1, 16, r1 +- LOAD_PTEH_VAL ((CPU_BASE+0x200000), ALIGN_1MB, PTE_ENABLED | PTE_NOT_SHARED, r25, r2) +- LOAD_PTEL_VAL ((CPU_BASE+0x200000), ALIGN_1MB, PTE_CB_DEVICE | PTE_SZ_1MB | PTE_PRR | PTE_PRW | PTE_PRU, r25, r3) +- SET_PTE (r1, r2, r3) +- +- addi r1, 16, r1 +- LOAD_PTEH_VAL ((CPU_BASE+0x400000), ALIGN_1MB, PTE_ENABLED | PTE_NOT_SHARED, r25, r2) +- LOAD_PTEL_VAL ((CPU_BASE+0x400000), ALIGN_1MB, PTE_CB_DEVICE | PTE_SZ_1MB | PTE_PRR | PTE_PRW | PTE_PRU, r25, r3) +- SET_PTE (r1, r2, r3) +- +- ! Switch over to virtual addressing and enabled cache +- getcon sr, r1 +- movi 1, r2 +- shlli r2, SR_BL_BIT, r2 +- or r1, r2, r1 +- putcon r1, ssr +- getcon sr, r1 +- movi 1, r2 +- shlli r2, SR_MMU_BIT, r2 +- or r1, r2, r1 +- putcon r1, ssr +- gettr tr1, r1 +- putcon r1, spc +- synco +- rte +- +- ! VM entry point. From now on, we are in VM mode. +-.vm_ep: +- +- ! Install the trap handler, by seeding vbr with the +- ! correct value, and by assigning sr.bl = 0. +- +- LOAD_ADDR (vbr_start, r1) +- putcon r1, vbr +- movi ~(1<<28), r1 +- getcon sr, r2 +- and r1, r2, r2 +- putcon r2, sr +-#endif /* MMU_SUPPORT */ +- +- pt/l .Lzero_bss_loop, tr0 +- pt/l _init, tr5 +- pt/l ___setup_argv_and_call_main, tr6 +- pt/l _exit, tr7 +- +- ! zero out bss +- LOAD_ADDR (_edata, r0) +- LOAD_ADDR (_end, r1) +-.Lzero_bss_loop: +- stx.q r0, r63, r63 +- addi r0, 8, r0 +- bgt/l r1, r0, tr0 +- +- LOAD_ADDR (___data, r26) +- LOAD_ADDR (___rodata, r27) +- +-#ifdef __SH_FPU_ANY__ +- getcon sr, r0 +- ! enable the FP unit, by resetting SR.FD +- ! also zero out SR.FR, SR.SZ and SR.PR, as mandated by the ABI +- movi 0, r1 +- shori 0xf000, r1 +- andc r0, r1, r0 +- putcon r0, sr +-#if __SH5__ == 32 +- pt/l ___set_fpscr, tr0 +- movi 0, r4 +- blink tr0, r18 +-#endif +-#endif +- +- ! arrange for exit to call fini +- pt/l _atexit, tr1 +- LOAD_ADDR (_fini, r2) +- blink tr1, r18 +- +- ! call init +- blink tr5, r18 +- +- ! call the mainline +- blink tr6, r18 +- +- ! call exit +- blink tr7, r18 +- ! We should never return from _exit but in case we do we would enter the +- ! the following tight loop. This avoids executing any data that might follow. +-limbo: +- pt/l limbo, tr0 +- blink tr0, r63 +- +-#ifdef MMU_SUPPORT +- ! All these traps are handled in the same place. +- .balign 256 +-vbr_start: +- pt/l handler, tr0 ! tr0 trashed. +- blink tr0, r63 +- .balign 256 +-vbr_100: +- pt/l handler, tr0 ! tr0 trashed. +- blink tr0, r63 +-vbr_100_end: +- .balign 256 +-vbr_200: +- pt/l handler, tr0 ! tr0 trashed. +- blink tr0, r63 +- .balign 256 +-vbr_300: +- pt/l handler, tr0 ! tr0 trashed. +- blink tr0, r63 +- .balign 256 +-vbr_400: ! Should be at vbr+0x400 +-handler: +- /* If the trap handler is there call it */ +- LOAD_ADDR (__superh_trap_handler, r2) +- pta chandler,tr2 +- beq r2, r63, tr2 /* If zero, ie not present branch around to chandler */ +- /* Now call the trap handler with as much of the context unchanged as possible. +- Move trapping address into R18 to make it look like the trap point */ +- getcon spc, r18 +- pt/l __superh_trap_handler, tr0 +- blink tr0, r7 +-chandler: +- getcon spc, r62 +- getcon expevt, r2 +- pt/l _exit, tr0 +- blink tr0, r63 +- +- /* Simulated trap handler */ +- .section .text..SHmedia32,"ax" +-gcc2_compiled.: +- .section .debug_abbrev +-.Ldebug_abbrev0: +- .section .text..SHmedia32 +-.Ltext0: +- .section .debug_info +-.Ldebug_info0: +- .section .debug_line +-.Ldebug_line0: +- .section .text..SHmedia32,"ax" +- .align 5 +- .global __superh_trap_handler +- .type __superh_trap_handler,@function +-__superh_trap_handler: +-.LFB1: +- ptabs r18, tr0 +- addi.l r15, -8, r15 +- st.l r15, 4, r14 +- addi.l r15, -8, r15 +- add.l r15, r63, r14 +- st.l r14, 0, r2 +- ptabs r7, tr0 +- addi.l r14, 8, r14 +- add.l r14, r63, r15 +- ld.l r15, 4, r14 +- addi.l r15, 8, r15 +- blink tr0, r63 +-.LFE1: +-.Lfe1: +- .size __superh_trap_handler,.Lfe1-__superh_trap_handler +- +- .section .text..SHmedia32 +-.Letext0: +- +- .section .debug_info +- .ualong 0xa7 +- .uaword 0x2 +- .ualong .Ldebug_abbrev0 +- .byte 0x4 +- .byte 0x1 +- .ualong .Ldebug_line0 +- .ualong .Letext0 +- .ualong .Ltext0 +- .string "trap_handler.c" +- +- .string "xxxxxxxxxxxxxxxxxxxxxxxxxxxx" +- +- .string "GNU C 2.97-sh5-010522" +- +- .byte 0x1 +- .byte 0x2 +- .ualong 0x9a +- .byte 0x1 +- .string "_superh_trap_handler" +- +- .byte 0x1 +- .byte 0x2 +- .byte 0x1 +- .ualong .LFB1 +- .ualong .LFE1 +- .byte 0x1 +- .byte 0x5e +- .byte 0x3 +- .string "trap_reason" +- +- .byte 0x1 +- .byte 0x1 +- .ualong 0x9a +- .byte 0x2 +- .byte 0x91 +- .byte 0x0 +- .byte 0x0 +- .byte 0x4 +- .string "unsigned int" +- +- .byte 0x4 +- .byte 0x7 +- .byte 0x0 +- +- .section .debug_abbrev +- .byte 0x1 +- .byte 0x11 +- .byte 0x1 +- .byte 0x10 +- .byte 0x6 +- .byte 0x12 +- .byte 0x1 +- .byte 0x11 +- .byte 0x1 +- .byte 0x3 +- .byte 0x8 +- .byte 0x1b +- .byte 0x8 +- .byte 0x25 +- .byte 0x8 +- .byte 0x13 +- .byte 0xb +- .byte 0,0 +- .byte 0x2 +- .byte 0x2e +- .byte 0x1 +- .byte 0x1 +- .byte 0x13 +- .byte 0x3f +- .byte 0xc +- .byte 0x3 +- .byte 0x8 +- .byte 0x3a +- .byte 0xb +- .byte 0x3b +- .byte 0xb +- .byte 0x27 +- .byte 0xc +- .byte 0x11 +- .byte 0x1 +- .byte 0x12 +- .byte 0x1 +- .byte 0x40 +- .byte 0xa +- .byte 0,0 +- .byte 0x3 +- .byte 0x5 +- .byte 0x0 +- .byte 0x3 +- .byte 0x8 +- .byte 0x3a +- .byte 0xb +- .byte 0x3b +- .byte 0xb +- .byte 0x49 +- .byte 0x13 +- .byte 0x2 +- .byte 0xa +- .byte 0,0 +- .byte 0x4 +- .byte 0x24 +- .byte 0x0 +- .byte 0x3 +- .byte 0x8 +- .byte 0xb +- .byte 0xb +- .byte 0x3e +- .byte 0xb +- .byte 0,0 +- .byte 0 +- +- .section .debug_pubnames +- .ualong 0x27 +- .uaword 0x2 +- .ualong .Ldebug_info0 +- .ualong 0xab +- .ualong 0x5b +- .string "_superh_trap_handler" +- +- .ualong 0x0 +- +- .section .debug_aranges +- .ualong 0x1c +- .uaword 0x2 +- .ualong .Ldebug_info0 +- .byte 0x4 +- .byte 0x0 +- .uaword 0x0,0 +- .ualong .Ltext0 +- .ualong .Letext0-.Ltext0 +- .ualong 0x0 +- .ualong 0x0 +- .ident "GCC: (GNU) 2.97-sh5-010522" +-#endif /* MMU_SUPPORT */ +-#else /* ! __SH5__ */ +- +- ! make a place to keep any previous value of the vbr register +- ! this will only have a value if it has been set by redboot (for example) +- .section .bss +-old_vbr: +- .long 0 +-#ifdef PROFILE +-profiling_enabled: +- .long 0 +-#endif +- +- +- .section .text +- .global start +- .import ___rtos_profiler_start_timer +- .weak ___rtos_profiler_start_timer +-start: +- mov.l stack_k,r15 +- +-#if defined (__SH3__) || (defined (__SH_FPU_ANY__) && ! defined (__SH2A__)) || defined (__SH4_NOFPU__) +-#define VBR_SETUP +- ! before zeroing the bss ... +- ! if the vbr is already set to vbr_start then the program has been restarted +- ! (i.e. it is not the first time the program has been run since reset) +- ! reset the vbr to its old value before old_vbr (in bss) is wiped +- ! this ensures that the later code does not create a circular vbr chain +- stc vbr, r1 +- mov.l vbr_start_k, r2 +- cmp/eq r1, r2 +- bf 0f +- ! reset the old vbr value +- mov.l old_vbr_k, r1 +- mov.l @r1, r2 +- ldc r2, vbr +-0: +-#endif /* VBR_SETUP */ +- +- ! zero out bss +- mov.l edata_k,r0 +- mov.l end_k,r1 +- mov #0,r2 +-start_l: +- mov.l r2,@r0 +- add #4,r0 +- cmp/ge r0,r1 +- bt start_l +- +-#if defined (__SH_FPU_ANY__) +- mov.l set_fpscr_k, r1 +- mov #4,r4 +- jsr @r1 +- shll16 r4 ! Set DN bit (flush denormal inputs to zero) +- lds r3,fpscr ! Switch to default precision +-#endif /* defined (__SH_FPU_ANY__) */ +- +-#ifdef VBR_SETUP +- ! save the existing contents of the vbr +- ! there will only be a prior value when using something like redboot +- ! otherwise it will be zero +- stc vbr, r1 +- mov.l old_vbr_k, r2 +- mov.l r1, @r2 +- ! setup vbr +- mov.l vbr_start_k, r1 +- ldc r1,vbr +-#endif /* VBR_SETUP */ +- +- ! if an rtos is exporting a timer start fn, +- ! then pick up an SR which does not enable ints +- ! (the rtos will take care of this) +- mov.l rtos_start_fn, r0 +- mov.l sr_initial_bare, r1 +- tst r0, r0 +- bt set_sr +- +- mov.l sr_initial_rtos, r1 +- +-set_sr: +- ! Set status register (sr) +- ldc r1, sr +- +- ! arrange for exit to call fini +- mov.l atexit_k,r0 +- mov.l fini_k,r4 +- jsr @r0 ++ ! Disable interrupts (if they're enabled) ++ mov.l old_sr_addr,r0 ++ stc sr,r1 ++ mov.l r1,@r0 ++ mov.l init_sr,r0 ++ ldc r0,sr ++ ++ ! Run in the P2 area ++ mov.l setup_cache_addr,r0 ++ mov.l p2_mask,r1 ++ or r1,r0 ++ jmp @r0 + nop + +-#ifdef PROFILE +- ! arrange for exit to call _mcleanup (via stop_profiling) +- mova stop_profiling,r0 +- mov.l atexit_k,r1 +- jsr @r1 +- mov r0, r4 +- +- ! Call profiler startup code +- mov.l monstartup_k, r0 +- mov.l start_k, r4 +- mov.l etext_k, r5 +- jsr @r0 ++setup_cache: ++ ! Now that we are in P2, it's safe to enable the cache ++ ! Check to see if we should enable OCRAM. ++ mov.l kos_init_flags_addr, r0 ++ add #2, r0 ++ mov.w @r0, r0 ++ tst #1, r0 ++ bf .L_setup_cache_L0 ++ mov.w ccr_data,r1 ++ bra .L_setup_cache_L1 ++ nop ++.L_setup_cache_L0: ++ mov.w ccr_data_ocram,r1 ++.L_setup_cache_L1: ++ mov.l ccr_addr,r0 ++ mov.l r1,@r0 ++ ++ ! After changing CCR, eight instructions must be executed before ++ ! it's safe to enter a cached area such as P1 ++ nop ! 1 ++ nop ! 2 ++ nop ! 3 ++ nop ! 4 ++ nop ! 5 (d-cache now safe) ++ nop ! 6 ++ mov.l init_addr,r0 ! 7 ++ mov #0,r1 ! 8 ++ jmp @r0 ! go ++ mov r1,r0 + nop + +- ! enable profiling trap +- ! until now any trap 33s will have been ignored +- ! This means that all library functions called before this point +- ! (directly or indirectly) may have the profiling trap at the start. +- ! Therefore, only mcount itself may not have the extra header. +- mov.l profiling_enabled_k2, r0 +- mov #1, r1 +- mov.l r1, @r0 +-#endif /* PROFILE */ ++init: ++ ! Save old PR on old stack so we can get to it later ++ sts.l pr,@-r15 + +- ! call init +- mov.l init_k,r0 ++ ! Save the current stack, and set a new stack (higher up in RAM) ++ mov.l old_stack_addr,r0 ++ mov.l r15,@r0 ++ mov.l new_stack,r15 ++ ++ ! Save VBR ++ mov.l old_vbr_addr,r0 ++ stc vbr,r1 ++ mov.l r1,@r0 ++ ++ ! Save FPSCR ++ mov.l old_fpscr_addr,r0 ++ sts fpscr,r1 ++ mov.l r1,@r0 ++ ++ ! Reset FPSCR ++ mov #4,r4 ! Use 00040000 (DN=1) ++ mov.l fpscr_addr,r0 + jsr @r0 +- nop ++ shll16 r4 + +- ! call the mainline +- mov.l main_k,r0 +- jsr @r0 +- nop ++ ! Setup a sentinel value for frame pointer in case we're using ++ ! FRAME_POINTERS for stack tracing. ++ mov #-1,r14 + +- ! call exit +- mov r0,r4 +- mov.l exit_k,r0 ++ ! Jump to the kernel main ++ mov.l main_addr,r0 + jsr @r0 + nop +- +- .balign 4 +-#ifdef PROFILE +-stop_profiling: +- # stop mcount counting +- mov.l profiling_enabled_k2, r0 +- mov #0, r1 +- mov.l r1, @r0 +- +- # call mcleanup +- mov.l mcleanup_k, r0 +- jmp @r0 +- nop +- +- .balign 4 +-mcleanup_k: +- .long __mcleanup +-monstartup_k: +- .long ___monstartup +-profiling_enabled_k2: +- .long profiling_enabled +-start_k: +- .long _start +-etext_k: +- .long __etext +-#endif /* PROFILE */ + +- .align 2 +-#if defined (__SH_FPU_ANY__) +-set_fpscr_k: +- .long ___set_fpscr +-#endif /* defined (__SH_FPU_ANY__) */ ++ ! Program can return here (not likely) or jump here directly ++ ! from anywhere in it to go straight back to the monitor ++_arch_real_exit: ++ ! Reset SR ++ mov.l old_sr,r0 ++ ldc r0,sr ++ ++ ! Disable MMU, invalidate TLB ++ mov #4,r0 ++ mov.l mmu_addr,r1 ++ mov.l r0,@r1 ++ ++ ! Wait (just in case) ++ nop ! 1 ++ nop ! 2 ++ nop ! 3 ++ nop ! 4 ++ nop ! 5 ++ nop ! 6 ++ nop ! 7 ++ nop ! 8 ++ ++ ! Restore VBR ++ mov.l old_vbr,r0 ++ ldc r0,vbr + +-stack_k: +- .long _stack +-edata_k: +- .long _edata +-end_k: +- .long _end +-main_k: +- .long ___setup_argv_and_call_main +-exit_k: +- .long _exit +-atexit_k: +- .long _atexit +-init_k: +- .long _init +-fini_k: +- .long _fini +-#ifdef VBR_SETUP +-old_vbr_k: +- .long old_vbr +-vbr_start_k: +- .long vbr_start +-#endif /* VBR_SETUP */ +- +-sr_initial_rtos: +- ! Privileged mode RB 1 BL 0. Keep BL 0 to allow default trap handlers to work. +- ! Whether profiling or not, keep interrupts masked, +- ! the RTOS will enable these if required. +- .long 0x600000f1 +- +-rtos_start_fn: +- .long ___rtos_profiler_start_timer +- +-#ifdef PROFILE +-sr_initial_bare: +- ! Privileged mode RB 1 BL 0. Keep BL 0 to allow default trap handlers to work. +- ! For bare machine, we need to enable interrupts to get profiling working +- .long 0x60000001 +-#else ++ ! If we're working under dcload, call its EXIT syscall ++ mov.l dcload_magic_addr,r0 ++ mov.l @r0,r0 ++ mov.l dcload_magic_value,r1 ++ cmp/eq r0,r1 ++ bf normal_exit + +-sr_initial_bare: +- ! Privileged mode RB 1 BL 0. Keep BL 0 to allow default trap handlers to work. +- ! Keep interrupts disabled - the application will enable as required. +- .long 0x600000f1 +-#endif ++ mov.l dcload_syscall,r0 ++ mov.l @r0,r0 ++ jsr @r0 ++ mov #15,r4 + +- ! supplied for backward compatibility only, in case of linking +- ! code whose main() was compiled with an older version of GCC. +- .global ___main +-___main: ++ ! Set back the stack and return (presumably to a serial debug) ++normal_exit: ++ mov.l old_stack,r15 ++ lds.l @r15+,pr + rts + nop +-#ifdef VBR_SETUP +-! Exception handlers +- .section .text.vbr, "ax" +-vbr_start: +- +- .org 0x100 +-vbr_100: +-#ifdef PROFILE +- ! Note on register usage. +- ! we use r0..r3 as scratch in this code. If we are here due to a trapa for profiling +- ! then this is OK as we are just before executing any function code. +- ! The other r4..r7 we save explicityl on the stack +- ! Remaining registers are saved by normal ABI conventions and we assert we do not +- ! use floating point registers. +- mov.l expevt_k1, r1 +- mov.l @r1, r1 +- mov.l event_mask, r0 +- and r0,r1 +- mov.l trapcode_k, r2 +- cmp/eq r1,r2 +- bt 1f +- bra handler_100 ! if not a trapa, go to default handler +- nop +-1: +- mov.l trapa_k, r0 +- mov.l @r0, r0 +- shlr2 r0 ! trapa code is shifted by 2. +- cmp/eq #33, r0 +- bt 2f +- bra handler_100 +- nop +-2: +- +- ! If here then it looks like we have trap #33 +- ! Now we need to call mcount with the following convention +- ! Save and restore r4..r7 +- mov.l r4,@-r15 +- mov.l r5,@-r15 +- mov.l r6,@-r15 +- mov.l r7,@-r15 +- sts.l pr,@-r15 +- +- ! r4 is frompc. +- ! r5 is selfpc +- ! r0 is the branch back address. +- ! The code sequence emitted by gcc for the profiling trap is +- ! .align 2 +- ! trapa #33 +- ! .align 2 +- ! .long lab Where lab is planted by the compiler. This is the address +- ! of a datum that needs to be incremented. +- sts pr, r4 ! frompc +- stc spc, r5 ! selfpc +- mov #2, r2 +- not r2, r2 ! pattern to align to 4 +- and r2, r5 ! r5 now has aligned address +-! add #4, r5 ! r5 now has address of address +- mov r5, r2 ! Remember it. +-! mov.l @r5, r5 ! r5 has value of lable (lab in above example) +- add #8, r2 +- ldc r2, spc ! our return address avoiding address word +- +- ! only call mcount if profiling is enabled +- mov.l profiling_enabled_k, r0 +- mov.l @r0, r0 +- cmp/eq #0, r0 +- bt 3f +- ! call mcount +- mov.l mcount_k, r2 +- jsr @r2 +- nop +-3: +- lds.l @r15+,pr +- mov.l @r15+,r7 +- mov.l @r15+,r6 +- mov.l @r15+,r5 +- mov.l @r15+,r4 +- rte +- nop +- .balign 4 +-event_mask: +- .long 0xfff +-trapcode_k: +- .long 0x160 +-expevt_k1: +- .long 0xff000024 ! Address of expevt +-trapa_k: +- .long 0xff000020 +-mcount_k: +- .long __call_mcount +-profiling_enabled_k: +- .long profiling_enabled +-#endif +- ! Non profiling case. +-handler_100: +- mov.l 2f, r0 ! load the old vbr setting (if any) +- mov.l @r0, r0 +- cmp/eq #0, r0 +- bf 1f +- ! no previous vbr - jump to own generic handler +- bra handler +- nop +-1: ! there was a previous handler - chain them +- add #0x7f, r0 ! 0x7f +- add #0x7f, r0 ! 0xfe +- add #0x2, r0 ! add 0x100 without corrupting another register +- jmp @r0 +- nop +- .balign 4 +-2: +- .long old_vbr + +- .org 0x400 +-vbr_400: ! Should be at vbr+0x400 +- mov.l 2f, r0 ! load the old vbr setting (if any) +- mov.l @r0, r0 +- cmp/eq #0, r0 +- ! no previous vbr - jump to own generic handler +- bt handler +- ! there was a previous handler - chain them +- rotcr r0 +- rotcr r0 +- add #0x7f, r0 ! 0x1fc +- add #0x7f, r0 ! 0x3f8 +- add #0x02, r0 ! 0x400 +- rotcl r0 +- rotcl r0 ! Add 0x400 without corrupting another register +- jmp @r0 +- nop +- .balign 4 +-2: +- .long old_vbr +-handler: +- /* If the trap handler is there call it */ +- mov.l superh_trap_handler_k, r0 +- cmp/eq #0, r0 ! True if zero. +- bf 3f +- bra chandler +- nop +-3: +- ! Here handler available, call it. +- /* Now call the trap handler with as much of the context unchanged as possible. +- Move trapping address into PR to make it look like the trap point */ +- stc spc, r1 +- lds r1, pr +- mov.l expevt_k, r4 +- mov.l @r4, r4 ! r4 is value of expevt, first parameter. +- mov r1, r5 ! Remember trapping pc. +- mov r1, r6 ! Remember trapping pc. +- mov.l chandler_k, r1 +- mov.l superh_trap_handler_k, r2 +- ! jmp to trap handler to avoid disturbing pr. +- jmp @r2 +- nop +- +- .org 0x600 +-vbr_600: +-#ifdef PROFILE +- ! Should be at vbr+0x600 +- ! Now we are in the land of interrupts so need to save more state. +- ! Save register state +- mov.l interrupt_stack_k, r15 ! r15 has been saved to sgr. +- mov.l r0,@-r15 +- mov.l r1,@-r15 +- mov.l r2,@-r15 +- mov.l r3,@-r15 +- mov.l r4,@-r15 +- mov.l r5,@-r15 +- mov.l r6,@-r15 +- mov.l r7,@-r15 +- sts.l pr,@-r15 +- sts.l mach,@-r15 +- sts.l macl,@-r15 +-#if defined(__SH_FPU_ANY__) +- ! Save fpul and fpscr, save fr0-fr7 in 64 bit mode +- ! and set the pervading precision for the timer_handler +- mov #0,r0 +- sts.l fpul,@-r15 +- sts.l fpscr,@-r15 +- lds r0,fpscr ! Clear fpscr +- fmov fr0,@-r15 +- fmov fr1,@-r15 +- fmov fr2,@-r15 +- fmov fr3,@-r15 +- mov.l pervading_precision_k,r0 +- fmov fr4,@-r15 +- fmov fr5,@-r15 +- mov.l @r0,r0 +- fmov fr6,@-r15 +- fmov fr7,@-r15 +- lds r0,fpscr +-#endif /* __SH_FPU_ANY__ */ +- ! Pass interrupted pc to timer_handler as first parameter (r4). +- stc spc, r4 +- mov.l timer_handler_k, r0 +- jsr @r0 +- nop +-#if defined(__SH_FPU_ANY__) +- mov #0,r0 +- lds r0,fpscr ! Clear the fpscr +- fmov @r15+,fr7 +- fmov @r15+,fr6 +- fmov @r15+,fr5 +- fmov @r15+,fr4 +- fmov @r15+,fr3 +- fmov @r15+,fr2 +- fmov @r15+,fr1 +- fmov @r15+,fr0 +- lds.l @r15+,fpscr +- lds.l @r15+,fpul +-#endif /* __SH_FPU_ANY__ */ +- lds.l @r15+,macl +- lds.l @r15+,mach +- lds.l @r15+,pr +- mov.l @r15+,r7 +- mov.l @r15+,r6 +- mov.l @r15+,r5 +- mov.l @r15+,r4 +- mov.l @r15+,r3 +- mov.l @r15+,r2 +- mov.l @r15+,r1 +- mov.l @r15+,r0 +- stc sgr, r15 ! Restore r15, destroyed by this sequence. +- rte +- nop +-#if defined(__SH_FPU_ANY__) +- .balign 4 +-pervading_precision_k: +-#define CONCAT1(A,B) A##B +-#define CONCAT(A,B) CONCAT1(A,B) +- .long CONCAT(__USER_LABEL_PREFIX__,__fpscr_values)+4 +-#endif +-#else +- mov.l 2f, r0 ! Load the old vbr setting (if any). +- mov.l @r0, r0 +- cmp/eq #0, r0 +- ! no previous vbr - jump to own handler +- bt chandler +- ! there was a previous handler - chain them +- rotcr r0 +- rotcr r0 +- add #0x7f, r0 ! 0x1fc +- add #0x7f, r0 ! 0x3f8 +- add #0x7f, r0 ! 0x5f4 +- add #0x03, r0 ! 0x600 +- rotcl r0 +- rotcl r0 ! Add 0x600 without corrupting another register +- jmp @r0 +- nop +- .balign 4 +-2: +- .long old_vbr +-#endif /* PROFILE code */ +-chandler: +- mov.l expevt_k, r4 +- mov.l @r4, r4 ! r4 is value of expevt hence making this the return code +- mov.l handler_exit_k,r0 +- jsr @r0 +- nop +- ! We should never return from _exit but in case we do we would enter the +- ! the following tight loop +-limbo: +- bra limbo +- nop +- .balign 4 +-#ifdef PROFILE +-interrupt_stack_k: +- .long __timer_stack ! The high end of the stack +-timer_handler_k: +- .long __profil_counter +-#endif +-expevt_k: +- .long 0xff000024 ! Address of expevt +-chandler_k: +- .long chandler +-superh_trap_handler_k: +- .long __superh_trap_handler +-handler_exit_k: +- .long _exit +- .align 2 +-! Simulated compile of trap handler. +- .section .debug_abbrev,"",@progbits +-.Ldebug_abbrev0: +- .section .debug_info,"",@progbits +-.Ldebug_info0: +- .section .debug_line,"",@progbits +-.Ldebug_line0: +- .text +-.Ltext0: +- .align 5 +- .type __superh_trap_handler,@function +-__superh_trap_handler: +-.LFB1: +- mov.l r14,@-r15 +-.LCFI0: +- add #-4,r15 +-.LCFI1: +- mov r15,r14 +-.LCFI2: +- mov.l r4,@r14 +- lds r1, pr +- add #4,r14 +- mov r14,r15 +- mov.l @r15+,r14 +- rts +- nop +-.LFE1: +-.Lfe1: +- .size __superh_trap_handler,.Lfe1-__superh_trap_handler +- .section .debug_frame,"",@progbits +-.Lframe0: +- .ualong .LECIE0-.LSCIE0 +-.LSCIE0: +- .ualong 0xffffffff +- .byte 0x1 +- .string "" +- .uleb128 0x1 +- .sleb128 -4 +- .byte 0x11 +- .byte 0xc +- .uleb128 0xf +- .uleb128 0x0 +- .align 2 +-.LECIE0: +-.LSFDE0: +- .ualong .LEFDE0-.LASFDE0 +-.LASFDE0: +- .ualong .Lframe0 +- .ualong .LFB1 +- .ualong .LFE1-.LFB1 +- .byte 0x4 +- .ualong .LCFI0-.LFB1 +- .byte 0xe +- .uleb128 0x4 +- .byte 0x4 +- .ualong .LCFI1-.LCFI0 +- .byte 0xe +- .uleb128 0x8 +- .byte 0x8e +- .uleb128 0x1 +- .byte 0x4 +- .ualong .LCFI2-.LCFI1 +- .byte 0xd +- .uleb128 0xe +- .align 2 +-.LEFDE0: +- .text +-.Letext0: +- .section .debug_info +- .ualong 0xb3 +- .uaword 0x2 +- .ualong .Ldebug_abbrev0 +- .byte 0x4 +- .uleb128 0x1 +- .ualong .Ldebug_line0 +- .ualong .Letext0 +- .ualong .Ltext0 +- .string "trap_handler.c" +- .string "xxxxxxxxxxxxxxxxxxxxxxxxxxxx" +- .string "GNU C 3.2 20020529 (experimental)" +- .byte 0x1 +- .uleb128 0x2 +- .ualong 0xa6 +- .byte 0x1 +- .string "_superh_trap_handler" +- .byte 0x1 +- .byte 0x2 +- .byte 0x1 +- .ualong .LFB1 +- .ualong .LFE1 +- .byte 0x1 +- .byte 0x5e +- .uleb128 0x3 +- .string "trap_reason" +- .byte 0x1 +- .byte 0x1 +- .ualong 0xa6 +- .byte 0x2 +- .byte 0x91 +- .sleb128 0 +- .byte 0x0 +- .uleb128 0x4 +- .string "unsigned int" +- .byte 0x4 +- .byte 0x7 +- .byte 0x0 +- .section .debug_abbrev +- .uleb128 0x1 +- .uleb128 0x11 +- .byte 0x1 +- .uleb128 0x10 +- .uleb128 0x6 +- .uleb128 0x12 +- .uleb128 0x1 +- .uleb128 0x11 +- .uleb128 0x1 +- .uleb128 0x3 +- .uleb128 0x8 +- .uleb128 0x1b +- .uleb128 0x8 +- .uleb128 0x25 +- .uleb128 0x8 +- .uleb128 0x13 +- .uleb128 0xb +- .byte 0x0 +- .byte 0x0 +- .uleb128 0x2 +- .uleb128 0x2e +- .byte 0x1 +- .uleb128 0x1 +- .uleb128 0x13 +- .uleb128 0x3f +- .uleb128 0xc +- .uleb128 0x3 +- .uleb128 0x8 +- .uleb128 0x3a +- .uleb128 0xb +- .uleb128 0x3b +- .uleb128 0xb +- .uleb128 0x27 +- .uleb128 0xc +- .uleb128 0x11 +- .uleb128 0x1 +- .uleb128 0x12 +- .uleb128 0x1 +- .uleb128 0x40 +- .uleb128 0xa +- .byte 0x0 +- .byte 0x0 +- .uleb128 0x3 +- .uleb128 0x5 +- .byte 0x0 +- .uleb128 0x3 +- .uleb128 0x8 +- .uleb128 0x3a +- .uleb128 0xb +- .uleb128 0x3b +- .uleb128 0xb +- .uleb128 0x49 +- .uleb128 0x13 +- .uleb128 0x2 +- .uleb128 0xa +- .byte 0x0 +- .byte 0x0 +- .uleb128 0x4 +- .uleb128 0x24 +- .byte 0x0 +- .uleb128 0x3 +- .uleb128 0x8 +- .uleb128 0xb +- .uleb128 0xb +- .uleb128 0x3e +- .uleb128 0xb +- .byte 0x0 +- .byte 0x0 +- .byte 0x0 +- .section .debug_pubnames,"",@progbits +- .ualong 0x27 +- .uaword 0x2 +- .ualong .Ldebug_info0 +- .ualong 0xb7 +- .ualong 0x67 +- .string "_superh_trap_handler" +- .ualong 0x0 +- .section .debug_aranges,"",@progbits +- .ualong 0x1c +- .uaword 0x2 +- .ualong .Ldebug_info0 +- .byte 0x4 +- .byte 0x0 +- .uaword 0x0 +- .uaword 0x0 +- .ualong .Ltext0 +- .ualong .Letext0-.Ltext0 +- .ualong 0x0 +- .ualong 0x0 +-#endif /* VBR_SETUP */ +-#endif /* ! __SH5__ */ ++! Misc variables ++ .align 2 ++dcload_magic_addr: ++ .long 0x8c004004 ++dcload_magic_value: ++ .long 0xdeadbeef ++dcload_syscall: ++ .long 0x8c004008 ++__arch_old_sr: ++old_sr: ++ .long 0 ++__arch_old_vbr: ++old_vbr: ++ .long 0 ++__arch_old_fpscr: ++old_fpscr: ++ .long 0 ++init_sr: ++ .long 0x500000f0 ++old_sr_addr: ++ .long old_sr ++old_vbr_addr: ++ .long old_vbr ++old_fpscr_addr: ++ .long old_fpscr ++old_stack_addr: ++ .long old_stack ++__arch_old_stack: ++old_stack: ++ .long 0 ++new_stack: ++ .long 0x8d000000 ++p2_mask: ++ .long 0xa0000000 ++setup_cache_addr: ++ .long setup_cache ++init_addr: ++ .long init ++main_addr: ++ .long _arch_main ++mmu_addr: ++ .long 0xff000010 ++fpscr_addr: ++ .long ___set_fpscr ! in libgcc ++kos_init_flags_addr: ++ .long ___kos_init_flags ++ccr_addr: ++ .long 0xff00001c ++ccr_data: ++ .word 0x090d ++ccr_data_ocram: ++ .word 0x092d +diff -ruN gcc-4.4.0/gcc/configure gcc-4.4.0-kos/gcc/configure +--- gcc-4.4.0/gcc/configure 2009-03-24 13:46:03.000000000 -0400 ++++ gcc-4.4.0-kos/gcc/configure 2009-05-06 13:53:31.000000000 -0400 +@@ -13334,7 +13334,7 @@ + target_thread_file='single' + ;; + aix | dce | gnat | irix | posix | posix95 | rtems | \ +- single | solaris | vxworks | win32 | mipssde) ++ single | solaris | vxworks | win32 | mipssde | kos) + target_thread_file=${enable_threads} + ;; + *) +diff -ruN gcc-4.4.0/gcc/gthr-kos.h gcc-4.4.0-kos/gcc/gthr-kos.h +--- gcc-4.4.0/gcc/gthr-kos.h 1969-12-31 19:00:00.000000000 -0500 ++++ gcc-4.4.0-kos/gcc/gthr-kos.h 2009-05-10 10:02:55.000000000 -0400 +@@ -0,0 +1,291 @@ ++/* Copyright (C) 2009 Lawrence Sebald */ ++ ++/* Threads compatibility routines for libgcc2 and libobjc. */ ++/* Compile this one with gcc. */ ++/* Copyright (C) 1997, 1999, 2000, 2004, 2008, 2009 ++ Free Software Foundation, Inc. ++ ++This file is part of GCC. ++ ++GCC 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 3, or (at your option) any later ++version. ++ ++GCC 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. ++ ++Under Section 7 of GPL version 3, you are granted additional ++permissions described in the GCC Runtime Library Exception, version ++3.1, as published by the Free Software Foundation. ++ ++You should have received a copy of the GNU General Public License and ++a copy of the GCC Runtime Library Exception along with this program; ++see the files COPYING3 and COPYING.RUNTIME respectively. If not, see ++<http://www.gnu.org/licenses/>. */ ++ ++#ifndef GCC_GTHR_KOS_H ++#define GCC_GTHR_KOS_H ++ ++/* KallistiOS threads specific definitions. */ ++ ++#define __GTHREADS 1 ++ ++#include <assert.h> ++#include <kos/thread.h> ++#include <kos/tls.h> ++#include <kos/mutex.h> ++#include <kos/recursive_lock.h> ++#include <kos/once.h> ++#include <kos/cond.h> ++ ++/* These should work just fine. */ ++typedef kthread_key_t __gthread_key_t; ++typedef kthread_once_t __gthread_once_t; ++typedef mutex_t * __gthread_mutex_t; ++typedef recursive_lock_t * __gthread_recursive_mutex_t; ++ ++static void __gthr_mutex_init(__gthread_mutex_t *__mutex) { ++ assert(__mutex); ++ *__mutex = mutex_create(); ++} ++ ++static void __gthr_recursive_mutex_init(__gthread_recursive_mutex_t *__mutex) { ++ assert(__mutex); ++ *__mutex = rlock_create(); ++} ++ ++#define __GTHREAD_ONCE_INIT KTHREAD_ONCE_INIT ++#define __GTHREAD_MUTEX_INIT_FUNCTION __gthr_mutex_init ++#define __GTHREAD_RECURSIVE_MUTEX_INIT_FUNCTION __gthr_recursive_mutex_init ++ ++static inline int __gthread_active_p(void) { ++ return 1; ++} ++ ++#ifdef _LIBOBJC ++ ++/* This stuff only applies to Objective C. */ ++ ++/* The config.h file in libobjc/ */ ++#include <config.h> ++ ++/* Key structure for maintaining thread specific storage */ ++static kthread_key_t _objc_thread_storage; ++ ++/* Backend initialization funcitons */ ++ ++/* Initialize the threads subsystem. */ ++static inline int __gthread_objc_init_thread_system(void) { ++ /* The only thing we have to do is to initialize the storage key. */ ++ return kthread_key_create(&_objc_thread_storage, NULL); ++} ++ ++/* Close the threads subsystem. */ ++static inline int __gthread_objc_close_thread_system(void) { ++ return kthread_key_delete(_objc_thread_storage); ++} ++ ++/* Backend thread functions */ ++ ++/* Create a new thread of execution. */ ++static inline objc_thread_t __gthread_objc_thread_detach(void (*func)(void *), ++ void *arg) { ++ kthread_t *thd_hnd; ++ ++ thd_hnd = thd_create(func, arg); ++ return (objc_thread_t)thd_hnd; ++} ++ ++/* Set the current thread's priority. */ ++static inline int __gthread_objc_thread_set_priority(int priority __attribute__((unused))) { ++ /* XXXX */ ++ return -1; ++} ++ ++/* Return the current thread's priority. */ ++static inline int __gthread_objc_thread_get_priority(void) { ++ /* XXXX */ ++ return OBJC_THREAD_INTERACTIVE_PRIORITY; ++} ++ ++/* Yield our process time to another thread. */ ++static inline void __gthread_objc_thread_yield(void) { ++ thd_pass(); ++} ++ ++/* Terminate the current thread. */ ++static inline int __gthread_objc_thread_exit(void) { ++ thd_exit(); ++ ++ /* Failed if we reached here */ ++ return -1; ++} ++ ++/* Returns an integer value which uniquely describes a thread. */ ++static inline objc_thread_t __gthread_objc_thread_id(void) { ++ return (objc_thread_t)thd_get_current(); ++} ++ ++/* Sets the thread's local storage pointer. */ ++static inline int __gthread_objc_thread_set_data(void *value) { ++ return kthread_setspecific(_objc_thread_storage, value); ++} ++ ++/* Returns the thread's local storage pointer. */ ++static inline void *__gthread_objc_thread_get_data(void) { ++ return kthread_getspecific(_objc_thread_storage); ++} ++ ++/* Backend mutex functions */ ++ ++/* Allocate a mutex. */ ++static inline int __gthread_objc_mutex_allocate(objc_mutex_t mutex) { ++ mutex_t *m = mutex_create(); ++ ++ if(m) { ++ mutex->backend = (void *)m; ++ return 0; ++ } ++ ++ mutex->backend = NULL; ++ return -1; ++} ++ ++/* Deallocate a mutex. */ ++static inline int __gthread_objc_mutex_deallocate(objc_mutex_t mutex) { ++ mutex_t *m = (mutex_t *)mutex->backend; ++ ++ if(mutex_is_locked(m)) { ++ mutex_unlock(m); ++ } ++ ++ mutex_destroy(m); ++ mutex->backend = NULL; ++ ++ return 0; ++} ++ ++/* Grab a lock on a mutex. */ ++static inline int __gthread_objc_mutex_lock(objc_mutex_t mutex) { ++ return mutex_lock((mutex_t *)mutex->backend); ++} ++ ++/* Try to grab a lock on a mutex. */ ++static inline int __gthread_objc_mutex_trylock(objc_mutex_t mutex) { ++ return mutex_trylock((mutex_t *)mutex->backend); ++} ++ ++/* Unlock the mutex. */ ++static inline int __gthread_objc_mutex_unlock(objc_mutex_t mutex) { ++ mutex_unlock((mutex_t *)mutex->backend); ++ return 0; ++} ++ ++/* Backend condition mutex functions */ ++ ++/* Allocate a condition. */ ++static inline int __gthread_objc_condition_allocate(objc_condition_t cond) { ++ condvar_t *c = cond_create(); ++ ++ if(c) { ++ cond->backend = (void *)c; ++ return 0; ++ } ++ ++ cond->backend = NULL; ++ return -1; ++} ++ ++/* Deallocate a condition. */ ++static inline int __gthread_objc_condition_deallocate(objc_condition_t cond) { ++ cond_destroy((condvar_t *)cond->backend); ++ cond->backend = NULL; ++ return 0; ++} ++ ++/* Wait on the condition. */ ++static inline int __gthread_objc_condition_wait(objc_condition_t cond, ++ objc_mutex_t mutex) { ++ return cond_wait((condvar_t *)cond->backend, (mutex_t *)mutex->backend); ++} ++ ++/* Wake up all threads waiting on this condition. */ ++static inline int __gthread_objc_condition_broadcast(objc_condition_t cond) { ++ cond_broadcast((condvar_t *)cond->backend); ++ return 0; ++} ++ ++/* Wake up one thread waiting on this condition. */ ++static inline int __gthread_objc_condition_signal(objc_condition_t cond) { ++ cond_signal((condvar_t *)cond->backend); ++ return 0; ++} ++ ++#else /* _LIBOBJC */ ++ ++static inline int __gthread_once(__gthread_once_t *__once, ++ void (*__func)(void)) { ++ return kthread_once(__once, __func); ++} ++ ++static inline int __gthread_key_create(__gthread_key_t *__key, ++ void (*__func)(void *)) { ++ return kthread_key_create(__key, __func); ++} ++ ++static int __gthread_key_delete(__gthread_key_t __key) { ++ return kthread_key_delete(__key); ++} ++ ++static inline void *__gthread_getspecific(__gthread_key_t __key) { ++ return kthread_getspecific(__key); ++} ++ ++static inline int __gthread_setspecific(__gthread_key_t __key, ++ const void *__v) { ++ return kthread_setspecific(__key, __v); ++} ++ ++static inline int __gthread_mutex_destroy(__gthread_mutex_t *__mutex) { ++ assert(__mutex); ++ mutex_destroy(*__mutex); ++ return 0; ++} ++ ++static inline int __gthread_mutex_lock(__gthread_mutex_t *__mutex) { ++ assert(__mutex); ++ return mutex_lock(*__mutex); ++} ++ ++static inline int __gthread_mutex_trylock(__gthread_mutex_t *__mutex) { ++ assert(__mutex); ++ return mutex_trylock(*__mutex); ++} ++ ++static inline int __gthread_mutex_unlock(__gthread_mutex_t *__mutex) { ++ assert(__mutex); ++ mutex_unlock(*__mutex); ++ return 0; ++} ++ ++static inline int __gthread_recursive_mutex_lock(__gthread_recursive_mutex_t *__mutex) { ++ assert(__mutex); ++ return rlock_lock(*__mutex); ++} ++ ++static inline int __gthread_recursive_mutex_trylock(__gthread_recursive_mutex_t *__mutex) { ++ assert(__mutex); ++ return rlock_trylock(*__mutex); ++} ++ ++static inline int __gthread_recursive_mutex_unlock(__gthread_recursive_mutex_t *__mutex) { ++ assert(__mutex); ++ return rlock_unlock(*__mutex); ++} ++ ++#endif /* _LIBOBJC */ ++ ++#endif /* ! GCC_GTHR_KOS_H */ Added: kos/utils/dc-chain/patches/gcc-4.4.4-kos.diff =================================================================== --- kos/utils/dc-chain/patches/gcc-4.4.4-kos.diff (rev 0) +++ kos/utils/dc-chain/patches/gcc-4.4.4-kos.diff 2010-06-15 14:10:22 UTC (rev 663) @@ -0,0 +1,1958 @@ +diff -ruN gcc-4.4.4/gcc/config/sh/crt1.asm gcc-4.4.4-kos/gcc/config/sh/crt1.asm +--- gcc-4.4.4/gcc/config/sh/crt1.asm 2009-04-09 19:23:07.000000000 -0400 ++++ gcc-4.4.4-kos/gcc/config/sh/crt1.asm 2010-06-13 16:21:39.000000000 -0400 +@@ -1,1369 +1,197 @@ +-/* Copyright (C) 2000, 2001, 2003, 2004, 2005, 2006, 2009 +- Free Software Foundation, Inc. +- This file was pretty much copied from newlib. ++! KallistiOS ##version## ++! ++! startup.s ++! (c)2000-2001 Dan Potter ++! ++! This file must appear FIRST in your linking order, or your program won't ++! work correctly as a raw binary. ++! ++! This is very loosely based on Marcus' crt0.s/startup.s ++! ++ ++.globl start ++.globl _start ++.globl _arch_real_exit ++.globl __arch_old_sr ++.globl __arch_old_vbr ++.globl __arch_old_stack ++.globl __arch_old_fpscr + +-This file is part of GCC. +- +-GCC 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 3, or (at your option) any +-later version. +- +-GCC 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. +- +-Under Section 7 of GPL version 3, you are granted additional +-permissions described in the GCC Runtime Library Exception, version +-3.1, as published by the Free Software Foundation. +- +-You should have received a copy of the GNU General Public License and +-a copy of the GCC Runtime Library Exception along with this program; +-see the files COPYING3 and COPYING.RUNTIME respectively. If not, see +-<http://www.gnu.org/licenses/>. */ +- +- +-#ifdef MMU_SUPPORT +- /* Section used for exception/timer interrupt stack area */ +- .section .data.vbr.stack,"aw" +- .align 4 +- .global __ST_VBR +-__ST_VBR: +- .zero 1024 * 2 /* ; 2k for VBR handlers */ +-/* Label at the highest stack address where the stack grows from */ +-__timer_stack: +-#endif /* MMU_SUPPORT */ +- +- /* ;---------------------------------------- +- Normal newlib crt1.asm */ +- +-#ifdef __SH5__ +- .section .data,"aw" +- .global ___data +-___data: +- +- .section .rodata,"a" +- .global ___rodata +-___rodata: +- +-#define ICCR_BASE 0x01600000 +-#define OCCR_BASE 0x01e00000 +-#define MMUIR_BASE 0x00000000 +-#define MMUDR_BASE 0x00800000 +- +-#define PTE_ENABLED 1 +-#define PTE_DISABLED 0 +- +-#define PTE_SHARED (1 << 1) +-#define PTE_NOT_SHARED 0 +- +-#define PTE_CB_UNCACHEABLE 0 +-#define PTE_CB_DEVICE 1 +-#define PTE_CB_CACHEABLE_WB 2 +-#define PTE_CB_CACHEABLE_WT 3 +- +-#define PTE_SZ_4KB (0 << 3) +-#define PTE_SZ_64KB (1 << 3) +-#define PTE_SZ_1MB (2 << 3) +-#define PTE_SZ_512MB (3 << 3) +- +-#define PTE_PRR (1 << 6) +-#define PTE_PRX (1 << 7) +-#define PTE_PRW (1 << 8) +-#define PTE_PRU (1 << 9) +- +-#define SR_MMU_BIT 31 +-#define SR_BL_BIT 28 +- +-#define ALIGN_4KB (0xfff) +-#define ALIGN_1MB (0xfffff) +-#define ALIGN_512MB (0x1fffffff) +- +-#define DYNACON_BASE 0x0f000000 +-#define DM_CB_DLINK_BASE 0x0c000000 +-#define DM_DB_DLINK_BASE 0x0b000000 +- +-#define FEMI_AREA_0 0x00000000 +-#define FEMI_AREA_1 0x04000000 +-#define FEMI_AREA_2 0x05000000 +-#define FEMI_AREA_3 0x06000000 +-#define FEMI_AREA_4 0x07000000 +-#define FEMI_CB 0x08000000 +- +-#define EMI_BASE 0X80000000 +- +-#define DMA_BASE 0X0e000000 +- +-#define CPU_BASE 0X0d000000 +- +-#define PERIPH_BASE 0X09000000 +-#define DMAC_BASE 0x0e000000 +-#define INTC_BASE 0x0a000000 +-#define CPRC_BASE 0x0a010000 +-#define TMU_BASE 0x0a020000 +-#define SCIF_BASE 0x0a030000 +-#define RTC_BASE 0x0a040000 +- +- +- +-#define LOAD_CONST32(val, reg) \ +- movi ((val) >> 16) & 65535, reg; \ +- shori (val) & 65535, reg +- +-#define LOAD_PTEH_VAL(sym, align, bits, scratch_reg, reg) \ +- LOAD_ADDR (sym, reg); \ +- LOAD_CONST32 ((align), scratch_reg); \ +- andc reg, scratch_reg, reg; \ +- LOAD_CONST32 ((bits), scratch_reg); \ +- or reg, scratch_reg, reg +- +-#define LOAD_PTEL_VAL(sym, align, bits, scratch_reg, reg) \ +- LOAD_ADDR (sym, reg); \ +- LOAD_CONST32 ((align), scratch_reg); \ +- andc reg, scratch_reg, reg; \ +- LOAD_CONST32 ((bits), scratch_reg); \ +- or reg, scratch_reg, reg +- +-#define SET_PTE(pte_addr_reg, p... [truncated message content] |
From: <los...@us...> - 2010-04-26 03:58:19
|
Revision: 662 http://cadcdev.svn.sourceforge.net/cadcdev/?rev=662&view=rev Author: lostgeneration Date: 2010-04-26 03:58:13 +0000 (Mon, 26 Apr 2010) Log Message: ----------- KOS as of commit 657 requires newlib 1.15.0. * If newlib 1.15.0 is still deemed unstable, fix newlib. Modified Paths: -------------- kos/utils/dc-chain/Makefile kos/utils/dc-chain/download.sh kos/utils/dc-chain/unpack.sh Modified: kos/utils/dc-chain/Makefile =================================================================== --- kos/utils/dc-chain/Makefile 2010-04-25 23:18:27 UTC (rev 661) +++ kos/utils/dc-chain/Makefile 2010-04-26 03:58:13 UTC (rev 662) @@ -30,7 +30,7 @@ kos_base=$(kos_root)/kos binutils_ver=2.17 gcc_ver=3.4.6 -newlib_ver=1.12.0 +newlib_ver=1.15.0 gdb_ver=6.7.1 insight_ver=6.7.1 thread_model=posix Modified: kos/utils/dc-chain/download.sh =================================================================== --- kos/utils/dc-chain/download.sh 2010-04-25 23:18:27 UTC (rev 661) +++ kos/utils/dc-chain/download.sh 2010-04-26 03:58:13 UTC (rev 662) @@ -1,5 +1,5 @@ #!/bin/sh wget -c ftp://ftp.gnu.org/gnu/binutils/binutils-2.17.tar.bz2 || exit 1 wget -c ftp://ftp.gnu.org/gnu/gcc/gcc-3.4.6/gcc-3.4.6.tar.bz2 || exit 1 -wget -c ftp://sources.redhat.com/pub/newlib/newlib-1.12.0.tar.gz || exit 1 +wget -c ftp://sources.redhat.com/pub/newlib/newlib-1.15.0.tar.gz || exit 1 Modified: kos/utils/dc-chain/unpack.sh =================================================================== --- kos/utils/dc-chain/unpack.sh 2010-04-25 23:18:27 UTC (rev 661) +++ kos/utils/dc-chain/unpack.sh 2010-04-26 03:58:13 UTC (rev 662) @@ -1,7 +1,7 @@ #!/bin/sh -rm -rf binutils-2.17 gcc-3.4.6 newlib-1.12.0 +rm -rf binutils-2.17 gcc-3.4.6 newlib-1.15.0 tar jxf binutils-2.17.tar.bz2 || exit 1 tar jxf gcc-3.4.6.tar.bz2 || exit 1 -tar zxf newlib-1.12.0.tar.gz || exit 1 +tar zxf newlib-1.15.0.tar.gz || exit 1 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ljs...@us...> - 2010-04-25 23:18:33
|
Revision: 661 http://cadcdev.svn.sourceforge.net/cadcdev/?rev=661&view=rev Author: ljsebald Date: 2010-04-25 23:18:27 +0000 (Sun, 25 Apr 2010) Log Message: ----------- Adding in "ping" example. Modified Paths: -------------- kos/examples/dreamcast/network/Makefile Added Paths: ----------- kos/examples/dreamcast/network/ping/ kos/examples/dreamcast/network/ping/Makefile kos/examples/dreamcast/network/ping/ping.c Modified: kos/examples/dreamcast/network/Makefile =================================================================== --- kos/examples/dreamcast/network/Makefile 2010-04-25 23:01:47 UTC (rev 660) +++ kos/examples/dreamcast/network/Makefile 2010-04-25 23:18:27 UTC (rev 661) @@ -7,16 +7,19 @@ all: $(KOS_MAKE) -C basic $(KOS_MAKE) -C httpd + $(KOS_MAKE) -C ping # $(KOS_MAKE) -C dcload-ip-lwip-test clean: $(KOS_MAKE) -C basic clean $(KOS_MAKE) -C httpd clean + $(KOS_MAKE) -C ping clean # $(KOS_MAKE) -C dcload-ip-lwip-test clean - + dist: $(KOS_MAKE) -C basic dist $(KOS_MAKE) -C httpd dist + $(KOS_MAKE) -C ping dist # $(KOS_MAKE) -C dcload-ip-lwip-test dist Added: kos/examples/dreamcast/network/ping/Makefile =================================================================== --- kos/examples/dreamcast/network/ping/Makefile (rev 0) +++ kos/examples/dreamcast/network/ping/Makefile 2010-04-25 23:18:27 UTC (rev 661) @@ -0,0 +1,32 @@ +# +# Basic KallistiOS skeleton / test program +# (c)2001 Dan Potter +# + +# Put the filename of the output binary here +TARGET = ping.elf + +# List all of your C files here, but change the extension to ".o" +OBJS = ping.o + +all: rm-elf $(TARGET) + +include $(KOS_BASE)/Makefile.rules + +clean: + -rm -f $(TARGET) $(OBJS) + +rm-elf: + -rm -f $(TARGET) + +$(TARGET): $(OBJS) + $(KOS_CC) $(KOS_CFLAGS) $(KOS_LDFLAGS) -o $(TARGET) $(KOS_START) \ + $(OBJS) $(OBJEXTRA) $(KOS_LIBS) + +run: $(TARGET) + $(KOS_LOADER) $(TARGET) -n + +dist: + rm -f $(OBJS) + $(KOS_STRIP) $(TARGET) + Added: kos/examples/dreamcast/network/ping/ping.c =================================================================== --- kos/examples/dreamcast/network/ping/ping.c (rev 0) +++ kos/examples/dreamcast/network/ping/ping.c 2010-04-25 23:18:27 UTC (rev 661) @@ -0,0 +1,49 @@ +/* KallistiOS ##version## + + ping.c + Copyright (C) 2009 Lawrence Sebald + + This example is a very basic "ping" program, much like you might find on + any computer. However, this version lacks many of the niceties you might find + on a real OS' ping program. + + This example also shows how to display things on the framebuffer with the + "fb" device for dbgio. + +*/ + +#include <arch/arch.h> +#include <kos/net.h> +#include <kos/thread.h> +#include <kos/dbgio.h> + +KOS_INIT_FLAGS(INIT_DEFAULT | INIT_NET); + +#define DATA_SIZE 56 + +int main(int argc, char *argv[]) { + /* The address to ping... */ + uint8 addr[4] = { 192, 168, 1, 1 }; + uint8 data[DATA_SIZE]; + int i; + + dbgio_dev_select("fb"); + + /* Fill in the data for the ping packet... this is pretty simple and doesn't + really have any real meaning... */ + for(i = 0; i < DATA_SIZE; ++i) { + data[i] = (uint8)i; + } + + /* Send out 10 pings, waiting 250ms between attempts. */ + for(i = 0; i < 10; ++i) { + net_icmp_send_echo(net_default_dev, addr, data, DATA_SIZE); + thd_sleep(250); + } + + /* Wait 2 seconds for the user to see what's on the screen before we clear + it during the exit back to the loader */ + thd_sleep(2 * 1000); + + return 0; +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ljs...@us...> - 2010-04-25 23:01:53
|
Revision: 660 http://cadcdev.svn.sourceforge.net/cadcdev/?rev=660&view=rev Author: ljsebald Date: 2010-04-25 23:01:47 +0000 (Sun, 25 Apr 2010) Log Message: ----------- This seems a bit more sane for thd_schedule_next... Modified Paths: -------------- kos/kernel/thread/thread.c Modified: kos/kernel/thread/thread.c =================================================================== --- kos/kernel/thread/thread.c 2010-04-21 05:16:54 UTC (rev 659) +++ kos/kernel/thread/thread.c 2010-04-25 23:01:47 UTC (rev 660) @@ -479,13 +479,17 @@ interrupt return to jump back to the new thread instead of the one that was executing (unless it was already executing). */ void thd_schedule_next(kthread_t *thd) { + /* Make sure we're actually inside an interrupt */ + if (!irq_inside_int()) + return; + /* Can't boost a blocked thread */ - if (thd_current->state != STATE_READY) + if (thd->state != STATE_READY) return; /* Unfortunately we have to take care of this here */ if (thd_current->state == STATE_ZOMBIE) { - thd_destroy(thd); + thd_destroy(thd_current); } else if (thd_current->state == STATE_RUNNING) { thd_current->state = STATE_READY; thd_add_to_runnable(thd_current, 0); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <los...@us...> - 2010-04-21 05:17:00
|
Revision: 659 http://cadcdev.svn.sourceforge.net/cadcdev/?rev=659&view=rev Author: lostgeneration Date: 2010-04-21 05:16:54 +0000 (Wed, 21 Apr 2010) Log Message: ----------- A few more doxygen comments/updates * cdrom.h still isn't complete, parameters aren't documented in some cases Modified Paths: -------------- kos/kernel/arch/dreamcast/include/dc/cdrom.h kos/kernel/arch/dreamcast/include/dc/fmath.h Modified: kos/kernel/arch/dreamcast/include/dc/cdrom.h =================================================================== --- kos/kernel/arch/dreamcast/include/dc/cdrom.h 2010-04-21 04:44:35 UTC (rev 658) +++ kos/kernel/arch/dreamcast/include/dc/cdrom.h 2010-04-21 05:16:54 UTC (rev 659) @@ -13,6 +13,12 @@ #include <arch/types.h> +/** + \file dc/cdrom.h + \brief cdrom access + \author Dan Potter +*/ + /** \defgroup cmd_codes Command codes (thanks maiwe) @{ */ Modified: kos/kernel/arch/dreamcast/include/dc/fmath.h =================================================================== --- kos/kernel/arch/dreamcast/include/dc/fmath.h 2010-04-21 04:44:35 UTC (rev 658) +++ kos/kernel/arch/dreamcast/include/dc/fmath.h 2010-04-21 05:16:54 UTC (rev 659) @@ -13,12 +13,16 @@ #include <arch/types.h> -/* Inline functions for the DC's special math instructions */ +/** + \file dc/fmath.h + \brief Inline functions for the DC's special math instructions + \author Andrew Kieschnick +*/ -/* PI constant (if you don't want full math.h) */ +/** PI constant (if you don't want full math.h) */ #define F_PI 3.1415926f - +/** \cond */ #define __fsin(x) \ ({ float __value, __arg = (x), __scale = 10430.37835; \ asm( "fmul %2,%1\n\t" \ @@ -131,53 +135,87 @@ ); \ __w; }) -/* Returns v1 dot v2 (inner product) */ +/** \endcond */ + +/** \return v1 dot v2 (inner product) */ extern inline float fipr(float x, float y, float z, float w, float a, float b, float c, float d) { return __fipr(x, y, z, w, a, b, c, d); } -/* Returns v1 dot v1 (square of magnitude) */ +/** + \brief Floating point inner product w/self (square of vector magnitude) + \return v1 dot v1 (square of magnitude) +*/ extern inline float fipr_magnitude_sqr(float x, float y, float z, float w) { return __fipr_magnitude_sqr(x, y, z, w); } -/* Returns sin(r), where r is [0..2*PI] */ +/** + \brief Floating point sine + \param r a floating point number between 0 and 2*PI + \return sin(r), where r is [0..2*PI] +*/ extern inline float fsin(float r) { return __fsin(r); } -/* Returns cos(r), where r is [0..2*PI] */ +/** + \brief Floating point cosine + \param r a floating point number between 0 and 2*PI + \return cos(r), where r is [0..2*PI] +*/ extern inline float fcos(float r) { return __fcos(r); } -/* Returns tan(r), where r is [0..2*PI] */ +/** + \brief Floating point tangent + \param r a floating point number between 0 and 2*PI + \return tan(r), where r is [0..2*PI] +*/ extern inline float ftan(float r) { return __ftan(r); } -/* Returns sin(d), where d is [0..65535] */ +/** + \brief Integer sine + \param d an integer between 0 and 65535 + \return sin(d), where d is [0..65535] +*/ extern inline float fisin(int d) { return __fisin(d); } -/* Returns cos(d), where d is [0..65535] */ +/** + \brief Integer cosine + \param d an integer between 0 and 65535 + \return cos(d), where d is [0..65535] +*/ extern inline float ficos(int d) { return __ficos(d); } -/* Returns tan(d), where d is [0..65535] */ +/** + \brief Integer tangent + \param d an integer between 0 and 65535 + \return tan(d), where d is [0..65535] +*/ extern inline float fitan(int d) { return __fitan(d); } -/* Returns sqrt(f) */ +/** + \brief Floating point square root + \return sqrt(f) +*/ extern inline float fsqrt(float f) { return __fsqrt(f); } -/* Returns 1.0f / sqrt(f) */ +/** + \return 1.0f / sqrt(f) +*/ extern inline float frsqrt(float f) { return __frsqrt(f); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <los...@us...> - 2010-04-21 04:44:41
|
Revision: 658 http://cadcdev.svn.sourceforge.net/cadcdev/?rev=658&view=rev Author: lostgeneration Date: 2010-04-21 04:44:35 +0000 (Wed, 21 Apr 2010) Log Message: ----------- Added some doxygen comments to the assert.h and cdrom.h Modified Paths: -------------- kos/include/assert.h kos/kernel/arch/dreamcast/include/dc/cdrom.h Modified: kos/include/assert.h =================================================================== --- kos/include/assert.h 2010-04-14 21:42:55 UTC (rev 657) +++ kos/include/assert.h 2010-04-21 04:44:35 UTC (rev 658) @@ -11,6 +11,16 @@ #include <kos/cdefs.h> __BEGIN_DECLS +/** + \file assert.h + \brief Standard C Assertions + + This file contains the standard C assertions to raise an assertion or to + change the assertion handler. + + \author Dan Potter +*/ + /* This is nice and simple, modeled after the BSD one like most of KOS; the addition here is assert_msg(), which allows you to provide an error message. */ @@ -21,7 +31,25 @@ # define assert(e) ((void)0) # define assert_msg(e, m) ((void)0) #else +/** + \brief standard C assertion + + \param e a value or expression to be evaluated as true or false + + \return if e is true (void)0 is returned, otherwise, the function does not + return and abort() is called +*/ # define assert(e) ((e) ? (void)0 : __assert(__FILE__, __LINE__, #e, NULL, __FUNCTION__)) + +/** + \brief assert with a custom message + + \param e a value or expression to be evaluated as true or false + \param m a const char * message + + \return if e is true (void)0 is returned, otherwise the function does not + return, a custom message is displayed, and abort() is called +*/ # define assert_msg(e, m) ((e) ? (void)0 : __assert(__FILE__, __LINE__, #e, m, __FUNCTION__)) #endif @@ -29,11 +57,32 @@ void __assert(const char *file, int line, const char *expr, const char *msg, const char *func); -/* Set an "assert handler" which is called whenever an assert happens. - By default, this will print a message and call abort(). Returns the old - handler's address. */ +/** + \brief assert handler + + An assertion handler can be a user defined assertion handler, + otherwise the default is used, which calls abort() + + \param file The filename where the assertion happened + \param line The line number where the assertion happened + \param expr The expression that raised the assertion + \param msg A custom message for why the assertion happened + \param func The function name from which the assertion happened + + \sa assert_set_handler +*/ typedef void (*assert_handler_t)(const char * file, int line, const char * expr, const char * msg, const char * func); + +/** + \brief set an "assert handler" to call on an assert + + By default, this will print a message and call abort(). + + \return the old assert_handler_t address + + \sa assert_handler_t +*/ assert_handler_t assert_set_handler(assert_handler_t hnd); __END_DECLS Modified: kos/kernel/arch/dreamcast/include/dc/cdrom.h =================================================================== --- kos/kernel/arch/dreamcast/include/dc/cdrom.h 2010-04-14 21:42:55 UTC (rev 657) +++ kos/kernel/arch/dreamcast/include/dc/cdrom.h 2010-04-21 04:44:35 UTC (rev 658) @@ -13,7 +13,9 @@ #include <arch/types.h> -/* Command codes (thanks maiwe) */ +/** \defgroup cmd_codes Command codes (thanks maiwe) + @{ +*/ #define CMD_PIOREAD 16 #define CMD_DMAREAD 17 #define CMD_GETTOC 18 @@ -28,27 +30,39 @@ #define CMD_STOP 33 #define CMD_GETSCD 34 #define CMD_GETSES 35 +/** @} */ -/* Command responses */ +/** \defgroup cmd_response Command responses + @{ +*/ #define ERR_OK 0 #define ERR_NO_DISC 1 #define ERR_DISC_CHG 2 #define ERR_SYS 3 #define ERR_ABORTED 4 #define ERR_NO_ACTIVE 5 +/** @} */ -/* Command Status responses */ +/** \defgroup cmd_status_response Command Status responses + @{ +*/ #define FAILED -1 #define NO_ACTIVE 0 #define PROCESSING 1 #define COMPLETED 2 #define ABORTED 3 +/** @} */ -/* CDDA Read Modes */ +/** \defgroup cdda_read_modes CDDA Read Modes + @{ +*/ #define CDDA_TRACKS 1 #define CDDA_SECTORS 2 +/** @} */ -/* Status values */ +/** \defgroup status_values Status values + @{ +*/ #define CD_STATUS_BUSY 0 #define CD_STATUS_PAUSED 1 #define CD_STATUS_STANDBY 2 @@ -57,62 +71,118 @@ #define CD_STATUS_SCANNING 5 #define CD_STATUS_OPEN 6 #define CD_STATUS_NO_DISC 7 +/** @} */ -/* Disk types */ +/** \defgroup disk_types Disk types + @{ +*/ #define CD_CDDA 0 #define CD_CDROM 0x10 #define CD_CDROM_XA 0x20 #define CD_CDI 0x30 #define CD_GDROM 0x80 +/** @} */ -/* TOC structure returned by the BIOS */ +/** TOC structure returned by the BIOS */ typedef struct { uint32 entry[99]; uint32 first, last; uint32 leadout_sector; } CDROM_TOC; -/* TOC access macros */ +/** \defgroup toc_access TOC access macros + @{ +*/ #define TOC_LBA(n) ((n) & 0x00ffffff) #define TOC_ADR(n) ( ((n) & 0x0f000000) >> 24 ) #define TOC_CTRL(n) ( ((n) & 0xf0000000) >> 28 ) #define TOC_TRACK(n) ( ((n) & 0x00ff0000) >> 16 ) +/** @} */ -/* Sets the sector size */ +/** + \brief Sets the sector size + + \param size The size of the sector you're desiring +*/ void set_sector_size (int size); -/* Command execution sequence */ +/** + \brief Command execution sequence + + \return \ref cmd_response +*/ int cdrom_exec_cmd(int cmd, void *param); -/* Return the status of the drive as two integers (see constants) */ +/** + \brief Gets the status of the the cdrom + \return the status of the drive as two integers (see constants) +*/ int cdrom_get_status(int *status, int *disc_type); -/* Re-init the drive, e.g., after a disc change, etc */ +/** + \brief Re-init the drive, e.g., after a disc change, etc + + \return \ref cmd_response +*/ int cdrom_reinit(); -/* Read the table of contents */ +/** + \brief Read the table of contents + + \return \ref cmd_response +*/ int cdrom_read_toc(CDROM_TOC *toc_buffer, int session); -/* Read one or more sectors */ +/** + \brief Read one or more sector + + \return \ref cmd_response +*/ int cdrom_read_sectors(void *buffer, int sector, int cnt); -/* Locate the LBA sector of the data track */ +/** + \brief Locate the LBA sector of the data track +*/ uint32 cdrom_locate_data_track(CDROM_TOC *toc); -/* Play CDDA audio tracks or sectors */ +/** + \brief Play CDDA audio tracks or sectors + + \return \ref cmd_response +*/ int cdrom_cdda_play(uint32 start, uint32 end, uint32 loops, int mode); -/* Pause CDDA audio playback */ +/* + \brief Pause CDDA audio playback + + \return \ref cmd_response +*/ int cdrom_cdda_pause(); -/* Resume CDDA audio playback */ +/** + \brief Resume CDDA audio playback + + \return \ref cmd_response +*/ int cdrom_cdda_resume(); -/* Spin down the CD */ +/** + \brief Spin down the CD + + \return \ref cmd_response +*/ int cdrom_spin_down(); -/* Initialize */ +/** + \brief Initialize cdrom + + \return -1 if cdrom_init has already been called, otherwise 0 +*/ int cdrom_init(); + +/** + \brief Shutdown cdrom +*/ void cdrom_shutdown(); __END_DECLS This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ljs...@us...> - 2010-04-14 21:43:02
|
Revision: 657 http://cadcdev.svn.sourceforge.net/cadcdev/?rev=657&view=rev Author: ljsebald Date: 2010-04-14 21:42:55 +0000 (Wed, 14 Apr 2010) Log Message: ----------- Ok... I didn't really mean for this commit to be so large, but apparently I haven't committed anything in a long while... - Fix the Doxyfile a bit more. - Add Doxygen comments to a bunch of headers (stuff I've added over time). - Modularize the socket protocol handlers a bit (to make adding new protocols much easier later). - Fix the prototypes of the htonl/htons/ntohl/ntohs functions to align with IEEE 1003.1-2008. - Fix some of the network related stuff for alignment with IEEE 1003.1-2008. Modified Paths: -------------- kos/doc/Doxyfile kos/include/arpa/inet.h kos/include/kos/fs_socket.h kos/include/kos/once.h kos/include/kos/recursive_lock.h kos/include/kos/rwsem.h kos/include/kos/tls.h kos/include/netinet/in.h kos/include/sys/socket.h kos/kernel/fs/fs_socket.c kos/kernel/libc/koslib/byteorder.c kos/kernel/net/net_udp.c kos/kernel/net/net_udp.h kos/kernel/thread/once.c Modified: kos/doc/Doxyfile =================================================================== --- kos/doc/Doxyfile 2010-02-20 04:34:13 UTC (rev 656) +++ kos/doc/Doxyfile 2010-04-14 21:42:55 UTC (rev 657) @@ -1,4 +1,4 @@ -# Doxyfile 1.5.6 +# Doxyfile 1.6.2 # This file describes the settings to be used by the documentation system # doxygen (www.doxygen.org) for a project @@ -14,211 +14,215 @@ # Project related configuration options #--------------------------------------------------------------------------- -# This tag specifies the encoding used for all characters in the config file -# that follow. The default is UTF-8 which is also the encoding used for all -# text before the first occurrence of this tag. Doxygen uses libiconv (or the -# iconv built into libc) for the transcoding. See +# This tag specifies the encoding used for all characters in the config file +# that follow. The default is UTF-8 which is also the encoding used for all +# text before the first occurrence of this tag. Doxygen uses libiconv (or the +# iconv built into libc) for the transcoding. See # http://www.gnu.org/software/libiconv for the list of possible encodings. DOXYFILE_ENCODING = UTF-8 -# The PROJECT_NAME tag is a single word (or a sequence of words surrounded +# The PROJECT_NAME tag is a single word (or a sequence of words surrounded # by quotes) that should identify the project. PROJECT_NAME = "KallistiOS" -# The PROJECT_NUMBER tag can be used to enter a project or revision number. -# This could be handy for archiving the generated documentation or +# The PROJECT_NUMBER tag can be used to enter a project or revision number. +# This could be handy for archiving the generated documentation or # if some version control system is used. PROJECT_NUMBER = "##version##" -# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) -# base path where the generated documentation will be put. -# If a relative path is entered, it will be relative to the location +# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) +# base path where the generated documentation will be put. +# If a relative path is entered, it will be relative to the location # where doxygen was started. If left blank the current directory will be used. OUTPUT_DIRECTORY = $(KOS_BASE)/doc/reference -# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create -# 4096 sub-directories (in 2 levels) under the output directory of each output -# format and will distribute the generated files over these directories. -# Enabling this option can be useful when feeding doxygen a huge amount of -# source files, where putting all generated files in the same directory would +# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create +# 4096 sub-directories (in 2 levels) under the output directory of each output +# format and will distribute the generated files over these directories. +# Enabling this option can be useful when feeding doxygen a huge amount of +# source files, where putting all generated files in the same directory would # otherwise cause performance problems for the file system. CREATE_SUBDIRS = NO -# The OUTPUT_LANGUAGE tag is used to specify the language in which all -# documentation generated by doxygen is written. Doxygen will use this -# information to generate all constant output in the proper language. -# The default language is English, other supported languages are: -# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, -# Croatian, Czech, Danish, Dutch, Farsi, Finnish, French, German, Greek, -# Hungarian, Italian, Japanese, Japanese-en (Japanese with English messages), -# Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, Polish, -# Portuguese, Romanian, Russian, Serbian, Slovak, Slovene, Spanish, Swedish, -# and Ukrainian. +# The OUTPUT_LANGUAGE tag is used to specify the language in which all +# documentation generated by doxygen is written. Doxygen will use this +# information to generate all constant output in the proper language. +# The default language is English, other supported languages are: +# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, +# Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German, +# Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English +# messages), Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, +# Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrilic, Slovak, +# Slovene, Spanish, Swedish, Ukrainian, and Vietnamese. OUTPUT_LANGUAGE = English -# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will -# include brief member descriptions after the members that are listed in -# the file and class documentation (similar to JavaDoc). +# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will +# include brief member descriptions after the members that are listed in +# the file and class documentation (similar to JavaDoc). # Set to NO to disable this. BRIEF_MEMBER_DESC = YES -# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend -# the brief description of a member or function before the detailed description. -# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the +# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend +# the brief description of a member or function before the detailed description. +# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the # brief descriptions will be completely suppressed. REPEAT_BRIEF = YES -# This tag implements a quasi-intelligent brief description abbreviator -# that is used to form the text in various listings. Each string -# in this list, if found as the leading text of the brief description, will be -# stripped from the text and the result after processing the whole list, is -# used as the annotated text. Otherwise, the brief description is used as-is. -# If left blank, the following values are used ("$name" is automatically -# replaced with the name of the entity): "The $name class" "The $name widget" -# "The $name file" "is" "provides" "specifies" "contains" +# This tag implements a quasi-intelligent brief description abbreviator +# that is used to form the text in various listings. Each string +# in this list, if found as the leading text of the brief description, will be +# stripped from the text and the result after processing the whole list, is +# used as the annotated text. Otherwise, the brief description is used as-is. +# If left blank, the following values are used ("$name" is automatically +# replaced with the name of the entity): "The $name class" "The $name widget" +# "The $name file" "is" "provides" "specifies" "contains" # "represents" "a" "an" "the" -ABBREVIATE_BRIEF = +ABBREVIATE_BRIEF = -# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then -# Doxygen will generate a detailed section even if there is only a brief +# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then +# Doxygen will generate a detailed section even if there is only a brief # description. ALWAYS_DETAILED_SEC = NO -# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all -# inherited members of a class in the documentation of that class as if those -# members were ordinary class members. Constructors, destructors and assignment +# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all +# inherited members of a class in the documentation of that class as if those +# members were ordinary class members. Constructors, destructors and assignment # operators of the base classes will not be shown. INLINE_INHERITED_MEMB = NO -# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full -# path before files name in the file list and in the header files. If set +# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full +# path before files name in the file list and in the header files. If set # to NO the shortest path that makes the file name unique will be used. FULL_PATH_NAMES = YES -# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag -# can be used to strip a user-defined part of the path. Stripping is -# only done if one of the specified strings matches the left-hand part of -# the path. The tag can be used to show relative paths in the file list. -# If left blank the directory from which doxygen is run is used as the +# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag +# can be used to strip a user-defined part of the path. Stripping is +# only done if one of the specified strings matches the left-hand part of +# the path. The tag can be used to show relative paths in the file list. +# If left blank the directory from which doxygen is run is used as the # path to strip. STRIP_FROM_PATH = $(KOS_BASE)/ -# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of -# the path mentioned in the documentation of a class, which tells -# the reader which header file to include in order to use a class. -# If left blank only the name of the header file containing the class -# definition is used. Otherwise one should specify the include paths that +# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of +# the path mentioned in the documentation of a class, which tells +# the reader which header file to include in order to use a class. +# If left blank only the name of the header file containing the class +# definition is used. Otherwise one should specify the include paths that # are normally passed to the compiler using the -I flag. -STRIP_FROM_INC_PATH = +STRIP_FROM_INC_PATH = -# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter -# (but less readable) file names. This can be useful is your file systems +# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter +# (but less readable) file names. This can be useful is your file systems # doesn't support long names like on DOS, Mac, or CD-ROM. SHORT_NAMES = NO -# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen -# will interpret the first line (until the first dot) of a JavaDoc-style -# comment as the brief description. If set to NO, the JavaDoc -# comments will behave just like regular Qt-style comments +# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen +# will interpret the first line (until the first dot) of a JavaDoc-style +# comment as the brief description. If set to NO, the JavaDoc +# comments will behave just like regular Qt-style comments # (thus requiring an explicit @brief command for a brief description.) JAVADOC_AUTOBRIEF = NO -# If the QT_AUTOBRIEF tag is set to YES then Doxygen will -# interpret the first line (until the first dot) of a Qt-style -# comment as the brief description. If set to NO, the comments -# will behave just like regular Qt-style comments (thus requiring +# If the QT_AUTOBRIEF tag is set to YES then Doxygen will +# interpret the first line (until the first dot) of a Qt-style +# comment as the brief description. If set to NO, the comments +# will behave just like regular Qt-style comments (thus requiring # an explicit \brief command for a brief description.) QT_AUTOBRIEF = NO -# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen -# treat a multi-line C++ special comment block (i.e. a block of //! or /// -# comments) as a brief description. This used to be the default behaviour. -# The new default is to treat a multi-line C++ comment block as a detailed +# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen +# treat a multi-line C++ special comment block (i.e. a block of //! or /// +# comments) as a brief description. This used to be the default behaviour. +# The new default is to treat a multi-line C++ comment block as a detailed # description. Set this tag to YES if you prefer the old behaviour instead. MULTILINE_CPP_IS_BRIEF = NO -# If the DETAILS_AT_TOP tag is set to YES then Doxygen -# will output the detailed description near the top, like JavaDoc. -# If set to NO, the detailed description appears after the member -# documentation. - -DETAILS_AT_TOP = YES - -# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented -# member inherits the documentation from any documented member that it +# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented +# member inherits the documentation from any documented member that it # re-implements. INHERIT_DOCS = YES -# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce -# a new page for each member. If set to NO, the documentation of a member will +# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce +# a new page for each member. If set to NO, the documentation of a member will # be part of the file/class/namespace that contains it. SEPARATE_MEMBER_PAGES = NO -# The TAB_SIZE tag can be used to set the number of spaces in a tab. +# The TAB_SIZE tag can be used to set the number of spaces in a tab. # Doxygen uses this value to replace tabs by spaces in code fragments. TAB_SIZE = 8 -# This tag can be used to specify a number of aliases that acts -# as commands in the documentation. An alias has the form "name=value". -# For example adding "sideeffect=\par Side Effects:\n" will allow you to -# put the command \sideeffect (or @sideeffect) in the documentation, which -# will result in a user-defined paragraph with heading "Side Effects:". +# This tag can be used to specify a number of aliases that acts +# as commands in the documentation. An alias has the form "name=value". +# For example adding "sideeffect=\par Side Effects:\n" will allow you to +# put the command \sideeffect (or @sideeffect) in the documentation, which +# will result in a user-defined paragraph with heading "Side Effects:". # You can put \n's in the value part of an alias to insert newlines. -ALIASES = +ALIASES = -# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C -# sources only. Doxygen will then generate output that is more tailored for C. -# For instance, some of the names that are used will be different. The list +# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C +# sources only. Doxygen will then generate output that is more tailored for C. +# For instance, some of the names that are used will be different. The list # of all members will be omitted, etc. OPTIMIZE_OUTPUT_FOR_C = YES -# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java -# sources only. Doxygen will then generate output that is more tailored for -# Java. For instance, namespaces will be presented as packages, qualified +# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java +# sources only. Doxygen will then generate output that is more tailored for +# Java. For instance, namespaces will be presented as packages, qualified # scopes will look different, etc. OPTIMIZE_OUTPUT_JAVA = NO -# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran -# sources only. Doxygen will then generate output that is more tailored for +# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran +# sources only. Doxygen will then generate output that is more tailored for # Fortran. OPTIMIZE_FOR_FORTRAN = NO -# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL -# sources. Doxygen will then generate output that is tailored for +# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL +# sources. Doxygen will then generate output that is tailored for # VHDL. OPTIMIZE_OUTPUT_VHDL = NO -# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want -# to include (a tag file for) the STL sources as input, then you should -# set this tag to YES in order to let doxygen match functions declarations and -# definitions whose arguments contain STL classes (e.g. func(std::string); v.s. -# func(std::string) {}). This also make the inheritance and collaboration +# Doxygen selects the parser to use depending on the extension of the files it parses. +# With this tag you can assign which parser to use for a given extension. +# Doxygen has a built-in mapping, but you can override or extend it using this tag. +# The format is ext=language, where ext is a file extension, and language is one of +# the parsers supported by doxygen: IDL, Java, Javascript, C#, C, C++, D, PHP, +# Objective-C, Python, Fortran, VHDL, C, C++. For instance to make doxygen treat +# .inc files as Fortran files (default is PHP), and .f files as C (default is Fortran), +# use: inc=Fortran f=C. Note that for custom extensions you also need to set FILE_PATTERNS otherwise the files are not read by doxygen. + +EXTENSION_MAPPING = + +# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want +# to include (a tag file for) the STL sources as input, then you should +# set this tag to YES in order to let doxygen match functions declarations and +# definitions whose arguments contain STL classes (e.g. func(std::string); v.s. +# func(std::string) {}). This also make the inheritance and collaboration # diagrams that involve STL classes more complete and accurate. BUILTIN_STL_SUPPORT = NO @@ -228,413 +232,452 @@ CPP_CLI_SUPPORT = NO -# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only. -# Doxygen will parse them like normal C++ but will assume all classes use public +# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only. +# Doxygen will parse them like normal C++ but will assume all classes use public # instead of private inheritance when no explicit protection keyword is present. SIP_SUPPORT = NO -# For Microsoft's IDL there are propget and propput attributes to indicate getter -# and setter methods for a property. Setting this option to YES (the default) -# will make doxygen to replace the get and set methods by a property in the -# documentation. This will only work if the methods are indeed getting or -# setting a simple type. If this is not the case, or you want to show the +# For Microsoft's IDL there are propget and propput attributes to indicate getter +# and setter methods for a property. Setting this option to YES (the default) +# will make doxygen to replace the get and set methods by a property in the +# documentation. This will only work if the methods are indeed getting or +# setting a simple type. If this is not the case, or you want to show the # methods anyway, you should set this option to NO. IDL_PROPERTY_SUPPORT = YES -# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC -# tag is set to YES, then doxygen will reuse the documentation of the first -# member in the group (if any) for the other members of the group. By default +# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC +# tag is set to YES, then doxygen will reuse the documentation of the first +# member in the group (if any) for the other members of the group. By default # all members of a group must be documented explicitly. DISTRIBUTE_GROUP_DOC = NO -# Set the SUBGROUPING tag to YES (the default) to allow class member groups of -# the same type (for instance a group of public functions) to be put as a -# subgroup of that type (e.g. under the Public Functions section). Set it to -# NO to prevent subgrouping. Alternatively, this can be done per class using +# Set the SUBGROUPING tag to YES (the default) to allow class member groups of +# the same type (for instance a group of public functions) to be put as a +# subgroup of that type (e.g. under the Public Functions section). Set it to +# NO to prevent subgrouping. Alternatively, this can be done per class using # the \nosubgrouping command. SUBGROUPING = YES -# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum -# is documented as struct, union, or enum with the name of the typedef. So -# typedef struct TypeS {} TypeT, will appear in the documentation as a struct -# with name TypeT. When disabled the typedef will appear as a member of a file, -# namespace, or class. And the struct will be named TypeS. This can typically -# be useful for C code in case the coding convention dictates that all compound +# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum +# is documented as struct, union, or enum with the name of the typedef. So +# typedef struct TypeS {} TypeT, will appear in the documentation as a struct +# with name TypeT. When disabled the typedef will appear as a member of a file, +# namespace, or class. And the struct will be named TypeS. This can typically +# be useful for C code in case the coding convention dictates that all compound # types are typedef'ed and only the typedef is referenced, never the tag name. TYPEDEF_HIDES_STRUCT = NO +# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to +# determine which symbols to keep in memory and which to flush to disk. +# When the cache is full, less often used symbols will be written to disk. +# For small to medium size projects (<1000 input files) the default value is +# probably good enough. For larger projects a too small cache size can cause +# doxygen to be busy swapping symbols to and from disk most of the time +# causing a significant performance penality. +# If the system has enough physical memory increasing the cache will improve the +# performance by keeping more symbols in memory. Note that the value works on +# a logarithmic scale so increasing the size by one will rougly double the +# memory usage. The cache size is given by this formula: +# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0, +# corresponding to a cache size of 2^16 = 65536 symbols + +SYMBOL_CACHE_SIZE = 0 + #--------------------------------------------------------------------------- # Build related configuration options #--------------------------------------------------------------------------- -# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in -# documentation are documented, even if no documentation was available. -# Private class members and static file members will be hidden unless +# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in +# documentation are documented, even if no documentation was available. +# Private class members and static file members will be hidden unless # the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES EXTRACT_ALL = YES -# If the EXTRACT_PRIVATE tag is set to YES all private members of a class +# If the EXTRACT_PRIVATE tag is set to YES all private members of a class # will be included in the documentation. EXTRACT_PRIVATE = NO -# If the EXTRACT_STATIC tag is set to YES all static members of a file +# If the EXTRACT_STATIC tag is set to YES all static members of a file # will be included in the documentation. EXTRACT_STATIC = NO -# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) -# defined locally in source files will be included in the documentation. +# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) +# defined locally in source files will be included in the documentation. # If set to NO only classes defined in header files are included. EXTRACT_LOCAL_CLASSES = NO -# This flag is only useful for Objective-C code. When set to YES local -# methods, which are defined in the implementation section but not in -# the interface are included in the documentation. +# This flag is only useful for Objective-C code. When set to YES local +# methods, which are defined in the implementation section but not in +# the interface are included in the documentation. # If set to NO (the default) only methods in the interface are included. EXTRACT_LOCAL_METHODS = NO -# If this flag is set to YES, the members of anonymous namespaces will be -# extracted and appear in the documentation as a namespace called -# 'anonymous_namespace{file}', where file will be replaced with the base -# name of the file that contains the anonymous namespace. By default +# If this flag is set to YES, the members of anonymous namespaces will be +# extracted and appear in the documentation as a namespace called +# 'anonymous_namespace{file}', where file will be replaced with the base +# name of the file that contains the anonymous namespace. By default # anonymous namespace are hidden. EXTRACT_ANON_NSPACES = NO -# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all -# undocumented members of documented classes, files or namespaces. -# If set to NO (the default) these members will be included in the -# various overviews, but no documentation section is generated. +# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all +# undocumented members of documented classes, files or namespaces. +# If set to NO (the default) these members will be included in the +# various overviews, but no documentation section is generated. # This option has no effect if EXTRACT_ALL is enabled. HIDE_UNDOC_MEMBERS = NO -# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all -# undocumented classes that are normally visible in the class hierarchy. -# If set to NO (the default) these classes will be included in the various +# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all +# undocumented classes that are normally visible in the class hierarchy. +# If set to NO (the default) these classes will be included in the various # overviews. This option has no effect if EXTRACT_ALL is enabled. HIDE_UNDOC_CLASSES = NO -# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all -# friend (class|struct|union) declarations. -# If set to NO (the default) these declarations will be included in the +# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all +# friend (class|struct|union) declarations. +# If set to NO (the default) these declarations will be included in the # documentation. HIDE_FRIEND_COMPOUNDS = NO -# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any -# documentation blocks found inside the body of a function. -# If set to NO (the default) these blocks will be appended to the +# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any +# documentation blocks found inside the body of a function. +# If set to NO (the default) these blocks will be appended to the # function's detailed documentation block. HIDE_IN_BODY_DOCS = NO -# The INTERNAL_DOCS tag determines if documentation -# that is typed after a \internal command is included. If the tag is set -# to NO (the default) then the documentation will be excluded. +# The INTERNAL_DOCS tag determines if documentation +# that is typed after a \internal command is included. If the tag is set +# to NO (the default) then the documentation will be excluded. # Set it to YES to include the internal documentation. INTERNAL_DOCS = YES -# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate -# file names in lower-case letters. If set to YES upper-case letters are also -# allowed. This is useful if you have classes or files whose names only differ -# in case and if your file system supports case sensitive file names. Windows +# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate +# file names in lower-case letters. If set to YES upper-case letters are also +# allowed. This is useful if you have classes or files whose names only differ +# in case and if your file system supports case sensitive file names. Windows # and Mac users are advised to set this option to NO. CASE_SENSE_NAMES = YES -# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen -# will show members with their full class and namespace scopes in the +# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen +# will show members with their full class and namespace scopes in the # documentation. If set to YES the scope will be hidden. HIDE_SCOPE_NAMES = NO -# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen -# will put a list of the files that are included by a file in the documentation +# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen +# will put a list of the files that are included by a file in the documentation # of that file. SHOW_INCLUDE_FILES = YES -# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] +# If the FORCE_LOCAL_INCLUDES tag is set to YES then Doxygen +# will list include files with double quotes in the documentation +# rather than with sharp brackets. + +FORCE_LOCAL_INCLUDES = NO + +# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] # is inserted in the documentation for inline members. INLINE_INFO = YES -# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen -# will sort the (detailed) documentation of file and class members -# alphabetically by member name. If set to NO the members will appear in +# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen +# will sort the (detailed) documentation of file and class members +# alphabetically by member name. If set to NO the members will appear in # declaration order. SORT_MEMBER_DOCS = YES -# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the -# brief documentation of file, namespace and class members alphabetically -# by member name. If set to NO (the default) the members will appear in +# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the +# brief documentation of file, namespace and class members alphabetically +# by member name. If set to NO (the default) the members will appear in # declaration order. SORT_BRIEF_DOCS = NO -# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the -# hierarchy of group names into alphabetical order. If set to NO (the default) +# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the (brief and detailed) documentation of class members so that constructors and destructors are listed first. If set to NO (the default) the constructors will appear in the respective orders defined by SORT_MEMBER_DOCS and SORT_BRIEF_DOCS. This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO. + +SORT_MEMBERS_CTORS_1ST = NO + +# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the +# hierarchy of group names into alphabetical order. If set to NO (the default) # the group names will appear in their defined order. SORT_GROUP_NAMES = NO -# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be -# sorted by fully-qualified names, including namespaces. If set to -# NO (the default), the class list will be sorted only by class name, -# not including the namespace part. +# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be +# sorted by fully-qualified names, including namespaces. If set to +# NO (the default), the class list will be sorted only by class name, +# not including the namespace part. # Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. -# Note: This option applies only to the class list, not to the +# Note: This option applies only to the class list, not to the # alphabetical list. SORT_BY_SCOPE_NAME = NO -# The GENERATE_TODOLIST tag can be used to enable (YES) or -# disable (NO) the todo list. This list is created by putting \todo +# The GENERATE_TODOLIST tag can be used to enable (YES) or +# disable (NO) the todo list. This list is created by putting \todo # commands in the documentation. GENERATE_TODOLIST = YES -# The GENERATE_TESTLIST tag can be used to enable (YES) or -# disable (NO) the test list. This list is created by putting \test +# The GENERATE_TESTLIST tag can be used to enable (YES) or +# disable (NO) the test list. This list is created by putting \test # commands in the documentation. GENERATE_TESTLIST = YES -# The GENERATE_BUGLIST tag can be used to enable (YES) or -# disable (NO) the bug list. This list is created by putting \bug +# The GENERATE_BUGLIST tag can be used to enable (YES) or +# disable (NO) the bug list. This list is created by putting \bug # commands in the documentation. GENERATE_BUGLIST = YES -# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or -# disable (NO) the deprecated list. This list is created by putting +# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or +# disable (NO) the deprecated list. This list is created by putting # \deprecated commands in the documentation. GENERATE_DEPRECATEDLIST= YES -# The ENABLED_SECTIONS tag can be used to enable conditional +# The ENABLED_SECTIONS tag can be used to enable conditional # documentation sections, marked by \if sectionname ... \endif. -ENABLED_SECTIONS = +ENABLED_SECTIONS = -# The MAX_INITIALIZER_LINES tag determines the maximum number of lines -# the initial value of a variable or define consists of for it to appear in -# the documentation. If the initializer consists of more lines than specified -# here it will be hidden. Use a value of 0 to hide initializers completely. -# The appearance of the initializer of individual variables and defines in the -# documentation can be controlled using \showinitializer or \hideinitializer +# The MAX_INITIALIZER_LINES tag determines the maximum number of lines +# the initial value of a variable or define consists of for it to appear in +# the documentation. If the initializer consists of more lines than specified +# here it will be hidden. Use a value of 0 to hide initializers completely. +# The appearance of the initializer of individual variables and defines in the +# documentation can be controlled using \showinitializer or \hideinitializer # command in the documentation regardless of this setting. MAX_INITIALIZER_LINES = 30 -# Set the SHOW_USED_FILES tag to NO to disable the list of files generated -# at the bottom of the documentation of classes and structs. If set to YES the +# Set the SHOW_USED_FILES tag to NO to disable the list of files generated +# at the bottom of the documentation of classes and structs. If set to YES the # list will mention the files that were used to generate the documentation. SHOW_USED_FILES = YES -# If the sources in your project are distributed over multiple directories -# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy +# If the sources in your project are distributed over multiple directories +# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy # in the documentation. The default is NO. SHOW_DIRECTORIES = NO # Set the SHOW_FILES tag to NO to disable the generation of the Files page. -# This will remove the Files entry from the Quick Index and from the +# This will remove the Files entry from the Quick Index and from the # Folder Tree View (if specified). The default is YES. SHOW_FILES = YES -# Set the SHOW_NAMESPACES tag to NO to disable the generation of the -# Namespaces page. This will remove the Namespaces entry from the Quick Index +# Set the SHOW_NAMESPACES tag to NO to disable the generation of the +# Namespaces page. +# This will remove the Namespaces entry from the Quick Index # and from the Folder Tree View (if specified). The default is YES. SHOW_NAMESPACES = YES -# The FILE_VERSION_FILTER tag can be used to specify a program or script that -# doxygen should invoke to get the current version for each file (typically from -# the version control system). Doxygen will invoke the program by executing (via -# popen()) the command <command> <input-file>, where <command> is the value of -# the FILE_VERSION_FILTER tag, and <input-file> is the name of an input file -# provided by doxygen. Whatever the program writes to standard output +# The FILE_VERSION_FILTER tag can be used to specify a program or script that +# doxygen should invoke to get the current version for each file (typically from +# the version control system). Doxygen will invoke the program by executing (via +# popen()) the command <command> <input-file>, where <command> is the value of +# the FILE_VERSION_FILTER tag, and <input-file> is the name of an input file +# provided by doxygen. Whatever the program writes to standard output # is used as the file version. See the manual for examples. -FILE_VERSION_FILTER = +FILE_VERSION_FILTER = +# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed by +# doxygen. The layout file controls the global structure of the generated output files +# in an output format independent way. The create the layout file that represents +# doxygen's defaults, run doxygen with the -l option. You can optionally specify a +# file name after the option, if omitted DoxygenLayout.xml will be used as the name +# of the layout file. + +LAYOUT_FILE = + #--------------------------------------------------------------------------- # configuration options related to warning and progress messages #--------------------------------------------------------------------------- -# The QUIET tag can be used to turn on/off the messages that are generated +# The QUIET tag can be used to turn on/off the messages that are generated # by doxygen. Possible values are YES and NO. If left blank NO is used. QUIET = NO -# The WARNINGS tag can be used to turn on/off the warning messages that are -# generated by doxygen. Possible values are YES and NO. If left blank +# The WARNINGS tag can be used to turn on/off the warning messages that are +# generated by doxygen. Possible values are YES and NO. If left blank # NO is used. WARNINGS = YES -# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings -# for undocumented members. If EXTRACT_ALL is set to YES then this flag will +# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings +# for undocumented members. If EXTRACT_ALL is set to YES then this flag will # automatically be disabled. WARN_IF_UNDOCUMENTED = YES -# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for -# potential errors in the documentation, such as not documenting some -# parameters in a documented function, or documenting parameters that +# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for +# potential errors in the documentation, such as not documenting some +# parameters in a documented function, or documenting parameters that # don't exist or using markup commands wrongly. WARN_IF_DOC_ERROR = YES -# This WARN_NO_PARAMDOC option can be abled to get warnings for -# functions that are documented, but have no documentation for their parameters -# or return value. If set to NO (the default) doxygen will only warn about -# wrong or incomplete parameter documentation, but not about the absence of +# This WARN_NO_PARAMDOC option can be abled to get warnings for +# functions that are documented, but have no documentation for their parameters +# or return value. If set to NO (the default) doxygen will only warn about +# wrong or incomplete parameter documentation, but not about the absence of # documentation. WARN_NO_PARAMDOC = NO -# The WARN_FORMAT tag determines the format of the warning messages that -# doxygen can produce. The string should contain the $file, $line, and $text -# tags, which will be replaced by the file and line number from which the -# warning originated and the warning text. Optionally the format may contain -# $version, which will be replaced by the version of the file (if it could +# The WARN_FORMAT tag determines the format of the warning messages that +# doxygen can produce. The string should contain the $file, $line, and $text +# tags, which will be replaced by the file and line number from which the +# warning originated and the warning text. Optionally the format may contain +# $version, which will be replaced by the version of the file (if it could # be obtained via FILE_VERSION_FILTER) WARN_FORMAT = "$file:$line: $text" -# The WARN_LOGFILE tag can be used to specify a file to which warning -# and error messages should be written. If left blank the output is written +# The WARN_LOGFILE tag can be used to specify a file to which warning +# and error messages should be written. If left blank the output is written # to stderr. -WARN_LOGFILE = +WARN_LOGFILE = #--------------------------------------------------------------------------- # configuration options related to the input files #--------------------------------------------------------------------------- -# The INPUT tag can be used to specify the files and/or directories that contain -# documented source files. You may enter file names like "myfile.cpp" or -# directories like "/usr/src/myproject". Separate the files or directories +# The INPUT tag can be used to specify the files and/or directories that contain +# documented source files. You may enter file names like "myfile.cpp" or +# directories like "/usr/src/myproject". Separate the files or directories # with spaces. INPUT = $(KOS_BASE)/include \ $(KOS_BASE)/kernel/arch/$(KOS_ARCH)/include -# This tag can be used to specify the character encoding of the source files -# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is -# also the default input encoding. Doxygen uses libiconv (or the iconv built -# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for +# This tag can be used to specify the character encoding of the source files +# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is +# also the default input encoding. Doxygen uses libiconv (or the iconv built +# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for # the list of possible encodings. INPUT_ENCODING = UTF-8 -# If the value of the INPUT tag contains directories, you can use the -# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp -# and *.h) to filter out the source-files in the directories. If left -# blank the following patterns are tested: -# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx +# If the value of the INPUT tag contains directories, you can use the +# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp +# and *.h) to filter out the source-files in the directories. If left +# blank the following patterns are tested: +# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx # *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py *.f90 -FILE_PATTERNS = +FILE_PATTERNS = -# The RECURSIVE tag can be used to turn specify whether or not subdirectories -# should be searched for input files as well. Possible values are YES and NO. +# The RECURSIVE tag can be used to turn specify whether or not subdirectories +# should be searched for input files as well. Possible values are YES and NO. # If left blank NO is used. RECURSIVE = YES -# The EXCLUDE tag can be used to specify files and/or directories that should -# excluded from the INPUT source files. This way you can easily exclude a +# The EXCLUDE tag can be used to specify files and/or directories that should +# excluded from the INPUT source files. This way you can easily exclude a # subdirectory from a directory tree whose root is specified with the INPUT tag. -EXCLUDE = +EXCLUDE = -# The EXCLUDE_SYMLINKS tag can be used select whether or not files or -# directories that are symbolic links (a Unix filesystem feature) are excluded +# The EXCLUDE_SYMLINKS tag can be used select whether or not files or +# directories that are symbolic links (a Unix filesystem feature) are excluded # from the input. EXCLUDE_SYMLINKS = YES -# If the value of the INPUT tag contains directories, you can use the -# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude -# certain files from those directories. Note that the wildcards are matched -# against the file with absolute path, so to exclude all test directories +# If the value of the INPUT tag contains directories, you can use the +# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude +# certain files from those directories. Note that the wildcards are matched +# against the file with absolute path, so to exclude all test directories # for example use the pattern */test/* -EXCLUDE_PATTERNS = +EXCLUDE_PATTERNS = -# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names -# (namespaces, classes, functions, etc.) that should be excluded from the -# output. The symbol name can be a fully qualified name, a word, or if the -# wildcard * is used, a substring. Examples: ANamespace, AClass, +# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names +# (namespaces, classes, functions, etc.) that should be excluded from the +# output. The symbol name can be a fully qualified name, a word, or if the +# wildcard * is used, a substring. Examples: ANamespace, AClass, # AClass::ANamespace, ANamespace::*Test -EXCLUDE_SYMBOLS = +EXCLUDE_SYMBOLS = -# The EXAMPLE_PATH tag can be used to specify one or more files or -# directories that contain example code fragments that are included (see +# The EXAMPLE_PATH tag can be used to specify one or more files or +# directories that contain example code fragments that are included (see # the \include command). -EXAMPLE_PATH = +EXAMPLE_PATH = -# If the value of the EXAMPLE_PATH tag contains directories, you can use the -# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp -# and *.h) to filter out the source-files in the directories. If left +# If the value of the EXAMPLE_PATH tag contains directories, you can use the +# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp +# and *.h) to filter out the source-files in the directories. If left # blank all files are included. -EXAMPLE_PATTERNS = +EXAMPLE_PATTERNS = -# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be -# searched for input files to be used with the \include or \dontinclude -# commands irrespective of the value of the RECURSIVE tag. +# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be +# searched for input files to be used with the \include or \dontinclude +# commands irrespective of the value of the RECURSIVE tag. # Possible values are YES and NO. If left blank NO is used. EXAMPLE_RECURSIVE = NO -# The IMAGE_PATH tag can be used to specify one or more files or -# directories that contain image that are included in the documentation (see +# The IMAGE_PATH tag can be used to specify one or more files or +# directories that contain image that are included in the documentation (see # the \image command). -IMAGE_PATH = +IMAGE_PATH = -# The INPUT_FILTER tag can be used to specify a program that doxygen should -# invoke to filter for each input file. Doxygen will invoke the filter program -# by executing (via popen()) the command <filter> <input-file>, where <filter> -# is the value of the INPUT_FILTER tag, and <input-file> is the name of an -# input file. Doxygen will then use the output that the filter program writes -# to standard output. If FILTER_PATTERNS is specified, this tag will be +# The INPUT_FILTER tag can be used to specify a program that doxygen should +# invoke to filter for each input file. Doxygen will invoke the filter program +# by executing (via popen()) the command <filter> <input-file>, where <filter> +# is the value of the INPUT_FILTER tag, and <input-file> is the name of an +# input file. Doxygen will then use the output that the filter program writes +# to standard output. +# If FILTER_PATTERNS is specified, this tag will be # ignored. -INPUT_FILTER = +INPUT_FILTER = -# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern -# basis. Doxygen will compare the file name with each pattern and apply the -# filter if there is a match. The filters are a list of the form: -# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further -# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER +# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern +# basis. +# Doxygen will compare the file name with each pattern and apply the +# filter if there is a match. +# The filters are a list of the form: +# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further +# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER # is applied to all files. -FILTER_PATTERNS = +FILTER_PATTERNS = -# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using -# INPUT_FILTER) will be used to filter the input files when producing source +# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using +# INPUT_FILTER) will be used to filter the input files when producing source # files to browse (i.e. when SOURCE_BROWSER is set to YES). FILTER_SOURCE_FILES = NO @@ -643,32 +686,32 @@ # configuration options related to source browsing #--------------------------------------------------------------------------- -# If the SOURCE_BROWSER tag is set to YES then a list of source files will -# be generated. Documented entities will be cross-referenced with these sources. -# Note: To get rid of all source code in the generated output, make sure also +# If the SOURCE_BROWSER tag is set to YES then a list of source files will +# be generated. Documented entities will be cross-referenced with these sources. +# Note: To get rid of all source code in the generated output, make sure also # VERBATIM_HEADERS is set to NO. SOURCE_BROWSER = NO -# Setting the INLINE_SOURCES tag to YES will include the body +# Setting the INLINE_SOURCES tag to YES will include the body # of functions and classes directly in the documentation. INLINE_SOURCES = NO -# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct -# doxygen to hide any special comment blocks from generated source code +# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct +# doxygen to hide any special comment blocks from generated source code # fragments. Normal C and C++ comments will always remain visible. STRIP_CODE_COMMENTS = NO -# If the REFERENCED_BY_RELATION tag is set to YES -# then for each documented function all documented +# If the REFERENCED_BY_RELATION tag is set to YES +# then for each documented function all documented # functions referencing it will be listed. REFERENCED_BY_RELATION = YES -# If the REFERENCES_RELATION tag is set to YES -# then for each documented function all documented entities +# If the REFERENCES_RELATION tag is set to YES +# then for each documented function all documented entities # called/used by that function will be listed. REFERENCES_RELATION = YES @@ -676,20 +719,21 @@ # If the REFERENCES_LINK_SOURCE tag is set to YES (the default) # and SOURCE_BROWSER tag is set to YES, then the hyperlinks from # functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will -# link to the source code. Otherwise they will link to the documentstion. +# link to the source code. +# Otherwise they will link to the documentation. REFERENCES_LINK_SOURCE = YES -# If the USE_HTAGS tag is set to YES then the references to source code -# will point to the HTML generated by the htags(1) tool instead of doxygen -# built-in source browser. The htags tool is part of GNU's global source -# tagging system (see http://www.gnu.org/software/global/global.html). You +# If the USE_HTAGS tag is set to YES then the references to source code +# will point to the HTML generated by the htags(1) tool instead of doxygen +# built-in source browser. The htags tool is part of GNU's global source +# tagging system (see http://www.gnu.org/software/global/global.html). You # will need version 4.8.6 or higher. USE_HTAGS = NO -# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen -# will generate a verbatim copy of the header file for each class for +# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen +# will generate a verbatim copy of the header file for each class for # which an include is specified. Set to NO to disable this. VERBATIM_HEADERS = YES @@ -698,129 +742,136 @@ # configuration options related to the alphabetical class index #--------------------------------------------------------------------------- -# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index -# of all compounds will be generated. Enable this if the project +# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index +# of all compounds will be generated. Enable this if the project # contains a lot of classes, structs, unions or interfaces. ALPHABETICAL_INDEX = YES -# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then -# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns +# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then +# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns # in which this list will be split (can be a number in the range [1..20]) COLS_IN_ALPHA_INDEX = 5 -# In case all classes in a project start with a common prefix, all -# classes will be put under the same header in the alphabetical index. -# The IGNORE_PREFIX tag can be used to specify one or more prefixes that +# In case all classes in a project start with a common prefix, all +# classes will be put under the same header in the alphabetical index. +# The IGNORE_PREFIX tag can be used to specify one or more prefixes that # should be ignored while generating the index headers. -IGNORE_PREFIX = +IGNORE_PREFIX = #--------------------------------------------------------------------------- # configuration options related to the HTML output #--------------------------------------------------------------------------- -# If the GENERATE_HTML tag is set to YES (the default) Doxygen will +# If the GENERATE_HTML tag is set to YES (the default) Doxygen will # generate HTML output. GENERATE_HTML = YES -# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `html' will be used as the default path. HTML_OUTPUT = html -# The HTML_FILE_EXTENSION tag can be used to specify the file extension for -# each generated HTML page (for example: .htm,.php,.asp). If it is left blank +# The HTML_FILE_EXTENSION tag can be used to specify the file extension for +# each generated HTML page (for example: .htm,.php,.asp). If it is left blank # doxygen will generate files with .html extension. HTML_FILE_EXTENSION = .html -# The HTML_HEADER tag can be used to specify a personal HTML header for -# each generated HTML page. If it is left blank doxygen will generate a +# The HTML_HEADER tag can be used to specify a personal HTML header for +# each generated HTML page. If it is left blank doxygen will generate a # standard header. -HTML_HEADER = +HTML_HEADER = -# The HTML_FOOTER tag can be used to specify a personal HTML footer for -# each generated HTML page. If it is left blank doxygen will generate a +# The HTML_FOOTER tag can be used to specify a personal HTML footer for +# each generated HTML page. If it is left blank doxygen will generate a # standard footer. -HTML_FOOTER = +HTML_FOOTER = -# The HTML_STYLESHEET tag can be used to specify a user-defined cascading -# style sheet that is used by each HTML page. It can be used to -# fine-tune the look of the HTML output. If the tag is left blank doxygen -# will generate a default style sheet. Note that doxygen will try to copy -# the style sheet file to the HTML output directory, so don't put your own +# The HTML_STYLESHEET tag can be used to specify a user-defined cascading +# style sheet that is used by each HTML page. It can be used to +# fine-tune the look of the HTML output. If the tag is left blank doxygen +# will generate a default style sheet. Note that doxygen will try to copy +# the style sheet file to the HTML output directory, so don't put your own # stylesheet in the HTML output directory as well, or it will be erased! -HTML_STYLESHEET = +HTML_STYLESHEET = -# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, -# files or namespaces will be aligned in HTML using tables. If set to +# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML +# page will contain the date and time when the page was generated. Setting +# this to NO can help when comparing the output of multiple runs. + +HTML_TIMESTAMP = NO + +# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, +# files or namespaces will be aligned in HTML using tables. If set to # NO a bullet list will be used. HTML_ALIGN_MEMBERS = YES -# If the GENERATE_HTMLHELP tag is set to YES, additional index files -# will be generated that can be used as input for tools like the -# Microsoft HTML help workshop to generate a compiled HTML help file (.chm) -# of the generated HTML documentation. +# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML +# documentation will contain sections that can be hidden and shown after the +# page has loaded. For this to work a browser that supports +# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox +# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari). -GENERATE_HTMLHELP = NO +HTML_DYNAMIC_SECTIONS = NO -# If the GENERATE_DOCSET tag is set to YES, additional index files -# will be generated that can be used as input for Apple's Xcode 3 -# integrated development environment, introduced with OSX... [truncated message content] |
From: <ljs...@us...> - 2010-02-20 04:34:21
|
Revision: 656 http://cadcdev.svn.sourceforge.net/cadcdev/?rev=656&view=rev Author: ljsebald Date: 2010-02-20 04:34:13 +0000 (Sat, 20 Feb 2010) Log Message: ----------- Adding in an updated Doxygen configuration (it pretty much stays true to the old one in how everything's set up), but will play nicer with newer versions of Doxygen. Added Paths: ----------- kos/doc/Doxyfile Removed Paths: ------------- kos/doc/doxygen.cfg Added: kos/doc/Doxyfile =================================================================== --- kos/doc/Doxyfile (rev 0) +++ kos/doc/Doxyfile 2010-02-20 04:34:13 UTC (rev 656) @@ -0,0 +1,1422 @@ +# Doxyfile 1.5.6 + +# This file describes the settings to be used by the documentation system +# doxygen (www.doxygen.org) for a project +# +# All text after a hash (#) is considered a comment and will be ignored +# The format is: +# TAG = value [value, ...] +# For lists items can also be appended using: +# TAG += value [value, ...] +# Values that contain spaces should be placed between quotes (" ") + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- + +# This tag specifies the encoding used for all characters in the config file +# that follow. The default is UTF-8 which is also the encoding used for all +# text before the first occurrence of this tag. Doxygen uses libiconv (or the +# iconv built into libc) for the transcoding. See +# http://www.gnu.org/software/libiconv for the list of possible encodings. + +DOXYFILE_ENCODING = UTF-8 + +# The PROJECT_NAME tag is a single word (or a sequence of words surrounded +# by quotes) that should identify the project. + +PROJECT_NAME = "KallistiOS" + +# The PROJECT_NUMBER tag can be used to enter a project or revision number. +# This could be handy for archiving the generated documentation or +# if some version control system is used. + +PROJECT_NUMBER = "##version##" + +# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) +# base path where the generated documentation will be put. +# If a relative path is entered, it will be relative to the location +# where doxygen was started. If left blank the current directory will be used. + +OUTPUT_DIRECTORY = $(KOS_BASE)/doc/reference + +# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create +# 4096 sub-directories (in 2 levels) under the output directory of each output +# format and will distribute the generated files over these directories. +# Enabling this option can be useful when feeding doxygen a huge amount of +# source files, where putting all generated files in the same directory would +# otherwise cause performance problems for the file system. + +CREATE_SUBDIRS = NO + +# The OUTPUT_LANGUAGE tag is used to specify the language in which all +# documentation generated by doxygen is written. Doxygen will use this +# information to generate all constant output in the proper language. +# The default language is English, other supported languages are: +# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, +# Croatian, Czech, Danish, Dutch, Farsi, Finnish, French, German, Greek, +# Hungarian, Italian, Japanese, Japanese-en (Japanese with English messages), +# Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, Polish, +# Portuguese, Romanian, Russian, Serbian, Slovak, Slovene, Spanish, Swedish, +# and Ukrainian. + +OUTPUT_LANGUAGE = English + +# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will +# include brief member descriptions after the members that are listed in +# the file and class documentation (similar to JavaDoc). +# Set to NO to disable this. + +BRIEF_MEMBER_DESC = YES + +# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend +# the brief description of a member or function before the detailed description. +# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the +# brief descriptions will be completely suppressed. + +REPEAT_BRIEF = YES + +# This tag implements a quasi-intelligent brief description abbreviator +# that is used to form the text in various listings. Each string +# in this list, if found as the leading text of the brief description, will be +# stripped from the text and the result after processing the whole list, is +# used as the annotated text. Otherwise, the brief description is used as-is. +# If left blank, the following values are used ("$name" is automatically +# replaced with the name of the entity): "The $name class" "The $name widget" +# "The $name file" "is" "provides" "specifies" "contains" +# "represents" "a" "an" "the" + +ABBREVIATE_BRIEF = + +# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then +# Doxygen will generate a detailed section even if there is only a brief +# description. + +ALWAYS_DETAILED_SEC = NO + +# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all +# inherited members of a class in the documentation of that class as if those +# members were ordinary class members. Constructors, destructors and assignment +# operators of the base classes will not be shown. + +INLINE_INHERITED_MEMB = NO + +# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full +# path before files name in the file list and in the header files. If set +# to NO the shortest path that makes the file name unique will be used. + +FULL_PATH_NAMES = YES + +# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag +# can be used to strip a user-defined part of the path. Stripping is +# only done if one of the specified strings matches the left-hand part of +# the path. The tag can be used to show relative paths in the file list. +# If left blank the directory from which doxygen is run is used as the +# path to strip. + +STRIP_FROM_PATH = $(KOS_BASE)/ + +# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of +# the path mentioned in the documentation of a class, which tells +# the reader which header file to include in order to use a class. +# If left blank only the name of the header file containing the class +# definition is used. Otherwise one should specify the include paths that +# are normally passed to the compiler using the -I flag. + +STRIP_FROM_INC_PATH = + +# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter +# (but less readable) file names. This can be useful is your file systems +# doesn't support long names like on DOS, Mac, or CD-ROM. + +SHORT_NAMES = NO + +# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen +# will interpret the first line (until the first dot) of a JavaDoc-style +# comment as the brief description. If set to NO, the JavaDoc +# comments will behave just like regular Qt-style comments +# (thus requiring an explicit @brief command for a brief description.) + +JAVADOC_AUTOBRIEF = NO + +# If the QT_AUTOBRIEF tag is set to YES then Doxygen will +# interpret the first line (until the first dot) of a Qt-style +# comment as the brief description. If set to NO, the comments +# will behave just like regular Qt-style comments (thus requiring +# an explicit \brief command for a brief description.) + +QT_AUTOBRIEF = NO + +# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen +# treat a multi-line C++ special comment block (i.e. a block of //! or /// +# comments) as a brief description. This used to be the default behaviour. +# The new default is to treat a multi-line C++ comment block as a detailed +# description. Set this tag to YES if you prefer the old behaviour instead. + +MULTILINE_CPP_IS_BRIEF = NO + +# If the DETAILS_AT_TOP tag is set to YES then Doxygen +# will output the detailed description near the top, like JavaDoc. +# If set to NO, the detailed description appears after the member +# documentation. + +DETAILS_AT_TOP = YES + +# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented +# member inherits the documentation from any documented member that it +# re-implements. + +INHERIT_DOCS = YES + +# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce +# a new page for each member. If set to NO, the documentation of a member will +# be part of the file/class/namespace that contains it. + +SEPARATE_MEMBER_PAGES = NO + +# The TAB_SIZE tag can be used to set the number of spaces in a tab. +# Doxygen uses this value to replace tabs by spaces in code fragments. + +TAB_SIZE = 8 + +# This tag can be used to specify a number of aliases that acts +# as commands in the documentation. An alias has the form "name=value". +# For example adding "sideeffect=\par Side Effects:\n" will allow you to +# put the command \sideeffect (or @sideeffect) in the documentation, which +# will result in a user-defined paragraph with heading "Side Effects:". +# You can put \n's in the value part of an alias to insert newlines. + +ALIASES = + +# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C +# sources only. Doxygen will then generate output that is more tailored for C. +# For instance, some of the names that are used will be different. The list +# of all members will be omitted, etc. + +OPTIMIZE_OUTPUT_FOR_C = YES + +# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java +# sources only. Doxygen will then generate output that is more tailored for +# Java. For instance, namespaces will be presented as packages, qualified +# scopes will look different, etc. + +OPTIMIZE_OUTPUT_JAVA = NO + +# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran +# sources only. Doxygen will then generate output that is more tailored for +# Fortran. + +OPTIMIZE_FOR_FORTRAN = NO + +# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL +# sources. Doxygen will then generate output that is tailored for +# VHDL. + +OPTIMIZE_OUTPUT_VHDL = NO + +# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want +# to include (a tag file for) the STL sources as input, then you should +# set this tag to YES in order to let doxygen match functions declarations and +# definitions whose arguments contain STL classes (e.g. func(std::string); v.s. +# func(std::string) {}). This also make the inheritance and collaboration +# diagrams that involve STL classes more complete and accurate. + +BUILTIN_STL_SUPPORT = NO + +# If you use Microsoft's C++/CLI language, you should set this option to YES to +# enable parsing support. + +CPP_CLI_SUPPORT = NO + +# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only. +# Doxygen will parse them like normal C++ but will assume all classes use public +# instead of private inheritance when no explicit protection keyword is present. + +SIP_SUPPORT = NO + +# For Microsoft's IDL there are propget and propput attributes to indicate getter +# and setter methods for a property. Setting this option to YES (the default) +# will make doxygen to replace the get and set methods by a property in the +# documentation. This will only work if the methods are indeed getting or +# setting a simple type. If this is not the case, or you want to show the +# methods anyway, you should set this option to NO. + +IDL_PROPERTY_SUPPORT = YES + +# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC +# tag is set to YES, then doxygen will reuse the documentation of the first +# member in the group (if any) for the other members of the group. By default +# all members of a group must be documented explicitly. + +DISTRIBUTE_GROUP_DOC = NO + +# Set the SUBGROUPING tag to YES (the default) to allow class member groups of +# the same type (for instance a group of public functions) to be put as a +# subgroup of that type (e.g. under the Public Functions section). Set it to +# NO to prevent subgrouping. Alternatively, this can be done per class using +# the \nosubgrouping command. + +SUBGROUPING = YES + +# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum +# is documented as struct, union, or enum with the name of the typedef. So +# typedef struct TypeS {} TypeT, will appear in the documentation as a struct +# with name TypeT. When disabled the typedef will appear as a member of a file, +# namespace, or class. And the struct will be named TypeS. This can typically +# be useful for C code in case the coding convention dictates that all compound +# types are typedef'ed and only the typedef is referenced, never the tag name. + +TYPEDEF_HIDES_STRUCT = NO + +#--------------------------------------------------------------------------- +# Build related configuration options +#--------------------------------------------------------------------------- + +# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in +# documentation are documented, even if no documentation was available. +# Private class members and static file members will be hidden unless +# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES + +EXTRACT_ALL = YES + +# If the EXTRACT_PRIVATE tag is set to YES all private members of a class +# will be included in the documentation. + +EXTRACT_PRIVATE = NO + +# If the EXTRACT_STATIC tag is set to YES all static members of a file +# will be included in the documentation. + +EXTRACT_STATIC = NO + +# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) +# defined locally in source files will be included in the documentation. +# If set to NO only classes defined in header files are included. + +EXTRACT_LOCAL_CLASSES = NO + +# This flag is only useful for Objective-C code. When set to YES local +# methods, which are defined in the implementation section but not in +# the interface are included in the documentation. +# If set to NO (the default) only methods in the interface are included. + +EXTRACT_LOCAL_METHODS = NO + +# If this flag is set to YES, the members of anonymous namespaces will be +# extracted and appear in the documentation as a namespace called +# 'anonymous_namespace{file}', where file will be replaced with the base +# name of the file that contains the anonymous namespace. By default +# anonymous namespace are hidden. + +EXTRACT_ANON_NSPACES = NO + +# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all +# undocumented members of documented classes, files or namespaces. +# If set to NO (the default) these members will be included in the +# various overviews, but no documentation section is generated. +# This option has no effect if EXTRACT_ALL is enabled. + +HIDE_UNDOC_MEMBERS = NO + +# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all +# undocumented classes that are normally visible in the class hierarchy. +# If set to NO (the default) these classes will be included in the various +# overviews. This option has no effect if EXTRACT_ALL is enabled. + +HIDE_UNDOC_CLASSES = NO + +# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all +# friend (class|struct|union) declarations. +# If set to NO (the default) these declarations will be included in the +# documentation. + +HIDE_FRIEND_COMPOUNDS = NO + +# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any +# documentation blocks found inside the body of a function. +# If set to NO (the default) these blocks will be appended to the +# function's detailed documentation block. + +HIDE_IN_BODY_DOCS = NO + +# The INTERNAL_DOCS tag determines if documentation +# that is typed after a \internal command is included. If the tag is set +# to NO (the default) then the documentation will be excluded. +# Set it to YES to include the internal documentation. + +INTERNAL_DOCS = YES + +# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate +# file names in lower-case letters. If set to YES upper-case letters are also +# allowed. This is useful if you have classes or files whose names only differ +# in case and if your file system supports case sensitive file names. Windows +# and Mac users are advised to set this option to NO. + +CASE_SENSE_NAMES = YES + +# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen +# will show members with their full class and namespace scopes in the +# documentation. If set to YES the scope will be hidden. + +HIDE_SCOPE_NAMES = NO + +# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen +# will put a list of the files that are included by a file in the documentation +# of that file. + +SHOW_INCLUDE_FILES = YES + +# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] +# is inserted in the documentation for inline members. + +INLINE_INFO = YES + +# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen +# will sort the (detailed) documentation of file and class members +# alphabetically by member name. If set to NO the members will appear in +# declaration order. + +SORT_MEMBER_DOCS = YES + +# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the +# brief documentation of file, namespace and class members alphabetically +# by member name. If set to NO (the default) the members will appear in +# declaration order. + +SORT_BRIEF_DOCS = NO + +# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the +# hierarchy of group names into alphabetical order. If set to NO (the default) +# the group names will appear in their defined order. + +SORT_GROUP_NAMES = NO + +# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be +# sorted by fully-qualified names, including namespaces. If set to +# NO (the default), the class list will be sorted only by class name, +# not including the namespace part. +# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. +# Note: This option applies only to the class list, not to the +# alphabetical list. + +SORT_BY_SCOPE_NAME = NO + +# The GENERATE_TODOLIST tag can be used to enable (YES) or +# disable (NO) the todo list. This list is created by putting \todo +# commands in the documentation. + +GENERATE_TODOLIST = YES + +# The GENERATE_TESTLIST tag can be used to enable (YES) or +# disable (NO) the test list. This list is created by putting \test +# commands in the documentation. + +GENERATE_TESTLIST = YES + +# The GENERATE_BUGLIST tag can be used to enable (YES) or +# disable (NO) the bug list. This list is created by putting \bug +# commands in the documentation. + +GENERATE_BUGLIST = YES + +# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or +# disable (NO) the deprecated list. This list is created by putting +# \deprecated commands in the documentation. + +GENERATE_DEPRECATEDLIST= YES + +# The ENABLED_SECTIONS tag can be used to enable conditional +# documentation sections, marked by \if sectionname ... \endif. + +ENABLED_SECTIONS = + +# The MAX_INITIALIZER_LINES tag determines the maximum number of lines +# the initial value of a variable or define consists of for it to appear in +# the documentation. If the initializer consists of more lines than specified +# here it will be hidden. Use a value of 0 to hide initializers completely. +# The appearance of the initializer of individual variables and defines in the +# documentation can be controlled using \showinitializer or \hideinitializer +# command in the documentation regardless of this setting. + +MAX_INITIALIZER_LINES = 30 + +# Set the SHOW_USED_FILES tag to NO to disable the list of files generated +# at the bottom of the documentation of classes and structs. If set to YES the +# list will mention the files that were used to generate the documentation. + +SHOW_USED_FILES = YES + +# If the sources in your project are distributed over multiple directories +# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy +# in the documentation. The default is NO. + +SHOW_DIRECTORIES = NO + +# Set the SHOW_FILES tag to NO to disable the generation of the Files page. +# This will remove the Files entry from the Quick Index and from the +# Folder Tree View (if specified). The default is YES. + +SHOW_FILES = YES + +# Set the SHOW_NAMESPACES tag to NO to disable the generation of the +# Namespaces page. This will remove the Namespaces entry from the Quick Index +# and from the Folder Tree View (if specified). The default is YES. + +SHOW_NAMESPACES = YES + +# The FILE_VERSION_FILTER tag can be used to specify a program or script that +# doxygen should invoke to get the current version for each file (typically from +# the version control system). Doxygen will invoke the program by executing (via +# popen()) the command <command> <input-file>, where <command> is the value of +# the FILE_VERSION_FILTER tag, and <input-file> is the name of an input file +# provided by doxygen. Whatever the program writes to standard output +# is used as the file version. See the manual for examples. + +FILE_VERSION_FILTER = + +#--------------------------------------------------------------------------- +# configuration options related to warning and progress messages +#--------------------------------------------------------------------------- + +# The QUIET tag can be used to turn on/off the messages that are generated +# by doxygen. Possible values are YES and NO. If left blank NO is used. + +QUIET = NO + +# The WARNINGS tag can be used to turn on/off the warning messages that are +# generated by doxygen. Possible values are YES and NO. If left blank +# NO is used. + +WARNINGS = YES + +# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings +# for undocumented members. If EXTRACT_ALL is set to YES then this flag will +# automatically be disabled. + +WARN_IF_UNDOCUMENTED = YES + +# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for +# potential errors in the documentation, such as not documenting some +# parameters in a documented function, or documenting parameters that +# don't exist or using markup commands wrongly. + +WARN_IF_DOC_ERROR = YES + +# This WARN_NO_PARAMDOC option can be abled to get warnings for +# functions that are documented, but have no documentation for their parameters +# or return value. If set to NO (the default) doxygen will only warn about +# wrong or incomplete parameter documentation, but not about the absence of +# documentation. + +WARN_NO_PARAMDOC = NO + +# The WARN_FORMAT tag determines the format of the warning messages that +# doxygen can produce. The string should contain the $file, $line, and $text +# tags, which will be replaced by the file and line number from which the +# warning originated and the warning text. Optionally the format may contain +# $version, which will be replaced by the version of the file (if it could +# be obtained via FILE_VERSION_FILTER) + +WARN_FORMAT = "$file:$line: $text" + +# The WARN_LOGFILE tag can be used to specify a file to which warning +# and error messages should be written. If left blank the output is written +# to stderr. + +WARN_LOGFILE = + +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- + +# The INPUT tag can be used to specify the files and/or directories that contain +# documented source files. You may enter file names like "myfile.cpp" or +# directories like "/usr/src/myproject". Separate the files or directories +# with spaces. + +INPUT = $(KOS_BASE)/include \ + $(KOS_BASE)/kernel/arch/$(KOS_ARCH)/include + +# This tag can be used to specify the character encoding of the source files +# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is +# also the default input encoding. Doxygen uses libiconv (or the iconv built +# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for +# the list of possible encodings. + +INPUT_ENCODING = UTF-8 + +# If the value of the INPUT tag contains directories, you can use the +# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp +# and *.h) to filter out the source-files in the directories. If left +# blank the following patterns are tested: +# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx +# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py *.f90 + +FILE_PATTERNS = + +# The RECURSIVE tag can be used to turn specify whether or not subdirectories +# should be searched for input files as well. Possible values are YES and NO. +# If left blank NO is used. + +RECURSIVE = YES + +# The EXCLUDE tag can be used to specify files and/or directories that should +# excluded from the INPUT source files. This way you can easily exclude a +# subdirectory from a directory tree whose root is specified with the INPUT tag. + +EXCLUDE = + +# The EXCLUDE_SYMLINKS tag can be used select whether or not files or +# directories that are symbolic links (a Unix filesystem feature) are excluded +# from the input. + +EXCLUDE_SYMLINKS = YES + +# If the value of the INPUT tag contains directories, you can use the +# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude +# certain files from those directories. Note that the wildcards are matched +# against the file with absolute path, so to exclude all test directories +# for example use the pattern */test/* + +EXCLUDE_PATTERNS = + +# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names +# (namespaces, classes, functions, etc.) that should be excluded from the +# output. The symbol name can be a fully qualified name, a word, or if the +# wildcard * is used, a substring. Examples: ANamespace, AClass, +# AClass::ANamespace, ANamespace::*Test + +EXCLUDE_SYMBOLS = + +# The EXAMPLE_PATH tag can be used to specify one or more files or +# directories that contain example code fragments that are included (see +# the \include command). + +EXAMPLE_PATH = + +# If the value of the EXAMPLE_PATH tag contains directories, you can use the +# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp +# and *.h) to filter out the source-files in the directories. If left +# blank all files are included. + +EXAMPLE_PATTERNS = + +# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be +# searched for input files to be used with the \include or \dontinclude +# commands irrespective of the value of the RECURSIVE tag. +# Possible values are YES and NO. If left blank NO is used. + +EXAMPLE_RECURSIVE = NO + +# The IMAGE_PATH tag can be used to specify one or more files or +# directories that contain image that are included in the documentation (see +# the \image command). + +IMAGE_PATH = + +# The INPUT_FILTER tag can be used to specify a program that doxygen should +# invoke to filter for each input file. Doxygen will invoke the filter program +# by executing (via popen()) the command <filter> <input-file>, where <filter> +# is the value of the INPUT_FILTER tag, and <input-file> is the name of an +# input file. Doxygen will then use the output that the filter program writes +# to standard output. If FILTER_PATTERNS is specified, this tag will be +# ignored. + +INPUT_FILTER = + +# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern +# basis. Doxygen will compare the file name with each pattern and apply the +# filter if there is a match. The filters are a list of the form: +# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further +# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER +# is applied to all files. + +FILTER_PATTERNS = + +# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using +# INPUT_FILTER) will be used to filter the input files when producing source +# files to browse (i.e. when SOURCE_BROWSER is set to YES). + +FILTER_SOURCE_FILES = NO + +#--------------------------------------------------------------------------- +# configuration options related to source browsing +#--------------------------------------------------------------------------- + +# If the SOURCE_BROWSER tag is set to YES then a list of source files will +# be generated. Documented entities will be cross-referenced with these sources. +# Note: To get rid of all source code in the generated output, make sure also +# VERBATIM_HEADERS is set to NO. + +SOURCE_BROWSER = NO + +# Setting the INLINE_SOURCES tag to YES will include the body +# of functions and classes directly in the documentation. + +INLINE_SOURCES = NO + +# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct +# doxygen to hide any special comment blocks from generated source code +# fragments. Normal C and C++ comments will always remain visible. + +STRIP_CODE_COMMENTS = NO + +# If the REFERENCED_BY_RELATION tag is set to YES +# then for each documented function all documented +# functions referencing it will be listed. + +REFERENCED_BY_RELATION = YES + +# If the REFERENCES_RELATION tag is set to YES +# then for each documented function all documented entities +# called/used by that function will be listed. + +REFERENCES_RELATION = YES + +# If the REFERENCES_LINK_SOURCE tag is set to YES (the default) +# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from +# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will +# link to the source code. Otherwise they will link to the documentstion. + +REFERENCES_LINK_SOURCE = YES + +# If the USE_HTAGS tag is set to YES then the references to source code +# will point to the HTML generated by the htags(1) tool instead of doxygen +# built-in source browser. The htags tool is part of GNU's global source +# tagging system (see http://www.gnu.org/software/global/global.html). You +# will need version 4.8.6 or higher. + +USE_HTAGS = NO + +# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen +# will generate a verbatim copy of the header file for each class for +# which an include is specified. Set to NO to disable this. + +VERBATIM_HEADERS = YES + +#--------------------------------------------------------------------------- +# configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- + +# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index +# of all compounds will be generated. Enable this if the project +# contains a lot of classes, structs, unions or interfaces. + +ALPHABETICAL_INDEX = YES + +# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then +# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns +# in which this list will be split (can be a number in the range [1..20]) + +COLS_IN_ALPHA_INDEX = 5 + +# In case all classes in a project start with a common prefix, all +# classes will be put under the same header in the alphabetical index. +# The IGNORE_PREFIX tag can be used to specify one or more prefixes that +# should be ignored while generating the index headers. + +IGNORE_PREFIX = + +#--------------------------------------------------------------------------- +# configuration options related to the HTML output +#--------------------------------------------------------------------------- + +# If the GENERATE_HTML tag is set to YES (the default) Doxygen will +# generate HTML output. + +GENERATE_HTML = YES + +# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `html' will be used as the default path. + +HTML_OUTPUT = html + +# The HTML_FILE_EXTENSION tag can be used to specify the file extension for +# each generated HTML page (for example: .htm,.php,.asp). If it is left blank +# doxygen will generate files with .html extension. + +HTML_FILE_EXTENSION = .html + +# The HTML_HEADER tag can be used to specify a personal HTML header for +# each generated HTML page. If it is left blank doxygen will generate a +# standard header. + +HTML_HEADER = + +# The HTML_FOOTER tag can be used to specify a personal HTML footer for +# each generated HTML page. If it is left blank doxygen will generate a +# standard footer. + +HTML_FOOTER = + +# The HTML_STYLESHEET tag can be used to specify a user-defined cascading +# style sheet that is used by each HTML page. It can be used to +# fine-tune the look of the HTML output. If the tag is left blank doxygen +# will generate a default style sheet. Note that doxygen will try to copy +# the style sheet file to the HTML output directory, so don't put your own +# stylesheet in the HTML output directory as well, or it will be erased! + +HTML_STYLESHEET = + +# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, +# files or namespaces will be aligned in HTML using tables. If set to +# NO a bullet list will be used. + +HTML_ALIGN_MEMBERS = YES + +# If the GENERATE_HTMLHELP tag is set to YES, additional index files +# will be generated that can be used as input for tools like the +# Microsoft HTML help workshop to generate a compiled HTML help file (.chm) +# of the generated HTML documentation. + +GENERATE_HTMLHELP = NO + +# If the GENERATE_DOCSET tag is set to YES, additional index files +# will be generated that can be used as input for Apple's Xcode 3 +# integrated development environment, introduced with OSX 10.5 (Leopard). +# To create a documentation set, doxygen will generate a Makefile in the +# HTML output directory. Running make will produce the docset in that +# directory and running "make install" will install the docset in +# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find +# it at startup. + +GENERATE_DOCSET = NO + +# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the +# feed. A documentation feed provides an umbrella under which multiple +# documentation sets from a single provider (such as a company or product suite) +# can be grouped. + +DOCSET_FEEDNAME = "Doxygen generated docs" + +# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that +# should uniquely identify the documentation set bundle. This should be a +# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen +# will append .docset to the name. + +DOCSET_BUNDLE_ID = org.doxygen.Project + +# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML +# documentation will contain sections that can be hidden and shown after the +# page has loaded. For this to work a browser that supports +# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox +# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari). + +HTML_DYNAMIC_SECTIONS = NO + +# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can +# be used to specify the file name of the resulting .chm file. You +# can add a path in front of the file if the result should not be +# written to the html output directory. + +CHM_FILE = + +# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can +# be used to specify the location (absolute path including file name) of +# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run +# the HTML help compiler on the generated index.hhp. + +HHC_LOCATION = + +# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag +# controls if a separate .chi index file is generated (YES) or that +# it should be included in the master .chm file (NO). + +GENERATE_CHI = NO + +# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING +# is used to encode HtmlHelp index (hhk), content (hhc) and project file +# content. + +CHM_INDEX_ENCODING = + +# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag +# controls whether a binary table of contents is generated (YES) or a +# normal table of contents (NO) in the .chm file. + +BINARY_TOC = NO + +# The TOC_EXPAND flag can be set to YES to add extra items for group members +# to the contents of the HTML help documentation and to the tree view. + +TOC_EXPAND = NO + +# The DISABLE_INDEX tag can be used to turn on/off the condensed index at +# top of each HTML page. The value NO (the default) enables the index and +# the value YES disables it. + +DISABLE_INDEX = NO + +# This tag can be used to set the number of enum values (range [1..20]) +# that doxygen will group on one line in the generated HTML documentation. + +ENUM_VALUES_PER_LINE = 4 + +# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index +# structure should be generated to display hierarchical information. +# If the tag value is set to FRAME, a side panel will be generated +# containing a tree-like index structure (just like the one that +# is generated for HTML Help). For this to work a browser that supports +# JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+, +# Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are +# probably better off using the HTML help feature. Other possible values +# for this tag are: HIERARCHIES, which will generate the Groups, Directories, +# and Class Hiererachy pages using a tree view instead of an ordered list; +# ALL, which combines the behavior of FRAME and HIERARCHIES; and NONE, which +# disables this behavior completely. For backwards compatibility with previous +# releases of Doxygen, the values YES and NO are equivalent to FRAME and NONE +# respectively. + +GENERATE_TREEVIEW = NO + +# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be +# used to set the initial width (in pixels) of the frame in which the tree +# is shown. + +TREEVIEW_WIDTH = 250 + +# Use this tag to change the font size of Latex formulas included +# as images in the HTML documentation. The default is 10. Note that +# when you change the font size after a successful doxygen run you need +# to manually remove any form_*.png images from the HTML output directory +# to force them to be regenerated. + +FORMULA_FONTSIZE = 10 + +#--------------------------------------------------------------------------- +# configuration options related to the LaTeX output +#--------------------------------------------------------------------------- + +# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will +# generate Latex output. + +GENERATE_LATEX = YES + +# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `latex' will be used as the default path. + +LATEX_OUTPUT = latex + +# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be +# invoked. If left blank `latex' will be used as the default command name. + +LATEX_CMD_NAME = latex + +# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to +# generate index for LaTeX. If left blank `makeindex' will be used as the +# default command name. + +MAKEINDEX_CMD_NAME = makeindex + +# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact +# LaTeX documents. This may be useful for small projects and may help to +# save some trees in general. + +COMPACT_LATEX = YES + +# The PAPER_TYPE tag can be used to set the paper type that is used +# by the printer. Possible values are: a4, a4wide, letter, legal and +# executive. If left blank a4wide will be used. + +PAPER_TYPE = a4wide + +# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX +# packages that should be included in the LaTeX output. + +EXTRA_PACKAGES = + +# The LATEX_HEADER tag can be used to specify a personal LaTeX header for +# the generated latex document. The header should contain everything until +# the first chapter. If it is left blank doxygen will generate a +# standard header. Notice: only use this tag if you know what you are doing! + +LATEX_HEADER = + +# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated +# is prepared for conversion to pdf (using ps2pdf). The pdf file will +# contain links (just like the HTML output) instead of page references +# This makes the output suitable for online browsing using a pdf viewer. + +PDF_HYPERLINKS = YES + +# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of +# plain latex in the generated Makefile. Set this option to YES to get a +# higher quality PDF documentation. + +USE_PDFLATEX = YES + +# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. +# command to the generated LaTeX files. This will instruct LaTeX to keep +# running if errors occur, instead of asking the user for help. +# This option is also used when generating formulas in HTML. + +LATEX_BATCHMODE = NO + +# If LATEX_HIDE_INDICES is set to YES then doxygen will not +# include the index chapters (such as File Index, Compound Index, etc.) +# in the output. + +LATEX_HIDE_INDICES = NO + +#--------------------------------------------------------------------------- +# configuration options related to the RTF output +#--------------------------------------------------------------------------- + +# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output +# The RTF output is optimized for Word 97 and may not look very pretty with +# other RTF readers or editors. + +GENERATE_RTF = NO + +# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `rtf' will be used as the default path. + +RTF_OUTPUT = rtf + +# If the COMPACT_RTF tag is set to YES Doxygen generates more compact +# RTF documents. This may be useful for small projects and may help to +# save some trees in general. + +COMPACT_RTF = NO + +# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated +# will contain hyperlink fields. The RTF file will +# contain links (just like the HTML output) instead of page references. +# This makes the output suitable for online browsing using WORD or other +# programs which support those fields. +# Note: wordpad (write) and others do not support links. + +RTF_HYPERLINKS = NO + +# Load stylesheet definitions from file. Syntax is similar to doxygen's +# config file, i.e. a series of assignments. You only have to provide +# replacements, missing definitions are set to their default value. + +RTF_STYLESHEET_FILE = + +# Set optional variables used in the generation of an rtf document. +# Syntax is similar to doxygen's config file. + +RTF_EXTENSIONS_FILE = + +#--------------------------------------------------------------------------- +# configuration options related to the man page output +#--------------------------------------------------------------------------- + +# If the GENERATE_MAN tag is set to YES (the default) Doxygen will +# generate man pages + +GENERATE_MAN = NO + +# The MAN_OUTPUT tag is used to specify where the man pages will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `man' will be used as the default path. + +MAN_OUTPUT = man + +# The MAN_EXTENSION tag determines the extension that is added to +# the generated man pages (default is the subroutine's section .3) + +MAN_EXTENSION = .3 + +# If the MAN_LINKS tag is set to YES and Doxygen generates man output, +# then it will generate one additional man file for each entity +# documented in the real man page(s). These additional files +# only source the real man page, but without them the man command +# would be unable to find the correct page. The default is NO. + +MAN_LINKS = NO + +#--------------------------------------------------------------------------- +# configuration options related to the XML output +#--------------------------------------------------------------------------- + +# If the GENERATE_XML tag is set to YES Doxygen will +# generate an XML file that captures the structure of +# the code including all documentation. + +GENERATE_XML = NO + +# The XML_OUTPUT tag is used to specify where the XML pages will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `xml' will be used as the default path. + +XML_OUTPUT = xml + +# The XML_SCHEMA tag can be used to specify an XML schema, +# which can be used by a validating XML parser to check the +# syntax of the XML files. + +XML_SCHEMA = + +# The XML_DTD tag can be used to specify an XML DTD, +# which can be used by a validating XML parser to check the +# syntax of the XML files. + +XML_DTD = + +# If the XML_PROGRAMLISTING tag is set to YES Doxygen will +# dump the program listings (including syntax highlighting +# and cross-referencing information) to the XML output. Note that +# enabling this will significantly increase the size of the XML output. + +XML_PROGRAMLISTING = YES + +#--------------------------------------------------------------------------- +# configuration options for the AutoGen Definitions output +#--------------------------------------------------------------------------- + +# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will +# generate an AutoGen Definitions (see autogen.sf.net) file +# that captures the structure of the code including all +# documentation. Note that this feature is still experimental +# and incomplete at the moment. + +GENERATE_AUTOGEN_DEF = NO + +#--------------------------------------------------------------------------- +# configuration options related to the Perl module output +#--------------------------------------------------------------------------- + +# If the GENERATE_PERLMOD tag is set to YES Doxygen will +# generate a Perl module file that captures the structure of +# the code including all documentation. Note that this +# feature is still experimental and incomplete at the +# moment. + +GENERATE_PERLMOD = NO + +# If the PERLMOD_LATEX tag is set to YES Doxygen will generate +# the necessary Makefile rules, Perl scripts and LaTeX code to be able +# to generate PDF and DVI output from the Perl module output. + +PERLMOD_LATEX = NO + +# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be +# nicely formatted so it can be parsed by a human reader. This is useful +# if you want to understand what is going on. On the other hand, if this +# tag is set to NO the size of the Perl module output will be much smaller +# and Perl will parse it just the same. + +PERLMOD_PRETTY = YES + +# The names of the make variables in the generated doxyrules.make file +# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. +# This is useful so different doxyrules.make files included by the same +# Makefile don't overwrite each other's variables. + +PERLMOD_MAKEVAR_PREFIX = + +#--------------------------------------------------------------------------- +# Configuration options related to the preprocessor +#--------------------------------------------------------------------------- + +# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will +# evaluate all C-preprocessor directives found in the sources and include +# files. + +ENABLE_PREPROCESSING = YES + +# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro +# names in the source code. If set to NO (the default) only conditional +# compilation will be performed. Macro expansion can be done in a controlled +# way by setting EXPAND_ONLY_PREDEF to YES. + +MACRO_EXPANSION = YES + +# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES +# then the macro expansion is limited to the macros specified with the +# PREDEFINED and EXPAND_AS_DEFINED tags. + +EXPAND_ONLY_PREDEF = YES + +# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files +# in the INCLUDE_PATH (see below) will be search if a #include is found. + +SEARCH_INCLUDES = YES + +# The INCLUDE_PATH tag can be used to specify one or more directories that +# contain include files that are not input files but should be processed by +# the preprocessor. + +INCLUDE_PATH = $(KOS_BASE)/include \ + $(KOS_BASE)/kernel/arch/$(KOS_ARCH)/include + +# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard +# patterns (like *.h and *.hpp) to filter out the header-files in the +# directories. If left blank, the patterns specified with FILE_PATTERNS will +# be used. + +INCLUDE_FILE_PATTERNS = *.h + +# The PREDEFINED tag can be used to specify one or more macro names that +# are defined before the preprocessor is started (similar to the -D option of +# gcc). The argument of the tag is a list of macros of the form: name +# or name=definition (no spaces). If the definition and the = are +# omitted =1 is assumed. To prevent a macro definition from being +# undefined via #undef or recursively expanded use the := operator +# instead of the = operator. + +PREDEFINED = _arch_$(KOS_ARCH)=1 \ + __BEGIN_DECLS= \ + __END_DECLS= + +# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then +# this tag can be used to specify a list of macro names that should be expanded. +# The macro definition that is found in the sources will be used. +# Use the PREDEFINED tag if you want to use a different macro definition. + +EXPAND_AS_DEFINED = __BEGIN_DECLS \ + __END_DECLS + +# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then +# doxygen's preprocessor will remove all function-like macros that are alone +# on a line, have an all uppercase name, and do not end with a semicolon. Such +# function macros are typically used for boiler-plate code, and will confuse +# the parser if not removed. + +SKIP_FUNCTION_MACROS = YES + +#--------------------------------------------------------------------------- +# Configuration::additions related to external references +#--------------------------------------------------------------------------- + +# The TAGFILES option can be used to specify one or more tagfiles. +# Optionally an initial location of the external documentation +# can be added for each tagfile. The format of a tag file without +# this location is as follows: +# TAGFILES = file1 file2 ... +# Adding location for the tag files is done as follows: +# TAGFILES = file1=loc1 "file2 = loc2" ... +# where "loc1" and "loc2" can be relative or absolute paths or +# URLs. If a location is present for each tag, the installdox tool +# does not have to be run to correct the links. +# Note that each tag file must have a unique name +# (where the name does NOT include the path) +# If a tag file is not located in the directory in which doxygen +# is run, you must also specify the path to the tagfile here. + +TAGFILES = + +# When a file name is specified after GENERATE_TAGFILE, doxygen will create +# a tag file that is based on the input files it reads. + +GENERATE_TAGFILE = + +# If the ALLEXTERNALS tag is set to YES all external classes will be listed +# in the class index. If set to NO only the inherited external classes +# will be listed. + +ALLEXTERNALS = NO + +# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed +# in the modules index. If set to NO, only the current project's groups will +# be listed. + +EXTERNAL_GROUPS = YES + +# The PERL_PATH should be the absolute path and name of the perl script +# interpreter (i.e. the result of `which perl'). + +PERL_PATH = /usr/bin/perl + +#--------------------------------------------------------------------------- +# Configuration options related to the dot tool +#--------------------------------------------------------------------------- + +# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will +# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base +# or super classes. Setting the tag to NO turns the diagrams off. Note that +# this option is superseded by the HAVE_DOT option below. This is only a +# fallback. It is recommended to install and use dot, since it yields more +# powerful graphs. + +CLASS_DIAGRAMS = YES + +# You can define message sequence charts within doxygen comments using the \msc +# command. Doxygen will then run the mscgen tool (see +# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the +# documentation. The MSCGEN_PATH tag allows you to specify the directory where +# the mscgen tool resides. If left empty the tool is assumed to be found in the +# default search path. + +MSCGEN_PATH = + +# If set to YES, the inheritance and collaboration graphs will hide +# inheritance and usage relations if the target is undocumented +# or is not a class. + +HIDE_UNDOC_RELATIONS = YES + +# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is +# available from the path. This tool is part of Graphviz, a graph visualization +# toolkit from AT&T and Lucent Bell Labs. The other options in this section +# have no effect if this option is set to NO (the default) + +HAVE_DOT = NO + +# By default doxygen will write a font called FreeSans.ttf to the output +# directory and reference it in all dot files that doxygen generates. This +# font does not include all possible unicode characters however, so when you need +# these (or just want a differently looking font) you can specify the font name +# using DOT_FONTNAME. You need need to make sure dot is able to find the font, +# which can be done by putting it in a standard location or by setting the +# DOTFONTPATH environment variable or by setting DOT_FONTPATH to the directory +# containing the font. + +DOT_FONTNAME = FreeSans + +# By default doxygen will tell dot to use the output directory to look for the +# FreeSans.ttf font (which doxygen will put there itself). If you specify a +# different font using DOT_FONTNAME you can set the path where dot +# can find it using this tag. + +DOT_FONTPATH = + +# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for each documented class showing the direct and +# indirect inheritance relations. Setting this tag to YES will force the +# the CLASS_DIAGRAMS tag to NO. + +CLASS_GRAPH = YES + +# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for each documented class showing the direct and +# indirect implementation dependencies (inheritance, containment, and +# class references variables) of the class with other documented classes. + +COLLABORATION_GRAPH = YES + +# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for groups, showing the direct groups dependencies + +GROUP_GRAPHS = YES + +# If the UML_LOOK tag is set to YES doxygen will generate inheritance and +# collaboration diagrams in a style similar to the OMG's Unified Modeling +# Language. + +UML_LOOK = NO + +# If set to YES, the inheritance and collaboration graphs will show the +# relations between templates and their instances. + +TEMPLATE_RELATIONS = YES + +# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT +# tags are set to YES then doxygen will generate a graph for each documented +# file showing the direct and indirect include dependencies of the file with +# other documented files. + +INCLUDE_GRAPH = YES + +# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and +# HAVE_DOT tags are set to YES then doxygen will generate a graph for each +# documented header file showing the documented files that directly or +# indirectly include this file. + +INCLUDED_BY_GRAPH = YES + +# If the CALL_GRAPH and HAVE_DOT options are set to YES then +# doxygen will generate a call dependency graph for every global function +# or class method. Note that enabling this option will significantly increase +# the time of a run. So in most cases it will be better to enable call graphs +# for selected functions only using the \callgraph command. + +CALL_GRAPH = NO + +# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then +# doxygen will generate a caller dependency graph for every global function +# or class method. Note that enabling this option will significantly increase +# the time of a run. So in most cases it will be better to enable caller +# graphs for selected functions only using the \callergraph command. + +CALLER_GRAPH = NO + +# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen +# will graphical hierarchy of all classes instead of a textual one. + +GRAPHICAL_HIERARCHY = YES + +# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES +# then doxygen will show the dependencies a directory has on other directories +# in a graphical way. The dependency relations are determined by the #include +# relations between the files in the directories. + +DIRECTORY_GRAPH = YES + +# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images +# generated by dot. Possible values are png, jpg, or gif +# If left blank png will be used. + +DOT_IMAGE_FORMAT = png + +# The tag DOT_PATH can be used to specify the path where the dot tool can be +# found. If left blank, it is assumed the dot tool can be found in the path. + +DOT_PATH = + +# The DOTFILE_DIRS tag can be used to specify one or more directories that +# contain dot files that are included in the documentation (see the +# \dotfile command). + +DOTFILE_DIRS = + +# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of +# nodes that will be shown in the graph. If the number of nodes in a graph +# becomes larger than this value, doxygen will truncate the graph, which is +# visualized by representing a node as a red box. Note that doxygen if the +# number of direct children of the root node in a graph is already larger than +# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note +# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH. + +DOT_GRAPH_MAX_NODES = 50 + +# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the +# graphs generated by dot. A depth value of 3 means that only nodes reachable +# from the root by following a path via at most 3 edges will be shown. Nodes +# that lay further from the root node will be omitted. Note that setting this +# option to 1 or 2 may greatly reduce the computation time needed for large +# code bases. Also note that the size of a graph can be further restricted by +# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction. + +MAX_DOT_GRAPH_DEPTH = 0 + +# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent +# background. This is enabled by default, which results in a transparent +# background. Warning: Depending on the platform used, enabling this option +# may lead to badly anti-aliased labels on the edges of a graph (i.e. they +# become hard to read). + +DOT_TRANSPARENT ... [truncated message content] |
From: <qu...@us...> - 2009-12-31 02:30:46
|
Revision: 655 http://cadcdev.svn.sourceforge.net/cadcdev/?rev=655&view=rev Author: quzar Date: 2009-12-31 02:30:38 +0000 (Thu, 31 Dec 2009) Log Message: ----------- B and G values were swapped in the last update to screenshot.c. Fixed. Modified Paths: -------------- kos/kernel/arch/dreamcast/util/screenshot.c Modified: kos/kernel/arch/dreamcast/util/screenshot.c =================================================================== --- kos/kernel/arch/dreamcast/util/screenshot.c 2009-10-11 20:49:34 UTC (rev 654) +++ kos/kernel/arch/dreamcast/util/screenshot.c 2009-12-31 02:30:38 UTC (rev 655) @@ -54,8 +54,8 @@ for (i = 0; i < numpix; i++) { pixel = vram_s[i]; r = (((pixel >> 10) & 0x1f) << 3); - b = (((pixel >> 5) & 0x1f) << 3); - g = (((pixel >> 0) & 0x1f) << 3); + g = (((pixel >> 5) & 0x1f) << 3); + b = (((pixel >> 0) & 0x1f) << 3); buffer[i * 3 + 0] = r; buffer[i * 3 + 1] = g; buffer[i * 3 + 2] = b; @@ -67,8 +67,8 @@ for (i = 0; i < numpix; i++) { pixel = vram_s[i]; r = (((pixel >> 11) & 0x1f) << 3); - b = (((pixel >> 5) & 0x3f) << 2); - g = (((pixel >> 0) & 0x1f) << 3); + g = (((pixel >> 5) & 0x3f) << 2); + b = (((pixel >> 0) & 0x1f) << 3); buffer[i * 3 + 0] = r; buffer[i * 3 + 1] = g; buffer[i * 3 + 2] = b; @@ -80,8 +80,8 @@ for (i = 0; i < numpix; i++) { pixel = vram_l[i]; r = (((pixel >> 16) & 0xff)); - b = (((pixel >> 8) & 0xff)); - g = (((pixel >> 0) & 0xff)); + g = (((pixel >> 8) & 0xff)); + b = (((pixel >> 0) & 0xff)); buffer[i * 3 + 0] = r; buffer[i * 3 + 1] = g; buffer[i * 3 + 2] = b; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ljs...@us...> - 2009-10-11 20:49:43
|
Revision: 654 http://cadcdev.svn.sourceforge.net/cadcdev/?rev=654&view=rev Author: ljsebald Date: 2009-10-11 20:49:34 +0000 (Sun, 11 Oct 2009) Log Message: ----------- Add a couple of events related to GD-ROM DMA. Modified Paths: -------------- kos/kernel/arch/dreamcast/hardware/asic.c kos/kernel/arch/dreamcast/include/dc/asic.h Modified: kos/kernel/arch/dreamcast/hardware/asic.c =================================================================== --- kos/kernel/arch/dreamcast/hardware/asic.c 2009-10-07 23:38:41 UTC (rev 653) +++ kos/kernel/arch/dreamcast/hardware/asic.c 2009-10-11 20:49:34 UTC (rev 654) @@ -87,7 +87,9 @@ 69x8 bit 2 out of primitive memory - bit 3 out of matrix memory + 3 out of matrix memory + 12 gd-rom dma illegal address + 13 gd-rom dma overrun */ Modified: kos/kernel/arch/dreamcast/include/dc/asic.h =================================================================== --- kos/kernel/arch/dreamcast/include/dc/asic.h 2009-10-07 23:38:41 UTC (rev 653) +++ kos/kernel/arch/dreamcast/include/dc/asic.h 2009-10-11 20:49:34 UTC (rev 654) @@ -35,6 +35,8 @@ /* Event codes for the GD controller */ #define ASIC_EVT_GD_COMMAND 0x0100 /* GD-Rom Command Status */ #define ASIC_EVT_GD_DMA 0x000e /* GD-Rom DMA complete */ +#define ASIC_EVT_GD_DMA_OVERRUN 0x020d /* GD-Rom DMA overrun */ +#define ASIC_EVT_GD_DMA_ILLADDR 0x020c /* GD-Rom DMA illegal address */ /* Event codes for the Maple controller */ #define ASIC_EVT_MAPLE_DMA 0x000c /* Maple DMA complete */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ljs...@us...> - 2009-10-07 23:38:56
|
Revision: 653 http://cadcdev.svn.sourceforge.net/cadcdev/?rev=653&view=rev Author: ljsebald Date: 2009-10-07 23:38:41 +0000 (Wed, 07 Oct 2009) Log Message: ----------- Fix a stupid bug with non-textured sprites. Modified Paths: -------------- kos/kernel/arch/dreamcast/hardware/pvr/pvr_prim.c Modified: kos/kernel/arch/dreamcast/hardware/pvr/pvr_prim.c =================================================================== --- kos/kernel/arch/dreamcast/hardware/pvr/pvr_prim.c 2009-10-06 23:56:58 UTC (rev 652) +++ kos/kernel/arch/dreamcast/hardware/pvr/pvr_prim.c 2009-10-07 23:38:41 UTC (rev 653) @@ -201,7 +201,7 @@ int alpha; /* Start off blank */ - memset(dst, 0, sizeof(pvr_poly_cxt_t)); + memset(dst, 0, sizeof(pvr_sprite_cxt_t)); /* Fill in a few values */ dst->list_type = list; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ljs...@us...> - 2009-10-06 23:57:12
|
Revision: 652 http://cadcdev.svn.sourceforge.net/cadcdev/?rev=652&view=rev Author: ljsebald Date: 2009-10-06 23:56:58 +0000 (Tue, 06 Oct 2009) Log Message: ----------- Reorder init/shutdown of the network components, don't allow net_init to be called twice without shutting it down, and fix some indentation issues. Modified Paths: -------------- kos/kernel/net/net_core.c Modified: kos/kernel/net/net_core.c =================================================================== --- kos/kernel/net/net_core.c 2009-10-06 23:54:43 UTC (rev 651) +++ kos/kernel/net/net_core.c 2009-10-06 23:56:58 UTC (rev 652) @@ -37,6 +37,9 @@ /* ARP cache */ struct netarp_list net_arp_cache = LIST_HEAD_INITIALIZER(0); +/* Are we already initialized? */ +static int net_initted = 0; + /* Default net device */ netif_t *net_default_dev = NULL; @@ -99,7 +102,7 @@ /* Set default */ netif_t *net_set_default(netif_t *n) { - netif_t *olddev = net_default_dev; + netif_t *olddev = net_default_dev; net_default_dev = n; @@ -126,9 +129,9 @@ continue; } - /* Set the first detected device to be the default */ - if(net_default_dev == NULL) - net_set_default(cur); + /* Set the first detected device to be the default */ + if(net_default_dev == NULL) + net_set_default(cur); detected++; } @@ -140,6 +143,10 @@ /* Init */ int net_init() { + /* Make sure we haven't already done this */ + if(net_initted) + return 0; + /* Detect and potentially initialize devices */ if (net_dev_init() < 0) return -1; @@ -153,18 +160,20 @@ /* Initialize IP fragmentation support */ net_ipv4_frag_init(); + /* Initialize the sockets-like interface */ + fs_socket_init(); + /* Initialize the UDP system */ net_udp_init(); - /* Initialize the sockets-like interface */ - fs_socket_init(); + /* Initialize the DHCP system */ + net_dhcp_init(); - /* Initialize the DHCP system */ - net_dhcp_init(); + if(net_default_dev && !net_default_dev->ip_addr[0]) { + return net_dhcp_request(); + } - if(net_default_dev && !net_default_dev->ip_addr[0]) { - return net_dhcp_request(); - } + net_initted = 1; return 0; } @@ -173,15 +182,19 @@ void net_shutdown() { netif_t *cur; - /* Shut down DHCP */ - net_dhcp_shutdown(); + /* Make sure we actually initialized the net stuff to begin with */ + if(!net_initted) + return; - /* Shut down the sockets-like interface */ - fs_socket_shutdown(); + /* Shut down DHCP */ + net_dhcp_shutdown(); /* Shut down the UDP system */ net_udp_shutdown(); + /* Shut down the sockets-like interface */ + fs_socket_shutdown(); + /* Shut down IP fragmentation support */ net_ipv4_frag_shutdown(); @@ -202,4 +215,6 @@ /* Blank out the list */ LIST_INIT(&net_if_list); + + net_initted = 0; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ljs...@us...> - 2009-10-06 23:55:04
|
Revision: 651 http://cadcdev.svn.sourceforge.net/cadcdev/?rev=651&view=rev Author: ljsebald Date: 2009-10-06 23:54:43 +0000 (Tue, 06 Oct 2009) Log Message: ----------- Fix stupid possible bug in cleaning up the fragment list. Modified Paths: -------------- kos/kernel/net/net_ipv4_frag.c Modified: kos/kernel/net/net_ipv4_frag.c =================================================================== --- kos/kernel/net/net_ipv4_frag.c 2009-10-06 23:53:38 UTC (rev 650) +++ kos/kernel/net/net_ipv4_frag.c 2009-10-06 23:54:43 UTC (rev 651) @@ -54,15 +54,17 @@ /* Look at each fragment item, and see if the timer has expired. If so, remvoe it. */ - TAILQ_FOREACH(f, &frags, listhnd) { + f = TAILQ_FIRST(&frags); + while(f) { n = TAILQ_NEXT(f, listhnd); if(f->death_time < now) { TAILQ_REMOVE(&frags, f, listhnd); free(f->data); free(f); - f = n; } + + f = n; } mutex_unlock(frag_mutex); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ljs...@us...> - 2009-10-06 23:53:46
|
Revision: 650 http://cadcdev.svn.sourceforge.net/cadcdev/?rev=650&view=rev Author: ljsebald Date: 2009-10-06 23:53:38 +0000 (Tue, 06 Oct 2009) Log Message: ----------- Remove pointless underscores in the ping_pkt structure name. Modified Paths: -------------- kos/kernel/net/net_icmp.c Modified: kos/kernel/net/net_icmp.c =================================================================== --- kos/kernel/net/net_icmp.c 2009-10-06 21:14:53 UTC (rev 649) +++ kos/kernel/net/net_icmp.c 2009-10-06 23:53:38 UTC (rev 650) @@ -36,8 +36,8 @@ 16 - Information Reply */ -struct __ping_pkt { - LIST_ENTRY(__ping_pkt) pkt_list; +struct ping_pkt { + LIST_ENTRY(ping_pkt) pkt_list; uint8 ip[4]; uint8 *data; int data_sz; @@ -45,9 +45,9 @@ uint64 usec; }; -LIST_HEAD(__ping_pkt_list, __ping_pkt); +LIST_HEAD(ping_pkt_list, ping_pkt); -static struct __ping_pkt_list pings = LIST_HEAD_INITIALIZER(0); +static struct ping_pkt_list pings = LIST_HEAD_INITIALIZER(0); static uint16 icmp_echo_seq = 1; static void icmp_default_echo_cb(const uint8 *ip, uint16 seq, uint64 delta_us, @@ -64,7 +64,7 @@ static void net_icmp_input_0(netif_t *src, ip_hdr_t *ip, icmp_hdr_t *icmp, const uint8 *d, int s) { uint64 tmr; - struct __ping_pkt *ping; + struct ping_pkt *ping; uint16 seq; tmr = timer_us_gettime64(); @@ -142,7 +142,7 @@ int net_icmp_send_echo(netif_t *net, const uint8 ipaddr[4], const uint8 *data, int size) { icmp_hdr_t *icmp; - struct __ping_pkt *newping; + struct ping_pkt *newping; int r = -1; uint8 databuf[sizeof(icmp_hdr_t) + size]; uint16 seq = icmp_echo_seq++; @@ -171,7 +171,7 @@ src = net_ipv4_address(net->ip_addr); } - newping = (struct __ping_pkt*) malloc(sizeof(struct __ping_pkt)); + newping = (struct ping_pkt*) malloc(sizeof(struct ping_pkt)); newping->data = (uint8 *)malloc(size); newping->data_sz = size; newping->icmp_seq = seq; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ljs...@us...> - 2009-10-06 21:15:01
|
Revision: 649 http://cadcdev.svn.sourceforge.net/cadcdev/?rev=649&view=rev Author: ljsebald Date: 2009-10-06 21:14:53 +0000 (Tue, 06 Oct 2009) Log Message: ----------- Add biosfont-based framebuffer dbgio interface. Modified Paths: -------------- kos/kernel/arch/dreamcast/kernel/init.c kos/kernel/arch/dreamcast/kernel/initall_hdrs.h kos/kernel/arch/dreamcast/util/Makefile Added Paths: ----------- kos/kernel/arch/dreamcast/include/dc/fb_console.h kos/kernel/arch/dreamcast/util/fb_console.c Added: kos/kernel/arch/dreamcast/include/dc/fb_console.h =================================================================== --- kos/kernel/arch/dreamcast/include/dc/fb_console.h (rev 0) +++ kos/kernel/arch/dreamcast/include/dc/fb_console.h 2009-10-06 21:14:53 UTC (rev 649) @@ -0,0 +1,29 @@ +/* KallistiOS ##version## + + dc/fb_console.h + Copyright (C) 2009 Lawrence Sebald + +*/ + +#ifndef __DC_FB_CONSOLE_H +#define __DC_FB_CONSOLE_H + +#include <sys/cdefs.h> +__BEGIN_DECLS + +#include <kos/dbgio.h> + +extern dbgio_handler_t dbgio_fb; + +/* Set up the target for the "framebuffer". This allows you to move it around + so that, for example, you could have it render to a texture rather than + to the full framebuffer. If you don't call this, then by default this + dbgio interface prints to the full 640x480 framebuffer with a 32-pixel + border. To restore this functionality after changing it, call this function + with a NULL for t, and the appropriate parameters in w, h, borderx, and + bordery. */ +void dbgio_fb_set_target(uint16 *t, int w, int h, int borderx, int bordery); + +__END_DECLS + +#endif /* __DC_FB_CONSOLE_H */ Modified: kos/kernel/arch/dreamcast/kernel/init.c =================================================================== --- kos/kernel/arch/dreamcast/kernel/init.c 2009-10-06 21:09:32 UTC (rev 648) +++ kos/kernel/arch/dreamcast/kernel/init.c 2009-10-06 21:14:53 UTC (rev 649) @@ -38,8 +38,9 @@ /* We have to put this here so we can include plat-specific devices */ dbgio_handler_t * dbgio_handlers[] = { &dbgio_dcload, - &dbgio_dcls, + &dbgio_dcls, &dbgio_scif, + &dbgio_fb, &dbgio_null }; int dbgio_handler_cnt = sizeof(dbgio_handlers) / sizeof(dbgio_handler_t *); Modified: kos/kernel/arch/dreamcast/kernel/initall_hdrs.h =================================================================== --- kos/kernel/arch/dreamcast/kernel/initall_hdrs.h 2009-10-06 21:09:32 UTC (rev 648) +++ kos/kernel/arch/dreamcast/kernel/initall_hdrs.h 2009-10-06 21:14:53 UTC (rev 649) @@ -19,3 +19,4 @@ #include <dc/scif.h> #include <arch/irq.h> #include <arch/timer.h> +#include <dc/fb_console.h> Modified: kos/kernel/arch/dreamcast/util/Makefile =================================================================== --- kos/kernel/arch/dreamcast/util/Makefile 2009-10-06 21:09:32 UTC (rev 648) +++ kos/kernel/arch/dreamcast/util/Makefile 2009-10-06 21:14:53 UTC (rev 649) @@ -4,7 +4,7 @@ # (c)2001 Dan Potter # -OBJS = vmu_pkg.o screenshot.o +OBJS = vmu_pkg.o screenshot.o fb_console.o SUBDIRS = include $(KOS_BASE)/Makefile.prefab Added: kos/kernel/arch/dreamcast/util/fb_console.c =================================================================== --- kos/kernel/arch/dreamcast/util/fb_console.c (rev 0) +++ kos/kernel/arch/dreamcast/util/fb_console.c 2009-10-06 21:14:53 UTC (rev 649) @@ -0,0 +1,140 @@ +/* KallistiOS ##version## + + util/fb_console.c + Copyright (C) 2009 Lawrence Sebald + +*/ + +#include <string.h> +#include <errno.h> +#include <kos/dbgio.h> +#include <dc/fb_console.h> +#include <dc/biosfont.h> +#include <dc/video.h> + +/* This is a very simple dbgio interface for doing debug to the framebuffer with + the biosfont functionality. Basically, this was written to aid in debugging + the network stack, and I figured other people would probably get some use out + of it as well. */ + +static uint16 *fb; +static int fb_w, fb_h; +static int cur_x, cur_y; +static int min_x, min_y, max_x, max_y; + +/* I don't think this is in a header anywhere any more. */ +extern void *memcpy2(void *dest, const void *src, size_t count); +extern void *memset2(void *s, unsigned short c, size_t count); + +#define FONT_CHAR_WIDTH 12 +#define FONT_CHAR_HEIGHT 24 + +static int fb_detected() { + return 1; +} + +static int fb_init() { + bfont_set_encoding(BFONT_CODE_ISO8859_1); + + /* Assume we're using 640x480x16bpp */ + fb = NULL; + fb_w = 640; + fb_h = 480; + min_x = 32; + min_y = 32; + max_x = 608; + max_y = 448; + cur_x = 32; + cur_y = 32; + + return 0; +} + +static int fb_shutdown() { + return 0; +} + +static int fb_set_irq_usage(int mode) { + return 0; +} + +static int fb_read() { + errno = EAGAIN; + return -1; +} + +static int fb_write(int c) { + uint16 *t = fb; + + if(!t) + t = vram_s; + + if(c != '\n') { + bfont_draw(t + cur_y * fb_w + cur_x, fb_w, 1, c); + cur_x += FONT_CHAR_WIDTH; + } + + /* If we have a newline or we've gone past the end of the line, advance down + one line. */ + if(c == '\n' || cur_x + FONT_CHAR_WIDTH > max_x) { + cur_y += FONT_CHAR_HEIGHT; + cur_x = min_x; + + /* If going down a line put us over the edge of the screen, move + everything up a line, fixing the problem. */ + if(cur_y + FONT_CHAR_HEIGHT > max_y) { + memcpy2(t + min_y * fb_w, t + (min_y + FONT_CHAR_HEIGHT) * fb_w, + (cur_y - min_y - FONT_CHAR_HEIGHT) * fb_w * 2); + cur_y -= FONT_CHAR_HEIGHT; + memset2(t + cur_y * fb_w, 0, FONT_CHAR_HEIGHT * fb_w * 2); + } + } + + return 1; +} + +static int fb_flush() { + return 0; +} + +static int fb_write_buffer(const uint8 *data, int len, int xlat) { + int rv = len; + + while(len--) { + fb_write((int)(*data++)); + } + + return rv; +} + +static int fb_read_buffer(uint8 * data, int len) { + errno = EAGAIN; + return -1; +} + +dbgio_handler_t dbgio_fb = { + "fb", + fb_detected, + fb_init, + fb_shutdown, + fb_set_irq_usage, + fb_read, + fb_write, + fb_flush, + fb_write_buffer, + fb_read_buffer +}; + +void dbgio_fb_set_target(uint16 *t, int w, int h, int borderx, int bordery) { + /* Set up all the new parameters. */ + fb = t; + + fb_w = w; + fb_h = h; + min_x = borderx; + min_y = bordery; + max_x = fb_w - borderx; + max_y = fb_w - bordery; + cur_x = min_x; + cur_y = min_y; +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ljs...@us...> - 2009-10-06 21:09:38
|
Revision: 648 http://cadcdev.svn.sourceforge.net/cadcdev/?rev=648&view=rev Author: ljsebald Date: 2009-10-06 21:09:32 +0000 (Tue, 06 Oct 2009) Log Message: ----------- Initialize the target dbgio device when switching devices. Modified Paths: -------------- kos/kernel/debug/dbgio.c Modified: kos/kernel/debug/dbgio.c =================================================================== --- kos/kernel/debug/dbgio.c 2009-08-03 00:38:45 UTC (rev 647) +++ kos/kernel/debug/dbgio.c 2009-10-06 21:09:32 UTC (rev 648) @@ -29,6 +29,12 @@ for (i=0; i<dbgio_handler_cnt; i++) { if (!strcmp(dbgio_handlers[i]->name, name)) { + /* Try to initialize the device, and if we can't then bail. */ + if(dbgio_handlers[i]->init()) { + errno = ENODEV; + return -1; + } + dbgio = dbgio_handlers[i]; return 0; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ljs...@us...> - 2009-08-03 00:38:53
|
Revision: 647 http://cadcdev.svn.sourceforge.net/cadcdev/?rev=647&view=rev Author: ljsebald Date: 2009-08-03 00:38:45 +0000 (Mon, 03 Aug 2009) Log Message: ----------- Support for multiple framebuffers when the PVR isn't being used. Modified Paths: -------------- kos/kernel/arch/dreamcast/hardware/video.c kos/kernel/arch/dreamcast/include/dc/video.h Modified: kos/kernel/arch/dreamcast/hardware/video.c =================================================================== --- kos/kernel/arch/dreamcast/hardware/video.c 2009-06-12 02:40:54 UTC (rev 646) +++ kos/kernel/arch/dreamcast/hardware/video.c 2009-08-03 00:38:45 UTC (rev 647) @@ -11,6 +11,8 @@ #include <string.h> #include <stdio.h> +#define FBPOS(n) (n * 0x200000) + /*-----------------------------------------------------------------------------*/ /* This table is indexed w/ DM_* */ vid_mode_t vid_builtin[DM_MODE_COUNT] = { @@ -205,6 +207,198 @@ { 0, 0, 0, 0 } }, + /* All of the modes below this comment are exactly the same as the ones + above, other than that they support multiple framebuffers (in the current + case, 4). They're only particularly useful if you're doing a drawing by + directly writing to the framebuffer, and are not useful at all if you're + using the PVR to do your drawing. */ + /* 320x240 VGA 60Hz */ + /* DM_320x240_VGA_MB */ + { + DM_320x240 | DM_MULTIBUFFER, + 320, 240, + VID_PIXELDOUBLE|VID_LINEDOUBLE, + CT_VGA, + 0, + 262, 857, + 0xAC, 0x28, + 0x15, 0x104, + 141, 843, + 24, 263, + 0, VID_MAX_FB, + { FBPOS(0), FBPOS(1), FBPOS(2), FBPOS(3) } + }, + + /* 320x240 NTSC 60Hz */ + /* DM_320x240_NTSC_MB */ + { + DM_320x240 | DM_MULTIBUFFER, + 320, 240, + VID_PIXELDOUBLE|VID_LINEDOUBLE, + CT_ANY, + 0, + 262, 857, + 0xA4, 0x18, + 0x15, 0x104, + 141, 843, + 24, 263, + 0, VID_MAX_FB, + { FBPOS(0), FBPOS(1), FBPOS(2), FBPOS(3) } + }, + + /* 640x480 VGA 60Hz */ + /* DM_640x480_VGA_MB */ + { + DM_640x480 | DM_MULTIBUFFER, + 640, 480, + VID_INTERLACE, + CT_VGA, + 0, + 0x20C, 0x359, + 0xAC, 0x28, + 0x15, 0x104, + 0x7E, 0x345, + 0x24, 0x204, + 0, VID_MAX_FB, + { FBPOS(0), FBPOS(1), FBPOS(2), FBPOS(3) } + }, + + /* 640x480 NTSC 60Hz IL */ + /* DM_640x480_NTSC_IL_MB */ + { + DM_640x480 | DM_MULTIBUFFER, + 640, 480, + VID_INTERLACE, + CT_ANY, + 0, + 0x20C, 0x359, + 0xA4, 0x12, + 0x15, 0x104, + 0x7E, 0x345, + 0x24, 0x204, + 0, VID_MAX_FB, + { FBPOS(0), FBPOS(1), FBPOS(2), FBPOS(3) } + }, + + /* 800x608 NTSC 60Hz (VGA) [BROKEN!] */ + /* DM_800x608_VGA_MB */ + { + DM_800x608 | DM_MULTIBUFFER, + 320, 240, + VID_INTERLACE, + 1/*CT_ANY*/, /* This will block the mode from being set. */ + 0, + 262, 857, + 164, 24, + 21, 82, + 141, 843, + 24, 264, + 0, VID_MAX_FB, + { FBPOS(0), FBPOS(1), FBPOS(2), FBPOS(3) } + }, + + /* 640x480 PAL 50Hz IL */ + /* DM_640x480_PAL_IL_MB */ + { + DM_640x480 | DM_MULTIBUFFER, + 640, 480, + VID_INTERLACE|VID_PAL, + CT_ANY, + 0, + 0x270, 0x35F, + 0xAE, 0x2D, + 0x15, 0x104, + 0x8D, 0x34B, + 0x2C, 0x26C, + 0, VID_MAX_FB, + { FBPOS(0), FBPOS(1), FBPOS(2), FBPOS(3) } + }, + + /* 256x256 PAL 50Hz IL (seems to output the same w/o VID_PAL, ie. in NTSC IL mode) */ + /* DM_256x256_PAL_IL_MB */ + { + DM_256x256 | DM_MULTIBUFFER, + 256, 256, + VID_PIXELDOUBLE|VID_LINEDOUBLE|VID_INTERLACE|VID_PAL, + CT_ANY, + 0, + 624, 863, + 226, 37, + 0x15, 0x104, + 0x8D, 0x34B, + 0x2C, 0x26C, + 0, VID_MAX_FB, + { FBPOS(0), FBPOS(1), FBPOS(2), FBPOS(3) } + }, + + /* 768x480 NTSC 60Hz IL (thanks DCGrendel) */ + /* DM_768x480_NTSC_IL_MB */ + { + DM_768x480 | DM_MULTIBUFFER, + 768, 480, + VID_INTERLACE, + CT_ANY, + 0, + 524, 857, + 96, 18, + 0x15, 0x104, + 0x2e, 0x345, + 0x24, 0x204, + 0, VID_MAX_FB, + { FBPOS(0), FBPOS(1), FBPOS(2), FBPOS(3) } + }, + + /* 768x576 PAL 50Hz IL (DCG) */ + /* DM_768x576_PAL_IL_MB */ + { + DM_768x576 | DM_MULTIBUFFER, + 768, 576, + VID_INTERLACE | VID_PAL, + CT_ANY, + 0, + 624, 863, + 88, 16, + 0x18, 0x104, + 0x36, 0x34b, + 0x2c, 0x26c, + 0, VID_MAX_FB, + { FBPOS(0), FBPOS(1), FBPOS(2), FBPOS(3) } + }, + + /* 768x480 PAL 50Hz IL */ + /* DM_768x480_PAL_IL_MB */ + { + DM_768x480 | DM_MULTIBUFFER, + 768, 480, + VID_INTERLACE | VID_PAL, + CT_ANY, + 0, + 624, 863, + 88, 16, + 0x18, 0x104, + 0x36, 0x34b, + 0x2c, 0x26c, + 0, VID_MAX_FB, + { FBPOS(0), FBPOS(1), FBPOS(2), FBPOS(3) } + }, + + /* 320x240 PAL 50Hz (thanks Marco Martins aka Mekanaizer) */ + /* DM_320x240_PAL_MB */ + { + DM_320x240 | DM_MULTIBUFFER, + 320, 240, + VID_PIXELDOUBLE|VID_LINEDOUBLE|VID_PAL, + CT_ANY, + 0, + 312, 863, + 174, 45, + 21, 260, + 141, 843, + 44, 620, + 0, VID_MAX_FB, + { FBPOS(0), FBPOS(1), FBPOS(2), FBPOS(3) } + }, + /* END */ /* DM_SENTINEL */ { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, { 0, 0, 0, 0 } } @@ -244,10 +438,15 @@ /*-----------------------------------------------------------------------------*/ void vid_set_mode(int dm, int pm) { vid_mode_t mode; - int i, ct, found; + int i, ct, found, dm2; ct = vid_check_cable(); + /* Remove the multi-buffering flag from the mode, if its present, and save + the state of that flag. */ + dm2 = dm & DM_MULTIBUFFER; + dm &= ~DM_MULTIBUFFER; + /* Check to see if we should use a direct mode index, a generic mode check, or if it's just invalid. */ if (dm > DM_INVALID && dm < DM_SENTINEL) { @@ -256,7 +455,7 @@ found = 0; for (i=1; i<DM_SENTINEL; i++) { /* Is it the right generic mode? */ - if (vid_builtin[i].generic != dm) + if (vid_builtin[i].generic != (dm | dm2)) continue; /* Do we have the right cable type? */ @@ -318,9 +517,10 @@ mode->scanlines *= 2; } - dbglog(DBG_INFO, "vid_set_mode: %ix%i%s %s\n", mode->width, mode->height, + dbglog(DBG_INFO, "vid_set_mode: %ix%i%s %s%s\n", mode->width, mode->height, (mode->flags & VID_INTERLACE) ? "IL" : "", - (mode->flags & VID_PAL) ? "PAL" : "NTSC"); + (mode->flags & VID_PAL) ? "PAL" : "NTSC", + (mode->generic & DM_MULTIBUFFER) ? " multi-buffered" : ""); vid_border_color(0, 0, 0); @@ -392,7 +592,9 @@ memcpy(&currmode, mode, sizeof(vid_mode_t)); vid_mode = &currmode; - vid_set_start(0); + /* Set up the framebuffer */ + vid_mode->fb_curr = -1; + vid_flip(0); /* Set cable type */ if (mode->cable_type & 1) { @@ -427,6 +629,7 @@ /*-----------------------------------------------------------------------------*/ void vid_flip(int fb) { uint16 oldfb; + uint32 base; oldfb = vid_mode->fb_curr; if (fb < 0) { @@ -441,6 +644,11 @@ } vid_set_start(vid_mode->fb_base[vid_mode->fb_curr]); + + /* Set the vram_* pointers as expected */ + base = vid_mode->fb_base[(vid_mode->fb_curr + 1) & (vid_mode->fb_count - 1)]; + vram_s = (uint16*)(0xA5000000|base); + vram_l = (uint32*)(0xA5000000|base); } /*-----------------------------------------------------------------------------*/ Modified: kos/kernel/arch/dreamcast/include/dc/video.h =================================================================== --- kos/kernel/arch/dreamcast/include/dc/video.h 2009-06-12 02:40:54 UTC (rev 646) +++ kos/kernel/arch/dreamcast/include/dc/video.h 2009-08-03 00:38:45 UTC (rev 647) @@ -38,6 +38,9 @@ DM_GENERIC_LAST = DM_768x576 }; +// OR this with the generic mode to get 4 framebuffers instead of one +#define DM_MULTIBUFFER 0x2000 + //----------------------------------------------------------------------------- // More specific modes (and actual indeces into the mode table) @@ -55,6 +58,17 @@ DM_768x576_PAL_IL, DM_768x480_PAL_IL, DM_320x240_PAL, + DM_320x240_VGA_MB, + DM_320x240_NTSC_MB, + DM_640x480_VGA_MB, + DM_640x480_NTSC_IL_MB, + DM_800x608_VGA_MB, + DM_640x480_PAL_IL_MB, + DM_256x256_PAL_IL_MB, + DM_768x480_NTSC_IL_MB, + DM_768x576_PAL_IL_MB, + DM_768x480_PAL_IL_MB, + DM_320x240_PAL_MB, // The below is only for counting.. DM_SENTINEL, DM_MODE_COUNT @@ -95,6 +109,12 @@ extern vid_mode_t *vid_mode; //----------------------------------------------------------------------------- +// These point to the current drawing area. If you're not using a multi-buffered +// mode, that means they do what KOS always used to do (they'll point at the +// start of VRAM). If you're using a multi-buffered mode, they'll point at the +// next framebuffer to be displayed. You must use vid_flip for this to work +// though (if you use vid_set_start, they'll point at the display base, for +// compatibility's sake). extern uint16 *vram_s; extern uint32 *vram_l; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ljs...@us...> - 2009-06-12 02:40:57
|
Revision: 646 http://cadcdev.svn.sourceforge.net/cadcdev/?rev=646&view=rev Author: ljsebald Date: 2009-06-12 02:40:54 +0000 (Fri, 12 Jun 2009) Log Message: ----------- Further work on IP reassembly: * Support the "timer" specified in RFC 791 for disposing of unfinished fragments (we should send an ICMP message about them though). * A much better "set_bits" function that more efficiently handles most cases. Modified Paths: -------------- kos/kernel/net/net_ipv4_frag.c Modified: kos/kernel/net/net_ipv4_frag.c =================================================================== --- kos/kernel/net/net_ipv4_frag.c 2009-06-11 19:50:58 UTC (rev 645) +++ kos/kernel/net/net_ipv4_frag.c 2009-06-12 02:40:54 UTC (rev 646) @@ -7,12 +7,14 @@ #include <string.h> #include <stdlib.h> +#include <string.h> #include <errno.h> #include <arpa/inet.h> #include <kos/net.h> #include <kos/mutex.h> #include <arch/timer.h> +#include <arch/irq.h> #include "net_ipv4.h" #include "net_thd.h" @@ -41,13 +43,59 @@ static mutex_t *frag_mutex = NULL; static int cbid = -1; -/* Set the bits in the bitfield for the given set of fragment blocks. - XXXX: This is horribly inefficient. */ +/* IP fragment "thread" -- this thread is set up to delete fragments for which + the "death_time" has passed. This is run approximately once every two + seconds (since death_time is always on the order of seconds). */ +static void frag_thd_cb(void *data __attribute__((unused))) { + struct ip_frag *f, *n; + uint64 now = timer_ms_gettime64(); + + mutex_lock(frag_mutex); + + /* Look at each fragment item, and see if the timer has expired. If so, + remvoe it. */ + TAILQ_FOREACH(f, &frags, listhnd) { + n = TAILQ_NEXT(f, listhnd); + + if(f->death_time < now) { + TAILQ_REMOVE(&frags, f, listhnd); + free(f->data); + free(f); + f = n; + } + } + + mutex_unlock(frag_mutex); +} + +/* Set the bits in the bitfield for the given set of fragment blocks. */ static inline void set_bits(uint8 *bitfield, int start, int end) { - --end; - while(end >= start) { - bitfield[end >> 3] |= (1 << (end & 0x07)); + /* Use a slightly more efficient method when dealing with an end that is not + in the same byte as the start. */ + if((end >> 3) > (start >> 3)) { + int bits = start & 0x07; + + /* Finish off anything in the start byte... */ + while(bits && bits < 8) { + bitfield[start >> 3] |= (1 << bits); + ++bits; + } + + /* ...and the start of the end byte. */ + bits = end & 0x07; + bitfield[end >> 3] |= (1 << bits) - 1; + + /* Now, fill anything in in the middle. */ + bits = (end >> 3) - ((start + 1) >> 3); + memset(bitfield + ((start + 1) >> 3), 0xFF, bits); + } + /* Fall back to brute-forcing it for when the two are in the same byte. */ + else { --end; + while(end >= start) { + bitfield[end >> 3] |= (1 << (end & 0x07)); + --end; + } } } @@ -199,9 +247,19 @@ return net_ipv4_input_proto(src, hdr, data); } + /* This is usually called inside an interrupt, so try to safely lock the + mutex, and bail if we can't. */ + if(irq_inside_int()) { + if(mutex_trylock(frag_mutex) == -1) { + errno = EWOULDBLOCK; + return -1; + } + } + else { + mutex_lock(frag_mutex); + } + /* Find the packet if we already have this one in our data buffer. */ - mutex_lock(frag_mutex); - TAILQ_FOREACH(f, &frags, listhnd) { if(f->src == hdr->src && f->dst == hdr->dest && f->ident == hdr->packet_id && f->proto == hdr->protocol) { @@ -236,6 +294,7 @@ int net_ipv4_frag_init() { if(!frag_mutex) { frag_mutex = mutex_create(); + cbid = net_thd_add_callback(&frag_thd_cb, NULL, 2000); TAILQ_INIT(&frags); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ljs...@us...> - 2009-06-11 19:51:01
|
Revision: 645 http://cadcdev.svn.sourceforge.net/cadcdev/?rev=645&view=rev Author: ljsebald Date: 2009-06-11 19:50:58 +0000 (Thu, 11 Jun 2009) Log Message: ----------- Adding in IP reassembly support and some fixes to ICMP. Modified Paths: -------------- kos/doc/CHANGELOG kos/include/kos/net.h kos/kernel/net/net_core.c kos/kernel/net/net_icmp.c kos/kernel/net/net_ipv4.h kos/kernel/net/net_ipv4_frag.c Modified: kos/doc/CHANGELOG =================================================================== --- kos/doc/CHANGELOG 2009-06-07 23:08:14 UTC (rev 644) +++ kos/doc/CHANGELOG 2009-06-11 19:50:58 UTC (rev 645) @@ -195,6 +195,7 @@ - *** Added a primary network thread that can be used for timer-based, repetitive network tasks (like DHCP renewals), and made the DHCP code utilize it [LS] +- *** Added rudimentary IP reassembly support [LS] KallistiOS version 1.2.0 ----------------------------------------------- - DC Fix to use DCARM7_CFLAGS when compiling ARM driver [Christian Groessler == CG] Modified: kos/include/kos/net.h =================================================================== --- kos/include/kos/net.h 2009-06-07 23:08:14 UTC (rev 644) +++ kos/include/kos/net.h 2009-06-11 19:50:58 UTC (rev 645) @@ -200,6 +200,10 @@ /* Where will we handle possibly notifying the user of ping replies? */ extern net_echo_cb net_icmp_echo_cb; +/* Send an ICMP Echo packet to the specified IP. */ +int net_icmp_send_echo(netif_t *net, const uint8 ipaddr[4], const uint8 *data, + int size); + /***** net_ipv4.c *********************************************************/ /* IPv4 statistics structure. This structure holds some basic statistics about Modified: kos/kernel/net/net_core.c =================================================================== --- kos/kernel/net/net_core.c 2009-06-07 23:08:14 UTC (rev 644) +++ kos/kernel/net/net_core.c 2009-06-11 19:50:58 UTC (rev 645) @@ -14,6 +14,7 @@ #include "net_dhcp.h" #include "net_thd.h" +#include "net_ipv4.h" /* @@ -149,6 +150,9 @@ /* Initialize the ARP cache */ net_arp_init(); + /* Initialize IP fragmentation support */ + net_ipv4_frag_init(); + /* Initialize the UDP system */ net_udp_init(); @@ -178,6 +182,9 @@ /* Shut down the UDP system */ net_udp_shutdown(); + /* Shut down IP fragmentation support */ + net_ipv4_frag_shutdown(); + /* Shut down the ARP cache */ net_arp_shutdown(); Modified: kos/kernel/net/net_icmp.c =================================================================== --- kos/kernel/net/net_icmp.c 2009-06-07 23:08:14 UTC (rev 644) +++ kos/kernel/net/net_icmp.c 2009-06-11 19:50:58 UTC (rev 645) @@ -3,7 +3,7 @@ kernel/net/net_icmp.c Copyright (C) 2002 Dan Potter - Copyright (C) 2005, 2006, 2007 Lawrence Sebald + Copyright (C) 2005, 2006, 2007, 2009 Lawrence Sebald */ @@ -37,25 +37,24 @@ */ struct __ping_pkt { - LIST_ENTRY(__ping_pkt) pkt_list; - uint8 ip[4]; - uint8 *data; - int data_sz; - uint16 icmp_seq; - uint64 usec; + LIST_ENTRY(__ping_pkt) pkt_list; + uint8 ip[4]; + uint8 *data; + int data_sz; + uint16 icmp_seq; + uint64 usec; }; LIST_HEAD(__ping_pkt_list, __ping_pkt); static struct __ping_pkt_list pings = LIST_HEAD_INITIALIZER(0); -static uint8 pktbuf[1514]; static uint16 icmp_echo_seq = 1; static void icmp_default_echo_cb(const uint8 *ip, uint16 seq, uint64 delta_us, uint8 ttl, const uint8* data, int data_sz) { - printf("%d bytes from %d.%d.%d.%d: icmp_seq=%d ttl=%d time=%.2f ms\n", - data_sz, ip[0], ip[1], ip[2], ip[3], seq, ttl, - delta_us / 1000.0f); + printf("%d bytes from %d.%d.%d.%d: icmp_seq=%d ttl=%d time=%.3f ms\n", + data_sz, ip[0], ip[1], ip[2], ip[3], seq, ttl, + delta_us / 1000.0f); } /* The default echo (ping) callback */ @@ -64,157 +63,126 @@ /* Handle Echo Reply (ICMP type 0) packets */ static void net_icmp_input_0(netif_t *src, ip_hdr_t *ip, icmp_hdr_t *icmp, const uint8 *d, int s) { - uint64 tmr; - struct __ping_pkt *ping; - uint16 seq; + uint64 tmr; + struct __ping_pkt *ping; + uint16 seq; - tmr = timer_us_gettime64(); + tmr = timer_us_gettime64(); + seq = (d[7] | (d[6] << 8)); - LIST_FOREACH(ping, &pings, pkt_list) { - seq = (d[7] | (d[6] << 8)); - if(ping->icmp_seq == seq) { - net_icmp_echo_cb((uint8 *)&ip->src, seq, - tmr - ping->usec, ip->ttl, d, s); + LIST_FOREACH(ping, &pings, pkt_list) { + if(ping->icmp_seq == seq) { + net_icmp_echo_cb((uint8 *)&ip->src, seq, + tmr - ping->usec, ip->ttl, d, s); - LIST_REMOVE(ping, pkt_list); - free(ping->data); - free(ping); + LIST_REMOVE(ping, pkt_list); + free(ping->data); + free(ping); - return; - } - } + return; + } + } } /* Handle Echo (ICMP type 8) packets */ static void net_icmp_input_8(netif_t *src, ip_hdr_t *ip, icmp_hdr_t *icmp, const uint8 *d, int s) { - /* Set type to echo reply */ - icmp->type = 0; + /* Set type to echo reply */ + icmp->type = 0; - /* Set the destination to the original source, and substitute in our IP - for the src (done this way so that pings that are broadcasted get an - appropriate reply). */ - ip->dest = ip->src; - ip->src = htonl(net_ipv4_address(src->ip_addr)); + /* Recompute the ICMP header checksum */ + icmp->checksum = 0; + icmp->checksum = net_ipv4_checksum((uint8 *)icmp, ntohs(ip->length) - + 4 * (ip->version_ihl & 0x0f)); - /* Recompute the IP header checksum */ - ip->checksum = 0; - ip->checksum = net_ipv4_checksum((uint8 *)ip, - 4 * (ip->version_ihl & 0x0f)); - - /* Recompute the ICMP header checksum */ - icmp->checksum = 0; - icmp->checksum = net_ipv4_checksum((uint8 *)icmp, ntohs(ip->length) - - 4 * (ip->version_ihl & 0x0f)); - - /* Send it */ - memcpy(pktbuf, ip, 20); - memcpy(pktbuf + 20, d, ntohs(ip->length) - 4 * (ip->version_ihl & 0x0F)); - net_ipv4_send_packet(src, ip, pktbuf + 20, ntohs(ip->length) - - 4 * (ip->version_ihl & 0x0F)); + /* Set the destination to the original source, and substitute in our IP + for the src (done this way so that pings that are broadcasted get an + appropriate reply), and send it away. */ + net_ipv4_send(src, d, s, ip->packet_id, ip->ttl, 1, ip->dest, ip->src); } int net_icmp_input(netif_t *src, ip_hdr_t *ip, const uint8 *d, int s) { - icmp_hdr_t *icmp; - int i; + icmp_hdr_t *icmp; + int i; - /* Find ICMP header */ - icmp = (icmp_hdr_t*) d; + /* Find ICMP header */ + icmp = (icmp_hdr_t*)d; - /* Check icmp checksum */ - memset(pktbuf, 0, 1514); - i = icmp->checksum; - icmp->checksum = 0; - memcpy(pktbuf, icmp, ntohs(ip->length) - 4 * (ip->version_ihl & 0x0f)); - icmp->checksum = net_ipv4_checksum(pktbuf, (ntohs(ip->length) + 1) - - 4 * (ip->version_ihl & 0x0f)); + /* Check the ICMP checksum */ + i = net_ipv4_checksum(d, s); - if (i != icmp->checksum) { - dbglog(DBG_KDEBUG, "net_icmp: icmp with invalid checksum\n"); - return -1; - } + if (i) { + dbglog(DBG_KDEBUG, "net_icmp: icmp with invalid checksum\n"); + return -1; + } - switch(icmp->type) { - case 0: /* Echo reply */ - net_icmp_input_0(src, ip, icmp, d, s); - break; - case 3: /* Destination unreachable */ - dbglog(DBG_KDEBUG, "net_icmp: Destination unreachable," - " code %d\n", icmp->code); - break; + switch(icmp->type) { + case 0: /* Echo reply */ + net_icmp_input_0(src, ip, icmp, d, s); + break; - case 8: /* Echo */ - net_icmp_input_8(src, ip, icmp, d, s); - break; + case 3: /* Destination unreachable */ + dbglog(DBG_KDEBUG, "net_icmp: Destination unreachable," + " code %d\n", icmp->code); + break; - default: - dbglog(DBG_KDEBUG, "net_icmp: unknown icmp type: %d\n", - icmp->type); - } + case 8: /* Echo */ + net_icmp_input_8(src, ip, icmp, d, s); + break; - return 0; + default: + dbglog(DBG_KDEBUG, "net_icmp: unknown icmp type: %d\n", + icmp->type); + } + + return 0; } /* Send an ICMP Echo (PING) packet to the specified device */ int net_icmp_send_echo(netif_t *net, const uint8 ipaddr[4], const uint8 *data, int size) { - icmp_hdr_t *icmp; - ip_hdr_t ip; - struct __ping_pkt *newping; - int r = -1; - uint8 databuf[sizeof(icmp_hdr_t) + size]; + icmp_hdr_t *icmp; + struct __ping_pkt *newping; + int r = -1; + uint8 databuf[sizeof(icmp_hdr_t) + size]; + uint16 seq = icmp_echo_seq++; + uint32 src; - icmp = (icmp_hdr_t *)databuf; + icmp = (icmp_hdr_t *)databuf; - /* Fill in the ICMP Header */ - icmp->type = 8; /* Echo */ - icmp->code = 0; - icmp->checksum = 0; - icmp->misc[0] = (uint8) 'D'; - icmp->misc[1] = (uint8) 'C'; - icmp->misc[2] = (uint8) (icmp_echo_seq >> 8); - icmp->misc[3] = (uint8) (icmp_echo_seq & 0xFF); - memcpy(databuf + sizeof(icmp_hdr_t), data, size); + /* Fill in the ICMP Header */ + icmp->type = 8; /* Echo */ + icmp->code = 0; + icmp->checksum = 0; + icmp->misc[0] = (uint8) 'D'; + icmp->misc[1] = (uint8) 'C'; + icmp->misc[2] = (uint8) (seq >> 8); + icmp->misc[3] = (uint8) (seq & 0xFF); + memcpy(databuf + sizeof(icmp_hdr_t), data, size); - /* Fill in the IP Header */ - ip.version_ihl = 0x45; /* 20 byte header, ipv4 */ - ip.tos = 0; - ip.length = htons(sizeof(icmp_hdr_t) + size + 20); - ip.packet_id = 0; - ip.flags_frag_offs = 0x0040; - ip.ttl = 64; - ip.protocol = 1; /* ICMP */ - ip.checksum = 0; + /* Compute the ICMP Checksum */ + icmp->checksum = net_ipv4_checksum(databuf, sizeof(icmp_hdr_t) + size); - if(net_ipv4_address(ipaddr) == 0x7F000001) - ip.src = htonl(net_ipv4_address(ipaddr)); - else - ip.src = htonl(net_ipv4_address(net->ip_addr)); + /* If we're sending to the loopback, set that as our source too. */ + if(ipaddr[0] == 127) { + src = net_ipv4_address(ipaddr); + } + else { + src = net_ipv4_address(net->ip_addr); + } - ip.dest = htonl(net_ipv4_address(ipaddr)); + newping = (struct __ping_pkt*) malloc(sizeof(struct __ping_pkt)); + newping->data = (uint8 *)malloc(size); + newping->data_sz = size; + newping->icmp_seq = seq; + memcpy(newping->data, data, size); + memcpy(newping->ip, ipaddr, 4); + LIST_INSERT_HEAD(&pings, newping, pkt_list); - /* Compute the ICMP Checksum */ - icmp->checksum = net_ipv4_checksum(databuf, sizeof(icmp_hdr_t) + size); + newping->usec = timer_us_gettime64(); + r = net_ipv4_send(net, databuf, sizeof(icmp_hdr_t) + size, seq, 64, 1, + htonl(src), + htonl(net_ipv4_address(ipaddr))); - /* Compute the IP Checksum */ - ip.checksum = net_ipv4_checksum((uint8 *)&ip, sizeof(ip_hdr_t)); - - newping = (struct __ping_pkt*) malloc(sizeof(struct __ping_pkt)); - newping->data = (uint8 *)malloc(size); - newping->data_sz = size; - newping->icmp_seq = icmp_echo_seq; - memcpy(newping->data, data, size); - memcpy(newping->ip, ipaddr, 4); - LIST_INSERT_HEAD(&pings, newping, pkt_list); - - ++icmp_echo_seq; - - while(r == -1) { - newping->usec = timer_us_gettime64(); - r = net_ipv4_send_packet(net, &ip, databuf, - sizeof(icmp_hdr_t) + size); - thd_sleep(10); - } - - return 0; + return r; } Modified: kos/kernel/net/net_ipv4.h =================================================================== --- kos/kernel/net/net_ipv4.h 2009-06-07 23:08:14 UTC (rev 644) +++ kos/kernel/net/net_ipv4.h 2009-06-11 19:50:58 UTC (rev 645) @@ -56,4 +56,7 @@ int size); int net_ipv4_reassemble(netif_t *net, ip_hdr_t *hdr, const uint8 *data, int size); +int net_ipv4_frag_init(); +void net_ipv4_frag_shutdown(); + #endif /* __LOCAL_NET_IPV4_H */ Modified: kos/kernel/net/net_ipv4_frag.c =================================================================== --- kos/kernel/net/net_ipv4_frag.c 2009-06-07 23:08:14 UTC (rev 644) +++ kos/kernel/net/net_ipv4_frag.c 2009-06-11 19:50:58 UTC (rev 645) @@ -6,13 +6,138 @@ */ #include <string.h> +#include <stdlib.h> #include <errno.h> #include <arpa/inet.h> #include <kos/net.h> +#include <kos/mutex.h> +#include <arch/timer.h> #include "net_ipv4.h" +#include "net_thd.h" +#define MAX(a, b) a > b ? a : b; + +struct ip_frag { + TAILQ_ENTRY(ip_frag) listhnd; + + uint32 src; + uint32 dst; + uint16 ident; + uint8 proto; + + ip_hdr_t hdr; + uint8 *data; + uint8 bitfield[8192]; + int cur_length; + int total_length; + uint64 death_time; +}; + +TAILQ_HEAD(ip_frag_list, ip_frag); + +static struct ip_frag_list frags; +static mutex_t *frag_mutex = NULL; +static int cbid = -1; + +/* Set the bits in the bitfield for the given set of fragment blocks. + XXXX: This is horribly inefficient. */ +static inline void set_bits(uint8 *bitfield, int start, int end) { + --end; + while(end >= start) { + bitfield[end >> 3] |= (1 << (end & 0x07)); + --end; + } +} + +/* Check if all bits in the bitfield that should be set are set. */ +static inline int all_bits_set(const uint8 *bitfield, int end) { + int i; + + /* Make sure each of the beginning bytes are fully set. */ + for(i = 0; i < (end >> 3); ++i) { + if(bitfield[i] != 0xFF) { + return 0; + } + } + + /* Check the last byte to make sure it has the right number of bits set. */ + if(bitfield[(end >> 3)] != ((1 << (end & 0x07)) - 1)) { + return 0; + } + + return 1; +} + +/* Import the data for a fragment, potentially passing it onward in processing, + if the whole datagram has arrived. */ +static int frag_import(netif_t *src, ip_hdr_t *hdr, const uint8 *data, + int size, uint16 flags, struct ip_frag *frag) { + void *tmp; + int fo = flags & 0x1FFF; + int tl = ntohs(hdr->length); + int start = (fo << 3); + int ihl = (hdr->version_ihl & 0x0F) << 2; + int end = start + tl - ihl; + int rv = 0; + uint64 now = timer_ms_gettime64(); + + /* Reallocate space for the data buffer, if needed. */ + if(end > frag->cur_length) { + tmp = realloc(frag->data, end); + + if(!tmp) { + errno = ENOMEM; + rv = -1; + goto out; + } + + frag->data = tmp; + } + + memcpy(frag->data + start, data, end - start); + set_bits(frag->bitfield, fo, fo + (((tl - ihl) + 7) >> 3)); + + /* If the MF flag is not set, set the data length. */ + if(!(flags & 0x2000)) { + frag->total_length = end; + } + + /* If the fragment offset is zero, store the header. */ + if(!fo) { + frag->hdr = *hdr; + } + + /* If the total length is not zero, and all the bits in the bitfield are + set, we continue on. */ + if(frag->total_length && + all_bits_set(frag->bitfield, frag->total_length >> 3)) { + /* Set the right length. Don't worry about updating the checksum, since + net_ipv4_input_proto doesn't check it anyway. */ + frag->hdr.length = htons(frag->total_length + + ((frag->hdr.version_ihl & 0x0F) << 2)); + + rv = net_ipv4_input_proto(src, &frag->hdr, frag->data); + + /* Remove the fragment from our buffer. */ + TAILQ_REMOVE(&frags, frag, listhnd); + free(frag->data); + free(frag); + + goto out; + } + + /* Update the timer. */ + frag->death_time = MAX(frag->death_time, (now + hdr->ttl * 1000)); + +out: + mutex_unlock(frag_mutex); + return rv; +} + +/* IPv4 fragmentation procedure. This is basically a direct implementation of + the example IP fragmentation procedure on pages 26-27 of RFC 791. */ int net_ipv4_frag_send(netif_t *net, ip_hdr_t *hdr, const uint8 *data, int size) { int ihl = (hdr->version_ihl & 0x0f) << 2; @@ -39,7 +164,7 @@ nfb = ((net->mtu - ihl) >> 3); ds = nfb << 3; newhdr.flags_frag_offs = htons(flags | 0x2000); - newhdr.length = htons(ihl + (nfb << 3)); + newhdr.length = htons(ihl + ds); /* Recompute the checksum. */ newhdr.checksum = 0; @@ -52,7 +177,7 @@ /* We don't deal with options right now, so dealing with the rest of the fragments is pretty easy. Fix the header, and recursively call this function to finish things off. */ - hdr->length = htons(ihl + size); + hdr->length = htons(ihl + size - ds); hdr->flags_frag_offs = htons((flags & 0xE000) | ((flags & 0x1FFF) + nfb)); hdr->checksum = 0; hdr->checksum = net_ipv4_checksum((uint8 *)hdr, sizeof(ip_hdr_t)); @@ -60,9 +185,13 @@ return net_ipv4_frag_send(net, hdr, data + ds, size - ds); } +/* IPv4 fragment reassembly procedure. This (along with the frag_import function + above are basically a direct implementation of the example IP reassembly + routine on pages 27-29 of RFC 791. */ int net_ipv4_reassemble(netif_t *src, ip_hdr_t *hdr, const uint8 *data, int size) { uint16 flags = ntohs(hdr->flags_frag_offs); + struct ip_frag *f; /* If the fragment offset is zero and the MF flag is 0, this is the whole packet. Treat it as such. */ @@ -70,5 +199,72 @@ return net_ipv4_input_proto(src, hdr, data); } - return -1; + /* Find the packet if we already have this one in our data buffer. */ + mutex_lock(frag_mutex); + + TAILQ_FOREACH(f, &frags, listhnd) { + if(f->src == hdr->src && f->dst == hdr->dest && + f->ident == hdr->packet_id && f->proto == hdr->protocol) { + /* We've got it, import the data (this function handles unlocking + the mutex when its done). */ + return frag_import(src, hdr, data, size, flags, f); + } + } + + /* We don't have a fragment with that identifier, so make one. */ + f = (struct ip_frag *)malloc(sizeof(struct ip_frag)); + + if(!f) { + errno = ENOMEM; + return -1; + } + + f->src = hdr->src; + f->dst = hdr->dest; + f->ident = hdr->packet_id; + f->proto = hdr->protocol; + f->data = NULL; + f->cur_length = 0; + f->total_length = 0; + memset(f->bitfield, 0, sizeof(f->bitfield)); + + TAILQ_INSERT_TAIL(&frags, f, listhnd); + + return frag_import(src, hdr, data, size, flags, f); } + +int net_ipv4_frag_init() { + if(!frag_mutex) { + frag_mutex = mutex_create(); + TAILQ_INIT(&frags); + } + + return frag_mutex != NULL; +} + +void net_ipv4_frag_shutdown() { + struct ip_frag *c, *n; + + if(frag_mutex) { + mutex_lock(frag_mutex); + + c = TAILQ_FIRST(&frags); + while(c) { + n = TAILQ_NEXT(c, listhnd); + free(c->data); + free(c->bitfield); + c = n; + } + + if(cbid != -1) { + net_thd_del_callback(cbid); + } + + mutex_unlock(frag_mutex); + mutex_destroy(frag_mutex); + } + + cbid = -1; + frag_mutex = NULL; + TAILQ_INIT(&frags); +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ljs...@us...> - 2009-06-07 23:08:22
|
Revision: 644 http://cadcdev.svn.sourceforge.net/cadcdev/?rev=644&view=rev Author: ljsebald Date: 2009-06-07 23:08:14 +0000 (Sun, 07 Jun 2009) Log Message: ----------- Adding in new network thread code. Various bits and pieces of the network stack are likely to need to use threads for some part of their operation now, so devote one thread to that purpose. Also, add the beginnings of IP reassembly (just reject fragments for now). Modified Paths: -------------- kos/doc/CHANGELOG kos/kernel/net/Makefile kos/kernel/net/net_core.c kos/kernel/net/net_dhcp.c kos/kernel/net/net_ipv4.c kos/kernel/net/net_ipv4.h kos/kernel/net/net_ipv4_frag.c Added Paths: ----------- kos/kernel/net/net_thd.c kos/kernel/net/net_thd.h Modified: kos/doc/CHANGELOG =================================================================== --- kos/doc/CHANGELOG 2009-06-06 22:05:36 UTC (rev 643) +++ kos/doc/CHANGELOG 2009-06-07 23:08:14 UTC (rev 644) @@ -186,12 +186,15 @@ - DC Added in some support functions for PVR modifier volumes (and an example program that uses them) [LS] - DC Added a modifier volume example using textures [LS] -- DC Added a simple statistics system to the IPv4 and UDP layers of the +- *** Added a simple statistics system to the IPv4 and UDP layers of the network stack [LS] -- DC Added a MTU value to the netif structure for maintaining the maximum +- *** Added a MTU value to the netif structure for maintaining the maximum transfer size of the adapter [LS] -- DC Added the ability to fragment IP packets, and made fragmenting respect +- *** Added the ability to fragment IP packets, and made fragmenting respect the MTU [LS] +- *** Added a primary network thread that can be used for timer-based, + repetitive network tasks (like DHCP renewals), and made the DHCP code + utilize it [LS] KallistiOS version 1.2.0 ----------------------------------------------- - DC Fix to use DCARM7_CFLAGS when compiling ARM driver [Christian Groessler == CG] Modified: kos/kernel/net/Makefile =================================================================== --- kos/kernel/net/Makefile 2009-06-06 22:05:36 UTC (rev 643) +++ kos/kernel/net/Makefile 2009-06-07 23:08:14 UTC (rev 644) @@ -5,7 +5,7 @@ # OBJS = net_core.o net_arp.o net_input.o net_icmp.o net_ipv4.o net_udp.o -OBJS += net_dhcp.o net_ipv4_frag.o +OBJS += net_dhcp.o net_ipv4_frag.o net_thd.o SUBDIRS = include $(KOS_BASE)/Makefile.prefab Modified: kos/kernel/net/net_core.c =================================================================== --- kos/kernel/net/net_core.c 2009-06-06 22:05:36 UTC (rev 643) +++ kos/kernel/net/net_core.c 2009-06-07 23:08:14 UTC (rev 644) @@ -13,6 +13,7 @@ #include <kos/fs_socket.h> #include "net_dhcp.h" +#include "net_thd.h" /* @@ -141,7 +142,10 @@ /* Detect and potentially initialize devices */ if (net_dev_init() < 0) return -1; - + + /* Initialize the network thread. */ + net_thd_init(); + /* Initialize the ARP cache */ net_arp_init(); @@ -177,6 +181,9 @@ /* Shut down the ARP cache */ net_arp_shutdown(); + /* Shut down the network thread */ + net_thd_shutdown(); + /* Shut down all activated network devices */ LIST_FOREACH(cur, &net_if_list, if_list) { if (cur->flags & NETIF_RUNNING && cur->if_stop) Modified: kos/kernel/net/net_dhcp.c =================================================================== --- kos/kernel/net/net_dhcp.c 2009-06-06 22:05:36 UTC (rev 643) +++ kos/kernel/net/net_dhcp.c 2009-06-07 23:08:14 UTC (rev 644) @@ -17,7 +17,6 @@ #include <time.h> #include <kos/net.h> -#include <kos/thread.h> #include <kos/genwait.h> #include <kos/recursive_lock.h> #include <kos/fs_socket.h> @@ -25,6 +24,7 @@ #include <arch/timer.h> #include "net_dhcp.h" +#include "net_thd.h" #define DHCP_SERVER_PORT 67 #define DHCP_CLIENT_PORT 68 @@ -45,7 +45,7 @@ static struct dhcp_pkt_queue dhcp_pkts = STAILQ_HEAD_INITIALIZER(dhcp_pkts); static recursive_lock_t *dhcp_lock = NULL; -static kthread_t *dhcp_thd = NULL; +static int dhcp_cbid = -1; static uint64 renew_time = 0xFFFFFFFFFFFFFFFFULL; static uint64 rebind_time = 0xFFFFFFFFFFFFFFFFULL; static uint64 lease_expires = 0xFFFFFFFFFFFFFFFFULL; @@ -265,7 +265,7 @@ /* We need to wait til we're either bound to an IP address, or until we give up all hope of doing so (give us 60 seconds). */ - if(thd_current != dhcp_thd) { + if(!net_thd_is_current()) { rv = genwait_wait(&dhcp_sock, "net_dhcp_request", 60 * 1000, NULL); } @@ -481,137 +481,132 @@ dhcp_pkt_t *pkt = (dhcp_pkt_t *)buf, *pkt2; int found; - for(;;) { - now = timer_ms_gettime64(); - len = 0; + now = timer_ms_gettime64(); + len = 0; - rlock_lock(dhcp_lock); + rlock_lock(dhcp_lock); - /* Make sure we don't need to renew our lease */ - if(lease_expires <= now && (state == DHCP_STATE_BOUND || - state == DHCP_STATE_RENEWING || state == DHCP_STATE_REBINDING)) { - STAILQ_FOREACH(qpkt, &dhcp_pkts, pkt_queue) { - STAILQ_REMOVE(&dhcp_pkts, qpkt, dhcp_pkt_out, pkt_queue); - free(qpkt->buf); - free(qpkt); - } + /* Make sure we don't need to renew our lease */ + if(lease_expires <= now && (state == DHCP_STATE_BOUND || + state == DHCP_STATE_RENEWING || state == DHCP_STATE_REBINDING)) { + STAILQ_FOREACH(qpkt, &dhcp_pkts, pkt_queue) { + STAILQ_REMOVE(&dhcp_pkts, qpkt, dhcp_pkt_out, pkt_queue); + free(qpkt->buf); + free(qpkt); + } - state = DHCP_STATE_INIT; - srv_addr.sin_addr.s_addr = INADDR_BROADCAST; - memset(net_default_dev->ip_addr, 0, 4); - net_dhcp_request(); + state = DHCP_STATE_INIT; + srv_addr.sin_addr.s_addr = INADDR_BROADCAST; + memset(net_default_dev->ip_addr, 0, 4); + net_dhcp_request(); + } + else if(rebind_time <= now && + (state == DHCP_STATE_BOUND || state == DHCP_STATE_RENEWING)) { + /* Clear out any existing packets. */ + STAILQ_FOREACH(qpkt, &dhcp_pkts, pkt_queue) { + STAILQ_REMOVE(&dhcp_pkts, qpkt, dhcp_pkt_out, pkt_queue); + free(qpkt->buf); + free(qpkt); } - else if(rebind_time <= now && - (state == DHCP_STATE_BOUND || state == DHCP_STATE_RENEWING)) { - /* Clear out any existing packets. */ - STAILQ_FOREACH(qpkt, &dhcp_pkts, pkt_queue) { - STAILQ_REMOVE(&dhcp_pkts, qpkt, dhcp_pkt_out, pkt_queue); - free(qpkt->buf); - free(qpkt); - } - state = DHCP_STATE_REBINDING; - srv_addr.sin_addr.s_addr = INADDR_BROADCAST; - net_dhcp_renew(); + state = DHCP_STATE_REBINDING; + srv_addr.sin_addr.s_addr = INADDR_BROADCAST; + net_dhcp_renew(); + } + else if(renew_time <= now && state == DHCP_STATE_BOUND) { + state = DHCP_STATE_RENEWING; + net_dhcp_renew(); + } + + /* Check if we have any packets waiting to come in. */ + while((len = recvfrom(dhcp_sock, buf, 1024, 0, + (struct sockaddr *)&addr, &addr_len)) != -1) { + /* Ignore any boot request packets -- they shouldn't be sent to + the port we're monitoring anyway. */ + if(pkt->op != DHCP_OP_BOOTREPLY) { + continue; } - else if(renew_time <= now && state == DHCP_STATE_BOUND) { - state = DHCP_STATE_RENEWING; - net_dhcp_renew(); + + /* Check the magic cookie to make sure we've actually got a DHCP + packet coming in. */ + if(pkt->options[0] != 0x63 || pkt->options[1] != 0x82 || + pkt->options[2] != 0x53 || pkt->options[3] != 0x63) { + continue; } - /* Check if we have any packets waiting to come in. */ - while((len = recvfrom(dhcp_sock, buf, 1024, 0, - (struct sockaddr *)&addr, &addr_len)) != -1) { - /* Ignore any boot request packets -- they shouldn't be sent to - the port we're monitoring anyway. */ - if(pkt->op != DHCP_OP_BOOTREPLY) { - continue; - } + found = 0; - /* Check the magic cookie to make sure we've actually got a DHCP - packet coming in. */ - if(pkt->options[0] != 0x63 || pkt->options[1] != 0x82 || - pkt->options[2] != 0x53 || pkt->options[3] != 0x63) { - continue; + /* Check the xid field of the new packet versus what we're still + waiting on responses for. */ + STAILQ_FOREACH(qpkt, &dhcp_pkts, pkt_queue) { + pkt2 = (dhcp_pkt_t *)qpkt->buf; + + if(pkt2->xid == pkt->xid) { + found = 1; + break; } + } - found = 0; + /* If we've found a pending request, act on the message received. */ + if(found) { + switch(net_dhcp_get_message_type(pkt2, qpkt->size)) { + case DHCP_MSG_DHCPDISCOVER: + if(net_dhcp_get_message_type(pkt, len) != + DHCP_MSG_DHCPOFFER) { + break; + } - /* Check the xid field of the new packet versus what we're still - waiting on responses for. */ - STAILQ_FOREACH(qpkt, &dhcp_pkts, pkt_queue) { - pkt2 = (dhcp_pkt_t *)qpkt->buf; + /* Send our DHCPREQUEST packet */ + net_dhcp_send_request(pkt, len, pkt2, qpkt->size); - if(pkt2->xid == pkt->xid) { - found = 1; + /* Remove the old packet from our queue */ + STAILQ_REMOVE(&dhcp_pkts, qpkt, dhcp_pkt_out, + pkt_queue); + free(qpkt->buf); + free(qpkt); break; - } - } - /* If we've found a pending request, act on the message received. */ - if(found) { - switch(net_dhcp_get_message_type(pkt2, qpkt->size)) { - case DHCP_MSG_DHCPDISCOVER: - if(net_dhcp_get_message_type(pkt, len) != - DHCP_MSG_DHCPOFFER) { - break; - } + case DHCP_MSG_DHCPREQUEST: + found = net_dhcp_get_message_type(pkt, len); - /* Send our DHCPREQUEST packet */ - net_dhcp_send_request(pkt, len, pkt2, qpkt->size); + if(found == DHCP_MSG_DHCPACK) { + srv_addr.sin_addr.s_addr = addr.sin_addr.s_addr; - /* Remove the old packet from our queue */ - STAILQ_REMOVE(&dhcp_pkts, qpkt, dhcp_pkt_out, - pkt_queue); - free(qpkt->buf); - free(qpkt); - break; + /* Bind to the specified IP address */ + net_dhcp_bind(pkt, len); + genwait_wake_all(&dhcp_sock); + } + else if(found == DHCP_MSG_DHCPNAK) { + /* We got a NAK, try to discover again. */ + state = DHCP_STATE_INIT; + net_dhcp_request(); + } - case DHCP_MSG_DHCPREQUEST: - found = net_dhcp_get_message_type(pkt, len); + /* Remove the old packet from our queue */ + STAILQ_REMOVE(&dhcp_pkts, qpkt, dhcp_pkt_out, + pkt_queue); + free(qpkt->buf); + free(qpkt); + break; - if(found == DHCP_MSG_DHCPACK) { - srv_addr.sin_addr.s_addr = addr.sin_addr.s_addr; - - /* Bind to the specified IP address */ - net_dhcp_bind(pkt, len); - genwait_wake_all(&dhcp_sock); - } - else if(found == DHCP_MSG_DHCPNAK) { - /* We got a NAK, try to discover again. */ - state = DHCP_STATE_INIT; - net_dhcp_request(); - } - - /* Remove the old packet from our queue */ - STAILQ_REMOVE(&dhcp_pkts, qpkt, dhcp_pkt_out, - pkt_queue); - free(qpkt->buf); - free(qpkt); - break; - - /* Currently, these are the only two DHCP packets the code - here sends out, so other packet types are omitted for - the time being. */ - } + /* Currently, these are the only two DHCP packets the code + here sends out, so other packet types are omitted for + the time being. */ } } - - /* Send any packets that need to be sent. */ - STAILQ_FOREACH(qpkt, &dhcp_pkts, pkt_queue) { - if(qpkt->next_send <= now) { - sendto(dhcp_sock, qpkt->buf, qpkt->size, 0, - (struct sockaddr *)&srv_addr, sizeof(srv_addr)); - qpkt->next_send = now + qpkt->next_delay; - qpkt->next_delay <<= 1; - } + } + + /* Send any packets that need to be sent. */ + STAILQ_FOREACH(qpkt, &dhcp_pkts, pkt_queue) { + if(qpkt->next_send <= now) { + sendto(dhcp_sock, qpkt->buf, qpkt->size, 0, + (struct sockaddr *)&srv_addr, sizeof(srv_addr)); + qpkt->next_send = now + qpkt->next_delay; + qpkt->next_delay <<= 1; } - - rlock_unlock(dhcp_lock); - - /* Sleep for a while. */ - thd_sleep(25); } + + rlock_unlock(dhcp_lock); } int net_dhcp_init() { @@ -650,8 +645,8 @@ /* Make the socket non-blocking */ fs_socket_setflags(dhcp_sock, O_NONBLOCK); - /* Create the thread for processing DHCP packets */ - dhcp_thd = thd_create(&net_dhcp_thd, NULL); + /* Create the callback for processing DHCP packets */ + dhcp_cbid = net_thd_add_callback(&net_dhcp_thd, NULL, 50); return 0; } @@ -669,4 +664,8 @@ if(dhcp_sock != -1) { close(dhcp_sock); } + + if(dhcp_cbid != -1) { + net_thd_del_callback(dhcp_cbid); + } } Modified: kos/kernel/net/net_ipv4.c =================================================================== --- kos/kernel/net/net_ipv4.c 2009-06-06 22:05:36 UTC (rev 643) +++ kos/kernel/net/net_ipv4.c 2009-06-07 23:08:14 UTC (rev 644) @@ -185,8 +185,8 @@ } int net_ipv4_input(netif_t *src, const uint8 *pkt, int pktsize) { - ip_hdr_t *ip; - int i; + ip_hdr_t *ip; + int i; uint8 *data; int hdrlen; @@ -205,8 +205,6 @@ return -1; } - data = (uint8 *) (pkt + hdrlen); - /* Check ip header checksum */ i = ip->checksum; ip->checksum = 0; @@ -218,6 +216,16 @@ return -1; } + data = (uint8 *)(pkt + hdrlen); + + /* Submit the packet for possible reassembly. */ + return net_ipv4_reassemble(src, ip, data, ntohs(ip->length) - hdrlen); +} + +int net_ipv4_input_proto(netif_t *src, ip_hdr_t *ip, const uint8 *data) { + int hdrlen = (ip->version_ihl & 0x0F) << 2; + + /* Send the packet along to the appropriate protocol. */ switch(ip->protocol) { case IPPROTO_ICMP: ++ipv4_stats.pkt_recv; Modified: kos/kernel/net/net_ipv4.h =================================================================== --- kos/kernel/net/net_ipv4.h 2009-06-06 22:05:36 UTC (rev 643) +++ kos/kernel/net/net_ipv4.h 2009-06-07 23:08:14 UTC (rev 644) @@ -49,9 +49,11 @@ int net_ipv4_send(netif_t *net, const uint8 *data, int size, int id, int ttl, int proto, uint32 src, uint32 dst); int net_ipv4_input(netif_t *src, const uint8 *pkt, int pktsize); +int net_ipv4_input_proto(netif_t *net, ip_hdr_t *ip, const uint8 *data); /* In net_ipv4_frag.c */ int net_ipv4_frag_send(netif_t *net, ip_hdr_t *hdr, const uint8 *data, int size); - +int net_ipv4_reassemble(netif_t *net, ip_hdr_t *hdr, const uint8 *data, + int size); #endif /* __LOCAL_NET_IPV4_H */ Modified: kos/kernel/net/net_ipv4_frag.c =================================================================== --- kos/kernel/net/net_ipv4_frag.c 2009-06-06 22:05:36 UTC (rev 643) +++ kos/kernel/net/net_ipv4_frag.c 2009-06-07 23:08:14 UTC (rev 644) @@ -59,3 +59,16 @@ return net_ipv4_frag_send(net, hdr, data + ds, size - ds); } + +int net_ipv4_reassemble(netif_t *src, ip_hdr_t *hdr, const uint8 *data, + int size) { + uint16 flags = ntohs(hdr->flags_frag_offs); + + /* If the fragment offset is zero and the MF flag is 0, this is the whole + packet. Treat it as such. */ + if(!(flags & 0x2000) && (flags & 0x1FFF) == 0) { + return net_ipv4_input_proto(src, hdr, data); + } + + return -1; +} Added: kos/kernel/net/net_thd.c =================================================================== --- kos/kernel/net/net_thd.c (rev 0) +++ kos/kernel/net/net_thd.c 2009-06-07 23:08:14 UTC (rev 644) @@ -0,0 +1,131 @@ +/* KallistiOS ##version## + + kernel/net/net_thd.c + Copyright (C) 2009 Lawrence Sebald + +*/ + +#include <sys/queue.h> +#include <errno.h> +#include <stdlib.h> + +#include <kos/thread.h> +#include <arch/timer.h> +#include "net_thd.h" + +struct thd_cb { + TAILQ_ENTRY(thd_cb) thds; + + int cbid; + void (*cb)(void *); + void *data; + uint64 timeout; + uint64 nextrun; +}; + +TAILQ_HEAD(thd_cb_queue, thd_cb); + +static struct thd_cb_queue cbs; +static kthread_t *thd; +static int done = 0; +static int cbid_top; + +static void net_thd_thd(void *data __attribute__((unused))) { + struct thd_cb *cb; + uint64 now; + + while(!done) { + now = timer_ms_gettime64(); + + /* Run any callbacks that need to be run now. */ + TAILQ_FOREACH(cb, &cbs, thds) { + if(now >= cb->nextrun) { + cb->cb(cb->data); + cb->nextrun = now + cb->timeout; + } + } + + /* Go to sleep til we need to be run again. */ + thd_sleep(50); + } +} + +int net_thd_add_callback(void (*cb)(void *), void *data, uint64 timeout) { + int old; + struct thd_cb *newcb; + + /* Allocate space for the new callback and set it up. */ + newcb = (struct thd_cb *)malloc(sizeof(struct thd_cb)); + if(!newcb) { + errno = ENOMEM; + return -1; + } + + newcb->cbid = cbid_top++; + newcb->cb = cb; + newcb->data = data; + newcb->timeout = timeout; + newcb->nextrun = timer_ms_gettime64() + timeout; + + /* Disable interrupts, insert, and reenable interrupts */ + old = irq_disable(); + TAILQ_INSERT_TAIL(&cbs, newcb, thds); + irq_restore(old); + + return newcb->cbid; +} + +int net_thd_del_callback(int cbid) { + int old; + struct thd_cb *cb; + + /* Disable interrupts so we can search without fear of anything changing + underneath us. */ + old = irq_disable(); + + /* See if we can find the callback requested. */ + TAILQ_FOREACH(cb, &cbs, thds) { + if(cb->cbid == cbid) { + TAILQ_REMOVE(&cbs, cb, thds); + free(cb); + irq_restore(old); + return 0; + } + } + + /* We didn't find it, punt. */ + irq_restore(old); + return -1; +} + +int net_thd_is_current() { + return thd_current == thd; +} + +int net_thd_init() { + TAILQ_INIT(&cbs); + done = 0; + cbid_top = 1; + + thd = thd_create(&net_thd_thd, NULL); + + return 0; +} + +void net_thd_shutdown() { + struct thd_cb *c, *n; + + /* Kill the thread. */ + done = 1; + thd_wait(thd); + + /* Free any handlers that we have laying around */ + c = TAILQ_FIRST(&cbs); + while(c) { + n = TAILQ_NEXT(c, thds); + free(c); + c = n; + } + + TAILQ_INIT(&cbs); +} Added: kos/kernel/net/net_thd.h =================================================================== --- kos/kernel/net/net_thd.h (rev 0) +++ kos/kernel/net/net_thd.h 2009-06-07 23:08:14 UTC (rev 644) @@ -0,0 +1,27 @@ +/* KallistiOS ##version## + + kernel/net/net_thd.h + Copyright (C) 2009 Lawrence Sebald + +*/ + +#ifndef __LOCAL_NET_THD_H +#define __LOCAL_NET_THD_H + +#include <sys/cdefs.h> + +__BEGIN_DECLS + +#include <arch/types.h> + +int net_thd_add_callback(void (*cb)(void *), void *data, uint64 timeout); +int net_thd_del_callback(int cbid); + +int net_thd_is_current(); + +int net_thd_init(); +void net_thd_shutdown(); + +__END_DECLS + +#endif /* !__LOCAL_NET_THD_H */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ljs...@us...> - 2009-06-06 22:06:03
|
Revision: 643 http://cadcdev.svn.sourceforge.net/cadcdev/?rev=643&view=rev Author: ljsebald Date: 2009-06-06 22:05:36 +0000 (Sat, 06 Jun 2009) Log Message: ----------- Added IP fragmenting support. Modified Paths: -------------- kos/doc/CHANGELOG kos/kernel/net/Makefile kos/kernel/net/net_ipv4.c kos/kernel/net/net_ipv4.h Added Paths: ----------- kos/kernel/net/net_ipv4_frag.c Modified: kos/doc/CHANGELOG =================================================================== --- kos/doc/CHANGELOG 2009-06-06 14:15:37 UTC (rev 642) +++ kos/doc/CHANGELOG 2009-06-06 22:05:36 UTC (rev 643) @@ -188,6 +188,10 @@ - DC Added a modifier volume example using textures [LS] - DC Added a simple statistics system to the IPv4 and UDP layers of the network stack [LS] +- DC Added a MTU value to the netif structure for maintaining the maximum + transfer size of the adapter [LS] +- DC Added the ability to fragment IP packets, and made fragmenting respect + the MTU [LS] KallistiOS version 1.2.0 ----------------------------------------------- - DC Fix to use DCARM7_CFLAGS when compiling ARM driver [Christian Groessler == CG] Modified: kos/kernel/net/Makefile =================================================================== --- kos/kernel/net/Makefile 2009-06-06 14:15:37 UTC (rev 642) +++ kos/kernel/net/Makefile 2009-06-06 22:05:36 UTC (rev 643) @@ -4,7 +4,8 @@ # (c)2002 Dan Potter # -OBJS = net_core.o net_arp.o net_input.o net_icmp.o net_ipv4.o net_udp.o net_dhcp.o +OBJS = net_core.o net_arp.o net_input.o net_icmp.o net_ipv4.o net_udp.o +OBJS += net_dhcp.o net_ipv4_frag.o SUBDIRS = include $(KOS_BASE)/Makefile.prefab Modified: kos/kernel/net/net_ipv4.c =================================================================== --- kos/kernel/net/net_ipv4.c 2009-06-06 14:15:37 UTC (rev 642) +++ kos/kernel/net/net_ipv4.c 2009-06-06 22:05:36 UTC (rev 643) @@ -164,7 +164,7 @@ } int net_ipv4_send(netif_t *net, const uint8 *data, int size, int id, int ttl, - int proto, uint32 src, uint32 dst) { + int proto, uint32 src, uint32 dst) { ip_hdr_t hdr; /* Fill in the IPv4 Header */ @@ -172,7 +172,7 @@ hdr.tos = 0; hdr.length = htons(size + 20); hdr.packet_id = id; - hdr.flags_frag_offs = htons(0x4000); + hdr.flags_frag_offs = 0; hdr.ttl = ttl; hdr.protocol = proto; hdr.checksum = 0; @@ -181,7 +181,7 @@ hdr.checksum = net_ipv4_checksum((uint8 *)&hdr, sizeof(ip_hdr_t)); - return net_ipv4_send_packet(net, &hdr, data, size); + return net_ipv4_frag_send(net, &hdr, data, size); } int net_ipv4_input(netif_t *src, const uint8 *pkt, int pktsize) { Modified: kos/kernel/net/net_ipv4.h =================================================================== --- kos/kernel/net/net_ipv4.h 2009-06-06 14:15:37 UTC (rev 642) +++ kos/kernel/net/net_ipv4.h 2009-06-06 22:05:36 UTC (rev 643) @@ -50,4 +50,8 @@ int proto, uint32 src, uint32 dst); int net_ipv4_input(netif_t *src, const uint8 *pkt, int pktsize); +/* In net_ipv4_frag.c */ +int net_ipv4_frag_send(netif_t *net, ip_hdr_t *hdr, const uint8 *data, + int size); + #endif /* __LOCAL_NET_IPV4_H */ Added: kos/kernel/net/net_ipv4_frag.c =================================================================== --- kos/kernel/net/net_ipv4_frag.c (rev 0) +++ kos/kernel/net/net_ipv4_frag.c 2009-06-06 22:05:36 UTC (rev 643) @@ -0,0 +1,61 @@ +/* KallistiOS ##version## + + kernel/net/net_ipv4_frag.c + Copyright (C) 2009 Lawrence Sebald + +*/ + +#include <string.h> +#include <errno.h> +#include <arpa/inet.h> + +#include <kos/net.h> + +#include "net_ipv4.h" + +int net_ipv4_frag_send(netif_t *net, ip_hdr_t *hdr, const uint8 *data, + int size) { + int ihl = (hdr->version_ihl & 0x0f) << 2; + int total = size + ihl; + uint16 flags = ntohs(hdr->flags_frag_offs); + ip_hdr_t newhdr; + int nfb, ds; + + if(net == NULL) + net = net_default_dev; + + /* If the packet doesn't need to be fragmented, send it away as is. */ + if(total < net->mtu) { + return net_ipv4_send_packet(net, hdr, data, size); + } + /* If it needs to be fragmented and the DF flag is set, return error. */ + else if(flags & 0x4000) { + errno = EMSGSIZE; + return -1; + } + + /* Copy over the old header, and set up things for fragment processing. */ + memcpy(&newhdr, hdr, ihl); + nfb = ((net->mtu - ihl) >> 3); + ds = nfb << 3; + newhdr.flags_frag_offs = htons(flags | 0x2000); + newhdr.length = htons(ihl + (nfb << 3)); + + /* Recompute the checksum. */ + newhdr.checksum = 0; + newhdr.checksum = net_ipv4_checksum((uint8 *)&newhdr, sizeof(ip_hdr_t)); + + if(net_ipv4_send_packet(net, &newhdr, data, ds)) { + return -1; + } + + /* We don't deal with options right now, so dealing with the rest of the + fragments is pretty easy. Fix the header, and recursively call this + function to finish things off. */ + hdr->length = htons(ihl + size); + hdr->flags_frag_offs = htons((flags & 0xE000) | ((flags & 0x1FFF) + nfb)); + hdr->checksum = 0; + hdr->checksum = net_ipv4_checksum((uint8 *)hdr, sizeof(ip_hdr_t)); + + return net_ipv4_frag_send(net, hdr, data + ds, size - ds); +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |