Merge branch 'master' into sam460ex

This commit is contained in:
François Revol
2013-03-28 09:47:50 +01:00
217 changed files with 27841 additions and 15813 deletions
+56 -60
View File
@@ -87,21 +87,21 @@ public:
int32 form, const char* property);
virtual status_t GetSupportedSuites(BMessage* data);
void SetText(const char* inText,
const text_run_array* inRuns = NULL);
void SetText(const char* inText, int32 inLength,
const text_run_array* inRuns = NULL);
void SetText(BFile* inFile,
int32 startOffset, int32 inLength,
const text_run_array* inRuns = NULL);
void SetText(const char* text,
const text_run_array* runs = NULL);
void SetText(const char* text, int32 length,
const text_run_array* runs = NULL);
void SetText(BFile* file, int32 offset,
int32 length,
const text_run_array* runs = NULL);
void Insert(const char* inText,
const text_run_array* inRuns = NULL);
void Insert(const char* inText, int32 inLength,
const text_run_array* inRuns = NULL);
void Insert(int32 startOffset,
const char* inText, int32 inLength,
const text_run_array* inRuns = NULL);
void Insert(const char* text,
const text_run_array* runs = NULL);
void Insert(const char* text, int32 length,
const text_run_array* runs = NULL);
void Insert(int32 offset, const char* text,
int32 length,
const text_run_array* runs = NULL);
void Delete();
void Delete(int32 startOffset, int32 endOffset);
@@ -122,42 +122,40 @@ public:
void Clear();
virtual bool AcceptsPaste(BClipboard* clipboard);
virtual bool AcceptsDrop(const BMessage* inMessage);
virtual bool AcceptsDrop(const BMessage* message);
virtual void Select(int32 startOffset, int32 endOffset);
void SelectAll();
void GetSelection(int32* outStart,
int32* outEnd) const;
void GetSelection(int32* _start, int32* _end) const;
void SetFontAndColor(const BFont* inFont,
uint32 inMode = B_FONT_ALL,
const rgb_color* inColor = NULL);
void SetFontAndColor(const BFont* font,
uint32 mode = B_FONT_ALL,
const rgb_color* color = NULL);
void SetFontAndColor(int32 startOffset,
int32 endOffset, const BFont* inFont,
uint32 inMode = B_FONT_ALL,
const rgb_color* inColor = NULL);
int32 endOffset, const BFont* font,
uint32 mode = B_FONT_ALL,
const rgb_color* color = NULL);
void GetFontAndColor(int32 inOffset, BFont* outFont,
rgb_color* outColor = NULL) const;
void GetFontAndColor(BFont* outFont,
uint32* sameProperties,
rgb_color* outColor = NULL,
bool* sameColor = NULL) const;
void GetFontAndColor(int32 offset, BFont* _font,
rgb_color* _color = NULL) const;
void GetFontAndColor(BFont* _font, uint32* _mode,
rgb_color* _color = NULL,
bool* _sameColor = NULL) const;
void SetRunArray(int32 startOffset, int32 endOffset,
const text_run_array* inRuns);
const text_run_array* runs);
text_run_array* RunArray(int32 startOffset, int32 endOffset,
int32* outSize = NULL) const;
int32* _size = NULL) const;
int32 LineAt(int32 offset) const;
int32 LineAt(BPoint point) const;
BPoint PointAt(int32 inOffset,
float* outHeight = NULL) const;
BPoint PointAt(int32 offset,
float* _height = NULL) const;
int32 OffsetAt(BPoint point) const;
int32 OffsetAt(int32 line) const;
virtual void FindWord(int32 inOffset, int32* outFromOffset,
int32* outToOffset);
virtual void FindWord(int32 offset, int32* _fromOffset,
int32* _toOffset);
virtual bool CanEndLine(int32 offset);
@@ -169,7 +167,7 @@ public:
void GetTextRegion(int32 startOffset,
int32 endOffset, BRegion* outRegion) const;
virtual void ScrollToOffset(int32 inOffset);
virtual void ScrollToOffset(int32 offset);
void ScrollToSelection();
void Highlight(int32 startOffset, int32 endOffset);
@@ -193,9 +191,9 @@ public:
bool DoesWordWrap() const;
void SetMaxBytes(int32 max);
int32 MaxBytes() const;
void DisallowChar(uint32 aChar);
void AllowChar(uint32 aChar);
void SetAlignment(alignment flag);
void DisallowChar(uint32 character);
void AllowChar(uint32 character);
void SetAlignment(alignment align);
alignment Alignment() const;
void SetAutoindent(bool state);
bool DoesAutoindent() const;
@@ -233,15 +231,14 @@ public:
static text_run_array* CopyRunArray(const text_run_array* orig,
int32 countDelta = 0);
static void FreeRunArray(text_run_array* array);
static void* FlattenRunArray(const text_run_array* inArray,
int32* outSize = NULL);
static void* FlattenRunArray(const text_run_array* runArray,
int32* _size = NULL);
static text_run_array* UnflattenRunArray(const void* data,
int32* outSize = NULL);
int32* _size = NULL);
protected:
virtual void InsertText(const char* inText, int32 inLength,
int32 inOffset,
const text_run_array* inRuns);
virtual void InsertText(const char* text, int32 length,
int32 offset, const text_run_array* runs);
virtual void DeleteText(int32 fromOffset, int32 toOffset);
public:
@@ -294,10 +291,10 @@ private:
void _ResetTextRect();
void _HandleBackspace();
void _HandleArrowKey(uint32 inArrowKey,
void _HandleArrowKey(uint32 arrowKey,
bool commandKeyDown = false);
void _HandleDelete();
void _HandlePageKey(uint32 inPageKey,
void _HandlePageKey(uint32 pageKey,
bool commandKeyDown = false);
void _HandleAlphaKey(const char* bytes,
int32 numBytes);
@@ -307,21 +304,20 @@ private:
void _RecalculateLineBreaks(int32* startLine,
int32* endLine);
int32 _FindLineBreak(int32 fromOffset,
float* outAscent, float* outDescent,
float* _ascent, float* _descent,
float* inOutWidth);
float _StyledWidth(int32 fromOffset, int32 length,
float* outAscent = NULL,
float* outDescent = NULL) const;
float* _ascent = NULL,
float* _descent = NULL) const;
float _TabExpandedStyledWidth(int32 offset,
int32 length, float* outAscent = NULL,
float* outDescent = NULL) const;
int32 length, float* _ascent = NULL,
float* _descent = NULL) const;
float _ActualTabWidth(float location) const;
void _DoInsertText(const char* inText,
int32 inLength, int32 inOffset,
const text_run_array* inRuns);
void _DoInsertText(const char* text, int32 length,
int32 offset, const text_run_array* runs);
void _DoDeleteText(int32 fromOffset,
int32 toOffset);
@@ -353,7 +349,7 @@ private:
void _TrackDrag(BPoint where);
void _InitiateDrag();
bool _MessageDropped(BMessage* inMessage,
bool _MessageDropped(BMessage* message,
BPoint where, BPoint offset);
void _PerformAutoScrolling();
@@ -373,13 +369,13 @@ private:
void _NormalizeFont(BFont* font);
void _SetRunArray(int32 startOffset, int32 endOffset,
const text_run_array* inRuns);
const text_run_array* runs);
void _ApplyStyleRange(int32 fromOffset,
int32 toOffset,
uint32 inMode = B_FONT_ALL,
const BFont *inFont = NULL,
const rgb_color *inColor = NULL,
uint32 mode = B_FONT_ALL,
const BFont* font = NULL,
const rgb_color* color = NULL,
bool syncNullStyle = true);
uint32 _CharClassification(int32 offset) const;
+2 -1
View File
@@ -592,7 +592,8 @@ typedef enum cpu_types {
B_CPU_AMD_E_SERIES = 0x5011f2,
// Family 15h
B_CPU_AMD_FX_SERIES = 0x6011f1, /* Bulldozer */
B_CPU_AMD_FX_SERIES_MODEL_1 = 0x6011f1, /* Bulldozer */
B_CPU_AMD_FX_SERIES_MODEL_2 = 0x6011f2,
/* VIA/Cyrix */
B_CPU_CYRIX_x86 = 0x1200,
@@ -30,8 +30,8 @@
// address where the kernel is loaded to: the kernel is loaded in the top 2GB
// of the virtual address space as required by GCC's kernel code model. The
// whole kernel address space is the top 512GB of the address space.
#define KERNEL_BASE 0xffffff8000000000
#define KERNEL_SIZE 0x8000000000
#define KERNEL_BASE 0xffffff0000000000
#define KERNEL_SIZE 0x10000000000
#define KERNEL_TOP (KERNEL_BASE + (KERNEL_SIZE - 1))
#define KERNEL_LOAD_BASE 0xffffffff80000000
+92 -2
View File
@@ -1,5 +1,5 @@
/*
* Copyright 2004-2012, Axel Dörfler, [email protected].
* Copyright 2004-2013, Axel Dörfler, [email protected].
* Distributed under the terms of the MIT License.
*/
@@ -78,6 +78,90 @@ parse_intel(const char* name)
buffer[outIndex] = '\0';
return buffer;
}
static const char*
parse_amd(const char* name)
{
static char buffer[49];
// ignore initial spaces
int index = 0;
for (; name[index] != '\0'; index++) {
if (name[index] != ' ')
break;
}
// Keep an initial "mobile"
int outIndex = 0;
bool spaceWritten = false;
if (!strncasecmp(&name[index], "Mobile ", 7)) {
strcpy(buffer, "Mobile ");
spaceWritten = true;
outIndex += 7;
index += 7;
}
// parse model
for (; name[index] != '\0'; index++) {
if (!strncasecmp(&name[index], "(r)", 3)) {
outIndex += strlcpy(&buffer[outIndex], "®",
sizeof(buffer) - outIndex);
index += 2;
} else if (!strncasecmp(&name[index], "(tm)", 4)) {
outIndex += strlcpy(&buffer[outIndex], "",
sizeof(buffer) - outIndex);
index += 3;
} else if (!strncmp(&name[index], "with ", 5)
|| !strncmp(&name[index], "/w", 2)) {
// Cut off the rest
break;
} else if (name[index] == '-') {
if (!spaceWritten)
buffer[outIndex++] = ' ';
spaceWritten = true;
} else {
const char* kWords[] = {
"Eight-core", "6-core", "Six-core", "Quad-core", "Dual-core",
"Dual core", "Processor", "APU", "AMD", "Intel", "Integrated",
"CyrixInstead", "Advanced Micro Devices", "Comb", "DualCore",
"Technology", "Mobile", "Triple-Core"
};
bool removed = false;
for (size_t i = 0; i < sizeof(kWords) / sizeof(kWords[0]); i++) {
size_t length = strlen(kWords[i]);
if (!strncasecmp(&name[index], kWords[i], length)) {
index += length - 1;
removed = true;
break;
}
}
if (removed)
continue;
if (name[index] == ' ') {
if (spaceWritten)
continue;
spaceWritten = true;
} else
spaceWritten = false;
buffer[outIndex++] = name[index];
}
}
// cut off trailing spaces
while (outIndex > 1 && buffer[outIndex - 1] == ' ')
outIndex--;
buffer[outIndex] = '\0';
// skip new initial spaces
for (outIndex = 0; buffer[outIndex] != '\0'; outIndex++) {
if (buffer[outIndex] != ' ')
break;
}
return buffer + outIndex;
}
#endif
@@ -350,7 +434,8 @@ get_cpu_model_string(system_info *info)
return "C-Series";
case B_CPU_AMD_E_SERIES:
return "E-Series";
case B_CPU_AMD_FX_SERIES:
case B_CPU_AMD_FX_SERIES_MODEL_1:
case B_CPU_AMD_FX_SERIES_MODEL_2:
return "FX-Series";
/* Transmeta */
@@ -405,6 +490,11 @@ get_cpu_model_string(system_info *info)
get_cpuid_model_string(cpuidName);
return parse_intel(cpuidName);
}
if ((info->cpu_type & B_CPU_x86_VENDOR_MASK) == B_CPU_AMD_x86) {
// Fallback to manual parsing of the model string
get_cpuid_model_string(cpuidName);
return parse_amd(cpuidName);
}
return NULL;
#endif /* __INTEL__ || __x86_64__ */
}