📄 psosutil.c
字号:
/* * Copyright 2000-2005 Wind River Systems, Inc. * All rights reserved. Provided under license only. * Distribution or other use of this software is only * permitted pursuant to the terms of a license agreement * from Wind River Systems (and is otherwise prohibited). * Refer to that license agreement for terms of use. *//* * Copyright 1993-1998 Integrated Systems, Inc. * All rights reserved. *//* * $Log: psosutil.c,v $ * Revision 1.1.1.1 2001/11/05 17:47:44 tneale * Tornado shuffle * * Revision 9.3 2001/01/19 22:22:14 paul * Update copyright. * * Revision 9.2 2000/04/05 19:07:46 josh * clearing up some warnings for pSOS+ 3.0 * * Revision 9.1 2000/03/17 00:18:17 meister * Update copyright message * * Revision 9.0 1998/10/16 22:10:36 sar * Update version stamp to match release * * Revision 1.2 1998/06/15 18:21:20 josh * added copyright notices * *//* [clearcase]modification history-------------------01b,18apr05,job update copyright notices01a,24nov03,job update copyright information*/#include "psos.h"#define RN_WAIT 0x00000000 /* Wait for a segment */#define NULL 0void *SNMP_memset(unsigned char *, unsigned char, unsigned long);void *SNMP_memcpy(unsigned char *, unsigned char *, long);/************************************************************************//* ChangeTaskPreemption: modify task's mode word *//* INPUTS: *//* RETURNS: *//* OUTPUTS: *//* NOTE(S): *//************************************************************************/unsigned long ChangeTaskPreemption(unsigned long nm){unsigned long om;t_mode(0x01, nm, &om);return om;}/************************************************************************//* RestoreTaskPreemption: restore task's mode word *//* INPUTS: *//* RETURNS: *//* OUTPUTS: *//* NOTE(S): *//************************************************************************/unsigned long RestoreTaskPreemption(unsigned long nm){unsigned long om;t_mode(0x01, nm, &om);}/*********************************************************************//* *//* FUNCTION MEMSET -- FILL MEMORY. *//* *//* void *memset (uchar *pt, uchar fill, ulong n ); *//* *//* This function fills n bytes with character 'fill' starting at *//* location pointed to by pt. *//* *//*********************************************************************/ void *SNMP_memset(unsigned char *pt, unsigned char fill, unsigned long n){ unsigned char *str;str = pt;while (n-- > 0) *(pt++) = fill; return(str);} /*********************************************************************/ /* *//* FUNCTION MEMCPY -- COPY FROM ONE BUFFER TO ANOTHER. *//* *//* void *memcpy (INT8 *mem1, INT8 *mem2, INT32 n); *//* *//* This function will copy n bytes from mem2 to mem1 regardless *//* of any control characters. If copying takes place between *//* objects that overlap, the behavior is undefined. *//* *//* The function returns a pointer to mem1. *//* *//*********************************************************************/ void *SNMP_memcpy(unsigned char *mem1, unsigned char *mem2, long n) { unsigned char *str;str = mem1;while (n--) *(mem1++) = *(mem2++);return(str);}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -