Don't use private BeOS syscalls.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31044 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold
2009-06-14 11:55:24 +00:00
parent 58e784dfe6
commit 87df8902ac
10 changed files with 187 additions and 176 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
SubDir HAIKU_TOP src apps processcontroller ;
SetSubDirSupportedPlatformsBeOSCompatible ;
UsePrivateSystemHeaders ;
Application ProcessController :
AutoIcon.cpp
+12 -14
View File
@@ -1,20 +1,20 @@
/*
ProcessController © 2000, Georges-Edouard Berenger, All Rights Reserved.
Copyright (C) 2004 beunited.org
Copyright (C) 2004 beunited.org
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library 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
Lesser General Public License for more details.
This library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef _PCWORLD_H_
#define _PCWORLD_H_
@@ -42,7 +42,5 @@ extern const char* kPCSemaphoreName;
extern thread_id id;
extern "C" int _kget_cpu_state_(int cpu);
extern "C" int _kset_cpu_state_(int cpu, int enabled);
#endif // _PCWORLD_H_
@@ -21,18 +21,9 @@
#include "ProcessController.h"
#include "AutoIcon.h"
#include "Colors.h"
#include "IconMenuItem.h"
#include "MemoryBarMenu.h"
#include "MemoryBarMenuItem.h"
#include "PCWorld.h"
#include "Preferences.h"
#include "QuitMenu.h"
#include "TeamBarMenu.h"
#include "TeamBarMenuItem.h"
#include "ThreadBarMenu.h"
#include "Utilities.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <Alert.h>
#include <Bitmap.h>
@@ -49,9 +40,21 @@
#include <Screen.h>
#include <TextView.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <syscalls.h>
#include "AutoIcon.h"
#include "Colors.h"
#include "IconMenuItem.h"
#include "MemoryBarMenu.h"
#include "MemoryBarMenuItem.h"
#include "PCWorld.h"
#include "Preferences.h"
#include "QuitMenu.h"
#include "TeamBarMenu.h"
#include "TeamBarMenuItem.h"
#include "ThreadBarMenu.h"
#include "Utilities.h"
const char* kDeskbarItemName = "ProcessController";
const char* kClassName = "ProcessController";
@@ -340,7 +343,7 @@ ProcessController::MessageReceived(BMessage *message)
if (message->FindInt32 ("cpu", &cpu) == B_OK) {
bool last = true;
for (int p = 0; p < gCPUcount; p++) {
if (p != cpu && _kget_cpu_state_(p)) {
if (p != cpu && _kern_cpu_enabled(p)) {
last = false;
break;
}
@@ -350,7 +353,7 @@ ProcessController::MessageReceived(BMessage *message)
"That's no Fun!", NULL, NULL, B_WIDTH_AS_USUAL, B_WARNING_ALERT);
alert->Go();
} else
_kset_cpu_state_(cpu, !_kget_cpu_state_(cpu));
_kern_set_cpu_enabled(cpu, !_kern_cpu_enabled(cpu));
}
break;
}
@@ -674,7 +677,7 @@ thread_popup(void *arg)
BMessage* m = new BMessage ('CPU ');
m->AddInt32 ("cpu", i);
item = new IconMenuItem (gPCView->fProcessorIcon, item_name, m);
if (_kget_cpu_state_(i))
if (_kern_cpu_enabled(i))
item->SetMarked (true);
item->SetTarget(gPCView);
addtopbottom(item);