src/thread/psp/SDL_syssem.c
author Philipp Wiesemann <philipp.wiesemann@arcor.de>
Sat, 31 Jan 2015 22:43:05 +0100
changeset 9328 b21d3417260a
parent 8149 681eb46b8ac4
child 9329 64bb8e49c6a6
permissions -rw-r--r--
Added missing include statements in implementation for PSP. SDL_internal.h should be included to support dynamic API and fix warnings.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
7009
161b7b6a5303 Add PSP support
Captain Lex <kimonline@126.com>
parents:
diff changeset
     1
/*
161b7b6a5303 Add PSP support
Captain Lex <kimonline@126.com>
parents:
diff changeset
     2
  Simple DirectMedia Layer
8149
681eb46b8ac4 Fixed bug 2374 - Update copyright for 2014...
Sam Lantinga <slouken@libsdl.org>
parents: 7191
diff changeset
     3
  Copyright (C) 1997-2014 Sam Lantinga <slouken@libsdl.org>
7009
161b7b6a5303 Add PSP support
Captain Lex <kimonline@126.com>
parents:
diff changeset
     4
161b7b6a5303 Add PSP support
Captain Lex <kimonline@126.com>
parents:
diff changeset
     5
  This software is provided 'as-is', without any express or implied
161b7b6a5303 Add PSP support
Captain Lex <kimonline@126.com>
parents:
diff changeset
     6
  warranty.  In no event will the authors be held liable for any damages
161b7b6a5303 Add PSP support
Captain Lex <kimonline@126.com>
parents:
diff changeset
     7
  arising from the use of this software.
161b7b6a5303 Add PSP support
Captain Lex <kimonline@126.com>
parents:
diff changeset
     8
161b7b6a5303 Add PSP support
Captain Lex <kimonline@126.com>
parents:
diff changeset
     9
  Permission is granted to anyone to use this software for any purpose,
161b7b6a5303 Add PSP support
Captain Lex <kimonline@126.com>
parents:
diff changeset
    10
  including commercial applications, and to alter it and redistribute it
161b7b6a5303 Add PSP support
Captain Lex <kimonline@126.com>
parents:
diff changeset
    11
  freely, subject to the following restrictions:
161b7b6a5303 Add PSP support
Captain Lex <kimonline@126.com>
parents:
diff changeset
    12
161b7b6a5303 Add PSP support
Captain Lex <kimonline@126.com>
parents:
diff changeset
    13
  1. The origin of this software must not be misrepresented; you must not
161b7b6a5303 Add PSP support
Captain Lex <kimonline@126.com>
parents:
diff changeset
    14
     claim that you wrote the original software. If you use this software
161b7b6a5303 Add PSP support
Captain Lex <kimonline@126.com>
parents:
diff changeset
    15
     in a product, an acknowledgment in the product documentation would be
161b7b6a5303 Add PSP support
Captain Lex <kimonline@126.com>
parents:
diff changeset
    16
     appreciated but is not required.
161b7b6a5303 Add PSP support
Captain Lex <kimonline@126.com>
parents:
diff changeset
    17
  2. Altered source versions must be plainly marked as such, and must not be
161b7b6a5303 Add PSP support
Captain Lex <kimonline@126.com>
parents:
diff changeset
    18
     misrepresented as being the original software.
161b7b6a5303 Add PSP support
Captain Lex <kimonline@126.com>
parents:
diff changeset
    19
  3. This notice may not be removed or altered from any source distribution.
161b7b6a5303 Add PSP support
Captain Lex <kimonline@126.com>
parents:
diff changeset
    20
*/
9328
b21d3417260a Added missing include statements in implementation for PSP.
Philipp Wiesemann <philipp.wiesemann@arcor.de>
parents: 8149
diff changeset
    21
#include "../../SDL_internal.h"
7009
161b7b6a5303 Add PSP support
Captain Lex <kimonline@126.com>
parents:
diff changeset
    22
161b7b6a5303 Add PSP support
Captain Lex <kimonline@126.com>
parents:
diff changeset
    23
/* Semaphore functions for the PSP. */
161b7b6a5303 Add PSP support
Captain Lex <kimonline@126.com>
parents:
diff changeset
    24
161b7b6a5303 Add PSP support
Captain Lex <kimonline@126.com>
parents:
diff changeset
    25
