hw: provide placement via dedicated header

ref #935
This commit is contained in:
Martin Stein 2013-11-14 12:07:07 +01:00 committed by Norman Feske
parent 15a56bd682
commit da49f86f5b
7 changed files with 36 additions and 27 deletions

View File

@ -0,0 +1,22 @@
/*
* \brief Placement new operator
* \author Martin Stein
* \date 2013-11-07
*/
/*
* Copyright (C) 2013 Genode Labs GmbH
*
* This file is part of the Genode OS framework, which is distributed
* under the terms of the GNU General Public License version 2.
*/
#ifndef _PLACEMENT_NEW_H_
#define _PLACEMENT_NEW_H_
/**
* Placement new operator
*/
inline void *operator new(Genode::size_t, void *at) { return at; }
#endif /* _PLACEMENT_NEW_H_ */

View File

@ -31,8 +31,8 @@
/* Genode includes */
#include <base/stdint.h>
inline void *operator new(Genode::size_t, void *at) { return at; }
/* base-hw includes */
#include <placement_new.h>
template <typename T, int ALIGN = 2, typename... Args>
static inline T *unsynchronized_singleton(Args... args)

View File

@ -18,6 +18,9 @@
#include <base/native_types.h>
#include <irq_session/irq_session.h>
/* base-hw includes */
#include <placement_new.h>
/* core includes */
#include <kernel/signal_receiver.h>
@ -125,15 +128,6 @@ class Kernel::Irq
public:
/**
* Placement-new operator
*
* \param p destination of new object
*
* \return destination of new object
*/
void * operator new (size_t, void * p) { return p; }
/**
* Constructor
*

View File

@ -14,6 +14,9 @@
/* Genode includes */
#include <base/thread_state.h>
/* base-hw includes */
#include <placement_new.h>
/* core includes */
#include <kernel/kernel.h>
#include <kernel/thread.h>

View File

@ -47,11 +47,6 @@ class Kernel::Vm : public Object<Vm, MAX_VMS, Vm_ids, vm_ids, vm_pool>,
public:
/**
* Placement new
*/
void * operator new (size_t, void * p) { return p; }
/**
* Constructor
*

View File

@ -13,7 +13,10 @@
/* Genode includes */
#include <base/printf.h>
/* base-hw includes */
#include <kernel/syscalls.h>
#include <placement_new.h>
/* core includes */
#include <signal_session_component.h>
@ -21,12 +24,6 @@
using namespace Genode;
/**
* Placement new
*/
void * operator new (size_t, void * p) { return p; }
Signal_session_component::Signal_session_component(Allocator * const md,
size_t const ram_quota) :
_md_alloc(md, ram_quota),

View File

@ -18,6 +18,9 @@
#include <util/register.h>
#include <base/printf.h>
/* base-hw includes */
#include <placement_new.h>
namespace Arm
{
using namespace Genode;
@ -312,11 +315,6 @@ namespace Arm
public:
/**
* Placement new operator
*/
void * operator new (size_t, void * p) { return p; }
/**
* Constructor
*/