3 Copyright (C) 2006-2009 Jörg Pfähler
5 This program is free software; you can redistribute it and/or
6 modify it under the terms of the GNU General Public License
7 as published by the Free Software Foundation; either version 2
8 of the License, or (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
19 #include <kernel/id.hpp>
20 #include <kernel/spinlock.hpp>
21 #include <lightOS/lightOS.hpp>
22 using namespace kernel
;
24 libkernel::port_id_t lastPortId
= libkernel::message_port::user
;
25 libkernel::shared_memory_id_t lastSharedMemoryId
= 0;
27 lightOS::spinlock mIdLock
;
30 id
kernel::generateId()
37 libkernel::port_id_t
kernel::generatePortId()
40 libkernel::port_id_t Id
= ++lastPortId
;
44 libkernel::shared_memory_id_t
kernel::generateSharedMemoryId()
47 libkernel::shared_memory_id_t Id
= ++lastSharedMemoryId
;