#include <stdio.h>
161b7b6a5303 Add PSP support
Captain Lex <kimonline@126.com>
parents:
diff changeset
    26
#include <stdlib.h>
161b7b6a5303 Add PSP support
Captain Lex <kimonline@126.com>
parents:
diff changeset
    27
161b7b6a5303 Add PSP support
Captain Lex <kimonline@126.com>
parents:
diff changeset
    28
#include "SDL_error.h"
161b7b6a5303 Add PSP support
Captain Lex <kimonline@126.com>
parents:
diff changeset
    29
#include "SDL_thread.h"
161b7b6a5303 Add PSP support
Captain Lex <kimonline@126.com>
parents:
diff changeset
    30
161b7b6a5303 Add PSP support
Captain Lex <kimonline@126.com>
parents:
diff changeset
    31
#include <pspthreadman.h>
161b7b6a5303 Add PSP support
Captain Lex <kimonline@126.com>
parents:
diff changeset
    32
#include <pspkerror.h>
161b7b6a5303 Add PSP support
Captain Lex <kimonline@126.com>
parents:
diff changeset
    33
161b7b6a5303 Add PSP support
Captain Lex <kimonline@126.com>
parents:
diff changeset
    34
struct SDL_semaphore {
7191
75360622e65f File style cleanup for the SDL 2.0 release
Sam Lantinga <slouken@libsdl.org>
parents: 7037
diff changeset
    35
    SceUID  semid;
7009
161b7b6a5303 Add PSP support
Captain Lex <kimonline@126.com>
parents:
diff changeset
    36
};
161b7b6a5303 Add PSP support
Captain Lex <kimonline@126.com>
parents:
diff changeset
    37
161b7b6a5303 Add PSP support
Captain Lex <kimonline@126.com>
parents:
diff changeset
    38
161b7b6a5303 Add PSP support
Captain Lex <kimonline@126.com>
parents:
diff changeset
    39
/* Create a semaphore */
161b7b6a5303 Add PSP support
Captain Lex <kimonline@126.com>
parents:
diff changeset
    40
SDL_sem *SDL_CreateSemaphore(Uint32 initial_value)
161b7b6a5303 Add PSP support
Captain Lex <kimonline@126.com>
parents:
diff changeset
    41
{
7191
75360622e65f File style cleanup for the SDL 2.0 release
Sam Lantinga <slouken@libsdl.org>
parents: 7037
diff changeset
    42
    SDL_sem *sem;
7009
161b7b6a5303 Add PSP support
Captain Lex <kimonline@126.com>
parents:
diff changeset
    43
7191
75360622e65f File style cleanup for the SDL 2.0 release
Sam Lantinga <slouken@libsdl.org>
parents: 7037
diff changeset
    44
    sem = (SDL_sem *) malloc(sizeof(*sem));
75360622e65f File style cleanup for the SDL 2.0 release
Sam Lantinga <slouken@libsdl.org>
parents: 7037
diff changeset
    45
    if (sem != NULL) {
75360622e65f File style cleanup for the SDL 2.0 release
Sam Lantinga <slouken@libsdl.org>
parents: 7037
diff changeset
    46
        /* TODO: Figure out the limit on the maximum value. */
75360622e65f File style cleanup for the SDL 2.0 release
Sam Lantinga <slouken@libsdl.org>
parents: 7037
diff changeset
    47
        sem->semid = sceKernelCreateSema("SDL sema", 0, initial_value, 255, NULL);
75360622e65f File style cleanup for the SDL 2.0 release
Sam Lantinga <slouken@libsdl.org>
parents: 7037
diff changeset
    48
        if (sem->semid < 0) {
75360622e65f File style cleanup for the SDL 2.0 release
Sam Lantinga <slouken@libsdl.org>
parents: 7037
diff changeset
    49
            SDL_SetError("Couldn't create semaphore");
75360622e65f File style cleanup for the SDL 2.0 release
Sam Lantinga <slouken@libsdl.org>
parents: 7037
diff changeset
    50
            free(sem);
75360622e65f File style cleanup for the SDL 2.0 release
Sam Lantinga <slouken@libsdl.org>
parents: 7037
diff changeset
    51
            sem = NULL;
75360622e65f File style cleanup for the SDL 2.0 release
Sam Lantinga <slouken@libsdl.org>
parents: 7037
diff changeset
    52
        }
75360622e65f File style cleanup for the SDL 2.0 release
Sam Lantinga <slouken@libsdl.org>
parents: 7037
diff changeset
    53
    } else {
75360622e65f File style cleanup for the SDL 2.0 release
Sam Lantinga <slouken@libsdl.org>
parents: 7037
diff changeset
    54
        SDL_OutOfMemory();
75360622e65f File style cleanup for the SDL 2.0 release
Sam Lantinga <slouken@libsdl.org>
parents: 7037
diff changeset
    55
    }
7009
161b7b6a5303 Add PSP support
Captain Lex <kimonline@126.com>
parents:
diff changeset
    56
7191
75360622e65f File style cleanup for the SDL 2.0 release
Sam Lantinga <slouken@libsdl.org>
parents: 7037
diff changeset
    57
    return sem;
7009
161b7b6a5303 Add PSP support
Captain Lex <kimonline@126.com>
parents:
diff changeset
    58
}
161b7b6a5303 Add PSP support
Captain Lex <kimonline@126.com>
parents:
diff changeset
    59
