2012-08-02 15:46:53 +00:00
|
|
|
/*
|
|
|
|
* \brief Fast-bitmap allocator for NIC-session packet streams
|
|
|
|
* \author Sebastian Sumpf
|
|
|
|
* \date 2012-07-30
|
|
|
|
*
|
|
|
|
* This allocator can be used with a nic session. It is *not* required though.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
2013-01-10 20:44:47 +00:00
|
|
|
* Copyright (C) 2012-2013 Genode Labs GmbH
|
2012-08-02 15:46:53 +00:00
|
|
|
*
|
|
|
|
* This file is part of the Genode OS framework, which is distributed
|
|
|
|
* under the terms of the GNU General Public License version 2.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _INCLUDE__NIC__PACKET_ALLOCATOR__
|
|
|
|
#define _INCLUDE__NIC__PACKET_ALLOCATOR__
|
|
|
|
|
2014-02-12 12:59:41 +00:00
|
|
|
#include <os/packet_allocator.h>
|
2012-08-02 15:46:53 +00:00
|
|
|
|
|
|
|
namespace Nic {
|
|
|
|
|
2014-02-12 12:59:41 +00:00
|
|
|
/**
|
|
|
|
* Packet allocator used for packet streaming in nic sessions.
|
|
|
|
*/
|
|
|
|
class Packet_allocator : public Genode::Packet_allocator
|
2012-08-02 15:46:53 +00:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
enum { DEFAULT_PACKET_SIZE = 1600 };
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Constructor
|
|
|
|
*
|
2014-02-12 12:59:41 +00:00
|
|
|
* \param md_alloc Meta-data allocator
|
2012-08-02 15:46:53 +00:00
|
|
|
*/
|
2014-02-12 12:59:41 +00:00
|
|
|
Packet_allocator(Genode::Allocator *md_alloc)
|
|
|
|
: Genode::Packet_allocator(md_alloc, DEFAULT_PACKET_SIZE) {}
|
2012-08-02 15:46:53 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* _INCLUDE__NIC__PACKET_ALLOCATOR__ */
|