Merge remote-tracking branch 'haiku/master' into package-management
Conflicts: build/jam/HaikuImage build/jam/OptionalPackageDependencies build/jam/OptionalPackages build/scripts/build_cross_tools_gcc4 src/add-ons/translators/icns/Jamfile src/add-ons/translators/jpeg/Jamfile
This commit is contained in:
@@ -0,0 +1,75 @@
|
||||
/****************************************************************************
|
||||
* Copyright (c) 1998,2000 Free Software Foundation, Inc. *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a *
|
||||
* copy of this software and associated documentation files (the *
|
||||
* "Software"), to deal in the Software without restriction, including *
|
||||
* without limitation the rights to use, copy, modify, merge, publish, *
|
||||
* distribute, distribute with modifications, sublicense, and/or sell *
|
||||
* copies of the Software, and to permit persons to whom the Software is *
|
||||
* furnished to do so, subject to the following conditions: *
|
||||
* *
|
||||
* The above copyright notice and this permission notice shall be included *
|
||||
* in all copies or substantial portions of the Software. *
|
||||
* *
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
|
||||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
|
||||
* IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
|
||||
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
|
||||
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
|
||||
* THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
|
||||
* *
|
||||
* Except as contained in this notice, the name(s) of the above copyright *
|
||||
* holders shall not be used in advertising or otherwise to promote the *
|
||||
* sale, use or other dealings in this Software without prior written *
|
||||
* authorization. *
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Author: Zeyd M. Ben-Halim <[email protected]> 1992,1995 *
|
||||
* and: Eric S. Raymond <[email protected]> *
|
||||
****************************************************************************/
|
||||
|
||||
/* $Id: termcap.h.in,v 1.16 2001/03/24 21:53:27 tom Exp $ */
|
||||
|
||||
#ifndef NCURSES_TERMCAP_H_incl
|
||||
#define NCURSES_TERMCAP_H_incl 1
|
||||
|
||||
#undef NCURSES_VERSION
|
||||
#define NCURSES_VERSION "5.5"
|
||||
|
||||
#include <ncurses_dll.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
#undef NCURSES_CONST
|
||||
#define NCURSES_CONST /*nothing*/
|
||||
|
||||
#undef NCURSES_OSPEED
|
||||
#define NCURSES_OSPEED short
|
||||
|
||||
extern NCURSES_EXPORT_VAR(char) PC;
|
||||
extern NCURSES_EXPORT_VAR(char *) UP;
|
||||
extern NCURSES_EXPORT_VAR(char *) BC;
|
||||
extern NCURSES_EXPORT_VAR(NCURSES_OSPEED) ospeed;
|
||||
|
||||
#if !defined(NCURSES_TERM_H_incl)
|
||||
extern NCURSES_EXPORT(char *) tgetstr (NCURSES_CONST char *, char **);
|
||||
extern NCURSES_EXPORT(char *) tgoto (const char *, int, int);
|
||||
extern NCURSES_EXPORT(int) tgetent (char *, const char *);
|
||||
extern NCURSES_EXPORT(int) tgetflag (NCURSES_CONST char *);
|
||||
extern NCURSES_EXPORT(int) tgetnum (NCURSES_CONST char *);
|
||||
extern NCURSES_EXPORT(int) tputs (const char *, int, int (*)(int));
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* NCURSES_TERMCAP_H_incl */
|
||||
@@ -1,62 +0,0 @@
|
||||
/* Declarations for termcap library.
|
||||
Copyright (C) 1991, 1992, 1995 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
|
||||
This program 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 General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||
|
||||
#ifndef _TERMCAP_H
|
||||
#define _TERMCAP_H 1
|
||||
|
||||
#if __STDC__
|
||||
|
||||
extern int tgetent (char *buffer, const char *termtype);
|
||||
|
||||
extern int tgetnum (const char *name);
|
||||
extern int tgetflag (const char *name);
|
||||
extern char *tgetstr (const char *name, char **area);
|
||||
|
||||
extern char PC;
|
||||
extern short ospeed;
|
||||
extern void tputs (const char *string, int nlines, int (*outfun) (int));
|
||||
|
||||
extern char *tparam (const char *ctlstring, char *buffer, int size, ...);
|
||||
|
||||
extern char *UP;
|
||||
extern char *BC;
|
||||
|
||||
extern char *tgoto (const char *cstring, int hpos, int vpos);
|
||||
|
||||
#else /* not __STDC__ */
|
||||
|
||||
extern int tgetent ();
|
||||
|
||||
extern int tgetnum ();
|
||||
extern int tgetflag ();
|
||||
extern char *tgetstr ();
|
||||
|
||||
extern char PC;
|
||||
extern short ospeed;
|
||||
|
||||
extern void tputs ();
|
||||
|
||||
extern char *tparam ();
|
||||
|
||||
extern char *UP;
|
||||
extern char *BC;
|
||||
|
||||
extern char *tgoto ();
|
||||
|
||||
#endif /* not __STDC__ */
|
||||
|
||||
#endif /* not _TERMCAP_H */
|
||||
+54
-10
@@ -131,18 +131,18 @@ struct pci_module_info {
|
||||
pci_info *info /* caller-supplied buffer for info */
|
||||
);
|
||||
uint32 (*read_pci_config) (
|
||||
uchar bus, /* bus number */
|
||||
uchar device, /* device # on bus */
|
||||
uchar function, /* function # in device */
|
||||
uchar offset, /* offset in configuration space */
|
||||
uchar size /* # bytes to read (1, 2 or 4) */
|
||||
uint8 bus, /* bus number */
|
||||
uint8 device, /* device # on bus */
|
||||
uint8 function, /* function # in device */
|
||||
uint16 offset, /* offset in configuration space */
|
||||
uint8 size /* # bytes to read (1, 2 or 4) */
|
||||
);
|
||||
void (*write_pci_config) (
|
||||
uchar bus, /* bus number */
|
||||
uchar device, /* device # on bus */
|
||||
uchar function, /* function # in device */
|
||||
uchar offset, /* offset in configuration space */
|
||||
uchar size, /* # bytes to write (1, 2 or 4) */
|
||||
uint8 bus, /* bus number */
|
||||
uint8 device, /* device # on bus */
|
||||
uint8 function, /* function # in device */
|
||||
uint16 offset, /* offset in configuration space */
|
||||
uint8 size, /* # bytes to write (1, 2 or 4) */
|
||||
uint32 value /* value to write */
|
||||
);
|
||||
|
||||
@@ -174,6 +174,14 @@ struct pci_module_info {
|
||||
uchar device,
|
||||
uchar function,
|
||||
uchar newInterruptLineValue);
|
||||
|
||||
status_t (*find_pci_extended_capability) (
|
||||
uint8 bus,
|
||||
uint8 device,
|
||||
uint8 function,
|
||||
uint16 cap_id,
|
||||
uint16 *offset
|
||||
);
|
||||
};
|
||||
|
||||
#define B_PCI_MODULE_NAME "bus_managers/pci/v1"
|
||||
@@ -196,6 +204,7 @@ struct pci_module_info {
|
||||
#define PCI_header_type 0x0e /* (1 byte) header type */
|
||||
#define PCI_bist 0x0f /* (1 byte) built-in self-test */
|
||||
|
||||
#define PCI_extended_capability 0x100 /* (4 bytes) extended capability */
|
||||
|
||||
|
||||
/* ---
|
||||
@@ -690,6 +699,41 @@ struct pci_module_info {
|
||||
#define PCI_cap_id_sata 0x12 /* Serial ATA Capability */
|
||||
#define PCI_cap_id_pciaf 0x13 /* PCI Advanced Features */
|
||||
|
||||
/** PCI Extended Capabilities */
|
||||
#define PCI_extcap_id(x) (x & 0x0000ffff)
|
||||
#define PCI_extcap_version(x) ((x & 0x000f0000) >> 16)
|
||||
#define PCI_extcap_next_ptr(x) ((x & 0xfff00000) >> 20)
|
||||
|
||||
#define PCI_extcap_id_aer 0x0001 /* Advanced Error Reporting */
|
||||
#define PCI_extcap_id_vc 0x0002 /* Virtual Channel */
|
||||
#define PCI_extcap_id_serial 0x0003 /* Serial Number */
|
||||
#define PCI_extcap_id_power_budget 0x0004 /* Power Budgeting */
|
||||
#define PCI_extcap_id_rcl_decl 0x0005 /* Root Complex Link Declaration */
|
||||
#define PCI_extcap_id_rcil_ctl 0x0006 /* Root Complex Internal Link Control */
|
||||
#define PCI_extcap_id_rcec_assoc 0x0007 /* Root Complex Event Collector Association */
|
||||
#define PCI_extcap_id_mfvc 0x0008 /* MultiFunction Virtual Channel */
|
||||
#define PCI_extcap_id_vc2 0x0009 /* Virtual Channel 2 */
|
||||
#define PCI_extcap_id_rcrb_header 0x000a /* RCRB Header */
|
||||
#define PCI_extcap_id_vendor 0x000b /* Vendor Unique */
|
||||
#define PCI_extcap_id_acs 0x000d /* Access Control Services */
|
||||
#define PCI_extcap_id_ari 0x000e /* Alternative Routing Id Interpretation */
|
||||
#define PCI_extcap_id_ats 0x000f /* Address Translation Services */
|
||||
#define PCI_extcap_id_srio_virtual 0x0010 /* Single Root I/O Virtualization */
|
||||
#define PCI_extcap_id_mrio_virtual 0x0011 /* Multiple Root I/O Virtual */
|
||||
#define PCI_extcap_id_multicast 0x0012 /* Multicast */
|
||||
#define PCI_extcap_id_page_request 0x0013 /* Page Request */
|
||||
#define PCI_extcap_id_amd 0x0014 /* AMD Reserved */
|
||||
#define PCI_extcap_id_resizable_bar 0x0015 /* Resizable Bar */
|
||||
#define PCI_extcap_id_dyn_power_alloc 0x0016 /* Dynamic Power Allocation */
|
||||
#define PCI_extcap_id_tph_requester 0x0017 /* TPH Requester */
|
||||
#define PCI_extcap_id_latency_tolerance 0x0018 /* Latency Tolerance Reporting */
|
||||
#define PCI_extcap_id_2ndpcie 0x0019 /* Secondary PCIe */
|
||||
#define PCI_extcap_id_pmux 0x001a /* Protocol Multiplexing */
|
||||
#define PCI_extcap_id_pasid 0x001b /* Process Address Space Id */
|
||||
#define PCI_extcap_id_ln_requester 0x001c /* LN Requester */
|
||||
#define PCI_extcap_id_dpc 0x001d /* Downstream Porto Containment */
|
||||
#define PCI_extcap_id_l1pm 0x001e /* L1 Power Management Substates */
|
||||
|
||||
/** Power Management Control Status Register settings */
|
||||
#define PCI_pm_mask 0x03
|
||||
#define PCI_pm_ctrl 0x02
|
||||
|
||||
@@ -27,13 +27,15 @@ typedef struct pci_device_module_info {
|
||||
|
||||
void *(*ram_address)(pci_device *device, const void *physicalAddress);
|
||||
|
||||
uint32 (*read_pci_config)(pci_device *device, uint8 offset,
|
||||
uint32 (*read_pci_config)(pci_device *device, uint16 offset,
|
||||
uint8 size);
|
||||
void (*write_pci_config)(pci_device *device, uint8 offset,
|
||||
void (*write_pci_config)(pci_device *device, uint16 offset,
|
||||
uint8 size, uint32 value);
|
||||
status_t (*find_pci_capability)(pci_device *device, uint8 capID,
|
||||
uint8 *offset);
|
||||
void (*get_pci_info)(pci_device *device, struct pci_info *info);
|
||||
status_t (*find_pci_extended_capability)(pci_device *device, uint16 capID,
|
||||
uint16 *offset);
|
||||
} pci_device_module_info;
|
||||
|
||||
|
||||
|
||||
@@ -256,7 +256,7 @@ typedef struct {
|
||||
uint32 sim_priv; /* Size of SIM private data area */
|
||||
uchar vuhba_flags[SCSI_VUHBA];/* Vendor unique capabilities */
|
||||
uchar initiator_id; /* ID of the HBA on the SCSI bus */
|
||||
uint32 hba_queue_size; // size of adapaters command queue
|
||||
uint32 hba_queue_size; // size of adapters command queue
|
||||
char sim_vid[SCSI_SIM_ID]; /* Vendor ID of the SIM */
|
||||
char hba_vid[SCSI_HBA_ID]; /* Vendor ID of the HBA */
|
||||
|
||||
|
||||
+11
-10
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2005-2006, Haiku, Inc. All Rights Reserved.
|
||||
* Copyright 2005-2013 Haiku, Inc. All Rights Reserved.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*/
|
||||
#ifndef _BOX_H
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
class BBox : public BView {
|
||||
public:
|
||||
BBox(BRect frame, const char *name = NULL,
|
||||
BBox(BRect frame, const char* name = NULL,
|
||||
uint32 resizingMode = B_FOLLOW_LEFT
|
||||
| B_FOLLOW_TOP,
|
||||
uint32 flags = B_WILL_DRAW | B_FRAME_EVENTS
|
||||
@@ -47,8 +47,8 @@ class BBox : public BView {
|
||||
virtual void DetachedFromWindow();
|
||||
virtual void AllAttached();
|
||||
virtual void AllDetached();
|
||||
virtual void FrameResized(float width, float height);
|
||||
virtual void MessageReceived(BMessage* message);
|
||||
virtual void FrameResized(float width, float height);
|
||||
virtual void MessageReceived(BMessage* message);
|
||||
virtual void MouseDown(BPoint point);
|
||||
virtual void MouseUp(BPoint point);
|
||||
virtual void WindowActivated(bool active);
|
||||
@@ -56,20 +56,21 @@ class BBox : public BView {
|
||||
const BMessage* dragMessage);
|
||||
virtual void FrameMoved(BPoint newLocation);
|
||||
|
||||
virtual BHandler* ResolveSpecifier(BMessage* message,
|
||||
virtual BHandler* ResolveSpecifier(BMessage* message,
|
||||
int32 index, BMessage* specifier,
|
||||
int32 what, const char* property);
|
||||
|
||||
virtual void ResizeToPreferred();
|
||||
virtual void GetPreferredSize(float* _width, float* _height);
|
||||
virtual void MakeFocus(bool focused = true);
|
||||
virtual status_t GetSupportedSuites(BMessage* message);
|
||||
virtual void ResizeToPreferred();
|
||||
virtual void GetPreferredSize(float* _width, float* _height);
|
||||
virtual void MakeFocus(bool focused = true);
|
||||
virtual status_t GetSupportedSuites(BMessage* message);
|
||||
|
||||
virtual status_t Perform(perform_code d, void* arg);
|
||||
virtual status_t Perform(perform_code d, void* arg);
|
||||
|
||||
virtual BSize MinSize();
|
||||
virtual BSize MaxSize();
|
||||
virtual BSize PreferredSize();
|
||||
virtual BAlignment LayoutAlignment();
|
||||
|
||||
protected:
|
||||
virtual void LayoutInvalidated(bool descendants = false);
|
||||
|
||||
@@ -17,9 +17,9 @@ public:
|
||||
uint32 flags = B_WILL_DRAW | B_NAVIGABLE);
|
||||
BCheckBox(const char* name, const char* label,
|
||||
BMessage* message, uint32 flags
|
||||
= B_WILL_DRAW | B_NAVIGABLE);
|
||||
= B_WILL_DRAW | B_NAVIGABLE);
|
||||
BCheckBox(const char* label,
|
||||
BMessage* message = NULL);
|
||||
BMessage* message = NULL);
|
||||
BCheckBox(BMessage* archive);
|
||||
|
||||
virtual ~BCheckBox();
|
||||
@@ -55,6 +55,7 @@ public:
|
||||
virtual BSize MinSize();
|
||||
virtual BSize MaxSize();
|
||||
virtual BSize PreferredSize();
|
||||
virtual BAlignment LayoutAlignment();
|
||||
|
||||
virtual void MakeFocus(bool focused = true);
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2005, Haiku, Inc. All Rights Reserved.
|
||||
* Copyright 2005-2013 Haiku, Inc. All Rights Reserved.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*/
|
||||
#ifndef _COLOR_CONTROL_H
|
||||
@@ -8,8 +8,6 @@
|
||||
|
||||
#include <Control.h>
|
||||
|
||||
class BBitmap;
|
||||
|
||||
|
||||
enum color_control_layout {
|
||||
B_CELLS_4x64 = 4,
|
||||
@@ -19,6 +17,8 @@ enum color_control_layout {
|
||||
B_CELLS_64x4 = 64,
|
||||
};
|
||||
|
||||
|
||||
class BBitmap;
|
||||
class BTextControl;
|
||||
|
||||
|
||||
@@ -93,15 +93,19 @@ private:
|
||||
void _LayoutView();
|
||||
void _InitOffscreen();
|
||||
void _DrawColorArea(BView* target, BRect update);
|
||||
void _DrawSelectors(BView* target);
|
||||
void _ColorRamp(BRect rect, BView* target,
|
||||
rgb_color baseColor, rgb_color compColor,
|
||||
int16 flag, bool focused, BRect update);
|
||||
void _DrawSelectors(BView* target);
|
||||
void _DrawColorRamp(BRect rect, BView* target,
|
||||
rgb_color baseColor, rgb_color compColor,
|
||||
int16 flag, bool focused,
|
||||
BRect updateRect);
|
||||
BPoint _SelectorPosition(const BRect& rampRect,
|
||||
uint8 shade) const;
|
||||
BRect _PaletteSelectorFrame(uint8 colorIndex) const;
|
||||
BRect _PaletteFrame() const;
|
||||
BRect _PaletteSelectorFrame(uint8 colorIndex) const;
|
||||
BRect _RampFrame(uint8 rampIndex) const;
|
||||
|
||||
void _SetCellSize(float size);
|
||||
float _TextRectOffset();
|
||||
|
||||
private:
|
||||
BRect fPaletteFrame;
|
||||
int16 fSelectedPaletteColorIndex;
|
||||
|
||||
@@ -61,7 +61,7 @@ public:
|
||||
virtual status_t Perform(perform_code d, void* argument);
|
||||
|
||||
virtual BSize MaxSize();
|
||||
|
||||
virtual BAlignment LayoutAlignment();
|
||||
|
||||
private:
|
||||
friend status_t _init_interface_kit_();
|
||||
|
||||
@@ -86,6 +86,7 @@ public:
|
||||
virtual BSize MinSize();
|
||||
virtual BSize MaxSize();
|
||||
virtual BSize PreferredSize();
|
||||
virtual BAlignment LayoutAlignment();
|
||||
|
||||
BLayoutItem* CreateLabelLayoutItem();
|
||||
BLayoutItem* CreateTextViewLayoutItem();
|
||||
|
||||
+127
-112
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2001-2012, Haiku, Inc. All rights reserved.
|
||||
* Copyright 2001-2013 Haiku, Inc. All rights reserved.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*/
|
||||
#ifndef _VIEW_H
|
||||
@@ -196,22 +196,22 @@ public:
|
||||
BView* Parent() const;
|
||||
BRect Bounds() const;
|
||||
BRect Frame() const;
|
||||
void ConvertToScreen(BPoint* pt) const;
|
||||
BPoint ConvertToScreen(BPoint pt) const;
|
||||
void ConvertFromScreen(BPoint* pt) const;
|
||||
BPoint ConvertFromScreen(BPoint pt) const;
|
||||
void ConvertToScreen(BRect* r) const;
|
||||
BRect ConvertToScreen(BRect r) const;
|
||||
void ConvertFromScreen(BRect* r) const;
|
||||
BRect ConvertFromScreen(BRect r) const;
|
||||
void ConvertToParent(BPoint* pt) const;
|
||||
BPoint ConvertToParent(BPoint pt) const;
|
||||
void ConvertFromParent(BPoint* pt) const;
|
||||
BPoint ConvertFromParent(BPoint pt) const;
|
||||
void ConvertToParent(BRect* r) const;
|
||||
BRect ConvertToParent(BRect r) const;
|
||||
void ConvertFromParent(BRect* r) const;
|
||||
BRect ConvertFromParent(BRect r) const;
|
||||
void ConvertToScreen(BPoint* point) const;
|
||||
BPoint ConvertToScreen(BPoint point) const;
|
||||
void ConvertFromScreen(BPoint* point) const;
|
||||
BPoint ConvertFromScreen(BPoint point) const;
|
||||
void ConvertToScreen(BRect* rect) const;
|
||||
BRect ConvertToScreen(BRect rect) const;
|
||||
void ConvertFromScreen(BRect* rect) const;
|
||||
BRect ConvertFromScreen(BRect rect) const;
|
||||
void ConvertToParent(BPoint* point) const;
|
||||
BPoint ConvertToParent(BPoint point) const;
|
||||
void ConvertFromParent(BPoint* point) const;
|
||||
BPoint ConvertFromParent(BPoint point) const;
|
||||
void ConvertToParent(BRect* rect) const;
|
||||
BRect ConvertToParent(BRect rect) const;
|
||||
void ConvertFromParent(BRect* rect) const;
|
||||
BRect ConvertFromParent(BRect rect) const;
|
||||
BPoint LeftTop() const;
|
||||
|
||||
void GetClippingRegion(BRegion* region) const;
|
||||
@@ -235,9 +235,9 @@ public:
|
||||
void SetViewCursor(const BCursor* cursor,
|
||||
bool sync = true);
|
||||
|
||||
virtual void SetViewColor(rgb_color c);
|
||||
void SetViewColor(uchar r, uchar g, uchar b,
|
||||
uchar a = 255);
|
||||
virtual void SetViewColor(rgb_color color);
|
||||
void SetViewColor(uchar red, uchar green, uchar blue,
|
||||
uchar alpha = 255);
|
||||
rgb_color ViewColor() const;
|
||||
|
||||
void SetViewBitmap(const BBitmap* bitmap,
|
||||
@@ -264,14 +264,14 @@ public:
|
||||
uint32 options = 0);
|
||||
void ClearViewOverlay();
|
||||
|
||||
virtual void SetHighColor(rgb_color a_color);
|
||||
void SetHighColor(uchar r, uchar g, uchar b,
|
||||
uchar a = 255);
|
||||
virtual void SetHighColor(rgb_color color);
|
||||
void SetHighColor(uchar red, uchar green, uchar blue,
|
||||
uchar alpha = 255);
|
||||
rgb_color HighColor() const;
|
||||
|
||||
virtual void SetLowColor(rgb_color a_color);
|
||||
void SetLowColor(uchar r, uchar g, uchar b,
|
||||
uchar a = 255);
|
||||
virtual void SetLowColor(rgb_color color);
|
||||
void SetLowColor(uchar red, uchar green, uchar blue,
|
||||
uchar alpha = 255);
|
||||
rgb_color LowColor() const;
|
||||
|
||||
void SetLineMode(cap_mode lineCap,
|
||||
@@ -292,110 +292,125 @@ public:
|
||||
void MovePenTo(float x, float y);
|
||||
void MovePenBy(float x, float y);
|
||||
BPoint PenLocation() const;
|
||||
void StrokeLine(BPoint toPt,
|
||||
pattern p = B_SOLID_HIGH);
|
||||
void StrokeLine(BPoint a, BPoint b,
|
||||
pattern p = B_SOLID_HIGH);
|
||||
void StrokeLine(BPoint toPoint,
|
||||
::pattern pattern = B_SOLID_HIGH);
|
||||
void StrokeLine(BPoint start, BPoint end,
|
||||
::pattern pattern = B_SOLID_HIGH);
|
||||
void BeginLineArray(int32 count);
|
||||
void AddLine(BPoint a, BPoint b, rgb_color color);
|
||||
void AddLine(BPoint start, BPoint end,
|
||||
rgb_color color);
|
||||
void EndLineArray();
|
||||
|
||||
void StrokePolygon(const BPolygon* polygon,
|
||||
bool closed = true,
|
||||
pattern p = B_SOLID_HIGH);
|
||||
void StrokePolygon(const BPoint* ptArray,
|
||||
int32 numPts, bool closed = true,
|
||||
pattern p = B_SOLID_HIGH);
|
||||
void StrokePolygon(const BPoint* ptArray,
|
||||
int32 numPts, BRect bounds,
|
||||
::pattern pattern = B_SOLID_HIGH);
|
||||
void StrokePolygon(const BPoint* pointArray,
|
||||
int32 numPoints, bool closed = true,
|
||||
::pattern pattern = B_SOLID_HIGH);
|
||||
void StrokePolygon(const BPoint* pointArray,
|
||||
int32 numPoints, BRect bounds,
|
||||
bool closed = true,
|
||||
pattern p = B_SOLID_HIGH);
|
||||
::pattern pattern = B_SOLID_HIGH);
|
||||
void FillPolygon(const BPolygon* polygon,
|
||||
pattern p = B_SOLID_HIGH);
|
||||
void FillPolygon(const BPoint* ptArray,
|
||||
int32 numPts, pattern p = B_SOLID_HIGH);
|
||||
void FillPolygon(const BPoint* ptArray,
|
||||
int32 numPts, BRect bounds,
|
||||
pattern p = B_SOLID_HIGH);
|
||||
::pattern pattern = B_SOLID_HIGH);
|
||||
void FillPolygon(const BPoint* pointArray,
|
||||
int32 numPoints,
|
||||
::pattern pattern = B_SOLID_HIGH);
|
||||
void FillPolygon(const BPoint* pointArray,
|
||||
int32 numPoints, BRect bounds,
|
||||
::pattern pattern = B_SOLID_HIGH);
|
||||
void FillPolygon(const BPolygon* polygon,
|
||||
const BGradient& gradient);
|
||||
void FillPolygon(const BPoint* ptArray,
|
||||
int32 numPts, const BGradient& gradient);
|
||||
void FillPolygon(const BPoint* ptArray,
|
||||
int32 numPts, BRect bounds,
|
||||
void FillPolygon(const BPoint* pointArray,
|
||||
int32 numPoints, const BGradient& gradient);
|
||||
void FillPolygon(const BPoint* pointArray,
|
||||
int32 numPoints, BRect bounds,
|
||||
const BGradient& gradient);
|
||||
|
||||
void StrokeTriangle(BPoint pt1, BPoint pt2,
|
||||
BPoint pt3, BRect bounds,
|
||||
pattern p = B_SOLID_HIGH);
|
||||
void StrokeTriangle(BPoint pt1, BPoint pt2,
|
||||
BPoint pt3, pattern p = B_SOLID_HIGH);
|
||||
void FillTriangle(BPoint pt1, BPoint pt2,
|
||||
BPoint pt3, pattern p = B_SOLID_HIGH);
|
||||
void FillTriangle(BPoint pt1, BPoint pt2,
|
||||
BPoint pt3, BRect bounds,
|
||||
pattern p = B_SOLID_HIGH);
|
||||
void FillTriangle(BPoint pt1, BPoint pt2,
|
||||
BPoint pt3, const BGradient& gradient);
|
||||
void FillTriangle(BPoint pt1, BPoint pt2,
|
||||
BPoint pt3, BRect bounds,
|
||||
void StrokeTriangle(BPoint point1, BPoint point2,
|
||||
BPoint point3, BRect bounds,
|
||||
::pattern pattern = B_SOLID_HIGH);
|
||||
void StrokeTriangle(BPoint point1, BPoint point2,
|
||||
BPoint point3,
|
||||
::pattern pattern = B_SOLID_HIGH);
|
||||
void FillTriangle(BPoint point1, BPoint point2,
|
||||
BPoint point3,
|
||||
::pattern pattern = B_SOLID_HIGH);
|
||||
void FillTriangle(BPoint point1, BPoint point2,
|
||||
BPoint point3, BRect bounds,
|
||||
::pattern pattern = B_SOLID_HIGH);
|
||||
void FillTriangle(BPoint point1, BPoint point2,
|
||||
BPoint point3, const BGradient& gradient);
|
||||
void FillTriangle(BPoint point1, BPoint point2,
|
||||
BPoint point3, BRect bounds,
|
||||
const BGradient& gradient);
|
||||
|
||||
void StrokeRect(BRect r, pattern p = B_SOLID_HIGH);
|
||||
void FillRect(BRect r, pattern p = B_SOLID_HIGH);
|
||||
void FillRect(BRect r, const BGradient& gradient);
|
||||
void FillRegion(BRegion* region,
|
||||
pattern p = B_SOLID_HIGH);
|
||||
void FillRegion(BRegion* region,
|
||||
void StrokeRect(BRect rect,
|
||||
::pattern pattern = B_SOLID_HIGH);
|
||||
void FillRect(BRect rect,
|
||||
::pattern pattern = B_SOLID_HIGH);
|
||||
void FillRect(BRect rect, const BGradient& gradient);
|
||||
void FillRegion(BRegion* rectegion,
|
||||
::pattern pattern = B_SOLID_HIGH);
|
||||
void FillRegion(BRegion* rectegion,
|
||||
const BGradient& gradient);
|
||||
void InvertRect(BRect r);
|
||||
void InvertRect(BRect rect);
|
||||
|
||||
void StrokeRoundRect(BRect r, float xRadius,
|
||||
float yRadius, pattern p = B_SOLID_HIGH);
|
||||
void FillRoundRect(BRect r, float xRadius,
|
||||
float yRadius, pattern p = B_SOLID_HIGH);
|
||||
void FillRoundRect(BRect r, float xRadius,
|
||||
void StrokeRoundRect(BRect rect, float xRadius,
|
||||
float yRadius,
|
||||
::pattern pattern = B_SOLID_HIGH);
|
||||
void FillRoundRect(BRect rect, float xRadius,
|
||||
float yRadius,
|
||||
::pattern pattern = B_SOLID_HIGH);
|
||||
void FillRoundRect(BRect rect, float xRadius,
|
||||
float yRadius, const BGradient& gradient);
|
||||
|
||||
void StrokeEllipse(BPoint center, float xRadius,
|
||||
float yRadius, pattern p = B_SOLID_HIGH);
|
||||
void StrokeEllipse(BRect r,
|
||||
pattern p = B_SOLID_HIGH);
|
||||
float yRadius,
|
||||
::pattern pattern = B_SOLID_HIGH);
|
||||
void StrokeEllipse(BRect rect,
|
||||
::pattern pattern = B_SOLID_HIGH);
|
||||
void FillEllipse(BPoint center, float xRadius,
|
||||
float yRadius, pattern p = B_SOLID_HIGH);
|
||||
void FillEllipse(BRect r, pattern p = B_SOLID_HIGH);
|
||||
float yRadius,
|
||||
::pattern pattern = B_SOLID_HIGH);
|
||||
void FillEllipse(BRect rect,
|
||||
::pattern pattern = B_SOLID_HIGH);
|
||||
void FillEllipse(BPoint center, float xRadius,
|
||||
float yRadius, const BGradient& gradient);
|
||||
void FillEllipse(BRect r,
|
||||
void FillEllipse(BRect rect,
|
||||
const BGradient& gradient);
|
||||
|
||||
void StrokeArc(BPoint center, float xRadius,
|
||||
float yRadius, float startAngle,
|
||||
float arcAngle, pattern p = B_SOLID_HIGH);
|
||||
void StrokeArc(BRect r, float startAngle,
|
||||
float arcAngle, pattern p = B_SOLID_HIGH);
|
||||
float arcAngle,
|
||||
::pattern pattern = B_SOLID_HIGH);
|
||||
void StrokeArc(BRect rect, float startAngle,
|
||||
float arcAngle,
|
||||
::pattern pattern = B_SOLID_HIGH);
|
||||
void FillArc(BPoint center, float xRadius,
|
||||
float yRadius, float startAngle,
|
||||
float arcAngle, pattern p = B_SOLID_HIGH);
|
||||
void FillArc(BRect r, float startAngle,
|
||||
float arcAngle, pattern p = B_SOLID_HIGH);
|
||||
float arcAngle,
|
||||
::pattern pattern = B_SOLID_HIGH);
|
||||
void FillArc(BRect rect, float startAngle,
|
||||
float arcAngle,
|
||||
::pattern pattern = B_SOLID_HIGH);
|
||||
void FillArc(BPoint center, float xRadius,
|
||||
float yRadius, float startAngle,
|
||||
float arcAngle, const BGradient& gradient);
|
||||
void FillArc(BRect r, float startAngle,
|
||||
void FillArc(BRect rect, float startAngle,
|
||||
float arcAngle, const BGradient& gradient);
|
||||
|
||||
void StrokeBezier(BPoint* controlPoints,
|
||||
pattern p = B_SOLID_HIGH);
|
||||
::pattern pattern = B_SOLID_HIGH);
|
||||
void FillBezier(BPoint* controlPoints,
|
||||
pattern p = B_SOLID_HIGH);
|
||||
::pattern pattern = B_SOLID_HIGH);
|
||||
void FillBezier(BPoint* controlPoints,
|
||||
const BGradient& gradient);
|
||||
|
||||
void StrokeShape(BShape* shape,
|
||||
pattern p = B_SOLID_HIGH);
|
||||
::pattern pattern = B_SOLID_HIGH);
|
||||
void FillShape(BShape* shape,
|
||||
pattern p = B_SOLID_HIGH);
|
||||
::pattern pattern = B_SOLID_HIGH);
|
||||
void FillShape(BShape* shape,
|
||||
const BGradient& gradient);
|
||||
|
||||
@@ -442,7 +457,7 @@ public:
|
||||
const BPoint* locations,
|
||||
int32 locationCount);
|
||||
|
||||
virtual void SetFont(const BFont* font,
|
||||
virtual void SetFont(const BFont* font,
|
||||
uint32 mask = B_FONT_ALL);
|
||||
|
||||
void GetFont(BFont* font) const;
|
||||
@@ -508,22 +523,22 @@ public:
|
||||
void Flush() const;
|
||||
void Sync() const;
|
||||
|
||||
virtual void GetPreferredSize(float* width, float* height);
|
||||
virtual void GetPreferredSize(float* _width, float* _height);
|
||||
virtual void ResizeToPreferred();
|
||||
|
||||
BScrollBar* ScrollBar(orientation posture) const;
|
||||
|
||||
virtual BHandler* ResolveSpecifier(BMessage* msg, int32 index,
|
||||
virtual BHandler* ResolveSpecifier(BMessage* message, int32 index,
|
||||
BMessage* specifier, int32 form,
|
||||
const char* property);
|
||||
virtual status_t GetSupportedSuites(BMessage* data);
|
||||
virtual status_t GetSupportedSuites(BMessage* data);
|
||||
|
||||
bool IsPrinting() const;
|
||||
void SetScale(float scale) const;
|
||||
float Scale() const;
|
||||
// new for Haiku
|
||||
|
||||
virtual status_t Perform(perform_code code, void* data);
|
||||
virtual status_t Perform(perform_code code, void* data);
|
||||
|
||||
virtual void DrawAfterChildren(BRect r);
|
||||
|
||||
@@ -581,7 +596,7 @@ public:
|
||||
void HideToolTip();
|
||||
|
||||
protected:
|
||||
virtual bool GetToolTipAt(BPoint point, BToolTip** _tip);
|
||||
virtual bool GetToolTipAt(BPoint point, BToolTip** _tip);
|
||||
|
||||
virtual void LayoutChanged();
|
||||
|
||||
@@ -720,37 +735,37 @@ BView::ScrollTo(float x, float y)
|
||||
|
||||
|
||||
inline void
|
||||
BView::SetViewColor(uchar r, uchar g, uchar b, uchar a)
|
||||
BView::SetViewColor(uchar red, uchar green, uchar blue, uchar alpha)
|
||||
{
|
||||
rgb_color color;
|
||||
color.red = r;
|
||||
color.green = g;
|
||||
color.blue = b;
|
||||
color.alpha = a;
|
||||
color.red = red;
|
||||
color.green = green;
|
||||
color.blue = blue;
|
||||
color.alpha = alpha;
|
||||
SetViewColor(color);
|
||||
}
|
||||
|
||||
|
||||
inline void
|
||||
BView::SetHighColor(uchar r, uchar g, uchar b, uchar a)
|
||||
BView::SetHighColor(uchar red, uchar green, uchar blue, uchar alpha)
|
||||
{
|
||||
rgb_color color;
|
||||
color.red = r;
|
||||
color.green = g;
|
||||
color.blue = b;
|
||||
color.alpha = a;
|
||||
color.red = red;
|
||||
color.green = green;
|
||||
color.blue = blue;
|
||||
color.alpha = alpha;
|
||||
SetHighColor(color);
|
||||
}
|
||||
|
||||
|
||||
inline void
|
||||
BView::SetLowColor(uchar r, uchar g, uchar b, uchar a)
|
||||
BView::SetLowColor(uchar red, uchar green, uchar blue, uchar alpha)
|
||||
{
|
||||
rgb_color color;
|
||||
color.red = r;
|
||||
color.green = g;
|
||||
color.blue = b;
|
||||
color.alpha = a;
|
||||
color.red = red;
|
||||
color.green = green;
|
||||
color.blue = blue;
|
||||
color.alpha = alpha;
|
||||
SetLowColor(color);
|
||||
}
|
||||
|
||||
|
||||
@@ -85,6 +85,11 @@ typedef struct area_info {
|
||||
/* area protection */
|
||||
#define B_READ_AREA 1
|
||||
#define B_WRITE_AREA 2
|
||||
#define B_EXECUTE_AREA 4
|
||||
#define B_STACK_AREA 8
|
||||
// "stack" protection is not available on most platforms - it's used
|
||||
// to only commit memory as needed, and have guard pages at the
|
||||
// bottom of the stack.
|
||||
|
||||
extern area_id create_area(const char *name, void **startAddress,
|
||||
uint32 addressSpec, size_t size, uint32 lock,
|
||||
|
||||
@@ -487,7 +487,7 @@ typedef struct {
|
||||
typedef struct {
|
||||
debug_origin origin;
|
||||
uint32 syscall; // the syscall number
|
||||
uint32 args[16]; // syscall arguments
|
||||
uint8 args[128]; // syscall arguments
|
||||
} debug_pre_syscall;
|
||||
|
||||
// B_DEBUGGER_MESSAGE_POST_SYSCALL
|
||||
@@ -498,7 +498,7 @@ typedef struct {
|
||||
bigtime_t end_time; // time of syscall completion
|
||||
uint64 return_value; // the syscall's return value
|
||||
uint32 syscall; // the syscall number
|
||||
uint32 args[16]; // syscall arguments
|
||||
uint8 args[128]; // syscall arguments
|
||||
} debug_post_syscall;
|
||||
|
||||
// B_DEBUGGER_MESSAGE_SIGNAL_RECEIVED
|
||||
|
||||
@@ -22,8 +22,9 @@ class AreaKeeper {
|
||||
|
||||
area_id Create(const char *name, void **_virtualAddress, uint32 spec,
|
||||
size_t size, uint32 lock, uint32 protection);
|
||||
area_id Map(const char *name, addr_t physicalAddress, size_t numBytes,
|
||||
uint32 spec, uint32 protection, void **_virtualAddress);
|
||||
area_id Map(const char *name, phys_addr_t physicalAddress,
|
||||
size_t numBytes, uint32 spec, uint32 protection,
|
||||
void **_virtualAddress);
|
||||
|
||||
status_t InitCheck() { return fArea < B_OK ? (status_t)fArea : B_OK; }
|
||||
void Detach();
|
||||
@@ -57,7 +58,7 @@ AreaKeeper::Create(const char *name, void **_virtualAddress, uint32 spec,
|
||||
|
||||
|
||||
area_id
|
||||
AreaKeeper::Map(const char *name, addr_t physicalAddress, size_t numBytes,
|
||||
AreaKeeper::Map(const char *name, phys_addr_t physicalAddress, size_t numBytes,
|
||||
uint32 spec, uint32 protection, void **_virtualAddress)
|
||||
{
|
||||
fArea = map_physical_memory(name, physicalAddress, numBytes, spec,
|
||||
|
||||
@@ -32,10 +32,11 @@
|
||||
|
||||
// Card chipset flags
|
||||
#define CHIP_STD (1 << 0) // Standard chipset
|
||||
#define CHIP_IGP (1 << 1) // IGP chipset
|
||||
#define CHIP_MOBILE (1 << 2) // Mobile chipset
|
||||
#define CHIP_DISCREET (1 << 3) // Discreet chipset
|
||||
#define CHIP_APU (1 << 4) // APU chipset
|
||||
#define CHIP_X2 (1 << 1) // Dual cpu
|
||||
#define CHIP_IGP (1 << 2) // IGP chipset
|
||||
#define CHIP_MOBILE (1 << 3) // Mobile chipset
|
||||
#define CHIP_DISCREET (1 << 4) // Discreet chipset
|
||||
#define CHIP_APU (1 << 5) // APU chipset
|
||||
|
||||
#define DEVICE_NAME "radeon_hd"
|
||||
#define RADEON_ACCELERANT_NAME "radeon_hd.accelerant"
|
||||
@@ -86,16 +87,18 @@ enum radeon_chipset {
|
||||
RADEON_PALM, //Fusion APU (NI), Radeon HD 6000
|
||||
RADEON_SUMO,
|
||||
RADEON_SUMO2,
|
||||
RADEON_CAICOS, //Nothern Islands, Radeon HD 6000
|
||||
RADEON_CAICOS, //Nothern Islands, Radeon HD 6000 / Low end 7000
|
||||
RADEON_TURKS,
|
||||
RADEON_BARTS,
|
||||
RADEON_CAYMAN,
|
||||
RADEON_ANTILLES,
|
||||
RADEON_LOMBOK, //Southern Islands, Radeon HD 7000
|
||||
RADEON_CAPEVERDE,
|
||||
RADEON_CAPEVERDE, //Southern Islands, Radeon HD 7000 aka ARUBA
|
||||
RADEON_BONAIRE,
|
||||
RADEON_PITCAIRN,
|
||||
RADEON_TAHITI,
|
||||
RADEON_NEWZEALAND
|
||||
RADEON_OLAND, //Sea Islands, Radeon HD 8000
|
||||
RADEON_HAINAN, // NO DCE?
|
||||
RADEON_CURACAO,
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -16,6 +16,9 @@
|
||||
#include <MessageFilter.h>
|
||||
|
||||
|
||||
static const float kVMargin = 2.0f;
|
||||
|
||||
|
||||
class BMessageRunner;
|
||||
|
||||
|
||||
@@ -48,6 +51,7 @@ public:
|
||||
virtual void FrameResized(float width, float height);
|
||||
virtual void MessageReceived(BMessage* msg);
|
||||
virtual void MakeFocus(bool focused = true);
|
||||
virtual void SetMaxContentWidth(float width);
|
||||
|
||||
void TogglePopUpMarker(bool show)
|
||||
{ fShowPopUpMarker = show; }
|
||||
@@ -60,7 +64,7 @@ public:
|
||||
private:
|
||||
_BMCMenuBar_&operator=(const _BMCMenuBar_&);
|
||||
|
||||
void _Init(bool setMaxContentWidth);
|
||||
void _Init();
|
||||
|
||||
BMenuField* fMenuField;
|
||||
bool fFixedSize;
|
||||
|
||||
@@ -18,6 +18,8 @@ struct real_time_data;
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
extern int __gABIVersion;
|
||||
|
||||
extern char _single_threaded;
|
||||
/* This determines if a process runs single threaded or not */
|
||||
|
||||
@@ -31,7 +33,7 @@ status_t __flatten_process_args(const char* const* args, int32 argCount,
|
||||
size_t* _flatSize);
|
||||
void _call_atexit_hooks_for_range(addr_t start, addr_t size);
|
||||
void __init_env(const struct user_space_program_args *args);
|
||||
void __init_heap(void);
|
||||
status_t __init_heap(void);
|
||||
void __init_heap_post_env(void);
|
||||
|
||||
void __init_time(addr_t commPageTable);
|
||||
@@ -42,6 +44,8 @@ void __init_pwd_backend(void);
|
||||
void __reinit_pwd_backend_after_fork(void);
|
||||
void* __arch_get_caller(void);
|
||||
|
||||
void __set_stack_protection(void);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -52,6 +52,7 @@ struct rld_export {
|
||||
|
||||
const struct user_space_program_args *program_args;
|
||||
const void* commpage_address;
|
||||
int abi_version;
|
||||
};
|
||||
|
||||
extern struct rld_export *__gRuntimeLoader;
|
||||
|
||||
@@ -0,0 +1,80 @@
|
||||
/*
|
||||
* Copyright 2013, Ingo Weinhold, ingo_weinhold@gmx.de.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*/
|
||||
#ifndef REG_EXP_H
|
||||
#define REG_EXP_H
|
||||
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
|
||||
class RegExp {
|
||||
public:
|
||||
enum PatternType {
|
||||
PATTERN_TYPE_REGULAR_EXPRESSION,
|
||||
PATTERN_TYPE_WILDCARD
|
||||
};
|
||||
|
||||
class MatchResult;
|
||||
|
||||
public:
|
||||
RegExp();
|
||||
RegExp(const char* pattern,
|
||||
PatternType patternType
|
||||
= PATTERN_TYPE_REGULAR_EXPRESSION,
|
||||
bool caseSensitive = true);
|
||||
RegExp(const RegExp& other);
|
||||
~RegExp();
|
||||
|
||||
bool IsValid() const
|
||||
{ return fData != NULL; }
|
||||
|
||||
bool SetPattern(const char* pattern,
|
||||
PatternType patternType
|
||||
= PATTERN_TYPE_REGULAR_EXPRESSION,
|
||||
bool caseSensitive = true);
|
||||
|
||||
MatchResult Match(const char* string) const;
|
||||
|
||||
RegExp& operator=(const RegExp& other);
|
||||
|
||||
private:
|
||||
struct Data;
|
||||
struct MatchResultData;
|
||||
|
||||
private:
|
||||
Data* fData;
|
||||
};
|
||||
|
||||
|
||||
class RegExp::MatchResult {
|
||||
public:
|
||||
MatchResult();
|
||||
MatchResult(const MatchResult& other);
|
||||
~MatchResult();
|
||||
|
||||
bool HasMatched() const;
|
||||
|
||||
size_t StartOffset() const;
|
||||
size_t EndOffset() const;
|
||||
|
||||
size_t GroupCount() const;
|
||||
size_t GroupStartOffsetAt(size_t index) const;
|
||||
size_t GroupEndOffsetAt(size_t index) const;
|
||||
|
||||
MatchResult& operator=(const MatchResult& other);
|
||||
|
||||
private:
|
||||
friend class RegExp;
|
||||
|
||||
private:
|
||||
MatchResult(MatchResultData* data);
|
||||
// takes over the data reference
|
||||
|
||||
private:
|
||||
MatchResultData* fData;
|
||||
};
|
||||
|
||||
|
||||
#endif // REG_EXP_H
|
||||
@@ -15,13 +15,6 @@
|
||||
// Note: the VM probably won't support all combinations - it will try
|
||||
// its best, but create_area() will fail if it has to.
|
||||
// Of course, the exact behaviour will be documented somewhere...
|
||||
#define B_EXECUTE_AREA 0x04
|
||||
#define B_STACK_AREA 0x08
|
||||
// "stack" protection is not available on most platforms - it's used
|
||||
// to only commit memory as needed, and have guard pages at the
|
||||
// bottom of the stack.
|
||||
// "execute" protection is currently ignored, but nevertheless, you
|
||||
// should use it if you require to execute code in that area.
|
||||
|
||||
#define B_KERNEL_EXECUTE_AREA 0x40
|
||||
#define B_KERNEL_STACK_AREA 0x80
|
||||
|
||||
@@ -0,0 +1,123 @@
|
||||
/*
|
||||
* Copyright 2013, Haiku, Inc. All Rights Reserved.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*/
|
||||
#ifndef _VIRTIO_H_
|
||||
#define _VIRTIO_H_
|
||||
|
||||
|
||||
#include <device_manager.h>
|
||||
#include <KernelExport.h>
|
||||
|
||||
|
||||
#define VIRTIO_DEVICE_ID_NETWORK 0x01
|
||||
#define VIRTIO_DEVICE_ID_BLOCK 0x02
|
||||
#define VIRTIO_DEVICE_ID_CONSOLE 0x03
|
||||
#define VIRTIO_DEVICE_ID_ENTROPY 0x04
|
||||
#define VIRTIO_DEVICE_ID_BALLOON 0x05
|
||||
#define VIRTIO_DEVICE_ID_IOMEMORY 0x06
|
||||
#define VIRTIO_DEVICE_ID_RP_MESSAGE 0x07
|
||||
#define VIRTIO_DEVICE_ID_SCSI 0x08
|
||||
#define VIRTIO_DEVICE_ID_9P 0x09
|
||||
#define VIRTIO_DEVICE_ID_RP_SERIAL 0x0b
|
||||
#define VIRTIO_DEVICE_ID_CAIF 0x0c
|
||||
|
||||
#define VIRTIO_FEATURE_TRANSPORT_MASK ((1 << 28) - 1)
|
||||
|
||||
#define VIRTIO_FEATURE_NOTIFY_ON_EMPTY (1 << 24)
|
||||
#define VIRTIO_FEATURE_RING_INDIRECT_DESC (1 << 28)
|
||||
#define VIRTIO_FEATURE_RING_EVENT_IDX (1 << 29)
|
||||
#define VIRTIO_FEATURE_BAD_FEATURE (1 << 30)
|
||||
|
||||
#define VIRTIO_VIRTQUEUES_MAX_COUNT 8
|
||||
|
||||
#define VIRTIO_CONFIG_STATUS_RESET 0x00
|
||||
#define VIRTIO_CONFIG_STATUS_ACK 0x01
|
||||
#define VIRTIO_CONFIG_STATUS_DRIVER 0x02
|
||||
#define VIRTIO_CONFIG_STATUS_DRIVER_OK 0x04
|
||||
#define VIRTIO_CONFIG_STATUS_FAILED 0x80
|
||||
|
||||
// attributes:
|
||||
|
||||
// node type
|
||||
#define VIRTIO_BUS_TYPE_NAME "bus/virtio/v1"
|
||||
// device type (uint16)
|
||||
#define VIRTIO_DEVICE_TYPE_ITEM "virtio/type"
|
||||
// alignment (uint16)
|
||||
#define VIRTIO_VRING_ALIGNMENT_ITEM "virtio/vring_alignment"
|
||||
|
||||
// sim cookie, issued by virtio bus manager
|
||||
typedef void* virtio_sim;
|
||||
// device cookie, issued by virtio bus manager
|
||||
typedef void* virtio_device;
|
||||
// queue cookie, issued by virtio bus manager
|
||||
typedef void* virtio_queue;
|
||||
// callback function for requests
|
||||
typedef void (*virtio_callback_func)(void *cookie);
|
||||
// callback function for interrupts
|
||||
typedef void (*virtio_intr_func)(void *cookie);
|
||||
|
||||
#define VIRTIO_DEVICE_MODULE_NAME "bus_managers/virtio/device/v1"
|
||||
|
||||
typedef struct {
|
||||
driver_module_info info;
|
||||
|
||||
status_t (*queue_interrupt_handler)(virtio_sim sim, uint16 queue);
|
||||
status_t (*config_interrupt_handler)(virtio_sim sim);
|
||||
} virtio_for_controller_interface;
|
||||
|
||||
#define VIRTIO_FOR_CONTROLLER_MODULE_NAME "bus_managers/virtio/controller/driver_v1"
|
||||
|
||||
// Bus manager interface used by Virtio controller drivers.
|
||||
typedef struct {
|
||||
driver_module_info info;
|
||||
|
||||
void (*set_sim)(void* cookie, virtio_sim sim);
|
||||
status_t (*read_host_features)(void* cookie, uint32* features);
|
||||
status_t (*write_guest_features)(void* cookie, uint32 features);
|
||||
uint8 (*get_status)(void* cookie);
|
||||
void (*set_status)(void* cookie, uint8 status);
|
||||
status_t (*read_device_config)(void* cookie, uint8 offset, void* buffer,
|
||||
size_t bufferSize);
|
||||
status_t (*write_device_config)(void* cookie, uint8 offset,
|
||||
const void* buffer, size_t bufferSize);
|
||||
|
||||
uint16 (*get_queue_ring_size)(void* cookie, uint16 queue);
|
||||
status_t (*setup_queue)(void* cookie, uint16 queue, phys_addr_t phy);
|
||||
status_t (*setup_interrupt)(void* cookie);
|
||||
void (*notify_queue)(void* cookie, uint16 queue);
|
||||
} virtio_sim_interface;
|
||||
|
||||
|
||||
// bus manager device interface for peripheral driver
|
||||
typedef struct {
|
||||
driver_module_info info;
|
||||
|
||||
status_t (*negociate_features)(virtio_device cookie, uint32 supported,
|
||||
uint32* negociated, const char* (*get_feature_name)(uint32));
|
||||
|
||||
status_t (*read_device_config)(virtio_device cookie, uint8 offset,
|
||||
void* buffer, size_t bufferSize);
|
||||
status_t (*write_device_config)(virtio_device cookie, uint8 offset,
|
||||
const void* buffer, size_t bufferSize);
|
||||
|
||||
status_t (*alloc_queues)(virtio_device cookie, size_t count,
|
||||
virtio_queue *queues);
|
||||
|
||||
status_t (*setup_interrupt)(virtio_device cookie,
|
||||
virtio_intr_func config_handler, void* configCookie);
|
||||
|
||||
status_t (*queue_request)(virtio_queue queue,
|
||||
const physical_entry *readEntry,
|
||||
const physical_entry *writtenEntry, virtio_callback_func callback,
|
||||
void *callbackCookie);
|
||||
|
||||
status_t (*queue_request_v)(virtio_queue queue,
|
||||
const physical_entry* vector,
|
||||
size_t readVectorCount, size_t writtenVectorCount,
|
||||
virtio_callback_func callback, void *callbackCookie);
|
||||
|
||||
} virtio_device_interface;
|
||||
|
||||
|
||||
#endif /* _VIRTIO_H_ */
|
||||
Reference in New Issue
Block a user