161b7b6a5303 Add PSP support
Captain Lex <kimonline@126.com>
parents:
diff changeset
    60
/* Free the semaphore */
161b7b6a5303 Add PSP support
Captain Lex <kimonline@126.com>
parents:
diff changeset
    61
void SDL_DestroySemaphore(SDL_sem *sem)
161b7b6a5303 Add PSP support
Captain Lex <kimonline@126.com>
parents:
diff changeset
    62
{
7191
75360622e65f File style cleanup for the SDL 2.0 release
Sam Lantinga <slouken@libsdl.org>
parents: 7037
diff changeset
    63
    if (sem != NULL) {
75360622e65f File style cleanup for the SDL 2.0 release
Sam Lantinga <slouken@libsdl.org>
parents: 7037
diff changeset
    64
        if (sem->semid > 0) {
75360622e65f File style cleanup for the SDL 2.0 release
Sam Lantinga <slouken@libsdl.org>
parents: 7037
diff changeset
    65
            sceKernelDeleteSema(sem->semid);
75360622e65f File style cleanup for the SDL 2.0 release
Sam Lantinga <slouken@libsdl.org>
parents: 7037
diff changeset
    66
            sem->semid = 0;
75360622e65f File style cleanup for the SDL 2.0 release
Sam Lantinga <slouken@libsdl.org>
parents: 7037
diff changeset
    67
        }
7009
161b7b6a5303 Add PSP support
Captain Lex <kimonline@126.com>
parents:
diff changeset
    68
7191
75360622e65f File style cleanup for the SDL 2.0 release
Sam Lantinga <slouken@libsdl.org>
parents: 7037
diff changeset
    69
        free(sem);
75360622e65f File style cleanup for the SDL 2.0 release
Sam Lantinga <slouken@libsdl.org>
parents: 7037
diff changeset
    70
    }
7009
161b7b6a5303 Add PSP support
Captain Lex <kimonline@126.com>
parents:
diff changeset
    71
}
161b7b6a5303 Add PSP support
Captain Lex <kimonline@126.com>
parents:
diff changeset
    72
161b7b6a5303 Add PSP support
Captain Lex <kimonline@126.com>
parents:
diff changeset
    73
/* TODO: This routine is a bit overloaded.
161b7b6a5303 Add PSP support
Captain Lex <kimonline@126.com>
parents:
diff changeset
    74
 * If the timeout is 0 then just poll the semaphore; if it's SDL_MUTEX_MAXWAIT, pass
161b7b6a5303 Add PSP support
Captain Lex <kimonline@126.com>
parents:
diff changeset
    75
 * NULL to sceKernelWaitSema() so that it waits indefinitely; and if the timeout
161b7b6a5303 Add PSP support
Captain Lex <kimonline@126.com>
parents:
diff changeset
    76
 * is specified, convert it to microseconds. */
161b7b6a5303 Add PSP support
Captain Lex <kimonline@126.com>
parents:
diff changeset
    77
int SDL_SemWaitTimeout(SDL_sem *sem, Uint32 timeout)
161b7b6a5303 Add PSP support
Captain Lex <kimonline@126.com>
parents:
diff changeset
    78
{
7191
75360622e65f File style cleanup for the SDL 2.0 release
Sam Lantinga <slouken@libsdl.org>
parents: 7037
diff changeset
    79
    Uint32 *pTimeout;
7009
161b7b6a5303 Add PSP support
Captain Lex <kimonline@126.com>
parents:
diff changeset
    80
       unsigned int res;
161b7b6a5303 Add PSP support
Captain Lex <kimonline@126.com>
parents:
diff changeset
    81
7191
75360622e65f File style cleanup for the SDL 2.0 release
Sam Lantinga <slouken@libsdl.org>
parents: 7037
diff changeset
    82
    if (sem == NULL) {
75360622e65f File style cleanup for the SDL 2.0 release
Sam Lantinga <slouken@libsdl.org>
parents: 7037
diff changeset
    83
        SDL_SetError("Passed a NULL sem");
75360622e65f File style cleanup for the SDL 2.0 release
Sam Lantinga <slouken@libsdl.org>
parents: 7037
diff changeset
    84
        return 0;
75360622e65f File style cleanup for the SDL 2.0 release
Sam Lantinga <slouken@libsdl.org>
parents: 7037
diff changeset
    85
    }
7009
161b7b6a5303 Add PSP support
Captain Lex <kimonline@126.com>
parents:
diff changeset
    86
7191
75360622e65f File style cleanup for the SDL 2.0 release
Sam Lantinga <slouken@libsdl.org>
parents: 7037
diff changeset
    87
    if (timeout == 0) {
75360622e65f File style cleanup for the SDL 2.0 release
Sam Lantinga <slouken@libsdl.org>
parents: 7037
diff changeset
    88
        res = sceKernelPollSema(sem->semid, 1);
75360622e65f File style cleanup for the SDL 2.0 release
Sam Lantinga <slouken@libsdl.org>
parents: 7037
diff changeset
    89
        if (res < 0) {
75360622e65f File style cleanup for the SDL 2.0 release
Sam Lantinga <slouken@libsdl.org>
parents: 7037
diff changeset
    90
            return SDL_MUTEX_TIMEDOUT;
75360622e65f File style cleanup for the SDL 2.0 release
Sam Lantinga <slouken@libsdl.org>
parents: 7037
diff changeset
    91
        }
75360622e65f File style cleanup for the SDL 2.0 release
Sam Lantinga <slouken@libsdl.org>
parents: 7037
diff changeset
    92
        return 0;
75360622e65f File style cleanup for the SDL 2.0 release
Sam Lantinga <slouken@libsdl.org>
parents: 7037
diff changeset
    93
    }
7009
161b7b6a5303 Add PSP support
Captain Lex <kimonline@126.com>
parents:
diff changeset
    94
7191
75360622e65f File style cleanup for the SDL 2.0 release
Sam Lantinga <slouken@libsdl.org>
parents: 7037
diff changeset
    95
    if (timeout == SDL_MUTEX_MAXWAIT) {
75360622e65f File style cleanup for the SDL 2.0 release
Sam Lantinga <slouken@libsdl.org>
parents: 7037
diff changeset
    96
        pTimeout = NULL;
75360622e65f File style cleanup for the SDL 2.0 release
Sam Lantinga <slouken@libsdl.org>
parents: 7037
diff changeset
    97
    } else {
75360622e65f File style cleanup for the SDL 2.0 release
Sam Lantinga <slouken@libsdl.org>
parents: 7037
diff changeset
    98
        timeout *= 1000;  /* Convert to microseconds. */
75360622e65f File style cleanup for the SDL 2.0 release
Sam Lantinga <slouken@libsdl.org>
parents: 7037
diff changeset
    99
        pTimeout = &timeout;
75360622e65f File style cleanup for the SDL 2.0 release
Sam Lantinga <slouken@libsdl.org>
parents: 7037
diff changeset
   100
    }
7009
161b7b6a5303 Add PSP support
Captain Lex <kimonline@126.com>
parents:
diff changeset
   101
7191
75360622e65f File style cleanup for the SDL 2.0 release
Sam Lantinga <slouken@libsdl.org>
parents: 7037
diff changeset
   102
    res = sceKernelWaitSema(sem->semid, 1, pTimeout);
7009
161b7b6a5303 Add PSP support
Captain Lex <kimonline@126.com>
parents:
diff changeset
   103
       switch (res) {
161b7b6a5303 Add PSP support
Captain Lex <kimonline@126.com>
parents:
diff changeset
   104
               case SCE_KERNEL_ERROR_OK:
161b7b6a5303 Add PSP support
Captain Lex <kimonline@126.com>
parents:
diff changeset
   105
                       return 0;
161b7b6a5303 Add PSP support
Captain Lex <kimonline@126.com>
parents:
diff changeset
   106
               case SCE_KERNEL_ERROR_WAIT_TIMEOUT:
161b7b6a5303 Add PSP support
Captain Lex <kimonline@126.com>
parents:
diff changeset
   107
                       return SDL_MUTEX_TIMEDOUT;
161b7b6a5303 Add PSP support
Captain Lex <kimonline@126.com>
parents:
diff changeset
   108
               default:
7037
3fedf1f25b94 Make SDL_SetError and friends unconditionally return -1.
Ryan C. Gordon <icculus@icculus.org>
parents: 7009
diff changeset
   109
                       return SDL_SetError("WaitForSingleObject() failed");
7191
75360622e65f File style cleanup for the SDL 2.0 release
Sam Lantinga <slouken@libsdl.org>
parents: 7037
diff changeset
   110
    }
7009
161b7b6a5303 Add PSP support
Captain Lex <kimonline@126.com>
parents:
diff changeset
   111
}
161b7b6a5303 Add PSP support
Captain Lex <kimonline@126.com>
parents:
diff changeset
   112
