Category : Alternate Operating Systems - Quarterdeck DesqView, CP/M, etc
Archive   : PCCAPP.ZIP
Filename : CPUSET.H

 
Output of file : CPUSET.H contained in archive : PCCAPP.ZIP
/*
* This file is part of the Choices Operating System
* Developed by: The TAPESTRY Parallel Computing Laboratory
* University of Illinois at Urbana-Champaign
* Department of Computer Science
* 1304 W. Springfield Ave.
* Urbana, IL 61801
*
* Copyright (c) 1987, 1988, 1989, 1990, 1991, 1992
* The University of Illinois Board of Trustees.
* All Rights Reserved.
*
* Author: Gary M. Johnston ([email protected])
* Contributing Author: Vincent F. Russo ([email protected])
* Project Manager and Principal Investigator: Roy Campbell ([email protected])
*
* Funded by: NSF TAPESTRY Grant No. 1-5-30035, NASA ICLASS Grant
* No. 1-5-25469 and No. NSG1471 and AT&T Metronet Grant No. 1-5-37411.
*
* Permission to use, copy, modify, and distribute this software and
* its documentation for educational, research, and non-profit purposes
* is hereby granted provided that the above copyright notice, the
* original authors names, and this permission notice appear in all such
* copies and supporting documentation; that no charge be made for such
* copies; and that the name of the University of Illinois not be used
* in advertising or publicity pertaining to distribution of the
* software without specific prior written permission. Any entity
* desiring permission to incorporate this software into commercial
* products should contact the Computing Research Laboratory, Department
* of Computer Science, University of Illinois, 1304 W. Springfield
* Avenue, Urbana, IL 61801. The University of Illinois makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*/
/*
* CPUSet.h: sets of CPUs discriminated by their processor id number.
*/

#ifndef CPUSet_h
#define CPUSet_h
#ifdef __GNUG__
#pragma once
#pragma interface
#endif

#include "Assert.h"
#include "CPUCollection.h"
#include "LOCK.h"
#include "Object.h"
#include "OutputStream.h"


typedef unsigned long CPUSetEntry;
static const unsigned int CPUSetEntryBits = 8 * sizeof( CPUSetEntry );
static const unsigned int CPUSetEntryCount =
( MAXPROCESSORS + CPUSetEntryBits - 1 ) / CPUSetEntryBits;

extern ClassStar CPUSetClass;
class CPUSet : public Object {
protected:
friend class CPUSetIterator;

LOCK lock;
CPUSetEntry entry[ CPUSetEntryCount ];

unsigned int index( unsigned long cpuid ); // Index of cpuid entry
CPUSetEntry mask( unsigned long cpuid ); // Mask of cpuid w/i entry
int present( unsigned long cpuid ); // Return bit value of cpuid
int lockedPresent( unsigned long cpuid ); // locked version of above
public:
CPUSet();
~CPUSet();

int contains( CPU * cpu );
void add( CPU * cpu );
void remove( CPU * cpu );
int isEmpty();

virtual Class * classOf();
};

inline
CPUSet::~CPUSet()
{
Assert( isEmpty() );
}

inline unsigned int
CPUSet::index( unsigned long cpuid )
{
return( cpuid / CPUSetEntryBits );
}

inline CPUSetEntry
CPUSet::mask( unsigned long cpuid )
{
return( (CPUSetEntry) 1 << ( cpuid % CPUSetEntryBits ) );
}

inline int
CPUSet::present( unsigned long cpuid )
{
return( ( entry[ index( cpuid ) ] & mask( cpuid ) ) != 0 );
}


/*
* An iterator for a CPUSet.
*/

class CPUSetIterator {
protected:
CPUSet * cpuSet;
unsigned long cpuid;
public:
CPUSetIterator( CPUSet * cpuSet );
CPU * next();
};

inline
CPUSetIterator::CPUSetIterator( CPUSet * set )
{
Assert( set != 0 );
cpuSet = set;
cpuid = 0;
}

#endif /* CPUSet_h */
/*
* This file is part of the Choices Operating System
* Developed by: The TAPESTRY Parallel Computing Laboratory
* University of Illinois at Urbana-Champaign
* Department of Computer Science
* 1304 W. Springfield Ave.
* Urbana, IL 61801
*
* Copyright (c) 1987, 1988, 1989, 1990, 1991, 1992
* The University of Illinois Board of Trustees.
* All Rights Reserved.
*
* Author: Systems Research Group ([email protected])
* Project Manager and Principal Investigator: Roy Campbell ([email protected])
*
* Funded by: NSF TAPESTRY Grant No. 1-5-30035, NASA ICLASS Grant
* No. 1-5-25469 and No. NSG1471 and AT&T Metronet Grant No. 1-5-37411.
*
* Permission to use, copy, modify, and distribute this software and
* its documentation for educational, research, and non-profit purposes
* is hereby granted provided that the above copyright notice, the
* original authors names, and this permission notice appear in all such
* copies and supporting documentation; that no charge be made for such
* copies; and that the name of the University of Illinois not be used
* in advertising or publicity pertaining to distribution of the
* software without specific prior written permission. Any entity
* desiring permission to incorporate this software into commercial
* products should contact the Computing Research Laboratory, Department
* of Computer Science, University of Illinois, 1304 W. Springfield
* Avenue, Urbana, IL 61801. The University of Illinois makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*/
/* This file was generated by Proxify++ version 0.1 */

#ifndef CPUSet_h
#define CPUSet_h
#ifdef __GNUG__
#pragma once
#pragma interface
#endif
#include "Assert.h"
#include "CPUCollection.h"
#include "LOCK.h"
#include "Object.h"
#include "OutputStream.h"
typedef unsigned long CPUSetEntry;
static const unsigned int CPUSetEntryBits = 8 * sizeof (CPUSetEntry);
static const unsigned int CPUSetEntryCount = (1 + CPUSetEntryBits - 1) / CPUSetEntryBits;
extern ClassStar CPUSetClass;
class CPUSet;
class CPUSetIterator;
#endif CPUSet_h


  3 Responses to “Category : Alternate Operating Systems - Quarterdeck DesqView, CP/M, etc
Archive   : PCCAPP.ZIP
Filename : CPUSET.H

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/