161b7b6a5303 Add PSP support
Captain Lex <kimonline@126.com>
parents:
diff changeset
   113
int SDL_SemTryWait(SDL_sem *sem)
161b7b6a5303 Add PSP support
Captain Lex <kimonline@126.com>
parents:
diff changeset
   114
{
7191
75360622e65f File style cleanup for the SDL 2.0 release
Sam Lantinga <slouken@libsdl.org>
parents: 7037
diff changeset
   115
    return SDL_SemWaitTimeout(sem, 0);
7009
161b7b6a5303 Add PSP support
Captain Lex <kimonline@126.com>
parents:
diff changeset
   116
}
161b7b6a5303 Add PSP support
Captain Lex <kimonline@126.com>
parents:
diff changeset
   117
161b7b6a5303 Add PSP support
Captain Lex <kimonline@126.com>
parents:
diff changeset
   118
int SDL_SemWait(SDL_sem *sem)
161b7b6a5303 Add PSP support
Captain Lex <kimonline@126.com>
parents:
diff changeset
   119
{
7191
75360622e65f File style cleanup for the SDL 2.0 release
Sam Lantinga <slouken@libsdl.org>
parents: 7037
diff changeset
   120
    return SDL_SemWaitTimeout(sem, SDL_MUTEX_MAXWAIT);
7009
161b7b6a5303 Add PSP support
Captain Lex <kimonline@126.com>
parents:
diff changeset
   121
}
161b7b6a5303 Add PSP support
Captain Lex <kimonline@126.com>
parents:
diff changeset
   122
161b7b6a5303 Add PSP support
Captain Lex <kimonline@126.com>
parents:
diff changeset
   123
/* Returns the current count of the semaphore */
161b7b6a5303 Add PSP support
Captain Lex <kimonline@126.com>
parents:
diff changeset
   124
Uint32 SDL_SemValue(SDL_sem *sem)
161b7b6a5303 Add PSP support
Captain Lex <kimonline@126.com>
parents:
diff changeset
   125
{
7191
75360622e65f File style cleanup for the SDL 2.0 release
Sam Lantinga <slouken@libsdl.org>
parents: 7037
diff changeset
   126
    SceKernelSemaInfo info;
7009
161b7b6a5303 Add PSP support
Captain Lex <kimonline@126.com>
parents:
diff changeset
   127
7191
75360622e65f File style cleanup for the SDL 2.0 release
Sam Lantinga <slouken@libsdl.org>
parents: 7037
diff changeset
   128
    if (sem == NULL) {
75360622e65f File style cleanup for the SDL 2.0 release
Sam Lantinga <slouken@libsdl.org>
parents: 7037
diff changeset
   129
        SDL_SetError("Passed a NULL sem");
75360622e65f File style cleanup for the SDL 2.0 release
Sam Lantinga <slouken@libsdl.org>
parents: 7037
diff changeset
   130
        return 0;
75360622e65f File style cleanup for the SDL 2.0 release
Sam Lantinga <slouken@libsdl.org>
parents: 7037
diff changeset
   131
    }
7009
161b7b6a5303 Add PSP support
Captain Lex <kimonline@126.com>
parents:
diff changeset
   132
7191
75360622e65f File style cleanup for the SDL 2.0 release
Sam Lantinga <slouken@libsdl.org>
parents: 7037
diff changeset
   133
    if (sceKernelReferSemaStatus(sem->semid, &info) >= 0) {
75360622e65f File style cleanup for the SDL 2.0 release
Sam Lantinga <slouken@libsdl.org>
parents: 7037
diff changeset
   134
        return info.currentCount;
75360622e65f File style cleanup for the SDL 2.0 release
Sam Lantinga <slouken@libsdl.org>
parents: 7037
diff changeset
   135
    }
7009
161b7b6a5303 Add PSP support
Captain Lex <kimonline@126.com>
parents:
diff changeset
   136
7191
75360622e65f File style cleanup for the SDL 2.0 release
Sam Lantinga <slouken@libsdl.org>
parents: 7037
diff changeset
   137
    return 0;
7009
161b7b6a5303 Add PSP support
Captain Lex <kimonline@126.com>
parents:
diff changeset
   138
}
161b7b6a5303 Add PSP support
Captain Lex <kimonline@126.com>
parents:
diff changeset
   139
161b7b6a5303 Add PSP support
Captain Lex <kimonline@126.com>
parents:
diff changeset
   140
int SDL_SemPost(SDL_sem *sem)
161b7b6a5303 Add PSP support
Captain Lex <kimonline@126.com>
parents:
diff changeset
   141
{
7191
75360622e65f File style cleanup for the SDL 2.0 release
Sam Lantinga <slouken@libsdl.org>
parents: 7037
diff changeset
   142
    int res;
7009
161b7b6a5303 Add PSP support
Captain Lex <kimonline@126.com>
parents:
diff changeset
   143
7191
75360622e65f File style cleanup for the SDL 2.0 release
Sam Lantinga <slouken@libsdl.org>
parents: 7037
diff changeset
   144
    if (sem == NULL) {
75360622e65f File style cleanup for the SDL 2.0 release
Sam Lantinga <slouken@libsdl.org>
parents: 7037
diff changeset
   145
        return SDL_SetError("Passed a NULL sem");
75360622e65f File style cleanup for the SDL 2.0 release
Sam Lantinga <slouken@libsdl.org>
parents: 7037
diff changeset
   146
    }
7009
161b7b6a5303 Add PSP support
Captain Lex <kimonline@126.com>
parents:
diff changeset
   147
7191
75360622e65f File style cleanup for the SDL 2.0 release
Sam Lantinga <slouken@libsdl.org>
parents: 7037
diff changeset
   148
    res = sceKernelSignalSema(sem->semid, 1);
75360622e65f File style cleanup for the SDL 2.0 release
Sam Lantinga <slouken@libsdl.org>
parents: 7037
diff changeset
   149
    if (res < 0) {
75360622e65f File style cleanup for the SDL 2.0 release
Sam Lantinga <slouken@libsdl.org>
parents: 7037
diff changeset
   150
        return SDL_SetError("sceKernelSignalSema() failed");
75360622e65f File style cleanup for the SDL 2.0 release
Sam Lantinga <slouken@libsdl.org>
parents: 7037
diff changeset
   151
    }
7009
161b7b6a5303 Add PSP support
Captain Lex <kimonline@126.com>
parents:
diff changeset
   152
7191
75360622e65f File style cleanup for the SDL 2.0 release
Sam Lantinga <slouken@libsdl.org>
parents: 7037
diff changeset
   153
    return 0;
7009
161b7b6a5303 Add PSP support
Captain Lex <kimonline@126.com>
parents:
diff changeset
   154
}
161b7b6a5303 Add PSP support
Captain Lex <kimonline@126.com>
parents:
diff changeset
   155
161b7b6a5303 Add PSP support
Captain Lex <kimonline@126.com>
parents:
diff changeset
   156
/* vim: ts=4 sw=4
161b7b6a5303 Add PSP support
Captain Lex <kimonline@126.com>
parents:
diff changeset
   157
 */